@burdenoff/be-sdk 2026.510.79
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/README.md +173 -0
- package/configs/eslint/index.js +492 -0
- package/configs/tsconfig/tsconfig.json +53 -0
- package/dist/EventQueueFactory-6NMSGECR.js +8 -0
- package/dist/EventQueueFactory-6NMSGECR.js.map +1 -0
- package/dist/auth/index.d.ts +66 -0
- package/dist/auth/index.js +8 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/cache/index.d.ts +2 -0
- package/dist/cache/index.js +6 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/captcha/index.d.ts +1 -0
- package/dist/captcha/index.js +4 -0
- package/dist/captcha/index.js.map +1 -0
- package/dist/chunk-2HANKZZM.js +245 -0
- package/dist/chunk-2HANKZZM.js.map +1 -0
- package/dist/chunk-2SD5L2F2.js +816 -0
- package/dist/chunk-2SD5L2F2.js.map +1 -0
- package/dist/chunk-3O2RQOPV.js +1068 -0
- package/dist/chunk-3O2RQOPV.js.map +1 -0
- package/dist/chunk-4B43DZIS.js +560 -0
- package/dist/chunk-4B43DZIS.js.map +1 -0
- package/dist/chunk-4XAEES25.js +2444 -0
- package/dist/chunk-4XAEES25.js.map +1 -0
- package/dist/chunk-4XGGWW36.js +1405 -0
- package/dist/chunk-4XGGWW36.js.map +1 -0
- package/dist/chunk-5LXDPGDH.js +245 -0
- package/dist/chunk-5LXDPGDH.js.map +1 -0
- package/dist/chunk-AI7L22ZJ.js +472 -0
- package/dist/chunk-AI7L22ZJ.js.map +1 -0
- package/dist/chunk-CBZNP6RF.js +286 -0
- package/dist/chunk-CBZNP6RF.js.map +1 -0
- package/dist/chunk-ELLX3K54.js +613 -0
- package/dist/chunk-ELLX3K54.js.map +1 -0
- package/dist/chunk-F5XEAGHQ.js +1875 -0
- package/dist/chunk-F5XEAGHQ.js.map +1 -0
- package/dist/chunk-FNZEQOJY.js +628 -0
- package/dist/chunk-FNZEQOJY.js.map +1 -0
- package/dist/chunk-GTEMQXCA.js +516 -0
- package/dist/chunk-GTEMQXCA.js.map +1 -0
- package/dist/chunk-HIWTWIGQ.js +226 -0
- package/dist/chunk-HIWTWIGQ.js.map +1 -0
- package/dist/chunk-IYE2NTRX.js +764 -0
- package/dist/chunk-IYE2NTRX.js.map +1 -0
- package/dist/chunk-J26YGR2U.js +1484 -0
- package/dist/chunk-J26YGR2U.js.map +1 -0
- package/dist/chunk-JG2FTZPI.js +509 -0
- package/dist/chunk-JG2FTZPI.js.map +1 -0
- package/dist/chunk-JVBTNSPG.js +1551 -0
- package/dist/chunk-JVBTNSPG.js.map +1 -0
- package/dist/chunk-L7ZMN2FJ.js +12 -0
- package/dist/chunk-L7ZMN2FJ.js.map +1 -0
- package/dist/chunk-M5IMU3US.js +473 -0
- package/dist/chunk-M5IMU3US.js.map +1 -0
- package/dist/chunk-MLW2HPS5.js +1267 -0
- package/dist/chunk-MLW2HPS5.js.map +1 -0
- package/dist/chunk-MNCGUYLJ.js +269 -0
- package/dist/chunk-MNCGUYLJ.js.map +1 -0
- package/dist/chunk-MOCUBSTW.js +373 -0
- package/dist/chunk-MOCUBSTW.js.map +1 -0
- package/dist/chunk-NGMEI42S.js +103 -0
- package/dist/chunk-NGMEI42S.js.map +1 -0
- package/dist/chunk-NUB5GQTU.js +270 -0
- package/dist/chunk-NUB5GQTU.js.map +1 -0
- package/dist/chunk-OVSYMNCI.js +145 -0
- package/dist/chunk-OVSYMNCI.js.map +1 -0
- package/dist/chunk-QLVKMWFA.js +94 -0
- package/dist/chunk-QLVKMWFA.js.map +1 -0
- package/dist/chunk-SAG6ZYWQ.js +89 -0
- package/dist/chunk-SAG6ZYWQ.js.map +1 -0
- package/dist/chunk-SAK2JCA7.js +198 -0
- package/dist/chunk-SAK2JCA7.js.map +1 -0
- package/dist/chunk-SBS4S2PJ.js +100 -0
- package/dist/chunk-SBS4S2PJ.js.map +1 -0
- package/dist/chunk-SNEOLWXT.js +148 -0
- package/dist/chunk-SNEOLWXT.js.map +1 -0
- package/dist/chunk-TKBD2ONF.js +564 -0
- package/dist/chunk-TKBD2ONF.js.map +1 -0
- package/dist/chunk-UBXFIIAW.js +127 -0
- package/dist/chunk-UBXFIIAW.js.map +1 -0
- package/dist/chunk-VI4VSNTI.js +57 -0
- package/dist/chunk-VI4VSNTI.js.map +1 -0
- package/dist/chunk-VWCN5PMD.js +268 -0
- package/dist/chunk-VWCN5PMD.js.map +1 -0
- package/dist/chunk-XC2YD6CF.js +913 -0
- package/dist/chunk-XC2YD6CF.js.map +1 -0
- package/dist/chunk-XE4OXN2W.js +10 -0
- package/dist/chunk-XE4OXN2W.js.map +1 -0
- package/dist/chunk-YMZEUTD2.js +110 -0
- package/dist/chunk-YMZEUTD2.js.map +1 -0
- package/dist/chunk-Z4IRLBWO.js +758 -0
- package/dist/chunk-Z4IRLBWO.js.map +1 -0
- package/dist/client/internal-client.d.ts +7 -0
- package/dist/client/internal-client.js +5 -0
- package/dist/client/internal-client.js.map +1 -0
- package/dist/client-CSjIrYKS.d.ts +77 -0
- package/dist/config-UKE2E3BW.js +4 -0
- package/dist/config-UKE2E3BW.js.map +1 -0
- package/dist/crypto/index.d.ts +1 -0
- package/dist/crypto/index.js +4 -0
- package/dist/crypto/index.js.map +1 -0
- package/dist/database/index.d.ts +117 -0
- package/dist/database/index.js +7 -0
- package/dist/database/index.js.map +1 -0
- package/dist/dataloader/index.d.ts +1 -0
- package/dist/dataloader/index.js +4 -0
- package/dist/dataloader/index.js.map +1 -0
- package/dist/esm-K6H7EIWK.js +1450 -0
- package/dist/esm-K6H7EIWK.js.map +1 -0
- package/dist/event-queue/index.d.ts +6 -0
- package/dist/event-queue/index.js +10 -0
- package/dist/event-queue/index.js.map +1 -0
- package/dist/export/index.d.ts +2 -0
- package/dist/export/index.js +9 -0
- package/dist/export/index.js.map +1 -0
- package/dist/feature-flags/index.d.ts +1 -0
- package/dist/feature-flags/index.js +4 -0
- package/dist/feature-flags/index.js.map +1 -0
- package/dist/gateway/index.d.ts +4 -0
- package/dist/gateway/index.js +8 -0
- package/dist/gateway/index.js.map +1 -0
- package/dist/gateway/security/index.d.ts +2 -0
- package/dist/gateway/security/index.js +5 -0
- package/dist/gateway/security/index.js.map +1 -0
- package/dist/graph/index.d.ts +9 -0
- package/dist/graph/index.js +13 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph-emitter-Bk0FqD53.d.ts +47 -0
- package/dist/graphql/index.d.ts +2 -0
- package/dist/graphql/index.js +7 -0
- package/dist/graphql/index.js.map +1 -0
- package/dist/graphql/services/index.d.ts +24 -0
- package/dist/graphql/services/index.js +5 -0
- package/dist/graphql/services/index.js.map +1 -0
- package/dist/graphql-BAVrUgBF.d.ts +22 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.js +5 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n-DA6IPnYy.d.ts +101 -0
- package/dist/index-4gKQKZ2B.d.ts +71 -0
- package/dist/index-B18rrFru.d.ts +42 -0
- package/dist/index-B70b5mYS.d.ts +33 -0
- package/dist/index-BMq3lFjj.d.ts +247 -0
- package/dist/index-BODgvRtL.d.ts +316 -0
- package/dist/index-BS2idbnr.d.ts +874 -0
- package/dist/index-BV3G48cH.d.ts +124 -0
- package/dist/index-CHbVw5M7.d.ts +73 -0
- package/dist/index-Cq_xNjcv.d.ts +602 -0
- package/dist/index-CrQgidpx.d.ts +77 -0
- package/dist/index-CyVEg86m.d.ts +309 -0
- package/dist/index-DOcBnmMe.d.ts +166 -0
- package/dist/index-DSOpj8DI.d.ts +17 -0
- package/dist/index-DW9q22GH.d.ts +75 -0
- package/dist/index-DlFDFyWD.d.ts +55 -0
- package/dist/index-DoK0bjhH.d.ts +607 -0
- package/dist/index-Dtf6FBaD.d.ts +199 -0
- package/dist/index-KVWGHMbS.d.ts +415 -0
- package/dist/index-PaojfSdd.d.ts +71 -0
- package/dist/index-RU_M5c74.d.ts +163 -0
- package/dist/index-UhkH2eaB.d.ts +192 -0
- package/dist/index-e_18DzAg.d.ts +18 -0
- package/dist/index-jOuh_TKn.d.ts +59 -0
- package/dist/index.d.ts +584 -0
- package/dist/index.js +2626 -0
- package/dist/index.js.map +1 -0
- package/dist/init/index.d.ts +2 -0
- package/dist/init/index.js +12 -0
- package/dist/init/index.js.map +1 -0
- package/dist/instrumentation/index.d.ts +3 -0
- package/dist/instrumentation/index.js +5 -0
- package/dist/instrumentation/index.js.map +1 -0
- package/dist/layer/index.d.ts +2 -0
- package/dist/layer/index.js +6 -0
- package/dist/layer/index.js.map +1 -0
- package/dist/layer-DDip18KY.d.ts +67 -0
- package/dist/logger/index.d.ts +2 -0
- package/dist/logger/index.js +4 -0
- package/dist/logger/index.js.map +1 -0
- package/dist/middleware/index.d.ts +3 -0
- package/dist/middleware/index.js +5 -0
- package/dist/middleware/index.js.map +1 -0
- package/dist/notifications/index.d.ts +4 -0
- package/dist/notifications/index.js +7 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/observability/index.d.ts +3 -0
- package/dist/observability/index.js +5 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/pino-logger-RYLGXPHZ.js +5 -0
- package/dist/pino-logger-RYLGXPHZ.js.map +1 -0
- package/dist/prisma/generator/index.d.ts +1 -0
- package/dist/prisma/generator/index.js +228 -0
- package/dist/prisma/generator/index.js.map +1 -0
- package/dist/prisma/index.d.ts +5 -0
- package/dist/prisma/index.js +12 -0
- package/dist/prisma/index.js.map +1 -0
- package/dist/prisma-extension-krXnYnrN.d.ts +30 -0
- package/dist/rbac/index.d.ts +116 -0
- package/dist/rbac/index.js +7 -0
- package/dist/rbac/index.js.map +1 -0
- package/dist/sdk-THO3IWEE.js +136 -0
- package/dist/sdk-THO3IWEE.js.map +1 -0
- package/dist/server/index.d.ts +359 -0
- package/dist/server/index.js +884 -0
- package/dist/server/index.js.map +1 -0
- package/dist/telemetry/index.d.ts +83 -0
- package/dist/telemetry/index.js +209 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/temporal/index.d.ts +148 -0
- package/dist/temporal/index.js +6 -0
- package/dist/temporal/index.js.map +1 -0
- package/dist/tracker/index.d.ts +5 -0
- package/dist/tracker/index.js +9 -0
- package/dist/tracker/index.js.map +1 -0
- package/dist/types-Bo2wkjSP.d.ts +35 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/workspace-guard-LHBNK4TG.js +5 -0
- package/dist/workspace-guard-LHBNK4TG.js.map +1 -0
- package/package.json +241 -0
|
@@ -0,0 +1,874 @@
|
|
|
1
|
+
import { B as BurdenoffGraphQLClient } from './graphql-BAVrUgBF.js';
|
|
2
|
+
import { S as SDKContext } from './index-CHbVw5M7.js';
|
|
3
|
+
import { P as PrismaClientBase } from './client-CSjIrYKS.js';
|
|
4
|
+
import { N as NatsGraphEventEmitter, E as EntityEventRbacMetadata } from './graph-emitter-Bk0FqD53.js';
|
|
5
|
+
import { G as GraphEventEmitter, E as EntityEventType, a as GraphMiddlewareConfig, b as addGraphExtension } from './prisma-extension-krXnYnrN.js';
|
|
6
|
+
|
|
7
|
+
type GraphEventType = 'entity.created' | 'entity.updated' | 'entity.deleted' | 'relationship.created' | 'relationship.updated' | 'relationship.deleted';
|
|
8
|
+
interface GraphEvent {
|
|
9
|
+
eventId: string;
|
|
10
|
+
eventType: GraphEventType;
|
|
11
|
+
organizationId: string;
|
|
12
|
+
productSource: string;
|
|
13
|
+
timestamp: string;
|
|
14
|
+
entity: {
|
|
15
|
+
id: string;
|
|
16
|
+
type: string;
|
|
17
|
+
data: Record<string, unknown>;
|
|
18
|
+
};
|
|
19
|
+
relationship?: {
|
|
20
|
+
from: {
|
|
21
|
+
id: string;
|
|
22
|
+
type: string;
|
|
23
|
+
};
|
|
24
|
+
to: {
|
|
25
|
+
id: string;
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
type: string;
|
|
29
|
+
metadata: Record<string, unknown>;
|
|
30
|
+
};
|
|
31
|
+
metadata: {
|
|
32
|
+
userId?: string;
|
|
33
|
+
correlationId: string;
|
|
34
|
+
causedBy?: string;
|
|
35
|
+
retryCount?: number;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
interface EntityVertex {
|
|
39
|
+
_key: string;
|
|
40
|
+
_id?: string;
|
|
41
|
+
organizationId: string;
|
|
42
|
+
workspaceId?: string;
|
|
43
|
+
projectId?: string;
|
|
44
|
+
productSource: string;
|
|
45
|
+
entityType: string;
|
|
46
|
+
entityId: string;
|
|
47
|
+
title?: string;
|
|
48
|
+
isActive: boolean;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
metadata?: Record<string, unknown>;
|
|
52
|
+
isPlaceholder?: boolean;
|
|
53
|
+
}
|
|
54
|
+
interface EdgeDocument {
|
|
55
|
+
_key?: string;
|
|
56
|
+
_from: string;
|
|
57
|
+
_to: string;
|
|
58
|
+
organizationId: string;
|
|
59
|
+
productSource: string;
|
|
60
|
+
createdAt: string;
|
|
61
|
+
updatedAt: string;
|
|
62
|
+
isActive?: boolean;
|
|
63
|
+
deletedAt?: string;
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
}
|
|
66
|
+
interface RegistryEntityRbacConfig {
|
|
67
|
+
resourceTypeName: string;
|
|
68
|
+
extractName?: (data: Record<string, unknown>) => string | undefined;
|
|
69
|
+
extractIdentifier?: (data: Record<string, unknown>) => string | undefined;
|
|
70
|
+
parentResourceField?: string;
|
|
71
|
+
createResource?: boolean;
|
|
72
|
+
}
|
|
73
|
+
interface EntityGraphConfig {
|
|
74
|
+
fields?: string[];
|
|
75
|
+
collection?: string;
|
|
76
|
+
extractTitle?: (entity: Record<string, unknown>) => string;
|
|
77
|
+
enabled?: boolean;
|
|
78
|
+
rbac?: RegistryEntityRbacConfig;
|
|
79
|
+
}
|
|
80
|
+
interface RelationshipGraphConfig {
|
|
81
|
+
from: string;
|
|
82
|
+
fromField: string;
|
|
83
|
+
to: string;
|
|
84
|
+
toField?: string;
|
|
85
|
+
label: string;
|
|
86
|
+
description?: string;
|
|
87
|
+
extractMetadata?: (record: Record<string, unknown>) => Record<string, unknown>;
|
|
88
|
+
polymorphicTypeField?: string;
|
|
89
|
+
enabled?: boolean;
|
|
90
|
+
}
|
|
91
|
+
interface ModuleGraphConfig {
|
|
92
|
+
moduleName: string;
|
|
93
|
+
entities: Record<string, EntityGraphConfig>;
|
|
94
|
+
relationships?: Record<string, RelationshipGraphConfig>;
|
|
95
|
+
}
|
|
96
|
+
interface SearchFilters {
|
|
97
|
+
productSources?: string[];
|
|
98
|
+
entityTypes?: string[];
|
|
99
|
+
dateRange?: {
|
|
100
|
+
from?: string;
|
|
101
|
+
to?: string;
|
|
102
|
+
};
|
|
103
|
+
metadataFilters?: {
|
|
104
|
+
field: string;
|
|
105
|
+
operator: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'in';
|
|
106
|
+
value: unknown;
|
|
107
|
+
}[];
|
|
108
|
+
limit?: number;
|
|
109
|
+
offset?: number;
|
|
110
|
+
}
|
|
111
|
+
interface SearchResult {
|
|
112
|
+
id: string;
|
|
113
|
+
type: string;
|
|
114
|
+
productSource: string;
|
|
115
|
+
title: string;
|
|
116
|
+
description?: string;
|
|
117
|
+
metadata?: Record<string, unknown>;
|
|
118
|
+
score: number;
|
|
119
|
+
highlights?: string[];
|
|
120
|
+
url: string;
|
|
121
|
+
createdAt?: string;
|
|
122
|
+
updatedAt?: string;
|
|
123
|
+
}
|
|
124
|
+
interface ProductFacet {
|
|
125
|
+
product: string;
|
|
126
|
+
count: number;
|
|
127
|
+
}
|
|
128
|
+
interface TypeFacet {
|
|
129
|
+
type: string;
|
|
130
|
+
count: number;
|
|
131
|
+
}
|
|
132
|
+
interface SearchFacets {
|
|
133
|
+
byProduct: ProductFacet[];
|
|
134
|
+
byType: TypeFacet[];
|
|
135
|
+
}
|
|
136
|
+
interface SearchResponse {
|
|
137
|
+
entities: SearchResult[];
|
|
138
|
+
total: number;
|
|
139
|
+
hasMore: boolean;
|
|
140
|
+
facets: SearchFacets;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
interface ResolvedEntityGraphConfig extends Omit<EntityGraphConfig, 'fields'> {
|
|
144
|
+
fields: string[];
|
|
145
|
+
getOrgId?: (data: Record<string, unknown>) => string | undefined;
|
|
146
|
+
getWorkspaceId?: (data: Record<string, unknown>) => string | undefined;
|
|
147
|
+
rbac?: RegistryEntityRbacConfig;
|
|
148
|
+
}
|
|
149
|
+
declare class GraphRegistry {
|
|
150
|
+
private static entityMappings;
|
|
151
|
+
private static relationshipMappings;
|
|
152
|
+
private static registeredModules;
|
|
153
|
+
private static resolveFields;
|
|
154
|
+
static registerModule(config: ModuleGraphConfig): void;
|
|
155
|
+
static getEntityConfig(entityType: string): ResolvedEntityGraphConfig | undefined;
|
|
156
|
+
static getRelationshipConfig(relationshipType: string): RelationshipGraphConfig | undefined;
|
|
157
|
+
static getAllEntityTypes(): string[];
|
|
158
|
+
static getAllRelationshipTypes(): string[];
|
|
159
|
+
static getRegisteredModules(): string[];
|
|
160
|
+
static isEntityRegistered(entityType: string): boolean;
|
|
161
|
+
static isRelationshipRegistered(relationshipType: string): boolean;
|
|
162
|
+
static getOrganizationId(entityType: string, data: Record<string, unknown>): string | undefined;
|
|
163
|
+
static getWorkspaceId(entityType: string, data: Record<string, unknown>): string | undefined;
|
|
164
|
+
static getRbacConfig(entityType: string): RegistryEntityRbacConfig | undefined;
|
|
165
|
+
static resolveRbacMetadata(entityType: string, entityData: Record<string, unknown>): {
|
|
166
|
+
resourceTypeName: string;
|
|
167
|
+
name?: string;
|
|
168
|
+
identifier?: string;
|
|
169
|
+
parentResourceIdentifier?: string;
|
|
170
|
+
createResource?: boolean;
|
|
171
|
+
} | undefined;
|
|
172
|
+
static getStats(): {
|
|
173
|
+
modules: number;
|
|
174
|
+
entities: number;
|
|
175
|
+
relationships: number;
|
|
176
|
+
collections: Set<string>;
|
|
177
|
+
edgeTypes: Set<string>;
|
|
178
|
+
};
|
|
179
|
+
static clear(): void;
|
|
180
|
+
static getRelationshipsForEntity(entityType: string): Array<[string, RelationshipGraphConfig]>;
|
|
181
|
+
static printStatus(): void;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
declare function createEntityEvent(eventType: GraphEventType, organizationId: string, entity: {
|
|
185
|
+
id: string;
|
|
186
|
+
type: string;
|
|
187
|
+
data: Record<string, unknown>;
|
|
188
|
+
}, metadata?: {
|
|
189
|
+
userId?: string;
|
|
190
|
+
correlationId?: string;
|
|
191
|
+
workspaceId?: string;
|
|
192
|
+
projectId?: string;
|
|
193
|
+
}, productSource?: string): GraphEvent;
|
|
194
|
+
declare function createRelationshipEvent(eventType: GraphEventType, organizationId: string, relationship: {
|
|
195
|
+
from: {
|
|
196
|
+
id: string;
|
|
197
|
+
type: string;
|
|
198
|
+
};
|
|
199
|
+
to: {
|
|
200
|
+
id: string;
|
|
201
|
+
type: string;
|
|
202
|
+
};
|
|
203
|
+
type: string;
|
|
204
|
+
metadata: Record<string, unknown>;
|
|
205
|
+
}, metadata?: {
|
|
206
|
+
userId?: string;
|
|
207
|
+
correlationId?: string;
|
|
208
|
+
}, productSource?: string): GraphEvent;
|
|
209
|
+
declare function extractMinimalFields(modelName: string, entity: Record<string, unknown>): Record<string, unknown>;
|
|
210
|
+
declare function parseRelationship(modelName: string, relationship: Record<string, unknown>): {
|
|
211
|
+
from: {
|
|
212
|
+
id: string;
|
|
213
|
+
type: string;
|
|
214
|
+
};
|
|
215
|
+
to: {
|
|
216
|
+
id: string;
|
|
217
|
+
type: string;
|
|
218
|
+
};
|
|
219
|
+
relationshipType: string;
|
|
220
|
+
metadata: Record<string, unknown>;
|
|
221
|
+
};
|
|
222
|
+
declare function getCollectionForEntity(entityType: string): string;
|
|
223
|
+
declare function extractEntityTitle(entityType: string, entity: Record<string, unknown>): string;
|
|
224
|
+
declare function shouldSyncEntity(entityType: string): boolean;
|
|
225
|
+
declare function shouldSyncRelationship(relationshipType: string): boolean;
|
|
226
|
+
|
|
227
|
+
type FieldMapper<T = string> = (data: Record<string, unknown>) => T | undefined;
|
|
228
|
+
interface EntityRbacConfig$1 {
|
|
229
|
+
resourceTypeName: string;
|
|
230
|
+
extractName?: (data: Record<string, unknown>) => string | undefined;
|
|
231
|
+
extractIdentifier?: (data: Record<string, unknown>) => string | undefined;
|
|
232
|
+
parentResourceField?: string;
|
|
233
|
+
createResource?: boolean;
|
|
234
|
+
}
|
|
235
|
+
interface GenericEntityConfig {
|
|
236
|
+
collection?: string;
|
|
237
|
+
fields: string[];
|
|
238
|
+
getWorkspaceId: FieldMapper<string>;
|
|
239
|
+
getOrgId: FieldMapper<string>;
|
|
240
|
+
getProjectId?: FieldMapper<string>;
|
|
241
|
+
extractTitle?: FieldMapper<string>;
|
|
242
|
+
enabled?: boolean;
|
|
243
|
+
rbac?: EntityRbacConfig$1;
|
|
244
|
+
}
|
|
245
|
+
interface GenericRelationshipConfig {
|
|
246
|
+
from: string;
|
|
247
|
+
to: string;
|
|
248
|
+
fromField: string;
|
|
249
|
+
toField?: string;
|
|
250
|
+
label: string;
|
|
251
|
+
description?: string;
|
|
252
|
+
extractMetadata?: (record: Record<string, unknown>) => Record<string, unknown>;
|
|
253
|
+
polymorphicTypeField?: string;
|
|
254
|
+
enabled?: boolean;
|
|
255
|
+
}
|
|
256
|
+
interface GenericGraphConfig {
|
|
257
|
+
moduleName: string;
|
|
258
|
+
entities: Record<string, GenericEntityConfig>;
|
|
259
|
+
relationships?: Record<string, GenericRelationshipConfig>;
|
|
260
|
+
}
|
|
261
|
+
type ValidationErrorType = 'MISSING_WORKSPACE_ID' | 'MISSING_ORG_ID' | 'ORPHANED_ENTITY' | 'INVALID_ENTITY_TYPE' | 'INVALID_RELATIONSHIP' | 'DUPLICATE_ENTITY_TYPE' | 'DUPLICATE_RELATIONSHIP_LABEL' | 'CIRCULAR_DEPENDENCY';
|
|
262
|
+
interface GraphValidationError {
|
|
263
|
+
type: ValidationErrorType;
|
|
264
|
+
entityType?: string;
|
|
265
|
+
relationshipKey?: string;
|
|
266
|
+
message: string;
|
|
267
|
+
data?: Record<string, unknown>;
|
|
268
|
+
}
|
|
269
|
+
interface GraphValidationResult {
|
|
270
|
+
valid: boolean;
|
|
271
|
+
errors: GraphValidationError[];
|
|
272
|
+
warnings: string[];
|
|
273
|
+
}
|
|
274
|
+
interface ExtractedEntityData {
|
|
275
|
+
id: string;
|
|
276
|
+
type: string;
|
|
277
|
+
workspaceId: string;
|
|
278
|
+
organizationId: string;
|
|
279
|
+
projectId?: string;
|
|
280
|
+
title: string;
|
|
281
|
+
fields: Record<string, unknown>;
|
|
282
|
+
}
|
|
283
|
+
interface ExtractedRelationshipData {
|
|
284
|
+
from: {
|
|
285
|
+
id: string;
|
|
286
|
+
type: string;
|
|
287
|
+
};
|
|
288
|
+
to: {
|
|
289
|
+
id: string;
|
|
290
|
+
type: string;
|
|
291
|
+
};
|
|
292
|
+
label: string;
|
|
293
|
+
metadata?: Record<string, unknown>;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
interface PrismaGraphIntegrationOptions<TPrismaClient = unknown> {
|
|
297
|
+
serviceName: string;
|
|
298
|
+
graphConfig: GenericGraphConfig;
|
|
299
|
+
productName?: string;
|
|
300
|
+
validateRuntime?: boolean;
|
|
301
|
+
autoInit?: boolean;
|
|
302
|
+
createPrismaClient: () => TPrismaClient;
|
|
303
|
+
}
|
|
304
|
+
declare function createPrismaGraphIntegration<TPrismaClient extends PrismaClientBase>(options: PrismaGraphIntegrationOptions<TPrismaClient>): {
|
|
305
|
+
initializeGraphEmitter: () => Promise<void>;
|
|
306
|
+
db: () => {
|
|
307
|
+
client: TPrismaClient;
|
|
308
|
+
};
|
|
309
|
+
prisma: TPrismaClient;
|
|
310
|
+
cleanup: () => Promise<void>;
|
|
311
|
+
getGraphEmitter: () => NatsGraphEventEmitter | null;
|
|
312
|
+
isInitialized: () => boolean;
|
|
313
|
+
};
|
|
314
|
+
type PrismaGraphIntegration<TPrismaClient extends PrismaClientBase> = ReturnType<typeof createPrismaGraphIntegration<TPrismaClient>>;
|
|
315
|
+
|
|
316
|
+
interface GraphEventPublishOptions {
|
|
317
|
+
userId?: string;
|
|
318
|
+
correlationId?: string;
|
|
319
|
+
}
|
|
320
|
+
interface GraphRelationshipData {
|
|
321
|
+
from: {
|
|
322
|
+
id: string;
|
|
323
|
+
type: string;
|
|
324
|
+
};
|
|
325
|
+
to: {
|
|
326
|
+
id: string;
|
|
327
|
+
type: string;
|
|
328
|
+
};
|
|
329
|
+
relationType: string;
|
|
330
|
+
metadata?: Record<string, unknown>;
|
|
331
|
+
}
|
|
332
|
+
interface GraphEntityConfig {
|
|
333
|
+
type: string;
|
|
334
|
+
getOrgId?: (data: Record<string, unknown>) => string | undefined;
|
|
335
|
+
getWorkspaceId?: (data: Record<string, unknown>) => string | undefined;
|
|
336
|
+
onCreated?: (data: Record<string, unknown>, publisher: GraphEventsPublisher, options?: GraphEventPublishOptions) => Promise<void>;
|
|
337
|
+
onUpdated?: (data: Record<string, unknown>, publisher: GraphEventsPublisher, options?: GraphEventPublishOptions) => Promise<void>;
|
|
338
|
+
onDeleted?: (data: Record<string, unknown>, publisher: GraphEventsPublisher, options?: GraphEventPublishOptions) => Promise<void>;
|
|
339
|
+
}
|
|
340
|
+
interface GraphEventsHelperConfig {
|
|
341
|
+
moduleName: string;
|
|
342
|
+
entities: Record<string, GraphEntityConfig>;
|
|
343
|
+
}
|
|
344
|
+
interface EntityEventData {
|
|
345
|
+
id: string;
|
|
346
|
+
type: string;
|
|
347
|
+
data: Record<string, unknown>;
|
|
348
|
+
organizationId?: string;
|
|
349
|
+
workspaceId?: string;
|
|
350
|
+
}
|
|
351
|
+
declare class GraphEventsPublisher {
|
|
352
|
+
private static instance;
|
|
353
|
+
private productName;
|
|
354
|
+
private initialized;
|
|
355
|
+
private emitter;
|
|
356
|
+
constructor(productName?: string);
|
|
357
|
+
static getInstance(productName?: string): GraphEventsPublisher;
|
|
358
|
+
setProductName(name: string): void;
|
|
359
|
+
initialize(): Promise<void>;
|
|
360
|
+
private ensureInitialized;
|
|
361
|
+
publishEntityCreated(entity: EntityEventData, options?: GraphEventPublishOptions): Promise<void>;
|
|
362
|
+
publishEntityUpdated(entity: EntityEventData, options?: GraphEventPublishOptions): Promise<void>;
|
|
363
|
+
publishEntityDeleted(entity: EntityEventData, options?: GraphEventPublishOptions): Promise<void>;
|
|
364
|
+
publishRelationshipCreated(relationship: GraphRelationshipData, organizationId: string, options?: GraphEventPublishOptions): Promise<void>;
|
|
365
|
+
publishRelationshipDeleted(relationship: GraphRelationshipData, organizationId: string, options?: GraphEventPublishOptions): Promise<void>;
|
|
366
|
+
private publishEntityEvent;
|
|
367
|
+
private publishRelationshipEvent;
|
|
368
|
+
shutdown(): Promise<void>;
|
|
369
|
+
static reset(): void;
|
|
370
|
+
}
|
|
371
|
+
declare function getGraphEventsPublisher(productName?: string): GraphEventsPublisher;
|
|
372
|
+
type EntityEventHandler = (data: Record<string, unknown>, options?: GraphEventPublishOptions) => Promise<void>;
|
|
373
|
+
interface EntityEvents {
|
|
374
|
+
created: EntityEventHandler;
|
|
375
|
+
updated: EntityEventHandler;
|
|
376
|
+
deleted: EntityEventHandler;
|
|
377
|
+
}
|
|
378
|
+
type GraphEventsHelper = Record<string, EntityEvents>;
|
|
379
|
+
declare function createGraphEventsHelper(config: GraphEventsHelperConfig): GraphEventsHelper;
|
|
380
|
+
|
|
381
|
+
interface GraphEntityExport {
|
|
382
|
+
id: string;
|
|
383
|
+
type: string;
|
|
384
|
+
data: Record<string, unknown>;
|
|
385
|
+
organizationId?: string;
|
|
386
|
+
workspaceId?: string;
|
|
387
|
+
createdAt: string;
|
|
388
|
+
updatedAt: string;
|
|
389
|
+
}
|
|
390
|
+
interface GraphRelationshipExport {
|
|
391
|
+
id: string;
|
|
392
|
+
type: string;
|
|
393
|
+
fromId: string;
|
|
394
|
+
fromType: string;
|
|
395
|
+
toId: string;
|
|
396
|
+
toType: string;
|
|
397
|
+
metadata: Record<string, unknown>;
|
|
398
|
+
createdAt: string;
|
|
399
|
+
updatedAt: string;
|
|
400
|
+
}
|
|
401
|
+
interface GraphExportResponse {
|
|
402
|
+
moduleName: string;
|
|
403
|
+
productSource: string;
|
|
404
|
+
exportedAt: string;
|
|
405
|
+
schema: {
|
|
406
|
+
entities: Record<string, {
|
|
407
|
+
fields: string[];
|
|
408
|
+
collection: string;
|
|
409
|
+
}>;
|
|
410
|
+
relationships: Record<string, {
|
|
411
|
+
from: string;
|
|
412
|
+
fromType: string;
|
|
413
|
+
to: string;
|
|
414
|
+
toType: string;
|
|
415
|
+
edgeType: string;
|
|
416
|
+
}>;
|
|
417
|
+
};
|
|
418
|
+
data: {
|
|
419
|
+
entities: Record<string, GraphEntityExport[]>;
|
|
420
|
+
relationships: GraphRelationshipExport[];
|
|
421
|
+
};
|
|
422
|
+
stats: {
|
|
423
|
+
totalEntities: number;
|
|
424
|
+
totalRelationships: number;
|
|
425
|
+
entityCounts: Record<string, number>;
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
type EntityFetcher$1<T = Record<string, unknown>> = (organizationId?: string, workspaceId?: string) => Promise<T[]>;
|
|
429
|
+
type RelationshipFetcher$1 = (organizationId?: string, workspaceId?: string) => Promise<GraphRelationshipExport[]>;
|
|
430
|
+
interface GraphExportServiceConfig {
|
|
431
|
+
moduleName: string;
|
|
432
|
+
config: ModuleGraphConfig;
|
|
433
|
+
fetchers: Record<string, EntityFetcher$1>;
|
|
434
|
+
relationshipFetchers?: Record<string, RelationshipFetcher$1>;
|
|
435
|
+
transformEntity?: (type: string, item: Record<string, unknown>) => GraphEntityExport;
|
|
436
|
+
}
|
|
437
|
+
declare class GraphExportService {
|
|
438
|
+
private readonly moduleName;
|
|
439
|
+
private readonly config;
|
|
440
|
+
private readonly fetchers;
|
|
441
|
+
private readonly relationshipFetchers;
|
|
442
|
+
private readonly customTransformer?;
|
|
443
|
+
constructor(serviceConfig: GraphExportServiceConfig);
|
|
444
|
+
getSchema(): {
|
|
445
|
+
moduleName: string;
|
|
446
|
+
entities: Record<string, {
|
|
447
|
+
fields: string[];
|
|
448
|
+
collection: string;
|
|
449
|
+
}>;
|
|
450
|
+
relationships: Record<string, {
|
|
451
|
+
from: string;
|
|
452
|
+
fromType: string;
|
|
453
|
+
to: string;
|
|
454
|
+
toType: string;
|
|
455
|
+
edgeType: string;
|
|
456
|
+
}>;
|
|
457
|
+
};
|
|
458
|
+
exportEntities(organizationId?: string, workspaceId?: string, entityTypes?: string[]): Promise<Record<string, GraphEntityExport[]>>;
|
|
459
|
+
exportRelationships(organizationId?: string, workspaceId?: string): Promise<GraphRelationshipExport[]>;
|
|
460
|
+
exportAll(organizationId?: string, workspaceId?: string): Promise<GraphExportResponse>;
|
|
461
|
+
private transformEntity;
|
|
462
|
+
}
|
|
463
|
+
declare function createGraphExportService(config: GraphExportServiceConfig): GraphExportService;
|
|
464
|
+
declare function createRelationshipFromEntity(entity: Record<string, unknown>, relationConfig: RelationshipGraphConfig, relationType: string): GraphRelationshipExport | null;
|
|
465
|
+
|
|
466
|
+
interface GraphEventOptions {
|
|
467
|
+
actorId?: string;
|
|
468
|
+
correlationId?: string;
|
|
469
|
+
}
|
|
470
|
+
interface RelationshipEventData {
|
|
471
|
+
from: {
|
|
472
|
+
id: string;
|
|
473
|
+
type: string;
|
|
474
|
+
};
|
|
475
|
+
to: {
|
|
476
|
+
id: string;
|
|
477
|
+
type: string;
|
|
478
|
+
};
|
|
479
|
+
relationType: string;
|
|
480
|
+
metadata?: Record<string, unknown>;
|
|
481
|
+
}
|
|
482
|
+
interface EntityEventContext {
|
|
483
|
+
publishRelationship: (data: RelationshipEventData, orgId?: string) => Promise<void>;
|
|
484
|
+
deleteRelationship: (data: RelationshipEventData, orgId?: string) => Promise<void>;
|
|
485
|
+
getOrgId: (data: Record<string, unknown>) => string | undefined;
|
|
486
|
+
getWorkspaceId: (data: Record<string, unknown>) => string | undefined;
|
|
487
|
+
}
|
|
488
|
+
type EntityEventHook = (data: Record<string, unknown>, ctx: EntityEventContext, options?: GraphEventOptions) => Promise<void>;
|
|
489
|
+
type EntityFetcher<T = Record<string, unknown>> = (organizationId?: string, workspaceId?: string) => Promise<T[]>;
|
|
490
|
+
interface RelationshipExportData {
|
|
491
|
+
id: string;
|
|
492
|
+
fromId: string;
|
|
493
|
+
toId: string;
|
|
494
|
+
metadata?: Record<string, unknown>;
|
|
495
|
+
createdAt?: string;
|
|
496
|
+
updatedAt?: string;
|
|
497
|
+
}
|
|
498
|
+
type RelationshipFetcher = (organizationId?: string, workspaceId?: string) => Promise<RelationshipExportData[]>;
|
|
499
|
+
interface EntityRbacConfig {
|
|
500
|
+
resourceTypeName: string;
|
|
501
|
+
extractName?: (data: Record<string, unknown>) => string | undefined;
|
|
502
|
+
extractIdentifier?: (data: Record<string, unknown>) => string | undefined;
|
|
503
|
+
parentResourceField?: string;
|
|
504
|
+
createResource?: boolean;
|
|
505
|
+
}
|
|
506
|
+
interface EntityDefinition<T = Record<string, unknown>> {
|
|
507
|
+
type: string;
|
|
508
|
+
fields?: string[];
|
|
509
|
+
collection?: string;
|
|
510
|
+
getOrgId?: (data: Record<string, unknown>) => string | undefined;
|
|
511
|
+
getWorkspaceId?: (data: Record<string, unknown>) => string | undefined;
|
|
512
|
+
onCreated?: EntityEventHook;
|
|
513
|
+
onUpdated?: EntityEventHook;
|
|
514
|
+
onDeleted?: EntityEventHook;
|
|
515
|
+
fetch?: EntityFetcher<T>;
|
|
516
|
+
rbac?: EntityRbacConfig;
|
|
517
|
+
}
|
|
518
|
+
interface RelationshipDefinition {
|
|
519
|
+
fromType: string;
|
|
520
|
+
toType: string;
|
|
521
|
+
edgeType: string;
|
|
522
|
+
extractMetadata?: (record: Record<string, unknown>) => Record<string, unknown>;
|
|
523
|
+
fetch?: RelationshipFetcher;
|
|
524
|
+
}
|
|
525
|
+
interface ModuleGraphDefinition {
|
|
526
|
+
moduleName: string;
|
|
527
|
+
productSource?: string;
|
|
528
|
+
entities: Record<string, EntityDefinition>;
|
|
529
|
+
relationships?: Record<string, RelationshipDefinition>;
|
|
530
|
+
}
|
|
531
|
+
interface EntityEventMethods {
|
|
532
|
+
created: (data: Record<string, unknown>, options?: GraphEventOptions) => Promise<void>;
|
|
533
|
+
updated: (data: Record<string, unknown>, options?: GraphEventOptions) => Promise<void>;
|
|
534
|
+
deleted: (data: Record<string, unknown>, options?: GraphEventOptions) => Promise<void>;
|
|
535
|
+
}
|
|
536
|
+
interface EntityExport {
|
|
537
|
+
id: string;
|
|
538
|
+
type: string;
|
|
539
|
+
data: Record<string, unknown>;
|
|
540
|
+
organizationId?: string;
|
|
541
|
+
workspaceId?: string;
|
|
542
|
+
createdAt: string;
|
|
543
|
+
updatedAt: string;
|
|
544
|
+
}
|
|
545
|
+
interface RelationshipExport {
|
|
546
|
+
id: string;
|
|
547
|
+
type: string;
|
|
548
|
+
fromId: string;
|
|
549
|
+
fromType: string;
|
|
550
|
+
toId: string;
|
|
551
|
+
toType: string;
|
|
552
|
+
metadata: Record<string, unknown>;
|
|
553
|
+
createdAt: string;
|
|
554
|
+
updatedAt: string;
|
|
555
|
+
}
|
|
556
|
+
interface GraphSchema {
|
|
557
|
+
moduleName: string;
|
|
558
|
+
entities: Record<string, {
|
|
559
|
+
fields: string[];
|
|
560
|
+
collection: string;
|
|
561
|
+
}>;
|
|
562
|
+
relationships: Record<string, {
|
|
563
|
+
fromType: string;
|
|
564
|
+
toType: string;
|
|
565
|
+
edgeType: string;
|
|
566
|
+
}>;
|
|
567
|
+
}
|
|
568
|
+
interface ExportResponse {
|
|
569
|
+
moduleName: string;
|
|
570
|
+
productSource: string;
|
|
571
|
+
exportedAt: string;
|
|
572
|
+
schema: GraphSchema;
|
|
573
|
+
data: {
|
|
574
|
+
entities: Record<string, EntityExport[]>;
|
|
575
|
+
relationships: RelationshipExport[];
|
|
576
|
+
};
|
|
577
|
+
stats: {
|
|
578
|
+
totalEntities: number;
|
|
579
|
+
totalRelationships: number;
|
|
580
|
+
entityCounts: Record<string, number>;
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
interface ModuleGraph {
|
|
584
|
+
readonly moduleName: string;
|
|
585
|
+
readonly events: Record<string, EntityEventMethods>;
|
|
586
|
+
initialize(): Promise<void>;
|
|
587
|
+
shutdown(): Promise<void>;
|
|
588
|
+
getSchema(): GraphSchema;
|
|
589
|
+
exportEntities(organizationId?: string, workspaceId?: string, entityTypes?: string[]): Promise<Record<string, EntityExport[]>>;
|
|
590
|
+
exportRelationships(organizationId?: string, workspaceId?: string): Promise<RelationshipExport[]>;
|
|
591
|
+
exportAll(organizationId?: string, workspaceId?: string): Promise<ExportResponse>;
|
|
592
|
+
getPublisher(): GraphEventsPublisherInternal;
|
|
593
|
+
}
|
|
594
|
+
declare class GraphEventsPublisherInternal {
|
|
595
|
+
private productName;
|
|
596
|
+
private initialized;
|
|
597
|
+
private emitter;
|
|
598
|
+
constructor(productName: string);
|
|
599
|
+
initialize(): Promise<void>;
|
|
600
|
+
private ensureInitialized;
|
|
601
|
+
publishEntityCreated(entity: {
|
|
602
|
+
id: string;
|
|
603
|
+
type: string;
|
|
604
|
+
data: Record<string, unknown>;
|
|
605
|
+
organizationId?: string;
|
|
606
|
+
workspaceId?: string;
|
|
607
|
+
}, options?: GraphEventOptions, rbac?: EntityEventRbacMetadata): Promise<void>;
|
|
608
|
+
publishEntityUpdated(entity: {
|
|
609
|
+
id: string;
|
|
610
|
+
type: string;
|
|
611
|
+
data: Record<string, unknown>;
|
|
612
|
+
organizationId?: string;
|
|
613
|
+
workspaceId?: string;
|
|
614
|
+
}, options?: GraphEventOptions, rbac?: EntityEventRbacMetadata): Promise<void>;
|
|
615
|
+
publishEntityDeleted(entity: {
|
|
616
|
+
id: string;
|
|
617
|
+
type: string;
|
|
618
|
+
data: Record<string, unknown>;
|
|
619
|
+
organizationId?: string;
|
|
620
|
+
workspaceId?: string;
|
|
621
|
+
}, options?: GraphEventOptions, rbac?: EntityEventRbacMetadata): Promise<void>;
|
|
622
|
+
publishRelationshipCreated(relationship: RelationshipEventData, organizationId: string, options?: GraphEventOptions): Promise<void>;
|
|
623
|
+
publishRelationshipDeleted(relationship: RelationshipEventData, organizationId: string, options?: GraphEventOptions): Promise<void>;
|
|
624
|
+
private publishEntityEvent;
|
|
625
|
+
private publishRelationshipEvent;
|
|
626
|
+
shutdown(): Promise<void>;
|
|
627
|
+
}
|
|
628
|
+
declare function defineModuleGraph(definition: ModuleGraphDefinition): ModuleGraph;
|
|
629
|
+
|
|
630
|
+
declare const STANDARD_FIELDS: readonly ["id", "createdAt", "updatedAt"];
|
|
631
|
+
declare const SOFT_DELETE_FIELDS: readonly ["deletedAt"];
|
|
632
|
+
declare const AUDIT_FIELDS: readonly ["metadata", "context"];
|
|
633
|
+
declare const TENANT_FIELDS: readonly ["workspaceId", "tenantId"];
|
|
634
|
+
interface DefineEntityConfigOptions extends Omit<GenericEntityConfig, 'fields'> {
|
|
635
|
+
fields?: string[];
|
|
636
|
+
model?: string;
|
|
637
|
+
exclude?: string[];
|
|
638
|
+
include?: string[];
|
|
639
|
+
softDelete?: boolean;
|
|
640
|
+
multiTenant?: boolean;
|
|
641
|
+
audit?: boolean;
|
|
642
|
+
}
|
|
643
|
+
interface DefineRelationshipConfigOptions extends Omit<GenericRelationshipConfig, 'label' | 'toField'> {
|
|
644
|
+
label?: string;
|
|
645
|
+
toField?: string;
|
|
646
|
+
}
|
|
647
|
+
interface PrismaFieldsModule {
|
|
648
|
+
getScalarFields: (modelName: string) => string[];
|
|
649
|
+
hasModel: (modelName: string) => boolean;
|
|
650
|
+
getAllModelNames: () => string[];
|
|
651
|
+
}
|
|
652
|
+
interface DefineGraphConfigOptions {
|
|
653
|
+
moduleName: string;
|
|
654
|
+
entities: Record<string, DefineEntityConfigOptions>;
|
|
655
|
+
relationships?: Record<string, DefineRelationshipConfigOptions>;
|
|
656
|
+
prismaFieldsModule?: PrismaFieldsModule;
|
|
657
|
+
}
|
|
658
|
+
declare function defineGraphConfig(options: DefineGraphConfigOptions): GenericGraphConfig;
|
|
659
|
+
declare function defineEntity(config: GenericEntityConfig): GenericEntityConfig;
|
|
660
|
+
declare function defineRelationship(config: GenericRelationshipConfig): GenericRelationshipConfig;
|
|
661
|
+
|
|
662
|
+
interface InitializeGraphOptions {
|
|
663
|
+
productName: string;
|
|
664
|
+
eventEmitter: GraphEventEmitter;
|
|
665
|
+
monitoredEntityTypes?: string[];
|
|
666
|
+
enabled?: boolean;
|
|
667
|
+
validateRuntime?: boolean;
|
|
668
|
+
}
|
|
669
|
+
declare function initializeGraph<TPrisma>(prismaClient: TPrisma, config: GenericGraphConfig, options: InitializeGraphOptions): TPrisma;
|
|
670
|
+
declare function isGraphInitialized(moduleName: string): boolean;
|
|
671
|
+
declare function getGraphStats(): {
|
|
672
|
+
modules: number;
|
|
673
|
+
entities: number;
|
|
674
|
+
relationships: number;
|
|
675
|
+
registeredModules: string[];
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
interface GraphNode {
|
|
679
|
+
id: string;
|
|
680
|
+
type: string;
|
|
681
|
+
properties: Record<string, unknown>;
|
|
682
|
+
workspaceId?: string;
|
|
683
|
+
organizationId?: string;
|
|
684
|
+
createdAt: string;
|
|
685
|
+
updatedAt: string;
|
|
686
|
+
}
|
|
687
|
+
interface GraphEdge {
|
|
688
|
+
id: string;
|
|
689
|
+
from: string;
|
|
690
|
+
to: string;
|
|
691
|
+
type: string;
|
|
692
|
+
properties?: Record<string, unknown>;
|
|
693
|
+
workspaceId?: string;
|
|
694
|
+
organizationId?: string;
|
|
695
|
+
createdAt: string;
|
|
696
|
+
}
|
|
697
|
+
interface CreateNodeOptions {
|
|
698
|
+
type: string;
|
|
699
|
+
properties: Record<string, unknown>;
|
|
700
|
+
workspaceId?: string;
|
|
701
|
+
organizationId?: string;
|
|
702
|
+
}
|
|
703
|
+
interface CreateEdgeOptions {
|
|
704
|
+
from: string;
|
|
705
|
+
to: string;
|
|
706
|
+
type: string;
|
|
707
|
+
properties?: Record<string, unknown>;
|
|
708
|
+
workspaceId?: string;
|
|
709
|
+
organizationId?: string;
|
|
710
|
+
}
|
|
711
|
+
type TraverseDirection = 'outbound' | 'inbound' | 'any';
|
|
712
|
+
interface TraverseOptions {
|
|
713
|
+
startNode: string;
|
|
714
|
+
direction?: TraverseDirection;
|
|
715
|
+
edgeTypes?: string[];
|
|
716
|
+
minDepth?: number;
|
|
717
|
+
maxDepth?: number;
|
|
718
|
+
limit?: number;
|
|
719
|
+
}
|
|
720
|
+
interface TraverseResult {
|
|
721
|
+
nodes: GraphNode[];
|
|
722
|
+
edges: GraphEdge[];
|
|
723
|
+
paths: Array<{
|
|
724
|
+
nodes: GraphNode[];
|
|
725
|
+
edges: GraphEdge[];
|
|
726
|
+
}>;
|
|
727
|
+
}
|
|
728
|
+
interface QueryGraphOptions {
|
|
729
|
+
query: string;
|
|
730
|
+
bindVars?: Record<string, unknown>;
|
|
731
|
+
limit?: number;
|
|
732
|
+
}
|
|
733
|
+
declare class GraphModule {
|
|
734
|
+
private client;
|
|
735
|
+
private context;
|
|
736
|
+
constructor(client: BurdenoffGraphQLClient, context: SDKContext);
|
|
737
|
+
createNode(options: CreateNodeOptions): Promise<GraphNode>;
|
|
738
|
+
createEdge(options: CreateEdgeOptions): Promise<GraphEdge>;
|
|
739
|
+
getNode(nodeId: string): Promise<GraphNode | null>;
|
|
740
|
+
updateNode(nodeId: string, properties: Record<string, unknown>): Promise<GraphNode>;
|
|
741
|
+
deleteNode(nodeId: string): Promise<boolean>;
|
|
742
|
+
deleteEdge(edgeId: string): Promise<boolean>;
|
|
743
|
+
traverse(options: TraverseOptions): Promise<TraverseResult>;
|
|
744
|
+
findShortestPath(fromNode: string, toNode: string, options?: {
|
|
745
|
+
edgeTypes?: string[];
|
|
746
|
+
maxDepth?: number;
|
|
747
|
+
}): Promise<{
|
|
748
|
+
nodes: GraphNode[];
|
|
749
|
+
edges: GraphEdge[];
|
|
750
|
+
distance: number;
|
|
751
|
+
} | null>;
|
|
752
|
+
query<T = unknown>(options: QueryGraphOptions): Promise<T[]>;
|
|
753
|
+
getNeighbors(nodeId: string, options?: {
|
|
754
|
+
direction?: 'outbound' | 'inbound' | 'any';
|
|
755
|
+
edgeTypes?: string[];
|
|
756
|
+
limit?: number;
|
|
757
|
+
}): Promise<{
|
|
758
|
+
nodes: GraphNode[];
|
|
759
|
+
edges: GraphEdge[];
|
|
760
|
+
}>;
|
|
761
|
+
getNodeDegree(nodeId: string, direction?: 'outbound' | 'inbound' | 'any'): Promise<{
|
|
762
|
+
inbound: number;
|
|
763
|
+
outbound: number;
|
|
764
|
+
total: number;
|
|
765
|
+
}>;
|
|
766
|
+
findNodes(type: string, filters: Record<string, unknown>, options?: {
|
|
767
|
+
limit?: number;
|
|
768
|
+
offset?: number;
|
|
769
|
+
}): Promise<{
|
|
770
|
+
nodes: GraphNode[];
|
|
771
|
+
total: number;
|
|
772
|
+
}>;
|
|
773
|
+
createNodesBatch(nodes: CreateNodeOptions[]): Promise<GraphNode[]>;
|
|
774
|
+
createEdgesBatch(edges: CreateEdgeOptions[]): Promise<GraphEdge[]>;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
declare const index_AUDIT_FIELDS: typeof AUDIT_FIELDS;
|
|
778
|
+
type index_CreateEdgeOptions = CreateEdgeOptions;
|
|
779
|
+
type index_CreateNodeOptions = CreateNodeOptions;
|
|
780
|
+
type index_DefineEntityConfigOptions = DefineEntityConfigOptions;
|
|
781
|
+
type index_DefineGraphConfigOptions = DefineGraphConfigOptions;
|
|
782
|
+
type index_DefineRelationshipConfigOptions = DefineRelationshipConfigOptions;
|
|
783
|
+
type index_EdgeDocument = EdgeDocument;
|
|
784
|
+
type index_EntityDefinition<T = Record<string, unknown>> = EntityDefinition<T>;
|
|
785
|
+
type index_EntityEventContext = EntityEventContext;
|
|
786
|
+
type index_EntityEventData = EntityEventData;
|
|
787
|
+
type index_EntityEventHook = EntityEventHook;
|
|
788
|
+
declare const index_EntityEventType: typeof EntityEventType;
|
|
789
|
+
type index_EntityGraphConfig = EntityGraphConfig;
|
|
790
|
+
type index_EntityRbacConfig = EntityRbacConfig;
|
|
791
|
+
type index_EntityVertex = EntityVertex;
|
|
792
|
+
type index_ExtractedEntityData = ExtractedEntityData;
|
|
793
|
+
type index_ExtractedRelationshipData = ExtractedRelationshipData;
|
|
794
|
+
type index_FieldMapper<T = string> = FieldMapper<T>;
|
|
795
|
+
type index_GenericEntityConfig = GenericEntityConfig;
|
|
796
|
+
type index_GenericGraphConfig = GenericGraphConfig;
|
|
797
|
+
type index_GenericRelationshipConfig = GenericRelationshipConfig;
|
|
798
|
+
type index_GraphEdge = GraphEdge;
|
|
799
|
+
type index_GraphEntityConfig = GraphEntityConfig;
|
|
800
|
+
type index_GraphEntityExport = GraphEntityExport;
|
|
801
|
+
type index_GraphEvent = GraphEvent;
|
|
802
|
+
declare const index_GraphEventEmitter: typeof GraphEventEmitter;
|
|
803
|
+
type index_GraphEventOptions = GraphEventOptions;
|
|
804
|
+
type index_GraphEventPublishOptions = GraphEventPublishOptions;
|
|
805
|
+
type index_GraphEventType = GraphEventType;
|
|
806
|
+
type index_GraphEventsHelper = GraphEventsHelper;
|
|
807
|
+
type index_GraphEventsHelperConfig = GraphEventsHelperConfig;
|
|
808
|
+
type index_GraphEventsPublisher = GraphEventsPublisher;
|
|
809
|
+
declare const index_GraphEventsPublisher: typeof GraphEventsPublisher;
|
|
810
|
+
type index_GraphExportResponse = GraphExportResponse;
|
|
811
|
+
type index_GraphExportService = GraphExportService;
|
|
812
|
+
declare const index_GraphExportService: typeof GraphExportService;
|
|
813
|
+
type index_GraphExportServiceConfig = GraphExportServiceConfig;
|
|
814
|
+
declare const index_GraphMiddlewareConfig: typeof GraphMiddlewareConfig;
|
|
815
|
+
type index_GraphModule = GraphModule;
|
|
816
|
+
declare const index_GraphModule: typeof GraphModule;
|
|
817
|
+
type index_GraphNode = GraphNode;
|
|
818
|
+
type index_GraphRegistry = GraphRegistry;
|
|
819
|
+
declare const index_GraphRegistry: typeof GraphRegistry;
|
|
820
|
+
type index_GraphRelationshipData = GraphRelationshipData;
|
|
821
|
+
type index_GraphRelationshipExport = GraphRelationshipExport;
|
|
822
|
+
type index_GraphSchema = GraphSchema;
|
|
823
|
+
type index_GraphValidationError = GraphValidationError;
|
|
824
|
+
type index_GraphValidationResult = GraphValidationResult;
|
|
825
|
+
type index_InitializeGraphOptions = InitializeGraphOptions;
|
|
826
|
+
type index_ModuleGraph = ModuleGraph;
|
|
827
|
+
type index_ModuleGraphConfig = ModuleGraphConfig;
|
|
828
|
+
type index_ModuleGraphDefinition = ModuleGraphDefinition;
|
|
829
|
+
type index_PrismaGraphIntegration<TPrismaClient extends PrismaClientBase> = PrismaGraphIntegration<TPrismaClient>;
|
|
830
|
+
type index_PrismaGraphIntegrationOptions<TPrismaClient = unknown> = PrismaGraphIntegrationOptions<TPrismaClient>;
|
|
831
|
+
type index_ProductFacet = ProductFacet;
|
|
832
|
+
type index_QueryGraphOptions = QueryGraphOptions;
|
|
833
|
+
type index_RelationshipDefinition = RelationshipDefinition;
|
|
834
|
+
type index_RelationshipEventData = RelationshipEventData;
|
|
835
|
+
type index_RelationshipExportData = RelationshipExportData;
|
|
836
|
+
type index_RelationshipGraphConfig = RelationshipGraphConfig;
|
|
837
|
+
declare const index_SOFT_DELETE_FIELDS: typeof SOFT_DELETE_FIELDS;
|
|
838
|
+
declare const index_STANDARD_FIELDS: typeof STANDARD_FIELDS;
|
|
839
|
+
type index_SearchFacets = SearchFacets;
|
|
840
|
+
type index_SearchFilters = SearchFilters;
|
|
841
|
+
type index_SearchResponse = SearchResponse;
|
|
842
|
+
type index_SearchResult = SearchResult;
|
|
843
|
+
declare const index_TENANT_FIELDS: typeof TENANT_FIELDS;
|
|
844
|
+
type index_TraverseDirection = TraverseDirection;
|
|
845
|
+
type index_TraverseOptions = TraverseOptions;
|
|
846
|
+
type index_TraverseResult = TraverseResult;
|
|
847
|
+
type index_TypeFacet = TypeFacet;
|
|
848
|
+
type index_ValidationErrorType = ValidationErrorType;
|
|
849
|
+
declare const index_addGraphExtension: typeof addGraphExtension;
|
|
850
|
+
declare const index_createEntityEvent: typeof createEntityEvent;
|
|
851
|
+
declare const index_createGraphEventsHelper: typeof createGraphEventsHelper;
|
|
852
|
+
declare const index_createGraphExportService: typeof createGraphExportService;
|
|
853
|
+
declare const index_createPrismaGraphIntegration: typeof createPrismaGraphIntegration;
|
|
854
|
+
declare const index_createRelationshipEvent: typeof createRelationshipEvent;
|
|
855
|
+
declare const index_createRelationshipFromEntity: typeof createRelationshipFromEntity;
|
|
856
|
+
declare const index_defineEntity: typeof defineEntity;
|
|
857
|
+
declare const index_defineGraphConfig: typeof defineGraphConfig;
|
|
858
|
+
declare const index_defineModuleGraph: typeof defineModuleGraph;
|
|
859
|
+
declare const index_defineRelationship: typeof defineRelationship;
|
|
860
|
+
declare const index_extractEntityTitle: typeof extractEntityTitle;
|
|
861
|
+
declare const index_extractMinimalFields: typeof extractMinimalFields;
|
|
862
|
+
declare const index_getCollectionForEntity: typeof getCollectionForEntity;
|
|
863
|
+
declare const index_getGraphEventsPublisher: typeof getGraphEventsPublisher;
|
|
864
|
+
declare const index_getGraphStats: typeof getGraphStats;
|
|
865
|
+
declare const index_initializeGraph: typeof initializeGraph;
|
|
866
|
+
declare const index_isGraphInitialized: typeof isGraphInitialized;
|
|
867
|
+
declare const index_parseRelationship: typeof parseRelationship;
|
|
868
|
+
declare const index_shouldSyncEntity: typeof shouldSyncEntity;
|
|
869
|
+
declare const index_shouldSyncRelationship: typeof shouldSyncRelationship;
|
|
870
|
+
declare namespace index {
|
|
871
|
+
export { index_AUDIT_FIELDS as AUDIT_FIELDS, type index_CreateEdgeOptions as CreateEdgeOptions, type index_CreateNodeOptions as CreateNodeOptions, type index_DefineEntityConfigOptions as DefineEntityConfigOptions, type index_DefineGraphConfigOptions as DefineGraphConfigOptions, type index_DefineRelationshipConfigOptions as DefineRelationshipConfigOptions, type index_EdgeDocument as EdgeDocument, type index_EntityDefinition as EntityDefinition, type index_EntityEventContext as EntityEventContext, type index_EntityEventData as EntityEventData, type index_EntityEventHook as EntityEventHook, index_EntityEventType as EntityEventType, type EntityFetcher$1 as EntityFetcher, type index_EntityGraphConfig as EntityGraphConfig, type index_EntityRbacConfig as EntityRbacConfig, type index_EntityVertex as EntityVertex, type index_ExtractedEntityData as ExtractedEntityData, type index_ExtractedRelationshipData as ExtractedRelationshipData, type index_FieldMapper as FieldMapper, type index_GenericEntityConfig as GenericEntityConfig, type EntityRbacConfig$1 as GenericEntityRbacConfig, type index_GenericGraphConfig as GenericGraphConfig, type index_GenericRelationshipConfig as GenericRelationshipConfig, type index_GraphEdge as GraphEdge, type index_GraphEntityConfig as GraphEntityConfig, type index_GraphEntityExport as GraphEntityExport, type index_GraphEvent as GraphEvent, index_GraphEventEmitter as GraphEventEmitter, type index_GraphEventOptions as GraphEventOptions, type index_GraphEventPublishOptions as GraphEventPublishOptions, type index_GraphEventType as GraphEventType, type index_GraphEventsHelper as GraphEventsHelper, type index_GraphEventsHelperConfig as GraphEventsHelperConfig, index_GraphEventsPublisher as GraphEventsPublisher, type index_GraphExportResponse as GraphExportResponse, index_GraphExportService as GraphExportService, type index_GraphExportServiceConfig as GraphExportServiceConfig, index_GraphMiddlewareConfig as GraphMiddlewareConfig, index_GraphModule as GraphModule, type index_GraphNode as GraphNode, index_GraphRegistry as GraphRegistry, type index_GraphRelationshipData as GraphRelationshipData, type index_GraphRelationshipExport as GraphRelationshipExport, type index_GraphSchema as GraphSchema, type index_GraphValidationError as GraphValidationError, type index_GraphValidationResult as GraphValidationResult, type index_InitializeGraphOptions as InitializeGraphOptions, type index_ModuleGraph as ModuleGraph, type index_ModuleGraphConfig as ModuleGraphConfig, type index_ModuleGraphDefinition as ModuleGraphDefinition, type index_PrismaGraphIntegration as PrismaGraphIntegration, type index_PrismaGraphIntegrationOptions as PrismaGraphIntegrationOptions, type index_ProductFacet as ProductFacet, type index_QueryGraphOptions as QueryGraphOptions, type index_RelationshipDefinition as RelationshipDefinition, type index_RelationshipEventData as RelationshipEventData, type index_RelationshipExportData as RelationshipExportData, type RelationshipFetcher$1 as RelationshipFetcher, type index_RelationshipGraphConfig as RelationshipGraphConfig, index_SOFT_DELETE_FIELDS as SOFT_DELETE_FIELDS, index_STANDARD_FIELDS as STANDARD_FIELDS, type index_SearchFacets as SearchFacets, type index_SearchFilters as SearchFilters, type index_SearchResponse as SearchResponse, type index_SearchResult as SearchResult, index_TENANT_FIELDS as TENANT_FIELDS, type index_TraverseDirection as TraverseDirection, type index_TraverseOptions as TraverseOptions, type index_TraverseResult as TraverseResult, type index_TypeFacet as TypeFacet, type index_ValidationErrorType as ValidationErrorType, index_addGraphExtension as addGraphExtension, index_createEntityEvent as createEntityEvent, index_createGraphEventsHelper as createGraphEventsHelper, index_createGraphExportService as createGraphExportService, index_createPrismaGraphIntegration as createPrismaGraphIntegration, index_createRelationshipEvent as createRelationshipEvent, index_createRelationshipFromEntity as createRelationshipFromEntity, index_defineEntity as defineEntity, index_defineGraphConfig as defineGraphConfig, index_defineModuleGraph as defineModuleGraph, index_defineRelationship as defineRelationship, index_extractEntityTitle as extractEntityTitle, index_extractMinimalFields as extractMinimalFields, index_getCollectionForEntity as getCollectionForEntity, index_getGraphEventsPublisher as getGraphEventsPublisher, index_getGraphStats as getGraphStats, index_initializeGraph as initializeGraph, index_isGraphInitialized as isGraphInitialized, index_parseRelationship as parseRelationship, index_shouldSyncEntity as shouldSyncEntity, index_shouldSyncRelationship as shouldSyncRelationship };
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
export { type RelationshipEventData as $, AUDIT_FIELDS as A, type GraphEventsHelperConfig as B, type CreateEdgeOptions as C, type DefineEntityConfigOptions as D, type EdgeDocument as E, type FieldMapper as F, GraphModule as G, GraphEventsPublisher as H, type GraphExportResponse as I, GraphExportService as J, type GraphExportServiceConfig as K, type GraphNode as L, GraphRegistry as M, type GraphRelationshipData as N, type GraphRelationshipExport as O, type GraphSchema as P, type GraphValidationError as Q, type GraphValidationResult as R, type InitializeGraphOptions as S, type ModuleGraph as T, type ModuleGraphConfig as U, type ModuleGraphDefinition as V, type PrismaGraphIntegration as W, type PrismaGraphIntegrationOptions as X, type ProductFacet as Y, type QueryGraphOptions as Z, type RelationshipDefinition as _, type CreateNodeOptions as a, type RelationshipExportData as a0, type RelationshipFetcher$1 as a1, type RelationshipGraphConfig as a2, SOFT_DELETE_FIELDS as a3, STANDARD_FIELDS as a4, type SearchFacets as a5, type SearchFilters as a6, type SearchResponse as a7, type SearchResult as a8, TENANT_FIELDS as a9, type TraverseDirection as aa, type TraverseOptions as ab, type TraverseResult as ac, type TypeFacet as ad, type ValidationErrorType as ae, createEntityEvent as af, createGraphEventsHelper as ag, createGraphExportService as ah, createPrismaGraphIntegration as ai, createRelationshipEvent as aj, createRelationshipFromEntity as ak, defineEntity as al, defineGraphConfig as am, defineModuleGraph as an, defineRelationship as ao, extractEntityTitle as ap, extractMinimalFields as aq, getCollectionForEntity as ar, getGraphEventsPublisher as as, getGraphStats as at, initializeGraph as au, isGraphInitialized as av, parseRelationship as aw, shouldSyncEntity as ax, shouldSyncRelationship as ay, type DefineGraphConfigOptions as b, type DefineRelationshipConfigOptions as c, type EntityDefinition as d, type EntityEventContext as e, type EntityEventData as f, type EntityEventHook as g, type EntityFetcher$1 as h, index as i, type EntityGraphConfig as j, type EntityRbacConfig as k, type EntityVertex as l, type ExtractedEntityData as m, type ExtractedRelationshipData as n, type GenericEntityConfig as o, type EntityRbacConfig$1 as p, type GenericGraphConfig as q, type GenericRelationshipConfig as r, type GraphEdge as s, type GraphEntityConfig as t, type GraphEntityExport as u, type GraphEvent as v, type GraphEventOptions as w, type GraphEventPublishOptions as x, type GraphEventType as y, type GraphEventsHelper as z };
|