@owlmeans/server-planning 0.1.18-rc.21 → 0.1.18-rc.23
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/cards.d.ts +5 -3
- package/build/actions/cards.d.ts.map +1 -1
- package/build/actions/cards.js +1 -1
- package/build/actions/cards.js.map +1 -1
- 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/list-specification-revisions.d.ts +6 -0
- 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/schemas.d.ts +5 -3
- package/build/actions/schemas.d.ts.map +1 -1
- package/build/actions/schemas.js.map +1 -1
- package/build/actions/specs.d.ts +4 -2
- package/build/actions/specs.d.ts.map +1 -1
- package/build/actions/specs.js.map +1 -1
- 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/src/actions/cards.ts +0 -48
- package/src/actions/schemas.ts +0 -87
package/build/actions/execute.js
CHANGED
|
@@ -1,109 +1,25 @@
|
|
|
1
1
|
import { handlers } from '@owlmeans/server-api';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
* What a wire execution may say. `actor` is dropped — the scope names the writer — and a create's
|
|
7
|
-
* `createdBy` claim is dropped too: the executor's {@link withCreator} stamps the authenticated
|
|
8
|
-
* subject, the same rule an in-process create follows. Applied here as well, so the returned
|
|
9
|
-
* execution already carries it. A `createdBy` in `changes` or `unset` is not dropped: the executor
|
|
10
|
-
* refuses it on every action (`assertCreatorFixed`), so no body moves an owner.
|
|
11
|
-
*/
|
|
12
|
-
export const wireExecution = (body, scope) => {
|
|
13
|
-
const { wait: _wait, timeout: _timeout, actor: _actor, ...exec } = body;
|
|
14
|
-
if (exec.action === TransitionAction.Create && exec.card != null && typeof exec.card === 'object') {
|
|
15
|
-
const { createdBy: _createdBy, ...draft } = exec.card;
|
|
16
|
-
exec.card = draft;
|
|
17
|
-
}
|
|
18
|
-
return withCreator(exec, scope);
|
|
19
|
-
};
|
|
20
|
-
/** `wait`/`timeout` as a server grants them: the timeout never holds a request past `maxPoll`. */
|
|
21
|
-
export const executeOptionsOf = (body, maxPoll) => {
|
|
22
|
-
const ceiling = maxPoll * 1000;
|
|
23
|
-
if (body.wait !== true) {
|
|
24
|
-
return {};
|
|
25
|
-
}
|
|
26
|
-
const asked = Number(body.timeout ?? DEFAULT_COMMIT_TIMEOUT);
|
|
27
|
-
return { wait: true, timeout: Math.min(Number.isFinite(asked) && asked > 0 ? asked : DEFAULT_COMMIT_TIMEOUT, ceiling) };
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Refuse an execution outside the access's `writes`: the card it acts on (a specification through
|
|
31
|
-
* its parent card), or every parent a create names, must be one {@link writableIn} admits. A create
|
|
32
|
-
* of a project is `grants.createProjects`' alone. A card or parent this scope cannot see is left to
|
|
33
|
-
* the executor, which answers it as absent.
|
|
34
|
-
*
|
|
35
|
-
* @throws {PlanningForbidden}
|
|
36
|
-
*/
|
|
37
|
-
export const assertExecutionWrites = async (facade, exec, access) => {
|
|
38
|
-
if (access?.writes == null) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const admitted = async (card) => {
|
|
42
|
-
if (writableIn(access, card)) {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
if (!isSpecification(card) || card.parent == null) {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
const parent = await facade.cards.load(card.parent);
|
|
49
|
-
return parent == null || writableIn(access, parent);
|
|
50
|
-
};
|
|
51
|
-
if (exec.action === TransitionAction.Create && exec.card != null && typeof exec.card === 'object') {
|
|
52
|
-
if (exec.card.kind === WorkcardKind.Project) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
const parents = normalizeParents(exec.card.parent, exec.card.parents);
|
|
56
|
-
if (parents.length === 0) {
|
|
57
|
-
throw new PlanningForbidden('writes:root');
|
|
58
|
-
}
|
|
59
|
-
for (const id of parents) {
|
|
60
|
-
const parent = await facade.cards.load(id);
|
|
61
|
-
if (parent != null && !await admitted(parent)) {
|
|
62
|
-
throw new PlanningForbidden(`writes:${id}`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (typeof exec.card === 'string' && exec.card !== '') {
|
|
68
|
-
const card = await facade.cards.load(exec.card);
|
|
69
|
-
if (card != null && !await admitted(card)) {
|
|
70
|
-
throw new PlanningForbidden(`writes:${exec.card}`);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* The access a wire execution needs. `writes` first ({@link assertExecutionWrites}); then the
|
|
76
|
-
* grants: `createProjects` for a project create (its primary parent, or the root),
|
|
77
|
-
* `deleteProjects` for the delete of a project card. A card this scope cannot see is left to the
|
|
78
|
-
* executor, which answers it as absent.
|
|
79
|
-
*
|
|
80
|
-
* @throws {PlanningForbidden}
|
|
81
|
-
*/
|
|
82
|
-
export const assertExecutionGranted = async (facade, exec, access) => {
|
|
83
|
-
await assertExecutionWrites(facade, exec, access);
|
|
84
|
-
if (access?.grants == null) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (exec.action === TransitionAction.Create && typeof exec.card === 'object' && exec.card?.kind === WorkcardKind.Project) {
|
|
88
|
-
assertGranted(access, 'createProjects', normalizeParents(exec.card.parent, exec.card.parents)[0]);
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (exec.action === TransitionAction.Delete && typeof exec.card === 'string') {
|
|
92
|
-
const card = await facade.cards.load(exec.card);
|
|
93
|
-
if (card != null && isProject(card)) {
|
|
94
|
-
assertGranted(access, 'deleteProjects', card.id);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
};
|
|
2
|
+
import { MAX_COMMIT_POLL } from '@owlmeans/planning';
|
|
3
|
+
import { guardHelper } from '../utils/guard.js';
|
|
4
|
+
import { planningHandlerOf } from '../utils/handler.js';
|
|
5
|
+
import { executionHelper } from './execution.js';
|
|
98
6
|
/** The one write route. */
|
|
99
|
-
export const executePlanning = (protocol, opts) => handlers().request(protocol, async (req, ctx) => concealed(async () => {
|
|
100
|
-
const { facade, access } = await handlerScopeOf(
|
|
7
|
+
export const executePlanning = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.concealed(async () => {
|
|
8
|
+
const { facade, access } = await planningHandlerOf(ctx).handlerScopeOf(req, opts);
|
|
101
9
|
const body = (req.body ?? {});
|
|
102
|
-
const exec = wireExecution(body, facade.scope);
|
|
103
|
-
await assertExecutionGranted(facade, exec, access);
|
|
104
|
-
const receipt = await facade.execute(exec, executeOptionsOf(body, opts?.maxPoll ?? MAX_COMMIT_POLL));
|
|
10
|
+
const exec = executionHelper.wireExecution(body, facade.scope);
|
|
11
|
+
await executionHelper.assertExecutionGranted(facade, exec, access);
|
|
12
|
+
const receipt = await facade.execute(exec, executionHelper.executeOptionsOf(body, opts?.maxPoll ?? MAX_COMMIT_POLL));
|
|
105
13
|
return receipt.card !== undefined
|
|
106
14
|
? { transition: receipt.transition, card: receipt.card }
|
|
107
15
|
: { transition: receipt.transition };
|
|
108
16
|
}));
|
|
17
|
+
/** @deprecated compat:factory-refactor — use `executionHelper.wireExecution(…)` */
|
|
18
|
+
export const wireExecution = (body, scope) => executionHelper.wireExecution(body, scope);
|
|
19
|
+
/** @deprecated compat:factory-refactor — use `executionHelper.executeOptionsOf(…)` */
|
|
20
|
+
export const executeOptionsOf = (body, maxPoll) => executionHelper.executeOptionsOf(body, maxPoll);
|
|
21
|
+
/** @deprecated compat:factory-refactor — use `executionHelper.assertExecutionWrites(…)` */
|
|
22
|
+
export const assertExecutionWrites = async (facade, exec, access) => await executionHelper.assertExecutionWrites(facade, exec, access);
|
|
23
|
+
/** @deprecated compat:factory-refactor — use `executionHelper.assertExecutionGranted(…)` */
|
|
24
|
+
export const assertExecutionGranted = async (facade, exec, access) => await executionHelper.assertExecutionGranted(facade, exec, access);
|
|
109
25
|
//# sourceMappingURL=execute.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../src/actions/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../src/actions/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAMpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGhD,2BAA2B;AAC3B,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,QAAsC,EAAE,IAA6B,EACrD,EAAE,CAClB,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,IAAoC,EAAE;IACzH,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACjF,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAmB,CAAA;IAC/C,MAAM,IAAI,GAAG,eAAe,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;IAC9D,MAAM,eAAe,CAAC,sBAAsB,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;IAClE,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,IAAI,eAAe,CAAC,CAAC,CAAA;IAEpH,OAAO,OAAO,CAAC,IAAI,KAAK,SAAS;QAC/B,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE;QACxD,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAA;AACxC,CAAC,CAAC,CAAC,CAAA;AAEL,mFAAmF;AACnF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAoB,EAAE,KAAoB,EAAuB,EAAE,CAC/F,eAAe,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AAE5C,sFAAsF;AACtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAA8C,EAAE,OAAe,EAAkB,EAAE,CAClH,eAAe,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;AAEjD,2FAA2F;AAC3F,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EACxC,MAAsB,EAAE,IAAyB,EAAE,MAAuB,EAC3D,EAAE,CAAC,MAAM,eAAe,CAAC,qBAAqB,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;AAErF,4FAA4F;AAC5F,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EACzC,MAAsB,EAAE,IAAyB,EAAE,MAAuB,EAC3D,EAAE,CAAC,MAAM,eAAe,CAAC,sBAAsB,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ExecuteOptions, ExecuteRequest, PlanningFacade, PlanningScope, TransitionExecution } from '@owlmeans/planning';
|
|
2
|
+
import type { PlanningAccess } from '../../types.js';
|
|
3
|
+
/** What a wire execution may say, how long it may hold, and what access it needs. */
|
|
4
|
+
export interface ExecutionHelper {
|
|
5
|
+
/**
|
|
6
|
+
* What a wire execution may say. `actor` is dropped — the scope names the writer — and a create's
|
|
7
|
+
* `createdBy` claim is dropped too: the executor's `creatorHelper.withCreator` stamps the
|
|
8
|
+
* authenticated subject, the same rule an in-process create follows. Applied here as well, so the
|
|
9
|
+
* returned execution already carries it. A `createdBy` in `changes` or `unset` is not dropped: the
|
|
10
|
+
* executor refuses it on every action (`assertCreatorFixed`), so no body moves an owner.
|
|
11
|
+
*/
|
|
12
|
+
wireExecution: (body: ExecuteRequest, scope: PlanningScope) => TransitionExecution;
|
|
13
|
+
/** `wait`/`timeout` as a server grants them: the timeout never holds a request past `maxPoll`. */
|
|
14
|
+
executeOptionsOf: (body: Pick<ExecuteRequest, 'wait' | 'timeout'>, maxPoll: number) => ExecuteOptions;
|
|
15
|
+
/**
|
|
16
|
+
* Refuse an execution outside the access's `writes`: the card it acts on (a specification through
|
|
17
|
+
* its parent card), or every parent a create names, must be one `writableIn` admits. A create
|
|
18
|
+
* of a project is `grants.createProjects`' alone. A card or parent this scope cannot see is left to
|
|
19
|
+
* the executor, which answers it as absent.
|
|
20
|
+
*
|
|
21
|
+
* @throws {PlanningForbidden}
|
|
22
|
+
*/
|
|
23
|
+
assertExecutionWrites: (facade: PlanningFacade, exec: TransitionExecution, access?: PlanningAccess) => Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* The access a wire execution needs. `writes` first ({@link ExecutionHelper.assertExecutionWrites});
|
|
26
|
+
* then the grants: `createProjects` for a project create (its primary parent, or the root),
|
|
27
|
+
* `deleteProjects` for the delete of a project card. A card this scope cannot see is left to the
|
|
28
|
+
* executor, which answers it as absent.
|
|
29
|
+
*
|
|
30
|
+
* @throws {PlanningForbidden}
|
|
31
|
+
*/
|
|
32
|
+
assertExecutionGranted: (facade: PlanningFacade, exec: TransitionExecution, access?: PlanningAccess) => Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/actions/execution/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC5H,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,qFAAqF;AACrF,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,aAAa,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa,KAAK,mBAAmB,CAAA;IAClF,kGAAkG;IAClG,gBAAgB,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,cAAc,CAAA;IACrG;;;;;;;OAOG;IACH,qBAAqB,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACpH;;;;;;;OAOG;IACH,sBAAsB,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/actions/execution/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/actions/execution.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,eAAO,MAAM,qBAAqB,QAAO,eAkFxC,CAAA;AAED,eAAO,MAAM,eAAe,iBAA0B,CAAA"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { cardHelper, DEFAULT_COMMIT_TIMEOUT, PlanningForbidden, TransitionAction, WorkcardKind, } from '@owlmeans/planning';
|
|
2
|
+
import { creatorHelper } from '../executor/creator.js';
|
|
3
|
+
import { makePlanningAccessModel } from '../utils/access.js';
|
|
4
|
+
export const createExecutionHelper = () => {
|
|
5
|
+
const wireExecution = (body, scope) => {
|
|
6
|
+
const { wait: _wait, timeout: _timeout, actor: _actor, ...exec } = body;
|
|
7
|
+
if (exec.action === TransitionAction.Create && exec.card != null && typeof exec.card === 'object') {
|
|
8
|
+
const { createdBy: _createdBy, ...draft } = exec.card;
|
|
9
|
+
exec.card = draft;
|
|
10
|
+
}
|
|
11
|
+
return creatorHelper.withCreator(exec, scope);
|
|
12
|
+
};
|
|
13
|
+
const executeOptionsOf = (body, maxPoll) => {
|
|
14
|
+
const ceiling = maxPoll * 1000;
|
|
15
|
+
if (body.wait !== true) {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
const asked = Number(body.timeout ?? DEFAULT_COMMIT_TIMEOUT);
|
|
19
|
+
return { wait: true, timeout: Math.min(Number.isFinite(asked) && asked > 0 ? asked : DEFAULT_COMMIT_TIMEOUT, ceiling) };
|
|
20
|
+
};
|
|
21
|
+
const assertExecutionWrites = async (facade, exec, access) => {
|
|
22
|
+
if (access?.writes == null) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const model = makePlanningAccessModel(access);
|
|
26
|
+
const admitted = async (card) => {
|
|
27
|
+
if (model.writableIn(card)) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
if (!cardHelper.isSpecification(card) || card.parent == null) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
const parent = await facade.cards.load(card.parent);
|
|
34
|
+
return parent == null || model.writableIn(parent);
|
|
35
|
+
};
|
|
36
|
+
if (exec.action === TransitionAction.Create && exec.card != null && typeof exec.card === 'object') {
|
|
37
|
+
if (exec.card.kind === WorkcardKind.Project) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const parents = cardHelper.normalizeParents(exec.card.parent, exec.card.parents);
|
|
41
|
+
if (parents.length === 0) {
|
|
42
|
+
throw new PlanningForbidden('writes:root');
|
|
43
|
+
}
|
|
44
|
+
for (const id of parents) {
|
|
45
|
+
const parent = await facade.cards.load(id);
|
|
46
|
+
if (parent != null && !await admitted(parent)) {
|
|
47
|
+
throw new PlanningForbidden(`writes:${id}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (typeof exec.card === 'string' && exec.card !== '') {
|
|
53
|
+
const card = await facade.cards.load(exec.card);
|
|
54
|
+
if (card != null && !await admitted(card)) {
|
|
55
|
+
throw new PlanningForbidden(`writes:${exec.card}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const assertExecutionGranted = async (facade, exec, access) => {
|
|
60
|
+
await assertExecutionWrites(facade, exec, access);
|
|
61
|
+
if (access?.grants == null) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const model = makePlanningAccessModel(access);
|
|
65
|
+
if (exec.action === TransitionAction.Create && typeof exec.card === 'object' && exec.card?.kind === WorkcardKind.Project) {
|
|
66
|
+
model.assertGranted('createProjects', cardHelper.normalizeParents(exec.card.parent, exec.card.parents)[0]);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (exec.action === TransitionAction.Delete && typeof exec.card === 'string') {
|
|
70
|
+
const card = await facade.cards.load(exec.card);
|
|
71
|
+
if (card != null && cardHelper.isProject(card)) {
|
|
72
|
+
model.assertGranted('deleteProjects', card.id);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
return { wireExecution, executeOptionsOf, assertExecutionWrites, assertExecutionGranted };
|
|
77
|
+
};
|
|
78
|
+
export const executionHelper = createExecutionHelper();
|
|
79
|
+
//# sourceMappingURL=execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/actions/execution.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PlanningProtocols } from '@owlmeans/planning';
|
|
2
|
+
import type { PlanningHandlerOptions } from '../types.js';
|
|
3
|
+
import type { RequestHandler } from './types.js';
|
|
4
|
+
/** @throws {WorkcardNotFound} for an absent card and for another entity's alike */
|
|
5
|
+
export declare const getCard: (protocol: PlanningProtocols['card']['get'], opts?: PlanningHandlerOptions) => RequestHandler;
|
|
6
|
+
//# sourceMappingURL=get-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-card.d.ts","sourceRoot":"","sources":["../../src/actions/get-card.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,mFAAmF;AACnF,eAAO,MAAM,OAAO,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,SAAS,sBAAsB,KAAG,cAK/F,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { handlers } from '@owlmeans/server-api';
|
|
2
|
+
import { guardHelper } from '../utils/guard.js';
|
|
3
|
+
import { planningHandlerOf } from '../utils/handler.js';
|
|
4
|
+
/** @throws {WorkcardNotFound} for an absent card and for another entity's alike */
|
|
5
|
+
export const getCard = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.concealed(async () => {
|
|
6
|
+
const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
|
|
7
|
+
return await facade.cards.get(`${req.params.id}`);
|
|
8
|
+
}));
|
|
9
|
+
//# sourceMappingURL=get-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-card.js","sourceRoot":"","sources":["../../src/actions/get-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,mFAAmF;AACnF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,QAA0C,EAAE,IAA6B,EAAkB,EAAE,CACnH,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;IACzF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAEpE,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;AACnD,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PlanningProtocols } from '@owlmeans/planning';
|
|
2
|
+
import type { PlanningHandlerOptions } from '../types.js';
|
|
3
|
+
import type { RequestHandler } from './types.js';
|
|
4
|
+
/** @throws {WorkcardNotFound} */
|
|
5
|
+
export declare const getSpecification: (protocol: PlanningProtocols['spec']['get'], opts?: PlanningHandlerOptions) => RequestHandler;
|
|
6
|
+
//# sourceMappingURL=get-specification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-specification.d.ts","sourceRoot":"","sources":["../../src/actions/get-specification.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,iCAAiC;AACjC,eAAO,MAAM,gBAAgB,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,SAAS,sBAAsB,KAAG,cAKxG,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { handlers } from '@owlmeans/server-api';
|
|
2
|
+
import { guardHelper } from '../utils/guard.js';
|
|
3
|
+
import { planningHandlerOf } from '../utils/handler.js';
|
|
4
|
+
/** @throws {WorkcardNotFound} */
|
|
5
|
+
export const getSpecification = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.concealed(async () => {
|
|
6
|
+
const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
|
|
7
|
+
return await facade.specifications.get(`${req.params.id}`);
|
|
8
|
+
}));
|
|
9
|
+
//# sourceMappingURL=get-specification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-specification.js","sourceRoot":"","sources":["../../src/actions/get-specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,iCAAiC;AACjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAA0C,EAAE,IAA6B,EAAkB,EAAE,CAC5H,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;IACzF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAEpE,OAAO,MAAM,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;AAC5D,CAAC,CAAC,CAAC,CAAA"}
|
package/build/actions/index.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export type * from './execution/types.js';
|
|
2
|
+
export * from './apply-schema-request.js';
|
|
2
3
|
export * from './commit.js';
|
|
4
|
+
export * from './define-schemas.js';
|
|
3
5
|
export * from './execute.js';
|
|
6
|
+
export * from './execution.js';
|
|
7
|
+
export * from './get-card.js';
|
|
8
|
+
export * from './get-specification.js';
|
|
4
9
|
export * from './links.js';
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
10
|
+
export * from './list-card-specifications.js';
|
|
11
|
+
export * from './list-card-transitions.js';
|
|
12
|
+
export * from './list-cards.js';
|
|
13
|
+
export * from './list-schemas.js';
|
|
14
|
+
export * from './list-specification-revisions.js';
|
|
15
|
+
export * from './summarize-cards.js';
|
|
7
16
|
export * from './transitions.js';
|
|
8
17
|
export * from './watch.js';
|
|
9
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,sBAAsB,CAAA;AAEzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,wBAAwB,CAAA;AACtC,cAAc,YAAY,CAAA;AAC1B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,mCAAmC,CAAA;AACjD,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA"}
|
package/build/actions/index.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './apply-schema-request.js';
|
|
2
2
|
export * from './commit.js';
|
|
3
|
+
export * from './define-schemas.js';
|
|
3
4
|
export * from './execute.js';
|
|
5
|
+
export * from './execution.js';
|
|
6
|
+
export * from './get-card.js';
|
|
7
|
+
export * from './get-specification.js';
|
|
4
8
|
export * from './links.js';
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
9
|
+
export * from './list-card-specifications.js';
|
|
10
|
+
export * from './list-card-transitions.js';
|
|
11
|
+
export * from './list-cards.js';
|
|
12
|
+
export * from './list-schemas.js';
|
|
13
|
+
export * from './list-specification-revisions.js';
|
|
14
|
+
export * from './summarize-cards.js';
|
|
7
15
|
export * from './transitions.js';
|
|
8
16
|
export * from './watch.js';
|
|
9
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAEA,cAAc,2BAA2B,CAAA;AACzC,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,wBAAwB,CAAA;AACtC,cAAc,YAAY,CAAA;AAC1B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,mCAAmC,CAAA;AACjD,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA"}
|
package/build/actions/links.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { handlers } from '@owlmeans/server-api';
|
|
2
1
|
import type { PlanningProtocols } from '@owlmeans/planning';
|
|
3
|
-
import type {
|
|
4
|
-
|
|
2
|
+
import type { PlanningHandlerOptions } from '../types.js';
|
|
3
|
+
import type { RequestHandler } from './types.js';
|
|
4
|
+
export declare const listLinks: (protocol: PlanningProtocols['link']['list'], opts?: PlanningHandlerOptions) => RequestHandler;
|
|
5
5
|
//# sourceMappingURL=links.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../src/actions/links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../src/actions/links.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,eAAO,MAAM,SAAS,aACV,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,SAAS,sBAAsB,KACzE,cAKE,CAAA"}
|
package/build/actions/links.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { handlers } from '@owlmeans/server-api';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { wireHelper } from '@owlmeans/planning';
|
|
3
|
+
import { guardHelper } from '../utils/guard.js';
|
|
4
|
+
import { planningHandlerOf } from '../utils/handler.js';
|
|
5
|
+
export const listLinks = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.concealed(async () => {
|
|
6
|
+
const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
|
|
7
|
+
return await facade.relationships.list(wireHelper.decodeRelationshipQuery(req.query));
|
|
7
8
|
}));
|
|
8
9
|
//# sourceMappingURL=links.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.js","sourceRoot":"","sources":["../../src/actions/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"links.js","sourceRoot":"","sources":["../../src/actions/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,QAA2C,EAAE,IAA6B,EAC1D,EAAE,CAClB,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;IACzF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAEpE,OAAO,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;AACvF,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type PlanningProtocols } from '@owlmeans/planning';
|
|
2
|
+
import type { PlanningHandlerOptions } from '../types.js';
|
|
3
|
+
import type { RequestHandler } from './types.js';
|
|
4
|
+
/** One card's specifications — the current document per category unless `all`. */
|
|
5
|
+
export declare const listCardSpecifications: (protocol: PlanningProtocols['card']['specifications'], opts?: PlanningHandlerOptions) => RequestHandler;
|
|
6
|
+
//# sourceMappingURL=list-card-specifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-card-specifications.d.ts","sourceRoot":"","sources":["../../src/actions/list-card-specifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACvE,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,kFAAkF;AAClF,eAAO,MAAM,sBAAsB,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,gBAAgB,CAAC,SAAS,sBAAsB,KAAG,cAMzH,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { handlers } from '@owlmeans/server-api';
|
|
2
|
+
import { wireHelper } from '@owlmeans/planning';
|
|
3
|
+
import { guardHelper } from '../utils/guard.js';
|
|
4
|
+
import { planningHandlerOf } from '../utils/handler.js';
|
|
5
|
+
/** One card's specifications — the current document per category unless `all`. */
|
|
6
|
+
export const listCardSpecifications = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.concealed(async () => {
|
|
7
|
+
const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
|
|
8
|
+
const card = await facade.cards.get(`${req.params.id}`);
|
|
9
|
+
return await facade.specifications.list(card.id, wireHelper.decodeSpecificationQuery(req.query));
|
|
10
|
+
}));
|
|
11
|
+
//# sourceMappingURL=list-card-specifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-card-specifications.js","sourceRoot":"","sources":["../../src/actions/list-card-specifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAA0B,MAAM,oBAAoB,CAAA;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,kFAAkF;AAClF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,QAAqD,EAAE,IAA6B,EAAkB,EAAE,CAC7I,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;IACzF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACpE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;IAEvD,OAAO,MAAM,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAG,EAAE,UAAU,CAAC,wBAAwB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;AACnG,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type PlanningProtocols } from '@owlmeans/planning';
|
|
2
|
+
import type { PlanningHandlerOptions } from '../types.js';
|
|
3
|
+
import type { RequestHandler } from './types.js';
|
|
4
|
+
/** One card's log. */
|
|
5
|
+
export declare const listCardTransitions: (protocol: PlanningProtocols['card']['transitions'], opts?: PlanningHandlerOptions) => RequestHandler;
|
|
6
|
+
//# sourceMappingURL=list-card-transitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-card-transitions.d.ts","sourceRoot":"","sources":["../../src/actions/list-card-transitions.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACvE,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,sBAAsB;AACtB,eAAO,MAAM,mBAAmB,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,SAAS,sBAAsB,KAAG,cAMnH,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { handlers } from '@owlmeans/server-api';
|
|
2
|
+
import { wireHelper } from '@owlmeans/planning';
|
|
3
|
+
import { guardHelper } from '../utils/guard.js';
|
|
4
|
+
import { planningHandlerOf } from '../utils/handler.js';
|
|
5
|
+
/** One card's log. */
|
|
6
|
+
export const listCardTransitions = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.concealed(async () => {
|
|
7
|
+
const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
|
|
8
|
+
const card = await facade.cards.get(`${req.params.id}`);
|
|
9
|
+
return await facade.transitions.list({ ...wireHelper.decodeTransitionQuery(req.query), card: card.id });
|
|
10
|
+
}));
|
|
11
|
+
//# sourceMappingURL=list-card-transitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-card-transitions.js","sourceRoot":"","sources":["../../src/actions/list-card-transitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAA0B,MAAM,oBAAoB,CAAA;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,sBAAsB;AACtB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAkD,EAAE,IAA6B,EAAkB,EAAE,CACvI,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;IACzF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACpE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;IAEvD,OAAO,MAAM,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;AACzG,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type PlanningProtocols } from '@owlmeans/planning';
|
|
2
|
+
import type { PlanningHandlerOptions } from '../types.js';
|
|
3
|
+
import type { RequestHandler } from './types.js';
|
|
4
|
+
/** Cards of the caller's entity; the query arrives in its wire shape and is decoded here. */
|
|
5
|
+
export declare const listCards: (protocol: PlanningProtocols['card']['list'], opts?: PlanningHandlerOptions) => RequestHandler;
|
|
6
|
+
//# sourceMappingURL=list-cards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-cards.d.ts","sourceRoot":"","sources":["../../src/actions/list-cards.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACvE,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,6FAA6F;AAC7F,eAAO,MAAM,SAAS,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,SAAS,sBAAsB,KAAG,cAKlG,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { handlers } from '@owlmeans/server-api';
|
|
2
|
+
import { wireHelper } from '@owlmeans/planning';
|
|
3
|
+
import { guardHelper } from '../utils/guard.js';
|
|
4
|
+
import { planningHandlerOf } from '../utils/handler.js';
|
|
5
|
+
/** Cards of the caller's entity; the query arrives in its wire shape and is decoded here. */
|
|
6
|
+
export const listCards = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.concealed(async () => {
|
|
7
|
+
const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
|
|
8
|
+
return await facade.cards.list(wireHelper.decodeWorkcardQuery(req.query));
|
|
9
|
+
}));
|
|
10
|
+
//# sourceMappingURL=list-cards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-cards.js","sourceRoot":"","sources":["../../src/actions/list-cards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAA0B,MAAM,oBAAoB,CAAA;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,6FAA6F;AAC7F,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAA2C,EAAE,IAA6B,EAAkB,EAAE,CACtH,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;IACzF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAEpE,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;AAC3E,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PlanningProtocols } from '@owlmeans/planning';
|
|
2
|
+
import type { PlanningHandlerOptions } from '../types.js';
|
|
3
|
+
import type { RequestHandler } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* The schema bundle — what a client loads to answer `can()` with no round trip. Scoped like every
|
|
6
|
+
* other leaf (no organization, no bundle). Where the store holds data-defined schemas it is the
|
|
7
|
+
* resolved layer of the organization, or of the project the `project` query names (a project this
|
|
8
|
+
* scope can see); otherwise the service's code bundle.
|
|
9
|
+
*
|
|
10
|
+
* @throws {WorkcardNotFound} for a project this scope cannot see
|
|
11
|
+
*/
|
|
12
|
+
export declare const listSchemas: (protocol: PlanningProtocols['schema']['list'], opts?: PlanningHandlerOptions) => RequestHandler;
|
|
13
|
+
//# sourceMappingURL=list-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-schemas.d.ts","sourceRoot":"","sources":["../../src/actions/list-schemas.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAsB,MAAM,oBAAoB,CAAA;AAC/E,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAKhD;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,aACZ,iBAAiB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,sBAAsB,KAC3E,cAQE,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { handlers } from '@owlmeans/server-api';
|
|
2
|
+
import { guardHelper } from '../utils/guard.js';
|
|
3
|
+
import { planningHandlerOf } from '../utils/handler.js';
|
|
4
|
+
const text = (value) => value == null || value === '' ? undefined : `${Array.isArray(value) ? value[0] : value}`;
|
|
5
|
+
/**
|
|
6
|
+
* The schema bundle — what a client loads to answer `can()` with no round trip. Scoped like every
|
|
7
|
+
* other leaf (no organization, no bundle). Where the store holds data-defined schemas it is the
|
|
8
|
+
* resolved layer of the organization, or of the project the `project` query names (a project this
|
|
9
|
+
* scope can see); otherwise the service's code bundle.
|
|
10
|
+
*
|
|
11
|
+
* @throws {WorkcardNotFound} for a project this scope cannot see
|
|
12
|
+
*/
|
|
13
|
+
export const listSchemas = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.concealed(async () => {
|
|
14
|
+
const { facade } = await planningHandlerOf(ctx).handlerScopeOf(req, opts);
|
|
15
|
+
if (facade.definitions == null) {
|
|
16
|
+
return facade.schemas.bundle();
|
|
17
|
+
}
|
|
18
|
+
return await facade.definitions.bundle(text(req.query?.project));
|
|
19
|
+
}));
|
|
20
|
+
//# sourceMappingURL=list-schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-schemas.js","sourceRoot":"","sources":["../../src/actions/list-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,MAAM,IAAI,GAAG,CAAC,KAAc,EAAsB,EAAE,CAClD,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAA;AAE1F;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,QAA6C,EAAE,IAA6B,EAC5D,EAAE,CAClB,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,IAAiC,EAAE;IACtH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACzE,IAAI,MAAM,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAA;IAChC,CAAC;IAED,OAAO,MAAM,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAE,GAAG,CAAC,KAA2C,EAAE,OAAO,CAAC,CAAC,CAAA;AACzG,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PlanningProtocols } from '@owlmeans/planning';
|
|
2
|
+
import type { PlanningHandlerOptions } from '../types.js';
|
|
3
|
+
import type { RequestHandler } from './types.js';
|
|
4
|
+
/** A document's history, newest first, replayed from its log. */
|
|
5
|
+
export declare const listSpecificationRevisions: (protocol: PlanningProtocols['spec']['revisions'], opts?: PlanningHandlerOptions) => RequestHandler;
|
|
6
|
+
//# sourceMappingURL=list-specification-revisions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-specification-revisions.d.ts","sourceRoot":"","sources":["../../src/actions/list-specification-revisions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,iEAAiE;AACjE,eAAO,MAAM,0BAA0B,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,sBAAsB,KAAG,cAMxH,CAAA"}
|