@owlmeans/planning 0.1.18-rc.23 → 0.1.18-rc.25
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 +1 -1
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/planning/SKILL.md +14 -5
- package/build/entrypoints/types.d.ts +13 -12
- package/build/entrypoints/types.d.ts.map +1 -1
- package/build/entrypoints.d.ts.map +1 -1
- package/build/entrypoints.js.map +1 -1
- package/build/helpers/index.d.ts +2 -0
- package/build/helpers/index.d.ts.map +1 -1
- package/build/helpers/index.js +1 -0
- package/build/helpers/index.js.map +1 -1
- package/build/helpers/reply/consts.d.ts +2 -0
- package/build/helpers/reply/consts.d.ts.map +1 -0
- package/build/helpers/reply/consts.js +2 -0
- package/build/helpers/reply/consts.js.map +1 -0
- package/build/helpers/reply/types.d.ts +10 -0
- package/build/helpers/reply/types.d.ts.map +1 -0
- package/build/helpers/reply/types.js +2 -0
- package/build/helpers/reply/types.js.map +1 -0
- package/build/helpers/reply.d.ts +5 -0
- package/build/helpers/reply.d.ts.map +1 -0
- package/build/helpers/reply.js +29 -0
- package/build/helpers/reply.js.map +1 -0
- package/build/resources/protocol/types.d.ts +4 -3
- package/build/resources/protocol/types.d.ts.map +1 -1
- package/build/resources/protocol.d.ts.map +1 -1
- package/build/resources/protocol.js.map +1 -1
- package/package.json +1 -1
- package/src/entrypoints/types.ts +13 -12
- package/src/entrypoints.ts +13 -12
- package/src/helpers/index.ts +2 -0
- package/src/helpers/reply/consts.ts +1 -0
- package/src/helpers/reply/types.ts +13 -0
- package/src/helpers/reply.ts +27 -0
- package/src/resources/protocol/types.ts +4 -3
- package/src/resources/protocol.ts +4 -3
- package/tests/models.spec.ts +8 -1
package/README.md
CHANGED
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/planning",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-10-
|
|
4
|
+
"version": "0.1.18-rc.25",
|
|
5
|
+
"generatedAt": "2026-10-09T17:24:50.733Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/planning
|
|
9
9
|
|
|
10
10
|
**Layer:** Cross-cutting domain
|
|
11
|
-
**Install:** `"@owlmeans/planning": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/planning": "^0.1.18-rc.25"` in `dependencies` (`ajv` and `ajv-formats` are peers)
|
|
12
12
|
|
|
13
13
|
The contracts of project planning: record shapes, schemas, refusals, the protocol tree, the pure
|
|
14
14
|
fold and the models. No database, no fastify, no React. The executor, the plugin registry, the
|
|
@@ -76,8 +76,9 @@ forms generated code keeps writing are `server-planning` → Creating and readin
|
|
|
76
76
|
- **`entityId` is the organization's stable record id** — never the wire `entitySlug`, never a body
|
|
77
77
|
value. Every read is scoped by it; where a request's comes from is `server-planning` → Scope and
|
|
78
78
|
security.
|
|
79
|
-
- **
|
|
80
|
-
|
|
79
|
+
- **Card containment is `parent` + `parents`.** `parents` always contains `parent` (first), so
|
|
80
|
+
multiple direct parents need no junction row. `within` queries those direct parents. Team
|
|
81
|
+
membership and project-team assignment use canonical typed relationships instead.
|
|
81
82
|
- **Specification is a workcard** (`kind: specification`) with `category`, `format`, `body`, `ref`,
|
|
82
83
|
`revision`, `version`, `bodyChars`. The SLOT — category, format, `multiple`, `revisioned`,
|
|
83
84
|
`keepRevisions`, a JSON body `schema` — is declared on the PARENT's type. One record per
|
|
@@ -85,8 +86,10 @@ forms generated code keeps writing are `server-planning` → Creating and readin
|
|
|
85
86
|
same record, and earlier bodies come back from the transition log.
|
|
86
87
|
- **`createdBy` is written once, from a create's draft, and never moves.** Named in `changes` or
|
|
87
88
|
`unset` it is refused on every action (`planning:immutable:createdBy`), so an ownership check
|
|
88
|
-
(`card.createdBy === profileId`) can trust it.
|
|
89
|
-
|
|
89
|
+
(`card.createdBy === profileId`) can trust it. Responsibility uses the optional top-level
|
|
90
|
+
`assignee` planning ID; additional participant fields belong in the type's `fields` schema.
|
|
91
|
+
The optional `reporter` also references an assignee ID. Who made each later write is the
|
|
92
|
+
transition's `actor`.
|
|
90
93
|
- **`seq` is the last folded transition, `head` the highest allocated.** `head > seq` means a write
|
|
91
94
|
is in flight (`cardHelper.isPending`); optimistic concurrency (`expectSeq`) compares against the
|
|
92
95
|
head.
|
|
@@ -408,6 +411,12 @@ Declare `resources: true` on `makePlanningProtocols` to add assignee/team/commen
|
|
|
408
411
|
for assignee type schema writes. Use stock facade methods, handlers, stores and feeds on both
|
|
409
412
|
sides; resource commands and versions are validated by the shared wire contract.
|
|
410
413
|
|
|
414
|
+
Protocol responses use `PlanningReply<T>`: storage organization metadata (`entityId`) is absent
|
|
415
|
+
from records, schema scopes, receipts and commit frames. `planningReplyHelper.project` handles
|
|
416
|
+
only known record/envelope positions; custom fields, transition changes and schema definitions
|
|
417
|
+
remain opaque. Native facades retain their trusted storage scope. Remote facades hydrate the
|
|
418
|
+
shared record shape with empty advisory metadata; never derive organization identity from it.
|
|
419
|
+
|
|
411
420
|
|
|
412
421
|
## Related
|
|
413
422
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PlanningReply } from '../helpers/reply/types.js';
|
|
1
2
|
import type { PlanningResourceProtocols } from '../resources/protocol/types.js';
|
|
2
3
|
import type { Assignee, Team, Comment, CommentMention } from '../resources/types.js';
|
|
3
4
|
import type { EntrypointProtocol, OpenRequest, OpenValue } from '@owlmeans/entrypoint';
|
|
@@ -43,35 +44,35 @@ export interface PlanningProtocols {
|
|
|
43
44
|
/** The plain bundle — or, on a tree declared with `definitions`, a layer's scoped one. */
|
|
44
45
|
list: EntrypointProtocol<{
|
|
45
46
|
query?: SchemaListQuery;
|
|
46
|
-
}, ScopedSchemaBundle
|
|
47
|
+
}, PlanningReply<ScopedSchemaBundle>>;
|
|
47
48
|
/** Present on a tree declared with `definitions` only. */
|
|
48
49
|
define?: EntrypointProtocol<{
|
|
49
50
|
body: SchemaDefineRequest;
|
|
50
|
-
}, SchemaDefineReply
|
|
51
|
+
}, PlanningReply<SchemaDefineReply>>;
|
|
51
52
|
};
|
|
52
53
|
card: {
|
|
53
54
|
list: EntrypointProtocol<{
|
|
54
55
|
query: WorkcardQueryWire;
|
|
55
|
-
}, ListResult<Workcard
|
|
56
|
+
}, PlanningReply<ListResult<Workcard>>>;
|
|
56
57
|
summary: EntrypointProtocol<{
|
|
57
58
|
query: SummaryQueryWire;
|
|
58
59
|
}, SummaryView>;
|
|
59
60
|
get: EntrypointProtocol<{
|
|
60
61
|
params: WorkcardParams;
|
|
61
|
-
}, Workcard
|
|
62
|
+
}, PlanningReply<Workcard>>;
|
|
62
63
|
transitions: EntrypointProtocol<{
|
|
63
64
|
params: WorkcardParams;
|
|
64
65
|
query: TransitionQueryWire;
|
|
65
|
-
}, ListResult<Transition
|
|
66
|
+
}, PlanningReply<ListResult<Transition>>>;
|
|
66
67
|
specifications: EntrypointProtocol<{
|
|
67
68
|
params: WorkcardParams;
|
|
68
69
|
query: SpecificationQueryWire;
|
|
69
|
-
}, ListResult<Specification
|
|
70
|
+
}, PlanningReply<ListResult<Specification>>>;
|
|
70
71
|
};
|
|
71
72
|
spec: {
|
|
72
73
|
get: EntrypointProtocol<{
|
|
73
74
|
params: WorkcardParams;
|
|
74
|
-
}, Specification
|
|
75
|
+
}, PlanningReply<Specification>>;
|
|
75
76
|
revisions: EntrypointProtocol<{
|
|
76
77
|
params: WorkcardParams;
|
|
77
78
|
query: RevisionsQuery;
|
|
@@ -80,24 +81,24 @@ export interface PlanningProtocols {
|
|
|
80
81
|
link: {
|
|
81
82
|
list: EntrypointProtocol<{
|
|
82
83
|
query: RelationshipQueryWire;
|
|
83
|
-
}, ListResult<Relationship
|
|
84
|
+
}, PlanningReply<ListResult<Relationship>>>;
|
|
84
85
|
};
|
|
85
86
|
transition: {
|
|
86
87
|
get: EntrypointProtocol<{
|
|
87
88
|
params: TransitionParams;
|
|
88
|
-
}, Transition
|
|
89
|
+
}, PlanningReply<Transition>>;
|
|
89
90
|
};
|
|
90
91
|
execute: EntrypointProtocol<{
|
|
91
92
|
body: ExecuteRequest;
|
|
92
|
-
}, TransitionReceiptView
|
|
93
|
+
}, PlanningReply<TransitionReceiptView>>;
|
|
93
94
|
commit: {
|
|
94
95
|
get: EntrypointProtocol<{
|
|
95
96
|
params: TransitionParams;
|
|
96
97
|
query: CommitQuery;
|
|
97
|
-
}, CommitStatus
|
|
98
|
+
}, PlanningReply<CommitStatus>>;
|
|
98
99
|
events: EntrypointProtocol<{
|
|
99
100
|
query: CommitFeedQuery;
|
|
100
|
-
}, CommitEvent
|
|
101
|
+
}, PlanningReply<CommitEvent>>;
|
|
101
102
|
};
|
|
102
103
|
}
|
|
103
104
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/entrypoints/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC/E,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACpF,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EACV,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,qBAAqB,EAC5G,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,e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AE,aAAa,CAAC,WAAW,CAAC,CAAC,CAAA;KACnF,CAAA;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AASxF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,SAAU,uBAAuB,KAAG,iBAsHrE,CAAA"}
|
package/build/entrypoints.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAA;AAEvE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE9E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAqB,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EACL,iBAAiB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,oBAAoB,EACtF,yBAAyB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,kBAAkB,EAC9F,sBAAsB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,mBAAmB,GACzF,MAAM,cAAc,CAAA;AAUrB;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,IAA6B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C;YACpB,GAAG,EAAE,QAAQ,CACX,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,sBAAsB,CAAC,EAC/C,QAAQ,CAAC,OAAO,CAAC;gBACf,MAAM,EAAE,KAAK,CAAmB,sBAAsB,CAAC;gBACvD,KAAK,EAAE,KAAK,CAAc,iBAAiB,CAAC;aAC7C,EAAE,KAAK,EAA+B,CAAC,CACzC;YACD,MAAM,EAAE,QAAQ,CACd,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC,CAAC,EACrF,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAmB,EAAE,EAAE,KAAK,EAA8B,CAAC,CAC3F;SACF,CAAC;KACH,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
package/build/helpers/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type * from './card/types.js';
|
|
|
3
3
|
export type * from './changes/types.js';
|
|
4
4
|
export type * from './code/types.js';
|
|
5
5
|
export type * from './query/types.js';
|
|
6
|
+
export type * from './reply/types.js';
|
|
6
7
|
export type * from './scoped/types.js';
|
|
7
8
|
export type * from './specification/types.js';
|
|
8
9
|
export type * from './status/types.js';
|
|
@@ -13,6 +14,7 @@ export * from './card.js';
|
|
|
13
14
|
export * from './changes.js';
|
|
14
15
|
export * from './code.js';
|
|
15
16
|
export * from './query.js';
|
|
17
|
+
export * from './reply.js';
|
|
16
18
|
export * from './scoped.js';
|
|
17
19
|
export * from './specification.js';
|
|
18
20
|
export * from './status.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,kBAAkB,CAAA;AACrC,mBAAmB,iBAAiB,CAAA;AACpC,mBAAmB,oBAAoB,CAAA;AACvC,mBAAmB,iBAAiB,CAAA;AACpC,mBAAmB,kBAAkB,CAAA;AACrC,mBAAmB,mBAAmB,CAAA;AACtC,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,mBAAmB,CAAA;AACtC,mBAAmB,qBAAqB,CAAA;AACxC,mBAAmB,iBAAiB,CAAA;AAEpC,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,kBAAkB,CAAA;AACrC,mBAAmB,iBAAiB,CAAA;AACpC,mBAAmB,oBAAoB,CAAA;AACvC,mBAAmB,iBAAiB,CAAA;AACpC,mBAAmB,kBAAkB,CAAA;AACrC,mBAAmB,kBAAkB,CAAA;AACrC,mBAAmB,mBAAmB,CAAA;AACtC,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,mBAAmB,CAAA;AACtC,mBAAmB,qBAAqB,CAAA;AACxC,mBAAmB,iBAAiB,CAAA;AAEpC,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA"}
|
package/build/helpers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAYA,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../src/helpers/reply/consts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,aAAmF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../../src/helpers/reply/consts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Storage organization metadata is absent from planning HTTP and socket replies. */
|
|
2
|
+
export type PlanningReply<T> = T extends readonly (infer R)[] ? PlanningReply<R>[] : T extends object ? {
|
|
3
|
+
[K in keyof T as K extends 'entityId' ? never : K]: K extends 'items' | 'records' | 'card' | 'record' | 'transition' | 'bundle' | 'scope' ? PlanningReply<T[K]> : T[K];
|
|
4
|
+
} : T;
|
|
5
|
+
export interface PlanningReplyHelper {
|
|
6
|
+
project: <T>(value: T) => PlanningReply<T>;
|
|
7
|
+
/** Restore the shared facade shape with empty, non-authoritative organization metadata. */
|
|
8
|
+
hydrate: <T>(value: PlanningReply<T>) => T;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/helpers/reply/types.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,GAC9E,CAAC,SAAS,MAAM,GAAG;KAClB,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,UAAU,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,SACnD,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,OAAO,GACzE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAC/B,GAAG,CAAC,CAAA;AAEP,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,CAAA;IAC1C,2FAA2F;IAC3F,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;CAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/helpers/reply/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PlanningReplyHelper } from './reply/types.js';
|
|
2
|
+
/** Project known planning envelopes; custom fields, changes and schema definitions remain opaque. */
|
|
3
|
+
export declare const createPlanningReplyHelper: () => PlanningReplyHelper;
|
|
4
|
+
export declare const planningReplyHelper: PlanningReplyHelper;
|
|
5
|
+
//# sourceMappingURL=reply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../src/helpers/reply.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAE1E,qGAAqG;AACrG,eAAO,MAAM,yBAAyB,QAAO,mBAoB5C,CAAA;AAED,eAAO,MAAM,mBAAmB,qBAA8B,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { REPLY_CONTAINERS } from './reply/consts.js';
|
|
2
|
+
/** Project known planning envelopes; custom fields, changes and schema definitions remain opaque. */
|
|
3
|
+
export const createPlanningReplyHelper = () => {
|
|
4
|
+
const visit = (value, hydrate, scope = false) => {
|
|
5
|
+
if (Array.isArray(value))
|
|
6
|
+
return value.map(item => visit(item, hydrate));
|
|
7
|
+
if (value == null || typeof value !== 'object')
|
|
8
|
+
return value;
|
|
9
|
+
const source = value;
|
|
10
|
+
const result = {};
|
|
11
|
+
for (const [key, item] of Object.entries(source)) {
|
|
12
|
+
if (key === 'entityId')
|
|
13
|
+
continue;
|
|
14
|
+
result[key] = REPLY_CONTAINERS.has(key) ? visit(item, hydrate, key === 'scope') : item;
|
|
15
|
+
}
|
|
16
|
+
const record = typeof source.createdAt === 'string'
|
|
17
|
+
|| (typeof source.card === 'string' && typeof source.seq === 'number'
|
|
18
|
+
&& (source.commit != null || typeof source.state === 'string'));
|
|
19
|
+
if (hydrate && (scope || record))
|
|
20
|
+
result.entityId = '';
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
project: (value) => visit(value, false),
|
|
25
|
+
hydrate: (value) => visit(value, true),
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export const planningReplyHelper = createPlanningReplyHelper();
|
|
29
|
+
//# sourceMappingURL=reply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reply.js","sourceRoot":"","sources":["../../src/helpers/reply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,M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ACD,OAAO;QACL,OAAO,EAAE,CAAI,KAAQ,EAAoB,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAqB;QACnF,OAAO,EAAE,CAAI,KAAuB,EAAK,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAM;KACpE,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,EAAE,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PlanningReply } from '../../helpers/reply/types.js';
|
|
1
2
|
import type { EntrypointProtocol } from '@owlmeans/entrypoint';
|
|
2
3
|
import type { ListResult } from '@owlmeans/resource';
|
|
3
4
|
import type { AssigneeDraft, TeamDraft, CommentDraft, PlanningRecord } from '../types.js';
|
|
@@ -18,12 +19,12 @@ export interface PlanningResourceProtocols<R extends PlanningRecord = PlanningRe
|
|
|
18
19
|
params: {
|
|
19
20
|
id: string;
|
|
20
21
|
};
|
|
21
|
-
}, R
|
|
22
|
+
}, PlanningReply<R>>;
|
|
22
23
|
list: EntrypointProtocol<{
|
|
23
24
|
query: PlanningResourceQueryWire;
|
|
24
|
-
}, ListResult<R
|
|
25
|
+
}, PlanningReply<ListResult<R>>>;
|
|
25
26
|
write: EntrypointProtocol<{
|
|
26
27
|
body: PlanningResourceCommand;
|
|
27
|
-
}, PlanningResourceReply
|
|
28
|
+
}, PlanningReply<PlanningResourceReply>>;
|
|
28
29
|
}
|
|
29
30
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/resources/protocol/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAA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uBAAuB;IACtC,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;IACzJ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,OAAO,CAAC,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC,CAAA;IACzD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AACD,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG,cAAc,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;AAEvF,MAAM,WAAW,yBAAyB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc;IAClF,GAAG,EAAE,kBAAkB,CAAC;QAAE,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;IACrE,IAAI,EAAE,kBAAkB,CAAC;QAAE,KAAK,EAAE,yBAAyB,CAAA;KAAE,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5F,KAAK,EAAE,kBAAkB,CAAC;QAAE,IAAI,EAAE,uBAAuB,CAAA;KAAE,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC,CAAA;CACnG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/resources/protocol.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/resources/protocol.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAK9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAA2B,yBAAyB,EAAoD,MAAM,qBAAqB,CAAA;AAE/I,iFAAiF;AACjF,eAAO,MAAM,6BAA6B,GAAI,CAAC,SAAS,cAAc,QAAQ,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,SAAS,MAAM,QAAQ,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,KAAG,yBAAyB,CAAC,CAAC,CAuB7M,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/resources/protocol.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/resources/protocol.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAEhE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAKpD,iFAAiF;AACjF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAA2B,IAAkC,EAAE,KAAa,EAAE,IAAqD,EAAgC,EAAE;IAChN,MAAM,OAAO,GAAG,mBAAmB,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAA;IACxE,MAAM,aAAa,GAAG;QACpB,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE;YAC1B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAA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E,EAAE,QAAQ,EAAE,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAgC,CAAC,CAAC;QAC7U,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,CAA0B,aAAoB,CAAC,EAAE,EAAE,KAAK,EAAwC,CAAC,CAAC;KAChO,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/planning",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.25",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Runtime-free project-planning contracts — the workcard super type, projects, specifications, typed relationships, status flows with three intrinsic states, the transition event and its pure fold, the schema registry, the models and the protocol tree.",
|
|
6
6
|
"type": "module",
|
package/src/entrypoints/types.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PlanningReply } from '../helpers/reply/types.js'
|
|
1
2
|
import type { PlanningResourceProtocols } from '../resources/protocol/types.js'
|
|
2
3
|
import type { Assignee, Team, Comment, CommentMention } from '../resources/types.js'
|
|
3
4
|
import type { EntrypointProtocol, OpenRequest, OpenValue } from '@owlmeans/entrypoint'
|
|
@@ -46,30 +47,30 @@ export interface PlanningProtocols {
|
|
|
46
47
|
base: EntrypointProtocol<OpenRequest, OpenValue>
|
|
47
48
|
schema: {
|
|
48
49
|
/** The plain bundle — or, on a tree declared with `definitions`, a layer's scoped one. */
|
|
49
|
-
list: EntrypointProtocol<{ query?: SchemaListQuery }, ScopedSchemaBundle
|
|
50
|
+
list: EntrypointProtocol<{ query?: SchemaListQuery }, PlanningReply<ScopedSchemaBundle>>
|
|
50
51
|
/** Present on a tree declared with `definitions` only. */
|
|
51
|
-
define?: EntrypointProtocol<{ body: SchemaDefineRequest }, SchemaDefineReply
|
|
52
|
+
define?: EntrypointProtocol<{ body: SchemaDefineRequest }, PlanningReply<SchemaDefineReply>>
|
|
52
53
|
}
|
|
53
54
|
card: {
|
|
54
|
-
list: EntrypointProtocol<{ query: WorkcardQueryWire }, ListResult<Workcard
|
|
55
|
+
list: EntrypointProtocol<{ query: WorkcardQueryWire }, PlanningReply<ListResult<Workcard>>>
|
|
55
56
|
summary: EntrypointProtocol<{ query: SummaryQueryWire }, SummaryView>
|
|
56
|
-
get: EntrypointProtocol<{ params: WorkcardParams }, Workcard
|
|
57
|
-
transitions: EntrypointProtocol<{ params: WorkcardParams, query: TransitionQueryWire }, ListResult<Transition
|
|
58
|
-
specifications: EntrypointProtocol<{ params: WorkcardParams, query: SpecificationQueryWire }, ListResult<Specification
|
|
57
|
+
get: EntrypointProtocol<{ params: WorkcardParams }, PlanningReply<Workcard>>
|
|
58
|
+
transitions: EntrypointProtocol<{ params: WorkcardParams, query: TransitionQueryWire }, PlanningReply<ListResult<Transition>>>
|
|
59
|
+
specifications: EntrypointProtocol<{ params: WorkcardParams, query: SpecificationQueryWire }, PlanningReply<ListResult<Specification>>>
|
|
59
60
|
}
|
|
60
61
|
spec: {
|
|
61
|
-
get: EntrypointProtocol<{ params: WorkcardParams }, Specification
|
|
62
|
+
get: EntrypointProtocol<{ params: WorkcardParams }, PlanningReply<Specification>>
|
|
62
63
|
revisions: EntrypointProtocol<{ params: WorkcardParams, query: RevisionsQuery }, SpecificationRevisionList>
|
|
63
64
|
}
|
|
64
65
|
link: {
|
|
65
|
-
list: EntrypointProtocol<{ query: RelationshipQueryWire }, ListResult<Relationship
|
|
66
|
+
list: EntrypointProtocol<{ query: RelationshipQueryWire }, PlanningReply<ListResult<Relationship>>>
|
|
66
67
|
}
|
|
67
68
|
transition: {
|
|
68
|
-
get: EntrypointProtocol<{ params: TransitionParams }, Transition
|
|
69
|
+
get: EntrypointProtocol<{ params: TransitionParams }, PlanningReply<Transition>>
|
|
69
70
|
}
|
|
70
|
-
execute: EntrypointProtocol<{ body: ExecuteRequest }, TransitionReceiptView
|
|
71
|
+
execute: EntrypointProtocol<{ body: ExecuteRequest }, PlanningReply<TransitionReceiptView>>
|
|
71
72
|
commit: {
|
|
72
|
-
get: EntrypointProtocol<{ params: TransitionParams, query: CommitQuery }, CommitStatus
|
|
73
|
-
events: EntrypointProtocol<{ query: CommitFeedQuery }, CommitEvent
|
|
73
|
+
get: EntrypointProtocol<{ params: TransitionParams, query: CommitQuery }, PlanningReply<CommitStatus>>
|
|
74
|
+
events: EntrypointProtocol<{ query: CommitFeedQuery }, PlanningReply<CommitEvent>>
|
|
74
75
|
}
|
|
75
76
|
}
|
package/src/entrypoints.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PlanningReply } from './helpers/reply/types.js'
|
|
1
2
|
import { makePlanningResourceProtocols } from './resources/protocol.js'
|
|
2
3
|
import type { Assignee, Team, Comment, CommentMention } from './resources/types.js'
|
|
3
4
|
import { contract, openProtocol, protocol, typed } from '@owlmeans/entrypoint'
|
|
@@ -51,11 +52,11 @@ export const makePlanningProtocols = (opts: PlanningProtocolOptions): PlanningPr
|
|
|
51
52
|
? Object.freeze({
|
|
52
53
|
list: protocol(
|
|
53
54
|
get(aliases.schema.list, '/schemas'),
|
|
54
|
-
contract.request({ query: typed<SchemaListQuery>(SchemaListQuerySchema) }, typed<ScopedSchemaBundle
|
|
55
|
+
contract.request({ query: typed<SchemaListQuery>(SchemaListQuerySchema) }, typed<PlanningReply<ScopedSchemaBundle>>())
|
|
55
56
|
) as unknown as PlanningProtocols['schema']['list'],
|
|
56
57
|
define: protocol(
|
|
57
58
|
route(planningAliasHelper.planningDefinitionAliases(opts.base.alias).define, '/schemas', backend({ parent: base }, RouteMethod.POST)),
|
|
58
|
-
contract.request({ body: typed<SchemaDefineRequest>(SchemaDefineRequestSchema) }, typed<SchemaDefineReply
|
|
59
|
+
contract.request({ body: typed<SchemaDefineRequest>(SchemaDefineRequestSchema) }, typed<PlanningReply<SchemaDefineReply>>())
|
|
59
60
|
),
|
|
60
61
|
})
|
|
61
62
|
: Object.freeze({
|
|
@@ -78,7 +79,7 @@ export const makePlanningProtocols = (opts: PlanningProtocolOptions): PlanningPr
|
|
|
78
79
|
card: Object.freeze({
|
|
79
80
|
list: protocol(
|
|
80
81
|
get(aliases.card.list, '/cards'),
|
|
81
|
-
contract.request({ query: typed<WorkcardQueryWire>(WorkcardQuerySchema) }, typed<ListResult<Workcard
|
|
82
|
+
contract.request({ query: typed<WorkcardQueryWire>(WorkcardQuerySchema) }, typed<PlanningReply<ListResult<Workcard>>>())
|
|
82
83
|
),
|
|
83
84
|
// Static before parametric: `/cards/summary` must never be read as a card id.
|
|
84
85
|
summary: protocol(
|
|
@@ -87,28 +88,28 @@ export const makePlanningProtocols = (opts: PlanningProtocolOptions): PlanningPr
|
|
|
87
88
|
),
|
|
88
89
|
get: protocol(
|
|
89
90
|
get(aliases.card.get, '/cards/:id'),
|
|
90
|
-
contract.request({ params: typed<WorkcardParams>(WorkcardParamsSchema) }, typed<Workcard
|
|
91
|
+
contract.request({ params: typed<WorkcardParams>(WorkcardParamsSchema) }, typed<PlanningReply<Workcard>>())
|
|
91
92
|
),
|
|
92
93
|
transitions: protocol(
|
|
93
94
|
get(aliases.card.transitions, '/cards/:id/transitions'),
|
|
94
95
|
contract.request({
|
|
95
96
|
params: typed<WorkcardParams>(WorkcardParamsSchema),
|
|
96
97
|
query: typed<TransitionQueryWire>(TransitionQuerySchema),
|
|
97
|
-
}, typed<ListResult<Transition
|
|
98
|
+
}, typed<PlanningReply<ListResult<Transition>>>())
|
|
98
99
|
),
|
|
99
100
|
specifications: protocol(
|
|
100
101
|
get(aliases.card.specifications, '/cards/:id/specifications'),
|
|
101
102
|
contract.request({
|
|
102
103
|
params: typed<WorkcardParams>(WorkcardParamsSchema),
|
|
103
104
|
query: typed<SpecificationQueryWire>(SpecificationQuerySchema),
|
|
104
|
-
}, typed<ListResult<Specification
|
|
105
|
+
}, typed<PlanningReply<ListResult<Specification>>>())
|
|
105
106
|
),
|
|
106
107
|
}),
|
|
107
108
|
|
|
108
109
|
spec: Object.freeze({
|
|
109
110
|
get: protocol(
|
|
110
111
|
get(aliases.spec.get, '/specifications/:id'),
|
|
111
|
-
contract.request({ params: typed<WorkcardParams>(WorkcardParamsSchema) }, typed<Specification
|
|
112
|
+
contract.request({ params: typed<WorkcardParams>(WorkcardParamsSchema) }, typed<PlanningReply<Specification>>())
|
|
112
113
|
),
|
|
113
114
|
revisions: protocol(
|
|
114
115
|
get(aliases.spec.revisions, '/specifications/:id/revisions'),
|
|
@@ -122,20 +123,20 @@ export const makePlanningProtocols = (opts: PlanningProtocolOptions): PlanningPr
|
|
|
122
123
|
link: Object.freeze({
|
|
123
124
|
list: protocol(
|
|
124
125
|
get(aliases.link.list, '/links'),
|
|
125
|
-
contract.request({ query: typed<RelationshipQueryWire>(RelationshipQuerySchema) }, typed<ListResult<Relationship
|
|
126
|
+
contract.request({ query: typed<RelationshipQueryWire>(RelationshipQuerySchema) }, typed<PlanningReply<ListResult<Relationship>>>())
|
|
126
127
|
),
|
|
127
128
|
}),
|
|
128
129
|
|
|
129
130
|
transition: Object.freeze({
|
|
130
131
|
get: protocol(
|
|
131
132
|
get(aliases.transition.get, '/transitions/:transition'),
|
|
132
|
-
contract.request({ params: typed<TransitionParams>(TransitionParamsSchema) }, typed<Transition
|
|
133
|
+
contract.request({ params: typed<TransitionParams>(TransitionParamsSchema) }, typed<PlanningReply<Transition>>())
|
|
133
134
|
),
|
|
134
135
|
}),
|
|
135
136
|
|
|
136
137
|
execute: protocol(
|
|
137
138
|
route(aliases.execute, '/execute', backend({ parent: base }, RouteMethod.POST)),
|
|
138
|
-
contract.request({ body: typed<ExecuteRequest>(ExecuteRequestSchema) }, typed<TransitionReceiptView
|
|
139
|
+
contract.request({ body: typed<ExecuteRequest>(ExecuteRequestSchema) }, typed<PlanningReply<TransitionReceiptView>>())
|
|
139
140
|
),
|
|
140
141
|
|
|
141
142
|
commit: Object.freeze({
|
|
@@ -144,11 +145,11 @@ export const makePlanningProtocols = (opts: PlanningProtocolOptions): PlanningPr
|
|
|
144
145
|
contract.request({
|
|
145
146
|
params: typed<TransitionParams>(TransitionParamsSchema),
|
|
146
147
|
query: typed<CommitQuery>(CommitQuerySchema),
|
|
147
|
-
}, typed<CommitStatus
|
|
148
|
+
}, typed<PlanningReply<CommitStatus>>())
|
|
148
149
|
),
|
|
149
150
|
events: protocol(
|
|
150
151
|
route(aliases.commit.events, '/commits', socket({ parent: opts.socketBase ?? base })),
|
|
151
|
-
contract.request({ query: typed<CommitFeedQuery>() }, typed<CommitEvent
|
|
152
|
+
contract.request({ query: typed<CommitFeedQuery>() }, typed<PlanningReply<CommitEvent>>())
|
|
152
153
|
),
|
|
153
154
|
}),
|
|
154
155
|
})
|
package/src/helpers/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type * from './card/types.js'
|
|
|
3
3
|
export type * from './changes/types.js'
|
|
4
4
|
export type * from './code/types.js'
|
|
5
5
|
export type * from './query/types.js'
|
|
6
|
+
export type * from './reply/types.js'
|
|
6
7
|
export type * from './scoped/types.js'
|
|
7
8
|
export type * from './specification/types.js'
|
|
8
9
|
export type * from './status/types.js'
|
|
@@ -14,6 +15,7 @@ export * from './card.js'
|
|
|
14
15
|
export * from './changes.js'
|
|
15
16
|
export * from './code.js'
|
|
16
17
|
export * from './query.js'
|
|
18
|
+
export * from './reply.js'
|
|
17
19
|
export * from './scoped.js'
|
|
18
20
|
export * from './specification.js'
|
|
19
21
|
export * from './status.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const REPLY_CONTAINERS = new Set(['items', 'records', 'card', 'record', 'transition', 'bundle', 'scope'])
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Storage organization metadata is absent from planning HTTP and socket replies. */
|
|
2
|
+
export type PlanningReply<T> = T extends readonly (infer R)[] ? PlanningReply<R>[]
|
|
3
|
+
: T extends object ? {
|
|
4
|
+
[K in keyof T as K extends 'entityId' ? never : K]: K extends
|
|
5
|
+
'items' | 'records' | 'card' | 'record' | 'transition' | 'bundle' | 'scope'
|
|
6
|
+
? PlanningReply<T[K]> : T[K]
|
|
7
|
+
} : T
|
|
8
|
+
|
|
9
|
+
export interface PlanningReplyHelper {
|
|
10
|
+
project: <T>(value: T) => PlanningReply<T>
|
|
11
|
+
/** Restore the shared facade shape with empty, non-authoritative organization metadata. */
|
|
12
|
+
hydrate: <T>(value: PlanningReply<T>) => T
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { REPLY_CONTAINERS } from './reply/consts.js'
|
|
2
|
+
import type { PlanningReply, PlanningReplyHelper } from './reply/types.js'
|
|
3
|
+
|
|
4
|
+
/** Project known planning envelopes; custom fields, changes and schema definitions remain opaque. */
|
|
5
|
+
export const createPlanningReplyHelper = (): PlanningReplyHelper => {
|
|
6
|
+
const visit = (value: unknown, hydrate: boolean, scope = false): unknown => {
|
|
7
|
+
if (Array.isArray(value)) return value.map(item => visit(item, hydrate))
|
|
8
|
+
if (value == null || typeof value !== 'object') return value
|
|
9
|
+
const source = value as Record<string, unknown>
|
|
10
|
+
const result: Record<string, unknown> = {}
|
|
11
|
+
for (const [key, item] of Object.entries(source)) {
|
|
12
|
+
if (key === 'entityId') continue
|
|
13
|
+
result[key] = REPLY_CONTAINERS.has(key) ? visit(item, hydrate, key === 'scope') : item
|
|
14
|
+
}
|
|
15
|
+
const record = typeof source.createdAt === 'string'
|
|
16
|
+
|| (typeof source.card === 'string' && typeof source.seq === 'number'
|
|
17
|
+
&& (source.commit != null || typeof source.state === 'string'))
|
|
18
|
+
if (hydrate && (scope || record)) result.entityId = ''
|
|
19
|
+
return result
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
project: <T>(value: T): PlanningReply<T> => visit(value, false) as PlanningReply<T>,
|
|
23
|
+
hydrate: <T>(value: PlanningReply<T>): T => visit(value, true) as T,
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const planningReplyHelper = createPlanningReplyHelper()
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PlanningReply } from '../../helpers/reply/types.js'
|
|
1
2
|
import type { EntrypointProtocol } from '@owlmeans/entrypoint'
|
|
2
3
|
import type { ListResult } from '@owlmeans/resource'
|
|
3
4
|
import type { AssigneeDraft, TeamDraft, CommentDraft, PlanningRecord } from '../types.js'
|
|
@@ -14,7 +15,7 @@ export interface PlanningResourceCommand {
|
|
|
14
15
|
export type PlanningResourceReply = PlanningRecord | PlanningRecord[] | string[] | null
|
|
15
16
|
|
|
16
17
|
export interface PlanningResourceProtocols<R extends PlanningRecord = PlanningRecord> {
|
|
17
|
-
get: EntrypointProtocol<{ params: { id: string } }, R
|
|
18
|
-
list: EntrypointProtocol<{ query: PlanningResourceQueryWire }, ListResult<R
|
|
19
|
-
write: EntrypointProtocol<{ body: PlanningResourceCommand }, PlanningResourceReply
|
|
18
|
+
get: EntrypointProtocol<{ params: { id: string } }, PlanningReply<R>>
|
|
19
|
+
list: EntrypointProtocol<{ query: PlanningResourceQueryWire }, PlanningReply<ListResult<R>>>
|
|
20
|
+
write: EntrypointProtocol<{ body: PlanningResourceCommand }, PlanningReply<PlanningResourceReply>>
|
|
20
21
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PlanningReply } from '../helpers/reply/types.js'
|
|
1
2
|
import { planningAliasHelper } from '../aliases.js'
|
|
2
3
|
import { contract, protocol, typed } from '@owlmeans/entrypoint'
|
|
3
4
|
import type { EntrypointProtocol } from '@owlmeans/entrypoint'
|
|
@@ -28,8 +29,8 @@ export const makePlanningResourceProtocols = <R extends PlanningRecord>(base: En
|
|
|
28
29
|
}, required: ['action'], additionalProperties: false,
|
|
29
30
|
}
|
|
30
31
|
return Object.freeze({
|
|
31
|
-
get: protocol(route(aliases.get, `/${name}/:id`, backend({ parent: base }, RouteMethod.GET)), contract.request({ params: typed<{ id: string }>(WorkcardParamsSchema) }, typed<R
|
|
32
|
-
list: protocol(route(aliases.list, `/${name}`, backend({ parent: base }, RouteMethod.GET)), contract.request({ query: typed<PlanningResourceQueryWire>({ type: 'object', properties: { query: { type: 'string', maxLength: 16384, nullable: true } }, required: [], additionalProperties: false }) }, typed<ListResult<R
|
|
33
|
-
write: protocol(route(aliases.write, `/${name}`, backend({ parent: base }, RouteMethod.POST)), contract.request({ body: typed<PlanningResourceCommand>(commandSchema as any) }, typed<PlanningResourceReply
|
|
32
|
+
get: protocol(route(aliases.get, `/${name}/:id`, backend({ parent: base }, RouteMethod.GET)), contract.request({ params: typed<{ id: string }>(WorkcardParamsSchema) }, typed<PlanningReply<R>>())),
|
|
33
|
+
list: protocol(route(aliases.list, `/${name}`, backend({ parent: base }, RouteMethod.GET)), contract.request({ query: typed<PlanningResourceQueryWire>({ type: 'object', properties: { query: { type: 'string', maxLength: 16384, nullable: true } }, required: [], additionalProperties: false }) }, typed<PlanningReply<ListResult<R>>>())),
|
|
34
|
+
write: protocol(route(aliases.write, `/${name}`, backend({ parent: base }, RouteMethod.POST)), contract.request({ body: typed<PlanningResourceCommand>(commandSchema as any) }, typed<PlanningReply<PlanningResourceReply>>())),
|
|
34
35
|
})
|
|
35
36
|
}
|
package/tests/models.spec.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from 'bun:test'
|
|
2
2
|
import { CommitState, TransitionAction, WorkcardKind } from '../src/consts.js'
|
|
3
|
-
import { WorkcardNotFound } from '../src/errors.js'
|
|
3
|
+
import { PlanningUnsupported, WorkcardNotFound } from '../src/errors.js'
|
|
4
4
|
import { makeProjectModel, makeWorkcardModel, modelOf } from '../src/models/index.js'
|
|
5
5
|
import type { ProjectModel } from '../src/models/types.js'
|
|
6
6
|
import type {
|
|
@@ -22,8 +22,15 @@ const makeFacade = () => {
|
|
|
22
22
|
const cards = new Map<string, Workcard>()
|
|
23
23
|
const executed: TransitionExecution[] = []
|
|
24
24
|
let next = 0
|
|
25
|
+
const unsupported = async (): Promise<never> => { throw new PlanningUnsupported('model-fixture:resources') }
|
|
25
26
|
|
|
26
27
|
const facade: PlanningFacade = {
|
|
28
|
+
assignees: { get: unsupported, load: unsupported, list: unsupported, create: unsupported, update: unsupported, retire: unsupported },
|
|
29
|
+
teams: { get: unsupported, load: unsupported, list: unsupported, create: unsupported, update: unsupported, remove: unsupported,
|
|
30
|
+
members: unsupported, addMember: unsupported, removeMember: unsupported, projects: unsupported,
|
|
31
|
+
attach: unsupported, detach: unsupported, assignees: unsupported },
|
|
32
|
+
comments: { get: unsupported, load: unsupported, list: unsupported, create: unsupported, update: unsupported, remove: unsupported },
|
|
33
|
+
mentions: { get: unsupported, load: unsupported, list: unsupported, rebuild: unsupported },
|
|
27
34
|
scope: { entityId: ENTITY },
|
|
28
35
|
schemas,
|
|
29
36
|
cards: {
|