@elevasis/ui 2.16.0 → 2.17.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/api/index.js +3 -2
- package/dist/app/index.js +9 -7
- package/dist/auth/index.js +4 -3
- package/dist/charts/index.js +11 -10
- package/dist/{chunk-DT7ETYBT.js → chunk-2TDZBYXI.js} +3 -3
- package/dist/{chunk-5IBTTMWX.js → chunk-34NQLV2W.js} +2 -2
- package/dist/{chunk-FL67C3WY.js → chunk-6IA2OMAE.js} +1 -1
- package/dist/{chunk-L4XXM55J.js → chunk-7YQKVWSD.js} +1 -1
- package/dist/{chunk-7MBONWZZ.js → chunk-ABUDMATM.js} +7 -8
- package/dist/{chunk-TUXTSEAF.js → chunk-DK2HVHCY.js} +1 -1
- package/dist/{chunk-GHIPBT5V.js → chunk-E4WQGJNS.js} +1 -1
- package/dist/{chunk-6SHOLCSV.js → chunk-FNWWVX5N.js} +5 -4
- package/dist/{chunk-IOKL7BKE.js → chunk-GCBWGGI6.js} +133 -1
- package/dist/chunk-GRGRBWIO.js +383 -0
- package/dist/{chunk-SLVC5OJ2.js → chunk-HQ7M6PBW.js} +1 -1
- package/dist/chunk-IRW7JMQ4.js +28 -0
- package/dist/{chunk-C3INGWGK.js → chunk-JU6UB4YA.js} +4 -4
- package/dist/{chunk-M2RM3CC4.js → chunk-MDO4UCEJ.js} +4 -4
- package/dist/{chunk-STZJ7SY5.js → chunk-MJ6YV2B5.js} +3 -2
- package/dist/{chunk-LKU4JCPR.js → chunk-MUZIYL5Q.js} +5 -4
- package/dist/{chunk-BKSSVQM6.js → chunk-OCCZRPER.js} +1 -1
- package/dist/{chunk-XNEYUG4B.js → chunk-OXWQQCDR.js} +13 -32
- package/dist/{chunk-ZB5GAV7J.js → chunk-P3TFNFZS.js} +6 -5
- package/dist/{chunk-QEPXAWE2.js → chunk-QHSW4WHM.js} +3 -26
- package/dist/{chunk-LXHZYSMQ.js → chunk-QSTH6T77.js} +2 -52
- package/dist/{chunk-F4VHHW4O.js → chunk-R7GKX4HW.js} +9 -409
- package/dist/{chunk-5UQKR27N.js → chunk-S6CYH4RI.js} +7 -6
- package/dist/{chunk-MTJ43R2E.js → chunk-SLH2QLKV.js} +1 -1
- package/dist/{chunk-RWFT46RK.js → chunk-TP5NMF6K.js} +6 -7
- package/dist/{chunk-SQQGLGHW.js → chunk-TTP62HWW.js} +3 -3
- package/dist/{chunk-NVOCKXUQ.js → chunk-VDM6DQES.js} +1 -1
- package/dist/chunk-ZTWA5H77.js +94 -0
- package/dist/components/index.d.ts +2640 -2640
- package/dist/components/index.js +38 -35
- package/dist/execution/index.js +2 -2
- package/dist/features/auth/index.js +5 -4
- package/dist/features/crm/index.d.ts +51 -51
- package/dist/features/crm/index.js +21 -19
- package/dist/features/dashboard/index.js +23 -21
- package/dist/features/delivery/index.d.ts +2604 -2604
- package/dist/features/delivery/index.js +21 -19
- package/dist/features/lead-gen/index.js +29 -26
- package/dist/features/monitoring/index.js +26 -24
- package/dist/features/monitoring/requests/index.d.ts +26 -26
- package/dist/features/monitoring/requests/index.js +20 -18
- package/dist/features/operations/index.d.ts +10 -10
- package/dist/features/operations/index.js +28 -25
- package/dist/features/seo/index.js +1 -1
- package/dist/features/settings/index.d.ts +34 -34
- package/dist/features/settings/index.js +22 -20
- package/dist/hooks/delivery/index.css +589 -0
- package/dist/hooks/delivery/index.d.ts +3044 -0
- package/dist/hooks/delivery/index.js +4 -0
- package/dist/hooks/index.d.ts +3095 -3095
- package/dist/hooks/index.js +20 -18
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +506 -0
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +1 -0
- package/dist/hooks/published.d.ts +3095 -3095
- package/dist/hooks/published.js +20 -18
- package/dist/index.d.ts +3396 -3335
- package/dist/index.js +21 -19
- package/dist/initialization/index.js +4 -3
- package/dist/layout/index.js +3 -3
- package/dist/organization/index.js +4 -3
- package/dist/profile/index.js +2 -1
- package/dist/provider/ElevasisServiceContext.d.ts +54 -0
- package/dist/provider/ElevasisServiceContext.js +1 -0
- package/dist/provider/index.d.ts +239 -239
- package/dist/provider/index.js +17 -16
- package/dist/provider/published.d.ts +239 -239
- package/dist/provider/published.js +15 -14
- package/dist/types/index.d.ts +2349 -2332
- package/dist/utils/index.d.ts +73 -1
- package/dist/utils/index.js +2 -1
- package/dist/zustand/index.d.ts +7 -7
- package/package.json +3 -3
- package/dist/{chunk-4BF74JVD.js → chunk-6GUW5GGF.js} +1 -1
- package/dist/{chunk-ELJIFLCB.js → chunk-KRWALB24.js} +6 -6
|
@@ -277,249 +277,249 @@ declare function ElevasisCoreProvider({ auth, queryClient, apiUrl, onError, noti
|
|
|
277
277
|
*/
|
|
278
278
|
type TimeRange = '1h' | '24h' | '7d' | '30d';
|
|
279
279
|
|
|
280
|
-
declare const SurfaceDefinitionSchema = z.object({
|
|
281
|
-
id: ModelIdSchema,
|
|
282
|
-
label: LabelSchema,
|
|
283
|
-
path: PathSchema,
|
|
284
|
-
surfaceType: SurfaceTypeSchema,
|
|
285
|
-
description: DescriptionSchema.optional(),
|
|
286
|
-
enabled: z.boolean().default(true),
|
|
287
|
-
icon: IconNameSchema.optional(),
|
|
288
|
-
featureId: ModelIdSchema.optional(),
|
|
289
|
-
featureIds: ReferenceIdsSchema,
|
|
290
|
-
entityIds: ReferenceIdsSchema,
|
|
291
|
-
resourceIds: ReferenceIdsSchema,
|
|
292
|
-
capabilityIds: ReferenceIdsSchema,
|
|
293
|
-
parentId: ModelIdSchema.optional()
|
|
280
|
+
declare const SurfaceDefinitionSchema = z.object({
|
|
281
|
+
id: ModelIdSchema,
|
|
282
|
+
label: LabelSchema,
|
|
283
|
+
path: PathSchema,
|
|
284
|
+
surfaceType: SurfaceTypeSchema,
|
|
285
|
+
description: DescriptionSchema.optional(),
|
|
286
|
+
enabled: z.boolean().default(true),
|
|
287
|
+
icon: IconNameSchema.optional(),
|
|
288
|
+
featureId: ModelIdSchema.optional(),
|
|
289
|
+
featureIds: ReferenceIdsSchema,
|
|
290
|
+
entityIds: ReferenceIdsSchema,
|
|
291
|
+
resourceIds: ReferenceIdsSchema,
|
|
292
|
+
capabilityIds: ReferenceIdsSchema,
|
|
293
|
+
parentId: ModelIdSchema.optional()
|
|
294
294
|
})
|
|
295
295
|
|
|
296
|
-
declare const OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ctx) => {
|
|
297
|
-
const featuresById = collectIds(model.features, ctx, ['features'], 'Feature')
|
|
298
|
-
const surfacesById = collectIds(model.navigation.surfaces, ctx, ['navigation', 'surfaces'], 'Surface')
|
|
299
|
-
collectIds(model.navigation.groups, ctx, ['navigation', 'groups'], 'Navigation group')
|
|
300
|
-
collectIds(model.resourceMappings, ctx, ['resourceMappings'], 'Resource mapping')
|
|
301
|
-
|
|
302
|
-
const resourceMappingsByResourceId = new Map<string, (typeof model.resourceMappings)[number]>()
|
|
303
|
-
model.resourceMappings.forEach((resourceMapping, index) => {
|
|
304
|
-
if (resourceMappingsByResourceId.has(resourceMapping.resourceId)) {
|
|
305
|
-
addIssue(
|
|
306
|
-
ctx,
|
|
307
|
-
['resourceMappings', index, 'resourceId'],
|
|
308
|
-
`Resource mapping resourceId "${resourceMapping.resourceId}" must be unique`
|
|
309
|
-
)
|
|
310
|
-
return
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
resourceMappingsByResourceId.set(resourceMapping.resourceId, resourceMapping)
|
|
314
|
-
})
|
|
315
|
-
|
|
316
|
-
if (model.navigation.defaultSurfaceId && !surfacesById.has(model.navigation.defaultSurfaceId)) {
|
|
317
|
-
addIssue(
|
|
318
|
-
ctx,
|
|
319
|
-
['navigation', 'defaultSurfaceId'],
|
|
320
|
-
`Default surface "${model.navigation.defaultSurfaceId}" must reference a declared navigation surface`
|
|
321
|
-
)
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
model.navigation.groups.forEach((group, groupIndex) => {
|
|
325
|
-
group.surfaceIds.forEach((surfaceId, surfaceIndex) => {
|
|
326
|
-
if (!surfacesById.has(surfaceId)) {
|
|
327
|
-
addIssue(
|
|
328
|
-
ctx,
|
|
329
|
-
['navigation', 'groups', groupIndex, 'surfaceIds', surfaceIndex],
|
|
330
|
-
`Navigation group "${group.id}" references unknown surface "${surfaceId}"`
|
|
331
|
-
)
|
|
332
|
-
}
|
|
333
|
-
})
|
|
334
|
-
})
|
|
335
|
-
|
|
336
|
-
// Feature -> Surface bidirectional validation
|
|
337
|
-
model.features.forEach((feature, featureIndex) => {
|
|
338
|
-
feature.surfaceIds.forEach((surfaceId, surfaceIndex) => {
|
|
339
|
-
const surface = surfacesById.get(surfaceId)
|
|
340
|
-
if (!surface) {
|
|
341
|
-
addIssue(
|
|
342
|
-
ctx,
|
|
343
|
-
['features', featureIndex, 'surfaceIds', surfaceIndex],
|
|
344
|
-
`Feature "${feature.id}" references unknown surface "${surfaceId}"`
|
|
345
|
-
)
|
|
346
|
-
return
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
if (!surface.featureIds.includes(feature.id)) {
|
|
350
|
-
addIssue(
|
|
351
|
-
ctx,
|
|
352
|
-
['features', featureIndex, 'surfaceIds', surfaceIndex],
|
|
353
|
-
`Feature "${feature.id}" references surface "${surfaceId}" but that surface does not include feature "${feature.id}"`
|
|
354
|
-
)
|
|
355
|
-
}
|
|
356
|
-
})
|
|
357
|
-
|
|
358
|
-
// Feature -> Resource bidirectional validation
|
|
359
|
-
feature.resourceIds.forEach((resourceId, resourceIndex) => {
|
|
360
|
-
const resourceMapping = resourceMappingsByResourceId.get(resourceId)
|
|
361
|
-
if (!resourceMapping) {
|
|
362
|
-
addIssue(
|
|
363
|
-
ctx,
|
|
364
|
-
['features', featureIndex, 'resourceIds', resourceIndex],
|
|
365
|
-
`Feature "${feature.id}" references unknown resource "${resourceId}"`
|
|
366
|
-
)
|
|
367
|
-
return
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
if (!resourceMapping.featureIds.includes(feature.id)) {
|
|
371
|
-
addIssue(
|
|
372
|
-
ctx,
|
|
373
|
-
['features', featureIndex, 'resourceIds', resourceIndex],
|
|
374
|
-
`Feature "${feature.id}" references resource "${resourceId}" but that resource mapping does not include feature "${feature.id}"`
|
|
375
|
-
)
|
|
376
|
-
}
|
|
377
|
-
})
|
|
378
|
-
})
|
|
379
|
-
|
|
380
|
-
// Surface -> Feature bidirectional validation and other surface refs
|
|
381
|
-
model.navigation.surfaces.forEach((surface, surfaceIndex) => {
|
|
382
|
-
if (surface.parentId && !surfacesById.has(surface.parentId)) {
|
|
383
|
-
addIssue(
|
|
384
|
-
ctx,
|
|
385
|
-
['navigation', 'surfaces', surfaceIndex, 'parentId'],
|
|
386
|
-
`Surface "${surface.id}" references unknown parent surface "${surface.parentId}"`
|
|
387
|
-
)
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
surface.featureIds.forEach((featureId, featureIndex) => {
|
|
391
|
-
const feature = featuresById.get(featureId)
|
|
392
|
-
if (!feature) {
|
|
393
|
-
addIssue(
|
|
394
|
-
ctx,
|
|
395
|
-
['navigation', 'surfaces', surfaceIndex, 'featureIds', featureIndex],
|
|
396
|
-
`Surface "${surface.id}" references unknown feature "${featureId}"`
|
|
397
|
-
)
|
|
398
|
-
return
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
if (!feature.surfaceIds.includes(surface.id)) {
|
|
402
|
-
addIssue(
|
|
403
|
-
ctx,
|
|
404
|
-
['navigation', 'surfaces', surfaceIndex, 'featureIds', featureIndex],
|
|
405
|
-
`Surface "${surface.id}" references feature "${featureId}" but that feature does not include surface "${surface.id}"`
|
|
406
|
-
)
|
|
407
|
-
}
|
|
408
|
-
})
|
|
409
|
-
|
|
410
|
-
// Surface -> Resource bidirectional validation
|
|
411
|
-
surface.resourceIds.forEach((resourceId, resourceIndex) => {
|
|
412
|
-
const resourceMapping = resourceMappingsByResourceId.get(resourceId)
|
|
413
|
-
if (!resourceMapping) {
|
|
414
|
-
addIssue(
|
|
415
|
-
ctx,
|
|
416
|
-
['navigation', 'surfaces', surfaceIndex, 'resourceIds', resourceIndex],
|
|
417
|
-
`Surface "${surface.id}" references unknown resource "${resourceId}"`
|
|
418
|
-
)
|
|
419
|
-
return
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
if (!resourceMapping.surfaceIds.includes(surface.id)) {
|
|
423
|
-
addIssue(
|
|
424
|
-
ctx,
|
|
425
|
-
['navigation', 'surfaces', surfaceIndex, 'resourceIds', resourceIndex],
|
|
426
|
-
`Surface "${surface.id}" references resource "${resourceId}" but that surface does not include resource "${surface.id}"`
|
|
427
|
-
)
|
|
428
|
-
}
|
|
429
|
-
})
|
|
430
|
-
})
|
|
431
|
-
|
|
432
|
-
// Offerings -> CustomerSegment cross-ref: targetSegmentIds must resolve
|
|
433
|
-
const segmentsById = new Map(model.customers.segments.map((seg) => [seg.id, seg]))
|
|
434
|
-
model.offerings.products.forEach((product, productIndex) => {
|
|
435
|
-
product.targetSegmentIds.forEach((segmentId, segmentIndex) => {
|
|
436
|
-
if (!segmentsById.has(segmentId)) {
|
|
437
|
-
addIssue(
|
|
438
|
-
ctx,
|
|
439
|
-
['offerings', 'products', productIndex, 'targetSegmentIds', segmentIndex],
|
|
440
|
-
`Product "${product.id}" references unknown customer segment "${segmentId}"`
|
|
441
|
-
)
|
|
442
|
-
}
|
|
443
|
-
})
|
|
444
|
-
|
|
445
|
-
// Offerings -> Feature cross-ref: deliveryFeatureId must resolve (when present)
|
|
446
|
-
if (product.deliveryFeatureId !== undefined && !featuresById.has(product.deliveryFeatureId)) {
|
|
447
|
-
addIssue(
|
|
448
|
-
ctx,
|
|
449
|
-
['offerings', 'products', productIndex, 'deliveryFeatureId'],
|
|
450
|
-
`Product "${product.id}" references unknown delivery feature "${product.deliveryFeatureId}"`
|
|
451
|
-
)
|
|
452
|
-
}
|
|
453
|
-
})
|
|
454
|
-
|
|
455
|
-
// Goals -> period-range validation: periodEnd must be strictly after periodStart
|
|
456
|
-
model.goals.objectives.forEach((objective, index) => {
|
|
457
|
-
if (objective.periodEnd <= objective.periodStart) {
|
|
458
|
-
addIssue(
|
|
459
|
-
ctx,
|
|
460
|
-
['goals', 'objectives', index, 'periodEnd'],
|
|
461
|
-
`Goal "${objective.id}" has periodEnd "${objective.periodEnd}" which must be strictly after periodStart "${objective.periodStart}"`
|
|
462
|
-
)
|
|
463
|
-
}
|
|
464
|
-
})
|
|
465
|
-
|
|
466
|
-
// Roles -> reportsToId cross-ref: each reportsToId must resolve to another role in the same collection
|
|
467
|
-
const rolesById = new Map(model.roles.roles.map((role) => [role.id, role]))
|
|
468
|
-
model.roles.roles.forEach((role, roleIndex) => {
|
|
469
|
-
if (role.reportsToId !== undefined && !rolesById.has(role.reportsToId)) {
|
|
470
|
-
addIssue(
|
|
471
|
-
ctx,
|
|
472
|
-
['roles', 'roles', roleIndex, 'reportsToId'],
|
|
473
|
-
`Role "${role.id}" references unknown reportsToId "${role.reportsToId}"`
|
|
474
|
-
)
|
|
475
|
-
}
|
|
476
|
-
})
|
|
477
|
-
|
|
478
|
-
// ResourceMapping -> Feature and Surface bidirectional validation
|
|
479
|
-
model.resourceMappings.forEach((resourceMapping, resourceIndex) => {
|
|
480
|
-
resourceMapping.featureIds.forEach((featureId, featureIndex) => {
|
|
481
|
-
const feature = featuresById.get(featureId)
|
|
482
|
-
if (!feature) {
|
|
483
|
-
addIssue(
|
|
484
|
-
ctx,
|
|
485
|
-
['resourceMappings', resourceIndex, 'featureIds', featureIndex],
|
|
486
|
-
`Resource mapping "${resourceMapping.id}" references unknown feature "${featureId}"`
|
|
487
|
-
)
|
|
488
|
-
return
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
if (!feature.resourceIds.includes(resourceMapping.resourceId)) {
|
|
492
|
-
addIssue(
|
|
493
|
-
ctx,
|
|
494
|
-
['resourceMappings', resourceIndex, 'featureIds', featureIndex],
|
|
495
|
-
`Resource mapping "${resourceMapping.id}" references feature "${featureId}" but that feature does not include resource "${resourceMapping.resourceId}"`
|
|
496
|
-
)
|
|
497
|
-
}
|
|
498
|
-
})
|
|
499
|
-
|
|
500
|
-
resourceMapping.surfaceIds.forEach((surfaceId, surfaceIndex) => {
|
|
501
|
-
const surface = surfacesById.get(surfaceId)
|
|
502
|
-
if (!surface) {
|
|
503
|
-
addIssue(
|
|
504
|
-
ctx,
|
|
505
|
-
['resourceMappings', resourceIndex, 'surfaceIds', surfaceIndex],
|
|
506
|
-
`Resource mapping "${resourceMapping.id}" references unknown surface "${surfaceId}"`
|
|
507
|
-
)
|
|
508
|
-
return
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
if (!surface.resourceIds.includes(resourceMapping.resourceId)) {
|
|
512
|
-
addIssue(
|
|
513
|
-
ctx,
|
|
514
|
-
['resourceMappings', resourceIndex, 'surfaceIds', surfaceIndex],
|
|
515
|
-
`Resource mapping "${resourceMapping.id}" references surface "${surfaceId}" but that surface does not include resource "${resourceMapping.resourceId}"`
|
|
516
|
-
)
|
|
517
|
-
}
|
|
518
|
-
})
|
|
519
|
-
})
|
|
296
|
+
declare const OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ctx) => {
|
|
297
|
+
const featuresById = collectIds(model.features, ctx, ['features'], 'Feature')
|
|
298
|
+
const surfacesById = collectIds(model.navigation.surfaces, ctx, ['navigation', 'surfaces'], 'Surface')
|
|
299
|
+
collectIds(model.navigation.groups, ctx, ['navigation', 'groups'], 'Navigation group')
|
|
300
|
+
collectIds(model.resourceMappings, ctx, ['resourceMappings'], 'Resource mapping')
|
|
301
|
+
|
|
302
|
+
const resourceMappingsByResourceId = new Map<string, (typeof model.resourceMappings)[number]>()
|
|
303
|
+
model.resourceMappings.forEach((resourceMapping, index) => {
|
|
304
|
+
if (resourceMappingsByResourceId.has(resourceMapping.resourceId)) {
|
|
305
|
+
addIssue(
|
|
306
|
+
ctx,
|
|
307
|
+
['resourceMappings', index, 'resourceId'],
|
|
308
|
+
`Resource mapping resourceId "${resourceMapping.resourceId}" must be unique`
|
|
309
|
+
)
|
|
310
|
+
return
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
resourceMappingsByResourceId.set(resourceMapping.resourceId, resourceMapping)
|
|
314
|
+
})
|
|
315
|
+
|
|
316
|
+
if (model.navigation.defaultSurfaceId && !surfacesById.has(model.navigation.defaultSurfaceId)) {
|
|
317
|
+
addIssue(
|
|
318
|
+
ctx,
|
|
319
|
+
['navigation', 'defaultSurfaceId'],
|
|
320
|
+
`Default surface "${model.navigation.defaultSurfaceId}" must reference a declared navigation surface`
|
|
321
|
+
)
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
model.navigation.groups.forEach((group, groupIndex) => {
|
|
325
|
+
group.surfaceIds.forEach((surfaceId, surfaceIndex) => {
|
|
326
|
+
if (!surfacesById.has(surfaceId)) {
|
|
327
|
+
addIssue(
|
|
328
|
+
ctx,
|
|
329
|
+
['navigation', 'groups', groupIndex, 'surfaceIds', surfaceIndex],
|
|
330
|
+
`Navigation group "${group.id}" references unknown surface "${surfaceId}"`
|
|
331
|
+
)
|
|
332
|
+
}
|
|
333
|
+
})
|
|
334
|
+
})
|
|
335
|
+
|
|
336
|
+
// Feature -> Surface bidirectional validation
|
|
337
|
+
model.features.forEach((feature, featureIndex) => {
|
|
338
|
+
feature.surfaceIds.forEach((surfaceId, surfaceIndex) => {
|
|
339
|
+
const surface = surfacesById.get(surfaceId)
|
|
340
|
+
if (!surface) {
|
|
341
|
+
addIssue(
|
|
342
|
+
ctx,
|
|
343
|
+
['features', featureIndex, 'surfaceIds', surfaceIndex],
|
|
344
|
+
`Feature "${feature.id}" references unknown surface "${surfaceId}"`
|
|
345
|
+
)
|
|
346
|
+
return
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
if (!surface.featureIds.includes(feature.id)) {
|
|
350
|
+
addIssue(
|
|
351
|
+
ctx,
|
|
352
|
+
['features', featureIndex, 'surfaceIds', surfaceIndex],
|
|
353
|
+
`Feature "${feature.id}" references surface "${surfaceId}" but that surface does not include feature "${feature.id}"`
|
|
354
|
+
)
|
|
355
|
+
}
|
|
356
|
+
})
|
|
357
|
+
|
|
358
|
+
// Feature -> Resource bidirectional validation
|
|
359
|
+
feature.resourceIds.forEach((resourceId, resourceIndex) => {
|
|
360
|
+
const resourceMapping = resourceMappingsByResourceId.get(resourceId)
|
|
361
|
+
if (!resourceMapping) {
|
|
362
|
+
addIssue(
|
|
363
|
+
ctx,
|
|
364
|
+
['features', featureIndex, 'resourceIds', resourceIndex],
|
|
365
|
+
`Feature "${feature.id}" references unknown resource "${resourceId}"`
|
|
366
|
+
)
|
|
367
|
+
return
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (!resourceMapping.featureIds.includes(feature.id)) {
|
|
371
|
+
addIssue(
|
|
372
|
+
ctx,
|
|
373
|
+
['features', featureIndex, 'resourceIds', resourceIndex],
|
|
374
|
+
`Feature "${feature.id}" references resource "${resourceId}" but that resource mapping does not include feature "${feature.id}"`
|
|
375
|
+
)
|
|
376
|
+
}
|
|
377
|
+
})
|
|
378
|
+
})
|
|
379
|
+
|
|
380
|
+
// Surface -> Feature bidirectional validation and other surface refs
|
|
381
|
+
model.navigation.surfaces.forEach((surface, surfaceIndex) => {
|
|
382
|
+
if (surface.parentId && !surfacesById.has(surface.parentId)) {
|
|
383
|
+
addIssue(
|
|
384
|
+
ctx,
|
|
385
|
+
['navigation', 'surfaces', surfaceIndex, 'parentId'],
|
|
386
|
+
`Surface "${surface.id}" references unknown parent surface "${surface.parentId}"`
|
|
387
|
+
)
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
surface.featureIds.forEach((featureId, featureIndex) => {
|
|
391
|
+
const feature = featuresById.get(featureId)
|
|
392
|
+
if (!feature) {
|
|
393
|
+
addIssue(
|
|
394
|
+
ctx,
|
|
395
|
+
['navigation', 'surfaces', surfaceIndex, 'featureIds', featureIndex],
|
|
396
|
+
`Surface "${surface.id}" references unknown feature "${featureId}"`
|
|
397
|
+
)
|
|
398
|
+
return
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (!feature.surfaceIds.includes(surface.id)) {
|
|
402
|
+
addIssue(
|
|
403
|
+
ctx,
|
|
404
|
+
['navigation', 'surfaces', surfaceIndex, 'featureIds', featureIndex],
|
|
405
|
+
`Surface "${surface.id}" references feature "${featureId}" but that feature does not include surface "${surface.id}"`
|
|
406
|
+
)
|
|
407
|
+
}
|
|
408
|
+
})
|
|
409
|
+
|
|
410
|
+
// Surface -> Resource bidirectional validation
|
|
411
|
+
surface.resourceIds.forEach((resourceId, resourceIndex) => {
|
|
412
|
+
const resourceMapping = resourceMappingsByResourceId.get(resourceId)
|
|
413
|
+
if (!resourceMapping) {
|
|
414
|
+
addIssue(
|
|
415
|
+
ctx,
|
|
416
|
+
['navigation', 'surfaces', surfaceIndex, 'resourceIds', resourceIndex],
|
|
417
|
+
`Surface "${surface.id}" references unknown resource "${resourceId}"`
|
|
418
|
+
)
|
|
419
|
+
return
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (!resourceMapping.surfaceIds.includes(surface.id)) {
|
|
423
|
+
addIssue(
|
|
424
|
+
ctx,
|
|
425
|
+
['navigation', 'surfaces', surfaceIndex, 'resourceIds', resourceIndex],
|
|
426
|
+
`Surface "${surface.id}" references resource "${resourceId}" but that surface does not include resource "${surface.id}"`
|
|
427
|
+
)
|
|
428
|
+
}
|
|
429
|
+
})
|
|
430
|
+
})
|
|
431
|
+
|
|
432
|
+
// Offerings -> CustomerSegment cross-ref: targetSegmentIds must resolve
|
|
433
|
+
const segmentsById = new Map(model.customers.segments.map((seg) => [seg.id, seg]))
|
|
434
|
+
model.offerings.products.forEach((product, productIndex) => {
|
|
435
|
+
product.targetSegmentIds.forEach((segmentId, segmentIndex) => {
|
|
436
|
+
if (!segmentsById.has(segmentId)) {
|
|
437
|
+
addIssue(
|
|
438
|
+
ctx,
|
|
439
|
+
['offerings', 'products', productIndex, 'targetSegmentIds', segmentIndex],
|
|
440
|
+
`Product "${product.id}" references unknown customer segment "${segmentId}"`
|
|
441
|
+
)
|
|
442
|
+
}
|
|
443
|
+
})
|
|
444
|
+
|
|
445
|
+
// Offerings -> Feature cross-ref: deliveryFeatureId must resolve (when present)
|
|
446
|
+
if (product.deliveryFeatureId !== undefined && !featuresById.has(product.deliveryFeatureId)) {
|
|
447
|
+
addIssue(
|
|
448
|
+
ctx,
|
|
449
|
+
['offerings', 'products', productIndex, 'deliveryFeatureId'],
|
|
450
|
+
`Product "${product.id}" references unknown delivery feature "${product.deliveryFeatureId}"`
|
|
451
|
+
)
|
|
452
|
+
}
|
|
453
|
+
})
|
|
454
|
+
|
|
455
|
+
// Goals -> period-range validation: periodEnd must be strictly after periodStart
|
|
456
|
+
model.goals.objectives.forEach((objective, index) => {
|
|
457
|
+
if (objective.periodEnd <= objective.periodStart) {
|
|
458
|
+
addIssue(
|
|
459
|
+
ctx,
|
|
460
|
+
['goals', 'objectives', index, 'periodEnd'],
|
|
461
|
+
`Goal "${objective.id}" has periodEnd "${objective.periodEnd}" which must be strictly after periodStart "${objective.periodStart}"`
|
|
462
|
+
)
|
|
463
|
+
}
|
|
464
|
+
})
|
|
465
|
+
|
|
466
|
+
// Roles -> reportsToId cross-ref: each reportsToId must resolve to another role in the same collection
|
|
467
|
+
const rolesById = new Map(model.roles.roles.map((role) => [role.id, role]))
|
|
468
|
+
model.roles.roles.forEach((role, roleIndex) => {
|
|
469
|
+
if (role.reportsToId !== undefined && !rolesById.has(role.reportsToId)) {
|
|
470
|
+
addIssue(
|
|
471
|
+
ctx,
|
|
472
|
+
['roles', 'roles', roleIndex, 'reportsToId'],
|
|
473
|
+
`Role "${role.id}" references unknown reportsToId "${role.reportsToId}"`
|
|
474
|
+
)
|
|
475
|
+
}
|
|
476
|
+
})
|
|
477
|
+
|
|
478
|
+
// ResourceMapping -> Feature and Surface bidirectional validation
|
|
479
|
+
model.resourceMappings.forEach((resourceMapping, resourceIndex) => {
|
|
480
|
+
resourceMapping.featureIds.forEach((featureId, featureIndex) => {
|
|
481
|
+
const feature = featuresById.get(featureId)
|
|
482
|
+
if (!feature) {
|
|
483
|
+
addIssue(
|
|
484
|
+
ctx,
|
|
485
|
+
['resourceMappings', resourceIndex, 'featureIds', featureIndex],
|
|
486
|
+
`Resource mapping "${resourceMapping.id}" references unknown feature "${featureId}"`
|
|
487
|
+
)
|
|
488
|
+
return
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
if (!feature.resourceIds.includes(resourceMapping.resourceId)) {
|
|
492
|
+
addIssue(
|
|
493
|
+
ctx,
|
|
494
|
+
['resourceMappings', resourceIndex, 'featureIds', featureIndex],
|
|
495
|
+
`Resource mapping "${resourceMapping.id}" references feature "${featureId}" but that feature does not include resource "${resourceMapping.resourceId}"`
|
|
496
|
+
)
|
|
497
|
+
}
|
|
498
|
+
})
|
|
499
|
+
|
|
500
|
+
resourceMapping.surfaceIds.forEach((surfaceId, surfaceIndex) => {
|
|
501
|
+
const surface = surfacesById.get(surfaceId)
|
|
502
|
+
if (!surface) {
|
|
503
|
+
addIssue(
|
|
504
|
+
ctx,
|
|
505
|
+
['resourceMappings', resourceIndex, 'surfaceIds', surfaceIndex],
|
|
506
|
+
`Resource mapping "${resourceMapping.id}" references unknown surface "${surfaceId}"`
|
|
507
|
+
)
|
|
508
|
+
return
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
if (!surface.resourceIds.includes(resourceMapping.resourceId)) {
|
|
512
|
+
addIssue(
|
|
513
|
+
ctx,
|
|
514
|
+
['resourceMappings', resourceIndex, 'surfaceIds', surfaceIndex],
|
|
515
|
+
`Resource mapping "${resourceMapping.id}" references surface "${surfaceId}" but that surface does not include resource "${resourceMapping.resourceId}"`
|
|
516
|
+
)
|
|
517
|
+
}
|
|
518
|
+
})
|
|
519
|
+
})
|
|
520
520
|
})
|
|
521
521
|
|
|
522
|
-
type OrganizationModel = z.infer<typeof OrganizationModelSchema>
|
|
522
|
+
type OrganizationModel = z.infer<typeof OrganizationModelSchema>
|
|
523
523
|
type OrganizationModelSurface = z.infer<typeof SurfaceDefinitionSchema>
|
|
524
524
|
|
|
525
525
|
interface EventSourceMessage {
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
export { ElevasisFeaturesProvider, FeatureShell, useElevasisFeatures, useOptionalElevasisFeatures } from '../chunk-
|
|
1
|
+
export { ElevasisFeaturesProvider, FeatureShell, useElevasisFeatures, useOptionalElevasisFeatures } from '../chunk-2TDZBYXI.js';
|
|
2
|
+
export { ElevasisCoreProvider, NotificationProvider, useNotificationAdapter } from '../chunk-P3TFNFZS.js';
|
|
2
3
|
import '../chunk-RX4UWZZR.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-TTP62HWW.js';
|
|
5
|
+
import '../chunk-SZHARWKU.js';
|
|
4
6
|
import '../chunk-3KMDHCAR.js';
|
|
5
7
|
import '../chunk-NYBEU5TE.js';
|
|
6
|
-
|
|
7
|
-
import '../chunk-SZHARWKU.js';
|
|
8
|
-
import '../chunk-NVOCKXUQ.js';
|
|
8
|
+
import '../chunk-VDM6DQES.js';
|
|
9
9
|
import '../chunk-2IFYDILW.js';
|
|
10
|
-
import '../chunk-
|
|
11
|
-
import '../chunk-
|
|
12
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-Q7DJKLEN.js';
|
|
11
|
+
import '../chunk-7YQKVWSD.js';
|
|
12
|
+
import '../chunk-6IA2OMAE.js';
|
|
13
13
|
export { AppearanceProvider, useAppearance } from '../chunk-QJ2KCHKX.js';
|
|
14
|
-
import '../chunk-
|
|
14
|
+
import '../chunk-HQ7M6PBW.js';
|
|
15
15
|
import '../chunk-DT3QYZVU.js';
|
|
16
16
|
import '../chunk-RNP5R5I3.js';
|
|
17
|
-
import '../chunk-
|
|
18
|
-
import '../chunk-
|
|
19
|
-
import '../chunk-
|
|
17
|
+
import '../chunk-GCBWGGI6.js';
|
|
18
|
+
import '../chunk-KRWALB24.js';
|
|
19
|
+
import '../chunk-SLH2QLKV.js';
|
|
20
|
+
import '../chunk-DK2HVHCY.js';
|
|
20
21
|
import '../chunk-DD3CCMCZ.js';
|
|
21
|
-
|
|
22
|
+
import '../chunk-QHSW4WHM.js';
|
|
23
|
+
export { ElevasisServiceProvider, useElevasisServices } from '../chunk-IRW7JMQ4.js';
|
|
22
24
|
import '../chunk-BRJ3QZ4E.js';
|
|
23
|
-
import '../chunk-Q7DJKLEN.js';
|