@elevasis/ui 2.5.0 → 2.7.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.
Files changed (44) hide show
  1. package/dist/{chunk-CKBJVNSA.js → chunk-6FDGVZFL.js} +2 -2
  2. package/dist/{chunk-3VTACYBT.js → chunk-HRIJZKFL.js} +2 -3
  3. package/dist/{chunk-S5EXLTGK.js → chunk-IFH4L6CR.js} +181 -7
  4. package/dist/{chunk-GEJZ6WLM.js → chunk-N6GYYWY3.js} +1 -1
  5. package/dist/{chunk-ZGV3X3UQ.js → chunk-SBND6P3L.js} +2 -3
  6. package/dist/{chunk-TNYUWKSJ.js → chunk-SPMKW4VO.js} +56 -91
  7. package/dist/{chunk-XGUMNEIR.js → chunk-T6R3V4GW.js} +3 -4
  8. package/dist/{chunk-DRBMVLJE.js → chunk-TENLM2GN.js} +2 -2
  9. package/dist/{chunk-5RYRL7DP.js → chunk-V6Z2U6ZV.js} +1 -1
  10. package/dist/{chunk-URFYQRJO.js → chunk-VGBMSGYC.js} +1 -1
  11. package/dist/{chunk-RBRSRRG4.js → chunk-X4HUZINF.js} +3 -4
  12. package/dist/{chunk-UXYE5ZBY.js → chunk-Z5RHDI7T.js} +4 -13
  13. package/dist/components/index.d.ts +4 -9
  14. package/dist/components/index.js +32 -23
  15. package/dist/features/auth/index.js +9 -2
  16. package/dist/features/crm/index.d.ts +1 -1
  17. package/dist/features/crm/index.js +5 -5
  18. package/dist/features/dashboard/index.d.ts +2 -62
  19. package/dist/features/dashboard/index.js +5 -5
  20. package/dist/features/delivery/index.d.ts +1 -1
  21. package/dist/features/delivery/index.js +5 -5
  22. package/dist/features/lead-gen/index.d.ts +1 -1
  23. package/dist/features/lead-gen/index.js +8 -8
  24. package/dist/features/monitoring/index.d.ts +1 -1
  25. package/dist/features/monitoring/index.js +6 -6
  26. package/dist/features/operations/index.d.ts +79 -79
  27. package/dist/features/operations/index.js +7 -7
  28. package/dist/features/seo/index.d.ts +1 -1
  29. package/dist/features/settings/index.d.ts +3 -2
  30. package/dist/features/settings/index.js +5 -5
  31. package/dist/hooks/index.d.ts +2 -1
  32. package/dist/hooks/index.js +4 -4
  33. package/dist/hooks/published.d.ts +2 -1
  34. package/dist/hooks/published.js +3 -3
  35. package/dist/index.d.ts +187 -43
  36. package/dist/index.js +4 -4
  37. package/dist/initialization/index.d.ts +2 -1
  38. package/dist/organization/index.d.ts +2 -1
  39. package/dist/provider/index.d.ts +185 -42
  40. package/dist/provider/index.js +2 -2
  41. package/dist/provider/published.d.ts +185 -42
  42. package/dist/provider/published.js +1 -1
  43. package/dist/types/index.d.ts +2 -1
  44. package/package.json +58 -86
@@ -311,16 +311,179 @@ declare const SurfaceDefinitionSchema = z.object({
311
311
  parentId: ModelIdSchema.optional()
312
312
  })
313
313
 
314
- declare const OrganizationModelSchema = z.object({
315
- version: z.literal(1).default(1),
316
- domains: z.array(SemanticDomainSchema).default([]),
317
- branding: OrganizationModelBrandingSchema,
318
- features: OrganizationModelFeaturesSchema,
319
- navigation: OrganizationModelNavigationSchema,
320
- crm: OrganizationModelCrmSchema,
321
- leadGen: OrganizationModelLeadGenSchema,
322
- delivery: OrganizationModelDeliverySchema,
323
- resourceMappings: z.array(ResourceMappingSchema).default([])
314
+ declare const OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ctx) => {
315
+ const domainsById = collectIds(model.domains, ctx, ['domains'], 'Domain')
316
+ const surfacesById = collectIds(model.navigation.surfaces, ctx, ['navigation', 'surfaces'], 'Surface')
317
+ collectIds(model.navigation.groups, ctx, ['navigation', 'groups'], 'Navigation group')
318
+ collectIds(model.resourceMappings, ctx, ['resourceMappings'], 'Resource mapping')
319
+
320
+ const resourceMappingsByResourceId = new Map<string, (typeof model.resourceMappings)[number]>()
321
+ model.resourceMappings.forEach((resourceMapping, index) => {
322
+ if (resourceMappingsByResourceId.has(resourceMapping.resourceId)) {
323
+ addIssue(
324
+ ctx,
325
+ ['resourceMappings', index, 'resourceId'],
326
+ `Resource mapping resourceId "${resourceMapping.resourceId}" must be unique`
327
+ )
328
+ return
329
+ }
330
+
331
+ resourceMappingsByResourceId.set(resourceMapping.resourceId, resourceMapping)
332
+ })
333
+
334
+ if (model.navigation.defaultSurfaceId && !surfacesById.has(model.navigation.defaultSurfaceId)) {
335
+ addIssue(
336
+ ctx,
337
+ ['navigation', 'defaultSurfaceId'],
338
+ `Default surface "${model.navigation.defaultSurfaceId}" must reference a declared navigation surface`
339
+ )
340
+ }
341
+
342
+ model.navigation.groups.forEach((group, groupIndex) => {
343
+ group.surfaceIds.forEach((surfaceId, surfaceIndex) => {
344
+ if (!surfacesById.has(surfaceId)) {
345
+ addIssue(
346
+ ctx,
347
+ ['navigation', 'groups', groupIndex, 'surfaceIds', surfaceIndex],
348
+ `Navigation group "${group.id}" references unknown surface "${surfaceId}"`
349
+ )
350
+ }
351
+ })
352
+ })
353
+
354
+ model.domains.forEach((domain, domainIndex) => {
355
+ domain.surfaceIds.forEach((surfaceId, surfaceIndex) => {
356
+ const surface = surfacesById.get(surfaceId)
357
+ if (!surface) {
358
+ addIssue(
359
+ ctx,
360
+ ['domains', domainIndex, 'surfaceIds', surfaceIndex],
361
+ `Domain "${domain.id}" references unknown surface "${surfaceId}"`
362
+ )
363
+ return
364
+ }
365
+
366
+ if (!surface.domainIds.includes(domain.id)) {
367
+ addIssue(
368
+ ctx,
369
+ ['domains', domainIndex, 'surfaceIds', surfaceIndex],
370
+ `Domain "${domain.id}" references surface "${surfaceId}" but that surface does not include domain "${domain.id}"`
371
+ )
372
+ }
373
+ })
374
+
375
+ domain.resourceIds.forEach((resourceId, resourceIndex) => {
376
+ const resourceMapping = resourceMappingsByResourceId.get(resourceId)
377
+ if (!resourceMapping) {
378
+ addIssue(
379
+ ctx,
380
+ ['domains', domainIndex, 'resourceIds', resourceIndex],
381
+ `Domain "${domain.id}" references unknown resource "${resourceId}"`
382
+ )
383
+ return
384
+ }
385
+
386
+ if (!resourceMapping.domainIds.includes(domain.id)) {
387
+ addIssue(
388
+ ctx,
389
+ ['domains', domainIndex, 'resourceIds', resourceIndex],
390
+ `Domain "${domain.id}" references resource "${resourceId}" but that resource mapping does not include domain "${domain.id}"`
391
+ )
392
+ }
393
+ })
394
+ })
395
+
396
+ model.navigation.surfaces.forEach((surface, surfaceIndex) => {
397
+ if (surface.parentId && !surfacesById.has(surface.parentId)) {
398
+ addIssue(
399
+ ctx,
400
+ ['navigation', 'surfaces', surfaceIndex, 'parentId'],
401
+ `Surface "${surface.id}" references unknown parent surface "${surface.parentId}"`
402
+ )
403
+ }
404
+
405
+ surface.domainIds.forEach((domainId, domainIndex) => {
406
+ const domain = domainsById.get(domainId)
407
+ if (!domain) {
408
+ addIssue(
409
+ ctx,
410
+ ['navigation', 'surfaces', surfaceIndex, 'domainIds', domainIndex],
411
+ `Surface "${surface.id}" references unknown domain "${domainId}"`
412
+ )
413
+ return
414
+ }
415
+
416
+ if (!domain.surfaceIds.includes(surface.id)) {
417
+ addIssue(
418
+ ctx,
419
+ ['navigation', 'surfaces', surfaceIndex, 'domainIds', domainIndex],
420
+ `Surface "${surface.id}" references domain "${domainId}" but that domain does not include surface "${surface.id}"`
421
+ )
422
+ }
423
+ })
424
+
425
+ surface.resourceIds.forEach((resourceId, resourceIndex) => {
426
+ const resourceMapping = resourceMappingsByResourceId.get(resourceId)
427
+ if (!resourceMapping) {
428
+ addIssue(
429
+ ctx,
430
+ ['navigation', 'surfaces', surfaceIndex, 'resourceIds', resourceIndex],
431
+ `Surface "${surface.id}" references unknown resource "${resourceId}"`
432
+ )
433
+ return
434
+ }
435
+
436
+ if (!resourceMapping.surfaceIds.includes(surface.id)) {
437
+ addIssue(
438
+ ctx,
439
+ ['navigation', 'surfaces', surfaceIndex, 'resourceIds', resourceIndex],
440
+ `Surface "${surface.id}" references resource "${resourceId}" but that resource mapping does not include surface "${surface.id}"`
441
+ )
442
+ }
443
+ })
444
+ })
445
+
446
+ model.resourceMappings.forEach((resourceMapping, resourceIndex) => {
447
+ resourceMapping.domainIds.forEach((domainId, domainIndex) => {
448
+ const domain = domainsById.get(domainId)
449
+ if (!domain) {
450
+ addIssue(
451
+ ctx,
452
+ ['resourceMappings', resourceIndex, 'domainIds', domainIndex],
453
+ `Resource mapping "${resourceMapping.id}" references unknown domain "${domainId}"`
454
+ )
455
+ return
456
+ }
457
+
458
+ if (!domain.resourceIds.includes(resourceMapping.resourceId)) {
459
+ addIssue(
460
+ ctx,
461
+ ['resourceMappings', resourceIndex, 'domainIds', domainIndex],
462
+ `Resource mapping "${resourceMapping.id}" references domain "${domainId}" but that domain does not include resource "${resourceMapping.resourceId}"`
463
+ )
464
+ }
465
+ })
466
+
467
+ resourceMapping.surfaceIds.forEach((surfaceId, surfaceIndex) => {
468
+ const surface = surfacesById.get(surfaceId)
469
+ if (!surface) {
470
+ addIssue(
471
+ ctx,
472
+ ['resourceMappings', resourceIndex, 'surfaceIds', surfaceIndex],
473
+ `Resource mapping "${resourceMapping.id}" references unknown surface "${surfaceId}"`
474
+ )
475
+ return
476
+ }
477
+
478
+ if (!surface.resourceIds.includes(resourceMapping.resourceId)) {
479
+ addIssue(
480
+ ctx,
481
+ ['resourceMappings', resourceIndex, 'surfaceIds', surfaceIndex],
482
+ `Resource mapping "${resourceMapping.id}" references surface "${surfaceId}" but that surface does not include resource "${resourceMapping.resourceId}"`
483
+ )
484
+ }
485
+ })
486
+ })
324
487
  })
325
488
 
326
489
  type OrganizationModel = z.infer<typeof OrganizationModelSchema>
@@ -377,7 +540,7 @@ type FeatureSidebarComponent = ComponentType;
377
540
  interface FeatureModule {
378
541
  key: string;
379
542
  label?: string;
380
- accessFeatureKey?: OrganizationModelFeatureKey;
543
+ accessFeatureKey: OrganizationModelFeatureKey;
381
544
  domainIds?: OrganizationModelSemanticDomain['id'][];
382
545
  capabilityIds?: string[];
383
546
  navEntry?: FeatureNavEntry;
@@ -385,9 +548,8 @@ interface FeatureModule {
385
548
  subshellRoutes?: string[];
386
549
  organizationGraph?: OrganizationGraphFeatureBridge;
387
550
  }
388
- type ShellModuleDefinition = FeatureModule;
389
551
  interface ResolvedFeatureAccess {
390
- featureKey?: string;
552
+ featureKey: string;
391
553
  label?: string;
392
554
  enabled: boolean;
393
555
  }
@@ -397,12 +559,7 @@ interface ResolvedFeatureSemantics {
397
559
  surfaceIds: string[];
398
560
  surfaces: OrganizationModelSurface[];
399
561
  }
400
- interface ResolvedFeatureShellModule {
401
- key: string;
402
- label?: string;
403
- }
404
562
  interface ResolvedFeatureModule extends FeatureModule {
405
- shellModule: ResolvedFeatureShellModule;
406
563
  access: ResolvedFeatureAccess;
407
564
  semantics: ResolvedFeatureSemantics;
408
565
  }
@@ -411,21 +568,25 @@ type ShellNavSource = 'app' | 'feature';
411
568
  interface ResolvedShellNavItem extends FeatureNavEntry {
412
569
  placement: ShellNavPlacement;
413
570
  source: ShellNavSource;
414
- shellModuleKey?: string;
415
571
  accessFeatureKey?: string;
416
572
  }
417
573
  interface ResolvedShellModel {
418
- primaryNavItems: ResolvedShellNavItem[];
419
- bottomNavItems: ResolvedShellNavItem[];
420
574
  navItems: ResolvedShellNavItem[];
421
575
  }
422
576
  interface AppShellOverrides {
423
577
  primaryNavItems?: FeatureNavEntry[];
424
578
  bottomNavItems?: FeatureNavEntry[];
425
579
  }
580
+ type ShellRouteMatchStatus = 'matched' | 'hidden' | 'unmatched';
581
+ interface ResolvedShellRouteMatch {
582
+ status: ShellRouteMatchStatus;
583
+ path: string;
584
+ feature?: ResolvedFeatureModule;
585
+ navItem?: ResolvedShellNavItem;
586
+ navLink?: FeatureNavLink;
587
+ }
426
588
  interface ShellRuntime {
427
- shellModel: ResolvedShellModel;
428
- resolveNavRoute: (path: string) => FeatureRouteResolution;
589
+ resolveRoute: (path: string) => ResolvedShellRouteMatch;
429
590
  }
430
591
  interface OrganizationGraphFeatureBridge {
431
592
  surfaceId: string;
@@ -437,17 +598,6 @@ interface OrganizationGraphContextValue {
437
598
  surfaceType?: OrganizationModelSurface['surfaceType'];
438
599
  featureKey?: OrganizationModelFeatureKey;
439
600
  }
440
- type FeatureRouteState = 'enabled' | 'disabled' | 'missing';
441
- interface FeatureRouteResolution {
442
- state: FeatureRouteState;
443
- path: string;
444
- feature?: FeatureModule;
445
- navEntry?: FeatureNavEntry;
446
- navLink?: FeatureNavLink;
447
- }
448
- interface FeatureRegistry {
449
- features: FeatureModule[];
450
- }
451
601
  interface ElevasisFeaturesProviderProps {
452
602
  features: FeatureModule[];
453
603
  organizationModel?: OrganizationModel;
@@ -459,13 +609,8 @@ interface ElevasisFeaturesProviderProps {
459
609
  children: ReactNode;
460
610
  }
461
611
  interface ElevasisFeaturesContextValue {
462
- navItems: FeatureNavEntry[];
463
- primaryNavItems: ResolvedShellNavItem[];
464
- bottomNavItems: ResolvedShellNavItem[];
465
612
  shellModel: ResolvedShellModel;
466
613
  shellRuntime: ShellRuntime;
467
- enabledFeatures: FeatureModule[];
468
- allFeatures: FeatureModule[];
469
614
  enabledResolvedFeatures: ResolvedFeatureModule[];
470
615
  resolvedFeatures: ResolvedFeatureModule[];
471
616
  organizationGraph: OrganizationGraphContextValue;
@@ -475,9 +620,7 @@ interface ElevasisFeaturesContextValue {
475
620
  operationsSSEManager?: SSEConnectionManagerLike;
476
621
  disabledSubsectionPaths: string[];
477
622
  isFeatureEnabled: (key: string) => boolean;
478
- getFeature: (key: string) => FeatureModule | undefined;
479
623
  getResolvedFeature: (key: string) => ResolvedFeatureModule | undefined;
480
- resolveNavRoute: (path: string) => FeatureRouteResolution;
481
624
  }
482
625
 
483
626
  declare function useElevasisFeatures(): ElevasisFeaturesContextValue;
@@ -551,4 +694,4 @@ interface ElevasisUIProviderProps extends Omit<ElevasisCoreProviderProps, 'theme
551
694
  declare function ElevasisUIProvider({ theme, children, ...coreProps }: ElevasisUIProviderProps): react_jsx_runtime.JSX.Element;
552
695
 
553
696
  export { AppearanceProvider, ElevasisCoreProvider, ElevasisFeaturesProvider, ElevasisServiceProvider, ElevasisUIProvider, FeatureShell, NotificationProvider, useAppearance, useElevasisFeatures, useElevasisServices, useNotificationAdapter, useOptionalElevasisFeatures };
554
- export type { ApiKeyConfig, AppShellOverrides, AppearanceConfig, AuthConfig, AuthKitConfig, ElevasisCoreProviderProps, ElevasisCoreThemeConfig, ElevasisFeaturesContextValue, ElevasisFeaturesProviderProps, ElevasisServiceContextValue, ElevasisServiceProviderProps, ElevasisThemeConfig, ElevasisTokenOverrides, FeatureModule, FeatureNavEntry, FeatureNavLink, FeatureRegistry, FeatureRouteResolution, FeatureRouteState, FeatureSidebarComponent, NotificationAdapter, OrganizationGraphContextValue, OrganizationGraphFeatureBridge, PresetName, ResolvedFeatureAccess, ResolvedFeatureModule, ResolvedFeatureSemantics, ResolvedFeatureShellModule, ResolvedShellModel, ResolvedShellNavItem, ShellModuleDefinition, ShellNavPlacement, ShellNavSource, ShellRuntime, WithSchemes };
697
+ export type { ApiKeyConfig, AppShellOverrides, AppearanceConfig, AuthConfig, AuthKitConfig, ElevasisCoreProviderProps, ElevasisCoreThemeConfig, ElevasisFeaturesContextValue, ElevasisFeaturesProviderProps, ElevasisServiceContextValue, ElevasisServiceProviderProps, ElevasisThemeConfig, ElevasisTokenOverrides, FeatureModule, FeatureNavEntry, FeatureNavLink, FeatureSidebarComponent, NotificationAdapter, OrganizationGraphContextValue, OrganizationGraphFeatureBridge, PresetName, ResolvedFeatureAccess, ResolvedFeatureModule, ResolvedFeatureSemantics, ResolvedShellModel, ResolvedShellNavItem, ResolvedShellRouteMatch, ShellNavPlacement, ShellNavSource, ShellRouteMatchStatus, ShellRuntime, WithSchemes };
@@ -1,7 +1,7 @@
1
- export { ElevasisUIProvider } from '../chunk-GEJZ6WLM.js';
1
+ export { ElevasisUIProvider } from '../chunk-N6GYYWY3.js';
2
2
  import '../chunk-47YILFON.js';
3
3
  import '../chunk-CYXZHBP4.js';
4
- export { ElevasisCoreProvider, ElevasisFeaturesProvider, FeatureShell, NotificationProvider, useElevasisFeatures, useNotificationAdapter, useOptionalElevasisFeatures } from '../chunk-TNYUWKSJ.js';
4
+ export { ElevasisCoreProvider, ElevasisFeaturesProvider, FeatureShell, NotificationProvider, useElevasisFeatures, useNotificationAdapter, useOptionalElevasisFeatures } from '../chunk-SPMKW4VO.js';
5
5
  import '../chunk-RX4UWZZR.js';
6
6
  import '../chunk-Y3D3WFJG.js';
7
7
  import '../chunk-3KMDHCAR.js';
@@ -310,16 +310,179 @@ declare const SurfaceDefinitionSchema = z.object({
310
310
  parentId: ModelIdSchema.optional()
311
311
  })
312
312
 
313
- declare const OrganizationModelSchema = z.object({
314
- version: z.literal(1).default(1),
315
- domains: z.array(SemanticDomainSchema).default([]),
316
- branding: OrganizationModelBrandingSchema,
317
- features: OrganizationModelFeaturesSchema,
318
- navigation: OrganizationModelNavigationSchema,
319
- crm: OrganizationModelCrmSchema,
320
- leadGen: OrganizationModelLeadGenSchema,
321
- delivery: OrganizationModelDeliverySchema,
322
- resourceMappings: z.array(ResourceMappingSchema).default([])
313
+ declare const OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ctx) => {
314
+ const domainsById = collectIds(model.domains, ctx, ['domains'], 'Domain')
315
+ const surfacesById = collectIds(model.navigation.surfaces, ctx, ['navigation', 'surfaces'], 'Surface')
316
+ collectIds(model.navigation.groups, ctx, ['navigation', 'groups'], 'Navigation group')
317
+ collectIds(model.resourceMappings, ctx, ['resourceMappings'], 'Resource mapping')
318
+
319
+ const resourceMappingsByResourceId = new Map<string, (typeof model.resourceMappings)[number]>()
320
+ model.resourceMappings.forEach((resourceMapping, index) => {
321
+ if (resourceMappingsByResourceId.has(resourceMapping.resourceId)) {
322
+ addIssue(
323
+ ctx,
324
+ ['resourceMappings', index, 'resourceId'],
325
+ `Resource mapping resourceId "${resourceMapping.resourceId}" must be unique`
326
+ )
327
+ return
328
+ }
329
+
330
+ resourceMappingsByResourceId.set(resourceMapping.resourceId, resourceMapping)
331
+ })
332
+
333
+ if (model.navigation.defaultSurfaceId && !surfacesById.has(model.navigation.defaultSurfaceId)) {
334
+ addIssue(
335
+ ctx,
336
+ ['navigation', 'defaultSurfaceId'],
337
+ `Default surface "${model.navigation.defaultSurfaceId}" must reference a declared navigation surface`
338
+ )
339
+ }
340
+
341
+ model.navigation.groups.forEach((group, groupIndex) => {
342
+ group.surfaceIds.forEach((surfaceId, surfaceIndex) => {
343
+ if (!surfacesById.has(surfaceId)) {
344
+ addIssue(
345
+ ctx,
346
+ ['navigation', 'groups', groupIndex, 'surfaceIds', surfaceIndex],
347
+ `Navigation group "${group.id}" references unknown surface "${surfaceId}"`
348
+ )
349
+ }
350
+ })
351
+ })
352
+
353
+ model.domains.forEach((domain, domainIndex) => {
354
+ domain.surfaceIds.forEach((surfaceId, surfaceIndex) => {
355
+ const surface = surfacesById.get(surfaceId)
356
+ if (!surface) {
357
+ addIssue(
358
+ ctx,
359
+ ['domains', domainIndex, 'surfaceIds', surfaceIndex],
360
+ `Domain "${domain.id}" references unknown surface "${surfaceId}"`
361
+ )
362
+ return
363
+ }
364
+
365
+ if (!surface.domainIds.includes(domain.id)) {
366
+ addIssue(
367
+ ctx,
368
+ ['domains', domainIndex, 'surfaceIds', surfaceIndex],
369
+ `Domain "${domain.id}" references surface "${surfaceId}" but that surface does not include domain "${domain.id}"`
370
+ )
371
+ }
372
+ })
373
+
374
+ domain.resourceIds.forEach((resourceId, resourceIndex) => {
375
+ const resourceMapping = resourceMappingsByResourceId.get(resourceId)
376
+ if (!resourceMapping) {
377
+ addIssue(
378
+ ctx,
379
+ ['domains', domainIndex, 'resourceIds', resourceIndex],
380
+ `Domain "${domain.id}" references unknown resource "${resourceId}"`
381
+ )
382
+ return
383
+ }
384
+
385
+ if (!resourceMapping.domainIds.includes(domain.id)) {
386
+ addIssue(
387
+ ctx,
388
+ ['domains', domainIndex, 'resourceIds', resourceIndex],
389
+ `Domain "${domain.id}" references resource "${resourceId}" but that resource mapping does not include domain "${domain.id}"`
390
+ )
391
+ }
392
+ })
393
+ })
394
+
395
+ model.navigation.surfaces.forEach((surface, surfaceIndex) => {
396
+ if (surface.parentId && !surfacesById.has(surface.parentId)) {
397
+ addIssue(
398
+ ctx,
399
+ ['navigation', 'surfaces', surfaceIndex, 'parentId'],
400
+ `Surface "${surface.id}" references unknown parent surface "${surface.parentId}"`
401
+ )
402
+ }
403
+
404
+ surface.domainIds.forEach((domainId, domainIndex) => {
405
+ const domain = domainsById.get(domainId)
406
+ if (!domain) {
407
+ addIssue(
408
+ ctx,
409
+ ['navigation', 'surfaces', surfaceIndex, 'domainIds', domainIndex],
410
+ `Surface "${surface.id}" references unknown domain "${domainId}"`
411
+ )
412
+ return
413
+ }
414
+
415
+ if (!domain.surfaceIds.includes(surface.id)) {
416
+ addIssue(
417
+ ctx,
418
+ ['navigation', 'surfaces', surfaceIndex, 'domainIds', domainIndex],
419
+ `Surface "${surface.id}" references domain "${domainId}" but that domain does not include surface "${surface.id}"`
420
+ )
421
+ }
422
+ })
423
+
424
+ surface.resourceIds.forEach((resourceId, resourceIndex) => {
425
+ const resourceMapping = resourceMappingsByResourceId.get(resourceId)
426
+ if (!resourceMapping) {
427
+ addIssue(
428
+ ctx,
429
+ ['navigation', 'surfaces', surfaceIndex, 'resourceIds', resourceIndex],
430
+ `Surface "${surface.id}" references unknown resource "${resourceId}"`
431
+ )
432
+ return
433
+ }
434
+
435
+ if (!resourceMapping.surfaceIds.includes(surface.id)) {
436
+ addIssue(
437
+ ctx,
438
+ ['navigation', 'surfaces', surfaceIndex, 'resourceIds', resourceIndex],
439
+ `Surface "${surface.id}" references resource "${resourceId}" but that resource mapping does not include surface "${surface.id}"`
440
+ )
441
+ }
442
+ })
443
+ })
444
+
445
+ model.resourceMappings.forEach((resourceMapping, resourceIndex) => {
446
+ resourceMapping.domainIds.forEach((domainId, domainIndex) => {
447
+ const domain = domainsById.get(domainId)
448
+ if (!domain) {
449
+ addIssue(
450
+ ctx,
451
+ ['resourceMappings', resourceIndex, 'domainIds', domainIndex],
452
+ `Resource mapping "${resourceMapping.id}" references unknown domain "${domainId}"`
453
+ )
454
+ return
455
+ }
456
+
457
+ if (!domain.resourceIds.includes(resourceMapping.resourceId)) {
458
+ addIssue(
459
+ ctx,
460
+ ['resourceMappings', resourceIndex, 'domainIds', domainIndex],
461
+ `Resource mapping "${resourceMapping.id}" references domain "${domainId}" but that domain does not include resource "${resourceMapping.resourceId}"`
462
+ )
463
+ }
464
+ })
465
+
466
+ resourceMapping.surfaceIds.forEach((surfaceId, surfaceIndex) => {
467
+ const surface = surfacesById.get(surfaceId)
468
+ if (!surface) {
469
+ addIssue(
470
+ ctx,
471
+ ['resourceMappings', resourceIndex, 'surfaceIds', surfaceIndex],
472
+ `Resource mapping "${resourceMapping.id}" references unknown surface "${surfaceId}"`
473
+ )
474
+ return
475
+ }
476
+
477
+ if (!surface.resourceIds.includes(resourceMapping.resourceId)) {
478
+ addIssue(
479
+ ctx,
480
+ ['resourceMappings', resourceIndex, 'surfaceIds', surfaceIndex],
481
+ `Resource mapping "${resourceMapping.id}" references surface "${surfaceId}" but that surface does not include resource "${resourceMapping.resourceId}"`
482
+ )
483
+ }
484
+ })
485
+ })
323
486
  })
324
487
 
325
488
  type OrganizationModel = z.infer<typeof OrganizationModelSchema>
@@ -376,7 +539,7 @@ type FeatureSidebarComponent = ComponentType;
376
539
  interface FeatureModule {
377
540
  key: string;
378
541
  label?: string;
379
- accessFeatureKey?: OrganizationModelFeatureKey;
542
+ accessFeatureKey: OrganizationModelFeatureKey;
380
543
  domainIds?: OrganizationModelSemanticDomain['id'][];
381
544
  capabilityIds?: string[];
382
545
  navEntry?: FeatureNavEntry;
@@ -384,9 +547,8 @@ interface FeatureModule {
384
547
  subshellRoutes?: string[];
385
548
  organizationGraph?: OrganizationGraphFeatureBridge;
386
549
  }
387
- type ShellModuleDefinition = FeatureModule;
388
550
  interface ResolvedFeatureAccess {
389
- featureKey?: string;
551
+ featureKey: string;
390
552
  label?: string;
391
553
  enabled: boolean;
392
554
  }
@@ -396,12 +558,7 @@ interface ResolvedFeatureSemantics {
396
558
  surfaceIds: string[];
397
559
  surfaces: OrganizationModelSurface[];
398
560
  }
399
- interface ResolvedFeatureShellModule {
400
- key: string;
401
- label?: string;
402
- }
403
561
  interface ResolvedFeatureModule extends FeatureModule {
404
- shellModule: ResolvedFeatureShellModule;
405
562
  access: ResolvedFeatureAccess;
406
563
  semantics: ResolvedFeatureSemantics;
407
564
  }
@@ -410,21 +567,25 @@ type ShellNavSource = 'app' | 'feature';
410
567
  interface ResolvedShellNavItem extends FeatureNavEntry {
411
568
  placement: ShellNavPlacement;
412
569
  source: ShellNavSource;
413
- shellModuleKey?: string;
414
570
  accessFeatureKey?: string;
415
571
  }
416
572
  interface ResolvedShellModel {
417
- primaryNavItems: ResolvedShellNavItem[];
418
- bottomNavItems: ResolvedShellNavItem[];
419
573
  navItems: ResolvedShellNavItem[];
420
574
  }
421
575
  interface AppShellOverrides {
422
576
  primaryNavItems?: FeatureNavEntry[];
423
577
  bottomNavItems?: FeatureNavEntry[];
424
578
  }
579
+ type ShellRouteMatchStatus = 'matched' | 'hidden' | 'unmatched';
580
+ interface ResolvedShellRouteMatch {
581
+ status: ShellRouteMatchStatus;
582
+ path: string;
583
+ feature?: ResolvedFeatureModule;
584
+ navItem?: ResolvedShellNavItem;
585
+ navLink?: FeatureNavLink;
586
+ }
425
587
  interface ShellRuntime {
426
- shellModel: ResolvedShellModel;
427
- resolveNavRoute: (path: string) => FeatureRouteResolution;
588
+ resolveRoute: (path: string) => ResolvedShellRouteMatch;
428
589
  }
429
590
  interface OrganizationGraphFeatureBridge {
430
591
  surfaceId: string;
@@ -436,17 +597,6 @@ interface OrganizationGraphContextValue {
436
597
  surfaceType?: OrganizationModelSurface['surfaceType'];
437
598
  featureKey?: OrganizationModelFeatureKey;
438
599
  }
439
- type FeatureRouteState = 'enabled' | 'disabled' | 'missing';
440
- interface FeatureRouteResolution {
441
- state: FeatureRouteState;
442
- path: string;
443
- feature?: FeatureModule;
444
- navEntry?: FeatureNavEntry;
445
- navLink?: FeatureNavLink;
446
- }
447
- interface FeatureRegistry {
448
- features: FeatureModule[];
449
- }
450
600
  interface ElevasisFeaturesProviderProps {
451
601
  features: FeatureModule[];
452
602
  organizationModel?: OrganizationModel;
@@ -458,13 +608,8 @@ interface ElevasisFeaturesProviderProps {
458
608
  children: ReactNode;
459
609
  }
460
610
  interface ElevasisFeaturesContextValue {
461
- navItems: FeatureNavEntry[];
462
- primaryNavItems: ResolvedShellNavItem[];
463
- bottomNavItems: ResolvedShellNavItem[];
464
611
  shellModel: ResolvedShellModel;
465
612
  shellRuntime: ShellRuntime;
466
- enabledFeatures: FeatureModule[];
467
- allFeatures: FeatureModule[];
468
613
  enabledResolvedFeatures: ResolvedFeatureModule[];
469
614
  resolvedFeatures: ResolvedFeatureModule[];
470
615
  organizationGraph: OrganizationGraphContextValue;
@@ -474,9 +619,7 @@ interface ElevasisFeaturesContextValue {
474
619
  operationsSSEManager?: SSEConnectionManagerLike;
475
620
  disabledSubsectionPaths: string[];
476
621
  isFeatureEnabled: (key: string) => boolean;
477
- getFeature: (key: string) => FeatureModule | undefined;
478
622
  getResolvedFeature: (key: string) => ResolvedFeatureModule | undefined;
479
- resolveNavRoute: (path: string) => FeatureRouteResolution;
480
623
  }
481
624
 
482
625
  declare function useElevasisFeatures(): ElevasisFeaturesContextValue;
@@ -529,4 +672,4 @@ declare function useElevasisServices(): ElevasisServiceContextValue;
529
672
  declare function ElevasisServiceProvider({ apiRequest, organizationId, isReady, children }: ElevasisServiceProviderProps): react_jsx_runtime.JSX.Element;
530
673
 
531
674
  export { AppearanceProvider, ElevasisCoreProvider, ElevasisFeaturesProvider, ElevasisServiceProvider, FeatureShell, NotificationProvider, useAppearance, useElevasisFeatures, useElevasisServices, useNotificationAdapter, useOptionalElevasisFeatures };
532
- export type { ApiKeyConfig, AppShellOverrides, AppearanceConfig, AuthConfig, AuthKitConfig, ElevasisCoreProviderProps, ElevasisCoreThemeConfig, ElevasisFeaturesContextValue, ElevasisFeaturesProviderProps, ElevasisServiceContextValue, ElevasisServiceProviderProps, ElevasisTokenOverrides, FeatureModule, FeatureNavEntry, FeatureNavLink, FeatureRegistry, FeatureRouteResolution, FeatureRouteState, FeatureSidebarComponent, NotificationAdapter, OrganizationGraphContextValue, OrganizationGraphFeatureBridge, ResolvedFeatureAccess, ResolvedFeatureModule, ResolvedFeatureSemantics, ResolvedFeatureShellModule, ResolvedShellModel, ResolvedShellNavItem, ShellModuleDefinition, ShellNavPlacement, ShellNavSource, ShellRuntime, WithSchemes };
675
+ export type { ApiKeyConfig, AppShellOverrides, AppearanceConfig, AuthConfig, AuthKitConfig, ElevasisCoreProviderProps, ElevasisCoreThemeConfig, ElevasisFeaturesContextValue, ElevasisFeaturesProviderProps, ElevasisServiceContextValue, ElevasisServiceProviderProps, ElevasisTokenOverrides, FeatureModule, FeatureNavEntry, FeatureNavLink, FeatureSidebarComponent, NotificationAdapter, OrganizationGraphContextValue, OrganizationGraphFeatureBridge, ResolvedFeatureAccess, ResolvedFeatureModule, ResolvedFeatureSemantics, ResolvedShellModel, ResolvedShellNavItem, ResolvedShellRouteMatch, ShellNavPlacement, ShellNavSource, ShellRouteMatchStatus, ShellRuntime, WithSchemes };
@@ -1,4 +1,4 @@
1
- export { ElevasisCoreProvider, ElevasisFeaturesProvider, FeatureShell, NotificationProvider, useElevasisFeatures, useNotificationAdapter, useOptionalElevasisFeatures } from '../chunk-TNYUWKSJ.js';
1
+ export { ElevasisCoreProvider, ElevasisFeaturesProvider, FeatureShell, NotificationProvider, useElevasisFeatures, useNotificationAdapter, useOptionalElevasisFeatures } from '../chunk-SPMKW4VO.js';
2
2
  import '../chunk-RX4UWZZR.js';
3
3
  import '../chunk-Y3D3WFJG.js';
4
4
  import '../chunk-3KMDHCAR.js';
@@ -3219,13 +3219,14 @@ interface SessionTokenUsage {
3219
3219
  /**
3220
3220
  * Per-user-per-org config (stored in org_memberships.config)
3221
3221
  * Controls which features a specific member can access within their org
3222
- * Valid feature keys: operations, monitoring, acquisition, calibration, seo
3222
+ * Valid feature keys: operations, monitoring, acquisition, delivery, calibration, seo
3223
3223
  */
3224
3224
  interface MembershipFeatureConfig {
3225
3225
  features?: {
3226
3226
  operations?: boolean;
3227
3227
  monitoring?: boolean;
3228
3228
  acquisition?: boolean;
3229
+ delivery?: boolean;
3229
3230
  calibration?: boolean;
3230
3231
  seo?: boolean;
3231
3232
  };