@owlmeans/server-planning 0.1.18-rc.21 → 0.1.18-rc.22
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/README.md +24 -17
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/server-planning/SKILL.md +28 -28
- package/build/actions/apply-schema-request.d.ts +8 -0
- package/build/actions/apply-schema-request.d.ts.map +1 -0
- package/build/actions/apply-schema-request.js +31 -0
- package/build/actions/apply-schema-request.js.map +1 -0
- package/build/actions/commit.d.ts +3 -3
- package/build/actions/commit.d.ts.map +1 -1
- package/build/actions/commit.js +5 -4
- package/build/actions/commit.js.map +1 -1
- package/build/actions/define-schemas.d.ts +13 -0
- package/build/actions/define-schemas.d.ts.map +1 -0
- package/build/actions/define-schemas.js +28 -0
- package/build/actions/define-schemas.js.map +1 -0
- package/build/actions/execute.d.ts +8 -28
- package/build/actions/execute.d.ts.map +1 -1
- package/build/actions/execute.js +17 -101
- package/build/actions/execute.js.map +1 -1
- package/build/actions/execution/types.d.ts +34 -0
- package/build/actions/execution/types.d.ts.map +1 -0
- package/build/actions/execution/types.js +2 -0
- package/build/actions/execution/types.js.map +1 -0
- package/build/actions/execution.d.ts +4 -0
- package/build/actions/execution.d.ts.map +1 -0
- package/build/actions/execution.js +79 -0
- package/build/actions/execution.js.map +1 -0
- package/build/actions/get-card.d.ts +6 -0
- package/build/actions/get-card.d.ts.map +1 -0
- package/build/actions/get-card.js +9 -0
- package/build/actions/get-card.js.map +1 -0
- package/build/actions/get-specification.d.ts +6 -0
- package/build/actions/get-specification.d.ts.map +1 -0
- package/build/actions/get-specification.js +9 -0
- package/build/actions/get-specification.js.map +1 -0
- package/build/actions/index.d.ts +12 -3
- package/build/actions/index.d.ts.map +1 -1
- package/build/actions/index.js +11 -3
- package/build/actions/index.js.map +1 -1
- package/build/actions/links.d.ts +3 -3
- package/build/actions/links.d.ts.map +1 -1
- package/build/actions/links.js +6 -5
- package/build/actions/links.js.map +1 -1
- package/build/actions/list-card-specifications.d.ts +6 -0
- package/build/actions/list-card-specifications.d.ts.map +1 -0
- package/build/actions/list-card-specifications.js +11 -0
- package/build/actions/list-card-specifications.js.map +1 -0
- package/build/actions/list-card-transitions.d.ts +6 -0
- package/build/actions/list-card-transitions.d.ts.map +1 -0
- package/build/actions/list-card-transitions.js +11 -0
- package/build/actions/list-card-transitions.js.map +1 -0
- package/build/actions/list-cards.d.ts +6 -0
- package/build/actions/list-cards.d.ts.map +1 -0
- package/build/actions/list-cards.js +10 -0
- package/build/actions/list-cards.js.map +1 -0
- package/build/actions/list-schemas.d.ts +13 -0
- package/build/actions/list-schemas.d.ts.map +1 -0
- package/build/actions/list-schemas.js +20 -0
- package/build/actions/list-schemas.js.map +1 -0
- package/build/actions/{specs.d.ts → list-specification-revisions.d.ts} +1 -3
- package/build/actions/list-specification-revisions.d.ts.map +1 -0
- package/build/actions/list-specification-revisions.js +10 -0
- package/build/actions/list-specification-revisions.js.map +1 -0
- package/build/actions/summarize-cards.d.ts +6 -0
- package/build/actions/summarize-cards.d.ts.map +1 -0
- package/build/actions/summarize-cards.js +11 -0
- package/build/actions/summarize-cards.js.map +1 -0
- package/build/actions/transitions.d.ts +3 -3
- package/build/actions/transitions.d.ts.map +1 -1
- package/build/actions/transitions.js +4 -3
- package/build/actions/transitions.js.map +1 -1
- package/build/actions/types.d.ts +5 -3
- package/build/actions/types.d.ts.map +1 -1
- package/build/actions/watch.d.ts +2 -2
- package/build/actions/watch.d.ts.map +1 -1
- package/build/actions/watch.js +2 -2
- package/build/actions/watch.js.map +1 -1
- package/build/conformance/assert/types.d.ts +19 -0
- package/build/conformance/assert/types.d.ts.map +1 -0
- package/build/conformance/assert/types.js +2 -0
- package/build/conformance/assert/types.js.map +1 -0
- package/build/conformance/assert.d.ts +8 -13
- package/build/conformance/assert.d.ts.map +1 -1
- package/build/conformance/assert.js +41 -43
- package/build/conformance/assert.js.map +1 -1
- package/build/conformance/cases.d.ts.map +1 -1
- package/build/conformance/cases.js +86 -67
- package/build/conformance/cases.js.map +1 -1
- package/build/conformance/clock.d.ts +6 -0
- package/build/conformance/clock.d.ts.map +1 -0
- package/build/conformance/clock.js +12 -0
- package/build/conformance/clock.js.map +1 -0
- package/build/conformance/consts.d.ts +3 -1
- package/build/conformance/consts.d.ts.map +1 -1
- package/build/conformance/consts.js +84 -1
- package/build/conformance/consts.js.map +1 -1
- package/build/conformance/errors.d.ts +5 -0
- package/build/conformance/errors.d.ts.map +1 -0
- package/build/conformance/errors.js +8 -0
- package/build/conformance/errors.js.map +1 -0
- package/build/conformance/fixtures/types.d.ts +13 -0
- package/build/conformance/fixtures/types.d.ts.map +1 -0
- package/build/conformance/fixtures/types.js +2 -0
- package/build/conformance/fixtures/types.js.map +1 -0
- package/build/conformance/fixtures.d.ts +8 -8
- package/build/conformance/fixtures.d.ts.map +1 -1
- package/build/conformance/fixtures.js +24 -107
- package/build/conformance/fixtures.js.map +1 -1
- package/build/conformance/index.d.ts +3 -0
- package/build/conformance/index.d.ts.map +1 -1
- package/build/conformance/index.js +1 -0
- package/build/conformance/index.js.map +1 -1
- package/build/definitions.d.ts.map +1 -1
- package/build/definitions.js +9 -9
- package/build/definitions.js.map +1 -1
- package/build/executor/changes/types.d.ts +36 -0
- package/build/executor/changes/types.d.ts.map +1 -0
- package/build/executor/changes/types.js +2 -0
- package/build/executor/changes/types.js.map +1 -0
- package/build/executor/changes.d.ts +3 -30
- package/build/executor/changes.d.ts.map +1 -1
- package/build/executor/changes.js +42 -51
- package/build/executor/changes.js.map +1 -1
- package/build/executor/code/types.d.ts +17 -0
- package/build/executor/code/types.d.ts.map +1 -0
- package/build/executor/code/types.js +2 -0
- package/build/executor/code/types.js.map +1 -0
- package/build/executor/code.d.ts +3 -14
- package/build/executor/code.d.ts.map +1 -1
- package/build/executor/code.js +50 -54
- package/build/executor/code.js.map +1 -1
- package/build/executor/creator/types.d.ts +33 -0
- package/build/executor/creator/types.d.ts.map +1 -0
- package/build/executor/creator/types.js +2 -0
- package/build/executor/creator/types.js.map +1 -0
- package/build/executor/creator.d.ts +6 -25
- package/build/executor/creator.d.ts.map +1 -1
- package/build/executor/creator.js +26 -41
- package/build/executor/creator.js.map +1 -1
- package/build/executor/resolve/types.d.ts +30 -0
- package/build/executor/resolve/types.d.ts.map +1 -0
- package/build/executor/resolve/types.js +2 -0
- package/build/executor/resolve/types.js.map +1 -0
- package/build/executor/resolve.d.ts +4 -41
- package/build/executor/resolve.d.ts.map +1 -1
- package/build/executor/resolve.js +142 -157
- package/build/executor/resolve.js.map +1 -1
- package/build/executor/types.d.ts +0 -2
- package/build/executor/types.d.ts.map +1 -1
- package/build/executor/validate.d.ts +1 -1
- package/build/executor/validate.d.ts.map +1 -1
- package/build/executor/validate.js +16 -15
- package/build/executor/validate.js.map +1 -1
- package/build/executor.d.ts +4 -3
- package/build/executor.d.ts.map +1 -1
- package/build/executor.js +18 -17
- package/build/executor.js.map +1 -1
- package/build/facade.d.ts.map +1 -1
- package/build/facade.js +16 -16
- package/build/facade.js.map +1 -1
- package/build/helper.d.ts +1 -6
- package/build/helper.d.ts.map +1 -1
- package/build/helper.js +3 -8
- package/build/helper.js.map +1 -1
- package/build/projection.d.ts +2 -0
- package/build/projection.d.ts.map +1 -1
- package/build/projection.js +6 -4
- package/build/projection.js.map +1 -1
- package/build/queue/declare.d.ts +5 -0
- package/build/queue/declare.d.ts.map +1 -0
- package/build/queue/declare.js +5 -0
- package/build/queue/declare.js.map +1 -0
- package/build/queue/index.d.ts +1 -4
- package/build/queue/index.d.ts.map +1 -1
- package/build/queue/index.js +1 -4
- package/build/queue/index.js.map +1 -1
- package/build/store/composite.d.ts.map +1 -1
- package/build/store/composite.js +2 -2
- package/build/store/composite.js.map +1 -1
- package/build/store/fold/types.d.ts +43 -0
- package/build/store/fold/types.d.ts.map +1 -0
- package/build/store/fold/types.js +2 -0
- package/build/store/fold/types.js.map +1 -0
- package/build/store/fold.d.ts +7 -30
- package/build/store/fold.d.ts.map +1 -1
- package/build/store/fold.js +185 -203
- package/build/store/fold.js.map +1 -1
- package/build/store/index.d.ts +1 -0
- package/build/store/index.d.ts.map +1 -1
- package/build/store/index.js.map +1 -1
- package/build/store/memory.d.ts.map +1 -1
- package/build/store/memory.js +0 -0
- package/build/store/memory.js.map +1 -1
- package/build/store/types.local.d.ts +3 -1
- package/build/store/types.local.d.ts.map +1 -1
- package/build/types.d.ts +2 -1
- package/build/types.d.ts.map +1 -1
- package/build/utils/access/types.d.ts +30 -0
- package/build/utils/access/types.d.ts.map +1 -0
- package/build/utils/access/types.js +2 -0
- package/build/utils/access/types.js.map +1 -0
- package/build/utils/access.d.ts +4 -0
- package/build/utils/access.d.ts.map +1 -0
- package/build/utils/access.js +28 -0
- package/build/utils/access.js.map +1 -0
- package/build/utils/guard/types.d.ts +21 -0
- package/build/utils/guard/types.d.ts.map +1 -0
- package/build/utils/guard/types.js +2 -0
- package/build/utils/guard/types.js.map +1 -0
- package/build/utils/guard.d.ts +7 -10
- package/build/utils/guard.d.ts.map +1 -1
- package/build/utils/guard.js +33 -31
- package/build/utils/guard.js.map +1 -1
- package/build/utils/handler/types.d.ts +26 -0
- package/build/utils/handler/types.d.ts.map +1 -0
- package/build/utils/handler/types.js +2 -0
- package/build/utils/handler/types.js.map +1 -0
- package/build/utils/handler.d.ts +6 -0
- package/build/utils/handler.d.ts.map +1 -0
- package/build/utils/handler.js +21 -0
- package/build/utils/handler.js.map +1 -0
- package/build/utils/index.d.ts +8 -1
- package/build/utils/index.d.ts.map +1 -1
- package/build/utils/index.js +3 -0
- package/build/utils/index.js.map +1 -1
- package/build/utils/request/types.d.ts +23 -0
- package/build/utils/request/types.d.ts.map +1 -0
- package/build/utils/request/types.js +2 -0
- package/build/utils/request/types.js.map +1 -0
- package/build/utils/request.d.ts +4 -0
- package/build/utils/request.d.ts.map +1 -0
- package/build/utils/request.js +27 -0
- package/build/utils/request.js.map +1 -0
- package/build/utils/scope.d.ts +10 -43
- package/build/utils/scope.d.ts.map +1 -1
- package/build/utils/scope.js +21 -99
- package/build/utils/scope.js.map +1 -1
- package/package.json +18 -18
- package/src/actions/apply-schema-request.ts +35 -0
- package/src/actions/commit.ts +7 -5
- package/src/actions/define-schemas.ts +34 -0
- package/src/actions/execute.ts +30 -115
- package/src/actions/execution/types.ts +34 -0
- package/src/actions/execution.ts +96 -0
- package/src/actions/get-card.ts +14 -0
- package/src/actions/get-specification.ts +14 -0
- package/src/actions/index.ts +13 -3
- package/src/actions/links.ts +8 -6
- package/src/actions/list-card-specifications.ts +15 -0
- package/src/actions/list-card-transitions.ts +15 -0
- package/src/actions/list-cards.ts +14 -0
- package/src/actions/list-schemas.ts +29 -0
- package/src/actions/{specs.ts → list-specification-revisions.ts} +4 -11
- package/src/actions/summarize-cards.ts +15 -0
- package/src/actions/transitions.ts +6 -4
- package/src/actions/types.ts +4 -3
- package/src/actions/watch.ts +4 -3
- package/src/conformance/assert/types.ts +16 -0
- package/src/conformance/assert.ts +49 -41
- package/src/conformance/cases.ts +88 -67
- package/src/conformance/clock.ts +11 -0
- package/src/conformance/consts.ts +87 -1
- package/src/conformance/errors.ts +7 -0
- package/src/conformance/fixtures/types.ts +11 -0
- package/src/conformance/fixtures.ts +32 -107
- package/src/conformance/index.ts +3 -0
- package/src/definitions.ts +9 -9
- package/src/executor/changes/types.ts +38 -0
- package/src/executor/changes.ts +48 -63
- package/src/executor/code/types.ts +23 -0
- package/src/executor/code.ts +60 -61
- package/src/executor/creator/types.ts +33 -0
- package/src/executor/creator.ts +33 -41
- package/src/executor/resolve/types.ts +30 -0
- package/src/executor/resolve.ts +153 -167
- package/src/executor/types.ts +0 -3
- package/src/executor/validate.ts +17 -16
- package/src/executor.ts +20 -17
- package/src/facade.ts +16 -16
- package/src/helper.ts +3 -8
- package/src/projection.ts +8 -4
- package/src/queue/declare.ts +7 -0
- package/src/queue/index.ts +1 -8
- package/src/store/composite.ts +2 -2
- package/src/store/fold/types.ts +44 -0
- package/src/store/fold.ts +209 -212
- package/src/store/index.ts +1 -0
- package/src/store/memory.ts +0 -0
- package/src/store/types.local.ts +1 -1
- package/src/types.ts +1 -1
- package/src/utils/access/types.ts +30 -0
- package/src/utils/access.ts +33 -0
- package/src/utils/guard/types.ts +19 -0
- package/src/utils/guard.ts +41 -30
- package/src/utils/handler/types.ts +28 -0
- package/src/utils/handler.ts +35 -0
- package/src/utils/index.ts +9 -1
- package/src/utils/request/types.ts +23 -0
- package/src/utils/request.ts +40 -0
- package/src/utils/scope.ts +25 -108
- package/tests/creator.spec.ts +18 -18
- package/build/actions/cards.d.ts +0 -14
- package/build/actions/cards.d.ts.map +0 -1
- package/build/actions/cards.js +0 -32
- package/build/actions/cards.js.map +0 -1
- package/build/actions/schemas.d.ts +0 -28
- package/build/actions/schemas.d.ts.map +0 -1
- package/build/actions/schemas.js +0 -69
- package/build/actions/schemas.js.map +0 -1
- package/build/actions/specs.d.ts.map +0 -1
- package/build/actions/specs.js +0 -14
- package/build/actions/specs.js.map +0 -1
- package/src/actions/cards.ts +0 -48
- package/src/actions/schemas.ts +0 -87
|
@@ -1,46 +1,31 @@
|
|
|
1
1
|
import { PlanningError, TransitionAction } from '@owlmeans/planning';
|
|
2
2
|
import { CREATOR } from './consts.local.js';
|
|
3
3
|
const named = (value) => value != null && value !== '';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
if (named(exec.card.createdBy)) {
|
|
24
|
-
return exec;
|
|
25
|
-
}
|
|
26
|
-
const creator = creatorOf(scope);
|
|
27
|
-
return creator == null ? exec : { ...exec, card: { ...exec.card, createdBy: creator } };
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Refuse an execution that names `createdBy` in `changes` or `unset`, whatever the action — a
|
|
31
|
-
* create included, whose owner is its draft's. After the create it never moves, so an ownership
|
|
32
|
-
* check (`card.createdBy === profileId`) cannot be bypassed by anyone allowed to update the card.
|
|
33
|
-
*
|
|
34
|
-
* The executor runs it with the immutables of step 6, after the `before` chain, so a wire body, an
|
|
35
|
-
* in-process caller and a plugin are refused alike. It is the executor's own check, whatever
|
|
36
|
-
* `@owlmeans/planning` build `assertMutable` comes from.
|
|
37
|
-
*
|
|
38
|
-
* @throws {PlanningError} `planning:immutable:createdBy`
|
|
39
|
-
*/
|
|
40
|
-
export const assertCreatorFixed = (exec) => {
|
|
41
|
-
if (exec.changes?.[CREATOR] !== undefined
|
|
42
|
-
|| (exec.unset ?? []).some(path => path.split('.')[0] === CREATOR)) {
|
|
43
|
-
throw new PlanningError(`immutable:${CREATOR}`);
|
|
44
|
-
}
|
|
4
|
+
export const createCreatorHelper = () => {
|
|
5
|
+
const creatorOf = (scope) => [scope.profileId, scope.userId, scope.actor?.profileId, scope.actor?.userId].find(named);
|
|
6
|
+
const withCreator = (exec, scope) => {
|
|
7
|
+
if (exec.action !== TransitionAction.Create || exec.card == null || typeof exec.card !== 'object') {
|
|
8
|
+
return exec;
|
|
9
|
+
}
|
|
10
|
+
if (named(exec.card.createdBy)) {
|
|
11
|
+
return exec;
|
|
12
|
+
}
|
|
13
|
+
const creator = creatorOf(scope);
|
|
14
|
+
return creator == null ? exec : { ...exec, card: { ...exec.card, createdBy: creator } };
|
|
15
|
+
};
|
|
16
|
+
const assertCreatorFixed = (exec) => {
|
|
17
|
+
if (exec.changes?.[CREATOR] !== undefined
|
|
18
|
+
|| (exec.unset ?? []).some(path => path.split('.')[0] === CREATOR)) {
|
|
19
|
+
throw new PlanningError(`immutable:${CREATOR}`);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return { creatorOf, withCreator, assertCreatorFixed };
|
|
45
23
|
};
|
|
24
|
+
export const creatorHelper = createCreatorHelper();
|
|
25
|
+
/** @deprecated compat:factory-refactor — use `creatorHelper.creatorOf(…)` */
|
|
26
|
+
export const creatorOf = (scope) => creatorHelper.creatorOf(scope);
|
|
27
|
+
/** @deprecated compat:factory-refactor — use `creatorHelper.withCreator(…)` */
|
|
28
|
+
export const withCreator = (exec, scope) => creatorHelper.withCreator(exec, scope);
|
|
29
|
+
/** @deprecated compat:factory-refactor — use `creatorHelper.assertCreatorFixed(…)` */
|
|
30
|
+
export const assertCreatorFixed = (exec) => creatorHelper.assertCreatorFixed(exec);
|
|
46
31
|
//# sourceMappingURL=creator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creator.js","sourceRoot":"","sources":["../../src/executor/creator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAgD,MAAM,oBAAoB,CAAA;AAClH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"creator.js","sourceRoot":"","sources":["../../src/executor/creator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAgD,MAAM,oBAAoB,CAAA;AAClH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAG3C,MAAM,KAAK,GAAG,CAAC,KAAqB,EAAmB,EAAE,CAAC,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,CAAA;AAEvF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAkB,EAAE;IACrD,MAAM,SAAS,GAAG,CAAC,KAAoB,EAAsB,EAAE,CAC7D,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAE1F,MAAM,WAAW,GAAG,CAAC,IAAyB,EAAE,KAAoB,EAAuB,EAAE;QAC3F,IAAI,IAAI,CAAC,MAAM,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AoB,EAAuB,EAAE,CAClG,aAAa,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AAExC,sFAAsF;AACtF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAyB,EAAQ,EAAE,CAAC,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PlanningFacade, PlanningSchemaRegistry, TransitionExecution, Workcard, WorkcardKind } from '@owlmeans/planning';
|
|
2
|
+
import type { Resolved } from '../types.js';
|
|
3
|
+
/** Steps 1 and 4 of the write path, over one service runtime. */
|
|
4
|
+
export interface ResolveUtils {
|
|
5
|
+
/**
|
|
6
|
+
* Step 1: a deep copy with trimmed text, `parents ∋ parent` on a draft, and no duplicate `unset`
|
|
7
|
+
* paths. The caller's object is never touched.
|
|
8
|
+
*/
|
|
9
|
+
normalizeExecution: (input: TransitionExecution) => TransitionExecution;
|
|
10
|
+
/**
|
|
11
|
+
* The parent type's rule for a child of `kind`/`type`: a project lists the `cardTypes` (and
|
|
12
|
+
* `projectTypes`) it admits, and one declaring `scopedCardTypes` also admits a card type its layer
|
|
13
|
+
* (`view`, the parent project's resolved schemas) defines as data. Project types are code's alone.
|
|
14
|
+
*
|
|
15
|
+
* @throws {CardTypeNotAllowed}
|
|
16
|
+
*/
|
|
17
|
+
assertChildAllowed: (parent: Workcard, kind: WorkcardKind, type: string, view?: PlanningSchemaRegistry) => void;
|
|
18
|
+
/** The layer a parent project admits data-defined children through — `undefined` without a schema port. */
|
|
19
|
+
childViewOf: (entityId: string, parent: Workcard) => Promise<PlanningSchemaRegistry | undefined>;
|
|
20
|
+
/**
|
|
21
|
+
* Step 4: the card, its type and flow, its parent and — for a specification — its slot.
|
|
22
|
+
*
|
|
23
|
+
* @throws {WorkcardNotFound | PlanningScopeMismatch | UnknownWorkcardType | UnknownStatusFlow}
|
|
24
|
+
* @throws {ParentNotFound | CardTypeNotAllowed | PlanningError}
|
|
25
|
+
*/
|
|
26
|
+
resolveExecution: (facade: PlanningFacade, exec: TransitionExecution) => Promise<Resolved>;
|
|
27
|
+
/** The project a transition is filed under: a project's own id, else its parent's project. */
|
|
28
|
+
projectFor: (resolved: Resolved, exec: TransitionExecution, cardId: string) => string | undefined;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/executor/resolve/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC7H,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,mBAAmB,CAAA;IACvE;;;;;;OAMG;IACH,kBAAkB,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,sBAAsB,KAAK,IAAI,CAAA;IAC/G,2GAA2G;IAC3G,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,KAAK,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAA;IAChG;;;;;OAKG;IACH,gBAAgB,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,mBAAmB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC1F,8FAA8F;IAC9F,UAAU,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAA;CAClG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/executor/resolve/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,43 +1,6 @@
|
|
|
1
|
-
import { WorkcardKind, type PlanningFacade, type PlanningSchemaRegistry, type TransitionExecution, type Workcard } from '@owlmeans/planning';
|
|
2
1
|
import type { PlanningRuntime } from '../types.js';
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
declare const normalizeExecution: (input: TransitionExecution) => TransitionExecution;
|
|
9
|
-
/**
|
|
10
|
-
* The parent type's rule for a child of `kind`/`type`: a project lists the `cardTypes` (and
|
|
11
|
-
* `projectTypes`) it admits, and one declaring `scopedCardTypes` also admits a card type its layer
|
|
12
|
-
* (`view`, the parent project's resolved schemas) defines as data. Project types are code's alone.
|
|
13
|
-
*
|
|
14
|
-
* @throws {CardTypeNotAllowed}
|
|
15
|
-
*/
|
|
16
|
-
declare const assertChildAllowed: (runtime: PlanningRuntime, parent: Workcard, kind: WorkcardKind, type: string, view?: PlanningSchemaRegistry) => void;
|
|
17
|
-
/** The layer a parent project admits data-defined children through — `undefined` without a schema port. */
|
|
18
|
-
declare const childViewOf: (runtime: PlanningRuntime, entityId: string, parent: Workcard) => Promise<PlanningSchemaRegistry | undefined>;
|
|
19
|
-
/**
|
|
20
|
-
* Step 4: the card, its type and flow, its parent and — for a specification — its slot.
|
|
21
|
-
*
|
|
22
|
-
* @throws {WorkcardNotFound | PlanningScopeMismatch | UnknownWorkcardType | UnknownStatusFlow}
|
|
23
|
-
* @throws {ParentNotFound | CardTypeNotAllowed | PlanningError}
|
|
24
|
-
*/
|
|
25
|
-
declare const resolveExecution: (runtime: PlanningRuntime, facade: PlanningFacade, exec: TransitionExecution) => Promise<Resolved>;
|
|
26
|
-
/** The project a transition is filed under: a project's own id, else its parent's project. */
|
|
27
|
-
declare const projectFor: (resolved: Resolved, exec: TransitionExecution, cardId: string) => string | undefined;
|
|
28
|
-
export declare const createResolveHelper: () => {
|
|
29
|
-
normalizeExecution: typeof normalizeExecution;
|
|
30
|
-
assertChildAllowed: typeof assertChildAllowed;
|
|
31
|
-
childViewOf: typeof childViewOf;
|
|
32
|
-
resolveExecution: typeof resolveExecution;
|
|
33
|
-
projectFor: typeof projectFor;
|
|
34
|
-
};
|
|
35
|
-
export declare const resolveHelper: {
|
|
36
|
-
normalizeExecution: typeof normalizeExecution;
|
|
37
|
-
assertChildAllowed: typeof assertChildAllowed;
|
|
38
|
-
childViewOf: typeof childViewOf;
|
|
39
|
-
resolveExecution: typeof resolveExecution;
|
|
40
|
-
projectFor: typeof projectFor;
|
|
41
|
-
};
|
|
42
|
-
export {};
|
|
2
|
+
import type { ResolveUtils } from './resolve/types.js';
|
|
3
|
+
export declare const makeResolveUtils: (runtime: PlanningRuntime) => ResolveUtils;
|
|
4
|
+
/** The resolution steps of one service runtime — one per runtime. */
|
|
5
|
+
export declare const resolveUtilsOf: (target: PlanningRuntime) => ResolveUtils;
|
|
43
6
|
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/executor/resolve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/executor/resolve.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AA6BtD,eAAO,MAAM,gBAAgB,YAAa,eAAe,KAAG,YAsK3D,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,cAAc,2CAAuC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cardHelper, CardTypeNotAllowed, ParentNotFound, PlanningError, PlanningSchemaKind, PlanningScopeMismatch, SchemaOrigin, specificationHelper, statusHelper, TransitionAction, UnknownStatusFlow, UnknownWorkcardType, WorkcardKind, WorkcardNotFound } from '@owlmeans/planning';
|
|
2
|
+
import { memoHelper } from '@owlmeans/context';
|
|
2
3
|
import { TRIMMED } from './consts.local.js';
|
|
3
4
|
const isScoped = (schemas) => typeof schemas.originOf === 'function';
|
|
4
5
|
/** A type the layer resolves from a data-defined record rather than from code. */
|
|
@@ -22,174 +23,158 @@ const trim = (record) => {
|
|
|
22
23
|
}
|
|
23
24
|
return copy;
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const draft = trim(exec.card);
|
|
33
|
-
const parents = normalizeParents(draft.parent, draft.parents);
|
|
34
|
-
exec.card = { ...draft, ...(parents.length > 0 ? { parents, parent: draft.parent ?? parents[0] } : {}) };
|
|
35
|
-
}
|
|
36
|
-
if (exec.changes != null) {
|
|
37
|
-
exec.changes = trim(exec.changes);
|
|
38
|
-
}
|
|
39
|
-
if (exec.unset != null) {
|
|
40
|
-
exec.unset = [...new Set(exec.unset)];
|
|
41
|
-
}
|
|
42
|
-
return exec;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* The parent type's rule for a child of `kind`/`type`: a project lists the `cardTypes` (and
|
|
46
|
-
* `projectTypes`) it admits, and one declaring `scopedCardTypes` also admits a card type its layer
|
|
47
|
-
* (`view`, the parent project's resolved schemas) defines as data. Project types are code's alone.
|
|
48
|
-
*
|
|
49
|
-
* @throws {CardTypeNotAllowed}
|
|
50
|
-
*/
|
|
51
|
-
const assertChildAllowed = (runtime, parent, kind, type, view) => {
|
|
52
|
-
if (kind === WorkcardKind.Specification) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (!isProject(parent)) {
|
|
56
|
-
throw new CardTypeNotAllowed(`${parent.type}:${type}`);
|
|
57
|
-
}
|
|
58
|
-
const parentType = runtime.service().schemas.type(parent.type);
|
|
59
|
-
const allowed = kind === WorkcardKind.Project ? parentType.projectTypes ?? [] : parentType.cardTypes ?? [];
|
|
60
|
-
if (allowed.includes(type)) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (kind === WorkcardKind.Card && parentType.scopedCardTypes === true && dataDefined(view, type)) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
throw new CardTypeNotAllowed(`${parent.type}:${type}`);
|
|
67
|
-
};
|
|
68
|
-
/** The layer a parent project admits data-defined children through — `undefined` without a schema port. */
|
|
69
|
-
const childViewOf = async (runtime, entityId, parent) => runtime.schemaStore() == null || !isProject(parent) ? undefined : await runtime.schemasFor(entityId, parent.id);
|
|
70
|
-
/**
|
|
71
|
-
* Step 4: the card, its type and flow, its parent and — for a specification — its slot.
|
|
72
|
-
*
|
|
73
|
-
* @throws {WorkcardNotFound | PlanningScopeMismatch | UnknownWorkcardType | UnknownStatusFlow}
|
|
74
|
-
* @throws {ParentNotFound | CardTypeNotAllowed | PlanningError}
|
|
75
|
-
*/
|
|
76
|
-
const resolveExecution = async (runtime, facade, exec) => {
|
|
77
|
-
const service = runtime.service();
|
|
78
|
-
const entityId = facade.scope.entityId;
|
|
79
|
-
const create = exec.action === TransitionAction.Create;
|
|
80
|
-
// Without a schema port every step reads the code registry itself, in today's order; with one,
|
|
81
|
-
// the card's project is found first and the step reads that project's resolved layer.
|
|
82
|
-
const layered = runtime.schemaStore() != null;
|
|
83
|
-
let schemas = service.schemas;
|
|
84
|
-
let card;
|
|
85
|
-
let type;
|
|
86
|
-
let parent;
|
|
87
|
-
if (create) {
|
|
88
|
-
if (exec.card == null || typeof exec.card !== 'object') {
|
|
89
|
-
throw new PlanningError('malformed:create-without-draft');
|
|
26
|
+
export const makeResolveUtils = (runtime) => {
|
|
27
|
+
const normalizeExecution = (input) => {
|
|
28
|
+
const exec = structuredClone(input);
|
|
29
|
+
if (exec.card != null && typeof exec.card === 'object') {
|
|
30
|
+
const draft = trim(exec.card);
|
|
31
|
+
const parents = cardHelper.normalizeParents(draft.parent, draft.parents);
|
|
32
|
+
exec.card = { ...draft, ...(parents.length > 0 ? { parents, parent: draft.parent ?? parents[0] } : {}) };
|
|
90
33
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const loaded = new Map();
|
|
94
|
-
if (layered) {
|
|
95
|
-
// Loaded through the facade, so a parent this scope cannot see is absent here too.
|
|
96
|
-
const primary = parents[0] != null ? await facade.cards.load(parents[0]) : null;
|
|
97
|
-
if (parents[0] != null && primary == null) {
|
|
98
|
-
throw new ParentNotFound(parents[0]);
|
|
99
|
-
}
|
|
100
|
-
if (primary != null) {
|
|
101
|
-
loaded.set(parents[0], primary);
|
|
102
|
-
}
|
|
103
|
-
const project = draft.kind === WorkcardKind.Project || primary == null
|
|
104
|
-
? undefined
|
|
105
|
-
: projectOf({ kind: draft.kind, parent: parents[0], parents }, primary);
|
|
106
|
-
schemas = await runtime.schemasFor(entityId, project);
|
|
34
|
+
if (exec.changes != null) {
|
|
35
|
+
exec.changes = trim(exec.changes);
|
|
107
36
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
throw new PlanningError(`malformed:kind:${draft.type}:${draft.kind}`);
|
|
37
|
+
if (exec.unset != null) {
|
|
38
|
+
exec.unset = [...new Set(exec.unset)];
|
|
111
39
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
40
|
+
return exec;
|
|
41
|
+
};
|
|
42
|
+
const assertChildAllowed = (parent, kind, type, view) => {
|
|
43
|
+
if (kind === WorkcardKind.Specification) {
|
|
44
|
+
return;
|
|
115
45
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
for (const [index, id] of parents.entries()) {
|
|
119
|
-
const found = loaded.get(id) ?? await facade.cards.load(id);
|
|
120
|
-
if (found == null) {
|
|
121
|
-
throw new ParentNotFound(id);
|
|
122
|
-
}
|
|
123
|
-
if (index === 0) {
|
|
124
|
-
parent = found;
|
|
125
|
-
}
|
|
126
|
-
if (index === 0 || isProject(found)) {
|
|
127
|
-
const view = !layered ? undefined : index === 0 && isProject(found) ? schemas : await childViewOf(runtime, entityId, found);
|
|
128
|
-
assertChildAllowed(runtime, found, draft.kind, draft.type, view);
|
|
129
|
-
}
|
|
46
|
+
if (!cardHelper.isProject(parent)) {
|
|
47
|
+
throw new CardTypeNotAllowed(`${parent.type}:${type}`);
|
|
130
48
|
}
|
|
131
|
-
|
|
132
|
-
|
|
49
|
+
const parentType = runtime.service().schemas.type(parent.type);
|
|
50
|
+
const allowed = kind === WorkcardKind.Project ? parentType.projectTypes ?? [] : parentType.cardTypes ?? [];
|
|
51
|
+
if (allowed.includes(type)) {
|
|
52
|
+
return;
|
|
133
53
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
if (typeof exec.card !== 'string' || exec.card === '') {
|
|
137
|
-
throw new PlanningError(`malformed:${exec.action}-without-card`);
|
|
54
|
+
if (kind === WorkcardKind.Card && parentType.scopedCardTypes === true && dataDefined(view, type)) {
|
|
55
|
+
return;
|
|
138
56
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
57
|
+
throw new CardTypeNotAllowed(`${parent.type}:${type}`);
|
|
58
|
+
};
|
|
59
|
+
const childViewOf = async (entityId, parent) => runtime.schemaStore() == null || !cardHelper.isProject(parent) ? undefined : await runtime.schemasFor(entityId, parent.id);
|
|
60
|
+
const resolveExecution = async (facade, exec) => {
|
|
61
|
+
const service = runtime.service();
|
|
62
|
+
const entityId = facade.scope.entityId;
|
|
63
|
+
const create = exec.action === TransitionAction.Create;
|
|
64
|
+
// Without a schema port every step reads the code registry itself, in today's order; with one,
|
|
65
|
+
// the card's project is found first and the step reads that project's resolved layer.
|
|
66
|
+
const layered = runtime.schemaStore() != null;
|
|
67
|
+
let schemas = service.schemas;
|
|
68
|
+
let card;
|
|
69
|
+
let type;
|
|
70
|
+
let parent;
|
|
71
|
+
if (create) {
|
|
72
|
+
if (exec.card == null || typeof exec.card !== 'object') {
|
|
73
|
+
throw new PlanningError('malformed:create-without-draft');
|
|
74
|
+
}
|
|
75
|
+
const draft = exec.card;
|
|
76
|
+
const parents = cardHelper.normalizeParents(draft.parent, draft.parents);
|
|
77
|
+
const loaded = new Map();
|
|
78
|
+
if (layered) {
|
|
79
|
+
// Loaded through the facade, so a parent this scope cannot see is absent here too.
|
|
80
|
+
const primary = parents[0] != null ? await facade.cards.load(parents[0]) : null;
|
|
81
|
+
if (parents[0] != null && primary == null) {
|
|
82
|
+
throw new ParentNotFound(parents[0]);
|
|
83
|
+
}
|
|
84
|
+
if (primary != null) {
|
|
85
|
+
loaded.set(parents[0], primary);
|
|
86
|
+
}
|
|
87
|
+
const project = draft.kind === WorkcardKind.Project || primary == null
|
|
88
|
+
? undefined
|
|
89
|
+
: cardHelper.projectOf({ kind: draft.kind, parent: parents[0], parents }, primary);
|
|
90
|
+
schemas = await runtime.schemasFor(entityId, project);
|
|
91
|
+
}
|
|
92
|
+
type = schemas.type(draft.type);
|
|
93
|
+
if (type.kind !== draft.kind) {
|
|
94
|
+
throw new PlanningError(`malformed:kind:${draft.type}:${draft.kind}`);
|
|
95
|
+
}
|
|
96
|
+
if (layered && isScoped(schemas) && schemas.isRetired(PlanningSchemaKind.Type, draft.type)) {
|
|
97
|
+
// Existing cards keep resolving a retired type; nothing new is made of it.
|
|
98
|
+
throw new UnknownWorkcardType(`retired:${draft.type}`);
|
|
99
|
+
}
|
|
100
|
+
// Normalized: the primary parent is first. It must accept the child; so must every project
|
|
101
|
+
// among the secondary parents.
|
|
102
|
+
for (const [index, id] of parents.entries()) {
|
|
103
|
+
const found = loaded.get(id) ?? await facade.cards.load(id);
|
|
104
|
+
if (found == null) {
|
|
105
|
+
throw new ParentNotFound(id);
|
|
106
|
+
}
|
|
107
|
+
if (index === 0) {
|
|
108
|
+
parent = found;
|
|
109
|
+
}
|
|
110
|
+
if (index === 0 || cardHelper.isProject(found)) {
|
|
111
|
+
const view = !layered ? undefined : index === 0 && cardHelper.isProject(found) ? schemas : await childViewOf(entityId, found);
|
|
112
|
+
assertChildAllowed(found, draft.kind, draft.type, view);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (draft.kind === WorkcardKind.Specification && parent == null) {
|
|
116
|
+
throw new PlanningError('malformed:specification-without-parent');
|
|
117
|
+
}
|
|
142
118
|
}
|
|
143
|
-
|
|
144
|
-
|
|
119
|
+
else {
|
|
120
|
+
if (typeof exec.card !== 'string' || exec.card === '') {
|
|
121
|
+
throw new PlanningError(`malformed:${exec.action}-without-card`);
|
|
122
|
+
}
|
|
123
|
+
const found = await runtime.reader().cards.get(exec.card, entityId);
|
|
124
|
+
if (found == null) {
|
|
125
|
+
throw new WorkcardNotFound(exec.card);
|
|
126
|
+
}
|
|
127
|
+
if (found.entityId !== entityId) {
|
|
128
|
+
throw new PlanningScopeMismatch(exec.card);
|
|
129
|
+
}
|
|
130
|
+
if (facade.scope.projects != null && await facade.cards.load(exec.card) == null) {
|
|
131
|
+
// Outside the scope's projects: absent, exactly like another entity's card.
|
|
132
|
+
throw new WorkcardNotFound(exec.card);
|
|
133
|
+
}
|
|
134
|
+
card = found;
|
|
135
|
+
if (layered) {
|
|
136
|
+
parent = card.parent != null ? await facade.cards.load(card.parent) ?? undefined : undefined;
|
|
137
|
+
schemas = await runtime.schemasFor(entityId, cardHelper.projectOf(card, parent));
|
|
138
|
+
type = schemas.type(card.type);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
type = schemas.type(card.type);
|
|
142
|
+
parent = card.parent != null ? await facade.cards.load(card.parent) ?? undefined : undefined;
|
|
143
|
+
}
|
|
145
144
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
throw new
|
|
145
|
+
const flowId = exec.flow ?? statusHelper.primaryFlowOf(type);
|
|
146
|
+
if (!type.flows.includes(flowId)) {
|
|
147
|
+
throw new UnknownStatusFlow(`${type.type}:${flowId}`);
|
|
149
148
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
149
|
+
const kind = create ? exec.card.kind : card.kind;
|
|
150
|
+
const category = create ? exec.card.category : card?.category;
|
|
151
|
+
const slot = kind === WorkcardKind.Specification && parent != null && category != null
|
|
152
|
+
? specificationHelper.slotOf(schemas.type(parent.type), category)
|
|
153
|
+
: undefined;
|
|
154
|
+
return {
|
|
155
|
+
create,
|
|
156
|
+
...(card != null ? { card } : {}),
|
|
157
|
+
type,
|
|
158
|
+
flowId,
|
|
159
|
+
flow: schemas.flow(flowId),
|
|
160
|
+
...(parent != null ? { parent } : {}),
|
|
161
|
+
...(slot != null ? { slot } : {}),
|
|
162
|
+
store: service.store(type.type),
|
|
163
|
+
schemas,
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
const projectFor = (resolved, exec, cardId) => {
|
|
167
|
+
if (resolved.card != null) {
|
|
168
|
+
return cardHelper.isProject(resolved.card) ? resolved.card.id : cardHelper.projectOf(resolved.card, resolved.parent);
|
|
155
169
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
170
|
+
const draft = exec.card;
|
|
171
|
+
if (draft.kind === WorkcardKind.Project) {
|
|
172
|
+
return cardId;
|
|
159
173
|
}
|
|
160
|
-
|
|
161
|
-
const flowId = exec.flow ?? primaryFlowOf(type);
|
|
162
|
-
if (!type.flows.includes(flowId)) {
|
|
163
|
-
throw new UnknownStatusFlow(`${type.type}:${flowId}`);
|
|
164
|
-
}
|
|
165
|
-
const kind = create ? exec.card.kind : card.kind;
|
|
166
|
-
const category = create ? exec.card.category : card?.category;
|
|
167
|
-
const slot = kind === WorkcardKind.Specification && parent != null && category != null
|
|
168
|
-
? slotOf(schemas.type(parent.type), category)
|
|
169
|
-
: undefined;
|
|
170
|
-
return {
|
|
171
|
-
create,
|
|
172
|
-
...(card != null ? { card } : {}),
|
|
173
|
-
type,
|
|
174
|
-
flowId,
|
|
175
|
-
flow: schemas.flow(flowId),
|
|
176
|
-
...(parent != null ? { parent } : {}),
|
|
177
|
-
...(slot != null ? { slot } : {}),
|
|
178
|
-
store: service.store(type.type),
|
|
179
|
-
schemas,
|
|
174
|
+
return cardHelper.projectOf({ kind: draft.kind, parent: draft.parent, parents: draft.parents ?? [] }, resolved.parent);
|
|
180
175
|
};
|
|
176
|
+
return { normalizeExecution, assertChildAllowed, childViewOf, resolveExecution, projectFor };
|
|
181
177
|
};
|
|
182
|
-
/** The
|
|
183
|
-
const
|
|
184
|
-
if (resolved.card != null) {
|
|
185
|
-
return isProject(resolved.card) ? resolved.card.id : projectOf(resolved.card, resolved.parent);
|
|
186
|
-
}
|
|
187
|
-
const draft = exec.card;
|
|
188
|
-
if (draft.kind === WorkcardKind.Project) {
|
|
189
|
-
return cardId;
|
|
190
|
-
}
|
|
191
|
-
return projectOf({ kind: draft.kind, parent: draft.parent, parents: draft.parents ?? [] }, resolved.parent);
|
|
192
|
-
};
|
|
193
|
-
export const createResolveHelper = () => ({ normalizeExecution, assertChildAllowed, childViewOf, resolveExecution, projectFor });
|
|
194
|
-
export const resolveHelper = createResolveHelper();
|
|
178
|
+
/** The resolution steps of one service runtime — one per runtime. */
|
|
179
|
+
export const resolveUtilsOf = memoHelper.oncePer(makeResolveUtils);
|
|
195
180
|
//# sourceMappingURL=resolve.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/executor/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/executor/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,YAAY,EAAE,gBAAgB,EAA4M,MAAM,oBAAoB,CAAA;AACle,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA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UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;QACtH,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAqB,CAAA;QACxC,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,OAAO,EAAE,CAAC;YACxC,OAAO,MAAM,CAAA;QACf,CAAC;QACD,OAAO,UAAU,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,EAAE,EAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IAC/I,CAAC,CAAA;IAED,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAA;AAC9F,CAAC,CAAA;AAED,qEAAqE;AACrE,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { AnyTypeSchema, PlanningSchemaRegistry, PlanningStore, SpecificationSlot, StatusFlowSchema, Workcard } from '@owlmeans/planning';
|
|
2
|
-
import type { createResolveHelper } from './resolve.js';
|
|
3
2
|
/** Everything the steps after resolution read about an execution. */
|
|
4
3
|
export interface Resolved {
|
|
5
4
|
create: boolean;
|
|
@@ -20,5 +19,4 @@ export interface Resolved {
|
|
|
20
19
|
*/
|
|
21
20
|
schemas: PlanningSchemaRegistry;
|
|
22
21
|
}
|
|
23
|
-
export type ResolveHelper = ReturnType<typeof createResolveHelper>;
|
|
24
22
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/executor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/executor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7I,qEAAqE;AACrE,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,OAAO,CAAA;IACf,wCAAwC;IACxC,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,IAAI,EAAE,aAAa,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,gBAAgB,CAAA;IACtB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,QAAQ,CAAA;IACjB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,iBAAiB,CAAA;IACxB,wCAAwC;IACxC,KAAK,EAAE,aAAa,CAAA;IACpB;;;OAGG;IACH,OAAO,EAAE,sBAAsB,CAAA;CAChC"}
|
|
@@ -2,7 +2,7 @@ import { type PlanningFacade, type TransitionExecution } from '@owlmeans/plannin
|
|
|
2
2
|
import type { PlanningRuntime } from '../types.js';
|
|
3
3
|
import type { Resolved } from './types.js';
|
|
4
4
|
/**
|
|
5
|
-
* Step 6: shape, flow rule, immutables (`createdBy` among them,
|
|
5
|
+
* Step 6: shape, flow rule, immutables (`createdBy` among them, `creatorHelper.assertCreatorFixed`),
|
|
6
6
|
* `fields`, labels, parent moves, the specification slot and relationships — in that order.
|
|
7
7
|
* Nothing is written by a refusal here.
|
|
8
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/executor/validate.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/executor/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0U,KAAK,cAAc,EAA8C,KAAK,mBAAmB,EAAsB,MAAM,oBAAoB,CAAA;AAC1d,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAiO1C;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,YACnB,eAAe,UAAU,cAAc,QAAQ,mBAAmB,YAAY,QAAQ,KAC9F,OAAO,CAAC,IAAI,CAUd,CAAA"}
|