身份与资源归属
构造聚合身份或资源归属路径时使用这些类型。它们描述传输字段,不从认证令牌推断身份,也不执行权限检查。下表字段除精确声明标记为可选外均必填;接口不提供运行时默认值。
| 契约 | 含义与约束 |
|---|---|
Identifier.id / Version.version | 通用字符串身份 / 数字版本;不会生成 ID 或验证版本范围。 |
AggregateId | 平铺的 {aggregateId, tenantId, contextName, aggregateName}。关联结果时应匹配四项,仅 ID 字符串不是完整身份。 |
AggregateIdCapable.aggregateId | 嵌套上述完整对象,不要与 AggregateId 中同名的字符串字段混淆。 |
NamedBoundedContext / AliasBoundedContext | contextName 是模型名;contextAlias 是路由别名。Named/AliasAggregate 还要求 aggregateName。 |
OwnerId、TenantId、SpaceIdCapable | 显式字符串归属字段。DEFAULT_OWNER_ID 为 '',不是 FetcherViewer 的默认 (0)。 |
UrlPathParams | 可选 tenant/owner/id 及自定义字符串路径槽位;必须提供所选模板所需的槽位。 |
ResourceAttributionPathSpec | 无归属、租户、所有者及租户+所有者路径前缀;模板不构成授权。 |
AbacTags / AbacTaggable.tags | 每个标签键对应字符串数组;空标签 {},通配值 ['*'];策略含义由服务端定义。 |
ApplyAbacTags / AbacTagsApplied | 含 tags 的命令/事件载荷;不包含本地策略引擎或自动修改行为。 |
Named / DescriptionCapable | 必填 name / description 字符串,不验证格式或非空。 |
发送 HTTP 命令时将身份/路径字段与命令选项组合。保存视图的身份应遵循远端确认规则,不能用 UI 租户过滤代替服务端授权。
精确契约
AbacTagKey
export type AbacTagKey = string;packages/wow/src/types/abac.ts:13
AbacTagValue
export type AbacTagValue = string[];packages/wow/src/types/abac.ts:14
AbacTags
export type AbacTags = Record<AbacTagKey, AbacTagValue>;packages/wow/src/types/abac.ts:15
EMPTY_ABAC_TAGS
declare const EMPTY_ABAC_TAGS: AbacTags;packages/wow/src/types/abac.ts:16
WILDCARD_ABAC_TAG_VALUES
declare const WILDCARD_ABAC_TAG_VALUES: string[];packages/wow/src/types/abac.ts:17
AbacTaggable
export interface AbacTaggable {
tags: AbacTags;
}packages/wow/src/types/abac.ts:19
ApplyAbacTags
export interface ApplyAbacTags extends AbacTaggable {}packages/wow/src/types/abac.ts:24
AbacTagsApplied
export interface AbacTagsApplied extends AbacTaggable {}packages/wow/src/types/abac.ts:27
Identifier
export interface Identifier {
id: string;
}packages/wow/src/types/common.ts:17
Version
export interface Version {
version: number;
}packages/wow/src/types/common.ts:31
UrlPathParams
export interface UrlPathParams {
tenantId?: string;
ownerId?: string;
id?: string;
[key: string]: string | undefined;
}packages/wow/src/types/endpoints.ts:19
ResourceAttributionPathSpec
export enum ResourceAttributionPathSpec {
NONE = '',
TENANT = '/tenant/{tenantId}',
OWNER = '/owner/{ownerId}',
TENANT_OWNER = '/tenant/{tenantId}/owner/{ownerId}',
}packages/wow/src/types/endpoints.ts:57
AggregateNameCapable
export interface AggregateNameCapable {
aggregateName: string;
}packages/wow/src/types/modeling.ts:79
NamedAggregate
export interface NamedAggregate
extends NamedBoundedContext, AggregateNameCapable {}packages/wow/src/types/modeling.ts:89
AliasAggregate
export interface AliasAggregate
extends AliasBoundedContext, AggregateNameCapable {}packages/wow/src/types/modeling.ts:92
AggregateId
export interface AggregateId extends TenantId, NamedAggregate {
aggregateId: string;
}packages/wow/src/types/modeling.ts:98
AggregateIdCapable
export interface AggregateIdCapable {
aggregateId: AggregateId;
}packages/wow/src/types/modeling.ts:109
DEFAULT_OWNER_ID
declare const DEFAULT_OWNER_ID: '';packages/wow/src/types/modeling.ts:129
OwnerId
export interface OwnerId {
ownerId: string;
}packages/wow/src/types/modeling.ts:134
SpaceIdCapable
export interface SpaceIdCapable {
spaceId: string;
}packages/wow/src/types/modeling.ts:141
TenantId
export interface TenantId {
tenantId: string;
}packages/wow/src/types/modeling.ts:158
NamedBoundedContext
export interface NamedBoundedContext {
contextName: string;
}packages/wow/src/types/naming.ts:17
AliasBoundedContext
export interface AliasBoundedContext {
contextAlias: string;
}packages/wow/src/types/naming.ts:21
Named
export interface Named {
name: string;
}packages/wow/src/types/naming.ts:28
DescriptionCapable
export interface DescriptionCapable {
description: string;
}