@memberjunction/core-entities 6.3.0-edge.0 → 6.3.0-edge.2

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.
Files changed (193) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/custom/AnchoredConversationSecurity.d.ts +10 -1
  3. package/dist/custom/AnchoredConversationSecurity.d.ts.map +1 -1
  4. package/dist/custom/AnchoredConversationSecurity.js +15 -0
  5. package/dist/custom/AnchoredConversationSecurity.js.map +1 -1
  6. package/dist/custom/ArtifactLockValidation.d.ts +28 -0
  7. package/dist/custom/ArtifactLockValidation.d.ts.map +1 -0
  8. package/dist/custom/ArtifactLockValidation.js +867 -0
  9. package/dist/custom/ArtifactLockValidation.js.map +1 -0
  10. package/dist/custom/ArtifactPermissionDelegate.d.ts +288 -0
  11. package/dist/custom/ArtifactPermissionDelegate.d.ts.map +1 -0
  12. package/dist/custom/ArtifactPermissionDelegate.js +1779 -0
  13. package/dist/custom/ArtifactPermissionDelegate.js.map +1 -0
  14. package/dist/custom/ArtifactPreviewSnapshot.d.ts +199 -0
  15. package/dist/custom/ArtifactPreviewSnapshot.d.ts.map +1 -0
  16. package/dist/custom/ArtifactPreviewSnapshot.js +772 -0
  17. package/dist/custom/ArtifactPreviewSnapshot.js.map +1 -0
  18. package/dist/custom/ArtifactSynthesisEngine.d.ts +151 -0
  19. package/dist/custom/ArtifactSynthesisEngine.d.ts.map +1 -0
  20. package/dist/custom/ArtifactSynthesisEngine.js +1124 -0
  21. package/dist/custom/ArtifactSynthesisEngine.js.map +1 -0
  22. package/dist/custom/ConversationWriteAccess.d.ts +36 -0
  23. package/dist/custom/ConversationWriteAccess.d.ts.map +1 -1
  24. package/dist/custom/ConversationWriteAccess.js +109 -1
  25. package/dist/custom/ConversationWriteAccess.js.map +1 -1
  26. package/dist/custom/DocumentLiveBlockEngine.d.ts +612 -0
  27. package/dist/custom/DocumentLiveBlockEngine.d.ts.map +1 -0
  28. package/dist/custom/DocumentLiveBlockEngine.js +2352 -0
  29. package/dist/custom/DocumentLiveBlockEngine.js.map +1 -0
  30. package/dist/custom/MJQueryEntityExtended.d.ts.map +1 -1
  31. package/dist/custom/MJQueryEntityExtended.js +27 -11
  32. package/dist/custom/MJQueryEntityExtended.js.map +1 -1
  33. package/dist/custom/PermissionProviders/ArtifactPermissionProvider.d.ts.map +1 -1
  34. package/dist/custom/PermissionProviders/ArtifactPermissionProvider.js +31 -7
  35. package/dist/custom/PermissionProviders/ArtifactPermissionProvider.js.map +1 -1
  36. package/dist/custom/PermissionProviders/CollectionPermissionProvider.d.ts +3 -4
  37. package/dist/custom/PermissionProviders/CollectionPermissionProvider.d.ts.map +1 -1
  38. package/dist/custom/PermissionProviders/CollectionPermissionProvider.js +334 -47
  39. package/dist/custom/PermissionProviders/CollectionPermissionProvider.js.map +1 -1
  40. package/dist/custom/Permissions/BaseShareEntityExtended.d.ts +28 -3
  41. package/dist/custom/Permissions/BaseShareEntityExtended.d.ts.map +1 -1
  42. package/dist/custom/Permissions/BaseShareEntityExtended.js +150 -13
  43. package/dist/custom/Permissions/BaseShareEntityExtended.js.map +1 -1
  44. package/dist/custom/Permissions/MJArtifactPermissionEntityExtended.d.ts +8 -6
  45. package/dist/custom/Permissions/MJArtifactPermissionEntityExtended.d.ts.map +1 -1
  46. package/dist/custom/Permissions/MJArtifactPermissionEntityExtended.js +107 -43
  47. package/dist/custom/Permissions/MJArtifactPermissionEntityExtended.js.map +1 -1
  48. package/dist/custom/Permissions/MJCollectionPermissionEntityExtended.d.ts +13 -5
  49. package/dist/custom/Permissions/MJCollectionPermissionEntityExtended.d.ts.map +1 -1
  50. package/dist/custom/Permissions/MJCollectionPermissionEntityExtended.js +284 -49
  51. package/dist/custom/Permissions/MJCollectionPermissionEntityExtended.js.map +1 -1
  52. package/dist/custom/Permissions/MJDashboardPermissionEntityExtended.d.ts +3 -1
  53. package/dist/custom/Permissions/MJDashboardPermissionEntityExtended.d.ts.map +1 -1
  54. package/dist/custom/Permissions/MJDashboardPermissionEntityExtended.js +83 -19
  55. package/dist/custom/Permissions/MJDashboardPermissionEntityExtended.js.map +1 -1
  56. package/dist/custom/Permissions/shareNotification.d.ts +14 -1
  57. package/dist/custom/Permissions/shareNotification.d.ts.map +1 -1
  58. package/dist/custom/Permissions/shareNotification.js +62 -8
  59. package/dist/custom/Permissions/shareNotification.js.map +1 -1
  60. package/dist/custom/ResourcePermissions/MJResourcePermissionEntityExtended.d.ts.map +1 -1
  61. package/dist/custom/ResourcePermissions/MJResourcePermissionEntityExtended.js +120 -38
  62. package/dist/custom/ResourcePermissions/MJResourcePermissionEntityExtended.js.map +1 -1
  63. package/dist/custom/SlideDeckEngine.d.ts +469 -0
  64. package/dist/custom/SlideDeckEngine.d.ts.map +1 -0
  65. package/dist/custom/SlideDeckEngine.js +2168 -0
  66. package/dist/custom/SlideDeckEngine.js.map +1 -0
  67. package/dist/custom/SlideDeckPptxEngine.d.ts +25 -0
  68. package/dist/custom/SlideDeckPptxEngine.d.ts.map +1 -0
  69. package/dist/custom/SlideDeckPptxEngine.js +1311 -0
  70. package/dist/custom/SlideDeckPptxEngine.js.map +1 -0
  71. package/dist/custom/SpreadsheetEngine.d.ts +1377 -0
  72. package/dist/custom/SpreadsheetEngine.d.ts.map +1 -0
  73. package/dist/custom/SpreadsheetEngine.js +17652 -0
  74. package/dist/custom/SpreadsheetEngine.js.map +1 -0
  75. package/dist/custom/approvals.d.ts +31 -1
  76. package/dist/custom/approvals.d.ts.map +1 -1
  77. package/dist/custom/approvals.js +42 -2
  78. package/dist/custom/approvals.js.map +1 -1
  79. package/dist/custom/operations/ArtifactComplianceAuditOperation.d.ts +7 -0
  80. package/dist/custom/operations/ArtifactComplianceAuditOperation.d.ts.map +1 -0
  81. package/dist/custom/operations/ArtifactComplianceAuditOperation.js +7 -0
  82. package/dist/custom/operations/ArtifactComplianceAuditOperation.js.map +1 -0
  83. package/dist/custom/operations/ArtifactEvaluateAiFormulaOperation.d.ts +7 -0
  84. package/dist/custom/operations/ArtifactEvaluateAiFormulaOperation.d.ts.map +1 -0
  85. package/dist/custom/operations/ArtifactEvaluateAiFormulaOperation.js +7 -0
  86. package/dist/custom/operations/ArtifactEvaluateAiFormulaOperation.js.map +1 -0
  87. package/dist/custom/operations/ArtifactGuestShareOperations.d.ts +60 -0
  88. package/dist/custom/operations/ArtifactGuestShareOperations.d.ts.map +1 -0
  89. package/dist/custom/operations/ArtifactGuestShareOperations.js +6 -0
  90. package/dist/custom/operations/ArtifactGuestShareOperations.js.map +1 -0
  91. package/dist/custom/operations/SynthesizeArtifactFromSourcesOperation.d.ts +7 -0
  92. package/dist/custom/operations/SynthesizeArtifactFromSourcesOperation.d.ts.map +1 -0
  93. package/dist/custom/operations/SynthesizeArtifactFromSourcesOperation.js +7 -0
  94. package/dist/custom/operations/SynthesizeArtifactFromSourcesOperation.js.map +1 -0
  95. package/dist/custom/typedQuery.d.ts +162 -0
  96. package/dist/custom/typedQuery.d.ts.map +1 -0
  97. package/dist/custom/typedQuery.js +296 -0
  98. package/dist/custom/typedQuery.js.map +1 -0
  99. package/dist/engines/CanonGraphEngine.d.ts +115 -2
  100. package/dist/engines/CanonGraphEngine.d.ts.map +1 -1
  101. package/dist/engines/CanonGraphEngine.js +259 -34
  102. package/dist/engines/CanonGraphEngine.js.map +1 -1
  103. package/dist/engines/EncryptionEngineBase.js +2 -2
  104. package/dist/engines/EncryptionEngineBase.js.map +1 -1
  105. package/dist/engines/QueryEngine.js +2 -2
  106. package/dist/engines/QueryEngine.js.map +1 -1
  107. package/dist/engines/SearchEngineBase.d.ts +17 -3
  108. package/dist/engines/SearchEngineBase.d.ts.map +1 -1
  109. package/dist/engines/SearchEngineBase.js +100 -28
  110. package/dist/engines/SearchEngineBase.js.map +1 -1
  111. package/dist/engines/UserInfoEngine.d.ts +8 -0
  112. package/dist/engines/UserInfoEngine.d.ts.map +1 -1
  113. package/dist/engines/UserInfoEngine.js +50 -3
  114. package/dist/engines/UserInfoEngine.js.map +1 -1
  115. package/dist/engines/conversations.d.ts +74 -6
  116. package/dist/engines/conversations.d.ts.map +1 -1
  117. package/dist/engines/conversations.js +205 -24
  118. package/dist/engines/conversations.js.map +1 -1
  119. package/dist/generated/entities/__mj.d.ts +25652 -43408
  120. package/dist/generated/entities/__mj.d.ts.map +1 -1
  121. package/dist/generated/entities/__mj.js +50800 -83602
  122. package/dist/generated/entities/__mj.js.map +1 -1
  123. package/dist/generated/queries/__mj.d.ts +12 -12
  124. package/dist/generated/queries/__mj.d.ts.map +1 -1
  125. package/dist/generated/queries/__mj.js +1 -1
  126. package/dist/generated/queries/__mj.js.map +1 -1
  127. package/dist/generated/remote_operations.d.ts +970 -65
  128. package/dist/generated/remote_operations.d.ts.map +1 -1
  129. package/dist/generated/remote_operations.js +343 -8
  130. package/dist/generated/remote_operations.js.map +1 -1
  131. package/dist/generated/schemas/__mj.d.ts +27415 -0
  132. package/dist/generated/schemas/__mj.d.ts.map +1 -0
  133. package/dist/generated/schemas/__mj.js +45127 -0
  134. package/dist/generated/schemas/__mj.js.map +1 -0
  135. package/dist/generated/schemas.d.ts +2 -0
  136. package/dist/generated/schemas.d.ts.map +1 -0
  137. package/dist/generated/schemas.js +2 -0
  138. package/dist/generated/schemas.js.map +1 -0
  139. package/dist/graph/BaseGraphEdgeProvider.d.ts +33 -1
  140. package/dist/graph/BaseGraphEdgeProvider.d.ts.map +1 -1
  141. package/dist/graph/BaseGraphEdgeProvider.js +18 -3
  142. package/dist/graph/BaseGraphEdgeProvider.js.map +1 -1
  143. package/dist/graph/CanonDocumentRenderer.d.ts +43 -0
  144. package/dist/graph/CanonDocumentRenderer.d.ts.map +1 -0
  145. package/dist/graph/CanonDocumentRenderer.js +627 -0
  146. package/dist/graph/CanonDocumentRenderer.js.map +1 -0
  147. package/dist/graph/DomainClustering.d.ts +88 -0
  148. package/dist/graph/DomainClustering.d.ts.map +1 -0
  149. package/dist/graph/DomainClustering.js +327 -0
  150. package/dist/graph/DomainClustering.js.map +1 -0
  151. package/dist/graph/DomainProposalWriter.d.ts +25 -0
  152. package/dist/graph/DomainProposalWriter.d.ts.map +1 -0
  153. package/dist/graph/DomainProposalWriter.js +107 -0
  154. package/dist/graph/DomainProposalWriter.js.map +1 -0
  155. package/dist/graph/GraphAccessPolicy.d.ts +111 -0
  156. package/dist/graph/GraphAccessPolicy.d.ts.map +1 -0
  157. package/dist/graph/GraphAccessPolicy.js +123 -0
  158. package/dist/graph/GraphAccessPolicy.js.map +1 -0
  159. package/dist/graph/GraphEngine.d.ts +115 -7
  160. package/dist/graph/GraphEngine.d.ts.map +1 -1
  161. package/dist/graph/GraphEngine.js +432 -36
  162. package/dist/graph/GraphEngine.js.map +1 -1
  163. package/dist/graph/RecordRelations.d.ts +52 -0
  164. package/dist/graph/RecordRelations.d.ts.map +1 -0
  165. package/dist/graph/RecordRelations.js +90 -0
  166. package/dist/graph/RecordRelations.js.map +1 -0
  167. package/dist/graph/index.d.ts +9 -1
  168. package/dist/graph/index.d.ts.map +1 -1
  169. package/dist/graph/index.js +13 -1
  170. package/dist/graph/index.js.map +1 -1
  171. package/dist/graph/policies/ProvenanceAccessPolicies.d.ts +56 -0
  172. package/dist/graph/policies/ProvenanceAccessPolicies.d.ts.map +1 -0
  173. package/dist/graph/policies/ProvenanceAccessPolicies.js +228 -0
  174. package/dist/graph/policies/ProvenanceAccessPolicies.js.map +1 -0
  175. package/dist/graph/providers/QueryEdgeProvider.d.ts.map +1 -1
  176. package/dist/graph/providers/QueryEdgeProvider.js +2 -2
  177. package/dist/graph/providers/QueryEdgeProvider.js.map +1 -1
  178. package/dist/graph/providers/RecordLinkEdgeProvider.d.ts.map +1 -1
  179. package/dist/graph/providers/RecordLinkEdgeProvider.js +2 -2
  180. package/dist/graph/providers/RecordLinkEdgeProvider.js.map +1 -1
  181. package/dist/graph/providers/SharedConceptEdgeProvider.d.ts +54 -0
  182. package/dist/graph/providers/SharedConceptEdgeProvider.d.ts.map +1 -0
  183. package/dist/graph/providers/SharedConceptEdgeProvider.js +282 -0
  184. package/dist/graph/providers/SharedConceptEdgeProvider.js.map +1 -0
  185. package/dist/index.d.ts +12 -0
  186. package/dist/index.d.ts.map +1 -1
  187. package/dist/index.js +18 -0
  188. package/dist/index.js.map +1 -1
  189. package/dist/schemas.d.ts +6 -0
  190. package/dist/schemas.d.ts.map +1 -0
  191. package/dist/schemas.js +6 -0
  192. package/dist/schemas.js.map +1 -0
  193. package/package.json +17 -6
@@ -0,0 +1,107 @@
1
+ import { RunInEntityTransaction } from '@memberjunction/core';
2
+ import { UUIDsEqual } from '@memberjunction/global';
3
+ import { GraphEngine } from './GraphEngine.js';
4
+ const CONCEPT_ENTITY = 'MJ: Graph Concepts';
5
+ const EDGE_ENTITY = 'MJ: Graph Edges';
6
+ const ENTITY_ENTITY = 'MJ: Entities';
7
+ const DOMAIN_CONCEPT_TYPE = 'Domain';
8
+ const DESCRIBES_EDGE_TYPE = 'Describes';
9
+ const INFERRED_AUTHORITY_TIER = 'Inferred';
10
+ /** Thrown when saving a batch of domain proposals fails; `Saved` holds proposals committed before the error. */
11
+ export class DomainProposalSaveError extends Error {
12
+ constructor(message, saved) {
13
+ super(message);
14
+ this.name = 'DomainProposalSaveError';
15
+ this.Saved = { ConceptIDs: [...saved.ConceptIDs], EdgeCount: saved.EdgeCount };
16
+ }
17
+ }
18
+ /**
19
+ * Write domain proposals into `graph` for review: each becomes a `Proposed` `Domain` concept, and
20
+ * each member entity gets an `Inferred` + `Proposed` `Describes` edge to it, carrying the member's
21
+ * confidence. Nothing is approved here; approval goes through the normal review path.
22
+ *
23
+ * Every save runs as `user` through `provider`, so entity permissions apply. Each proposal is written
24
+ * in one transaction (where the provider supports one), so a concept never lands without its edges.
25
+ * Throws {@link DomainProposalSaveError} with the failing save's message and any proposals
26
+ * committed before the failure.
27
+ */
28
+ export async function SaveDomainProposals(graph, proposals, user, provider) {
29
+ const lookups = resolveLookups(graph, provider);
30
+ const saved = { ConceptIDs: [], EdgeCount: 0 };
31
+ try {
32
+ for (const proposal of proposals) {
33
+ // A server provider exposes entity transactions; a client one runs the work as-is.
34
+ const conceptId = await RunInEntityTransaction(provider, () => saveOne(graph, proposal, lookups, user, provider));
35
+ saved.ConceptIDs.push(conceptId);
36
+ saved.EdgeCount += proposal.Members.length;
37
+ }
38
+ return saved;
39
+ }
40
+ catch (error) {
41
+ if (error instanceof DomainProposalSaveError) {
42
+ throw error;
43
+ }
44
+ const msg = error instanceof Error ? error.message : String(error);
45
+ throw new DomainProposalSaveError(msg, saved);
46
+ }
47
+ }
48
+ function resolveLookups(graph, provider) {
49
+ const engine = GraphEngine.Instance;
50
+ const domainType = engine.ConceptTypes.find((t) => t.Name.trim().toLowerCase() === DOMAIN_CONCEPT_TYPE.toLowerCase());
51
+ const describes = engine.EdgeTypes.find((t) => t.Name.trim().toLowerCase() === DESCRIBES_EDGE_TYPE.toLowerCase() && (t.GraphID == null || UUIDsEqual(t.GraphID, graph.ID)));
52
+ const inferredTier = engine.AuthorityTiers.find((t) => t.Name.trim().toLowerCase() === INFERRED_AUTHORITY_TIER.toLowerCase());
53
+ const entityEntity = provider.EntityByName(ENTITY_ENTITY);
54
+ const conceptEntity = provider.EntityByName(CONCEPT_ENTITY);
55
+ if (!domainType) {
56
+ throw new Error(`The "${DOMAIN_CONCEPT_TYPE}" graph concept type is not defined.`);
57
+ }
58
+ if (!describes) {
59
+ throw new Error(`The "${DESCRIBES_EDGE_TYPE}" edge type is not defined for graph "${graph.Name}".`);
60
+ }
61
+ if (!entityEntity || !conceptEntity) {
62
+ throw new Error(`Entity metadata for "${ENTITY_ENTITY}" or "${CONCEPT_ENTITY}" is not loaded.`);
63
+ }
64
+ return {
65
+ DomainTypeID: domainType.ID,
66
+ DescribesTypeID: describes.ID,
67
+ DescribesWeight: describes.DefaultWeight,
68
+ InferredTierID: inferredTier?.ID ?? null,
69
+ EntityEntityID: entityEntity.ID,
70
+ ConceptEntityID: conceptEntity.ID,
71
+ };
72
+ }
73
+ async function saveOne(graph, proposal, lookups, user, provider) {
74
+ const concept = await provider.GetEntityObject(CONCEPT_ENTITY, user);
75
+ concept.NewRecord();
76
+ concept.GraphID = graph.ID;
77
+ concept.Name = proposal.Name;
78
+ concept.ConceptTypeID = lookups.DomainTypeID;
79
+ if (lookups.InferredTierID != null) {
80
+ concept.AuthorityTierID = lookups.InferredTierID;
81
+ }
82
+ concept.Description = proposal.Description;
83
+ concept.Status = 'Proposed';
84
+ if (!(await concept.Save())) {
85
+ throw new Error(`Saving proposed concept "${proposal.Name}" failed: ${concept.LatestResult?.CompleteMessage ?? 'unknown error'}`);
86
+ }
87
+ for (const member of proposal.Members) {
88
+ const edge = await provider.GetEntityObject(EDGE_ENTITY, user);
89
+ edge.NewRecord();
90
+ edge.GraphID = graph.ID;
91
+ edge.EdgeTypeID = lookups.DescribesTypeID;
92
+ edge.SourceEntityID = lookups.EntityEntityID;
93
+ edge.SourceRecordID = member.EntityID; // MJ: Entities has a single-column key, so the compact form is the bare ID
94
+ edge.TargetEntityID = lookups.ConceptEntityID;
95
+ edge.TargetRecordID = concept.ID;
96
+ edge.Weight = lookups.DescribesWeight;
97
+ edge.Description = `Proposed member of "${proposal.Name}" (share of its links inside the group: ${Math.round(member.Confidence * 100)}%).`;
98
+ edge.Origin = 'Inferred';
99
+ edge.Status = 'Proposed';
100
+ edge.Confidence = member.Confidence;
101
+ if (!(await edge.Save())) {
102
+ throw new Error(`Saving the Describes edge from "${member.EntityName}" to "${proposal.Name}" failed: ${edge.LatestResult?.CompleteMessage ?? 'unknown error'}`);
103
+ }
104
+ }
105
+ return concept.ID;
106
+ }
107
+ //# sourceMappingURL=DomainProposalWriter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DomainProposalWriter.js","sourceRoot":"","sources":["../../src/graph/DomainProposalWriter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAyC,MAAM,sBAAsB,CAAC;AACrG,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD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AAK,CAAC,mCAAmC,MAAM,CAAC,UAAU,SAAS,QAAQ,CAAC,IAAI,aAAa,IAAI,CAAC,YAAY,EAAE,eAAe,IAAI,eAAe,EAAE,CAAC,CAAC;QACpK,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC,EAAE,CAAC;AACtB,CAAC"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * @fileoverview Pluggable access policies for the semantic graph.
3
+ *
4
+ * By default {@link GraphEngine} shows a node only when the viewer may read its entity and the row
5
+ * comes back from a read run as that viewer (entity permissions and row-level security). That is
6
+ * the right rule for most entities, but not for all of them:
7
+ *
8
+ * - **Derived nodes.** A concept synthesized from a private document, or that document's chunks, are
9
+ * separate entities whose own permissions know nothing about the document. Visibility has to follow
10
+ * the source record.
11
+ * - **Entities whose access is not row-level security.** Some entities decide access in code; their
12
+ * graph visibility should come from that code.
13
+ *
14
+ * A policy plugs in for one entity (node policy) or one edge type (edge policy):
15
+ *
16
+ * ```typescript
17
+ * @RegisterClass(BaseGraphNodeAccessPolicy, 'MJ: Graph Concepts')
18
+ * export class MyConceptPolicy extends BaseGraphNodeAccessPolicy { ... }
19
+ * ```
20
+ *
21
+ * Policies are registered in code only. No metadata row selects one, so metadata-write access cannot
22
+ * swap in a permissive policy. One policy applies per entity or edge type: the highest-priority
23
+ * registration wins, so to combine behaviours, subclass the policy you are extending.
24
+ *
25
+ * @module @memberjunction/core-entities
26
+ */
27
+ import { UserInfo } from '@memberjunction/core';
28
+ import { type GraphDataProvider, type GraphEdgeView, type GraphNodeRef, type GraphNodeView } from './BaseGraphEdgeProvider.js';
29
+ /** What a node policy decides for one node. */
30
+ export type GraphNodeAccessDecision = 'Visible' | 'Redacted' | 'Hidden';
31
+ /**
32
+ * How a node policy combines with the default check.
33
+ * - `Extend`: the default check runs first; the policy sees only nodes that passed it and can only narrow.
34
+ * - `Replace`: the default check is skipped for the entity; the policy reads the nodes and decides.
35
+ */
36
+ export type GraphAccessPolicyMode = 'Extend' | 'Replace';
37
+ /** One node handed to a node policy. `View` is set for `Extend` policies (the default check's result). */
38
+ export interface GraphPolicyNode {
39
+ readonly Key: string;
40
+ readonly Ref: GraphNodeRef;
41
+ readonly View?: GraphNodeView;
42
+ }
43
+ /** What a policy may use while deciding. Every read it makes must run as {@link Principal}. */
44
+ export interface GraphAccessPolicyContext {
45
+ /** The viewer being checked. With audience readers, each principal is checked separately. */
46
+ readonly Principal: UserInfo;
47
+ /** Provider for every read the policy makes. */
48
+ readonly Provider: GraphDataProvider;
49
+ /** When `true`, `Proposed` concepts count as visible. */
50
+ readonly IncludeProposed: boolean;
51
+ /**
52
+ * Keys of `nodes` this principal may see, by the full check (default check plus policies).
53
+ * Used to make one node's visibility follow another's, such as a chunk following its source
54
+ * document. Nested calls are bounded; past the bound every node is hidden.
55
+ */
56
+ ResolveVisibleKeys(nodes: readonly GraphNodeRef[]): Promise<Set<string>>;
57
+ /** Canonical node key for a reference, as used in {@link GraphPolicyNode.Key}. */
58
+ NodeKey(node: GraphNodeRef): string;
59
+ /** `true` when the graph is of a graph type with `IsCanon = 1`. */
60
+ IsCanonGraph(graphID: string): boolean;
61
+ }
62
+ /**
63
+ * Access policy for the nodes of one entity, registered under that entity's name.
64
+ */
65
+ export declare abstract class BaseGraphNodeAccessPolicy {
66
+ /** `Extend` (the default) or `Replace`. See {@link GraphAccessPolicyMode}. */
67
+ get Mode(): GraphAccessPolicyMode;
68
+ /**
69
+ * Decides each node. A node missing from the result is hidden. For an `Extend` policy, `nodes`
70
+ * are the ones that passed the default check; for a `Replace` policy, the views produced by
71
+ * {@link ReadNodes}. Make one batched set of reads for the whole call, never one per node.
72
+ */
73
+ abstract FilterNodes(nodes: readonly GraphPolicyNode[], ctx: GraphAccessPolicyContext): Promise<Map<string, GraphNodeAccessDecision>>;
74
+ /**
75
+ * `Replace` policies only: reads the requested nodes as {@link GraphAccessPolicyContext.Principal}
76
+ * and returns a view for each node that exists and may be shown. The default implementation
77
+ * returns nothing, which hides every node.
78
+ */
79
+ ReadNodes(nodes: readonly GraphPolicyNode[], ctx: GraphAccessPolicyContext): Promise<Map<string, GraphNodeView>>;
80
+ }
81
+ /**
82
+ * Access policy for the edges of one edge type, registered under the edge type's name. The engine
83
+ * already hides an edge unless both endpoints are visible; an edge policy can only narrow further.
84
+ */
85
+ export declare abstract class BaseGraphEdgeAccessPolicy {
86
+ /** IDs of the edges this principal may see. An edge missing from the result is hidden. */
87
+ abstract FilterEdges(edges: readonly GraphEdgeView[], ctx: GraphAccessPolicyContext): Promise<Set<string>>;
88
+ }
89
+ /**
90
+ * Resolves registered access policies by entity name or edge type name. A policy that is registered
91
+ * but cannot be created fails closed: everything it governs is hidden, never left to the default.
92
+ */
93
+ export declare class GraphAccessPolicyRegistry {
94
+ /** The node policy registered for an entity, or `null` when none is. */
95
+ static GetNodePolicy(entityName: string): BaseGraphNodeAccessPolicy | null;
96
+ /**
97
+ * The edge policy registered for an edge type, or `null` when none is. The type name is matched
98
+ * ignoring case and whitespace ({@link NormalizeGraphEdgeTypeName}), the same way edges match an
99
+ * edge-type filter: a policy registered as `'RelatedTo'` governs edges named `'Related To'`, and
100
+ * an edge cannot skip its policy because of how the name is spaced.
101
+ */
102
+ static GetEdgePolicy(edgeTypeName: string): BaseGraphEdgeAccessPolicy | null;
103
+ /**
104
+ * The key of the highest-priority edge policy registered for this type name under any spelling,
105
+ * or the name itself when none matches. Priority ties go to the later registration, as in the
106
+ * ClassFactory.
107
+ */
108
+ private static registeredEdgePolicyKey;
109
+ private static resolve;
110
+ }
111
+ //# sourceMappingURL=GraphAccessPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphAccessPolicy.d.ts","sourceRoot":"","sources":["../../src/graph/GraphAccessPolicy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAY,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAA8B,KAAK,iBAAiB,EAAE,KAAK,aA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B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CAKzC;AAED;;;GAGG;AACH,8BAAsB,yBAAyB;IAC3C,0FAA0F;aAC1E,WAAW,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,EAAE,GAAG,EAAE,wBAAwB,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACpH;AAgBD;;;GAGG;AACH,qBAAa,yBAAyB;IAClC,wEAAwE;WAC1D,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,yBAAyB,GAAG,IAAI;IAQjF;;;;;OAKG;WACW,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,yBAAyB,GAAG,IAAI;IAQnF;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAWtC,OAAO,CAAC,MAAM,CAAC,OAAO;CAqBzB"}
@@ -0,0 +1,123 @@
1
+ /**
2
+ * @fileoverview Pluggable access policies for the semantic graph.
3
+ *
4
+ * By default {@link GraphEngine} shows a node only when the viewer may read its entity and the row
5
+ * comes back from a read run as that viewer (entity permissions and row-level security). That is
6
+ * the right rule for most entities, but not for all of them:
7
+ *
8
+ * - **Derived nodes.** A concept synthesized from a private document, or that document's chunks, are
9
+ * separate entities whose own permissions know nothing about the document. Visibility has to follow
10
+ * the source record.
11
+ * - **Entities whose access is not row-level security.** Some entities decide access in code; their
12
+ * graph visibility should come from that code.
13
+ *
14
+ * A policy plugs in for one entity (node policy) or one edge type (edge policy):
15
+ *
16
+ * ```typescript
17
+ * @RegisterClass(BaseGraphNodeAccessPolicy, 'MJ: Graph Concepts')
18
+ * export class MyConceptPolicy extends BaseGraphNodeAccessPolicy { ... }
19
+ * ```
20
+ *
21
+ * Policies are registered in code only. No metadata row selects one, so metadata-write access cannot
22
+ * swap in a permissive policy. One policy applies per entity or edge type: the highest-priority
23
+ * registration wins, so to combine behaviours, subclass the policy you are extending.
24
+ *
25
+ * @module @memberjunction/core-entities
26
+ */
27
+ import { LogError } from '@memberjunction/core';
28
+ import { MJGlobal } from '@memberjunction/global';
29
+ import { NormalizeGraphEdgeTypeName } from './BaseGraphEdgeProvider.js';
30
+ /**
31
+ * Access policy for the nodes of one entity, registered under that entity's name.
32
+ */
33
+ export class BaseGraphNodeAccessPolicy {
34
+ /** `Extend` (the default) or `Replace`. See {@link GraphAccessPolicyMode}. */
35
+ get Mode() {
36
+ return 'Extend';
37
+ }
38
+ /**
39
+ * `Replace` policies only: reads the requested nodes as {@link GraphAccessPolicyContext.Principal}
40
+ * and returns a view for each node that exists and may be shown. The default implementation
41
+ * returns nothing, which hides every node.
42
+ */
43
+ async ReadNodes(nodes, ctx) {
44
+ void nodes;
45
+ void ctx;
46
+ return new Map();
47
+ }
48
+ }
49
+ /**
50
+ * Access policy for the edges of one edge type, registered under the edge type's name. The engine
51
+ * already hides an edge unless both endpoints are visible; an edge policy can only narrow further.
52
+ */
53
+ export class BaseGraphEdgeAccessPolicy {
54
+ }
55
+ /** Stands in for a registered node policy that could not be created: hides every node. */
56
+ class FailClosedNodePolicy extends BaseGraphNodeAccessPolicy {
57
+ async FilterNodes() {
58
+ return new Map();
59
+ }
60
+ }
61
+ /** Stands in for a registered edge policy that could not be created: hides every edge. */
62
+ class FailClosedEdgePolicy extends BaseGraphEdgeAccessPolicy {
63
+ async FilterEdges() {
64
+ return new Set();
65
+ }
66
+ }
67
+ /**
68
+ * Resolves registered access policies by entity name or edge type name. A policy that is registered
69
+ * but cannot be created fails closed: everything it governs is hidden, never left to the default.
70
+ */
71
+ export class GraphAccessPolicyRegistry {
72
+ /** The node policy registered for an entity, or `null` when none is. */
73
+ static GetNodePolicy(entityName) {
74
+ return GraphAccessPolicyRegistry.resolve(BaseGraphNodeAccessPolicy, entityName, () => new FailClosedNodePolicy());
75
+ }
76
+ /**
77
+ * The edge policy registered for an edge type, or `null` when none is. The type name is matched
78
+ * ignoring case and whitespace ({@link NormalizeGraphEdgeTypeName}), the same way edges match an
79
+ * edge-type filter: a policy registered as `'RelatedTo'` governs edges named `'Related To'`, and
80
+ * an edge cannot skip its policy because of how the name is spaced.
81
+ */
82
+ static GetEdgePolicy(edgeTypeName) {
83
+ return GraphAccessPolicyRegistry.resolve(BaseGraphEdgeAccessPolicy, GraphAccessPolicyRegistry.registeredEdgePolicyKey(edgeTypeName), () => new FailClosedEdgePolicy());
84
+ }
85
+ /**
86
+ * The key of the highest-priority edge policy registered for this type name under any spelling,
87
+ * or the name itself when none matches. Priority ties go to the later registration, as in the
88
+ * ClassFactory.
89
+ */
90
+ static registeredEdgePolicyKey(edgeTypeName) {
91
+ const target = NormalizeGraphEdgeTypeName(edgeTypeName);
92
+ let best = null;
93
+ for (const r of MJGlobal.Instance.ClassFactory.GetAllRegistrations(BaseGraphEdgeAccessPolicy)) {
94
+ if (r.Key != null && NormalizeGraphEdgeTypeName(r.Key) === target && (!best || r.Priority >= best.Priority)) {
95
+ best = { Key: r.Key, Priority: r.Priority };
96
+ }
97
+ }
98
+ return best?.Key ?? edgeTypeName;
99
+ }
100
+ static resolve(baseClass, key, failClosed) {
101
+ const trimmed = key?.trim();
102
+ if (!trimmed) {
103
+ return null;
104
+ }
105
+ const factory = MJGlobal.Instance.ClassFactory;
106
+ if (!factory.GetRegistration(baseClass, trimmed)) {
107
+ return null;
108
+ }
109
+ try {
110
+ const result = factory.TryCreateInstance(baseClass, trimmed);
111
+ if (result.Resolved) {
112
+ return result.Instance;
113
+ }
114
+ LogError(`GraphAccessPolicyRegistry: the policy registered for '${trimmed}' could not be created; hiding what it governs.`);
115
+ }
116
+ catch (err) {
117
+ const msg = err instanceof Error ? err.message : String(err);
118
+ LogError(`GraphAccessPolicyRegistry: creating the policy registered for '${trimmed}' threw; hiding what it governs: ${msg}`);
119
+ }
120
+ return failClosed();
121
+ }
122
+ }
123
+ //# sourceMappingURL=GraphAccessPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphAccessPolicy.js","sourceRoot":"","sources":["../../src/graph/GraphAccessPolicy.ts"],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O,iDAAiD,CAAC,CAAC;QAChI,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACpB,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,QAAQ,CAAC,kEAAkE,OAAO,oCAAoC,GAAG,EAAE,CAAC,CAAC;QACjI,CAAC;QACD,OAAO,UAAU,EAAE,CAAC;IACxB,CAAC;CACJ"}
@@ -1,6 +1,8 @@
1
- import { BaseEngine, BaseEnginePropertyConfig, BaseEntityEvent, EntityInfo, IMetadataProvider, UserInfo } from '@memberjunction/core';
1
+ import { AuthorizationInfo, BaseEngine, BaseEnginePropertyConfig, BaseEntityEvent, EntityInfo, IMetadataProvider, UserInfo } from '@memberjunction/core';
2
+ import { UUIDSet } from '@memberjunction/global';
2
3
  import { MJGraphAuthorityTierEntity, MJGraphConceptEntity, MJGraphConceptTypeEntity, MJGraphEdgeProviderEntity, MJGraphEdgeTypeEndpointEntity, MJGraphEdgeTypeEntity, MJGraphEntity, MJGraphTypeEntity } from '../generated/entity_subclasses.js';
3
- import { type GraphEdgeView, type GraphNodeRef, type GraphNodeView, type GraphSubgraph, type GraphTraversalOptions } from './BaseGraphEdgeProvider.js';
4
+ import type { MJGraphEdgeTypeEndpointEntityType, MJGraphEntityType } from '../generated/entities/__mj.js';
5
+ import { type GraphEdgeView, type GraphNodeRef, type GraphNodeView, type GraphPath, type GraphSubgraph, type GraphTraversalOptions } from './BaseGraphEdgeProvider.js';
4
6
  /** Depth used when the caller gives none. */
5
7
  export declare const GRAPH_DEFAULT_DEPTH = 2;
6
8
  /** Hard upper bound on traversal depth. */
@@ -11,15 +13,47 @@ export declare const GRAPH_DEFAULT_MAX_NODES = 50;
11
13
  export declare const GRAPH_MAX_NODES = 200;
12
14
  /** Row cap on the stored edges one expansion step reads on demand. */
13
15
  export declare const GRAPH_MAX_STORED_EDGES_PER_STEP = 1000;
16
+ /**
17
+ * Named `MJ: Authorizations` grant required for every approval, rejection/deprecation, edit-of-approved,
18
+ * or delete-of-approved decision on `MJ: Graph Edges` and `MJ: Graph Concepts`.
19
+ */
20
+ export declare const GRAPH_APPROVE_EDGES_AUTHORIZATION = "Graph: Approve Edges";
14
21
  /**
15
22
  * Server operation key (`ServerOperationScopeManager`) under which the Content Pipeline `Graph` stage
16
- * saves the `Inferred` edges its content source's `GraphOverlay` policy approves (every
17
- * `ConceptTaxonomyMode` except `propose-only`). `MJGraphEdgeEntityServer` lets a new `Inferred` edge
18
- * start `Approved` without `Graph: Approve Edges` only inside this scope. Client CRUD entry points
19
- * (GraphQL, REST, transaction groups) run inside a client CRUD boundary that masks every outer scope,
20
- * so an API caller cannot enter it; only server code that names this key can.
23
+ * saves the newly synthesized `Approved` `MJ: Graph Concepts` and `Inferred` + `Approved`
24
+ * `MJ: Graph Edges` that its content source's `GraphOverlay` policy approves (every
25
+ * `ConceptTaxonomyMode` except `propose-only`). `MJGraphEdgeEntityServer` and
26
+ * `MJGraphConceptEntityServer` let a newly created policy-approved row start `Approved` without
27
+ * `Graph: Approve Edges` only inside this scope (never edits, deprecations, or status transitions on
28
+ * existing concepts). Client CRUD entry points (GraphQL, REST, transaction groups) run inside a client
29
+ * CRUD boundary that masks every outer scope, so an API caller cannot enter it; only server code
30
+ * that names this key can.
21
31
  */
22
32
  export declare const GRAPH_PIPELINE_EDGE_APPROVAL_OPERATION = "ContentPipeline.GraphStage.ApproveInferredEdges";
33
+ /**
34
+ * Server operation key under which the Content Pipeline retracts the evidence of a chunk it is
35
+ * deleting: the `Inferred` edges that have that chunk as an endpoint. Deleting an `Approved` edge is
36
+ * otherwise a review decision that needs `Graph: Approve Edges`, but an edge whose evidence is gone
37
+ * is not one a person decided to keep, so `MJGraphEdgeEntityServer` allows deleting an `Inferred`
38
+ * edge inside this scope. A `Declared` edge is never covered. Like the approval scope, no API caller
39
+ * can enter it.
40
+ */
41
+ export declare const GRAPH_PIPELINE_EVIDENCE_RETRACTION_OPERATION = "ContentPipeline.Delete.RetractInferredEdges";
42
+ /**
43
+ * True when a graph belongs to a graph type with `IsCanon = 1`. Whether a graph is Canon is metadata:
44
+ * neither the graph's name nor its type's name decides it.
45
+ */
46
+ export declare function IsCanonGraph(graph: Pick<MJGraphEntityType, 'GraphTypeID'>, canonTypeIds: UUIDSet): boolean;
47
+ /** The `MJ: Graph Edge Type Endpoints` columns an endpoint check reads. */
48
+ export type GraphEdgeEndpointRule = Pick<MJGraphEdgeTypeEndpointEntityType, 'EdgeTypeID' | 'Side' | 'EntityID'>;
49
+ /**
50
+ * Whether `entityId` may sit on `side` of an edge of type `edgeTypeId`, according to `endpoints`
51
+ * (`MJ: Graph Edge Type Endpoints` rows). With no row for that type and side, any entity may.
52
+ *
53
+ * The one rule behind {@link GraphEngine.ValidateEdgeEndpoint} (read path and the edge server
54
+ * subclass) and every proposer that checks an edge before writing it, so they cannot disagree.
55
+ */
56
+ export declare function GraphEdgeEndpointAllows(endpoints: readonly GraphEdgeEndpointRule[], edgeTypeId: string, side: GraphEdgeEndpointRule['Side'], entityId: string): boolean;
23
57
  /** Options for {@link GraphEngine.FilterNodesForUser}. */
24
58
  export interface GraphNodeFilterOptions {
25
59
  /** When `true`, `Proposed` concepts are visible alongside `Approved` ones (`false` by default). */
@@ -66,7 +100,22 @@ export declare class GraphEngine extends BaseEngine<GraphEngine> {
66
100
  private preloadGeneration;
67
101
  /** Field and alternate-view lookups for metadata nodes; rebuilt when the provider's entity list changes. */
68
102
  private metadataNodeIndex;
103
+ /** Cached result of the lightweight unloaded Canon-graph existence probe, keyed by provider. */
104
+ private activeCanonGraphCache;
105
+ /** In-flight lightweight Canon-graph probes so concurrent callers share one query per provider. */
106
+ private activeCanonGraphInFlight;
107
+ /** Monotonic counter incremented when graph/type metadata changes so stale probes do not cache. */
108
+ private activeCanonProbeGeneration;
69
109
  Config(forceRefresh?: boolean, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<void>;
110
+ /**
111
+ * Returns `true` when at least one active Canon graph exists. When `GraphEngine` is already
112
+ * loaded for the resolved provider, evaluates strictly in memory; otherwise runs a single
113
+ * lightweight `RunView` probe cached per provider so callers can skip loading all 8 graph entities
114
+ * on deployments with no active Canon graphs.
115
+ */
116
+ HasActiveCanonGraphs(contextUser?: UserInfo, provider?: IMetadataProvider): Promise<boolean>;
117
+ private probeActiveCanonGraphs;
118
+ private invalidateActiveCanonGraphCache;
70
119
  /** A first or forced (re)load also drops every preloaded graph; each reloads on its next traversal. */
71
120
  protected Load(configs: Partial<BaseEnginePropertyConfig>[], provider: IMetadataProvider, forceRefresh?: boolean, contextUser?: UserInfo): Promise<void>;
72
121
  /**
@@ -120,6 +169,12 @@ export declare class GraphEngine extends BaseEngine<GraphEngine> {
120
169
  * A concept appears only when {@link IsGraphConceptStatusVisible} for `options.IncludeProposed`.
121
170
  */
122
171
  FilterNodesForUser(nodes: GraphNodeRef[], user: UserInfo, audienceReaders?: readonly UserInfo[], options?: GraphNodeFilterOptions): Promise<Map<string, GraphNodeView>>;
172
+ /**
173
+ * Runs registered {@link BaseGraphEdgeAccessPolicy} checks over `edges` for `user` and every
174
+ * `audienceReaders` principal. An edge survives only when every principal's policy allows it;
175
+ * edge types with no registered policy pass through unchanged.
176
+ */
177
+ FilterEdgesForUser(edges: GraphEdgeView[], user: UserInfo, audienceReaders?: readonly UserInfo[], options?: GraphNodeFilterOptions): Promise<GraphEdgeView[]>;
123
178
  /**
124
179
  * Stored and derived edges incident to `node` in `graphName` whose endpoints the caller (and any
125
180
  * `options.AudienceReaders`) may see. An unknown or inactive graph yields no edges. Every read made
@@ -147,6 +202,32 @@ export declare class GraphEngine extends BaseEngine<GraphEngine> {
147
202
  * Alias for {@link Subgraph} used by RAG and pipeline callers.
148
203
  */
149
204
  Expand(graphName: string, seeds: GraphNodeRef[], options: GraphTraversalOptions, user: UserInfo, provider?: IMetadataProvider): Promise<GraphSubgraph>;
205
+ /**
206
+ * The fewest-hop path from `from` to `to` in `graphName` that the caller (and every
207
+ * `options.AudienceReaders`) may see, with the best path weight among paths of that length.
208
+ *
209
+ * The search is the same best-first, permission-checked expansion as {@link Subgraph}, started at
210
+ * `from` and stopped the moment `to` is admitted, so a path never runs through a node some
211
+ * principal cannot see. `Depth` defaults to the maximum (4) and `MaxNodes` to the cap (200),
212
+ * because a path search usually needs the reach that a neighborhood read does not.
213
+ *
214
+ * A node the caller cannot see (either endpoint included) and a node that is not connected give
215
+ * the same answer, `Found: false` with a `Message`, so the result never reveals that a record exists.
216
+ */
217
+ FindPath(graphName: string, from: GraphNodeRef, to: GraphNodeRef, options: GraphTraversalOptions, user: UserInfo, provider?: IMetadataProvider): Promise<GraphPath>;
218
+ /**
219
+ * Render a {@link GraphPath} as one Markdown line per hop for LLM prompt injection. Each edge is
220
+ * shown in its own direction, so a hop taken against an edge reads `<--`.
221
+ */
222
+ DescribePathForPrompt(path: GraphPath, provider?: IMetadataProvider): string;
223
+ /**
224
+ * Best-first bounded expansion shared by {@link Subgraph} and {@link FindPath}: admit the visible
225
+ * seeds, then expand hop by hop, checking every candidate's visibility for every principal before
226
+ * admitting it, until the depth or node limit is reached or `limits.StopAtKey` is admitted.
227
+ */
228
+ private traverse;
229
+ /** Walk back from `targetKey` through each node's parent to the seed, and return the path in order. */
230
+ private buildPath;
150
231
  /**
151
232
  * Render a {@link GraphSubgraph} as a compact, deterministic Markdown block for LLM prompt injection.
152
233
  */
@@ -167,6 +248,13 @@ export declare class GraphEngine extends BaseEngine<GraphEngine> {
167
248
  */
168
249
  private collectEdgesBetween;
169
250
  private getEdgesForFrontier;
251
+ /**
252
+ * Runs each edge type's access policy, for every principal: an edge survives only if every
253
+ * principal's policy allows it. Edge types with no policy pass through. A policy that throws hides
254
+ * every edge it governs.
255
+ */
256
+ private applyEdgePolicies;
257
+ private allowedEdges;
170
258
  private touchesFrontier;
171
259
  private toStoredEdgeView;
172
260
  /**
@@ -222,6 +310,20 @@ export declare class GraphEngine extends BaseEngine<GraphEngine> {
222
310
  * principal read it) is not {@link IsGraphConceptStatusVisible} is invisible too.
223
311
  */
224
312
  private resolveNodesForPrincipal;
313
+ /** What a policy may use while deciding for `principal`; nested checks run one level deeper. */
314
+ private policyContext;
315
+ /** `Replace` policies read their own nodes; a policy that throws hides its nodes. */
316
+ private readReplacedNodes;
317
+ /**
318
+ * Runs each visible node's entity policy over it. `Hidden` (or a missing decision) removes the
319
+ * node; `Redacted` keeps it with the neutral label and no description. A policy that throws hides
320
+ * every node it governs.
321
+ */
322
+ private applyNodePolicies;
323
+ private decideNodes;
324
+ private applyNodeDecision;
325
+ /** `true` when `graphID` is an active graph whose graph type has `IsCanon = 1`. */
326
+ private isCanonGraphID;
225
327
  private resolveMetadataNode;
226
328
  private metadataIndex;
227
329
  private resolveDataNodes;
@@ -248,6 +350,12 @@ export declare function IsGraphConceptStatusVisible(status: unknown, includeProp
248
350
  * minus deny, no bypass for any user type. Anything unknown is denied.
249
351
  */
250
352
  export declare function CanUserReadEntity(entity: EntityInfo | undefined, user: UserInfo | undefined): boolean;
353
+ /**
354
+ * True only when `user` holds the `Graph: Approve Edges` authorization (directly or via an
355
+ * ancestor authorization) in `authorizations`. Fails closed when `user`, `authorizations`, or the
356
+ * seeded `Graph: Approve Edges` authorization is missing.
357
+ */
358
+ export declare function CanUserApproveGraph(user: UserInfo | null | undefined, authorizations: AuthorizationInfo[] | null | undefined): boolean;
251
359
  /** Clamp a requested traversal depth to `1..4` (default `2`). */
252
360
  export declare function ClampGraphDepth(requested: number | undefined): number;
253
361
  /** Clamp a requested node budget to `1..200` (default `50`, or `fallback`). */
@@ -1 +1 @@
1
- {"version":3,"file":"GraphEngine.d.ts","sourceRoot":"","sources":["../../src/graph/GraphEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,UAAU,EACV,wBAAwB,EACxB,eAAe,EAGf,UAAU,EAEV,iBAAiB,EAKjB,QAAQ,EACX,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,0BAA0B,EAC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