@ai-matrx/associations 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/README.md +3 -3
- package/dist/core/index.cjs +244 -3
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +67 -3
- package/dist/core/index.d.ts +67 -3
- package/dist/core/index.js +244 -3
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +106 -1
- package/dist/index.d.ts +106 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +537 -53
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +252 -4
- package/dist/react/index.d.ts +252 -4
- package/dist/react/index.js +489 -5
- package/dist/react/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -88,6 +88,43 @@ interface CategoriesEntry {
|
|
|
88
88
|
error: string | null;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/** The author of a comment, denormalized by `cmt_list` from the auth user. */
|
|
92
|
+
interface CommentAuthor {
|
|
93
|
+
email: string | null;
|
|
94
|
+
displayName: string | null;
|
|
95
|
+
avatarUrl: string | null;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* One `platform.comments` row, camelCased (mirrors `cmt_list`'s return).
|
|
99
|
+
* Threading is by `parentId`: a top-level comment has `parentId === null`;
|
|
100
|
+
* a reply points at its parent. `cmt_list` returns rows oldest→newest so
|
|
101
|
+
* callers can build the thread in one pass.
|
|
102
|
+
*/
|
|
103
|
+
interface PlatformComment {
|
|
104
|
+
id: string;
|
|
105
|
+
orgId: string | null;
|
|
106
|
+
entityType: string;
|
|
107
|
+
entityId: string;
|
|
108
|
+
parentId: string | null;
|
|
109
|
+
body: string;
|
|
110
|
+
createdAt: string;
|
|
111
|
+
updatedAt: string;
|
|
112
|
+
createdBy: string | null;
|
|
113
|
+
author: CommentAuthor;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* One cached comment thread (per `${entityType}:${entityId}` endpoint) — the
|
|
117
|
+
* same lifecycle shape as `AssociationsEntry`/`CategoriesEntry`: pending
|
|
118
|
+
* keeps previous comments AND the visible error; `fetchedAt` is the last
|
|
119
|
+
* successful load.
|
|
120
|
+
*/
|
|
121
|
+
interface CommentsEntry {
|
|
122
|
+
status: "idle" | "loading" | "ready" | "error";
|
|
123
|
+
comments: readonly PlatformComment[];
|
|
124
|
+
fetchedAt: number | null;
|
|
125
|
+
error: string | null;
|
|
126
|
+
}
|
|
127
|
+
|
|
91
128
|
/** Per-RPC Args/Returns for every demanded function, straight from the live DB. */
|
|
92
129
|
interface DemandedRpcSignatures {
|
|
93
130
|
assoc_add: {
|
|
@@ -363,6 +400,49 @@ interface DemandedRpcSignatures {
|
|
|
363
400
|
title: string;
|
|
364
401
|
}[];
|
|
365
402
|
};
|
|
403
|
+
cmt_list: {
|
|
404
|
+
Args: {
|
|
405
|
+
p_entity_id: string;
|
|
406
|
+
p_entity_type: string;
|
|
407
|
+
};
|
|
408
|
+
Returns: {
|
|
409
|
+
author_avatar_url: string;
|
|
410
|
+
author_display_name: string;
|
|
411
|
+
author_email: string;
|
|
412
|
+
body: string;
|
|
413
|
+
created_at: string;
|
|
414
|
+
created_by: string;
|
|
415
|
+
entity_id: string;
|
|
416
|
+
entity_type: string;
|
|
417
|
+
id: string;
|
|
418
|
+
organization_id: string;
|
|
419
|
+
parent_id: string;
|
|
420
|
+
updated_at: string;
|
|
421
|
+
}[];
|
|
422
|
+
};
|
|
423
|
+
cmt_add: {
|
|
424
|
+
Args: {
|
|
425
|
+
p_body: string;
|
|
426
|
+
p_entity_id: string;
|
|
427
|
+
p_entity_type: string;
|
|
428
|
+
p_org_id?: string;
|
|
429
|
+
p_parent_id?: string;
|
|
430
|
+
};
|
|
431
|
+
Returns: string;
|
|
432
|
+
};
|
|
433
|
+
cmt_edit: {
|
|
434
|
+
Args: {
|
|
435
|
+
p_body: string;
|
|
436
|
+
p_id: string;
|
|
437
|
+
};
|
|
438
|
+
Returns: undefined;
|
|
439
|
+
};
|
|
440
|
+
cmt_delete: {
|
|
441
|
+
Args: {
|
|
442
|
+
p_id: string;
|
|
443
|
+
};
|
|
444
|
+
Returns: undefined;
|
|
445
|
+
};
|
|
366
446
|
}
|
|
367
447
|
/** The name of any demanded RPC — the only strings the dataSource port accepts. */
|
|
368
448
|
type DemandedRpcName = keyof DemandedRpcSignatures;
|
|
@@ -11179,6 +11259,30 @@ interface EntityDoorProps {
|
|
|
11179
11259
|
name?: string | null;
|
|
11180
11260
|
className?: string;
|
|
11181
11261
|
}
|
|
11262
|
+
/** What the authorDisplay port receives — one comment's denormalized author. */
|
|
11263
|
+
interface AuthorDisplayInput {
|
|
11264
|
+
/** The auth user id (`created_by`), or null on an authorless legacy row. */
|
|
11265
|
+
userId: string | null;
|
|
11266
|
+
email: string | null;
|
|
11267
|
+
displayName: string | null;
|
|
11268
|
+
avatarUrl: string | null;
|
|
11269
|
+
}
|
|
11270
|
+
/**
|
|
11271
|
+
* The author-display seam (W6 comments UI). The package cannot resolve user
|
|
11272
|
+
* profiles itself — `cmt_list` denormalizes email/displayName/avatarUrl per
|
|
11273
|
+
* row, and a host with a richer profile store (presence, current names,
|
|
11274
|
+
* signed avatar URLs) overrides them here. Return `null` (or omit a field)
|
|
11275
|
+
* to keep the denormalized value.
|
|
11276
|
+
*
|
|
11277
|
+
* DEGRADATION (absent port): the RPC's denormalized fields render as-is;
|
|
11278
|
+
* a row with neither displayName nor email shows the package's
|
|
11279
|
+
* "Unknown user" label with the default initial avatar. Never blank, never
|
|
11280
|
+
* a crash.
|
|
11281
|
+
*/
|
|
11282
|
+
type AuthorDisplayPort = (author: AuthorDisplayInput) => {
|
|
11283
|
+
displayName?: string | null;
|
|
11284
|
+
avatarUrl?: string | null;
|
|
11285
|
+
} | null;
|
|
11182
11286
|
/**
|
|
11183
11287
|
* The entity-doors seam (today: `EntityRef` / `EntityDoorControls` /
|
|
11184
11288
|
* access-gate `UnresolvedEntityRef`). Absent → title text plus the overlay's
|
|
@@ -11208,6 +11312,7 @@ interface AssociationsConfig {
|
|
|
11208
11312
|
capture?: CapturePort;
|
|
11209
11313
|
pickerOverrides?: PickerOverrideMap;
|
|
11210
11314
|
entityDoors?: EntityDoorsPort;
|
|
11315
|
+
authorDisplay?: AuthorDisplayPort;
|
|
11211
11316
|
}
|
|
11212
11317
|
|
|
11213
|
-
export { ASSOCIATION_TARGET_TYPES, type AssociationEdge, type AssociationPickerProps, type AssociationSourceEdge, type AssociationTargetEdge, type AssociationTargetType, type AssociationsConfig, type AssociationsDataSource, type AssociationsEntry, type AssociationsIdentity, type AssociationsNotifier, type AssociationsRpcError, type AssociationsRpcErrorCode, type AssociationsRpcResult, type CapturePickOpts, type CapturePort, type CaptureUploadOpts, type CaptureUploadResult, type CategoriesEntry, type CategoryDimension, type ComponentEntityToken, DEMANDED_RPC_NAMES, type DemandedRpcArgs, type DemandedRpcName, type DemandedRpcReturns, type DemandedRpcSignatures, ENTITY_TYPE_METADATA, ENTITY_TYPE_TOKENS, type EntityDoorProps, type EntityDoorsPort, type EntityOverlayEntry, type EntityOverlayMap, type EntityRefProps, type EntityTypeMeta, type EntityTypeToken, type ErrorSink, type ListedEntityToken, type ModuleEntityToken, type PgError, type PickerOverrideMap, type PlatformCategory, REFERENCE_CATEGORY_DISPLAY, type ReferencePickableEntityToken, SCHEMA_DISPLAY, type ScopeableEntityToken, type UserEntityState, type UserStateKind, type WindowShellPort, isAssociationsRpcErr, isEntityTypeToken };
|
|
11318
|
+
export { ASSOCIATION_TARGET_TYPES, type AssociationEdge, type AssociationPickerProps, type AssociationSourceEdge, type AssociationTargetEdge, type AssociationTargetType, type AssociationsConfig, type AssociationsDataSource, type AssociationsEntry, type AssociationsIdentity, type AssociationsNotifier, type AssociationsRpcError, type AssociationsRpcErrorCode, type AssociationsRpcResult, type AuthorDisplayInput, type AuthorDisplayPort, type CapturePickOpts, type CapturePort, type CaptureUploadOpts, type CaptureUploadResult, type CategoriesEntry, type CategoryDimension, type CommentAuthor, type CommentsEntry, type ComponentEntityToken, DEMANDED_RPC_NAMES, type DemandedRpcArgs, type DemandedRpcName, type DemandedRpcReturns, type DemandedRpcSignatures, ENTITY_TYPE_METADATA, ENTITY_TYPE_TOKENS, type EntityDoorProps, type EntityDoorsPort, type EntityOverlayEntry, type EntityOverlayMap, type EntityRefProps, type EntityTypeMeta, type EntityTypeToken, type ErrorSink, type ListedEntityToken, type ModuleEntityToken, type PgError, type PickerOverrideMap, type PlatformCategory, type PlatformComment, REFERENCE_CATEGORY_DISPLAY, type ReferencePickableEntityToken, SCHEMA_DISPLAY, type ScopeableEntityToken, type UserEntityState, type UserStateKind, type WindowShellPort, isAssociationsRpcErr, isEntityTypeToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -88,6 +88,43 @@ interface CategoriesEntry {
|
|
|
88
88
|
error: string | null;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/** The author of a comment, denormalized by `cmt_list` from the auth user. */
|
|
92
|
+
interface CommentAuthor {
|
|
93
|
+
email: string | null;
|
|
94
|
+
displayName: string | null;
|
|
95
|
+
avatarUrl: string | null;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* One `platform.comments` row, camelCased (mirrors `cmt_list`'s return).
|
|
99
|
+
* Threading is by `parentId`: a top-level comment has `parentId === null`;
|
|
100
|
+
* a reply points at its parent. `cmt_list` returns rows oldest→newest so
|
|
101
|
+
* callers can build the thread in one pass.
|
|
102
|
+
*/
|
|
103
|
+
interface PlatformComment {
|
|
104
|
+
id: string;
|
|
105
|
+
orgId: string | null;
|
|
106
|
+
entityType: string;
|
|
107
|
+
entityId: string;
|
|
108
|
+
parentId: string | null;
|
|
109
|
+
body: string;
|
|
110
|
+
createdAt: string;
|
|
111
|
+
updatedAt: string;
|
|
112
|
+
createdBy: string | null;
|
|
113
|
+
author: CommentAuthor;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* One cached comment thread (per `${entityType}:${entityId}` endpoint) — the
|
|
117
|
+
* same lifecycle shape as `AssociationsEntry`/`CategoriesEntry`: pending
|
|
118
|
+
* keeps previous comments AND the visible error; `fetchedAt` is the last
|
|
119
|
+
* successful load.
|
|
120
|
+
*/
|
|
121
|
+
interface CommentsEntry {
|
|
122
|
+
status: "idle" | "loading" | "ready" | "error";
|
|
123
|
+
comments: readonly PlatformComment[];
|
|
124
|
+
fetchedAt: number | null;
|
|
125
|
+
error: string | null;
|
|
126
|
+
}
|
|
127
|
+
|
|
91
128
|
/** Per-RPC Args/Returns for every demanded function, straight from the live DB. */
|
|
92
129
|
interface DemandedRpcSignatures {
|
|
93
130
|
assoc_add: {
|
|
@@ -363,6 +400,49 @@ interface DemandedRpcSignatures {
|
|
|
363
400
|
title: string;
|
|
364
401
|
}[];
|
|
365
402
|
};
|
|
403
|
+
cmt_list: {
|
|
404
|
+
Args: {
|
|
405
|
+
p_entity_id: string;
|
|
406
|
+
p_entity_type: string;
|
|
407
|
+
};
|
|
408
|
+
Returns: {
|
|
409
|
+
author_avatar_url: string;
|
|
410
|
+
author_display_name: string;
|
|
411
|
+
author_email: string;
|
|
412
|
+
body: string;
|
|
413
|
+
created_at: string;
|
|
414
|
+
created_by: string;
|
|
415
|
+
entity_id: string;
|
|
416
|
+
entity_type: string;
|
|
417
|
+
id: string;
|
|
418
|
+
organization_id: string;
|
|
419
|
+
parent_id: string;
|
|
420
|
+
updated_at: string;
|
|
421
|
+
}[];
|
|
422
|
+
};
|
|
423
|
+
cmt_add: {
|
|
424
|
+
Args: {
|
|
425
|
+
p_body: string;
|
|
426
|
+
p_entity_id: string;
|
|
427
|
+
p_entity_type: string;
|
|
428
|
+
p_org_id?: string;
|
|
429
|
+
p_parent_id?: string;
|
|
430
|
+
};
|
|
431
|
+
Returns: string;
|
|
432
|
+
};
|
|
433
|
+
cmt_edit: {
|
|
434
|
+
Args: {
|
|
435
|
+
p_body: string;
|
|
436
|
+
p_id: string;
|
|
437
|
+
};
|
|
438
|
+
Returns: undefined;
|
|
439
|
+
};
|
|
440
|
+
cmt_delete: {
|
|
441
|
+
Args: {
|
|
442
|
+
p_id: string;
|
|
443
|
+
};
|
|
444
|
+
Returns: undefined;
|
|
445
|
+
};
|
|
366
446
|
}
|
|
367
447
|
/** The name of any demanded RPC — the only strings the dataSource port accepts. */
|
|
368
448
|
type DemandedRpcName = keyof DemandedRpcSignatures;
|
|
@@ -11179,6 +11259,30 @@ interface EntityDoorProps {
|
|
|
11179
11259
|
name?: string | null;
|
|
11180
11260
|
className?: string;
|
|
11181
11261
|
}
|
|
11262
|
+
/** What the authorDisplay port receives — one comment's denormalized author. */
|
|
11263
|
+
interface AuthorDisplayInput {
|
|
11264
|
+
/** The auth user id (`created_by`), or null on an authorless legacy row. */
|
|
11265
|
+
userId: string | null;
|
|
11266
|
+
email: string | null;
|
|
11267
|
+
displayName: string | null;
|
|
11268
|
+
avatarUrl: string | null;
|
|
11269
|
+
}
|
|
11270
|
+
/**
|
|
11271
|
+
* The author-display seam (W6 comments UI). The package cannot resolve user
|
|
11272
|
+
* profiles itself — `cmt_list` denormalizes email/displayName/avatarUrl per
|
|
11273
|
+
* row, and a host with a richer profile store (presence, current names,
|
|
11274
|
+
* signed avatar URLs) overrides them here. Return `null` (or omit a field)
|
|
11275
|
+
* to keep the denormalized value.
|
|
11276
|
+
*
|
|
11277
|
+
* DEGRADATION (absent port): the RPC's denormalized fields render as-is;
|
|
11278
|
+
* a row with neither displayName nor email shows the package's
|
|
11279
|
+
* "Unknown user" label with the default initial avatar. Never blank, never
|
|
11280
|
+
* a crash.
|
|
11281
|
+
*/
|
|
11282
|
+
type AuthorDisplayPort = (author: AuthorDisplayInput) => {
|
|
11283
|
+
displayName?: string | null;
|
|
11284
|
+
avatarUrl?: string | null;
|
|
11285
|
+
} | null;
|
|
11182
11286
|
/**
|
|
11183
11287
|
* The entity-doors seam (today: `EntityRef` / `EntityDoorControls` /
|
|
11184
11288
|
* access-gate `UnresolvedEntityRef`). Absent → title text plus the overlay's
|
|
@@ -11208,6 +11312,7 @@ interface AssociationsConfig {
|
|
|
11208
11312
|
capture?: CapturePort;
|
|
11209
11313
|
pickerOverrides?: PickerOverrideMap;
|
|
11210
11314
|
entityDoors?: EntityDoorsPort;
|
|
11315
|
+
authorDisplay?: AuthorDisplayPort;
|
|
11211
11316
|
}
|
|
11212
11317
|
|
|
11213
|
-
export { ASSOCIATION_TARGET_TYPES, type AssociationEdge, type AssociationPickerProps, type AssociationSourceEdge, type AssociationTargetEdge, type AssociationTargetType, type AssociationsConfig, type AssociationsDataSource, type AssociationsEntry, type AssociationsIdentity, type AssociationsNotifier, type AssociationsRpcError, type AssociationsRpcErrorCode, type AssociationsRpcResult, type CapturePickOpts, type CapturePort, type CaptureUploadOpts, type CaptureUploadResult, type CategoriesEntry, type CategoryDimension, type ComponentEntityToken, DEMANDED_RPC_NAMES, type DemandedRpcArgs, type DemandedRpcName, type DemandedRpcReturns, type DemandedRpcSignatures, ENTITY_TYPE_METADATA, ENTITY_TYPE_TOKENS, type EntityDoorProps, type EntityDoorsPort, type EntityOverlayEntry, type EntityOverlayMap, type EntityRefProps, type EntityTypeMeta, type EntityTypeToken, type ErrorSink, type ListedEntityToken, type ModuleEntityToken, type PgError, type PickerOverrideMap, type PlatformCategory, REFERENCE_CATEGORY_DISPLAY, type ReferencePickableEntityToken, SCHEMA_DISPLAY, type ScopeableEntityToken, type UserEntityState, type UserStateKind, type WindowShellPort, isAssociationsRpcErr, isEntityTypeToken };
|
|
11318
|
+
export { ASSOCIATION_TARGET_TYPES, type AssociationEdge, type AssociationPickerProps, type AssociationSourceEdge, type AssociationTargetEdge, type AssociationTargetType, type AssociationsConfig, type AssociationsDataSource, type AssociationsEntry, type AssociationsIdentity, type AssociationsNotifier, type AssociationsRpcError, type AssociationsRpcErrorCode, type AssociationsRpcResult, type AuthorDisplayInput, type AuthorDisplayPort, type CapturePickOpts, type CapturePort, type CaptureUploadOpts, type CaptureUploadResult, type CategoriesEntry, type CategoryDimension, type CommentAuthor, type CommentsEntry, type ComponentEntityToken, DEMANDED_RPC_NAMES, type DemandedRpcArgs, type DemandedRpcName, type DemandedRpcReturns, type DemandedRpcSignatures, ENTITY_TYPE_METADATA, ENTITY_TYPE_TOKENS, type EntityDoorProps, type EntityDoorsPort, type EntityOverlayEntry, type EntityOverlayMap, type EntityRefProps, type EntityTypeMeta, type EntityTypeToken, type ErrorSink, type ListedEntityToken, type ModuleEntityToken, type PgError, type PickerOverrideMap, type PlatformCategory, type PlatformComment, REFERENCE_CATEGORY_DISPLAY, type ReferencePickableEntityToken, SCHEMA_DISPLAY, type ScopeableEntityToken, type UserEntityState, type UserStateKind, type WindowShellPort, isAssociationsRpcErr, isEntityTypeToken };
|
package/dist/index.js
CHANGED
|
@@ -1447,7 +1447,11 @@ var DEMANDED_RPC_NAMES = [
|
|
|
1447
1447
|
"ues_list",
|
|
1448
1448
|
"ues_get_bulk",
|
|
1449
1449
|
"ues_touch",
|
|
1450
|
-
"reference_search_candidates"
|
|
1450
|
+
"reference_search_candidates",
|
|
1451
|
+
"cmt_list",
|
|
1452
|
+
"cmt_add",
|
|
1453
|
+
"cmt_edit",
|
|
1454
|
+
"cmt_delete"
|
|
1451
1455
|
];
|
|
1452
1456
|
export {
|
|
1453
1457
|
ASSOCIATION_TARGET_TYPES,
|