@open-mercato/onboarding 0.6.4-develop.4110.1.836aafde58 → 0.6.4-develop.4121.1.0d7f20d229

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.
@@ -1,7 +1,17 @@
1
1
  const features = [
2
2
  { id: "onboarding.access", title: "Access onboarding flow", module: "onboarding" },
3
- { id: "onboarding.submit", title: "Submit onboarding request", module: "onboarding" },
4
- { id: "onboarding.verify", title: "Verify onboarding request", module: "onboarding" }
3
+ {
4
+ id: "onboarding.submit",
5
+ title: "Submit onboarding request",
6
+ module: "onboarding",
7
+ dependsOn: ["onboarding.access"]
8
+ },
9
+ {
10
+ id: "onboarding.verify",
11
+ title: "Verify onboarding request",
12
+ module: "onboarding",
13
+ dependsOn: ["onboarding.access"]
14
+ }
5
15
  ];
6
16
  var acl_default = features;
7
17
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/modules/onboarding/acl.ts"],
4
- "sourcesContent": ["export const features = [\n { id: 'onboarding.access', title: 'Access onboarding flow', module: 'onboarding' },\n { id: 'onboarding.submit', title: 'Submit onboarding request', module: 'onboarding' },\n { id: 'onboarding.verify', title: 'Verify onboarding request', module: 'onboarding' },\n]\n\nexport default features\n"],
5
- "mappings": "AAAO,MAAM,WAAW;AAAA,EACtB,EAAE,IAAI,qBAAqB,OAAO,0BAA0B,QAAQ,aAAa;AAAA,EACjF,EAAE,IAAI,qBAAqB,OAAO,6BAA6B,QAAQ,aAAa;AAAA,EACpF,EAAE,IAAI,qBAAqB,OAAO,6BAA6B,QAAQ,aAAa;AACtF;AAEA,IAAO,cAAQ;",
4
+ "sourcesContent": ["export const features = [\n { id: 'onboarding.access', title: 'Access onboarding flow', module: 'onboarding' },\n {\n id: 'onboarding.submit',\n title: 'Submit onboarding request',\n module: 'onboarding',\n dependsOn: ['onboarding.access'],\n },\n {\n id: 'onboarding.verify',\n title: 'Verify onboarding request',\n module: 'onboarding',\n dependsOn: ['onboarding.access'],\n },\n]\n\nexport default features\n"],
5
+ "mappings": "AAAO,MAAM,WAAW;AAAA,EACtB,EAAE,IAAI,qBAAqB,OAAO,0BAA0B,QAAQ,aAAa;AAAA,EACjF;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW,CAAC,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW,CAAC,mBAAmB;AAAA,EACjC;AACF;AAEA,IAAO,cAAQ;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/onboarding",
3
- "version": "0.6.4-develop.4110.1.836aafde58",
3
+ "version": "0.6.4-develop.4121.1.0d7f20d229",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -69,10 +69,10 @@
69
69
  }
70
70
  },
71
71
  "peerDependencies": {
72
- "@open-mercato/shared": "0.6.4-develop.4110.1.836aafde58"
72
+ "@open-mercato/shared": "0.6.4-develop.4121.1.0d7f20d229"
73
73
  },
74
74
  "devDependencies": {
75
- "@open-mercato/shared": "0.6.4-develop.4110.1.836aafde58",
75
+ "@open-mercato/shared": "0.6.4-develop.4121.1.0d7f20d229",
76
76
  "@types/jest": "^30.0.0",
77
77
  "jest": "^30.4.2",
78
78
  "ts-jest": "^29.4.11"
@@ -1,3 +1,7 @@
1
+ import {
2
+ resolveAclDependencyDiagnostics,
3
+ type FeatureDescriptor,
4
+ } from '@open-mercato/shared/security/aclDependencies'
1
5
  import { features } from '../modules/onboarding/acl'
2
6
 
3
7
  describe('onboarding ACL features', () => {
@@ -50,3 +54,48 @@ describe('onboarding ACL features', () => {
50
54
  expect(mod.default).toBe(features)
51
55
  })
52
56
  })
57
+
58
+ describe('onboarding acl dependency declarations', () => {
59
+ const descriptors: FeatureDescriptor[] = features
60
+ const ownIds = descriptors.map((feature) => feature.id)
61
+
62
+ it('declares dependsOn only against features registered in the catalog', () => {
63
+ const diagnostics = resolveAclDependencyDiagnostics(ownIds, descriptors)
64
+ const ownUnknown = diagnostics.unknownReferences.filter((ref) =>
65
+ ref.feature.startsWith('onboarding.'),
66
+ )
67
+ expect(ownUnknown).toEqual([])
68
+ })
69
+
70
+ it('resolves cleanly with no missing deps when every feature is granted', () => {
71
+ const diagnostics = resolveAclDependencyDiagnostics(ownIds, descriptors)
72
+ const ownMissing = diagnostics.missingDependencies.filter((dep) =>
73
+ dep.feature.startsWith('onboarding.'),
74
+ )
75
+ expect(ownMissing).toEqual([])
76
+ })
77
+
78
+ it('keeps every dependency target within the onboarding feature set', () => {
79
+ const ids = new Set(ownIds)
80
+ const deps = descriptors.flatMap((feature) => feature.dependsOn ?? [])
81
+ for (const dep of deps) {
82
+ expect(ids.has(dep)).toBe(true)
83
+ }
84
+ })
85
+
86
+ it('flags submit and verify as missing onboarding.access when access is not granted', () => {
87
+ const diagnostics = resolveAclDependencyDiagnostics(
88
+ ['onboarding.submit', 'onboarding.verify'],
89
+ descriptors,
90
+ )
91
+ expect(diagnostics.unknownReferences).toEqual([])
92
+ const submitMissing = diagnostics.missingDependencies.find(
93
+ (dep) => dep.feature === 'onboarding.submit',
94
+ )
95
+ const verifyMissing = diagnostics.missingDependencies.find(
96
+ (dep) => dep.feature === 'onboarding.verify',
97
+ )
98
+ expect(submitMissing?.missing).toEqual(['onboarding.access'])
99
+ expect(verifyMissing?.missing).toEqual(['onboarding.access'])
100
+ })
101
+ })
@@ -1,7 +1,17 @@
1
1
  export const features = [
2
2
  { id: 'onboarding.access', title: 'Access onboarding flow', module: 'onboarding' },
3
- { id: 'onboarding.submit', title: 'Submit onboarding request', module: 'onboarding' },
4
- { id: 'onboarding.verify', title: 'Verify onboarding request', module: 'onboarding' },
3
+ {
4
+ id: 'onboarding.submit',
5
+ title: 'Submit onboarding request',
6
+ module: 'onboarding',
7
+ dependsOn: ['onboarding.access'],
8
+ },
9
+ {
10
+ id: 'onboarding.verify',
11
+ title: 'Verify onboarding request',
12
+ module: 'onboarding',
13
+ dependsOn: ['onboarding.access'],
14
+ },
5
15
  ]
6
16
 
7
17
  export default features