@elevasis/core 0.42.1 → 0.44.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/auth/index.d.ts +8 -3
  2. package/dist/auth/index.js +6 -0
  3. package/dist/business/entities-published.d.ts +1 -1
  4. package/dist/index.d.ts +12 -13
  5. package/dist/index.js +48 -29
  6. package/dist/knowledge/index.d.ts +94 -6
  7. package/dist/knowledge/index.js +172 -8
  8. package/dist/organization-model/index.d.ts +12 -13
  9. package/dist/organization-model/index.js +48 -29
  10. package/dist/test-utils/index.d.ts +5 -6
  11. package/dist/test-utils/index.js +21 -18
  12. package/package.json +3 -3
  13. package/src/auth/access-keys.ts +6 -0
  14. package/src/business/acquisition/api-schemas.ts +1 -1
  15. package/src/business/base-entities.ts +1 -1
  16. package/src/knowledge/cli-helpers.ts +211 -0
  17. package/src/knowledge/index.ts +13 -0
  18. package/src/knowledge/published.ts +18 -5
  19. package/src/knowledge/queries.ts +5 -5
  20. package/src/organization-model/__tests__/cross-ref.test.ts +11 -1
  21. package/src/organization-model/__tests__/domains/systems.test.ts +34 -8
  22. package/src/organization-model/__tests__/scaffolders.test.ts +30 -1
  23. package/src/organization-model/__tests__/schema-refinements.test.ts +178 -0
  24. package/src/organization-model/cross-ref.ts +43 -7
  25. package/src/organization-model/defaults.ts +2 -2
  26. package/src/organization-model/domains/actions.ts +1 -1
  27. package/src/organization-model/domains/resources.ts +1 -1
  28. package/src/organization-model/domains/systems.ts +0 -4
  29. package/src/organization-model/ontology.ts +13 -18
  30. package/src/organization-model/organization-graph.mdx +9 -8
  31. package/src/organization-model/published.ts +9 -3
  32. package/src/organization-model/resolve.ts +9 -7
  33. package/src/organization-model/scaffolders/helpers.ts +1 -1
  34. package/src/organization-model/scaffolders/scaffoldKnowledgeNode.ts +1 -0
  35. package/src/organization-model/scaffolders/scaffoldOntologyRecord.ts +28 -6
  36. package/src/organization-model/scaffolders/scaffoldResource.ts +1 -0
  37. package/src/organization-model/scaffolders/scaffoldSystem.ts +2 -1
  38. package/src/organization-model/schema-refinements.ts +3 -5
  39. package/src/platform/registry/__tests__/validation.test.ts +28 -0
  40. package/src/platform/registry/validation.ts +20 -2
  41. package/src/scaffold-registry/__tests__/index.test.ts +380 -206
  42. package/src/scaffold-registry/index.ts +392 -381
  43. package/src/test-utils/mocks/supabase.ts +1 -1
  44. package/src/test-utils/mocks/workos.ts +2 -2
@@ -960,6 +960,34 @@ describe('validateResourceGovernance', () => {
960
960
  })
961
961
 
962
962
  describe('validateDeclaredSystemInterfaceReadiness', () => {
963
+ it('allows empty apiInterface markers for systems without scoped API resources', () => {
964
+ expect(() =>
965
+ validateDeclaredSystemInterfaceReadiness('test-org', {
966
+ systems: {
967
+ 'sales.lead-gen': {
968
+ id: 'sales.lead-gen',
969
+ label: 'Lead Gen',
970
+ order: 10,
971
+ apiInterface: {
972
+ lifecycle: 'active',
973
+ readinessProfile: 'sales.lead-gen.api',
974
+ resourceIds: []
975
+ }
976
+ },
977
+ 'sales.crm': {
978
+ id: 'sales.crm',
979
+ label: 'CRM',
980
+ order: 20,
981
+ apiInterface: {
982
+ lifecycle: 'active',
983
+ resourceIds: []
984
+ }
985
+ }
986
+ }
987
+ })
988
+ ).not.toThrow()
989
+ })
990
+
963
991
  it('scans flat system.apiInterface markers', () => {
964
992
  let error: unknown
965
993
  try {
@@ -212,8 +212,8 @@ function ontologyIndexForKind(index: ResolvedOntologyIndex, kind: OntologyKind):
212
212
  return index.sharedProperties
213
213
  case 'group':
214
214
  return index.groups
215
- case 'surface':
216
- return index.surfaces
215
+ case 'endpoint':
216
+ return index.endpoints
217
217
  }
218
218
  }
219
219
 
@@ -705,6 +705,24 @@ export function validateDeclaredSystemInterfaceReadiness(
705
705
  if (system.apiInterface === undefined) continue
706
706
 
707
707
  const interfaceKey = 'api'
708
+ const resourceIds = system.apiInterface.resourceIds ?? []
709
+ if (resourceIds.length === 0) {
710
+ const readinessProfile = system.apiInterface.readinessProfile
711
+ if (
712
+ readinessProfile !== undefined &&
713
+ !SYSTEM_INTERFACE_PROFILES.some((profile) => profile.readinessProfile === readinessProfile)
714
+ ) {
715
+ addSystemInterfaceIssue(issues, orgName, path, interfaceKey, {
716
+ family: 'SYSTEM_INTERFACE_INVALID',
717
+ code: 'unknown-readiness-profile',
718
+ path: `systems.${path}.apiInterface.readinessProfile`,
719
+ ref: readinessProfile,
720
+ message: `System Interface "${path}/${interfaceKey}" references unknown readiness profile "${readinessProfile}".`
721
+ })
722
+ }
723
+ continue
724
+ }
725
+
708
726
  const result = computeInterfaceReadiness(model, { systemPath: path, interfaceKey })
709
727
  for (const issue of result.issues) {
710
728
  addSystemInterfaceIssue(issues, orgName, path, interfaceKey, issue)