@memberjunction/core-entities 6.2.1 → 6.3.0-edge.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/dist/.tsbuildinfo +1 -1
- package/dist/custom/MJUserViewEntityExtended.d.ts +4 -7
- package/dist/custom/MJUserViewEntityExtended.d.ts.map +1 -1
- package/dist/custom/MJUserViewEntityExtended.js +15 -97
- package/dist/custom/MJUserViewEntityExtended.js.map +1 -1
- package/dist/engines/CanonGraphEngine.d.ts +122 -0
- package/dist/engines/CanonGraphEngine.d.ts.map +1 -0
- package/dist/engines/CanonGraphEngine.js +495 -0
- package/dist/engines/CanonGraphEngine.js.map +1 -0
- package/dist/engines/UserInfoEngine.d.ts.map +1 -1
- package/dist/engines/UserInfoEngine.js +12 -7
- package/dist/engines/UserInfoEngine.js.map +1 -1
- package/dist/engines/conversations.d.ts +159 -10
- package/dist/engines/conversations.d.ts.map +1 -1
- package/dist/engines/conversations.js +434 -18
- package/dist/engines/conversations.js.map +1 -1
- package/dist/generated/entities/__mj.d.ts +4237 -899
- package/dist/generated/entities/__mj.d.ts.map +1 -1
- package/dist/generated/entities/__mj.js +4605 -448
- package/dist/generated/entities/__mj.js.map +1 -1
- package/dist/generated/queries/__mj.d.ts +269 -0
- package/dist/generated/queries/__mj.d.ts.map +1 -0
- package/dist/generated/queries/__mj.js +100 -0
- package/dist/generated/queries/__mj.js.map +1 -0
- package/dist/generated/queries/index.d.ts +2 -0
- package/dist/generated/queries/index.d.ts.map +1 -0
- package/dist/generated/queries/index.js +4 -0
- package/dist/generated/queries/index.js.map +1 -0
- package/dist/generated/remote_operations.d.ts +50 -22
- package/dist/generated/remote_operations.d.ts.map +1 -1
- package/dist/generated/remote_operations.js +3 -3
- package/dist/generated/remote_operations.js.map +1 -1
- package/dist/graph/BaseGraphEdgeProvider.d.ts +158 -0
- package/dist/graph/BaseGraphEdgeProvider.d.ts.map +1 -0
- package/dist/graph/BaseGraphEdgeProvider.js +70 -0
- package/dist/graph/BaseGraphEdgeProvider.js.map +1 -0
- package/dist/graph/GraphEngine.d.ts +255 -0
- package/dist/graph/GraphEngine.d.ts.map +1 -0
- package/dist/graph/GraphEngine.js +1066 -0
- package/dist/graph/GraphEngine.js.map +1 -0
- package/dist/graph/GraphExpansion.d.ts +142 -0
- package/dist/graph/GraphExpansion.d.ts.map +1 -0
- package/dist/graph/GraphExpansion.js +87 -0
- package/dist/graph/GraphExpansion.js.map +1 -0
- package/dist/graph/index.d.ts +15 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +30 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/providers/AlternateBaseViewEdgeProvider.d.ts +16 -0
- package/dist/graph/providers/AlternateBaseViewEdgeProvider.d.ts.map +1 -0
- package/dist/graph/providers/AlternateBaseViewEdgeProvider.js +115 -0
- package/dist/graph/providers/AlternateBaseViewEdgeProvider.js.map +1 -0
- package/dist/graph/providers/EntityMetadataEdgeProvider.d.ts +17 -0
- package/dist/graph/providers/EntityMetadataEdgeProvider.d.ts.map +1 -0
- package/dist/graph/providers/EntityMetadataEdgeProvider.js +145 -0
- package/dist/graph/providers/EntityMetadataEdgeProvider.js.map +1 -0
- package/dist/graph/providers/ForeignKeyEdgeProvider.d.ts +25 -0
- package/dist/graph/providers/ForeignKeyEdgeProvider.d.ts.map +1 -0
- package/dist/graph/providers/ForeignKeyEdgeProvider.js +131 -0
- package/dist/graph/providers/ForeignKeyEdgeProvider.js.map +1 -0
- package/dist/graph/providers/JoinEntityEdgeProvider.d.ts +37 -0
- package/dist/graph/providers/JoinEntityEdgeProvider.d.ts.map +1 -0
- package/dist/graph/providers/JoinEntityEdgeProvider.js +170 -0
- package/dist/graph/providers/JoinEntityEdgeProvider.js.map +1 -0
- package/dist/graph/providers/QueryEdgeProvider.d.ts +33 -0
- package/dist/graph/providers/QueryEdgeProvider.d.ts.map +1 -0
- package/dist/graph/providers/QueryEdgeProvider.js +120 -0
- package/dist/graph/providers/QueryEdgeProvider.js.map +1 -0
- package/dist/graph/providers/QueryMetadataEdgeProvider.d.ts +18 -0
- package/dist/graph/providers/QueryMetadataEdgeProvider.d.ts.map +1 -0
- package/dist/graph/providers/QueryMetadataEdgeProvider.js +163 -0
- package/dist/graph/providers/QueryMetadataEdgeProvider.js.map +1 -0
- package/dist/graph/providers/RecordLinkEdgeProvider.d.ts +20 -0
- package/dist/graph/providers/RecordLinkEdgeProvider.d.ts.map +1 -0
- package/dist/graph/providers/RecordLinkEdgeProvider.js +172 -0
- package/dist/graph/providers/RecordLinkEdgeProvider.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { BaseEngine, BaseEnginePropertyConfig, BaseEntityEvent, EntityInfo, IMetadataProvider, UserInfo } from '@memberjunction/core';
|
|
2
|
+
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
|
+
/** Depth used when the caller gives none. */
|
|
5
|
+
export declare const GRAPH_DEFAULT_DEPTH = 2;
|
|
6
|
+
/** Hard upper bound on traversal depth. */
|
|
7
|
+
export declare const GRAPH_MAX_DEPTH = 4;
|
|
8
|
+
/** Node budget used when the caller gives none. */
|
|
9
|
+
export declare const GRAPH_DEFAULT_MAX_NODES = 50;
|
|
10
|
+
/** Hard upper bound on nodes a traversal returns. */
|
|
11
|
+
export declare const GRAPH_MAX_NODES = 200;
|
|
12
|
+
/** Row cap on the stored edges one expansion step reads on demand. */
|
|
13
|
+
export declare const GRAPH_MAX_STORED_EDGES_PER_STEP = 1000;
|
|
14
|
+
/**
|
|
15
|
+
* 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.
|
|
21
|
+
*/
|
|
22
|
+
export declare const GRAPH_PIPELINE_EDGE_APPROVAL_OPERATION = "ContentPipeline.GraphStage.ApproveInferredEdges";
|
|
23
|
+
/** Options for {@link GraphEngine.FilterNodesForUser}. */
|
|
24
|
+
export interface GraphNodeFilterOptions {
|
|
25
|
+
/** When `true`, `Proposed` concepts are visible alongside `Approved` ones (`false` by default). */
|
|
26
|
+
IncludeProposed?: boolean;
|
|
27
|
+
/** Provider for the visibility reads (the engine's own when omitted). */
|
|
28
|
+
Provider?: IMetadataProvider;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Semantic Graph Engine (`WS-4.2` / `plans/canon-semantic-graph.md`).
|
|
32
|
+
*
|
|
33
|
+
* Caches graph metadata (graphs, edge types, endpoints, providers, concepts, lookup tables) and,
|
|
34
|
+
* for `Preload` graphs only, their approved stored edges, loaded per graph on its first traversal
|
|
35
|
+
* and reloaded per graph after a change. `OnDemand` graphs read stored edges per expansion step with
|
|
36
|
+
* one bounded RunView. Derived edges come from the graph's active `MJ: Graph Edge Providers`.
|
|
37
|
+
*
|
|
38
|
+
* **Lazily configured.** Nothing loads at startup; the first caller of `Config` pays for it.
|
|
39
|
+
*
|
|
40
|
+
* **Whose data the cache holds.** On a server `BaseEngine` loads every config as the MJ system user,
|
|
41
|
+
* so the shared cache never takes the first caller's scope. Nothing cached is handed to a caller
|
|
42
|
+
* unchecked: every node returned is checked AS THE CALLER (and as every audience reader) at the hop
|
|
43
|
+
* it is reached, with one batched `RunViews` per principal per hop (`[pk] IN (...)` per entity, so
|
|
44
|
+
* entity permissions and row-level security apply), and cached stored edges are used only for a
|
|
45
|
+
* principal who could read every one of them anyway.
|
|
46
|
+
*/
|
|
47
|
+
export declare class GraphEngine extends BaseEngine<GraphEngine> {
|
|
48
|
+
static get Instance(): GraphEngine;
|
|
49
|
+
private _graphs;
|
|
50
|
+
private _graphTypes;
|
|
51
|
+
private _edgeTypes;
|
|
52
|
+
private _edgeTypeEndpoints;
|
|
53
|
+
private _edgeProviders;
|
|
54
|
+
private _concepts;
|
|
55
|
+
private _conceptTypes;
|
|
56
|
+
private _authorityTiers;
|
|
57
|
+
/**
|
|
58
|
+
* Approved stored edges of the `Preload` graphs traversed so far, one entry per graph, loaded on a
|
|
59
|
+
* graph's first traversal. A change drops only the entries it affects (see
|
|
60
|
+
* {@link HandleIndividualBaseEntityEvent}); the next traversal of that graph reloads it alone.
|
|
61
|
+
*/
|
|
62
|
+
private preloadedEdges;
|
|
63
|
+
/** In-flight preload reads by graph ID, so concurrent traversals share one read per graph. */
|
|
64
|
+
private preloadReads;
|
|
65
|
+
/** Bumped by every invalidation, so a read that started before one is not cached after it. */
|
|
66
|
+
private preloadGeneration;
|
|
67
|
+
/** Field and alternate-view lookups for metadata nodes; rebuilt when the provider's entity list changes. */
|
|
68
|
+
private metadataNodeIndex;
|
|
69
|
+
Config(forceRefresh?: boolean, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<void>;
|
|
70
|
+
/** A first or forced (re)load also drops every preloaded graph; each reloads on its next traversal. */
|
|
71
|
+
protected Load(configs: Partial<BaseEnginePropertyConfig>[], provider: IMetadataProvider, forceRefresh?: boolean, contextUser?: UserInfo): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Drops the preload entries a change affects, and nothing else.
|
|
74
|
+
*
|
|
75
|
+
* There is deliberately no `AdditionalLoading` override: `BaseEngine` turns off in-place cache
|
|
76
|
+
* updates for an engine that has one, so every concept or edge-type save would reload that whole
|
|
77
|
+
* config and then every Preload graph's edges. Without it, the cached configs update in place and
|
|
78
|
+
* stored edges load per graph, lazily:
|
|
79
|
+
* - a `MJ: Graph Edges` save or delete drops the edge's graph, and any graph whose entry holds that
|
|
80
|
+
* edge ID (an edge moved to another graph);
|
|
81
|
+
* - a `MJ: Graphs` save or delete drops that graph (its `LoadMode` or `Status` may have changed);
|
|
82
|
+
* - a change that does not say which row (a remote invalidation) drops every entry.
|
|
83
|
+
*/
|
|
84
|
+
protected HandleIndividualBaseEntityEvent(event: BaseEntityEvent): Promise<boolean>;
|
|
85
|
+
/** Drops the preload entries whose graph ID matches `affects` (every entry when `null`). */
|
|
86
|
+
private invalidatePreloadedEdges;
|
|
87
|
+
private preloadHoldsEdge;
|
|
88
|
+
get Graphs(): MJGraphEntity[];
|
|
89
|
+
get GraphTypes(): MJGraphTypeEntity[];
|
|
90
|
+
get EdgeTypes(): MJGraphEdgeTypeEntity[];
|
|
91
|
+
get EdgeTypeEndpoints(): MJGraphEdgeTypeEndpointEntity[];
|
|
92
|
+
get EdgeProviders(): MJGraphEdgeProviderEntity[];
|
|
93
|
+
/**
|
|
94
|
+
* Every cached concept, loaded as the engine's identity. Never hand these to a caller directly:
|
|
95
|
+
* check them with {@link FilterNodesForUser} first (as `CanonGraphEngine.FindConcepts` does).
|
|
96
|
+
*/
|
|
97
|
+
get Concepts(): MJGraphConceptEntity[];
|
|
98
|
+
get ConceptTypes(): MJGraphConceptTypeEntity[];
|
|
99
|
+
get AuthorityTiers(): MJGraphAuthorityTierEntity[];
|
|
100
|
+
/**
|
|
101
|
+
* Find an ACTIVE `MJ: Graphs` row by `Name` (case-insensitive) or `ID`. An unknown or disabled
|
|
102
|
+
* graph returns `undefined`; traversal of it returns nothing.
|
|
103
|
+
*/
|
|
104
|
+
GetGraph(graphNameOrId: string): MJGraphEntity | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Validate whether `entityId` is permitted on `side` (`'Source'` or `'Target'`) of `edgeTypeId`
|
|
107
|
+
* according to `MJ: Graph Edge Type Endpoints`. When no endpoint rows exist for `(edgeTypeId, side)`,
|
|
108
|
+
* any entity is permitted.
|
|
109
|
+
*/
|
|
110
|
+
ValidateEdgeEndpoint(edgeTypeId: string, side: 'Source' | 'Target', entityId: string): boolean;
|
|
111
|
+
/**
|
|
112
|
+
* The canonical key of a node (`<entityID>|<recordID>`), resolving the entity through metadata.
|
|
113
|
+
*/
|
|
114
|
+
GetNodeKey(node: GraphNodeRef): string;
|
|
115
|
+
/**
|
|
116
|
+
* The nodes in `nodes` that `user` — and every one of `audienceReaders` — may see, with display
|
|
117
|
+
* labels, keyed by node key. Data records (including concepts) are read as each principal with one
|
|
118
|
+
* batched `RunViews` per principal, so entity permissions and row-level security apply; metadata
|
|
119
|
+
* nodes use entity `CanRead`, `UserCanRun` (queries) and `CanRead` + `IsUsable` (alternate views).
|
|
120
|
+
* A concept appears only when {@link IsGraphConceptStatusVisible} for `options.IncludeProposed`.
|
|
121
|
+
*/
|
|
122
|
+
FilterNodesForUser(nodes: GraphNodeRef[], user: UserInfo, audienceReaders?: readonly UserInfo[], options?: GraphNodeFilterOptions): Promise<Map<string, GraphNodeView>>;
|
|
123
|
+
/**
|
|
124
|
+
* Stored and derived edges incident to `node` in `graphName` whose endpoints the caller (and any
|
|
125
|
+
* `options.AudienceReaders`) may see. An unknown or inactive graph yields no edges. Every read made
|
|
126
|
+
* for the caller goes through `provider` when one is given (see {@link Subgraph}).
|
|
127
|
+
*/
|
|
128
|
+
GetEdges(graphName: string, node: GraphNodeRef, options: GraphTraversalOptions, user: UserInfo, provider?: IMetadataProvider): Promise<GraphEdgeView[]>;
|
|
129
|
+
/**
|
|
130
|
+
* Best-first bounded expansion around `seeds` in `graphName`.
|
|
131
|
+
*
|
|
132
|
+
* Each step reads the frontier's edges, ranks candidate neighbors by path score (product of edge
|
|
133
|
+
* weights, decayed per hop; ties broken by node key then edge ID), checks the candidates'
|
|
134
|
+
* visibility for the caller and every audience reader in one batch, and admits visible ones until
|
|
135
|
+
* `MaxNodes`. Only admitted nodes are expanded, so traversal never crosses a node some principal
|
|
136
|
+
* cannot see. Every admitted node carries the path that reached it.
|
|
137
|
+
*
|
|
138
|
+
* An unknown or inactive graph returns an empty subgraph with a `Message`.
|
|
139
|
+
*
|
|
140
|
+
* `provider`, when given, carries every read made for the caller and the readers (node visibility,
|
|
141
|
+
* on-demand stored edges, derived-edge providers), e.g. the request's own provider on a server. The
|
|
142
|
+
* engine's cached metadata and Preload edges still come from the provider the engine was configured
|
|
143
|
+
* with.
|
|
144
|
+
*/
|
|
145
|
+
Subgraph(graphName: string, seeds: GraphNodeRef[], options: GraphTraversalOptions, user: UserInfo, provider?: IMetadataProvider): Promise<GraphSubgraph>;
|
|
146
|
+
/**
|
|
147
|
+
* Alias for {@link Subgraph} used by RAG and pipeline callers.
|
|
148
|
+
*/
|
|
149
|
+
Expand(graphName: string, seeds: GraphNodeRef[], options: GraphTraversalOptions, user: UserInfo, provider?: IMetadataProvider): Promise<GraphSubgraph>;
|
|
150
|
+
/**
|
|
151
|
+
* Render a {@link GraphSubgraph} as a compact, deterministic Markdown block for LLM prompt injection.
|
|
152
|
+
*/
|
|
153
|
+
DescribeForPrompt(subgraph: GraphSubgraph): string;
|
|
154
|
+
/** `requested` when it can serve graph reads, else the provider the engine is bound to. */
|
|
155
|
+
private graphProvider;
|
|
156
|
+
/** `[user, ...readers]` with each user once (by ID) and the caller first. */
|
|
157
|
+
private principals;
|
|
158
|
+
private admitSeeds;
|
|
159
|
+
/** Candidate neighbors of the frontier, best first, with a deterministic tie-break. */
|
|
160
|
+
private rankCandidates;
|
|
161
|
+
private uniqueNeighborRefs;
|
|
162
|
+
/** Admit visible candidates in rank order until `maxNodes`; the best path to each node wins. */
|
|
163
|
+
private admitCandidates;
|
|
164
|
+
/**
|
|
165
|
+
* Every edge (that the traversal options allow) between two admitted nodes. Reads the admitted
|
|
166
|
+
* set's edges once more so edges among nodes reached on different branches are included.
|
|
167
|
+
*/
|
|
168
|
+
private collectEdgesBetween;
|
|
169
|
+
private getEdgesForFrontier;
|
|
170
|
+
private touchesFrontier;
|
|
171
|
+
private toStoredEdgeView;
|
|
172
|
+
/**
|
|
173
|
+
* Whether every principal may read a stored edge's `Description` and `Attributes`. A field-level
|
|
174
|
+
* denial still returns the row (only the column is dropped), and the preload cache holds every
|
|
175
|
+
* column, so an edge's text is shown only when no principal is denied it.
|
|
176
|
+
*/
|
|
177
|
+
private storedEdgeTextReadable;
|
|
178
|
+
/**
|
|
179
|
+
* Stored edges incident to the frontier, as every principal may read them.
|
|
180
|
+
*
|
|
181
|
+
* Served from the preload cache only for an active `Preload` graph, approved edges only, and only
|
|
182
|
+
* when every principal can read `MJ: Graph Edges` with no row-level filter (so the cache, loaded
|
|
183
|
+
* as the engine's identity, holds exactly what each of them could read). Otherwise each principal
|
|
184
|
+
* reads the frontier's edges itself — one bounded, ordered RunView per principal — and an edge is
|
|
185
|
+
* kept only if every principal read it.
|
|
186
|
+
*/
|
|
187
|
+
private loadStoredEdges;
|
|
188
|
+
private preloadEdgesFor;
|
|
189
|
+
private readStoredEdgesAsPrincipals;
|
|
190
|
+
private buildStoredEdgeParams;
|
|
191
|
+
/**
|
|
192
|
+
* The approved stored edges of one `Preload` graph, loaded on first use as the engine's own identity
|
|
193
|
+
* (the system user on a server) and kept until a change drops them. `null` when the read fails: the
|
|
194
|
+
* caller then reads on demand as each principal.
|
|
195
|
+
*/
|
|
196
|
+
private preloadedEdgesOf;
|
|
197
|
+
private readPreloadedEdges;
|
|
198
|
+
/**
|
|
199
|
+
* Derived edges every principal derives. Data-scale providers read as the user they run for, so an
|
|
200
|
+
* edge one principal derives from a row another cannot read (a membership, a link) would reveal that
|
|
201
|
+
* row; each principal runs the providers and only edges all of them produce are kept. Each read
|
|
202
|
+
* also applied that principal's field-level security, so an edge keeps only the text every
|
|
203
|
+
* principal's version carries (see {@link sharedEdgeText}).
|
|
204
|
+
*/
|
|
205
|
+
private derivedEdgesForEveryPrincipal;
|
|
206
|
+
/** Derived edges from the graph's active providers, read as `caller`. */
|
|
207
|
+
private runDerivedProviders;
|
|
208
|
+
/** Nodes visible to EVERY principal; labels come from the caller's read. */
|
|
209
|
+
private resolveVisibleNodes;
|
|
210
|
+
/**
|
|
211
|
+
* Data-node labels and descriptions come from the caller's read. Field-level security drops a
|
|
212
|
+
* denied column but still returns the row, so a reader denied the name field still counts the node
|
|
213
|
+
* as visible; its label and description are shown only when EVERY principal may read the field,
|
|
214
|
+
* and otherwise replaced by the neutral `<entity name> <record ID>` label and no description.
|
|
215
|
+
* (Metadata nodes take their text from metadata, which entity permissions already gate.)
|
|
216
|
+
*/
|
|
217
|
+
private neutralizeUnsharedText;
|
|
218
|
+
/**
|
|
219
|
+
* Nodes `principal` may see. Metadata nodes are checked against metadata; every data record —
|
|
220
|
+
* concepts included — is read as `principal` in one batched `RunViews` (`[pk] IN (...)` per
|
|
221
|
+
* entity), and a record that does not come back is invisible. A concept whose `Status` (as this
|
|
222
|
+
* principal read it) is not {@link IsGraphConceptStatusVisible} is invisible too.
|
|
223
|
+
*/
|
|
224
|
+
private resolveNodesForPrincipal;
|
|
225
|
+
private resolveMetadataNode;
|
|
226
|
+
private metadataIndex;
|
|
227
|
+
private resolveDataNodes;
|
|
228
|
+
private buildNodeReadParams;
|
|
229
|
+
private addReturnedRows;
|
|
230
|
+
private normalizeNodeRef;
|
|
231
|
+
private nodeKey;
|
|
232
|
+
}
|
|
233
|
+
/** The label a node gets when its name field may not be shown: the entity name and the record key. */
|
|
234
|
+
export declare function NeutralGraphNodeLabel(entityName: string, recordId: string): string;
|
|
235
|
+
/** True when every principal may read `fieldName` on `entity` (MJ field-level security). */
|
|
236
|
+
export declare function IsFieldReadableByAll(entity: EntityInfo, fieldName: string, principals: readonly UserInfo[]): boolean;
|
|
237
|
+
/** `MJ: Graph Concepts.Status` values, from the generated entity. */
|
|
238
|
+
export type GraphConceptStatus = MJGraphConceptEntity['Status'];
|
|
239
|
+
/**
|
|
240
|
+
* Whether a concept with this `Status` may seed a traversal or appear in one. Only `Approved`
|
|
241
|
+
* concepts are canon; `Proposed` ones appear only when the caller asked for proposed content
|
|
242
|
+
* (`IncludeProposed`); `Draft` (the column default: still being written) and `Deprecated` never do.
|
|
243
|
+
* Anything else, including a status the reader could not read, is not visible.
|
|
244
|
+
*/
|
|
245
|
+
export declare function IsGraphConceptStatusVisible(status: unknown, includeProposed: boolean): boolean;
|
|
246
|
+
/**
|
|
247
|
+
* Entity read permission with MJ's own semantics (`EntityInfo.GetUserPermisions`): role-based allow
|
|
248
|
+
* minus deny, no bypass for any user type. Anything unknown is denied.
|
|
249
|
+
*/
|
|
250
|
+
export declare function CanUserReadEntity(entity: EntityInfo | undefined, user: UserInfo | undefined): boolean;
|
|
251
|
+
/** Clamp a requested traversal depth to `1..4` (default `2`). */
|
|
252
|
+
export declare function ClampGraphDepth(requested: number | undefined): number;
|
|
253
|
+
/** Clamp a requested node budget to `1..200` (default `50`, or `fallback`). */
|
|
254
|
+
export declare function ClampGraphMaxNodes(requested: number | undefined, fallback?: number): number;
|
|
255
|
+
//# sourceMappingURL=GraphEngine.d.ts.map
|
|
@@ -0,0 +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,EAC1B,oBAAoB,EACpB,wBAAwB,EAExB,yBAAyB,EACzB,6BAA6B,EAC7B,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACpB,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAOH,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,EA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