@elevasis/core 0.2.1 → 0.4.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/index.d.ts +63 -103
- package/dist/index.js +431 -111
- package/dist/organization-model/index.d.ts +63 -103
- package/dist/organization-model/index.js +431 -111
- package/package.json +1 -1
- package/src/README.md +1 -1
- package/src/__tests__/template-foundations-compatibility.test.ts +28 -36
- package/src/auth/multi-tenancy/types.ts +4 -11
- package/src/auth/multi-tenancy/users/api-schemas.ts +1 -1
- package/src/business/base-entities.test.ts +481 -0
- package/src/business/base-entities.ts +241 -0
- package/src/business/delivery/types.ts +1 -1
- package/src/business/index.ts +3 -0
- package/src/execution/index.ts +3 -6
- package/src/index.ts +1 -1
- package/src/organization-model/README.md +25 -26
- package/src/organization-model/__tests__/graph.test.ts +103 -71
- package/src/organization-model/__tests__/resolve.test.ts +22 -31
- package/src/organization-model/contracts.ts +3 -0
- package/src/organization-model/defaults.ts +59 -7
- package/src/organization-model/domains/features.ts +19 -54
- package/src/organization-model/domains/navigation.ts +266 -17
- package/src/organization-model/domains/shared.ts +1 -10
- package/src/organization-model/foundation.ts +97 -0
- package/src/organization-model/graph/build.ts +34 -67
- package/src/organization-model/graph/schema.ts +2 -4
- package/src/organization-model/graph/types.ts +3 -15
- package/src/organization-model/index.ts +2 -0
- package/src/organization-model/organization-graph.mdx +37 -28
- package/src/organization-model/organization-model.mdx +34 -36
- package/src/organization-model/published.ts +12 -3
- package/src/organization-model/schema.ts +38 -34
- package/src/organization-model/types.ts +5 -10
- package/src/platform/constants/versions.ts +1 -1
- package/src/platform/sse/events.ts +1 -34
- package/src/projects/api-schemas.ts +2 -1
- package/src/reference/_generated/contracts.md +10 -31
- package/src/reference/glossary.md +14 -18
- package/src/supabase/database.types.ts +0 -107
- package/src/test-utils/rls/RLSTestContext.ts +1 -31
- package/src/execution/calibration/__tests__/schemas.test.ts +0 -320
- package/src/execution/calibration/index.ts +0 -3
- package/src/execution/calibration/schemas.ts +0 -121
- package/src/execution/calibration/sse-events.ts +0 -125
- package/src/execution/calibration/types.ts +0 -190
package/dist/index.d.ts
CHANGED
|
@@ -2,12 +2,13 @@ import { z } from 'zod';
|
|
|
2
2
|
|
|
3
3
|
declare const OrganizationModelSchema: z.ZodObject<{
|
|
4
4
|
version: z.ZodDefault<z.ZodLiteral<1>>;
|
|
5
|
-
|
|
5
|
+
features: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
6
7
|
label: z.ZodString;
|
|
7
8
|
description: z.ZodOptional<z.ZodString>;
|
|
9
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
8
10
|
color: z.ZodOptional<z.ZodString>;
|
|
9
11
|
icon: z.ZodOptional<z.ZodString>;
|
|
10
|
-
id: z.ZodString;
|
|
11
12
|
entityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
12
13
|
surfaceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
13
14
|
resourceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -23,26 +24,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
23
24
|
dark: z.ZodOptional<z.ZodString>;
|
|
24
25
|
}, z.core.$strip>>;
|
|
25
26
|
}, z.core.$strip>;
|
|
26
|
-
features: z.ZodObject<{
|
|
27
|
-
enabled: z.ZodDefault<z.ZodObject<{
|
|
28
|
-
acquisition: z.ZodDefault<z.ZodBoolean>;
|
|
29
|
-
delivery: z.ZodDefault<z.ZodBoolean>;
|
|
30
|
-
operations: z.ZodDefault<z.ZodBoolean>;
|
|
31
|
-
monitoring: z.ZodDefault<z.ZodBoolean>;
|
|
32
|
-
settings: z.ZodDefault<z.ZodBoolean>;
|
|
33
|
-
seo: z.ZodDefault<z.ZodBoolean>;
|
|
34
|
-
calibration: z.ZodDefault<z.ZodBoolean>;
|
|
35
|
-
}, z.core.$strip>>;
|
|
36
|
-
labels: z.ZodDefault<z.ZodObject<{
|
|
37
|
-
acquisition: z.ZodOptional<z.ZodString>;
|
|
38
|
-
delivery: z.ZodOptional<z.ZodString>;
|
|
39
|
-
operations: z.ZodOptional<z.ZodString>;
|
|
40
|
-
monitoring: z.ZodOptional<z.ZodString>;
|
|
41
|
-
settings: z.ZodOptional<z.ZodString>;
|
|
42
|
-
seo: z.ZodOptional<z.ZodString>;
|
|
43
|
-
calibration: z.ZodOptional<z.ZodString>;
|
|
44
|
-
}, z.core.$strip>>;
|
|
45
|
-
}, z.core.$strip>;
|
|
46
27
|
navigation: z.ZodObject<{
|
|
47
28
|
defaultSurfaceId: z.ZodOptional<z.ZodString>;
|
|
48
29
|
surfaces: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -51,24 +32,17 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
51
32
|
path: z.ZodString;
|
|
52
33
|
surfaceType: z.ZodEnum<{
|
|
53
34
|
list: "list";
|
|
54
|
-
settings: "settings";
|
|
55
35
|
page: "page";
|
|
56
36
|
dashboard: "dashboard";
|
|
57
37
|
graph: "graph";
|
|
58
38
|
detail: "detail";
|
|
39
|
+
settings: "settings";
|
|
59
40
|
}>;
|
|
60
41
|
description: z.ZodOptional<z.ZodString>;
|
|
42
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
61
43
|
icon: z.ZodOptional<z.ZodString>;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
operations: "operations";
|
|
65
|
-
acquisition: "acquisition";
|
|
66
|
-
monitoring: "monitoring";
|
|
67
|
-
settings: "settings";
|
|
68
|
-
seo: "seo";
|
|
69
|
-
calibration: "calibration";
|
|
70
|
-
}>>;
|
|
71
|
-
domainIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
44
|
+
featureId: z.ZodOptional<z.ZodString>;
|
|
45
|
+
featureIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
72
46
|
entityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
73
47
|
resourceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
74
48
|
capabilityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -178,13 +152,30 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
178
152
|
external: "external";
|
|
179
153
|
human_checkpoint: "human_checkpoint";
|
|
180
154
|
}>;
|
|
181
|
-
|
|
155
|
+
featureIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
182
156
|
entityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
183
157
|
surfaceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
184
158
|
capabilityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
185
159
|
}, z.core.$strip>>>;
|
|
186
160
|
}, z.core.$strip>;
|
|
187
161
|
|
|
162
|
+
declare const FeatureSchema: z.ZodObject<{
|
|
163
|
+
id: z.ZodString;
|
|
164
|
+
label: z.ZodString;
|
|
165
|
+
description: z.ZodOptional<z.ZodString>;
|
|
166
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
167
|
+
color: z.ZodOptional<z.ZodString>;
|
|
168
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
169
|
+
entityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
170
|
+
surfaceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
171
|
+
resourceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
172
|
+
capabilityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
173
|
+
}, z.core.$strip>;
|
|
174
|
+
|
|
175
|
+
declare const PROJECTS_FEATURE_ID: "projects";
|
|
176
|
+
declare const PROJECTS_INDEX_SURFACE_ID: "projects.index";
|
|
177
|
+
declare const DELIVERY_PROJECTS_VIEW_CAPABILITY_ID: "delivery.projects.view";
|
|
178
|
+
|
|
188
179
|
declare const OrganizationModelBrandingSchema: z.ZodObject<{
|
|
189
180
|
organizationName: z.ZodString;
|
|
190
181
|
productName: z.ZodString;
|
|
@@ -254,36 +245,6 @@ declare const OrganizationModelDeliverySchema: z.ZodObject<{
|
|
|
254
245
|
}, z.core.$strip>>;
|
|
255
246
|
}, z.core.$strip>;
|
|
256
247
|
|
|
257
|
-
declare const FeatureKeySchema: z.ZodEnum<{
|
|
258
|
-
delivery: "delivery";
|
|
259
|
-
operations: "operations";
|
|
260
|
-
acquisition: "acquisition";
|
|
261
|
-
monitoring: "monitoring";
|
|
262
|
-
settings: "settings";
|
|
263
|
-
seo: "seo";
|
|
264
|
-
calibration: "calibration";
|
|
265
|
-
}>;
|
|
266
|
-
declare const OrganizationModelFeaturesSchema: z.ZodObject<{
|
|
267
|
-
enabled: z.ZodDefault<z.ZodObject<{
|
|
268
|
-
acquisition: z.ZodDefault<z.ZodBoolean>;
|
|
269
|
-
delivery: z.ZodDefault<z.ZodBoolean>;
|
|
270
|
-
operations: z.ZodDefault<z.ZodBoolean>;
|
|
271
|
-
monitoring: z.ZodDefault<z.ZodBoolean>;
|
|
272
|
-
settings: z.ZodDefault<z.ZodBoolean>;
|
|
273
|
-
seo: z.ZodDefault<z.ZodBoolean>;
|
|
274
|
-
calibration: z.ZodDefault<z.ZodBoolean>;
|
|
275
|
-
}, z.core.$strip>>;
|
|
276
|
-
labels: z.ZodDefault<z.ZodObject<{
|
|
277
|
-
acquisition: z.ZodOptional<z.ZodString>;
|
|
278
|
-
delivery: z.ZodOptional<z.ZodString>;
|
|
279
|
-
operations: z.ZodOptional<z.ZodString>;
|
|
280
|
-
monitoring: z.ZodOptional<z.ZodString>;
|
|
281
|
-
settings: z.ZodOptional<z.ZodString>;
|
|
282
|
-
seo: z.ZodOptional<z.ZodString>;
|
|
283
|
-
calibration: z.ZodOptional<z.ZodString>;
|
|
284
|
-
}, z.core.$strip>>;
|
|
285
|
-
}, z.core.$strip>;
|
|
286
|
-
|
|
287
248
|
declare const OrganizationModelLeadGenSchema: z.ZodObject<{
|
|
288
249
|
listEntityId: z.ZodString;
|
|
289
250
|
companyEntityId: z.ZodString;
|
|
@@ -313,24 +274,17 @@ declare const SurfaceDefinitionSchema: z.ZodObject<{
|
|
|
313
274
|
path: z.ZodString;
|
|
314
275
|
surfaceType: z.ZodEnum<{
|
|
315
276
|
list: "list";
|
|
316
|
-
settings: "settings";
|
|
317
277
|
page: "page";
|
|
318
278
|
dashboard: "dashboard";
|
|
319
279
|
graph: "graph";
|
|
320
280
|
detail: "detail";
|
|
281
|
+
settings: "settings";
|
|
321
282
|
}>;
|
|
322
283
|
description: z.ZodOptional<z.ZodString>;
|
|
284
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
323
285
|
icon: z.ZodOptional<z.ZodString>;
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
operations: "operations";
|
|
327
|
-
acquisition: "acquisition";
|
|
328
|
-
monitoring: "monitoring";
|
|
329
|
-
settings: "settings";
|
|
330
|
-
seo: "seo";
|
|
331
|
-
calibration: "calibration";
|
|
332
|
-
}>>;
|
|
333
|
-
domainIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
286
|
+
featureId: z.ZodOptional<z.ZodString>;
|
|
287
|
+
featureIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
334
288
|
entityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
335
289
|
resourceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
336
290
|
capabilityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -344,24 +298,17 @@ declare const OrganizationModelNavigationSchema: z.ZodObject<{
|
|
|
344
298
|
path: z.ZodString;
|
|
345
299
|
surfaceType: z.ZodEnum<{
|
|
346
300
|
list: "list";
|
|
347
|
-
settings: "settings";
|
|
348
301
|
page: "page";
|
|
349
302
|
dashboard: "dashboard";
|
|
350
303
|
graph: "graph";
|
|
351
304
|
detail: "detail";
|
|
305
|
+
settings: "settings";
|
|
352
306
|
}>;
|
|
353
307
|
description: z.ZodOptional<z.ZodString>;
|
|
308
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
354
309
|
icon: z.ZodOptional<z.ZodString>;
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
operations: "operations";
|
|
358
|
-
acquisition: "acquisition";
|
|
359
|
-
monitoring: "monitoring";
|
|
360
|
-
settings: "settings";
|
|
361
|
-
seo: "seo";
|
|
362
|
-
calibration: "calibration";
|
|
363
|
-
}>>;
|
|
364
|
-
domainIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
310
|
+
featureId: z.ZodOptional<z.ZodString>;
|
|
311
|
+
featureIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
365
312
|
entityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
366
313
|
resourceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
367
314
|
capabilityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -379,17 +326,6 @@ declare const OrganizationModelNavigationSchema: z.ZodObject<{
|
|
|
379
326
|
}, z.core.$strip>>>;
|
|
380
327
|
}, z.core.$strip>;
|
|
381
328
|
|
|
382
|
-
declare const SemanticDomainSchema: z.ZodObject<{
|
|
383
|
-
label: z.ZodString;
|
|
384
|
-
description: z.ZodOptional<z.ZodString>;
|
|
385
|
-
color: z.ZodOptional<z.ZodString>;
|
|
386
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
387
|
-
id: z.ZodString;
|
|
388
|
-
entityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
389
|
-
surfaceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
390
|
-
resourceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
391
|
-
capabilityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
392
|
-
}, z.core.$strip>;
|
|
393
329
|
declare const ResourceMappingSchema: z.ZodObject<{
|
|
394
330
|
label: z.ZodString;
|
|
395
331
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -405,7 +341,7 @@ declare const ResourceMappingSchema: z.ZodObject<{
|
|
|
405
341
|
external: "external";
|
|
406
342
|
human_checkpoint: "human_checkpoint";
|
|
407
343
|
}>;
|
|
408
|
-
|
|
344
|
+
featureIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
409
345
|
entityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
410
346
|
surfaceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
411
347
|
capabilityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -416,11 +352,9 @@ type OrganizationModelBranding = z.infer<typeof OrganizationModelBrandingSchema>
|
|
|
416
352
|
type OrganizationModelCrm = z.infer<typeof OrganizationModelCrmSchema>;
|
|
417
353
|
type OrganizationModelLeadGen = z.infer<typeof OrganizationModelLeadGenSchema>;
|
|
418
354
|
type OrganizationModelDelivery = z.infer<typeof OrganizationModelDeliverySchema>;
|
|
419
|
-
type
|
|
420
|
-
type OrganizationModelFeatureKey = z.infer<typeof FeatureKeySchema>;
|
|
355
|
+
type OrganizationModelFeature = z.infer<typeof FeatureSchema>;
|
|
421
356
|
type OrganizationModelNavigation = z.infer<typeof OrganizationModelNavigationSchema>;
|
|
422
357
|
type OrganizationModelSurface = z.infer<typeof SurfaceDefinitionSchema>;
|
|
423
|
-
type OrganizationModelSemanticDomain = z.infer<typeof SemanticDomainSchema>;
|
|
424
358
|
type OrganizationModelResourceMapping = z.infer<typeof ResourceMappingSchema>;
|
|
425
359
|
type DeepPartial<T> = T extends Array<infer U> ? Array<DeepPartial<U>> : T extends object ? {
|
|
426
360
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
@@ -431,5 +365,31 @@ declare const DEFAULT_ORGANIZATION_MODEL: OrganizationModel;
|
|
|
431
365
|
declare function defineOrganizationModel<T extends DeepPartial<OrganizationModel>>(model: T): T;
|
|
432
366
|
declare function resolveOrganizationModel(override?: DeepPartial<OrganizationModel>): OrganizationModel;
|
|
433
367
|
|
|
434
|
-
|
|
435
|
-
|
|
368
|
+
type FoundationSurfaceType = OrganizationModelSurface['surfaceType'];
|
|
369
|
+
type FoundationSurfaceIcon = 'dashboard' | 'crm' | 'lead-gen' | 'projects' | 'operations' | 'settings';
|
|
370
|
+
interface FoundationNavigationSurface extends Omit<OrganizationModelSurface, 'icon'> {
|
|
371
|
+
icon?: FoundationSurfaceIcon;
|
|
372
|
+
}
|
|
373
|
+
interface FoundationOrganizationModel extends Omit<OrganizationModel, 'navigation'> {
|
|
374
|
+
navigation: {
|
|
375
|
+
defaultSurfaceId: string;
|
|
376
|
+
homeLabel: string;
|
|
377
|
+
quickAccessSurfaceIds: readonly string[];
|
|
378
|
+
surfaces: FoundationNavigationSurface[];
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
interface FoundationBranding {
|
|
382
|
+
organizationName: string;
|
|
383
|
+
productName: string;
|
|
384
|
+
shortName: string;
|
|
385
|
+
}
|
|
386
|
+
declare function createFoundationOrganizationModel(branding: FoundationBranding): {
|
|
387
|
+
canonical: OrganizationModel;
|
|
388
|
+
model: FoundationOrganizationModel;
|
|
389
|
+
homeLabel: string;
|
|
390
|
+
quickAccessSurfaceIds: readonly string[];
|
|
391
|
+
getOrganizationSurface: (surfaceId: string) => FoundationNavigationSurface | undefined;
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
export { DEFAULT_ORGANIZATION_MODEL, DELIVERY_PROJECTS_VIEW_CAPABILITY_ID, FeatureSchema, OrganizationModelSchema, PROJECTS_FEATURE_ID, PROJECTS_INDEX_SURFACE_ID, createFoundationOrganizationModel, defineOrganizationModel, resolveOrganizationModel };
|
|
395
|
+
export type { DeepPartial, FoundationBranding, FoundationNavigationSurface, FoundationOrganizationModel, FoundationSurfaceIcon, FoundationSurfaceType, OrganizationModel, OrganizationModelBranding, OrganizationModelCrm, OrganizationModelDelivery, OrganizationModelFeature, OrganizationModelLeadGen, OrganizationModelNavigation, OrganizationModelResourceMapping, OrganizationModelSurface };
|