@elevasis/core 0.2.0 → 0.3.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 +60 -103
- package/dist/index.js +162 -109
- package/dist/organization-model/index.d.ts +60 -103
- package/dist/organization-model/index.js +162 -109
- package/package.json +1 -1
- package/src/README.md +24 -17
- 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 +20 -29
- package/src/organization-model/contracts.ts +3 -0
- package/src/organization-model/defaults.ts +40 -6
- package/src/organization-model/domains/features.ts +19 -54
- package/src/organization-model/domains/navigation.ts +25 -16
- package/src/organization-model/domains/shared.ts +1 -10
- package/src/organization-model/foundation.ts +96 -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-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,16 @@ 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>;
|
|
61
42
|
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>>;
|
|
43
|
+
featureId: z.ZodOptional<z.ZodString>;
|
|
44
|
+
featureIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
72
45
|
entityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
73
46
|
resourceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
74
47
|
capabilityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -178,13 +151,30 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
178
151
|
external: "external";
|
|
179
152
|
human_checkpoint: "human_checkpoint";
|
|
180
153
|
}>;
|
|
181
|
-
|
|
154
|
+
featureIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
182
155
|
entityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
183
156
|
surfaceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
184
157
|
capabilityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
185
158
|
}, z.core.$strip>>>;
|
|
186
159
|
}, z.core.$strip>;
|
|
187
160
|
|
|
161
|
+
declare const FeatureSchema: z.ZodObject<{
|
|
162
|
+
id: z.ZodString;
|
|
163
|
+
label: z.ZodString;
|
|
164
|
+
description: z.ZodOptional<z.ZodString>;
|
|
165
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
166
|
+
color: z.ZodOptional<z.ZodString>;
|
|
167
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
168
|
+
entityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
169
|
+
surfaceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
170
|
+
resourceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
171
|
+
capabilityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
172
|
+
}, z.core.$strip>;
|
|
173
|
+
|
|
174
|
+
declare const PROJECTS_FEATURE_ID: "projects";
|
|
175
|
+
declare const PROJECTS_INDEX_SURFACE_ID: "projects.index";
|
|
176
|
+
declare const DELIVERY_PROJECTS_VIEW_CAPABILITY_ID: "delivery.projects.view";
|
|
177
|
+
|
|
188
178
|
declare const OrganizationModelBrandingSchema: z.ZodObject<{
|
|
189
179
|
organizationName: z.ZodString;
|
|
190
180
|
productName: z.ZodString;
|
|
@@ -254,36 +244,6 @@ declare const OrganizationModelDeliverySchema: z.ZodObject<{
|
|
|
254
244
|
}, z.core.$strip>>;
|
|
255
245
|
}, z.core.$strip>;
|
|
256
246
|
|
|
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
247
|
declare const OrganizationModelLeadGenSchema: z.ZodObject<{
|
|
288
248
|
listEntityId: z.ZodString;
|
|
289
249
|
companyEntityId: z.ZodString;
|
|
@@ -313,24 +273,16 @@ declare const SurfaceDefinitionSchema: z.ZodObject<{
|
|
|
313
273
|
path: z.ZodString;
|
|
314
274
|
surfaceType: z.ZodEnum<{
|
|
315
275
|
list: "list";
|
|
316
|
-
settings: "settings";
|
|
317
276
|
page: "page";
|
|
318
277
|
dashboard: "dashboard";
|
|
319
278
|
graph: "graph";
|
|
320
279
|
detail: "detail";
|
|
280
|
+
settings: "settings";
|
|
321
281
|
}>;
|
|
322
282
|
description: z.ZodOptional<z.ZodString>;
|
|
323
283
|
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>>;
|
|
284
|
+
featureId: z.ZodOptional<z.ZodString>;
|
|
285
|
+
featureIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
334
286
|
entityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
335
287
|
resourceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
336
288
|
capabilityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -344,24 +296,16 @@ declare const OrganizationModelNavigationSchema: z.ZodObject<{
|
|
|
344
296
|
path: z.ZodString;
|
|
345
297
|
surfaceType: z.ZodEnum<{
|
|
346
298
|
list: "list";
|
|
347
|
-
settings: "settings";
|
|
348
299
|
page: "page";
|
|
349
300
|
dashboard: "dashboard";
|
|
350
301
|
graph: "graph";
|
|
351
302
|
detail: "detail";
|
|
303
|
+
settings: "settings";
|
|
352
304
|
}>;
|
|
353
305
|
description: z.ZodOptional<z.ZodString>;
|
|
354
306
|
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>>;
|
|
307
|
+
featureId: z.ZodOptional<z.ZodString>;
|
|
308
|
+
featureIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
365
309
|
entityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
366
310
|
resourceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
367
311
|
capabilityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -379,17 +323,6 @@ declare const OrganizationModelNavigationSchema: z.ZodObject<{
|
|
|
379
323
|
}, z.core.$strip>>>;
|
|
380
324
|
}, z.core.$strip>;
|
|
381
325
|
|
|
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
326
|
declare const ResourceMappingSchema: z.ZodObject<{
|
|
394
327
|
label: z.ZodString;
|
|
395
328
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -405,7 +338,7 @@ declare const ResourceMappingSchema: z.ZodObject<{
|
|
|
405
338
|
external: "external";
|
|
406
339
|
human_checkpoint: "human_checkpoint";
|
|
407
340
|
}>;
|
|
408
|
-
|
|
341
|
+
featureIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
409
342
|
entityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
410
343
|
surfaceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
411
344
|
capabilityIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -416,11 +349,9 @@ type OrganizationModelBranding = z.infer<typeof OrganizationModelBrandingSchema>
|
|
|
416
349
|
type OrganizationModelCrm = z.infer<typeof OrganizationModelCrmSchema>;
|
|
417
350
|
type OrganizationModelLeadGen = z.infer<typeof OrganizationModelLeadGenSchema>;
|
|
418
351
|
type OrganizationModelDelivery = z.infer<typeof OrganizationModelDeliverySchema>;
|
|
419
|
-
type
|
|
420
|
-
type OrganizationModelFeatureKey = z.infer<typeof FeatureKeySchema>;
|
|
352
|
+
type OrganizationModelFeature = z.infer<typeof FeatureSchema>;
|
|
421
353
|
type OrganizationModelNavigation = z.infer<typeof OrganizationModelNavigationSchema>;
|
|
422
354
|
type OrganizationModelSurface = z.infer<typeof SurfaceDefinitionSchema>;
|
|
423
|
-
type OrganizationModelSemanticDomain = z.infer<typeof SemanticDomainSchema>;
|
|
424
355
|
type OrganizationModelResourceMapping = z.infer<typeof ResourceMappingSchema>;
|
|
425
356
|
type DeepPartial<T> = T extends Array<infer U> ? Array<DeepPartial<U>> : T extends object ? {
|
|
426
357
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
@@ -431,5 +362,31 @@ declare const DEFAULT_ORGANIZATION_MODEL: OrganizationModel;
|
|
|
431
362
|
declare function defineOrganizationModel<T extends DeepPartial<OrganizationModel>>(model: T): T;
|
|
432
363
|
declare function resolveOrganizationModel(override?: DeepPartial<OrganizationModel>): OrganizationModel;
|
|
433
364
|
|
|
434
|
-
|
|
435
|
-
|
|
365
|
+
type FoundationSurfaceType = OrganizationModelSurface['surfaceType'];
|
|
366
|
+
type FoundationSurfaceIcon = 'dashboard' | 'crm' | 'lead-gen' | 'projects' | 'operations' | 'settings';
|
|
367
|
+
interface FoundationNavigationSurface extends Omit<OrganizationModelSurface, 'icon'> {
|
|
368
|
+
icon?: FoundationSurfaceIcon;
|
|
369
|
+
}
|
|
370
|
+
interface FoundationOrganizationModel extends Omit<OrganizationModel, 'navigation'> {
|
|
371
|
+
navigation: {
|
|
372
|
+
defaultSurfaceId: string;
|
|
373
|
+
homeLabel: string;
|
|
374
|
+
quickAccessSurfaceIds: readonly string[];
|
|
375
|
+
surfaces: FoundationNavigationSurface[];
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
interface FoundationBranding {
|
|
379
|
+
organizationName: string;
|
|
380
|
+
productName: string;
|
|
381
|
+
shortName: string;
|
|
382
|
+
}
|
|
383
|
+
declare function createFoundationOrganizationModel(branding: FoundationBranding): {
|
|
384
|
+
canonical: OrganizationModel;
|
|
385
|
+
model: FoundationOrganizationModel;
|
|
386
|
+
homeLabel: string;
|
|
387
|
+
quickAccessSurfaceIds: readonly string[];
|
|
388
|
+
getOrganizationSurface: (surfaceId: string) => FoundationNavigationSurface | undefined;
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
export { DEFAULT_ORGANIZATION_MODEL, DELIVERY_PROJECTS_VIEW_CAPABILITY_ID, FeatureSchema, OrganizationModelSchema, PROJECTS_FEATURE_ID, PROJECTS_INDEX_SURFACE_ID, createFoundationOrganizationModel, defineOrganizationModel, resolveOrganizationModel };
|
|
392
|
+
export type { DeepPartial, FoundationBranding, FoundationNavigationSurface, FoundationOrganizationModel, FoundationSurfaceIcon, FoundationSurfaceType, OrganizationModel, OrganizationModelBranding, OrganizationModelCrm, OrganizationModelDelivery, OrganizationModelFeature, OrganizationModelLeadGen, OrganizationModelNavigation, OrganizationModelResourceMapping, OrganizationModelSurface };
|