@owlmeans/planning 0.1.18-rc.8 → 0.1.18
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 +122 -29
- package/agent-meta/manifest.json +131 -4
- package/agent-meta/skills/planning/SKILL.md +78 -171
- package/agent-meta/skills/planning/parts/collaboration.md +67 -0
- package/agent-meta/skills/planning/parts/errors.md +51 -0
- package/agent-meta/skills/planning/parts/fold.md +69 -0
- package/agent-meta/skills/planning/parts/mounting.md +64 -0
- package/agent-meta/skills/planning/parts/types.md +141 -0
- package/build/aliases/types.d.ts +72 -0
- package/build/aliases/types.d.ts.map +1 -0
- package/build/aliases/types.js +2 -0
- package/build/aliases/types.js.map +1 -0
- package/build/aliases.d.ts +4 -0
- package/build/aliases.d.ts.map +1 -0
- package/build/aliases.js +28 -0
- package/build/aliases.js.map +1 -0
- package/build/consts.d.ts +43 -34
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +49 -25
- package/build/consts.js.map +1 -1
- package/build/entrypoints/types.d.ts +105 -0
- package/build/entrypoints/types.d.ts.map +1 -0
- package/build/entrypoints/types.js +2 -0
- package/build/entrypoints/types.js.map +1 -0
- package/build/entrypoints.d.ts +5 -1
- package/build/entrypoints.d.ts.map +1 -1
- package/build/entrypoints.js +24 -6
- package/build/entrypoints.js.map +1 -1
- package/build/errors.d.ts +41 -0
- package/build/errors.d.ts.map +1 -1
- package/build/errors.js +61 -0
- package/build/errors.js.map +1 -1
- package/build/helpers/app/consts.local.d.ts +5 -0
- package/build/helpers/app/consts.local.d.ts.map +1 -0
- package/build/helpers/app/consts.local.js +5 -0
- package/build/helpers/app/consts.local.js.map +1 -0
- package/build/helpers/app/types.d.ts +53 -0
- package/build/helpers/app/types.d.ts.map +1 -0
- package/build/helpers/app/types.js +2 -0
- package/build/helpers/app/types.js.map +1 -0
- package/build/helpers/app.d.ts +4 -0
- package/build/helpers/app.d.ts.map +1 -0
- package/build/helpers/app.js +139 -0
- package/build/helpers/app.js.map +1 -0
- package/build/helpers/apply/consts.local.d.ts +7 -0
- package/build/helpers/apply/consts.local.d.ts.map +1 -0
- package/build/helpers/apply/consts.local.js +9 -0
- package/build/helpers/apply/consts.local.js.map +1 -0
- package/build/helpers/apply/types.d.ts +32 -0
- package/build/helpers/apply/types.d.ts.map +1 -0
- package/build/helpers/apply/types.js +2 -0
- package/build/helpers/apply/types.js.map +1 -0
- package/build/helpers/apply.d.ts +5 -23
- package/build/helpers/apply.d.ts.map +1 -1
- package/build/helpers/apply.js +127 -144
- package/build/helpers/apply.js.map +1 -1
- package/build/helpers/card/types.d.ts +20 -0
- package/build/helpers/card/types.d.ts.map +1 -0
- package/build/helpers/card/types.js +2 -0
- package/build/helpers/card/types.js.map +1 -0
- package/build/helpers/card.d.ts +11 -7
- package/build/helpers/card.d.ts.map +1 -1
- package/build/helpers/card.js +41 -28
- package/build/helpers/card.js.map +1 -1
- package/build/helpers/changes/consts.local.d.ts +13 -0
- package/build/helpers/changes/consts.local.d.ts.map +1 -0
- package/build/helpers/changes/consts.local.js +13 -0
- package/build/helpers/changes/consts.local.js.map +1 -0
- package/build/helpers/changes/types.d.ts +58 -0
- package/build/helpers/changes/types.d.ts.map +1 -0
- package/build/helpers/changes/types.js +2 -0
- package/build/helpers/changes/types.js.map +1 -0
- package/build/helpers/changes.d.ts +11 -42
- package/build/helpers/changes.d.ts.map +1 -1
- package/build/helpers/changes.js +237 -251
- package/build/helpers/changes.js.map +1 -1
- package/build/helpers/code/types.d.ts +27 -0
- package/build/helpers/code/types.d.ts.map +1 -0
- package/build/helpers/code/types.js +2 -0
- package/build/helpers/code/types.js.map +1 -0
- package/build/helpers/code.d.ts +6 -17
- package/build/helpers/code.d.ts.map +1 -1
- package/build/helpers/code.js +39 -40
- package/build/helpers/code.js.map +1 -1
- package/build/helpers/index.d.ts +16 -0
- package/build/helpers/index.d.ts.map +1 -1
- package/build/helpers/index.js +4 -0
- package/build/helpers/index.js.map +1 -1
- package/build/helpers/query/types.d.ts +23 -0
- package/build/helpers/query/types.d.ts.map +1 -0
- package/build/helpers/query/types.js +2 -0
- package/build/helpers/query/types.js.map +1 -0
- package/build/helpers/query.d.ts +25 -17
- package/build/helpers/query.d.ts.map +1 -1
- package/build/helpers/query.js +108 -280
- package/build/helpers/query.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/helpers/scoped/types.d.ts +73 -0
- package/build/helpers/scoped/types.d.ts.map +1 -0
- package/build/helpers/scoped/types.js +2 -0
- package/build/helpers/scoped/types.js.map +1 -0
- package/build/helpers/scoped.d.ts +25 -0
- package/build/helpers/scoped.d.ts.map +1 -0
- package/build/helpers/scoped.js +223 -0
- package/build/helpers/scoped.js.map +1 -0
- package/build/helpers/specification/types.d.ts +24 -0
- package/build/helpers/specification/types.d.ts.map +1 -0
- package/build/helpers/specification/types.js +2 -0
- package/build/helpers/specification/types.js.map +1 -0
- package/build/helpers/specification.d.ts +9 -13
- package/build/helpers/specification.d.ts.map +1 -1
- package/build/helpers/specification.js +47 -44
- package/build/helpers/specification.js.map +1 -1
- package/build/helpers/status/types.d.ts +48 -0
- package/build/helpers/status/types.d.ts.map +1 -0
- package/build/helpers/status/types.js +2 -0
- package/build/helpers/status/types.js.map +1 -0
- package/build/helpers/status.d.ts +16 -29
- package/build/helpers/status.d.ts.map +1 -1
- package/build/helpers/status.js +77 -73
- package/build/helpers/status.js.map +1 -1
- package/build/helpers/types.local.d.ts +17 -0
- package/build/helpers/types.local.d.ts.map +1 -0
- package/build/helpers/types.local.js +2 -0
- package/build/helpers/types.local.js.map +1 -0
- package/build/helpers/validate/types.d.ts +31 -0
- package/build/helpers/validate/types.d.ts.map +1 -0
- package/build/helpers/validate/types.js +2 -0
- package/build/helpers/validate/types.js.map +1 -0
- package/build/helpers/validate.d.ts +8 -19
- package/build/helpers/validate.d.ts.map +1 -1
- package/build/helpers/validate.js +79 -79
- package/build/helpers/validate.js.map +1 -1
- package/build/helpers/wire/types.d.ts +28 -0
- package/build/helpers/wire/types.d.ts.map +1 -0
- package/build/helpers/wire/types.js +2 -0
- package/build/helpers/wire/types.js.map +1 -0
- package/build/helpers/wire.d.ts +4 -0
- package/build/helpers/wire.d.ts.map +1 -0
- package/build/helpers/wire.js +216 -0
- package/build/helpers/wire.js.map +1 -0
- package/build/i18n/be.json +5 -0
- package/build/i18n/de.json +5 -0
- package/build/i18n/en.json +5 -0
- package/build/i18n/es.json +5 -0
- package/build/i18n/fr.json +5 -0
- package/build/i18n/pl.json +5 -0
- package/build/i18n/ru.json +5 -0
- package/build/i18n/uk.json +5 -0
- package/build/i18n.js +3 -3
- package/build/i18n.js.map +1 -1
- package/build/index.d.ts +7 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3 -0
- package/build/index.js.map +1 -1
- package/build/models/index.d.ts +2 -3
- package/build/models/index.d.ts.map +1 -1
- package/build/models/index.js +1 -15
- package/build/models/index.js.map +1 -1
- package/build/models/model.d.ts +5 -0
- package/build/models/model.d.ts.map +1 -0
- package/build/models/model.js +16 -0
- package/build/models/model.js.map +1 -0
- package/build/models/project.d.ts +2 -1
- package/build/models/project.d.ts.map +1 -1
- package/build/models/project.js.map +1 -1
- package/build/models/specification.d.ts +2 -1
- package/build/models/specification.d.ts.map +1 -1
- package/build/models/specification.js.map +1 -1
- package/build/models/types.d.ts +69 -0
- package/build/models/types.d.ts.map +1 -0
- package/build/models/types.js +2 -0
- package/build/models/types.js.map +1 -0
- package/build/models/workcard.d.ts +2 -1
- package/build/models/workcard.d.ts.map +1 -1
- package/build/models/workcard.js +12 -12
- package/build/models/workcard.js.map +1 -1
- package/build/registry.d.ts +3 -2
- package/build/registry.d.ts.map +1 -1
- package/build/registry.js +51 -3
- package/build/registry.js.map +1 -1
- package/build/resources/mentions.d.ts +4 -0
- package/build/resources/mentions.d.ts.map +1 -0
- package/build/resources/mentions.js +15 -0
- package/build/resources/mentions.js.map +1 -0
- package/build/resources/protocol/types.d.ts +30 -0
- package/build/resources/protocol/types.d.ts.map +1 -0
- package/build/resources/protocol/types.js +2 -0
- package/build/resources/protocol/types.js.map +1 -0
- package/build/resources/protocol.d.ts +6 -0
- package/build/resources/protocol.d.ts.map +1 -0
- package/build/resources/protocol.js +31 -0
- package/build/resources/protocol.js.map +1 -0
- package/build/resources/types.d.ts +146 -0
- package/build/resources/types.d.ts.map +1 -0
- package/build/resources/types.js +2 -0
- package/build/resources/types.js.map +1 -0
- package/build/resources/types.local.d.ts +6 -0
- package/build/resources/types.local.d.ts.map +1 -0
- package/build/resources/types.local.js +2 -0
- package/build/resources/types.local.js.map +1 -0
- package/build/schemas.d.ts +21 -2
- package/build/schemas.d.ts.map +1 -1
- package/build/schemas.js +164 -2
- package/build/schemas.js.map +1 -1
- package/build/types.d.ts +330 -151
- package/build/types.d.ts.map +1 -1
- package/build/utils.d.ts +6 -0
- package/build/utils.d.ts.map +1 -0
- package/build/utils.js +6 -0
- package/build/utils.js.map +1 -0
- package/package.json +13 -13
- package/src/aliases/types.ts +41 -0
- package/src/aliases.ts +34 -0
- package/src/consts.ts +50 -25
- package/src/entrypoints/types.ts +77 -0
- package/src/entrypoints.ts +53 -24
- package/src/errors.ts +71 -0
- package/src/helpers/app/consts.local.ts +5 -0
- package/src/helpers/app/types.ts +54 -0
- package/src/helpers/app.ts +158 -0
- package/src/helpers/apply/consts.local.ts +10 -0
- package/src/helpers/apply/types.ts +32 -0
- package/src/helpers/apply.ts +141 -153
- package/src/helpers/card/types.ts +20 -0
- package/src/helpers/card.ts +59 -33
- package/src/helpers/changes/consts.local.ts +17 -0
- package/src/helpers/changes/types.ts +66 -0
- package/src/helpers/changes.ts +270 -280
- package/src/helpers/code/types.ts +31 -0
- package/src/helpers/code.ts +52 -48
- package/src/helpers/index.ts +17 -0
- package/src/helpers/query/types.ts +26 -0
- package/src/helpers/query.ts +144 -314
- 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/helpers/scoped/types.ts +78 -0
- package/src/helpers/scoped.ts +281 -0
- package/src/helpers/specification/types.ts +26 -0
- package/src/helpers/specification.ts +69 -51
- package/src/helpers/status/types.ts +46 -0
- package/src/helpers/status.ts +117 -93
- package/src/helpers/types.local.ts +18 -0
- package/src/helpers/validate/types.ts +31 -0
- package/src/helpers/validate.ts +89 -77
- package/src/helpers/wire/types.ts +31 -0
- package/src/helpers/wire.ts +252 -0
- package/src/i18n/be.json +5 -0
- package/src/i18n/de.json +5 -0
- package/src/i18n/en.json +5 -0
- package/src/i18n/es.json +5 -0
- package/src/i18n/fr.json +5 -0
- package/src/i18n/pl.json +5 -0
- package/src/i18n/ru.json +5 -0
- package/src/i18n/uk.json +5 -0
- package/src/i18n.ts +4 -3
- package/src/index.ts +8 -0
- package/src/models/index.ts +2 -17
- package/src/models/model.ts +18 -0
- package/src/models/project.ts +2 -1
- package/src/models/specification.ts +2 -1
- package/src/models/types.ts +70 -0
- package/src/models/workcard.ts +14 -16
- package/src/registry.ts +55 -4
- package/src/resources/mentions.ts +11 -0
- package/src/resources/protocol/types.ts +21 -0
- package/src/resources/protocol.ts +36 -0
- package/src/resources/types.local.ts +5 -0
- package/src/resources/types.ts +148 -0
- package/src/schemas.ts +179 -4
- package/src/types.ts +334 -130
- package/src/utils.ts +9 -0
- package/tests/app.spec.ts +188 -0
- package/tests/apply.spec.ts +95 -31
- package/tests/code.spec.ts +9 -9
- package/tests/csp.spec.ts +122 -0
- package/tests/entrypoints.spec.ts +18 -2
- package/tests/error-status.spec.ts +6 -1
- package/tests/models.spec.ts +24 -16
- package/tests/query.spec.ts +13 -15
- package/tests/schemas.spec.ts +8 -8
- package/tests/scoped.spec.ts +161 -0
- package/tests/status.spec.ts +31 -22
package/build/types.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { AssigneeSchemaRegistry, AssigneeTypeSchema, PlanningResourceFacade, PlanningRecordStore, Assignee, Team, Comment, CommentMention } from './resources/types.js';
|
|
2
|
+
import type { PlanningResourceKind, ProjectMode } from './consts.js';
|
|
1
3
|
import type { BasicConfig, BasicContext } from '@owlmeans/context';
|
|
2
|
-
import type { EntrypointProtocol, OpenRequest, OpenValue } from '@owlmeans/entrypoint';
|
|
3
4
|
import type { Criteria, ListOptions, ListResult, ResourceRecord } from '@owlmeans/resource';
|
|
4
|
-
import type { RouteParent } from '@owlmeans/route';
|
|
5
5
|
import type { AnySchema, ValidateFunction } from 'ajv';
|
|
6
|
-
import type { CodeScope, CodeStyle, CommitState, IntrinsicPolicy, IntrinsicStatus, SpecificationFormat, TransitionAction, WorkcardKind } from './consts.js';
|
|
6
|
+
import type { CodeScope, CodeStyle, CommitState, IntrinsicPolicy, IntrinsicStatus, PlanningSchemaKind, SchemaOrigin, SchemaWriteMode, SpecificationFormat, TransitionAction, WorkcardKind } from './consts.js';
|
|
7
|
+
import type { WorkcardModel } from './models/types.js';
|
|
7
8
|
/**
|
|
8
9
|
* The super type. Base fields live at the top level; everything a provider's type declares lives in
|
|
9
10
|
* `fields` and is validated by that type's `fields` JSON schema. Generic code — lists, boards,
|
|
@@ -21,6 +22,12 @@ export interface Workcard extends ResourceRecord {
|
|
|
21
22
|
description?: string;
|
|
22
23
|
/** Primary parent id. Absent on a root project. */
|
|
23
24
|
parent?: string;
|
|
25
|
+
/** Derived from the actual primary parent; never an independent reference. */
|
|
26
|
+
parentType?: string;
|
|
27
|
+
reporter?: string;
|
|
28
|
+
assignee?: string;
|
|
29
|
+
/** Project visibility metadata, interpreted only by a host policy hook. */
|
|
30
|
+
mode?: ProjectMode;
|
|
24
31
|
/** EVERY parent — many-to-many membership with no junction row. Always contains `parent`. */
|
|
25
32
|
parents: string[];
|
|
26
33
|
/** Status key of the PRIMARY flow. Mirror of `flows[primaryFlow]`. */
|
|
@@ -72,6 +79,8 @@ export interface Relationship extends ResourceRecord {
|
|
|
72
79
|
type: string;
|
|
73
80
|
from: string;
|
|
74
81
|
to: string;
|
|
82
|
+
fromKind?: PlanningResourceKind;
|
|
83
|
+
toKind?: PlanningResourceKind;
|
|
75
84
|
project?: string;
|
|
76
85
|
fields?: Record<string, unknown>;
|
|
77
86
|
createdAt: string;
|
|
@@ -83,6 +92,8 @@ export interface RelationshipDraft {
|
|
|
83
92
|
/** Defaults to the card the transition is about. */
|
|
84
93
|
from?: string;
|
|
85
94
|
to: string;
|
|
95
|
+
fromKind?: PlanningResourceKind;
|
|
96
|
+
toKind?: PlanningResourceKind;
|
|
86
97
|
fields?: Record<string, unknown>;
|
|
87
98
|
}
|
|
88
99
|
/** Who wrote a transition. Filled by the server from the authenticated request — never the wire. */
|
|
@@ -106,7 +117,8 @@ export interface TransitionCommit {
|
|
|
106
117
|
* Every key carries a NEW VALUE, never a delta. `fields` and `flows` merge shallowly into the
|
|
107
118
|
* card's; every other key replaces. Clearing is `Transition.unset`.
|
|
108
119
|
*/
|
|
109
|
-
export
|
|
120
|
+
export interface WorkcardChanges extends Partial<Omit<Workcard, 'id' | 'kind' | 'type' | 'entityId' | 'seq' | 'head' | 'createdAt'>>, Partial<Pick<Specification, 'category' | 'format' | 'body' | 'ref' | 'revision' | 'version' | 'bodyChars'>> {
|
|
121
|
+
}
|
|
110
122
|
/** The event. Append-only, never edited; folding every transition of a card in `seq` order IS the card. */
|
|
111
123
|
export interface Transition extends ResourceRecord {
|
|
112
124
|
id?: string;
|
|
@@ -163,6 +175,48 @@ export interface StatusFlowSchema {
|
|
|
163
175
|
statuses: StatusDefinition[];
|
|
164
176
|
transitions: StatusTransitionRule[];
|
|
165
177
|
label?: string;
|
|
178
|
+
/** A presentation hint: the colour family an application marks this flow with. Free text. */
|
|
179
|
+
tone?: string;
|
|
180
|
+
/** A presentation hint: the icon name an application marks this flow with. Free text. */
|
|
181
|
+
icon?: string;
|
|
182
|
+
/**
|
|
183
|
+
* A code-registered flow is sealed against a data-defined override unless it says so. Meaningless
|
|
184
|
+
* on a data-defined flow: a project may override any organization-wide record.
|
|
185
|
+
*/
|
|
186
|
+
overridable?: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* The application's own properties of this flow (`description`, …), closed over what the
|
|
189
|
+
* application declares in `PlanningAppDeclarations.flow`. Refused on a data-defined flow when the
|
|
190
|
+
* application declares none.
|
|
191
|
+
*/
|
|
192
|
+
app?: Record<string, unknown>;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* One kind of property set an application declares in code: an object schema whose `properties`
|
|
196
|
+
* (and `required`) several plugins merge by name. No other keyword is admitted — a merge could not
|
|
197
|
+
* honour it.
|
|
198
|
+
*/
|
|
199
|
+
export interface PlanningAppSchema {
|
|
200
|
+
type?: 'object';
|
|
201
|
+
/** The JSON schema of each property, by name — no `.` or `$` in a name. */
|
|
202
|
+
properties: Record<string, AnySchema>;
|
|
203
|
+
/** Names every record of the kind carries; each one declared in `properties`. */
|
|
204
|
+
required?: string[];
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* What an application pregenerates beside its people's own custom fields — declared in code
|
|
208
|
+
* (`PlanningPlugin.schemas.app`, `PlanningServiceOptions.schemas.app`), served in the bundle.
|
|
209
|
+
*/
|
|
210
|
+
export interface PlanningAppDeclarations {
|
|
211
|
+
/** The `app` bag of every type declaration — checked on a data-defined card type's write. */
|
|
212
|
+
type?: PlanningAppSchema;
|
|
213
|
+
/** The `app` bag of every flow declaration — checked on a data-defined flow's write. */
|
|
214
|
+
flow?: PlanningAppSchema;
|
|
215
|
+
/**
|
|
216
|
+
* Base `fields` of every card of kind `card` — code or data-defined type — validated beside the
|
|
217
|
+
* type's own `fields` schema. Projects and specifications are not affected.
|
|
218
|
+
*/
|
|
219
|
+
card?: PlanningAppSchema;
|
|
166
220
|
}
|
|
167
221
|
export interface SpecificationSlot {
|
|
168
222
|
category: string;
|
|
@@ -195,6 +249,11 @@ export interface RelationshipType {
|
|
|
195
249
|
from?: string[];
|
|
196
250
|
/** Card types allowed at the `to` end. Any when omitted. */
|
|
197
251
|
to?: string[];
|
|
252
|
+
fromKind?: PlanningResourceKind;
|
|
253
|
+
toKind?: PlanningResourceKind;
|
|
254
|
+
/** A fields property whose references derive this relationship index. */
|
|
255
|
+
field?: string;
|
|
256
|
+
multiple?: boolean;
|
|
198
257
|
inverse?: string;
|
|
199
258
|
/** At most one relationship of this type leaves a card. */
|
|
200
259
|
single?: boolean;
|
|
@@ -212,25 +271,65 @@ export interface WorkcardTypeSchema {
|
|
|
212
271
|
/** Slots the type's cards carry as children. */
|
|
213
272
|
specifications: SpecificationSlot[];
|
|
214
273
|
relationships?: RelationshipType[];
|
|
274
|
+
/** Primary/direct hierarchy declarations. Missing means the legacy project-only rule. */
|
|
275
|
+
parents?: {
|
|
276
|
+
types?: string[];
|
|
277
|
+
required?: boolean;
|
|
278
|
+
};
|
|
279
|
+
children?: {
|
|
280
|
+
types: string[];
|
|
281
|
+
};
|
|
215
282
|
/** Allowed labels. Any when omitted. */
|
|
216
283
|
labels?: string[];
|
|
217
284
|
code?: CodePolicy;
|
|
218
285
|
label?: string;
|
|
286
|
+
/** A presentation hint: the colour family an application marks this type's cards with. Free text. */
|
|
287
|
+
tone?: string;
|
|
288
|
+
/** A presentation hint: the icon name an application marks this type's cards with. Free text. */
|
|
289
|
+
icon?: string;
|
|
290
|
+
/**
|
|
291
|
+
* A code-registered card type is sealed against a data-defined override unless it says so.
|
|
292
|
+
* Meaningless on a data-defined type: a project may override any organization-wide record.
|
|
293
|
+
*/
|
|
294
|
+
overridable?: boolean;
|
|
295
|
+
/**
|
|
296
|
+
* The application's own properties of this type (`description`, …), closed over what the
|
|
297
|
+
* application declares in `PlanningAppDeclarations.type`. Refused on a data-defined type when the
|
|
298
|
+
* application declares none.
|
|
299
|
+
*/
|
|
300
|
+
app?: Record<string, unknown>;
|
|
219
301
|
}
|
|
220
302
|
export interface ProjectTypeSchema extends Omit<WorkcardTypeSchema, 'kind'> {
|
|
221
303
|
kind: WorkcardKind.Project;
|
|
222
304
|
cardTypes: string[];
|
|
223
305
|
projectTypes?: string[];
|
|
306
|
+
/**
|
|
307
|
+
* The project admits cards of data-defined types (organization-wide or its own) beside the
|
|
308
|
+
* `cardTypes` it lists.
|
|
309
|
+
*/
|
|
310
|
+
scopedCardTypes?: boolean;
|
|
224
311
|
}
|
|
225
312
|
export type AnyTypeSchema = WorkcardTypeSchema | ProjectTypeSchema;
|
|
226
313
|
export interface PlanningSchemaBundle {
|
|
227
314
|
version: number;
|
|
228
315
|
types: AnyTypeSchema[];
|
|
229
316
|
flows: StatusFlowSchema[];
|
|
317
|
+
assigneeTypes?: AssigneeTypeSchema[];
|
|
318
|
+
/** The application's declarations, merged — absent when it declares none. */
|
|
319
|
+
app?: PlanningAppDeclarations;
|
|
230
320
|
}
|
|
231
|
-
export interface PlanningSchemaRegistry {
|
|
321
|
+
export interface PlanningSchemaRegistry extends AssigneeSchemaRegistry {
|
|
232
322
|
registerType: (schema: AnyTypeSchema) => void;
|
|
233
323
|
registerFlow: (flow: StatusFlowSchema) => void;
|
|
324
|
+
/**
|
|
325
|
+
* Replace the application's declarations (already merged; `undefined` clears them) — drops every
|
|
326
|
+
* cached validator.
|
|
327
|
+
*
|
|
328
|
+
* @throws {SchemaInvalid} a malformed declaration
|
|
329
|
+
*/
|
|
330
|
+
registerApp: (app?: PlanningAppDeclarations) => void;
|
|
331
|
+
/** The application's declarations in force, `undefined` when there are none. Do not mutate. */
|
|
332
|
+
app: () => PlanningAppDeclarations | undefined;
|
|
234
333
|
types: () => AnyTypeSchema[];
|
|
235
334
|
/** @throws {UnknownWorkcardType} */
|
|
236
335
|
type: (type: string) => AnyTypeSchema;
|
|
@@ -240,16 +339,174 @@ export interface PlanningSchemaRegistry {
|
|
|
240
339
|
flow: (id: string) => StatusFlowSchema;
|
|
241
340
|
/** @throws {UnknownWorkcardType | UnknownStatusFlow} */
|
|
242
341
|
primaryFlow: (type: string) => StatusFlowSchema;
|
|
243
|
-
/**
|
|
342
|
+
/**
|
|
343
|
+
* The schema a type's `fields` validate against: its own `fields`, plus the application's base
|
|
344
|
+
* card fields for a type of kind `card` (`appSchemaHelper.fieldsSchemaOf`). What a browser form
|
|
345
|
+
* hands `makePlanningFieldValidator`.
|
|
346
|
+
*
|
|
347
|
+
* @throws {UnknownWorkcardType}
|
|
348
|
+
*/
|
|
349
|
+
fieldsSchema: (type: string) => AnySchema;
|
|
350
|
+
/** The compiled, cached validator of a type's {@link fieldsSchema}. */
|
|
244
351
|
validator: (type: string) => ValidateFunction;
|
|
245
352
|
bundle: () => PlanningSchemaBundle;
|
|
246
353
|
/** Replace everything with a bundle — a client's boot. */
|
|
247
354
|
load: (bundle: PlanningSchemaBundle) => void;
|
|
248
355
|
}
|
|
356
|
+
/** The layer a record belongs to: an organization, and optionally one of its project cards. */
|
|
357
|
+
export interface SchemaScope {
|
|
358
|
+
entityId: string;
|
|
359
|
+
/** A project card id; the organization-wide layer when omitted. */
|
|
360
|
+
project?: string;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* A card type or a status flow defined as data — organization-wide, or scoped to one project.
|
|
364
|
+
*
|
|
365
|
+
* `version` is the record's compare-and-set token and is also written into the declaration's own
|
|
366
|
+
* `version`: a write lands only at its layer's next version (1 for a new key).
|
|
367
|
+
*/
|
|
368
|
+
export interface ScopedSchemaRecord extends ResourceRecord {
|
|
369
|
+
id?: string;
|
|
370
|
+
entityId: string;
|
|
371
|
+
/** A project card id; absent on an organization-wide record. */
|
|
372
|
+
project?: string;
|
|
373
|
+
kind: PlanningSchemaKind;
|
|
374
|
+
/** The type key or the flow id. */
|
|
375
|
+
key: string;
|
|
376
|
+
version: number;
|
|
377
|
+
/** A `WorkcardTypeSchema` of kind `card`, or a `StatusFlowSchema`. */
|
|
378
|
+
definition: WorkcardTypeSchema | StatusFlowSchema | AssigneeTypeSchema;
|
|
379
|
+
/**
|
|
380
|
+
* Retired: offered for nothing new, still resolved for what already uses it. A retired record
|
|
381
|
+
* gives way to a live declaration of the same key in a lower layer.
|
|
382
|
+
*/
|
|
383
|
+
retired?: boolean;
|
|
384
|
+
/** The organization's schema revision this write landed at — assigned by the store. */
|
|
385
|
+
rev?: number;
|
|
386
|
+
createdAt: string;
|
|
387
|
+
updatedAt?: string;
|
|
388
|
+
by?: TransitionActor;
|
|
389
|
+
}
|
|
390
|
+
export interface ScopedSchemaWhere {
|
|
391
|
+
entityId: string;
|
|
392
|
+
/** A project id — that project's layer; `null` — the organization-wide layer; omitted — every layer. */
|
|
393
|
+
project?: string | null;
|
|
394
|
+
kind?: PlanningSchemaKind;
|
|
395
|
+
key?: string | string[];
|
|
396
|
+
retired?: boolean;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* The optional port a store implements to hold data-defined types and flows. A store without it
|
|
400
|
+
* resolves every type and flow from the code registry alone.
|
|
401
|
+
*/
|
|
402
|
+
export interface SchemaStore {
|
|
403
|
+
list: (where: ScopedSchemaWhere) => Promise<ScopedSchemaRecord[]>;
|
|
404
|
+
/**
|
|
405
|
+
* Write one record — compare-and-set on `version`: the stored record of the same layer and key
|
|
406
|
+
* must be at `record.version - 1` (absent for version 1). Bumps the organization's revision.
|
|
407
|
+
*
|
|
408
|
+
* @throws {SchemaConflict}
|
|
409
|
+
*/
|
|
410
|
+
put: (record: ScopedSchemaRecord) => Promise<ScopedSchemaRecord>;
|
|
411
|
+
/** Remove a project's whole layer (its project was purged). Bumps the revision. */
|
|
412
|
+
purge: (where: {
|
|
413
|
+
entityId: string;
|
|
414
|
+
project: string;
|
|
415
|
+
}) => Promise<number>;
|
|
416
|
+
/** The organization's monotonic schema revision — 0 before its first write. */
|
|
417
|
+
revision: (entityId: string) => Promise<number>;
|
|
418
|
+
/** Hear of every write of an organization's records, from this process and — where the store can — others. */
|
|
419
|
+
watch?: (listener: (entityId: string) => void) => Unsubscribe;
|
|
420
|
+
}
|
|
421
|
+
export interface SchemaKey {
|
|
422
|
+
kind: PlanningSchemaKind;
|
|
423
|
+
key: string;
|
|
424
|
+
}
|
|
425
|
+
/** What a scoped bundle adds, per kind: where each key resolved from, and which keys are retired. */
|
|
426
|
+
export interface ScopedSchemaOrigins {
|
|
427
|
+
types: Record<string, SchemaOrigin>;
|
|
428
|
+
flows: Record<string, SchemaOrigin>;
|
|
429
|
+
assigneeTypes?: Record<string, SchemaOrigin>;
|
|
430
|
+
}
|
|
431
|
+
export interface ScopedSchemaRetired {
|
|
432
|
+
types: string[];
|
|
433
|
+
flows: string[];
|
|
434
|
+
assigneeTypes?: string[];
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* A bundle resolved for one layer: the code registry, overlaid by the organization's records, then
|
|
438
|
+
* by the project's. Retired declarations stay in `types`/`flows` (existing cards still resolve them)
|
|
439
|
+
* and are listed in `retired`. Readers of the plain bundle ignore the extra keys.
|
|
440
|
+
*/
|
|
441
|
+
export interface ScopedSchemaBundle extends PlanningSchemaBundle {
|
|
442
|
+
scope?: SchemaScope;
|
|
443
|
+
/** The organization's schema revision the bundle was resolved at. */
|
|
444
|
+
revision?: number;
|
|
445
|
+
origins?: ScopedSchemaOrigins;
|
|
446
|
+
retired?: ScopedSchemaRetired;
|
|
447
|
+
}
|
|
448
|
+
/** A read-only registry over one resolved layer. Its `register*` and `load` refuse. */
|
|
449
|
+
export interface ScopedSchemaRegistry extends PlanningSchemaRegistry {
|
|
450
|
+
scope: SchemaScope;
|
|
451
|
+
revision: number;
|
|
452
|
+
/** `undefined` for a key the layer does not resolve. */
|
|
453
|
+
originOf: (kind: PlanningSchemaKind, key: string) => SchemaOrigin | undefined;
|
|
454
|
+
isRetired: (kind: PlanningSchemaKind, key: string) => boolean;
|
|
455
|
+
bundle: () => ScopedSchemaBundle;
|
|
456
|
+
}
|
|
457
|
+
/** Declarations written together — flows first, so a type may name a flow defined beside it. */
|
|
458
|
+
export interface SchemaDeclarations {
|
|
459
|
+
types?: WorkcardTypeSchema[];
|
|
460
|
+
flows?: StatusFlowSchema[];
|
|
461
|
+
assigneeTypes?: AssigneeTypeSchema[];
|
|
462
|
+
}
|
|
463
|
+
export interface SchemaWriteOptions {
|
|
464
|
+
/** A project card id — that project's layer; the organization-wide layer when omitted. */
|
|
465
|
+
project?: string;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Data-defined types and flows — present on a facade whose store implements
|
|
469
|
+
* {@link PlanningStore.schemas}. Only card types and flows are data-defined; projects and
|
|
470
|
+
* specifications always resolve in code.
|
|
471
|
+
*/
|
|
472
|
+
export interface PlanningDefinitions {
|
|
473
|
+
/** The layer resolved: the organization-wide one, or a project's (which includes it). */
|
|
474
|
+
bundle: (project?: string) => Promise<ScopedSchemaBundle>;
|
|
475
|
+
registry: (project?: string) => Promise<ScopedSchemaRegistry>;
|
|
476
|
+
/** The records of one layer (`project: null` the organization's; omitted — every layer). */
|
|
477
|
+
records: (opts?: {
|
|
478
|
+
project?: string | null;
|
|
479
|
+
kind?: PlanningSchemaKind;
|
|
480
|
+
retired?: boolean;
|
|
481
|
+
}) => Promise<ScopedSchemaRecord[]>;
|
|
482
|
+
/**
|
|
483
|
+
* Compare-and-set: `type.version` must be the layer's next version (1 for a new key).
|
|
484
|
+
*
|
|
485
|
+
* @throws {SchemaConflict | SchemaSealed | SchemaInvalid | WorkcardNotFound}
|
|
486
|
+
*/
|
|
487
|
+
putType: (type: WorkcardTypeSchema, opts?: SchemaWriteOptions) => Promise<ScopedSchemaRecord>;
|
|
488
|
+
/** Compare-and-set, as {@link putType}. */
|
|
489
|
+
putAssigneeType: (schema: AssigneeTypeSchema) => Promise<ScopedSchemaRecord>;
|
|
490
|
+
putFlow: (flow: StatusFlowSchema, opts?: SchemaWriteOptions) => Promise<ScopedSchemaRecord>;
|
|
491
|
+
/** Every declaration at its layer's next version — flows first, then types. */
|
|
492
|
+
define: (declarations: SchemaDeclarations, opts?: SchemaWriteOptions) => Promise<ScopedSchemaRecord[]>;
|
|
493
|
+
/** Only the keys the layer lacks, at version 1 — idempotent. */
|
|
494
|
+
seed: (declarations: SchemaDeclarations, opts?: SchemaWriteOptions) => Promise<ScopedSchemaRecord[]>;
|
|
495
|
+
/**
|
|
496
|
+
* Retire a key at a layer. Existing cards keep resolving it; nothing new is created with it.
|
|
497
|
+
*
|
|
498
|
+
* @throws {SchemaInUse} a flow still resolved by a live type of an affected layer
|
|
499
|
+
* @throws {UnknownWorkcardType | UnknownStatusFlow} the layer holds no record of the key
|
|
500
|
+
*/
|
|
501
|
+
retire: (kind: PlanningSchemaKind, key: string, opts?: SchemaWriteOptions) => Promise<ScopedSchemaRecord>;
|
|
502
|
+
}
|
|
249
503
|
export interface WorkcardDraft {
|
|
250
504
|
kind: WorkcardKind;
|
|
251
505
|
type: string;
|
|
252
506
|
parent?: string;
|
|
507
|
+
reporter?: string;
|
|
508
|
+
assignee?: string;
|
|
509
|
+
mode?: ProjectMode;
|
|
253
510
|
parents?: string[];
|
|
254
511
|
title: string;
|
|
255
512
|
description?: string;
|
|
@@ -333,7 +590,9 @@ export interface CommitFilter {
|
|
|
333
590
|
card?: string;
|
|
334
591
|
kind?: WorkcardKind;
|
|
335
592
|
}
|
|
336
|
-
export
|
|
593
|
+
export interface Unsubscribe {
|
|
594
|
+
(): void;
|
|
595
|
+
}
|
|
337
596
|
export interface CommitSource {
|
|
338
597
|
status: (transition: string) => Promise<CommitStatus>;
|
|
339
598
|
subscribe: (listener: (event: CommitEvent) => void | Promise<void>, filter?: CommitFilter) => Unsubscribe | Promise<Unsubscribe>;
|
|
@@ -345,7 +604,8 @@ export interface CommitSource {
|
|
|
345
604
|
export interface TransitionWhere {
|
|
346
605
|
entityId: string;
|
|
347
606
|
card?: string | string[];
|
|
348
|
-
project
|
|
607
|
+
/** One project, or any of several. */
|
|
608
|
+
project?: string | string[];
|
|
349
609
|
sinceSeq?: number;
|
|
350
610
|
state?: CommitState;
|
|
351
611
|
action?: TransitionAction | TransitionAction[];
|
|
@@ -374,6 +634,11 @@ export interface ProjectionStore {
|
|
|
374
634
|
count: (where: Criteria<Workcard>) => Promise<number>;
|
|
375
635
|
summary: (parents: string[], where?: Criteria<Workcard>) => Promise<SummaryView>;
|
|
376
636
|
put: (card: Workcard) => Promise<void>;
|
|
637
|
+
/**
|
|
638
|
+
* Remove a record — the fold of its `delete` — with its comments and mentions, and its own
|
|
639
|
+
* documents (the specifications whose primary parent is it, and theirs in turn) with their edges,
|
|
640
|
+
* comments, mentions and log. The record's own log stays: its delete row is the tombstone.
|
|
641
|
+
*/
|
|
377
642
|
drop: (id: string, entityId: string) => Promise<void>;
|
|
378
643
|
/** Fold what is pending for the card — now or through a durable server projection. */
|
|
379
644
|
project: (card: string, hint?: {
|
|
@@ -406,6 +671,10 @@ export interface RelationshipWhere {
|
|
|
406
671
|
from?: string | string[];
|
|
407
672
|
to?: string | string[];
|
|
408
673
|
type?: string | string[];
|
|
674
|
+
fromKind?: PlanningResourceKind;
|
|
675
|
+
toKind?: PlanningResourceKind;
|
|
676
|
+
/** The project an edge is filed under. A store that ignores it is narrowed by the facade. */
|
|
677
|
+
project?: string | string[];
|
|
409
678
|
}
|
|
410
679
|
export interface RelationshipStore {
|
|
411
680
|
list: (where: RelationshipWhere, opts?: ListOptions<Relationship>) => Promise<ListResult<Relationship>>;
|
|
@@ -420,6 +689,8 @@ export interface PlanningStoreCapabilities {
|
|
|
420
689
|
}
|
|
421
690
|
/** Only `cards` is required — which is what keeps a foreign provider possible. */
|
|
422
691
|
export interface PlanningStore {
|
|
692
|
+
validateProjection?: (before: Workcard | null, after: Workcard | null, transition: Transition) => Promise<void>;
|
|
693
|
+
projectReferences?: (after: Workcard, transition: Transition) => Promise<void>;
|
|
423
694
|
alias?: string;
|
|
424
695
|
capabilities?: PlanningStoreCapabilities;
|
|
425
696
|
/** The id a new card gets. */
|
|
@@ -429,6 +700,14 @@ export interface PlanningStore {
|
|
|
429
700
|
specs?: SpecificationStore;
|
|
430
701
|
links?: RelationshipStore;
|
|
431
702
|
commits?: CommitSource;
|
|
703
|
+
/** Data-defined card/assignee types and flows. Without it their declarations resolve in code. */
|
|
704
|
+
schemas?: SchemaStore;
|
|
705
|
+
assignees?: PlanningRecordStore<Assignee>;
|
|
706
|
+
teams?: PlanningRecordStore<Team>;
|
|
707
|
+
comments?: PlanningRecordStore<Comment>;
|
|
708
|
+
mentions?: PlanningRecordStore<CommentMention>;
|
|
709
|
+
/** Serialize dependent writes across processes in this organization. */
|
|
710
|
+
unit?: <R>(entityId: string, run: () => Promise<R>) => Promise<R>;
|
|
432
711
|
}
|
|
433
712
|
export interface WorkcardQuery extends ListOptions<Workcard> {
|
|
434
713
|
kind?: WorkcardKind | WorkcardKind[];
|
|
@@ -460,6 +739,8 @@ export interface SpecificationQuery extends ListOptions<Specification> {
|
|
|
460
739
|
all?: boolean;
|
|
461
740
|
}
|
|
462
741
|
export interface RelationshipQuery extends ListOptions<Relationship> {
|
|
742
|
+
fromKind?: PlanningResourceKind;
|
|
743
|
+
toKind?: PlanningResourceKind;
|
|
463
744
|
from?: string | string[];
|
|
464
745
|
to?: string | string[];
|
|
465
746
|
type?: string | string[];
|
|
@@ -511,6 +792,8 @@ export interface SpecificationQueryWire extends ListWire {
|
|
|
511
792
|
all?: boolean;
|
|
512
793
|
}
|
|
513
794
|
export interface RelationshipQueryWire extends ListWire {
|
|
795
|
+
fromKind?: PlanningResourceKind;
|
|
796
|
+
toKind?: PlanningResourceKind;
|
|
514
797
|
from?: string;
|
|
515
798
|
to?: string;
|
|
516
799
|
type?: string;
|
|
@@ -544,15 +827,45 @@ export interface CommitFeedQuery {
|
|
|
544
827
|
export interface RevisionsQuery {
|
|
545
828
|
limit?: number;
|
|
546
829
|
}
|
|
830
|
+
export interface SchemaListQuery {
|
|
831
|
+
/** A project card id — that project's layer; the organization-wide one when omitted. */
|
|
832
|
+
project?: string;
|
|
833
|
+
}
|
|
834
|
+
/** The one write of data-defined types and flows over the wire. */
|
|
835
|
+
export interface SchemaDefineRequest {
|
|
836
|
+
/** A project card id — that project's layer; the organization-wide one when omitted. */
|
|
837
|
+
project?: string;
|
|
838
|
+
/** `define` when omitted. */
|
|
839
|
+
mode?: SchemaWriteMode;
|
|
840
|
+
types?: WorkcardTypeSchema[];
|
|
841
|
+
flows?: StatusFlowSchema[];
|
|
842
|
+
assigneeTypes?: AssigneeTypeSchema[];
|
|
843
|
+
/** Keys retired at the layer after the declarations are written. */
|
|
844
|
+
retire?: SchemaKey[];
|
|
845
|
+
}
|
|
846
|
+
/** What a `schema.define` answers: the records it wrote, and the layer as it resolves afterwards. */
|
|
847
|
+
export interface SchemaDefineReply {
|
|
848
|
+
records: ScopedSchemaRecord[];
|
|
849
|
+
bundle: ScopedSchemaBundle;
|
|
850
|
+
}
|
|
547
851
|
export interface PlanningScope {
|
|
548
852
|
entityId: string;
|
|
549
853
|
profileId?: string;
|
|
550
854
|
userId?: string;
|
|
855
|
+
/** Trusted planning actor, resolved by a host auth plugin. */
|
|
856
|
+
assigneeId?: string;
|
|
857
|
+
defaultAssigneeId?: string;
|
|
551
858
|
service?: string;
|
|
552
859
|
channel?: string;
|
|
553
860
|
actor?: TransitionActor;
|
|
861
|
+
/**
|
|
862
|
+
* The only project cards this scope may see and write — the projects themselves and every card
|
|
863
|
+
* whose `parents` name one (a card's document through its card). Every project when omitted.
|
|
864
|
+
* Advisory on a client, where the server decides.
|
|
865
|
+
*/
|
|
866
|
+
projects?: string[];
|
|
554
867
|
}
|
|
555
|
-
export interface PlanningFacade {
|
|
868
|
+
export interface PlanningFacade extends PlanningResourceFacade {
|
|
556
869
|
scope: PlanningScope;
|
|
557
870
|
schemas: PlanningSchemaRegistry;
|
|
558
871
|
cards: {
|
|
@@ -580,6 +893,8 @@ export interface PlanningFacade {
|
|
|
580
893
|
commits: CommitSource;
|
|
581
894
|
execute: (exec: TransitionExecution, opts?: ExecuteOptions) => Promise<TransitionReceipt>;
|
|
582
895
|
model: <T extends Workcard = Workcard>(card: T | string) => Promise<WorkcardModel<T>>;
|
|
896
|
+
/** Data-defined types and flows — present only where the store holds them. */
|
|
897
|
+
definitions?: PlanningDefinitions;
|
|
583
898
|
}
|
|
584
899
|
export interface WithPlanningService {
|
|
585
900
|
planning: () => PlanningService;
|
|
@@ -620,9 +935,15 @@ export interface PlanningPlugin {
|
|
|
620
935
|
name: string;
|
|
621
936
|
/** Ascending; `DEFAULT_PLUGIN_ORDER` (50) when omitted. */
|
|
622
937
|
order?: number;
|
|
938
|
+
/**
|
|
939
|
+
* Code declarations. `app` — the application's own definition properties and base card fields —
|
|
940
|
+
* is merged over every plugin in plugin order (`appSchemaHelper.merge`), not replaced.
|
|
941
|
+
*/
|
|
623
942
|
schemas?: {
|
|
624
943
|
types?: AnyTypeSchema[];
|
|
625
944
|
flows?: StatusFlowSchema[];
|
|
945
|
+
assigneeTypes?: AssigneeTypeSchema[];
|
|
946
|
+
app?: PlanningAppDeclarations;
|
|
626
947
|
};
|
|
627
948
|
owns?: (type: string) => boolean;
|
|
628
949
|
store?: PlanningStore | ((ctx: BasicContext<BasicConfig>) => PlanningStore);
|
|
@@ -640,146 +961,4 @@ export interface PlanningService {
|
|
|
640
961
|
/** Runs the ordered `after` chain — called by the process that FOLDED the transition. */
|
|
641
962
|
committed: (event: CommitEvent) => Promise<void>;
|
|
642
963
|
}
|
|
643
|
-
export interface ExecuteMeta {
|
|
644
|
-
actor?: TransitionActor;
|
|
645
|
-
cause?: string;
|
|
646
|
-
key?: string;
|
|
647
|
-
expectSeq?: number | null;
|
|
648
|
-
}
|
|
649
|
-
export type ModelExecuteOptions = ExecuteOptions & ExecuteMeta;
|
|
650
|
-
export interface SpecificationWriteOptions extends ModelExecuteOptions {
|
|
651
|
-
format?: SpecificationFormat;
|
|
652
|
-
version?: number;
|
|
653
|
-
ref?: string;
|
|
654
|
-
/** The title a new document gets; the category when omitted. */
|
|
655
|
-
title?: string;
|
|
656
|
-
/** The specification type; resolved from the slot and the registry when omitted. */
|
|
657
|
-
type?: string;
|
|
658
|
-
}
|
|
659
|
-
export interface WorkcardModel<T extends Workcard = Workcard> {
|
|
660
|
-
record: T;
|
|
661
|
-
id: string;
|
|
662
|
-
kind: WorkcardKind;
|
|
663
|
-
type: string;
|
|
664
|
-
schema: () => AnyTypeSchema;
|
|
665
|
-
flow: (id?: string) => StatusFlowSchema;
|
|
666
|
-
statusOf: (flowId?: string) => string;
|
|
667
|
-
intrinsicOf: (flowId?: string) => IntrinsicStatus;
|
|
668
|
-
can: (transition: string, flowId?: string) => boolean;
|
|
669
|
-
available: (flowId?: string) => StatusTransitionRule[];
|
|
670
|
-
pending: () => boolean;
|
|
671
|
-
transit: (transition: string, changes?: WorkcardChanges, opts?: ModelExecuteOptions & {
|
|
672
|
-
flow?: string;
|
|
673
|
-
}) => Promise<TransitionReceipt>;
|
|
674
|
-
update: (changes: WorkcardChanges, opts?: ModelExecuteOptions & {
|
|
675
|
-
unset?: string[];
|
|
676
|
-
}) => Promise<TransitionReceipt>;
|
|
677
|
-
remove: (opts?: ModelExecuteOptions) => Promise<TransitionReceipt>;
|
|
678
|
-
link: (type: string, to: string, fields?: Record<string, unknown>, opts?: ModelExecuteOptions) => Promise<TransitionReceipt>;
|
|
679
|
-
unlink: (type: string, to: string, opts?: ModelExecuteOptions) => Promise<TransitionReceipt>;
|
|
680
|
-
children: (query?: Omit<WorkcardQuery, 'parent'>) => Promise<ListResult<Workcard>>;
|
|
681
|
-
relationships: (query?: RelationshipQuery) => Promise<ListResult<Relationship>>;
|
|
682
|
-
transitions: (query?: Omit<TransitionQuery, 'card'>) => Promise<ListResult<Transition>>;
|
|
683
|
-
specification: (category: string) => Promise<Specification | null>;
|
|
684
|
-
specifications: (query?: SpecificationQuery) => Promise<ListResult<Specification>>;
|
|
685
|
-
revisions: (category: string, limit?: number) => Promise<SpecificationRevision[]>;
|
|
686
|
-
/** Create the slot's document, or revise it when it already exists. */
|
|
687
|
-
write: (category: string, body: string, opts?: SpecificationWriteOptions) => Promise<TransitionReceipt>;
|
|
688
|
-
reload: () => Promise<WorkcardModel<T>>;
|
|
689
|
-
}
|
|
690
|
-
export interface ProjectModel extends WorkcardModel<Project> {
|
|
691
|
-
cards: (query?: Omit<WorkcardQuery, 'within' | 'kind'>) => Promise<ListResult<Workcard>>;
|
|
692
|
-
projects: (query?: Omit<WorkcardQuery, 'within' | 'kind'>) => Promise<ListResult<Workcard>>;
|
|
693
|
-
summary: (query?: Omit<SummaryQuery, 'parents'>) => Promise<IntrinsicCounts>;
|
|
694
|
-
/** A `delete` of the project — the store removes everything under it. */
|
|
695
|
-
purge: (opts?: ModelExecuteOptions) => Promise<TransitionReceipt>;
|
|
696
|
-
reload: () => Promise<ProjectModel>;
|
|
697
|
-
}
|
|
698
|
-
export interface SpecificationModel extends WorkcardModel<Specification> {
|
|
699
|
-
body: () => string | undefined;
|
|
700
|
-
revise: (body: string, opts?: ModelExecuteOptions & {
|
|
701
|
-
version?: number;
|
|
702
|
-
ref?: string;
|
|
703
|
-
}) => Promise<TransitionReceipt>;
|
|
704
|
-
history: (limit?: number) => Promise<SpecificationRevision[]>;
|
|
705
|
-
reload: () => Promise<SpecificationModel>;
|
|
706
|
-
}
|
|
707
|
-
export interface PlanningBaseOptions {
|
|
708
|
-
/** The base alias every leaf alias derives from (`planningAliases`). */
|
|
709
|
-
alias: string;
|
|
710
|
-
/** Defaults to `PLANNING_PATH`. */
|
|
711
|
-
path?: string;
|
|
712
|
-
parent?: RouteParent;
|
|
713
|
-
service?: string;
|
|
714
|
-
}
|
|
715
|
-
export interface PlanningProtocolOptions {
|
|
716
|
-
base: PlanningBaseOptions;
|
|
717
|
-
/** The guard(s) the base carries; every HTTP leaf inherits them. */
|
|
718
|
-
guards: string | readonly string[];
|
|
719
|
-
gate?: {
|
|
720
|
-
alias: string;
|
|
721
|
-
params?: string | readonly string[];
|
|
722
|
-
};
|
|
723
|
-
/**
|
|
724
|
-
* The socket base the commit feed hangs under. The feed inherits THAT base's guards; the
|
|
725
|
-
* planning base when omitted.
|
|
726
|
-
*/
|
|
727
|
-
socketBase?: RouteParent;
|
|
728
|
-
}
|
|
729
|
-
export interface PlanningProtocols {
|
|
730
|
-
base: EntrypointProtocol<OpenRequest, OpenValue>;
|
|
731
|
-
schema: {
|
|
732
|
-
list: EntrypointProtocol<{}, PlanningSchemaBundle>;
|
|
733
|
-
};
|
|
734
|
-
card: {
|
|
735
|
-
list: EntrypointProtocol<{
|
|
736
|
-
query: WorkcardQueryWire;
|
|
737
|
-
}, ListResult<Workcard>>;
|
|
738
|
-
summary: EntrypointProtocol<{
|
|
739
|
-
query: SummaryQueryWire;
|
|
740
|
-
}, SummaryView>;
|
|
741
|
-
get: EntrypointProtocol<{
|
|
742
|
-
params: WorkcardParams;
|
|
743
|
-
}, Workcard>;
|
|
744
|
-
transitions: EntrypointProtocol<{
|
|
745
|
-
params: WorkcardParams;
|
|
746
|
-
query: TransitionQueryWire;
|
|
747
|
-
}, ListResult<Transition>>;
|
|
748
|
-
specifications: EntrypointProtocol<{
|
|
749
|
-
params: WorkcardParams;
|
|
750
|
-
query: SpecificationQueryWire;
|
|
751
|
-
}, ListResult<Specification>>;
|
|
752
|
-
};
|
|
753
|
-
spec: {
|
|
754
|
-
get: EntrypointProtocol<{
|
|
755
|
-
params: WorkcardParams;
|
|
756
|
-
}, Specification>;
|
|
757
|
-
revisions: EntrypointProtocol<{
|
|
758
|
-
params: WorkcardParams;
|
|
759
|
-
query: RevisionsQuery;
|
|
760
|
-
}, SpecificationRevisionList>;
|
|
761
|
-
};
|
|
762
|
-
link: {
|
|
763
|
-
list: EntrypointProtocol<{
|
|
764
|
-
query: RelationshipQueryWire;
|
|
765
|
-
}, ListResult<Relationship>>;
|
|
766
|
-
};
|
|
767
|
-
transition: {
|
|
768
|
-
get: EntrypointProtocol<{
|
|
769
|
-
params: TransitionParams;
|
|
770
|
-
}, Transition>;
|
|
771
|
-
};
|
|
772
|
-
execute: EntrypointProtocol<{
|
|
773
|
-
body: ExecuteRequest;
|
|
774
|
-
}, TransitionReceiptView>;
|
|
775
|
-
commit: {
|
|
776
|
-
get: EntrypointProtocol<{
|
|
777
|
-
params: TransitionParams;
|
|
778
|
-
query: CommitQuery;
|
|
779
|
-
}, CommitStatus>;
|
|
780
|
-
events: EntrypointProtocol<{
|
|
781
|
-
query: CommitFeedQuery;
|
|
782
|
-
}, CommitEvent>;
|
|
783
|
-
};
|
|
784
|
-
}
|
|
785
964
|
//# sourceMappingURL=types.d.ts.map
|