@openengio/cli 0.27.1 → 0.36.0
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 +124 -25
- package/bin/public/openeng.js +2508 -303
- package/package.json +1 -1
- package/skill/build-ui/SKILL.md +1 -1
- package/skill/conventions/SKILL.md +98 -2
- package/skill/demo/SKILL.md +11 -6
- package/skill/openeng/SKILL.md +219 -35
- package/skill/playbooks/product-lifecycle.md +1 -1
package/bin/public/openeng.js
CHANGED
|
@@ -51,9 +51,24 @@ var IMPORT_FAILURE_TEXT = Object.freeze({
|
|
|
51
51
|
"mirror-row-unreadable": "a row the connector wrote in the mirror project has lost a value the connector stamps on it (its upstream identifier, upstream document identifier or upstream status); a person who writes the mirror project restores it or deletes the row, and the next run creates it again"
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
// packages/api-contract/dist/
|
|
54
|
+
// packages/api-contract/dist/description-parsing.js
|
|
55
55
|
var LINK_DIRECTIONS = Object.freeze(["outgoing", "incoming", "to-children", "to-parent"]);
|
|
56
|
-
|
|
56
|
+
|
|
57
|
+
// packages/api-contract/dist/query-parser.js
|
|
58
|
+
var SET_OPERATORS = Object.freeze(["union", "intersection", "difference"]);
|
|
59
|
+
var AGGREGATE_OPERATIONS = Object.freeze(["count", "min", "max", "sum", "average"]);
|
|
60
|
+
|
|
61
|
+
// packages/api-contract/dist/entry-form.js
|
|
62
|
+
function verbEntry(type) {
|
|
63
|
+
const subjects = type.allowedSubjectTypes;
|
|
64
|
+
return { ...type, allowedSubjectTypes: subjects.kind === "none" ? "none" : subjects.types };
|
|
65
|
+
}
|
|
66
|
+
function entryTypeOf(type) {
|
|
67
|
+
return type.typeCategory === "verb" ? verbEntry(type) : type;
|
|
68
|
+
}
|
|
69
|
+
function entryChangesOf(changes) {
|
|
70
|
+
return Object.freeze(Object.fromEntries(Object.entries(changes).map(([key, type]) => [key, entryTypeOf(type)])));
|
|
71
|
+
}
|
|
57
72
|
|
|
58
73
|
// packages/api-contract/dist/refusal-catalogue.js
|
|
59
74
|
function entry(meaning, ...next) {
|
|
@@ -64,6 +79,20 @@ var FIX_REQUEST = { option: "Correct the request and send it again." };
|
|
|
64
79
|
var ASK_ADMINISTRATOR = { option: "Ask an administrator of the organisation to make the change or to grant the permission." };
|
|
65
80
|
var SIGN_IN_AGAIN = { option: "Sign in again." };
|
|
66
81
|
var RULE_ENTRIES = {
|
|
82
|
+
"upstream-changed": entry("The upstream content changed since the link was reviewed; no link was cleared.", {
|
|
83
|
+
option: "Read the link status, review the upstream content and clear against its new version.",
|
|
84
|
+
read: "readLinkStatus"
|
|
85
|
+
}),
|
|
86
|
+
"upstream-not-readable": entry("The upstream object or an object in its review chain cannot be read; no link was cleared.", { option: "Ask for read access to the upstream review chain before clearing the link." }),
|
|
87
|
+
"too-many-links": entry("The review chain or aggregate exceeds 100 contributing objects or links.", { option: "Reduce the chain or the contributing links before reading or clearing again." }),
|
|
88
|
+
"unsupported-content": entry("The file's content or name is not an admitted attachment format.", FIX_REQUEST),
|
|
89
|
+
"too-large": entry("The attachment exceeds the per-file byte limit.", FIX_REQUEST),
|
|
90
|
+
"not-an-attachment-property": entry("The object's stored type version does not declare this property as an attachment.", FIX_REQUEST),
|
|
91
|
+
"no-attachment": entry("The property holds no attachment."),
|
|
92
|
+
"attachment-unavailable": entry("The attachment's stored bytes are unavailable.", { option: "Ask an administrator to restore the attachment." }),
|
|
93
|
+
"unknown-attachment": entry("The changed attachment has not been staged for you in this project.", FIX_REQUEST),
|
|
94
|
+
"attachment-precondition": entry("The attachment's media type or byte count differs from its stored metadata.", FIX_REQUEST),
|
|
95
|
+
"attachment-class-mismatch": entry("The attachment's class is not admitted by this property.", FIX_REQUEST),
|
|
67
96
|
"not-permitted": entry("The operation was refused. What the request names may not exist, or you may not have permission for it; the answer is the same either way.", { option: "Check that the request names something you can reach; if it does, ask an administrator for the permission." }),
|
|
68
97
|
"grant-scope": entry("The application was not given the permission this operation needs; the refusal names that permission.", { option: "Ask the person to connect the application again with the permission the refusal names." }),
|
|
69
98
|
"not-in-this-release": entry("This operation is not available in this release."),
|
|
@@ -80,6 +109,7 @@ var RULE_ENTRIES = {
|
|
|
80
109
|
read: "readChangeSet"
|
|
81
110
|
}),
|
|
82
111
|
"version-conflict": entry("Another change already published a version of a type that this change set also publishes.", { option: "Read the change set and the published types, then revise the change set to the next version.", read: "readChangeSet" }),
|
|
112
|
+
"owned-type-not-presentation": entry("A connector-owned type permits only presentation changes to a later object or edge version. First versions and verbs are refused; the detail names the requested type key and the refused column.", { option: "Keep the type's data fields unchanged and publish only the permitted presentation changes." }),
|
|
83
113
|
"key-under-another-kind": entry("A type key in the change set is already used by a type of another kind.", { option: "Read the change set, choose a different key and revise it.", read: "readChangeSet" }),
|
|
84
114
|
"namespace-not-active": entry("The organisation's types are not active, so nothing can be published to them.", ASK_ADMINISTRATOR),
|
|
85
115
|
"invalid-configuration": entry("The agent is not set up for this request.", ASK_ADMINISTRATOR),
|
|
@@ -89,13 +119,14 @@ var RULE_ENTRIES = {
|
|
|
89
119
|
"plan-superseded": entry("A newer plan replaced this one.", { option: "Read the agent session.", read: "readAgentSession" }),
|
|
90
120
|
"plan-closed": entry("The plan is closed, so it takes no further change.", { option: "Read the agent session.", read: "readAgentSession" }),
|
|
91
121
|
"plan-not-open": entry("The plan is not open.", { option: "Read the agent session.", read: "readAgentSession" }),
|
|
122
|
+
"unknown-role": entry("The role key is unknown to this deployment.", { option: "Choose a role key from roleKeys and send the request again." }),
|
|
92
123
|
"above-caller-role": entry("The request would give a role that is higher than your own, or change one.", ASK_ADMINISTRATOR),
|
|
93
124
|
"last-administrator": entry("The change would leave no administrator.", { option: "Name another administrator first." }),
|
|
94
125
|
"erasure-not-permitted": entry("The erasure is not permitted.", ASK_ADMINISTRATOR),
|
|
95
126
|
"no-such-membership": entry("The membership the request names is not one you may change.", FIX_REQUEST),
|
|
96
127
|
"capability-missing": entry("You do not have the permission this operation needs.", ASK_ADMINISTRATOR),
|
|
97
|
-
"window-out-of-range": entry("
|
|
98
|
-
"max-session-out-of-range": entry("The
|
|
128
|
+
"window-out-of-range": entry("The requested session-refresh window must be from 1 through 60,000 milliseconds.", FIX_REQUEST),
|
|
129
|
+
"max-session-out-of-range": entry("The requested session lifetime must be from 1 through 2,592,000 seconds.", FIX_REQUEST),
|
|
99
130
|
"invalid-email": entry("The email address is not one the platform takes: it must have one @, and no space or non-ASCII character, and be at most 254 characters.", FIX_REQUEST),
|
|
100
131
|
"already-invited": entry("The organisation already has a pending invitation to this address.", { option: "List the pending invitations.", read: "listInvitations" }),
|
|
101
132
|
"no-such-client": entry("The client the request names is not an active client of your organisation.", { option: "List the organisation's clients.", read: "listClients" }),
|
|
@@ -108,6 +139,7 @@ var RULE_ENTRIES = {
|
|
|
108
139
|
"service_identity.revoke": entry("The service account was not revoked: you do not administer it.", ASK_ADMINISTRATOR),
|
|
109
140
|
"duplicate-name": entry("The name is already in use.", { option: "Choose another name." }),
|
|
110
141
|
"unknown-credential": entry("The credential was not accepted.", { option: "Check the credential and send it again, or ask for a new one." }),
|
|
142
|
+
"token-kind-not-admitted": entry("This operation does not take this kind of token. Its reference lists the kinds of token it takes.", { option: "Use a kind of token this operation takes." }),
|
|
111
143
|
secret: entry("The credential was not accepted.", { option: "Check the credential and send it again, or ask for a new one." }),
|
|
112
144
|
kind: entry("The sign-in was refused for this kind of account.", ASK_ADMINISTRATOR),
|
|
113
145
|
lifecycle: entry("The sign-in was refused because of the state of this account.", ASK_ADMINISTRATOR),
|
|
@@ -122,14 +154,15 @@ var RULE_ENTRIES = {
|
|
|
122
154
|
expiry: entry("The sign-in token has expired.", SIGN_IN_AGAIN),
|
|
123
155
|
algorithm: entry("The sign-in token was not accepted.", SIGN_IN_AGAIN),
|
|
124
156
|
claims: entry("The sign-in token was not accepted.", SIGN_IN_AGAIN),
|
|
125
|
-
"malformed-query": entry("The query is not one the platform can run.", FIX_REQUEST),
|
|
157
|
+
"malformed-query": entry("The query is not one the platform can run; the refusal identifies the path of the invalid field.", FIX_REQUEST),
|
|
126
158
|
"view-not-drawable": entry("The published view steps over an edge type that has no parent end, so it places no object under another and cannot be drawn as a tree.", { option: "Ask the type's author to change the view, or to step over an edge type that has a parent end." }),
|
|
127
159
|
"text-search-unavailable": entry("Text search is a filter of kind text, not a search key.", { option: "Send the term as a filter of kind text." }),
|
|
128
160
|
"search-too-wide": entry("The text match names more properties than one query may match.", { option: "Name the object type the match is over." }),
|
|
129
161
|
"invalid-continuation": entry("The paging token is not one the platform issued for this request.", { option: "Start the read again from its first page." }),
|
|
130
162
|
"stale-continuation": entry("The paging token was issued for an earlier state.", { option: "Start the read again from its first page." }),
|
|
131
163
|
"head-moved": entry("The branch changed while the pages were being read.", { option: "Start the read again from its first page." }),
|
|
132
|
-
"
|
|
164
|
+
"cycle-in-reach": entry("A per-path repeat reach returned to an object already in that path's ancestors; the refusal names the readable object.", { option: "Remove the cycle, or use distinct multiplicity, which admits cycles." }),
|
|
165
|
+
"over-bound": entry("The request exceeds a graph, structure, path, or query limit.", FIX_REQUEST),
|
|
133
166
|
"malformed-history-request": entry("The history request is not one the platform can run.", FIX_REQUEST),
|
|
134
167
|
"protected-ref": entry("This branch is protected, so an agent cannot write to it.", { option: "Write to another branch." }),
|
|
135
168
|
immutable: entry("The record's type is immutable, so it cannot be changed or deleted on any branch.", { option: "Leave the record unchanged." }),
|
|
@@ -137,10 +170,11 @@ var RULE_ENTRIES = {
|
|
|
137
170
|
frozen: entry("The record is locked; it cannot be changed until someone allowed to lock records lifts the lock.", { option: "Ask someone allowed to lock records to lift the lock." }),
|
|
138
171
|
protected: entry("A rule protects this record on this branch, so it changes only by a merge from another branch.", { option: "Make the change on another branch and merge it." }),
|
|
139
172
|
"not-a-ref-head": entry("The commit is not the latest commit of a branch you can use.", { option: "Read the branches you can use and choose one." }),
|
|
173
|
+
"stale-source": entry("The source commit is not the current commit on the named branch.", { option: "Read a branch you can use and merge its current commit." }),
|
|
140
174
|
"branch-needs-schema-update": entry("This branch's schema is older than the platform's, so it must be updated before it can be written.", { option: "Request a schema update for the branch." }),
|
|
141
175
|
"organisation-not-ready": entry("The organisation's trunk is not ready yet.", { option: "Try again shortly." }),
|
|
142
176
|
"read-only-ref": entry("The branch is read-only, so nothing can be written or merged into it.", { option: "Choose a writable branch." }),
|
|
143
|
-
"ref-exists": entry("An organisation
|
|
177
|
+
"ref-exists": entry("An organisation branch or baseline of that name already exists.", { option: "List the organisation's branches and baselines.", read: "listOrganisationRefs" }),
|
|
144
178
|
"concurrent-change": entry("Another write changed the record first, so nothing was applied.", { option: "Try again shortly." }),
|
|
145
179
|
"lock-unavailable": entry("The lock could not be taken now, so nothing was applied.", { option: "Try again shortly." }),
|
|
146
180
|
"organisation-not-active": entry("The organisation is not active.", ASK_ADMINISTRATOR),
|
|
@@ -168,8 +202,8 @@ var RULE_ENTRIES = {
|
|
|
168
202
|
"connector-template-missing": entry("This deployment holds no type template for the connector's system.")
|
|
169
203
|
};
|
|
170
204
|
var KIND_ENTRIES = {
|
|
171
|
-
unauthenticated: entry("The request carried no sign-in it can use: none, an invalid or expired one
|
|
172
|
-
"not-found": entry("What the request names does not exist, or you may not reach it; the answer is the same either way.", { option: "Check the identifiers; list what you may read.", read: "listProjects" }),
|
|
205
|
+
unauthenticated: entry("The request carried no sign-in it can use: none, or an invalid or expired one.", { option: "Sign in and send the request again." }),
|
|
206
|
+
"not-found": entry("What the request names does not exist, or you may not reach it; the answer is the same either way.", { option: "Check the identifiers; list what you may read.", read: "listProjects" }, { option: "If the request names a verb, list the verbs available for the object.", read: "discoverVerbs" }),
|
|
173
207
|
"session-moved": entry("Your sign-in is attached to another organisation than the one the token names.", { option: "Sign in again to the organisation your sign-in is attached to." }),
|
|
174
208
|
"not-attached": entry("Your sign-in is attached to no organisation, and this request acts inside one.", { option: "Attach your sign-in to an organisation, then send the request again." }),
|
|
175
209
|
"invalid-request": entry("The request is not in the shape the call takes.", FIX_REQUEST),
|
|
@@ -187,13 +221,15 @@ var CLASS_ENTRIES = {
|
|
|
187
221
|
};
|
|
188
222
|
var API_RULE_ENTRIES = {
|
|
189
223
|
"not-found": KIND_ENTRIES["not-found"],
|
|
224
|
+
"token-kind-not-admitted": RULE_ENTRIES["token-kind-not-admitted"],
|
|
190
225
|
immutable: RULE_ENTRIES.immutable,
|
|
191
226
|
owned: RULE_ENTRIES.owned,
|
|
192
227
|
frozen: RULE_ENTRIES.frozen,
|
|
193
228
|
protected: RULE_ENTRIES.protected,
|
|
194
229
|
"branch-needs-schema-update": RULE_ENTRIES["branch-needs-schema-update"],
|
|
195
230
|
conflict: entry("A property's current value differs from the 'from' value the request expected; the refusal names each such property and its current value.", { option: "Read the current properties, reconcile the changes and send the update again with the from values you now expect." }),
|
|
196
|
-
"unknown-type": entry("The requested type is not a current object or edge type in this namespace.", { option: "Read the current types and use an object or edge type they contain.", read: "readCatalogue" }),
|
|
231
|
+
"unknown-type": entry("The requested type is not a current object or edge type in this namespace.", { option: "Read the current types and use an object or edge type they contain.", read: "readCatalogue" }, { option: "If looking for a verb, list the verbs available for the object.", read: "discoverVerbs" }),
|
|
232
|
+
"unknown-verb": entry("The object has no verb with that name.", { option: "List the verbs available for the object.", read: "discoverVerbs" }),
|
|
197
233
|
"type-version-precondition": entry("The type version the request expected differs from the type's current version.", { option: "Read the type's current version and send the request with that version." }),
|
|
198
234
|
"invalid-properties": entry("The property document failed validation; the violations name each offending path and rule.", { option: "Correct the properties at the paths the violations name and send the request again." }),
|
|
199
235
|
"blocked-by-edge": entry("The object has a link you may not remove, so nothing was deleted.", { option: "Remove that link first, or ask someone who may to remove it." }),
|
|
@@ -239,7 +275,8 @@ var API_REFUSAL_RULES = Object.freeze([
|
|
|
239
275
|
"cross-organisation-edge",
|
|
240
276
|
"project-not-an-endpoint",
|
|
241
277
|
"self-parent",
|
|
242
|
-
"descendant-parent"
|
|
278
|
+
"descendant-parent",
|
|
279
|
+
"token-kind-not-admitted"
|
|
243
280
|
]);
|
|
244
281
|
var SHIM_COLLIDING_API_RULES = Object.freeze(["write-refused"]);
|
|
245
282
|
|
|
@@ -267,13 +304,30 @@ var PROTECTION_ROUTE_CAPABILITIES = Object.freeze({
|
|
|
267
304
|
]),
|
|
268
305
|
readSchemaUpdateRequest: Object.freeze([Object.freeze({ visibility: "requester-in-token-organisation" })])
|
|
269
306
|
});
|
|
270
|
-
var SIGNED_IN = [
|
|
307
|
+
var SIGNED_IN = [
|
|
308
|
+
"unauthenticated",
|
|
309
|
+
"token-kind-not-admitted",
|
|
310
|
+
"invalid-request",
|
|
311
|
+
"bound-exceeded",
|
|
312
|
+
"internal"
|
|
313
|
+
];
|
|
271
314
|
var SCOPED = [...SIGNED_IN, "not-found", "not-permitted"];
|
|
272
315
|
var WRITE = [...SCOPED, "in-flight", "unknown-outcome"];
|
|
273
316
|
var REF_READ = [...SCOPED, "organisation-not-ready", "branch-needs-schema-update"];
|
|
274
317
|
var REF_WRITE = [...REF_READ, "in-flight", "unknown-outcome"];
|
|
318
|
+
var ATTACHMENT_SCOPED = [
|
|
319
|
+
...SIGNED_IN,
|
|
320
|
+
"protocol-mismatch",
|
|
321
|
+
"not-found",
|
|
322
|
+
"not-attached",
|
|
323
|
+
"session-moved",
|
|
324
|
+
"grant-scope"
|
|
325
|
+
];
|
|
275
326
|
var OBJECT_WRITE = [
|
|
276
327
|
...REF_WRITE,
|
|
328
|
+
"unknown-attachment",
|
|
329
|
+
"attachment-precondition",
|
|
330
|
+
"attachment-class-mismatch",
|
|
277
331
|
"immutable",
|
|
278
332
|
"owned",
|
|
279
333
|
"frozen",
|
|
@@ -284,14 +338,15 @@ var OBJECT_WRITE = [
|
|
|
284
338
|
];
|
|
285
339
|
var PUBLIC = ["invalid-request", "bound-exceeded", "internal"];
|
|
286
340
|
var CHANGE_SET = [...SIGNED_IN, "not-permitted", "stale-revision", "not-open"];
|
|
287
|
-
var QUERY_PROJECT_SCOPE = 'Without input.projects, it reads every project the caller can read on the selected
|
|
341
|
+
var QUERY_PROJECT_SCOPE = 'Without input.projects, it reads every project the caller can read on the selected branch or baseline; selector.projectId does not narrow the set. To limit it to one project, include "projects":["<projectId>"] in input.';
|
|
342
|
+
var GRAPH_QUERY_PROJECT_SCOPE = 'Without input.start.projects, it reads every project the caller can read on the selected ref; selector.projectId does not narrow the set. To limit it to some projects, include "projects":["<projectId>"] in input.start.';
|
|
288
343
|
function doc(does, refuses) {
|
|
289
344
|
return Object.freeze({ does, refuses: Object.freeze([...refuses]) });
|
|
290
345
|
}
|
|
291
346
|
var ROUTE_DOCS = Object.freeze({
|
|
292
347
|
createObjectSet: doc("Saves a named set of 1 to 200 object addresses in the caller's organisation. Concurrent retries with one key return the same saved set and revision.", [...SCOPED, "head-moved"]),
|
|
293
348
|
listObjectSets: doc("Lists the organisation's saved sets, newest update first, without members or counts.", SIGNED_IN),
|
|
294
|
-
readObjectSet: doc("Reads a saved set's visible objects on the selected
|
|
349
|
+
readObjectSet: doc("Reads a saved set's visible objects on the selected branch or baseline, a count of missing visible members and one bit for members outside the caller's scope.", [...SCOPED, "head-moved"]),
|
|
295
350
|
updateObjectSet: doc("Renames a saved set or replaces its readable members at the expected revision. Members outside the caller's scope remain. A success raises the revision by one.", [...SCOPED, "stale-revision", "head-moved"]),
|
|
296
351
|
deleteObjectSet: doc("Deletes a saved set and every member at the expected revision.", [...SCOPED, "stale-revision"]),
|
|
297
352
|
health: doc("Answers whether the host is running.", PUBLIC),
|
|
@@ -312,8 +367,10 @@ var ROUTE_DOCS = Object.freeze({
|
|
|
312
367
|
decideConsent: doc("Approves or denies a pending authorization request.", SCOPED),
|
|
313
368
|
listConnectedApps: doc("Lists the applications the caller has connected.", SIGNED_IN),
|
|
314
369
|
revokeConnectedApp: doc("Disconnects an application: every grant the caller holds for it stops.", SCOPED),
|
|
315
|
-
|
|
316
|
-
|
|
370
|
+
stageAttachment: doc("Stages attachment bytes for the selected project and ref without writing an engineering row. Admits user, service, client and run-apply tokens.", [...ATTACHMENT_SCOPED, "unsupported-content", "too-large"]),
|
|
371
|
+
readAttachment: doc("Downloads the attachment held by an object's property at its stored type version. Admits user, service, client, run-explore and run-apply tokens.", [...ATTACHMENT_SCOPED, "organisation-not-ready", "branch-needs-schema-update", "not-an-attachment-property", "no-attachment", "attachment-unavailable"]),
|
|
372
|
+
readObject: doc("Reads one object at a branch or baseline.", REF_READ),
|
|
373
|
+
queryObjects: doc(`Runs a filtered, ordered, paged query over the objects of a branch or baseline, or pages the union, intersection or difference of two plain object-set descriptions on that ref. A top-level type filter {kind:"type",op:"in",values:["part","system"]} selects any of 1 to 100 published type keys and may be combined with a text filter; continuation binds to the entire selection. ${QUERY_PROJECT_SCOPE}`, [
|
|
317
374
|
...REF_READ,
|
|
318
375
|
"malformed-query",
|
|
319
376
|
"over-bound",
|
|
@@ -323,10 +380,11 @@ var ROUTE_DOCS = Object.freeze({
|
|
|
323
380
|
"stale-continuation",
|
|
324
381
|
"head-moved"
|
|
325
382
|
]),
|
|
326
|
-
|
|
383
|
+
queryRows: doc("Answers rows of named cells over a start set and up to three hops, or groups with counts, sums, minimums, maximums and weighted sums. Each hop names edgeTypeKeys as any or 1 through 8 names; optional targetTypeKeys also takes 1 through 8 names. Empty lists are malformed-query; more than 8 names is over-bound. A final hop may repeat to depth 1 through 3, without filters or targetTypeKeys, and answers groups only; a depth above 3 is over-bound, while 0, non-integers and non-numbers are malformed-query. A parent group key may name a repeat alias and uses its own edgeTypeKeys and optional parents filter. Each parent edge contributes a membership; a child with no matching parent forms no group. Parent keys carry address and readable, including readable: false for unreadable parents; hidden reached objects are counted per level including project, never keyed. After a successful walk, parent reads batch 100 children, at most 60 statements per key or 120 for two keys; an overflowing walk runs none. A weighted sum requires a final repeat hop and names 1 through 8 contributing types in over, an edge weight property and per-path or distinct multiplicity; the start never contributes. On an ancestor return, count and per-path sum or weightedSum refuse cycle-in-reach naming the readable object; distinct measures, min and max admit cycles. Repeat answers carry deeper, unvalued and unweighted; missing values and weights are counted separately. Every measure over a path names ends: visible or all. With any all measure, hidden counts appear per hop, on each group when every key names start, and on the answer otherwise; values still measure readable objects. Hidden counts deduplicate far identities including project per hop. countDistinct cannot be combined with sum, min or max. A property group key cannot mix numeric and nonnumeric declarations across its alias types. Distinct-count answers ordered by a measure or filtered by having, and hidden start-group merges, require complete reads: truncation refuses over-bound instead of returning a bounded prefix. " + GRAPH_QUERY_PROJECT_SCOPE, [...REF_READ, "malformed-query", "over-bound", "search-too-wide", "invalid-continuation", "stale-continuation", "head-moved", "cycle-in-reach"]),
|
|
384
|
+
aggregateObjects: doc(`Deprecated: use queryRows for graph aggregates. Runs an aggregate over the objects of a branch or baseline: a count, or a minimum, maximum, sum or average of one numeric property, answered as one value (an average also carries its count), or, with groupBy, a count, sum or average grouped by type or by a property's value, or a count grouped by structural parent, answered as groups. ${QUERY_PROJECT_SCOPE}`, [...REF_READ, "malformed-query", "over-bound", "text-search-unavailable", "search-too-wide"]),
|
|
327
385
|
discoverVerbs: doc("Lists the verbs an object may be given.", REF_READ),
|
|
328
386
|
readHistory: doc("Reads one object's history of changes.", [...REF_READ, "invalid-continuation", "stale-continuation", "malformed-history-request"]),
|
|
329
|
-
mutate: doc('Creates, changes or deletes an object on the selected
|
|
387
|
+
mutate: doc('Creates, changes or deletes an object on the selected writable branch. A protected refusal means the change needs a branch and a merge. For a property update, `from` is the value the caller expects now; a mismatch is refused as `conflict`, and `{"absent": true}` clears the property.', [...OBJECT_WRITE, "plan-closed"]),
|
|
330
388
|
mutateBatch: doc('Applies a list of object and edge operations to a branch in one save, one commit and one audit record, or none of them: a refused operation refuses the whole batch and writes nothing. An edge may name an object created earlier in the same batch. A batch with more operations than the maximum is refused as invalid-request naming input.operations, before any write. For a property update, `from` is the value the caller expects now; a mismatch is refused as `conflict`, and `{"absent": true}` clears the property.', [...OBJECT_WRITE, "plan-closed"]),
|
|
331
389
|
createConnection: doc("Creates a connection to an external source system for the signed-in person: its mirror project and its service identity. The connection commits whether or not its types could be drafted, and the answer says which.", [...SIGNED_IN, "not-permitted", "organisation-not-active", "connection-exists"]),
|
|
332
390
|
listConnections: doc("Lists the connections whose mirror project the caller reads, each with its last run and whether the caller may start a run.", SIGNED_IN),
|
|
@@ -337,10 +395,25 @@ var ROUTE_DOCS = Object.freeze({
|
|
|
337
395
|
startImportRun: doc("Starts a run that imports the connection's source into its mirror project, and answers the run once its row has committed.", [...SCOPED, "import-running", "connection-revoked", "types-not-approved"]),
|
|
338
396
|
listImportRuns: doc("Lists the runs of a connection, newest first, or the one run named.", SCOPED),
|
|
339
397
|
closeImportRun: doc("Ends a running run: the connection's service identity as succeeded or failed, or the person who started it as failed.", [...SCOPED, "run-not-running"]),
|
|
398
|
+
createHostedApp: doc("Creates a hosted app in a project under a key the project has not used.", [...WRITE]),
|
|
399
|
+
publishHostedVersion: doc("Publishes the request body, at most 4 MiB, as the next version of the hosted app the name header keys.", [...WRITE]),
|
|
400
|
+
readHostedBundle: doc("Reads the bundle of the caller's own open launch record.", [...SCOPED]),
|
|
401
|
+
listHostedApps: doc("Lists the hosted apps of a project the caller reads.", [...SCOPED]),
|
|
402
|
+
listHostedVersions: doc("Lists the versions of a hosted app, newest first.", [...SCOPED]),
|
|
403
|
+
revokeHostedApp: doc("Revokes a hosted app, which ends every launch of it at the next call.", [...WRITE]),
|
|
404
|
+
revokeHostedVersion: doc("Revokes one version of a hosted app.", [...WRITE]),
|
|
405
|
+
openHostedApp: doc("Opens the newest live version of the app keyed by appKey in the selected project, derives its runtime and records the caller's launch.", [...WRITE]),
|
|
406
|
+
endHostedLaunch: doc("Ends the caller's own open launch record.", [...WRITE]),
|
|
407
|
+
mintHostedAppToken: doc("Mints the short-lived token a hosted app presents, from a user token and the caller's own open launch record.", [...SCOPED]),
|
|
408
|
+
setHostedOneWallSwitch: doc("Turns the organisation's one-wall switch on or off. Turning it off withdraws every one-wall permission.", [...WRITE]),
|
|
409
|
+
readHostedOneWallSwitch: doc("Reads the organisation's one-wall switch.", [...SCOPED]),
|
|
410
|
+
grantHostedOneWall: doc("Grants one app the one-wall permission while the organisation's switch is on.", [...WRITE]),
|
|
411
|
+
withdrawHostedOneWall: doc("Withdraws one app's one-wall permission.", [...WRITE]),
|
|
412
|
+
listHostedOneWallGrants: doc("Lists the organisation's one-wall permissions.", [...SCOPED]),
|
|
340
413
|
previewDelete: doc("Previews deleting an object: the links the delete would remove, or the refusal it would meet. Changes nothing.", [...OBJECT_WRITE, "plan-closed"]),
|
|
341
414
|
recover: doc("Finds what an interrupted mutation did and finishes its record.", REF_READ),
|
|
342
415
|
executeVerb: doc("Runs a verb on an object and records its result.", [...OBJECT_WRITE, "plan-closed"]),
|
|
343
|
-
createBranch: doc("Creates a branch from a
|
|
416
|
+
createBranch: doc("Creates a project branch from a branch, a baseline or an admitted current head.", [
|
|
344
417
|
...REF_WRITE,
|
|
345
418
|
"plan-closed",
|
|
346
419
|
"ref-exists",
|
|
@@ -349,15 +422,11 @@ var ROUTE_DOCS = Object.freeze({
|
|
|
349
422
|
"lock-unavailable",
|
|
350
423
|
"not-a-ref-head"
|
|
351
424
|
]),
|
|
352
|
-
merge: doc("Merges a reviewed head of a project branch or an organisation
|
|
353
|
-
readMergeConflicts: doc("Reads the
|
|
354
|
-
disposeRef: doc("Disposes a branch that is no longer wanted.", [
|
|
355
|
-
...WRITE,
|
|
356
|
-
"concurrent-change",
|
|
357
|
-
"lock-unavailable"
|
|
358
|
-
]),
|
|
425
|
+
merge: doc("Merges a reviewed head of a project branch or an organisation branch or baseline source into main, or into the writable branch the optional target names; absent target means main. For a proposal, send its reviewedHash as sourceHash. A successful merge into main completes every pending proposal in the project that reviewed that hash. Optional name is checked against the source branch's bound head and is refused stale-source when it differs.", [...REF_WRITE, "read-only-ref", "concurrent-change", "lock-unavailable", "not-a-ref-head", "stale-source"]),
|
|
426
|
+
readMergeConflicts: doc("Reads conflicts for the source branch named in input.name, always comparing it with main. For each field, base is the common value before either side changed it, ours is main, and theirs is the source branch. If the merge targeted another branch, this read still compares with main and does not report that merge's conflicts.", REF_READ),
|
|
427
|
+
disposeRef: doc("Disposes a branch that is no longer wanted: a writer of the branch when no proposal on it is pending, otherwise a merger of the project.", [...WRITE, "concurrent-change", "lock-unavailable"]),
|
|
359
428
|
listProjects: doc("Lists every project the caller may read in the organisation the session is attached to, with its namespace.", SIGNED_IN),
|
|
360
|
-
listRefs: doc("Lists the
|
|
429
|
+
listRefs: doc("Lists the branches of a project, each with its head: readable with a hash, withheld when the caller may not read the branch, or unread past the first 50 branches. Each row also carries a schema state as a convenience hint; the branch-needs-schema-update refusal on use remains the guard.", [...SCOPED, "organisation-not-ready"]),
|
|
361
430
|
readCatalogue: doc("Reads the published catalogue of a project's namespace.", SCOPED),
|
|
362
431
|
readPendingProposal: doc("Reads the proposal waiting for review on a branch, if any.", SCOPED),
|
|
363
432
|
submitProposal: doc("Submits a branch for review.", [...REF_READ, "proposal-open", "no-commits"]),
|
|
@@ -365,23 +434,34 @@ var ROUTE_DOCS = Object.freeze({
|
|
|
365
434
|
revokeServiceIdentity: doc("Revokes a service identity.", [...SIGNED_IN, "not-permitted", "service_identity.revoke"]),
|
|
366
435
|
issueServiceCredential: doc("Issues a credential for a service identity.", [...SIGNED_IN, "not-permitted", "capability-missing"]),
|
|
367
436
|
revokeServiceCredential: doc("Revokes a service identity's credential.", [...SIGNED_IN, "not-permitted", "capability-missing"]),
|
|
368
|
-
grantMembership: doc("Grants a principal a role in a scope.", [...SIGNED_IN, "not-permitted", "above-caller-role", "membership-exists", "no-such-principal"]),
|
|
437
|
+
grantMembership: doc("Grants a principal a role in a scope. An unknown role answers unknown-role with the deployment's roleKeys.", [...SIGNED_IN, "not-permitted", "above-caller-role", "unknown-role", "membership-exists", "no-such-principal"]),
|
|
369
438
|
revokeMembership: doc("Revokes a principal's membership of a scope; at organisation scope, also revokes their memberships in its projects.", [...SIGNED_IN, "not-permitted", "last-administrator", "no-such-membership", "erasure-not-permitted"]),
|
|
370
439
|
setModelConfiguration: doc("Sets the model configuration an organisation's agents use.", [...SIGNED_IN, "not-permitted", "capability-missing", "window-out-of-range", "max-session-out-of-range"]),
|
|
440
|
+
setModelId: doc("Changes the model an organisation's agents use, keeping the key it holds, for a caller who administers agents.", [...SIGNED_IN, "not-permitted", "model-not-configured"]),
|
|
441
|
+
readModelConfigurationStatus: doc("Reads whether the caller's organisation has a model configured, and its provider, model and the time it was set, for a caller who administers agents. The key is never answered.", [...SIGNED_IN, "not-permitted"]),
|
|
442
|
+
readAccount: doc("Reads the caller's own principal identifier, display name and registered email.", SIGNED_IN),
|
|
371
443
|
readDisplayNames: doc("Reads the display names of principals the caller may see.", SIGNED_IN),
|
|
372
444
|
listMembers: doc("Lists the members of a project.", SCOPED),
|
|
373
|
-
changeMembershipRole: doc("Changes a principal's role in a scope.", [...SIGNED_IN, "not-permitted", "above-caller-role", "last-administrator", "no-such-membership"]),
|
|
445
|
+
changeMembershipRole: doc("Changes a principal's role in a scope.", [...SIGNED_IN, "not-permitted", "above-caller-role", "unknown-role", "last-administrator", "no-such-membership"]),
|
|
374
446
|
listOrganisationMembers: doc("Lists the memberships of the caller's organisation and of the projects of it the caller may read.", SCOPED),
|
|
375
447
|
searchPeople: doc("Finds the people of the caller's organisation whose name has a word starting with the query.", [...SIGNED_IN, "invalid-query"]),
|
|
376
|
-
searchObjectReaders: doc("Finds the people who can read an object on a
|
|
448
|
+
searchObjectReaders: doc("Finds the people who can read an object on a branch or baseline, by a name prefix.", [...REF_READ, "invalid-query", "invalid-ref"]),
|
|
377
449
|
listSubscribers: doc("Lists the subscriptions on an object.", REF_READ),
|
|
378
450
|
addSubscriber: doc("Adds a person to an object's subscriptions as owner, approver or watcher, when the type's `subscriptionRoles` admits that role. The declaration may set maxima; owner is limited to one. With no declaration, only watchers are admitted.", [...REF_READ, "limit-reached", "role-not-admitted", "unknown-person", "not-permitted", "invalid-ref"]),
|
|
379
451
|
removeSubscriber: doc("Removes a person's subscription to an object in a role.", [...REF_READ, "subscription-absent", "not-permitted", "invalid-ref"]),
|
|
380
452
|
listComments: doc("Lists the comments on an object, oldest first, a page at a time.", [...REF_READ, "invalid-query"]),
|
|
381
453
|
addComment: doc("Adds a comment to an object, naming the people it mentions.", [...REF_WRITE, "invalid-body", "invalid-mention", "unknown-person", "invalid-ref"]),
|
|
382
454
|
listServiceIdentities: doc("Lists the service identities of the caller's organisation, for a caller who administers them.", SCOPED),
|
|
383
|
-
createInvitation: doc("Invites an
|
|
384
|
-
|
|
455
|
+
createInvitation: doc("Invites an address in an organisation role with up to 50 optional projectRoles, each a projectId and roleKey. Every project must belong to the invitation's organisation. The caller must administer members there and on each project. An unknown role answers unknown-role with the deployment's roleKeys; a known role above the caller's answers above-caller-role.", [
|
|
456
|
+
...SIGNED_IN,
|
|
457
|
+
"capability-missing",
|
|
458
|
+
"above-caller-role",
|
|
459
|
+
"unknown-role",
|
|
460
|
+
"invalid-email",
|
|
461
|
+
"already-invited",
|
|
462
|
+
"domain-not-allowed"
|
|
463
|
+
]),
|
|
464
|
+
listInvitations: doc("Lists pending invitations of the caller's organisation, including each invitation's projectRoles, for a caller who administers its members.", [...SIGNED_IN, "capability-missing"]),
|
|
385
465
|
revokeInvitation: doc("Revokes a pending invitation of the caller's organisation, for a caller who administers its members.", [...SIGNED_IN, "capability-missing", "no-such-invitation", "invitation-not-pending"]),
|
|
386
466
|
readInvitationDomainRule: doc("Reads the domains the caller's organisation invites from, for an owner.", [...SIGNED_IN, "capability-missing"]),
|
|
387
467
|
setInvitationDomainRule: doc("Replaces the domains the caller's organisation invites from, for an owner.", [...SIGNED_IN, "capability-missing", "invalid-domain"]),
|
|
@@ -392,8 +472,8 @@ var ROUTE_DOCS = Object.freeze({
|
|
|
392
472
|
reissuePlatformInvitation: doc("Replaces the code and the expiry of a pending platform invitation and answers the new link, for a platform administrator.", [...SIGNED_IN, "capability-missing", "no-such-invitation", "invitation-not-pending"]),
|
|
393
473
|
readWebOrigin: doc("Reads the origin of the deployment's web application, or null when the host is given none.", SIGNED_IN),
|
|
394
474
|
readCallerCapabilities: doc("Lists the capabilities the caller holds in the token's organisation and its projects, and the platform capability for a platform administrator.", [...SIGNED_IN]),
|
|
395
|
-
queryGraph: doc(`Walks the edges from a start of addresses or an object set, and answers the objects reached with every hop among them.
|
|
396
|
-
readStructure: doc("Reads the structure of a type's objects as a tree: every root, one object's subtree or one object's ancestors, each placement an occurrence. A chosen relationship or one-step view places the type itself, and the types above it follow their own declared relationships.", [
|
|
475
|
+
queryGraph: doc(`Walks the edges from a start of addresses or an object set, and answers the objects reached with every hop among them. Example: one start address and one hop step of depth 1 reads that object's connections, with a marker for each kind of connection whose far object the caller cannot read. A start takes at most 200 addresses or set members; a walk takes at most 3 steps and 3 total levels. An explicit edgeTypeKeys list holds at most 8 edge types per step; when edgeTypeKeys is absent, the step traverses every edge type. objectLimit is at most 200 and hopLimit at most 400. A continuation reads the next page in the one-object form. For an object-set start, omitting input.start.set.projects reads every project the caller can read on the selected branch or baseline; selector.projectId does not narrow the set. To limit it to one project, include "projects":["<projectId>"] in input.start.set.`, [...REF_READ, "malformed-query", "over-bound", "text-search-unavailable", "search-too-wide", "invalid-continuation", "stale-continuation", "head-moved"]),
|
|
476
|
+
readStructure: doc("Reads the structure of a type's objects as a tree: every root, one object's subtree or one object's ancestors, each placement an occurrence. Example: a forest anchor with maxDepth 1 reads its roots and their children. maxDepth is at most 32 and occurrenceLimit at most 2000. The answer reports whether it is complete or bounded, and a bounded answer says whether the limit was occurrences, depth or level rows; the route does not page. Narrow the walk with maxDepth and occurrenceLimit. A chosen relationship or one-step view places the type itself, and the types above it follow their own declared relationships.", [
|
|
397
477
|
...REF_READ,
|
|
398
478
|
"malformed-query",
|
|
399
479
|
"view-not-drawable",
|
|
@@ -404,31 +484,35 @@ var ROUTE_DOCS = Object.freeze({
|
|
|
404
484
|
listProposals: doc("Lists the proposals of a project.", SCOPED),
|
|
405
485
|
readProposal: doc("Reads one proposal.", SCOPED),
|
|
406
486
|
refuseProposal: doc("Refuses a proposal and returns its branch to its author.", [...SCOPED, "proposal-not-pending"]),
|
|
407
|
-
readBranchDiff: doc("Reads
|
|
408
|
-
|
|
487
|
+
readBranchDiff: doc("Reads the objects and edges a proposal's branch changes against its target.", REF_READ),
|
|
488
|
+
readLinkStatus: doc("Reads an object's tracked links at a stable head: review (cleared, suspect, unreviewed, not-visible or too-many-links), clearing attribution, link bounds and aggregate bounds with units and coverage. Only a readable upstream supplies its opaque upstreamVersion, the precondition for clearing.", [...REF_READ, "head-moved"]),
|
|
489
|
+
clearLinks: doc("Clears 1 to 100 links atomically on the named ref. Send each linkId with the upstreamVersion from readLinkStatus as a precondition; upstream-changed requires a fresh read and review. Records the clearer and time without changing bounds. Admits user, run-apply, client and service; run-explore and run-types are refused at admission. An unknown outcome must be recovered by correlation before retrying.", [...OBJECT_WRITE, "upstream-changed", "upstream-not-readable", "too-many-links"]),
|
|
490
|
+
readChangeImpact: doc("Reads review, link bounds and aggregate bounds state changes against the branch's merge base, plus downstream reach to depth three and hidden counts. Both ref and base are required. Includes added and removed states and pins both heads; over-bound and head-moved refuse the entire read without a partial answer.", [...REF_READ, "over-bound", "head-moved"]),
|
|
491
|
+
diffBranches: doc("Reads the objects and edges one branch or baseline changes against another.", REF_READ),
|
|
409
492
|
readBranchHistory: doc("Reads a branch's history of commits.", [...SCOPED, "invalid-continuation", "stale-continuation", "malformed-history-request"]),
|
|
410
493
|
listAudit: doc("Lists the audit records of a project.", [...SCOPED, "invalid-continuation"]),
|
|
411
|
-
|
|
494
|
+
listOrganisationAudit: doc("Lists the organisation-level actions the caller may read.", [...SCOPED, "invalid-continuation"]),
|
|
495
|
+
readRefHead: doc("Reads the head of a branch or baseline.", REF_READ),
|
|
412
496
|
inspectBranchOperation: doc("Reads the state of a branch operation the caller started.", SCOPED),
|
|
413
497
|
abandonBranch: doc("Refuses branch abandonment because this operation is not available in this release.", [
|
|
414
498
|
...WRITE,
|
|
415
499
|
"not-in-this-release"
|
|
416
500
|
]),
|
|
417
|
-
addRefRule: doc("Adds a
|
|
418
|
-
listRefRules: doc("Lists only the selected project's visible
|
|
501
|
+
addRefRule: doc("Adds a branch protection rule to the selected project and answers the full rule. Repeating the same pattern and consequence returns the existing rule, ignoring pattern letter case. Consequences are merge-only and locked-rows-only; an invalid pattern or consequence answers invalid-request naming that field.", SCOPED),
|
|
502
|
+
listRefRules: doc("Lists only the selected project's visible branch protection rules, including each rule's identifier, pattern and consequence.", SCOPED),
|
|
419
503
|
removeRefRule: doc("Removes a rule by identifier from the selected project and answers its ruleId. An absent or unreadable identifier, or one belonging to another project, answers not-found.", SCOPED),
|
|
420
|
-
addOrganisationRule: doc("Adds a
|
|
421
|
-
listOrganisationRules: doc("Lists the attached organisation's visible
|
|
504
|
+
addOrganisationRule: doc("Adds a branch protection rule in the attached organisation and answers the full rule. Repeating the same pattern and consequence returns the existing rule, ignoring pattern letter case. An invalid pattern or consequence answers invalid-request naming that field.", SCOPED),
|
|
505
|
+
listOrganisationRules: doc("Lists the attached organisation's visible branch rules, including identifier, pattern and consequence.", SCOPED),
|
|
422
506
|
removeOrganisationRule: doc("Removes a rule by identifier from the attached organisation and answers its ruleId. An absent, unreadable or project-rule identifier answers not-found.", SCOPED),
|
|
423
|
-
createOrganisationRef: doc("Creates a
|
|
424
|
-
listOrganisationRefs: doc("Lists visible
|
|
425
|
-
deleteOrganisationRef: doc("Deletes a writable
|
|
426
|
-
markOrganisationRefReadOnly: doc("Marks
|
|
427
|
-
setObjectLock: doc("Sets an object's lock on the selected project
|
|
507
|
+
createOrganisationRef: doc("Creates a branch or baseline at the organisation's trunk head and answers its name, readOnly and creation attribution. The optional readOnly flag defaults to false; the name is one non-reserved name segment.", [...WRITE, "ref-exists", "read-only-ref", "organisation-not-ready"]),
|
|
508
|
+
listOrganisationRefs: doc("Lists visible branches and baselines in the attached organisation, including each name, readOnly and creation attribution.", SCOPED),
|
|
509
|
+
deleteOrganisationRef: doc("Deletes a writable branch from the attached organisation and answers its name. A baseline cannot be deleted.", [...REF_WRITE, "read-only-ref"]),
|
|
510
|
+
markOrganisationRefReadOnly: doc("Marks an organisation branch read-only as a baseline and answers its full record. An absent or unreadable name answers not-found.", SCOPED),
|
|
511
|
+
setObjectLock: doc("Sets an object's lock on the selected project branch to none, merge-only or frozen and answers objectId and lock. The lock also applies to its existing structural child edges in that project; none lifts the lock. New children on a writable branch are not thereby frozen. Use a baseline for a fixed snapshot. An unknown lock answers invalid-request at lock.", [...REF_WRITE, "read-only-ref", "concurrent-change", "lock-unavailable"]),
|
|
428
512
|
readAgentCeiling: doc("Reads the selected project's maximum agent role as { ceiling }: contributor or maintainer. An absent or unreadable project answers not-found.", SCOPED),
|
|
429
513
|
setAgentCeiling: doc("Sets the selected project's maximum agent role to contributor or maintainer and answers { ceiling }. An unknown role answers invalid-request at ceiling.", SCOPED),
|
|
430
|
-
requestSchemaUpdate: doc("Records a schema update request for a project branch or organisation
|
|
431
|
-
readSchemaUpdateRequest: doc("Reads the caller's latest schema update request for the
|
|
514
|
+
requestSchemaUpdate: doc("Records a schema update request for a project branch or organisation branch or baseline and answers its state and attribution. Execution is separate. A branch whose name contains a slash cannot request a schema update today. The trunk main answers invalid-request at `ref`; an unreachable branch or baseline answers not-found.", SCOPED),
|
|
515
|
+
readSchemaUpdateRequest: doc("Reads the caller's latest schema update request for the branch or baseline in the token's organisation, or null. Project read access is not required. A branch whose name contains a slash cannot read its request today. The trunk main answers invalid-request at `ref`.", SCOPED),
|
|
432
516
|
openAgentSession: doc("Opens an agent session on a project.", [...SCOPED, "invalid-configuration"]),
|
|
433
517
|
listAgentSessions: doc("Lists the caller's agent sessions on a project.", SCOPED),
|
|
434
518
|
readAgentSession: doc("Reads one agent session and its runs.", SCOPED),
|
|
@@ -454,6 +538,7 @@ var ROUTE_DOCS = Object.freeze({
|
|
|
454
538
|
"invalid-catalogue",
|
|
455
539
|
"version-conflict",
|
|
456
540
|
"key-under-another-kind",
|
|
541
|
+
"owned-type-not-presentation",
|
|
457
542
|
"namespace-not-active"
|
|
458
543
|
]),
|
|
459
544
|
readApp: doc("Reads a published version of an app, the latest where none is named, with the app's history of versions.", [...SIGNED_IN, "not-found"]),
|
|
@@ -476,6 +561,30 @@ function deepFreeze(value) {
|
|
|
476
561
|
}
|
|
477
562
|
return value;
|
|
478
563
|
}
|
|
564
|
+
var BINARY_REQUESTS = {
|
|
565
|
+
stageAttachment: {
|
|
566
|
+
"contentType": "application/octet-stream",
|
|
567
|
+
"selectorHeader": "x-oe2-selector",
|
|
568
|
+
"selectorEncoding": "json",
|
|
569
|
+
"nameHeader": "x-oe2-attachment-name",
|
|
570
|
+
"nameEncoding": "rfc8187"
|
|
571
|
+
},
|
|
572
|
+
publishHostedVersion: {
|
|
573
|
+
"contentType": "application/octet-stream",
|
|
574
|
+
"selectorHeader": "x-oe2-selector",
|
|
575
|
+
"selectorEncoding": "json",
|
|
576
|
+
"nameHeader": "x-oe2-attachment-name",
|
|
577
|
+
"nameEncoding": "rfc8187"
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
var BINARY_REQUEST_INPUTS = deepFreeze(BINARY_REQUESTS);
|
|
581
|
+
var BINARY_RESPONSES = {
|
|
582
|
+
readAttachment: {
|
|
583
|
+
"contentType": "attachment",
|
|
584
|
+
"headers": "attachmentResponseHeaders"
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
var BINARY_RESPONSE_OUTPUTS = deepFreeze(BINARY_RESPONSES);
|
|
479
588
|
var SCHEMAS = {
|
|
480
589
|
createObjectSet: { "type": "object", "properties": { "name": { "type": "string" }, "members": { "type": "array", "items": { "type": "object", "properties": { "objectId": { "type": "string" }, "projectId": { "type": "string" } }, "required": ["objectId", "projectId"], "additionalProperties": false } } }, "required": ["name", "members"], "additionalProperties": false },
|
|
481
590
|
listObjectSets: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
@@ -500,9 +609,26 @@ var SCHEMAS = {
|
|
|
500
609
|
decideConsent: { "oneOf": [{ "type": "object", "properties": { "interactionId": { "type": "string" }, "decision": { "const": "approve" }, "approvedScopes": { "type": "array", "items": { "enum": ["objects.read", "objects.write", "branches.read", "branches.write", "branches.manage", "offline_access"] } } }, "required": ["interactionId", "decision", "approvedScopes"], "additionalProperties": false }, { "type": "object", "properties": { "interactionId": { "type": "string" }, "decision": { "const": "deny" } }, "required": ["interactionId", "decision"], "additionalProperties": false }] },
|
|
501
610
|
listConnectedApps: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
502
611
|
revokeConnectedApp: { "type": "object", "properties": { "clientId": { "type": "string" } }, "required": ["clientId"], "additionalProperties": false },
|
|
612
|
+
readAttachment: {
|
|
613
|
+
"type": "object",
|
|
614
|
+
"properties": {
|
|
615
|
+
"objectId": {
|
|
616
|
+
"type": "string"
|
|
617
|
+
},
|
|
618
|
+
"property": {
|
|
619
|
+
"type": "string"
|
|
620
|
+
}
|
|
621
|
+
},
|
|
622
|
+
"required": [
|
|
623
|
+
"objectId",
|
|
624
|
+
"property"
|
|
625
|
+
],
|
|
626
|
+
"additionalProperties": false
|
|
627
|
+
},
|
|
503
628
|
readObject: { "type": "object", "properties": { "objectId": { "type": "string" } }, "required": ["objectId"], "additionalProperties": false },
|
|
504
|
-
queryObjects: { "type": "object", "properties": { "kind": { "const": "objects" }, "typeKey": { "oneOf": [{ "type": "string" }, { "type": "null" }] }, "projects": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }] } }, "steps": { "type": "array", "items": { "type": "object", "properties": { "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "targetTypeKey": { "type": "string" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }] } } }, "required": ["edgeTypeKey", "direction", "targetTypeKey"], "additionalProperties": false } }, "sort": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "property", "direction"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "direction"], "additionalProperties": false }] }, "limit": { "type": "number" }, "continuation": { "oneOf": [{ "type": "string" }, { "type": "null" }] } }, "required": ["kind", "typeKey", "limit", "continuation"], "additionalProperties": false },
|
|
505
|
-
aggregateObjects: { "type": "object", "properties": { "kind": { "const": "aggregate" }, "typeKey": { "oneOf": [{ "type": "string" }, { "type": "null" }] }, "projects": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }] } }, "steps": { "type": "array", "items": { "type": "object", "properties": { "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "targetTypeKey": { "type": "string" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }] } } }, "required": ["edgeTypeKey", "direction", "targetTypeKey"], "additionalProperties": false } }, "operation": { "enum": ["count", "min", "max", "sum"] }, "property": { "type": "string" }, "groupBy": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "type" } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" } }, "required": ["kind", "property"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "parent" }, "edgeTypeKeys": { "type": "array", "items": { "type": "string" } }, "multiplicity": { "enum": ["per-path", "distinct"] }, "ends": { "enum": ["visible", "all"] }, "parents": { "type": "array", "items": { "type": "object", "properties": { "objectId": { "type": "string" }, "projectId": { "type": "string" } }, "required": ["objectId", "projectId"], "additionalProperties": false } } }, "required": ["kind", "edgeTypeKeys", "multiplicity", "ends"], "additionalProperties": false }] } }, "required": ["kind", "typeKey", "operation"], "additionalProperties": false },
|
|
629
|
+
queryObjects: { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "objects" }, "typeKey": { "oneOf": [{ "type": "string" }, { "type": "null" }] }, "projects": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "type" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }] } }, "steps": { "type": "array", "items": { "type": "object", "properties": { "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "targetTypeKey": { "type": "string" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "type" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }] } } }, "required": ["edgeTypeKey", "direction", "targetTypeKey"], "additionalProperties": false } }, "sort": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "property", "direction"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "direction"], "additionalProperties": false }] }, "limit": { "type": "number" }, "continuation": { "oneOf": [{ "type": "string" }, { "type": "null" }] } }, "required": ["kind", "typeKey", "limit", "continuation"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "set" }, "op": { "enum": ["union", "intersection", "difference"] }, "left": { "type": "object", "properties": { "kind": { "const": "objects" }, "typeKey": { "oneOf": [{ "type": "string" }, { "type": "null" }] }, "projects": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "type" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }] } }, "steps": { "type": "array", "items": { "type": "object", "properties": { "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "targetTypeKey": { "type": "string" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "type" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }] } } }, "required": ["edgeTypeKey", "direction", "targetTypeKey"], "additionalProperties": false } }, "sort": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "property", "direction"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "direction"], "additionalProperties": false }] } }, "required": ["kind", "typeKey"], "additionalProperties": false }, "right": { "type": "object", "properties": { "kind": { "const": "objects" }, "typeKey": { "oneOf": [{ "type": "string" }, { "type": "null" }] }, "projects": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "type" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }] } }, "steps": { "type": "array", "items": { "type": "object", "properties": { "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "targetTypeKey": { "type": "string" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "type" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }] } } }, "required": ["edgeTypeKey", "direction", "targetTypeKey"], "additionalProperties": false } }, "sort": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "property", "direction"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "direction"], "additionalProperties": false }] } }, "required": ["kind", "typeKey"], "additionalProperties": false }, "limit": { "type": "number" }, "continuation": { "oneOf": [{ "type": "string" }, { "type": "null" }] } }, "required": ["kind", "op", "left", "right", "limit", "continuation"], "additionalProperties": false }] },
|
|
630
|
+
queryRows: { "type": "object", "properties": { "kind": { "const": "graph-query" }, "start": { "type": "object", "properties": { "typeKey": { "oneOf": [{ "type": "string" }, { "type": "null" }] }, "projects": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "type" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }] } } }, "required": ["typeKey"], "additionalProperties": false }, "path": { "type": "array", "items": { "type": "object", "properties": { "alias": { "type": "string" }, "edgeTypeKeys": { "oneOf": [{ "const": "any" }, { "type": "array", "items": { "type": "string" } }] }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "targetTypeKeys": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "type" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }] } }, "repeat": { "type": "object", "properties": { "depth": { "type": "number" } }, "required": ["depth"], "additionalProperties": false } }, "required": ["alias", "edgeTypeKeys", "direction"], "additionalProperties": false } }, "answer": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "rows" }, "columns": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "enum": ["identity", "typeKey"] }, "alias": { "type": "string" } }, "required": ["kind", "alias"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "alias": { "type": "string" }, "property": { "type": "string" } }, "required": ["kind", "alias", "property"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "alias": { "type": "string" }, "field": { "enum": ["identity", "typeKey"] } }, "required": ["kind", "alias", "field"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge-property" }, "alias": { "type": "string" }, "property": { "type": "string" } }, "required": ["kind", "alias", "property"], "additionalProperties": false }] } }, "order": { "type": "object", "properties": { "alias": { "type": "string" }, "property": { "type": "string" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["alias", "property", "direction"], "additionalProperties": false }, "limit": { "type": "number" }, "continuation": { "oneOf": [{ "type": "string" }, { "type": "null" }] } }, "required": ["kind", "columns", "limit", "continuation"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "groups" }, "keys": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "enum": ["identity", "typeKey"] }, "alias": { "type": "string" } }, "required": ["kind", "alias"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "alias": { "type": "string" }, "property": { "type": "string" } }, "required": ["kind", "alias", "property"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "parent" }, "alias": { "type": "string" }, "edgeTypeKeys": { "type": "array", "items": { "type": "string" } }, "parents": { "type": "array", "items": { "type": "object", "properties": { "objectId": { "type": "string" }, "projectId": { "type": "string" } }, "required": ["objectId", "projectId"], "additionalProperties": false } } }, "required": ["kind", "alias", "edgeTypeKeys"], "additionalProperties": false }] } }, "measures": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "count" }, "over": { "type": "array", "items": { "type": "string" } }, "ends": { "enum": ["visible", "all"] } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "countDistinct" }, "alias": { "type": "string" }, "over": { "type": "array", "items": { "type": "string" } }, "ends": { "enum": ["visible", "all"] } }, "required": ["kind", "alias"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "sum" }, "alias": { "type": "string" }, "property": { "type": "string" }, "over": { "type": "array", "items": { "type": "string" } }, "multiplicity": { "enum": ["per-path", "distinct"] }, "ends": { "enum": ["visible", "all"] } }, "required": ["kind", "alias", "property"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "enum": ["min", "max"] }, "alias": { "type": "string" }, "property": { "type": "string" }, "over": { "type": "array", "items": { "type": "string" } }, "ends": { "enum": ["visible", "all"] } }, "required": ["kind", "alias", "property"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "weightedSum" }, "alias": { "type": "string" }, "property": { "type": "string" }, "weight": { "type": "string" }, "over": { "type": "array", "items": { "type": "string" } }, "multiplicity": { "enum": ["per-path", "distinct"] }, "ends": { "enum": ["visible", "all"] } }, "required": ["kind", "alias", "weight", "over", "multiplicity", "ends"], "additionalProperties": false }] } }, "having": { "type": "array", "items": { "type": "object", "properties": { "measure": { "type": "number" }, "op": { "enum": ["=", ">", ">=", "<", "<="] }, "value": { "type": "number" } }, "required": ["measure", "op", "value"], "additionalProperties": false } }, "order": { "type": "object", "properties": { "by": { "enum": ["key", "measure"] }, "index": { "type": "number" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["by", "index", "direction"], "additionalProperties": false }, "limit": { "type": "number" } }, "required": ["kind", "keys", "measures"], "additionalProperties": false }] } }, "required": ["kind", "start", "answer"], "additionalProperties": false },
|
|
631
|
+
aggregateObjects: { "type": "object", "properties": { "kind": { "const": "aggregate" }, "typeKey": { "oneOf": [{ "type": "string" }, { "type": "null" }] }, "projects": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "type" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }] } }, "steps": { "type": "array", "items": { "type": "object", "properties": { "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "targetTypeKey": { "type": "string" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "type" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }] } } }, "required": ["edgeTypeKey", "direction", "targetTypeKey"], "additionalProperties": false } }, "operation": { "enum": ["count", "min", "max", "sum", "average"] }, "property": { "type": "string" }, "groupBy": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "type" } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" } }, "required": ["kind", "property"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "parent" }, "edgeTypeKeys": { "type": "array", "items": { "type": "string" } }, "multiplicity": { "enum": ["per-path", "distinct"] }, "ends": { "enum": ["visible", "all"] }, "parents": { "type": "array", "items": { "type": "object", "properties": { "objectId": { "type": "string" }, "projectId": { "type": "string" } }, "required": ["objectId", "projectId"], "additionalProperties": false } } }, "required": ["kind", "edgeTypeKeys", "multiplicity", "ends"], "additionalProperties": false }] } }, "required": ["kind", "typeKey", "operation"], "additionalProperties": false },
|
|
506
632
|
discoverVerbs: { "type": "object", "properties": { "objectId": { "type": "string" } }, "required": ["objectId"], "additionalProperties": false },
|
|
507
633
|
readHistory: { "type": "object", "properties": { "objectId": { "type": "string" }, "limit": { "type": "number" }, "continuation": { "oneOf": [{ "type": "string" }, { "type": "null" }] } }, "required": ["objectId", "limit", "continuation"], "additionalProperties": false },
|
|
508
634
|
mutate: { "type": "object", "properties": { "correlation": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "mint" } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "sent" }, "correlationId": { "type": "string" } }, "required": ["kind", "correlationId"], "additionalProperties": false }] }, "operation": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "create-object" }, "typeKey": { "type": "string" }, "typeVersion": { "type": "number" }, "properties": { "type": "object", "additionalProperties": {} } }, "required": ["kind", "typeKey", "typeVersion", "properties"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "update-object" }, "objectId": { "type": "string" }, "typeVersion": { "type": "number" }, "changes": { "type": "object", "additionalProperties": { "type": "object", "properties": { "from": { "oneOf": [{ "type": "object", "properties": { "absent": { "const": true } }, "required": ["absent"], "additionalProperties": false }, { "type": "object", "properties": { "value": {} }, "required": ["value"], "additionalProperties": false }] }, "to": { "oneOf": [{ "type": "object", "properties": { "absent": { "const": true } }, "required": ["absent"], "additionalProperties": false }, { "type": "object", "properties": { "value": {} }, "required": ["value"], "additionalProperties": false }] } }, "required": ["from", "to"], "additionalProperties": false } } }, "required": ["kind", "objectId", "typeVersion", "changes"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "delete-object" }, "objectId": { "type": "string" } }, "required": ["kind", "objectId"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "create-edge" }, "typeKey": { "type": "string" }, "typeVersion": { "type": "number" }, "sourceObjectId": { "type": "string" }, "targetObjectId": { "type": "string" }, "properties": { "type": "object", "additionalProperties": {} } }, "required": ["kind", "typeKey", "typeVersion", "sourceObjectId", "targetObjectId", "properties"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "update-edge" }, "edgeId": { "type": "string" }, "typeVersion": { "type": "number" }, "changes": { "type": "object", "additionalProperties": { "type": "object", "properties": { "from": { "oneOf": [{ "type": "object", "properties": { "absent": { "const": true } }, "required": ["absent"], "additionalProperties": false }, { "type": "object", "properties": { "value": {} }, "required": ["value"], "additionalProperties": false }] }, "to": { "oneOf": [{ "type": "object", "properties": { "absent": { "const": true } }, "required": ["absent"], "additionalProperties": false }, { "type": "object", "properties": { "value": {} }, "required": ["value"], "additionalProperties": false }] } }, "required": ["from", "to"], "additionalProperties": false } } }, "required": ["kind", "edgeId", "typeVersion", "changes"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "delete-edge" }, "edgeId": { "type": "string" } }, "required": ["kind", "edgeId"], "additionalProperties": false }] } }, "required": ["correlation", "operation"], "additionalProperties": false },
|
|
@@ -526,14 +652,17 @@ var SCHEMAS = {
|
|
|
526
652
|
grantMembership: { "type": "object", "properties": { "principalId": { "type": "string" }, "scopeKind": { "enum": ["organisation", "project"] }, "scopeId": { "type": "string" }, "roleKey": { "type": "string" } }, "required": ["principalId", "scopeKind", "scopeId", "roleKey"], "additionalProperties": false },
|
|
527
653
|
revokeMembership: { "type": "object", "properties": { "principalId": { "type": "string" }, "scopeKind": { "enum": ["organisation", "project"] }, "scopeId": { "type": "string" } }, "required": ["principalId", "scopeKind", "scopeId"], "additionalProperties": false },
|
|
528
654
|
setModelConfiguration: { "type": "object", "properties": { "model": { "type": "string" }, "apiKey": { "type": "string" } }, "required": ["model", "apiKey"], "additionalProperties": false },
|
|
655
|
+
setModelId: { "type": "object", "properties": { "model": { "type": "string" } }, "required": ["model"], "additionalProperties": false },
|
|
529
656
|
readDisplayNames: { "type": "object", "properties": { "principalIds": { "type": "array", "items": { "type": "string" } } }, "required": ["principalIds"], "additionalProperties": false },
|
|
530
657
|
listMembers: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
531
658
|
changeMembershipRole: { "type": "object", "properties": { "principalId": { "type": "string" }, "scopeKind": { "enum": ["organisation", "project"] }, "scopeId": { "type": "string" }, "roleKey": { "type": "string" } }, "required": ["principalId", "scopeKind", "scopeId", "roleKey"], "additionalProperties": false },
|
|
532
659
|
listOrganisationMembers: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
533
660
|
listServiceIdentities: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
534
|
-
createInvitation: { "type": "object", "properties": { "email": { "type": "string" }, "roleKey": { "type": "string" } }, "required": ["email", "roleKey"], "additionalProperties": false },
|
|
661
|
+
createInvitation: { "type": "object", "properties": { "email": { "type": "string" }, "roleKey": { "type": "string" }, "projectRoles": { "type": "array", "items": { "type": "object", "properties": { "projectId": { "type": "string" }, "roleKey": { "type": "string" } }, "required": ["projectId", "roleKey"], "additionalProperties": false }, "maxItems": 50 } }, "required": ["email", "roleKey"], "additionalProperties": false },
|
|
535
662
|
listInvitations: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
536
663
|
revokeInvitation: { "type": "object", "properties": { "invitationId": { "type": "string" } }, "required": ["invitationId"], "additionalProperties": false },
|
|
664
|
+
readModelConfigurationStatus: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
665
|
+
readAccount: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
537
666
|
readInvitationDomainRule: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
538
667
|
setInvitationDomainRule: { "type": "object", "properties": { "restricted": { "type": "boolean" }, "domains": { "type": "array", "items": { "type": "string" } } }, "required": ["restricted", "domains"], "additionalProperties": false },
|
|
539
668
|
reissueInvitation: { "type": "object", "properties": { "invitationId": { "type": "string" } }, "required": ["invitationId"], "additionalProperties": false },
|
|
@@ -543,16 +672,20 @@ var SCHEMAS = {
|
|
|
543
672
|
reissuePlatformInvitation: { "type": "object", "properties": { "invitationId": { "type": "string" } }, "required": ["invitationId"], "additionalProperties": false },
|
|
544
673
|
readWebOrigin: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
545
674
|
readCallerCapabilities: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
546
|
-
queryGraph: { "type": "object", "properties": { "kind": { "const": "graph" }, "start": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "objects" }, "objects": { "type": "array", "items": { "type": "object", "properties": { "objectId": { "type": "string" }, "projectId": { "type": "string" } }, "required": ["objectId", "projectId"], "additionalProperties": false } } }, "required": ["kind", "objects"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "set" }, "set": { "type": "object", "properties": { "kind": { "const": "objects" }, "typeKey": { "oneOf": [{ "type": "string" }, { "type": "null" }] }, "projects": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }] } }, "steps": { "type": "array", "items": { "type": "object", "properties": { "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "targetTypeKey": { "type": "string" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }] } } }, "required": ["edgeTypeKey", "direction", "targetTypeKey"], "additionalProperties": false } }, "sort": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "property", "direction"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "direction"], "additionalProperties": false }] } }, "required": ["kind", "typeKey"], "additionalProperties": false } }, "required": ["kind", "set"], "additionalProperties": false }] }, "steps": { "type": "array", "items": { "type": "object", "properties": { "edgeTypeKeys": { "type": "array", "items": { "type": "string" } }, "direction": { "enum": ["outgoing", "incoming"] }, "depth": { "type": "number" }, "targetTypeKeys": { "type": "array", "items": { "type": "string" } } }, "required": ["depth"], "additionalProperties": false } }, "closeOver": { "type": "array", "items": { "type": "string" } }, "keep": { "enum": ["all", "last"] }, "objectLimit": { "type": "number" }, "hopLimit": { "type": "number" }, "continuation": { "oneOf": [{ "type": "string" }, { "type": "null" }] } }, "required": ["kind", "start", "steps"], "additionalProperties": false },
|
|
675
|
+
queryGraph: { "type": "object", "properties": { "kind": { "const": "graph" }, "start": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "objects" }, "objects": { "type": "array", "items": { "type": "object", "properties": { "objectId": { "type": "string" }, "projectId": { "type": "string" } }, "required": ["objectId", "projectId"], "additionalProperties": false } } }, "required": ["kind", "objects"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "set" }, "set": { "type": "object", "properties": { "kind": { "const": "objects" }, "typeKey": { "oneOf": [{ "type": "string" }, { "type": "null" }] }, "projects": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "type" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }] } }, "steps": { "type": "array", "items": { "type": "object", "properties": { "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "targetTypeKey": { "type": "string" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "or" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "=" }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": [">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "edge" }, "edgeTypeKey": { "type": "string" }, "direction": { "enum": ["outgoing", "incoming", "to-children", "to-parent"] }, "has": { "type": "boolean" } }, "required": ["kind", "edgeTypeKey", "direction", "has"], "additionalProperties": false }] } } }, "required": ["kind", "filters"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "type" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "op", "values"], "additionalProperties": false }] } } }, "required": ["edgeTypeKey", "direction", "targetTypeKey"], "additionalProperties": false } }, "sort": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "property", "direction"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "direction"], "additionalProperties": false }] } }, "required": ["kind", "typeKey"], "additionalProperties": false } }, "required": ["kind", "set"], "additionalProperties": false }] }, "steps": { "type": "array", "items": { "type": "object", "properties": { "edgeTypeKeys": { "type": "array", "items": { "type": "string" } }, "direction": { "enum": ["outgoing", "incoming"] }, "depth": { "type": "number" }, "targetTypeKeys": { "type": "array", "items": { "type": "string" } } }, "required": ["depth"], "additionalProperties": false } }, "closeOver": { "type": "array", "items": { "type": "string" } }, "keep": { "enum": ["all", "last"] }, "objectLimit": { "type": "number" }, "hopLimit": { "type": "number" }, "continuation": { "oneOf": [{ "type": "string" }, { "type": "null" }] } }, "required": ["kind", "start", "steps"], "additionalProperties": false },
|
|
547
676
|
readStructure: { "type": "object", "properties": { "typeKey": { "type": "string" }, "structure": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "declared" } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "relationship" }, "edgeTypeKey": { "type": "string" } }, "required": ["kind", "edgeTypeKey"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "view" }, "viewKey": { "type": "string" } }, "required": ["kind", "viewKey"], "additionalProperties": false }] }, "anchor": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "forest" } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "subtree" }, "object": { "type": "object", "properties": { "objectId": { "type": "string" }, "projectId": { "type": "string" } }, "required": ["objectId", "projectId"], "additionalProperties": false } }, "required": ["kind", "object"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "ancestors" }, "object": { "type": "object", "properties": { "objectId": { "type": "string" }, "projectId": { "type": "string" } }, "required": ["objectId", "projectId"], "additionalProperties": false } }, "required": ["kind", "object"], "additionalProperties": false }] }, "maxDepth": { "type": "number" }, "occurrenceLimit": { "type": "number" } }, "required": ["typeKey", "structure", "anchor"], "additionalProperties": false },
|
|
548
677
|
findPaths: { "type": "object", "properties": { "from": { "type": "object", "properties": { "objectId": { "type": "string" }, "projectId": { "type": "string" } }, "required": ["objectId", "projectId"], "additionalProperties": false }, "to": { "type": "object", "properties": { "objectId": { "type": "string" }, "projectId": { "type": "string" } }, "required": ["objectId", "projectId"], "additionalProperties": false }, "edgeTypeKeys": { "type": "array", "items": { "type": "string" } }, "direction": { "enum": ["outgoing", "incoming"] }, "maxLength": { "type": "number" }, "maxPaths": { "type": "number" } }, "required": ["from", "to", "maxLength"], "additionalProperties": false },
|
|
549
678
|
listProposals: { "type": "object", "properties": { "state": { "enum": ["pending", "merged", "refused", "discarded", "all"] }, "cursor": { "type": "string" } }, "required": ["state"], "additionalProperties": false },
|
|
550
679
|
readProposal: { "type": "object", "properties": { "proposalId": { "type": "string" } }, "required": ["proposalId"], "additionalProperties": false },
|
|
551
680
|
refuseProposal: { "type": "object", "properties": { "proposalId": { "type": "string" }, "reason": { "type": "string" } }, "required": ["proposalId", "reason"], "additionalProperties": false },
|
|
552
681
|
readBranchDiff: { "type": "object", "properties": { "proposalId": { "type": "string" }, "cursor": { "type": "string" } }, "required": ["proposalId"], "additionalProperties": false },
|
|
682
|
+
readLinkStatus: { "type": "object", "properties": { "objectId": { "type": "string" } }, "required": ["objectId"], "additionalProperties": false },
|
|
683
|
+
clearLinks: { "type": "object", "properties": { "correlation": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "mint" } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "sent" }, "correlationId": { "type": "string" } }, "required": ["kind", "correlationId"], "additionalProperties": false }] }, "ref": { "type": "string" }, "entries": { "type": "array", "items": { "type": "object", "properties": { "linkId": { "type": "string" }, "upstreamVersion": { "type": "string" } }, "required": ["linkId", "upstreamVersion"], "additionalProperties": false }, "minItems": 1, "maxItems": 100 } }, "required": ["correlation", "ref", "entries"], "additionalProperties": false },
|
|
684
|
+
readChangeImpact: { "type": "object", "properties": { "ref": { "type": "string" }, "base": { "type": "string" } }, "required": ["ref", "base"], "additionalProperties": false },
|
|
553
685
|
diffBranches: { "type": "object", "properties": { "ref": { "type": "string" }, "base": { "type": "string" }, "cursor": { "type": "string" } }, "required": ["ref", "base"], "additionalProperties": false },
|
|
554
686
|
readBranchHistory: { "type": "object", "properties": { "name": { "type": "string" }, "cursor": { "type": "string" } }, "required": ["name"], "additionalProperties": false },
|
|
555
687
|
listAudit: { "type": "object", "properties": { "limit": { "type": "number" }, "cursor": { "type": "string" } }, "required": ["limit"], "additionalProperties": false },
|
|
688
|
+
listOrganisationAudit: { "type": "object", "properties": { "limit": { "type": "number" }, "verbPrefix": { "type": "string" }, "cursor": { "type": "string" } }, "required": ["limit", "verbPrefix"], "additionalProperties": false },
|
|
556
689
|
readRefHead: { "type": "object", "properties": { "name": { "type": "string" } }, "required": ["name"], "additionalProperties": false },
|
|
557
690
|
inspectBranchOperation: { "type": "object", "properties": { "correlationId": { "type": "string" } }, "required": ["correlationId"], "additionalProperties": false },
|
|
558
691
|
abandonBranch: { "type": "object", "properties": { "correlation": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "mint" } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "sent" }, "correlationId": { "type": "string" } }, "required": ["kind", "correlationId"], "additionalProperties": false }] }, "name": { "type": "string" }, "atHash": { "type": "string" } }, "required": ["correlation", "name", "atHash"], "additionalProperties": false },
|
|
@@ -586,7 +719,7 @@ var SCHEMAS = {
|
|
|
586
719
|
readCurrentChangeSet: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
587
720
|
readChangeSet: { "type": "object", "properties": { "changeSetId": { "type": "string" } }, "required": ["changeSetId"], "additionalProperties": false },
|
|
588
721
|
readChangeSetState: { "type": "object", "properties": { "changeSetId": { "type": "string" } }, "required": ["changeSetId"], "additionalProperties": false },
|
|
589
|
-
reviseChangeSet: { "type": "object", "properties": { "changeSetId": { "type": "string" }, "expectedRevision": { "type": "string" }, "changes": { "type": "object", "additionalProperties": { "oneOf": [{ "type": "object", "properties": { "typeCategory": { "const": "object" }, "typeKey": { "type": "string" }, "version": { "type": "number" }, "displayName": { "type": "string" }, "description": { "oneOf": [{ "type": "string" }, { "type": "null" }] }, "schemaLanguageVersion": { "type": "string" }, "propertyDefinitions": { "type": "object", "additionalProperties": {} }, "requiredPropertyKeys": { "type": "array", "items": { "type": "string" } }, "presentationBindings": { "type": "object", "properties": { "views": { "type": "object", "properties": { "object": { "type": "object", "properties": { "root": { "type": "string" }, "elements": { "type": "object", "additionalProperties": { "type": "object", "properties": { "type": { "type": "string" }, "props": { "type": "object", "additionalProperties": {} }, "children": { "type": "array", "items": { "type": "string" } }, "repeat": { "type": "object", "properties": { "statePath": { "type": "string" }, "key": { "type": "string" } }, "required": ["statePath"], "additionalProperties": false }, "on": { "type": "object", "properties": { "press": { "oneOf": [{ "type": "object", "properties": { "action": { "const": "set-properties" }, "params": { "type": "object", "properties": { "properties": { "type": "object", "additionalProperties": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "null" }, { "type": "object", "properties": { "$state": { "type": "string" } }, "required": ["$state"], "additionalProperties": false }] } } }, "required": ["properties"], "additionalProperties": false } }, "required": ["action", "params"], "additionalProperties": false }, { "type": "object", "properties": { "action": { "const": "run-verb" }, "params": { "type": "object", "properties": { "verb": { "type": "string" } }, "required": ["verb"], "additionalProperties": false } }, "required": ["action", "params"], "additionalProperties": false }] } }, "required": ["press"], "additionalProperties": false } }, "required": ["type", "props", "children"], "additionalProperties": false } } }, "required": ["root", "elements"], "additionalProperties": false }, "app": { "type": "object", "properties": { "root": { "type": "string" }, "elements": { "type": "object", "additionalProperties": { "type": "object", "properties": { "type": { "type": "string" }, "props": { "type": "object", "additionalProperties": {} }, "children": { "type": "array", "items": { "type": "string" } }, "repeat": { "type": "object", "properties": { "statePath": { "type": "string" }, "key": { "type": "string" } }, "required": ["statePath"], "additionalProperties": false }, "on": { "type": "object", "properties": { "press": { "oneOf": [{ "type": "object", "properties": { "action": { "const": "set-properties" }, "params": { "type": "object", "properties": { "properties": { "type": "object", "additionalProperties": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "null" }, { "type": "object", "properties": { "$state": { "type": "string" } }, "required": ["$state"], "additionalProperties": false }] } } }, "required": ["properties"], "additionalProperties": false } }, "required": ["action", "params"], "additionalProperties": false }, { "type": "object", "properties": { "action": { "const": "run-verb" }, "params": { "type": "object", "properties": { "verb": { "type": "string" } }, "required": ["verb"], "additionalProperties": false } }, "required": ["action", "params"], "additionalProperties": false }] } }, "required": ["press"], "additionalProperties": false } }, "required": ["type", "props", "children"], "additionalProperties": false } } }, "required": ["root", "elements"], "additionalProperties": false }, "card": { "type": "object", "properties": { "root": { "type": "string" }, "elements": { "type": "object", "additionalProperties": { "type": "object", "properties": { "type": { "type": "string" }, "props": { "type": "object", "additionalProperties": {} }, "children": { "type": "array", "items": { "type": "string" } }, "repeat": { "type": "object", "properties": { "statePath": { "type": "string" }, "key": { "type": "string" } }, "required": ["statePath"], "additionalProperties": false }, "on": { "type": "object", "properties": { "press": { "oneOf": [{ "type": "object", "properties": { "action": { "const": "set-properties" }, "params": { "type": "object", "properties": { "properties": { "type": "object", "additionalProperties": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "null" }, { "type": "object", "properties": { "$state": { "type": "string" } }, "required": ["$state"], "additionalProperties": false }] } } }, "required": ["properties"], "additionalProperties": false } }, "required": ["action", "params"], "additionalProperties": false }, { "type": "object", "properties": { "action": { "const": "run-verb" }, "params": { "type": "object", "properties": { "verb": { "type": "string" } }, "required": ["verb"], "additionalProperties": false } }, "required": ["action", "params"], "additionalProperties": false }] } }, "required": ["press"], "additionalProperties": false } }, "required": ["type", "props", "children"], "additionalProperties": false } } }, "required": ["root", "elements"], "additionalProperties": false } }, "required": [], "additionalProperties": false }, "title": { "type": "string" }, "summary": { "type": "string" }, "icon": { "type": "string" }, "typeIcon": { "type": "string" }, "rail": { "type": "object", "properties": { "group": { "type": "string" }, "order": { "type": "number" } }, "required": ["group", "order"], "additionalProperties": false } }, "required": [], "additionalProperties": false }, "structureDeclaration": { "type": "object", "properties": { "relationships": { "type": "array", "items": { "type": "string" } }, "views": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "label": { "type": "string" }, "steps": { "type": "array", "items": { "type": "string" } }, "decoration": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "label": { "type": "string" } }, "required": ["key", "label"], "additionalProperties": false } } }, "required": ["key", "label", "steps"], "additionalProperties": false } } }, "required": [], "additionalProperties": false }, "subscriptionRoles": { "type": "object", "properties": { "owner": { "type": "object", "properties": { "max": { "type": "number" } }, "required": [], "additionalProperties": false }, "approver": { "type": "object", "properties": { "max": { "type": "number" } }, "required": [], "additionalProperties": false }, "watcher": { "type": "object", "properties": { "max": { "type": "number" } }, "required": [], "additionalProperties": false } }, "required": [], "additionalProperties": false } }, "required": ["typeCategory", "typeKey", "version", "displayName", "description", "schemaLanguageVersion", "propertyDefinitions", "requiredPropertyKeys"], "additionalProperties": false }, { "type": "object", "properties": { "typeCategory": { "const": "edge" }, "typeKey": { "type": "string" }, "version": { "type": "number" }, "displayName": { "type": "string" }, "sourceObjectType": { "type": "string" }, "targetObjectType": { "type": "string" }, "kind": { "enum": ["structural", "traceability"] }, "subjectEnd": { "enum": ["source", "target"] }, "parentEnd": { "oneOf": [{ "const": "source" }, { "const": "target" }, { "type": "null" }] }, "sourceLabel": { "type": "string" }, "targetLabel": { "type": "string" }, "schemaLanguageVersion": { "type": "string" }, "propertyDefinitions": { "type": "object", "additionalProperties": {} }, "requiredPropertyKeys": { "type": "array", "items": { "type": "string" } }, "readRule": { "enum": ["both-endpoints", "either-endpoint"] }, "writeRule": { "enum": ["both-endpoints", "either-endpoint"] } }, "required": ["typeCategory", "typeKey", "version", "displayName", "sourceObjectType", "targetObjectType", "kind", "subjectEnd", "parentEnd", "sourceLabel", "targetLabel", "schemaLanguageVersion", "propertyDefinitions", "requiredPropertyKeys", "readRule", "writeRule"], "additionalProperties": false }, { "type": "object", "properties": { "typeCategory": { "const": "verb" }, "typeKey": { "type": "string" }, "version": { "type": "number" }, "displayName": { "type": "string" }, "description": { "oneOf": [{ "type": "string" }, { "type": "null" }] }, "allowedSubjectTypes": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "none" } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "types" }, "types": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "types"], "additionalProperties": false }] }, "inputSchema": {}, "resultSchema": {}, "handlerKey": { "type": "string" }, "template": { "type": "object", "properties": { "query": { "type": "object", "properties": { "typeKey": { "type": "string" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": ["=", ">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "literal" }, "value": {} }, "required": ["slot", "value"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "literal" }, "value": {} }, "required": ["slot", "value"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "literal" }, "value": {} }, "required": ["slot", "value"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }] }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }] } }, "sort": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "property", "direction"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "direction"], "additionalProperties": false }] }, "limit": { "type": "number" } }, "required": ["typeKey", "limit"], "additionalProperties": false }, "operations": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "create-object" }, "typeKey": { "type": "string" }, "properties": { "type": "object", "additionalProperties": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "literal" }, "value": {} }, "required": ["slot", "value"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }] } } }, "required": ["kind", "typeKey", "properties"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "update-object" }, "typeKey": { "type": "string" }, "target": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }] }, "changes": { "type": "object", "additionalProperties": { "type": "object", "properties": { "from": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "literal" }, "value": {} }, "required": ["slot", "value"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "absent" } }, "required": ["slot"], "additionalProperties": false }] }, "to": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "literal" }, "value": {} }, "required": ["slot", "value"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "absent" } }, "required": ["slot"], "additionalProperties": false }] } }, "required": ["from", "to"], "additionalProperties": false } } }, "required": ["kind", "typeKey", "target", "changes"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "delete-object" }, "typeKey": { "type": "string" }, "target": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }] } }, "required": ["kind", "typeKey", "target"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "create-edge" }, "typeKey": { "type": "string" }, "source": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }] }, "target": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }] }, "properties": { "type": "object", "additionalProperties": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "literal" }, "value": {} }, "required": ["slot", "value"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }] } } }, "required": ["kind", "typeKey", "source", "target", "properties"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "delete-edge" }, "typeKey": { "type": "string" }, "target": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }] } }, "required": ["kind", "typeKey", "target"], "additionalProperties": false }] } } }, "required": ["operations"], "additionalProperties": false }, "schemaLanguageVersion": { "type": "string" } }, "required": ["typeCategory", "typeKey", "version", "displayName", "description", "allowedSubjectTypes", "inputSchema", "resultSchema", "schemaLanguageVersion"], "additionalProperties": false }] } }, "railGroups": { "type": "array", "items": { "type": "string" } } }, "required": ["changeSetId", "expectedRevision", "changes"], "additionalProperties": false },
|
|
722
|
+
reviseChangeSet: { "type": "object", "properties": { "changeSetId": { "type": "string" }, "expectedRevision": { "type": "string" }, "changes": { "type": "object", "additionalProperties": { "oneOf": [{ "type": "object", "properties": { "typeCategory": { "const": "object" }, "typeKey": { "type": "string" }, "version": { "type": "number" }, "displayName": { "type": "string" }, "description": { "oneOf": [{ "type": "string" }, { "type": "null" }] }, "schemaLanguageVersion": { "type": "string" }, "propertyDefinitions": { "type": "object", "additionalProperties": {} }, "requiredPropertyKeys": { "type": "array", "items": { "type": "string" } }, "presentationBindings": { "type": "object", "properties": { "views": { "type": "object", "properties": { "object": { "type": "object", "properties": { "root": { "type": "string" }, "elements": { "type": "object", "additionalProperties": { "type": "object", "properties": { "type": { "type": "string" }, "props": { "type": "object", "additionalProperties": {} }, "children": { "type": "array", "items": { "type": "string" } }, "repeat": { "type": "object", "properties": { "statePath": { "type": "string" }, "key": { "type": "string" } }, "required": ["statePath"], "additionalProperties": false }, "on": { "type": "object", "properties": { "press": { "oneOf": [{ "type": "object", "properties": { "action": { "const": "set-properties" }, "params": { "type": "object", "properties": { "properties": { "type": "object", "additionalProperties": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "null" }, { "type": "object", "properties": { "$state": { "type": "string" } }, "required": ["$state"], "additionalProperties": false }] } } }, "required": ["properties"], "additionalProperties": false } }, "required": ["action", "params"], "additionalProperties": false }, { "type": "object", "properties": { "action": { "const": "run-verb" }, "params": { "type": "object", "properties": { "verb": { "type": "string" } }, "required": ["verb"], "additionalProperties": false } }, "required": ["action", "params"], "additionalProperties": false }] } }, "required": ["press"], "additionalProperties": false } }, "required": ["type", "props", "children"], "additionalProperties": false } } }, "required": ["root", "elements"], "additionalProperties": false }, "app": { "type": "object", "properties": { "root": { "type": "string" }, "elements": { "type": "object", "additionalProperties": { "type": "object", "properties": { "type": { "type": "string" }, "props": { "type": "object", "additionalProperties": {} }, "children": { "type": "array", "items": { "type": "string" } }, "repeat": { "type": "object", "properties": { "statePath": { "type": "string" }, "key": { "type": "string" } }, "required": ["statePath"], "additionalProperties": false }, "on": { "type": "object", "properties": { "press": { "oneOf": [{ "type": "object", "properties": { "action": { "const": "set-properties" }, "params": { "type": "object", "properties": { "properties": { "type": "object", "additionalProperties": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "null" }, { "type": "object", "properties": { "$state": { "type": "string" } }, "required": ["$state"], "additionalProperties": false }] } } }, "required": ["properties"], "additionalProperties": false } }, "required": ["action", "params"], "additionalProperties": false }, { "type": "object", "properties": { "action": { "const": "run-verb" }, "params": { "type": "object", "properties": { "verb": { "type": "string" } }, "required": ["verb"], "additionalProperties": false } }, "required": ["action", "params"], "additionalProperties": false }] } }, "required": ["press"], "additionalProperties": false } }, "required": ["type", "props", "children"], "additionalProperties": false } } }, "required": ["root", "elements"], "additionalProperties": false }, "card": { "type": "object", "properties": { "root": { "type": "string" }, "elements": { "type": "object", "additionalProperties": { "type": "object", "properties": { "type": { "type": "string" }, "props": { "type": "object", "additionalProperties": {} }, "children": { "type": "array", "items": { "type": "string" } }, "repeat": { "type": "object", "properties": { "statePath": { "type": "string" }, "key": { "type": "string" } }, "required": ["statePath"], "additionalProperties": false }, "on": { "type": "object", "properties": { "press": { "oneOf": [{ "type": "object", "properties": { "action": { "const": "set-properties" }, "params": { "type": "object", "properties": { "properties": { "type": "object", "additionalProperties": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "null" }, { "type": "object", "properties": { "$state": { "type": "string" } }, "required": ["$state"], "additionalProperties": false }] } } }, "required": ["properties"], "additionalProperties": false } }, "required": ["action", "params"], "additionalProperties": false }, { "type": "object", "properties": { "action": { "const": "run-verb" }, "params": { "type": "object", "properties": { "verb": { "type": "string" } }, "required": ["verb"], "additionalProperties": false } }, "required": ["action", "params"], "additionalProperties": false }] } }, "required": ["press"], "additionalProperties": false } }, "required": ["type", "props", "children"], "additionalProperties": false } } }, "required": ["root", "elements"], "additionalProperties": false } }, "required": [], "additionalProperties": false }, "title": { "type": "string" }, "summary": { "type": "string" }, "icon": { "type": "string" }, "typeIcon": { "type": "string" }, "propertyLabels": { "type": "object", "additionalProperties": { "type": "string" } }, "propertyOrder": { "type": "array", "items": { "type": "string" } }, "rail": { "type": "object", "properties": { "group": { "type": "string" }, "order": { "type": "number" } }, "required": ["group", "order"], "additionalProperties": false } }, "required": [], "additionalProperties": false }, "structureDeclaration": { "type": "object", "properties": { "relationships": { "type": "array", "items": { "type": "string" } }, "views": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "label": { "type": "string" }, "steps": { "type": "array", "items": { "type": "string" } }, "decoration": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "label": { "type": "string" } }, "required": ["key", "label"], "additionalProperties": false } } }, "required": ["key", "label", "steps"], "additionalProperties": false } } }, "required": [], "additionalProperties": false }, "subscriptionRoles": { "type": "object", "properties": { "owner": { "type": "object", "properties": { "max": { "type": "number" } }, "required": [], "additionalProperties": false }, "approver": { "type": "object", "properties": { "max": { "type": "number" } }, "required": [], "additionalProperties": false }, "watcher": { "type": "object", "properties": { "max": { "type": "number" } }, "required": [], "additionalProperties": false } }, "required": [], "additionalProperties": false } }, "required": ["typeCategory", "typeKey", "version", "displayName", "description", "schemaLanguageVersion", "propertyDefinitions", "requiredPropertyKeys"], "additionalProperties": false }, { "type": "object", "properties": { "typeCategory": { "const": "edge" }, "typeKey": { "type": "string" }, "version": { "type": "number" }, "displayName": { "type": "string" }, "sourceObjectType": { "type": "string" }, "targetObjectType": { "type": "string" }, "kind": { "enum": ["structural", "traceability"] }, "subjectEnd": { "enum": ["source", "target"] }, "parentEnd": { "oneOf": [{ "const": "source" }, { "const": "target" }, { "type": "null" }] }, "sourceLabel": { "type": "string" }, "targetLabel": { "type": "string" }, "schemaLanguageVersion": { "type": "string" }, "propertyDefinitions": { "type": "object", "additionalProperties": {} }, "requiredPropertyKeys": { "type": "array", "items": { "type": "string" } }, "readRule": { "enum": ["both-endpoints", "either-endpoint"] }, "writeRule": { "enum": ["both-endpoints", "either-endpoint"] }, "review": { "type": "object", "properties": { "upstream": { "enum": ["source", "target"] }, "significant": { "type": "array", "items": { "type": "string" } }, "newLinks": { "enum": ["cleared", "unreviewed"] }, "propagation": { "enum": ["direct", "chain"] }, "chainDepth": { "type": "number" } }, "required": ["upstream"], "additionalProperties": false } }, "required": ["typeCategory", "typeKey", "version", "displayName", "sourceObjectType", "targetObjectType", "kind", "subjectEnd", "parentEnd", "sourceLabel", "targetLabel", "schemaLanguageVersion", "propertyDefinitions", "requiredPropertyKeys", "readRule", "writeRule"], "additionalProperties": false }, { "type": "object", "properties": { "typeCategory": { "const": "verb" }, "typeKey": { "type": "string" }, "version": { "type": "number" }, "displayName": { "type": "string" }, "description": { "oneOf": [{ "type": "string" }, { "type": "null" }] }, "allowedSubjectTypes": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "none" } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "types" }, "types": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "types"], "additionalProperties": false }] }, "inputSchema": {}, "resultSchema": {}, "handlerKey": { "type": "string" }, "template": { "type": "object", "properties": { "query": { "type": "object", "properties": { "typeKey": { "type": "string" }, "filters": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "enum": ["=", ">", ">=", "<", "<="] }, "value": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "literal" }, "value": {} }, "required": ["slot", "value"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }] } }, "required": ["kind", "property", "op", "value"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "op": { "const": "in" }, "values": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "literal" }, "value": {} }, "required": ["slot", "value"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }] } } }, "required": ["kind", "property", "op", "values"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "text" }, "term": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "literal" }, "value": {} }, "required": ["slot", "value"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }] }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["kind", "term"], "additionalProperties": false }] } }, "sort": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "property" }, "property": { "type": "string" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "property", "direction"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "identity" }, "direction": { "enum": ["asc", "desc"] } }, "required": ["kind", "direction"], "additionalProperties": false }] }, "limit": { "type": "number" } }, "required": ["typeKey", "limit"], "additionalProperties": false }, "operations": { "type": "array", "items": { "oneOf": [{ "type": "object", "properties": { "kind": { "const": "create-object" }, "typeKey": { "type": "string" }, "properties": { "type": "object", "additionalProperties": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "literal" }, "value": {} }, "required": ["slot", "value"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }] } } }, "required": ["kind", "typeKey", "properties"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "update-object" }, "typeKey": { "type": "string" }, "target": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }] }, "changes": { "type": "object", "additionalProperties": { "type": "object", "properties": { "from": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "literal" }, "value": {} }, "required": ["slot", "value"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "absent" } }, "required": ["slot"], "additionalProperties": false }] }, "to": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "literal" }, "value": {} }, "required": ["slot", "value"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "absent" } }, "required": ["slot"], "additionalProperties": false }] } }, "required": ["from", "to"], "additionalProperties": false } } }, "required": ["kind", "typeKey", "target", "changes"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "delete-object" }, "typeKey": { "type": "string" }, "target": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }] } }, "required": ["kind", "typeKey", "target"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "create-edge" }, "typeKey": { "type": "string" }, "source": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }] }, "target": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }] }, "properties": { "type": "object", "additionalProperties": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "literal" }, "value": {} }, "required": ["slot", "value"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" }, "property": { "type": "string" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }] } } }, "required": ["kind", "typeKey", "source", "target", "properties"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "delete-edge" }, "typeKey": { "type": "string" }, "target": { "oneOf": [{ "type": "object", "properties": { "slot": { "const": "input" }, "key": { "type": "string" } }, "required": ["slot", "key"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "subject" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "item" } }, "required": ["slot"], "additionalProperties": false }, { "type": "object", "properties": { "slot": { "const": "step" }, "index": { "type": "number" } }, "required": ["slot", "index"], "additionalProperties": false }] } }, "required": ["kind", "typeKey", "target"], "additionalProperties": false }] } } }, "required": ["operations"], "additionalProperties": false }, "schemaLanguageVersion": { "type": "string" } }, "required": ["typeCategory", "typeKey", "version", "displayName", "description", "allowedSubjectTypes", "inputSchema", "resultSchema", "schemaLanguageVersion"], "additionalProperties": false }] } }, "railGroups": { "type": "array", "items": { "type": "string" } } }, "required": ["changeSetId", "expectedRevision", "changes"], "additionalProperties": false },
|
|
590
723
|
validateChangeSet: { "type": "object", "properties": { "changeSetId": { "type": "string" }, "revision": { "type": "string" } }, "required": ["changeSetId", "revision"], "additionalProperties": false },
|
|
591
724
|
discardChangeSet: { "type": "object", "properties": { "changeSetId": { "type": "string" } }, "required": ["changeSetId"], "additionalProperties": false },
|
|
592
725
|
acceptChangeSet: { "type": "object", "properties": { "changeSetId": { "type": "string" }, "revision": { "type": "string" }, "correlationId": { "type": "string" } }, "required": ["changeSetId", "revision"], "additionalProperties": false },
|
|
@@ -613,7 +746,21 @@ var SCHEMAS = {
|
|
|
613
746
|
revokeConnection: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
614
747
|
startImportRun: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
615
748
|
listImportRuns: { "type": "object", "properties": { "runId": { "type": "string" } }, "required": [], "additionalProperties": false },
|
|
616
|
-
closeImportRun: { "oneOf": [{ "type": "object", "properties": { "runId": { "type": "string" }, "outcome": { "const": "succeeded" }, "commits": { "type": "array", "items": { "type": "string" } }, "complete": { "type": "boolean" }, "sourceCheckpoint": { "oneOf": [{ "type": "number" }, { "type": "null" }] }, "counts": { "type": "object", "properties": { "created": { "type": "number" }, "updated": { "type": "number" }, "unchanged": { "type": "number" }, "withdrawn": { "type": "number" }, "carried": { "type": "number" }, "overwritten": { "type": "number" } }, "required": ["created", "updated", "unchanged", "withdrawn", "carried", "overwritten"], "additionalProperties": false } }, "required": ["runId", "outcome", "commits", "complete", "sourceCheckpoint", "counts"], "additionalProperties": false }, { "type": "object", "properties": { "runId": { "type": "string" }, "outcome": { "const": "failed" }, "failure": { "enum": ["auth", "timeout", "size", "shape", "upstream-error", "unreachable", "allowance-spent", "duplicate-identifier", "dangling-reference", "undeclared-type", "credential-unreadable", "connection-revoked", "abandoned", "apply-refused", "apply-conflict", "apply-unknown", "duplicate-upstream", "types-not-approved", "internal", "mirror-row-unreadable"] } }, "required": ["runId", "outcome", "failure"], "additionalProperties": false }] }
|
|
749
|
+
closeImportRun: { "oneOf": [{ "type": "object", "properties": { "runId": { "type": "string" }, "outcome": { "const": "succeeded" }, "commits": { "type": "array", "items": { "type": "string" } }, "complete": { "type": "boolean" }, "sourceCheckpoint": { "oneOf": [{ "type": "number" }, { "type": "null" }] }, "counts": { "type": "object", "properties": { "created": { "type": "number" }, "updated": { "type": "number" }, "unchanged": { "type": "number" }, "withdrawn": { "type": "number" }, "carried": { "type": "number" }, "overwritten": { "type": "number" } }, "required": ["created", "updated", "unchanged", "withdrawn", "carried", "overwritten"], "additionalProperties": false } }, "required": ["runId", "outcome", "commits", "complete", "sourceCheckpoint", "counts"], "additionalProperties": false }, { "type": "object", "properties": { "runId": { "type": "string" }, "outcome": { "const": "failed" }, "failure": { "enum": ["auth", "timeout", "size", "shape", "upstream-error", "unreachable", "allowance-spent", "duplicate-identifier", "dangling-reference", "undeclared-type", "credential-unreadable", "connection-revoked", "abandoned", "apply-refused", "apply-conflict", "apply-unknown", "duplicate-upstream", "types-not-approved", "internal", "mirror-row-unreadable"] } }, "required": ["runId", "outcome", "failure"], "additionalProperties": false }] },
|
|
750
|
+
createHostedApp: { "type": "object", "properties": { "key": { "type": "string" } }, "required": ["key"], "additionalProperties": false },
|
|
751
|
+
readHostedBundle: { "type": "object", "properties": { "launchId": { "type": "string" } }, "required": ["launchId"], "additionalProperties": false },
|
|
752
|
+
listHostedApps: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
753
|
+
listHostedVersions: { "type": "object", "properties": { "appId": { "type": "string" } }, "required": ["appId"], "additionalProperties": false },
|
|
754
|
+
revokeHostedApp: { "type": "object", "properties": { "appId": { "type": "string" } }, "required": ["appId"], "additionalProperties": false },
|
|
755
|
+
revokeHostedVersion: { "type": "object", "properties": { "versionId": { "type": "string" } }, "required": ["versionId"], "additionalProperties": false },
|
|
756
|
+
openHostedApp: { "type": "object", "properties": { "appKey": { "type": "string" } }, "required": ["appKey"], "additionalProperties": false },
|
|
757
|
+
endHostedLaunch: { "type": "object", "properties": { "launchId": { "type": "string" } }, "required": ["launchId"], "additionalProperties": false },
|
|
758
|
+
mintHostedAppToken: { "type": "object", "properties": { "launchId": { "type": "string" } }, "required": ["launchId"], "additionalProperties": false },
|
|
759
|
+
setHostedOneWallSwitch: { "type": "object", "properties": { "allowed": { "type": "boolean" } }, "required": ["allowed"], "additionalProperties": false },
|
|
760
|
+
readHostedOneWallSwitch: { "type": "object", "properties": {}, "required": [], "additionalProperties": false },
|
|
761
|
+
grantHostedOneWall: { "type": "object", "properties": { "appId": { "type": "string" } }, "required": ["appId"], "additionalProperties": false },
|
|
762
|
+
withdrawHostedOneWall: { "type": "object", "properties": { "appId": { "type": "string" } }, "required": ["appId"], "additionalProperties": false },
|
|
763
|
+
listHostedOneWallGrants: { "type": "object", "properties": {}, "required": [], "additionalProperties": false }
|
|
617
764
|
};
|
|
618
765
|
var ROUTE_INPUT_SCHEMAS = deepFreeze(SCHEMAS);
|
|
619
766
|
var SELECTORS = {
|
|
@@ -646,8 +793,13 @@ var EXAMPLES = {
|
|
|
646
793
|
decideConsent: { "interactionId": "<interactionId>", "decision": "approve", "approvedScopes": [] },
|
|
647
794
|
listConnectedApps: {},
|
|
648
795
|
revokeConnectedApp: { "clientId": "<clientId>" },
|
|
796
|
+
readAttachment: {
|
|
797
|
+
"objectId": "<objectId>",
|
|
798
|
+
"property": "<property>"
|
|
799
|
+
},
|
|
649
800
|
readObject: { "objectId": "<objectId>" },
|
|
650
801
|
queryObjects: { "kind": "objects", "typeKey": null, "limit": 1, "continuation": null },
|
|
802
|
+
queryRows: { "kind": "graph-query", "start": { "typeKey": null }, "answer": { "kind": "rows", "columns": [], "limit": 1, "continuation": null } },
|
|
651
803
|
aggregateObjects: { "kind": "aggregate", "typeKey": null, "operation": "count" },
|
|
652
804
|
discoverVerbs: { "objectId": "<objectId>" },
|
|
653
805
|
readHistory: { "objectId": "<objectId>", "limit": 1, "continuation": null },
|
|
@@ -672,6 +824,7 @@ var EXAMPLES = {
|
|
|
672
824
|
grantMembership: { "principalId": "<principalId>", "scopeKind": "organisation", "scopeId": "<scopeId>", "roleKey": "<roleKey>" },
|
|
673
825
|
revokeMembership: { "principalId": "<principalId>", "scopeKind": "organisation", "scopeId": "<scopeId>" },
|
|
674
826
|
setModelConfiguration: { "model": "<model>", "apiKey": "<apiKey>" },
|
|
827
|
+
setModelId: { "model": "<model>" },
|
|
675
828
|
readDisplayNames: { "principalIds": [] },
|
|
676
829
|
listMembers: {},
|
|
677
830
|
changeMembershipRole: { "principalId": "<principalId>", "scopeKind": "organisation", "scopeId": "<scopeId>", "roleKey": "<roleKey>" },
|
|
@@ -680,6 +833,8 @@ var EXAMPLES = {
|
|
|
680
833
|
createInvitation: { "email": "<email>", "roleKey": "<roleKey>" },
|
|
681
834
|
listInvitations: {},
|
|
682
835
|
revokeInvitation: { "invitationId": "<invitationId>" },
|
|
836
|
+
readModelConfigurationStatus: {},
|
|
837
|
+
readAccount: {},
|
|
683
838
|
readInvitationDomainRule: {},
|
|
684
839
|
setInvitationDomainRule: { "restricted": false, "domains": [] },
|
|
685
840
|
reissueInvitation: { "invitationId": "<invitationId>" },
|
|
@@ -696,9 +851,13 @@ var EXAMPLES = {
|
|
|
696
851
|
readProposal: { "proposalId": "<proposalId>" },
|
|
697
852
|
refuseProposal: { "proposalId": "<proposalId>", "reason": "<reason>" },
|
|
698
853
|
readBranchDiff: { "proposalId": "<proposalId>" },
|
|
854
|
+
readLinkStatus: { "objectId": "<objectId>" },
|
|
855
|
+
clearLinks: { "correlation": { "kind": "mint" }, "ref": "main", "entries": [{ "linkId": "<linkId>", "upstreamVersion": "<upstreamVersion>" }] },
|
|
856
|
+
readChangeImpact: { "ref": "project/branch", "base": "main" },
|
|
699
857
|
diffBranches: { "ref": "<ref>", "base": "<base>" },
|
|
700
858
|
readBranchHistory: { "name": "<name>" },
|
|
701
859
|
listAudit: { "limit": 1 },
|
|
860
|
+
listOrganisationAudit: { "limit": 1, "verbPrefix": "<verbPrefix>" },
|
|
702
861
|
readRefHead: { "name": "<name>" },
|
|
703
862
|
inspectBranchOperation: { "correlationId": "<correlationId>" },
|
|
704
863
|
abandonBranch: { "correlation": { "kind": "mint" }, "name": "<name>", "atHash": "<atHash>" },
|
|
@@ -759,16 +918,35 @@ var EXAMPLES = {
|
|
|
759
918
|
revokeConnection: {},
|
|
760
919
|
startImportRun: {},
|
|
761
920
|
listImportRuns: {},
|
|
762
|
-
closeImportRun: { "runId": "<runId>", "outcome": "succeeded", "commits": [], "complete": false, "sourceCheckpoint": null, "counts": { "created": 1, "updated": 1, "unchanged": 1, "withdrawn": 1, "carried": 1, "overwritten": 1 } }
|
|
921
|
+
closeImportRun: { "runId": "<runId>", "outcome": "succeeded", "commits": [], "complete": false, "sourceCheckpoint": null, "counts": { "created": 1, "updated": 1, "unchanged": 1, "withdrawn": 1, "carried": 1, "overwritten": 1 } },
|
|
922
|
+
createHostedApp: { "key": "<key>" },
|
|
923
|
+
readHostedBundle: { "launchId": "<launchId>" },
|
|
924
|
+
listHostedApps: {},
|
|
925
|
+
listHostedVersions: { "appId": "<appId>" },
|
|
926
|
+
revokeHostedApp: { "appId": "<appId>" },
|
|
927
|
+
revokeHostedVersion: { "versionId": "<versionId>" },
|
|
928
|
+
openHostedApp: { "appKey": "<appKey>" },
|
|
929
|
+
endHostedLaunch: { "launchId": "<launchId>" },
|
|
930
|
+
mintHostedAppToken: { "launchId": "<launchId>" },
|
|
931
|
+
setHostedOneWallSwitch: { "allowed": false },
|
|
932
|
+
readHostedOneWallSwitch: {},
|
|
933
|
+
grantHostedOneWall: { "appId": "<appId>" },
|
|
934
|
+
withdrawHostedOneWall: { "appId": "<appId>" },
|
|
935
|
+
listHostedOneWallGrants: {}
|
|
763
936
|
};
|
|
764
937
|
var ROUTE_INPUT_EXAMPLES = deepFreeze(EXAMPLES);
|
|
765
938
|
|
|
766
939
|
// packages/api-contract/dist/routes.js
|
|
767
|
-
var PROTOCOL_VERSION =
|
|
940
|
+
var PROTOCOL_VERSION = 36;
|
|
768
941
|
var VERSION_HEADER = "oe2-protocol-version";
|
|
769
942
|
var TOKEN_HEADER = "authorization";
|
|
770
943
|
var IDEMPOTENCY_HEADER = "oe2-idempotency-key";
|
|
771
944
|
var STREAMED_ROUTE_NAMES = Object.freeze(["sendMessageStreamed", "answerPlanStreamed"]);
|
|
945
|
+
var BINARY_REQUEST_ROUTE_NAMES = Object.freeze(["stageAttachment", "publishHostedVersion"]);
|
|
946
|
+
var BINARY_RESPONSE_ROUTE_NAMES = Object.freeze(["readAttachment"]);
|
|
947
|
+
function isBinaryRequestRoute(name) {
|
|
948
|
+
return BINARY_REQUEST_ROUTE_NAMES.some((binary) => binary === name);
|
|
949
|
+
}
|
|
772
950
|
var OMITTABLE_GROUPS = Object.freeze([
|
|
773
951
|
"read",
|
|
774
952
|
"history",
|
|
@@ -790,11 +968,11 @@ function route(entry2) {
|
|
|
790
968
|
return Object.freeze({ ...entry2, doc: documented });
|
|
791
969
|
}
|
|
792
970
|
var ROUTES = Object.freeze({
|
|
793
|
-
createObjectSet: route({ name: "createObjectSet", method: "POST", path: "/object-sets", group: "write", selector: "object", subject: "project", idempotent: true, admission: admitting("user"), versioned: true, module: "objects-sdk", capability: "objects.createObjectSet" }),
|
|
794
|
-
listObjectSets: route({ name: "listObjectSets", method: "POST", path: "/object-sets/list", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "objects-sdk", capability: "objects.listObjectSets" }),
|
|
795
|
-
readObjectSet: route({ name: "readObjectSet", method: "POST", path: "/object-sets/read", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "objects-sdk", capability: "objects.readObjectSet" }),
|
|
796
|
-
updateObjectSet: route({ name: "updateObjectSet", method: "POST", path: "/object-sets/update", group: "write", selector: "object", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "objects-sdk", capability: "objects.updateObjectSet" }),
|
|
797
|
-
deleteObjectSet: route({ name: "deleteObjectSet", method: "POST", path: "/object-sets/delete", group: "write", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "objects-sdk", capability: "objects.deleteObjectSet" }),
|
|
971
|
+
createObjectSet: route({ name: "createObjectSet", method: "POST", path: "/object-sets", group: "write", selector: "object", subject: "project", idempotent: true, admission: admitting("user", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.createObjectSet" }),
|
|
972
|
+
listObjectSets: route({ name: "listObjectSets", method: "POST", path: "/object-sets/list", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.listObjectSets" }),
|
|
973
|
+
readObjectSet: route({ name: "readObjectSet", method: "POST", path: "/object-sets/read", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.readObjectSet" }),
|
|
974
|
+
updateObjectSet: route({ name: "updateObjectSet", method: "POST", path: "/object-sets/update", group: "write", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.updateObjectSet" }),
|
|
975
|
+
deleteObjectSet: route({ name: "deleteObjectSet", method: "POST", path: "/object-sets/delete", group: "write", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.deleteObjectSet" }),
|
|
798
976
|
health: route({ name: "health", method: "GET", path: "/health", group: "platform", selector: "none", subject: "platform", idempotent: false, admission: NO_ACCESS_TOKEN, versioned: false, module: "sdk-core", capability: "core.health" }),
|
|
799
977
|
signInStart: route({ name: "signInStart", method: "GET", path: "/auth/sign-in", group: "platform", selector: "none", subject: "platform", idempotent: false, admission: NO_ACCESS_TOKEN, versioned: false, module: "sdk-core", capability: "core.signInStart" }),
|
|
800
978
|
signInCallback: route({ name: "signInCallback", method: "GET", path: "/auth/callback", group: "platform", selector: "none", subject: "platform", idempotent: false, admission: NO_ACCESS_TOKEN, versioned: false, module: "sdk-core", capability: "core.signInCallback" }),
|
|
@@ -813,24 +991,63 @@ var ROUTES = Object.freeze({
|
|
|
813
991
|
decideConsent: route({ name: "decideConsent", method: "POST", path: "/consent-decisions", group: "platform", selector: "none", subject: "platform", idempotent: false, admission: admitting("user"), versioned: true, module: "web-sdk", capability: "web.consentDecision" }),
|
|
814
992
|
listConnectedApps: route({ name: "listConnectedApps", method: "POST", path: "/connected-apps", group: "platform", selector: "none", subject: "platform", idempotent: false, admission: admitting("user"), versioned: true, module: "web-sdk", capability: "web.connectedApps" }),
|
|
815
993
|
revokeConnectedApp: route({ name: "revokeConnectedApp", method: "POST", path: "/connected-app-revocations", group: "platform", selector: "none", subject: "platform", idempotent: false, admission: admitting("user"), versioned: true, module: "web-sdk", capability: "web.connectedAppRevocation" }),
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
994
|
+
stageAttachment: route({
|
|
995
|
+
name: "stageAttachment",
|
|
996
|
+
method: "POST",
|
|
997
|
+
path: "/attachments/stage",
|
|
998
|
+
group: "write",
|
|
999
|
+
selector: "object",
|
|
1000
|
+
subject: "project",
|
|
1001
|
+
idempotent: false,
|
|
1002
|
+
admission: admitting("user", "service", "client", "run-apply"),
|
|
1003
|
+
versioned: true,
|
|
1004
|
+
module: "objects-sdk",
|
|
1005
|
+
capability: "objects.write"
|
|
1006
|
+
}),
|
|
1007
|
+
readAttachment: route({
|
|
1008
|
+
name: "readAttachment",
|
|
1009
|
+
method: "POST",
|
|
1010
|
+
path: "/attachments/read",
|
|
1011
|
+
group: "read",
|
|
1012
|
+
selector: "object",
|
|
1013
|
+
subject: "project",
|
|
1014
|
+
idempotent: false,
|
|
1015
|
+
admission: admitting("user", "service", "client", "run-explore", "run-apply"),
|
|
1016
|
+
versioned: true,
|
|
1017
|
+
module: "objects-sdk",
|
|
1018
|
+
capability: "objects.read"
|
|
1019
|
+
}),
|
|
1020
|
+
readObject: route({ name: "readObject", method: "POST", path: "/objects/read", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.read" }),
|
|
1021
|
+
queryObjects: route({ name: "queryObjects", method: "POST", path: "/objects/query", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "run-types", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.query" }),
|
|
1022
|
+
queryRows: route({
|
|
1023
|
+
name: "queryRows",
|
|
1024
|
+
method: "POST",
|
|
1025
|
+
path: "/objects/rows",
|
|
1026
|
+
group: "read",
|
|
1027
|
+
selector: "object",
|
|
1028
|
+
subject: "project",
|
|
1029
|
+
idempotent: false,
|
|
1030
|
+
admission: admitting("user", "service", "run-explore", "run-apply", "run-types", "client", "hosted-app"),
|
|
1031
|
+
versioned: true,
|
|
1032
|
+
module: "objects-sdk",
|
|
1033
|
+
capability: "objects.query"
|
|
1034
|
+
}),
|
|
1035
|
+
aggregateObjects: route({ name: "aggregateObjects", method: "POST", path: "/objects/aggregate", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "service", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.aggregate" }),
|
|
1036
|
+
discoverVerbs: route({ name: "discoverVerbs", method: "POST", path: "/objects/verbs", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.read" }),
|
|
1037
|
+
readHistory: route({ name: "readHistory", method: "POST", path: "/objects/history", group: "history", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.history" }),
|
|
1038
|
+
mutate: route({ name: "mutate", method: "POST", path: "/mutations", group: "write", selector: "object", subject: "project", idempotent: true, admission: admitting("user", "service", "run-apply", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.write" }),
|
|
1039
|
+
mutateBatch: route({ name: "mutateBatch", method: "POST", path: "/mutations/batch", group: "write", selector: "object", subject: "project", idempotent: true, admission: admitting("user", "service", "run-apply", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.write" }),
|
|
1040
|
+
previewDelete: route({ name: "previewDelete", method: "POST", path: "/objects/delete-preview", group: "write", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "service", "run-apply", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.write" }),
|
|
1041
|
+
recover: route({ name: "recover", method: "POST", path: "/recoveries", group: "write", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "service", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.recovery" }),
|
|
1042
|
+
executeVerb: route({ name: "executeVerb", method: "POST", path: "/verb-executions", group: "verb", selector: "object", subject: "project", idempotent: true, admission: admitting("user", "service", "run-apply", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.verb" }),
|
|
826
1043
|
createBranch: route({ name: "createBranch", method: "POST", path: "/branches", group: "branch", selector: "project", subject: "project", idempotent: true, admission: admitting("user", "service", "run-explore", "run-apply", "client"), versioned: true, module: "branches-sdk", capability: "branches.create" }),
|
|
827
1044
|
merge: route({ name: "merge", method: "POST", path: "/merges", group: "branch", selector: "project", subject: "project", idempotent: true, admission: admitting("user", "service", "client"), versioned: true, module: "branches-sdk", capability: "branches.merge" }),
|
|
828
|
-
readMergeConflicts: route({ name: "readMergeConflicts", method: "POST", path: "/branches/conflicts", group: "branch", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "service", "client"), versioned: true, module: "branches-sdk", capability: "branches.conflicts" }),
|
|
1045
|
+
readMergeConflicts: route({ name: "readMergeConflicts", method: "POST", path: "/branches/conflicts", group: "branch", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "service", "client", "hosted-app"), versioned: true, module: "branches-sdk", capability: "branches.conflicts" }),
|
|
829
1046
|
disposeRef: route({ name: "disposeRef", method: "POST", path: "/branch-disposals", group: "branch", selector: "project", subject: "project", idempotent: true, admission: admitting("user", "service", "client"), versioned: true, module: "branches-sdk", capability: "branches.disposal" }),
|
|
830
|
-
listProjects: route({ name: "listProjects", method: "POST", path: "/projects", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "service", "client"), versioned: true, module: "objects-sdk", capability: "objects.projects" }),
|
|
831
|
-
listRefs: route({ name: "listRefs", method: "POST", path: "/projects/refs", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "client"), versioned: true, module: "objects-sdk", capability: "branches.list" }),
|
|
832
|
-
readCatalogue: route({ name: "readCatalogue", method: "POST", path: "/projects/catalogue", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "run-types", "client"), versioned: true, module: "objects-sdk", capability: "objects.catalogue" }),
|
|
833
|
-
readPendingProposal: route({ name: "readPendingProposal", method: "POST", path: "/proposals/pending", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "client"), versioned: true, module: "branches-sdk", capability: "branches.pendingProposal" }),
|
|
1047
|
+
listProjects: route({ name: "listProjects", method: "POST", path: "/projects", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "service", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.projects" }),
|
|
1048
|
+
listRefs: route({ name: "listRefs", method: "POST", path: "/projects/refs", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "branches.list" }),
|
|
1049
|
+
readCatalogue: route({ name: "readCatalogue", method: "POST", path: "/projects/catalogue", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "run-types", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.catalogue" }),
|
|
1050
|
+
readPendingProposal: route({ name: "readPendingProposal", method: "POST", path: "/proposals/pending", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "client", "hosted-app"), versioned: true, module: "branches-sdk", capability: "branches.pendingProposal" }),
|
|
834
1051
|
submitProposal: route({ name: "submitProposal", method: "POST", path: "/proposals", group: "branch", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "client"), versioned: true, module: "branches-sdk", capability: "branches.proposalSubmit" }),
|
|
835
1052
|
createServiceIdentity: route({ name: "createServiceIdentity", method: "POST", path: "/service-identities", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.serviceIdentity" }),
|
|
836
1053
|
revokeServiceIdentity: route({ name: "revokeServiceIdentity", method: "POST", path: "/service-identities/revocation", group: "administration", selector: "none", subject: "service-identity", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.serviceIdentityRevocation" }),
|
|
@@ -839,10 +1056,13 @@ var ROUTES = Object.freeze({
|
|
|
839
1056
|
grantMembership: route({ name: "grantMembership", method: "POST", path: "/memberships", group: "administration", selector: "none", subject: "membership-scope", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.membership" }),
|
|
840
1057
|
revokeMembership: route({ name: "revokeMembership", method: "POST", path: "/membership-revocations", group: "administration", selector: "none", subject: "membership-scope", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.membershipRevocation" }),
|
|
841
1058
|
setModelConfiguration: route({ name: "setModelConfiguration", method: "POST", path: "/model-configuration", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.modelConfiguration" }),
|
|
842
|
-
|
|
843
|
-
|
|
1059
|
+
setModelId: route({ name: "setModelId", method: "POST", path: "/model-configuration/model", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.modelId" }),
|
|
1060
|
+
readModelConfigurationStatus: route({ name: "readModelConfigurationStatus", method: "POST", path: "/model-configuration/status", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.modelConfigurationStatus" }),
|
|
1061
|
+
readAccount: route({ name: "readAccount", method: "POST", path: "/account", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.account" }),
|
|
1062
|
+
readDisplayNames: route({ name: "readDisplayNames", method: "POST", path: "/principals/names", group: "read", selector: "none", subject: "display-names", idempotent: false, admission: admitting("user", "hosted-app"), versioned: true, module: "admin-sdk", capability: "admin.displayNames" }),
|
|
1063
|
+
listMembers: route({ name: "listMembers", method: "POST", path: "/projects/members", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "hosted-app"), versioned: true, module: "admin-sdk", capability: "admin.members" }),
|
|
844
1064
|
changeMembershipRole: route({ name: "changeMembershipRole", method: "POST", path: "/membership-roles", group: "administration", selector: "none", subject: "membership-scope", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.membershipRole" }),
|
|
845
|
-
listOrganisationMembers: route({ name: "listOrganisationMembers", method: "POST", path: "/organisation/members", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.organisationMembers" }),
|
|
1065
|
+
listOrganisationMembers: route({ name: "listOrganisationMembers", method: "POST", path: "/organisation/members", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "hosted-app"), versioned: true, module: "admin-sdk", capability: "admin.organisationMembers" }),
|
|
846
1066
|
listServiceIdentities: route({ name: "listServiceIdentities", method: "POST", path: "/organisation/service-identities", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.serviceIdentities" }),
|
|
847
1067
|
createInvitation: route({ name: "createInvitation", method: "POST", path: "/invitations", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.invitation" }),
|
|
848
1068
|
listInvitations: route({ name: "listInvitations", method: "POST", path: "/invitations/list", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.invitationList" }),
|
|
@@ -855,18 +1075,58 @@ var ROUTES = Object.freeze({
|
|
|
855
1075
|
revokePlatformInvitation: route({ name: "revokePlatformInvitation", method: "POST", path: "/platform-invitation-revocations", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.platformInvitationRevocation" }),
|
|
856
1076
|
reissuePlatformInvitation: route({ name: "reissuePlatformInvitation", method: "POST", path: "/platform-invitation-reissues", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.platformInvitationReissue" }),
|
|
857
1077
|
readWebOrigin: route({ name: "readWebOrigin", method: "POST", path: "/web-origin/read", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "service"), versioned: true, module: "admin-sdk", capability: "admin.webOrigin" }),
|
|
858
|
-
readCallerCapabilities: route({ name: "readCallerCapabilities", method: "POST", path: "/caller-capabilities/read", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.callerCapabilities" }),
|
|
859
|
-
queryGraph: route({ name: "queryGraph", method: "POST", path: "/objects/graph", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "client"), versioned: true, module: "objects-sdk", capability: "objects.traverse" }),
|
|
860
|
-
readStructure: route({ name: "readStructure", method: "POST", path: "/objects/structure", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "client"), versioned: true, module: "objects-sdk", capability: "objects.traverse" }),
|
|
861
|
-
findPaths: route({ name: "findPaths", method: "POST", path: "/objects/paths", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "client"), versioned: true, module: "objects-sdk", capability: "objects.traverse" }),
|
|
862
|
-
listProposals: route({ name: "listProposals", method: "POST", path: "/proposals/list", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "client"), versioned: true, module: "branches-sdk", capability: "branches.proposalList" }),
|
|
863
|
-
readProposal: route({ name: "readProposal", method: "POST", path: "/proposals/read", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "client"), versioned: true, module: "branches-sdk", capability: "branches.proposalRead" }),
|
|
1078
|
+
readCallerCapabilities: route({ name: "readCallerCapabilities", method: "POST", path: "/caller-capabilities/read", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "hosted-app"), versioned: true, module: "admin-sdk", capability: "admin.callerCapabilities" }),
|
|
1079
|
+
queryGraph: route({ name: "queryGraph", method: "POST", path: "/objects/graph", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.traverse" }),
|
|
1080
|
+
readStructure: route({ name: "readStructure", method: "POST", path: "/objects/structure", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.traverse" }),
|
|
1081
|
+
findPaths: route({ name: "findPaths", method: "POST", path: "/objects/paths", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.traverse" }),
|
|
1082
|
+
listProposals: route({ name: "listProposals", method: "POST", path: "/proposals/list", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "client", "hosted-app"), versioned: true, module: "branches-sdk", capability: "branches.proposalList" }),
|
|
1083
|
+
readProposal: route({ name: "readProposal", method: "POST", path: "/proposals/read", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "client", "hosted-app"), versioned: true, module: "branches-sdk", capability: "branches.proposalRead" }),
|
|
864
1084
|
refuseProposal: route({ name: "refuseProposal", method: "POST", path: "/proposal-refusals", group: "branch", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "client"), versioned: true, module: "branches-sdk", capability: "branches.proposalRefusal" }),
|
|
865
|
-
readBranchDiff: route({ name: "readBranchDiff", method: "POST", path: "/branches/diff", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "service", "client"), versioned: true, module: "branches-sdk", capability: "branches.proposalDiff" }),
|
|
866
|
-
|
|
867
|
-
|
|
1085
|
+
readBranchDiff: route({ name: "readBranchDiff", method: "POST", path: "/branches/diff", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "service", "client", "hosted-app"), versioned: true, module: "branches-sdk", capability: "branches.proposalDiff" }),
|
|
1086
|
+
readLinkStatus: route({
|
|
1087
|
+
name: "readLinkStatus",
|
|
1088
|
+
method: "POST",
|
|
1089
|
+
path: "/links/status",
|
|
1090
|
+
group: "read",
|
|
1091
|
+
selector: "object",
|
|
1092
|
+
subject: "project",
|
|
1093
|
+
idempotent: false,
|
|
1094
|
+
admission: admitting("user", "service", "run-explore", "run-apply", "client", "hosted-app"),
|
|
1095
|
+
versioned: true,
|
|
1096
|
+
module: "objects-sdk",
|
|
1097
|
+
capability: "links.status"
|
|
1098
|
+
}),
|
|
1099
|
+
clearLinks: route({
|
|
1100
|
+
name: "clearLinks",
|
|
1101
|
+
method: "POST",
|
|
1102
|
+
path: "/link-clearings",
|
|
1103
|
+
group: "write",
|
|
1104
|
+
selector: "project",
|
|
1105
|
+
subject: "project",
|
|
1106
|
+
idempotent: true,
|
|
1107
|
+
admission: admitting("user", "run-apply", "client", "service"),
|
|
1108
|
+
versioned: true,
|
|
1109
|
+
module: "objects-sdk",
|
|
1110
|
+
capability: "links.clear"
|
|
1111
|
+
}),
|
|
1112
|
+
readChangeImpact: route({
|
|
1113
|
+
name: "readChangeImpact",
|
|
1114
|
+
method: "POST",
|
|
1115
|
+
path: "/branches/impact",
|
|
1116
|
+
group: "read",
|
|
1117
|
+
selector: "project",
|
|
1118
|
+
subject: "project",
|
|
1119
|
+
idempotent: false,
|
|
1120
|
+
admission: admitting("user", "service", "run-explore", "run-apply", "client", "hosted-app"),
|
|
1121
|
+
versioned: true,
|
|
1122
|
+
module: "branches-sdk",
|
|
1123
|
+
capability: "branches.impact"
|
|
1124
|
+
}),
|
|
1125
|
+
diffBranches: route({ name: "diffBranches", method: "POST", path: "/branches/difference", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "client", "hosted-app"), versioned: true, module: "branches-sdk", capability: "branches.diff" }),
|
|
1126
|
+
readBranchHistory: route({ name: "readBranchHistory", method: "POST", path: "/branches/history", group: "history", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "client", "hosted-app"), versioned: true, module: "branches-sdk", capability: "branches.history" }),
|
|
868
1127
|
listAudit: route({ name: "listAudit", method: "POST", path: "/audit", group: "history", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "run-explore", "run-apply", "run-types"), versioned: true, module: "admin-sdk", capability: "admin.audit" }),
|
|
869
|
-
|
|
1128
|
+
listOrganisationAudit: route({ name: "listOrganisationAudit", method: "POST", path: "/organisation-audit", group: "history", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.organisationAudit" }),
|
|
1129
|
+
readRefHead: route({ name: "readRefHead", method: "POST", path: "/branches/head", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "run-types", "client", "hosted-app"), versioned: true, module: "branches-sdk", capability: "branches.head" }),
|
|
870
1130
|
inspectBranchOperation: route({ name: "inspectBranchOperation", method: "POST", path: "/branch-inspections", group: "branch", selector: "project", subject: "project", idempotent: false, admission: admitting("user", "service", "client"), versioned: true, module: "branches-sdk", capability: "branches.inspection" }),
|
|
871
1131
|
abandonBranch: route({ name: "abandonBranch", method: "POST", path: "/branch-abandonments", group: "branch", selector: "project", subject: "project", idempotent: true, admission: admitting("user", "service", "client"), versioned: true, module: "branches-sdk", capability: "branches.abandonment" }),
|
|
872
1132
|
addRefRule: route({ name: "addRefRule", method: "POST", path: "/ref-rules", group: "administration", selector: "project", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.ref-rules" }),
|
|
@@ -903,21 +1163,21 @@ var ROUTES = Object.freeze({
|
|
|
903
1163
|
validateChangeSet: route({ name: "validateChangeSet", method: "POST", path: "/change-sets/validation", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "run-types"), versioned: true, module: "ontology-sdk", capability: "ontology.draft" }),
|
|
904
1164
|
discardChangeSet: route({ name: "discardChangeSet", method: "POST", path: "/change-set-discards", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "ontology-sdk", capability: "ontology.publish" }),
|
|
905
1165
|
acceptChangeSet: route({ name: "acceptChangeSet", method: "POST", path: "/change-set-acceptances", group: "administration", selector: "none", subject: "none", idempotent: true, admission: admitting("user"), versioned: true, module: "ontology-sdk", capability: "ontology.publish" }),
|
|
906
|
-
readApp: route({ name: "readApp", method: "POST", path: "/apps/read", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "run-types", "client"), versioned: true, module: "objects-sdk", capability: "objects.catalogue" }),
|
|
1166
|
+
readApp: route({ name: "readApp", method: "POST", path: "/apps/read", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "run-types", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.catalogue" }),
|
|
907
1167
|
openAppDraft: route({ name: "openAppDraft", method: "POST", path: "/app-drafts", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "run-types"), versioned: true, module: "ontology-sdk", capability: "ontology.draft" }),
|
|
908
1168
|
readAppDraft: route({ name: "readAppDraft", method: "POST", path: "/app-drafts/read", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "run-types"), versioned: true, module: "ontology-sdk", capability: "ontology.draft" }),
|
|
909
1169
|
reviseAppDraft: route({ name: "reviseAppDraft", method: "POST", path: "/app-drafts/revisions", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "run-types"), versioned: true, module: "ontology-sdk", capability: "ontology.draft" }),
|
|
910
1170
|
acceptAppDraft: route({ name: "acceptAppDraft", method: "POST", path: "/app-draft-acceptances", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "ontology-sdk", capability: "ontology.publish" }),
|
|
911
|
-
listApps: route({ name: "listApps", method: "POST", path: "/apps", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "run-types", "client"), versioned: true, module: "objects-sdk", capability: "objects.catalogue" }),
|
|
1171
|
+
listApps: route({ name: "listApps", method: "POST", path: "/apps", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "service", "run-explore", "run-apply", "run-types", "client", "hosted-app"), versioned: true, module: "objects-sdk", capability: "objects.catalogue" }),
|
|
912
1172
|
validateAppDraft: route({ name: "validateAppDraft", method: "POST", path: "/app-drafts/validation", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user", "run-types"), versioned: true, module: "ontology-sdk", capability: "ontology.draft" }),
|
|
913
1173
|
discardAppDraft: route({ name: "discardAppDraft", method: "POST", path: "/app-draft-discards", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "ontology-sdk", capability: "ontology.publish" }),
|
|
914
|
-
searchPeople: route({ name: "searchPeople", method: "POST", path: "/people/search", group: "read", selector: "none", subject: "display-names", idempotent: false, admission: admitting("user"), versioned: true, module: "objects-sdk", capability: "people.search" }),
|
|
915
|
-
searchObjectReaders: route({ name: "searchObjectReaders", method: "POST", path: "/objects/readers", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "objects-sdk", capability: "people.objectReaders" }),
|
|
916
|
-
listSubscribers: route({ name: "listSubscribers", method: "POST", path: "/objects/subscribers", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "objects-sdk", capability: "discussion.subscribers" }),
|
|
917
|
-
addSubscriber: route({ name: "addSubscriber", method: "POST", path: "/objects/subscribers/add", group: "write", selector: "object", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "objects-sdk", capability: "discussion.subscriberChange" }),
|
|
918
|
-
removeSubscriber: route({ name: "removeSubscriber", method: "POST", path: "/objects/subscribers/remove", group: "write", selector: "object", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "objects-sdk", capability: "discussion.subscriberChange" }),
|
|
919
|
-
listComments: route({ name: "listComments", method: "POST", path: "/objects/comments", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "objects-sdk", capability: "discussion.comments" }),
|
|
920
|
-
addComment: route({ name: "addComment", method: "POST", path: "/objects/comments/add", group: "write", selector: "object", subject: "project", idempotent: true, admission: admitting("user"), versioned: true, module: "objects-sdk", capability: "discussion.commentWrite" }),
|
|
1174
|
+
searchPeople: route({ name: "searchPeople", method: "POST", path: "/people/search", group: "read", selector: "none", subject: "display-names", idempotent: false, admission: admitting("user", "hosted-app"), versioned: true, module: "objects-sdk", capability: "people.search" }),
|
|
1175
|
+
searchObjectReaders: route({ name: "searchObjectReaders", method: "POST", path: "/objects/readers", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "hosted-app"), versioned: true, module: "objects-sdk", capability: "people.objectReaders" }),
|
|
1176
|
+
listSubscribers: route({ name: "listSubscribers", method: "POST", path: "/objects/subscribers", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "hosted-app"), versioned: true, module: "objects-sdk", capability: "discussion.subscribers" }),
|
|
1177
|
+
addSubscriber: route({ name: "addSubscriber", method: "POST", path: "/objects/subscribers/add", group: "write", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "hosted-app"), versioned: true, module: "objects-sdk", capability: "discussion.subscriberChange" }),
|
|
1178
|
+
removeSubscriber: route({ name: "removeSubscriber", method: "POST", path: "/objects/subscribers/remove", group: "write", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "hosted-app"), versioned: true, module: "objects-sdk", capability: "discussion.subscriberChange" }),
|
|
1179
|
+
listComments: route({ name: "listComments", method: "POST", path: "/objects/comments", group: "read", selector: "object", subject: "project", idempotent: false, admission: admitting("user", "hosted-app"), versioned: true, module: "objects-sdk", capability: "discussion.comments" }),
|
|
1180
|
+
addComment: route({ name: "addComment", method: "POST", path: "/objects/comments/add", group: "write", selector: "object", subject: "project", idempotent: true, admission: admitting("user", "hosted-app"), versioned: true, module: "objects-sdk", capability: "discussion.commentWrite" }),
|
|
921
1181
|
createConnection: route({ name: "createConnection", method: "POST", path: "/connections", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.connectionCreation" }),
|
|
922
1182
|
listConnections: route({ name: "listConnections", method: "POST", path: "/connections/list", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.connections" }),
|
|
923
1183
|
setConnectionCredential: route({ name: "setConnectionCredential", method: "POST", path: "/connections/credential", group: "administration", selector: "connection", subject: "connection", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.connectionCredential" }),
|
|
@@ -926,7 +1186,22 @@ var ROUTES = Object.freeze({
|
|
|
926
1186
|
revokeConnection: route({ name: "revokeConnection", method: "POST", path: "/connection-revocations", group: "administration", selector: "connection", subject: "connection", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.connectionRevocation" }),
|
|
927
1187
|
startImportRun: route({ name: "startImportRun", method: "POST", path: "/import-runs", group: "write", selector: "connection", subject: "connection", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.importRunStart" }),
|
|
928
1188
|
listImportRuns: route({ name: "listImportRuns", method: "POST", path: "/import-runs/list", group: "read", selector: "connection", subject: "connection", idempotent: false, admission: admitting("user"), versioned: true, module: "admin-sdk", capability: "admin.importRuns" }),
|
|
929
|
-
closeImportRun: route({ name: "closeImportRun", method: "POST", path: "/import-run-closes", group: "write", selector: "connection", subject: "connection", idempotent: false, admission: admitting("service", "user"), versioned: true, module: "admin-sdk", capability: "admin.importRunClose" })
|
|
1189
|
+
closeImportRun: route({ name: "closeImportRun", method: "POST", path: "/import-run-closes", group: "write", selector: "connection", subject: "connection", idempotent: false, admission: admitting("service", "user"), versioned: true, module: "admin-sdk", capability: "admin.importRunClose" }),
|
|
1190
|
+
createHostedApp: route({ name: "createHostedApp", method: "POST", path: "/hosted-apps", group: "administration", selector: "project", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.app" }),
|
|
1191
|
+
publishHostedVersion: route({ name: "publishHostedVersion", method: "POST", path: "/hosted-apps/versions", group: "administration", selector: "project", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.publish" }),
|
|
1192
|
+
readHostedBundle: route({ name: "readHostedBundle", method: "POST", path: "/hosted-apps/bundle", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.bundle" }),
|
|
1193
|
+
listHostedApps: route({ name: "listHostedApps", method: "POST", path: "/hosted-apps/list", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.apps" }),
|
|
1194
|
+
listHostedVersions: route({ name: "listHostedVersions", method: "POST", path: "/hosted-apps/versions/list", group: "read", selector: "project", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.versions" }),
|
|
1195
|
+
revokeHostedApp: route({ name: "revokeHostedApp", method: "POST", path: "/hosted-app-revocations", group: "administration", selector: "project", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.appRevocation" }),
|
|
1196
|
+
revokeHostedVersion: route({ name: "revokeHostedVersion", method: "POST", path: "/hosted-version-revocations", group: "administration", selector: "project", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.versionRevocation" }),
|
|
1197
|
+
openHostedApp: route({ name: "openHostedApp", method: "POST", path: "/hosted-app-launches", group: "administration", selector: "project", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.launch" }),
|
|
1198
|
+
endHostedLaunch: route({ name: "endHostedLaunch", method: "POST", path: "/hosted-app-launch-ends", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.launchEnd" }),
|
|
1199
|
+
mintHostedAppToken: route({ name: "mintHostedAppToken", method: "POST", path: "/hosted-app-tokens", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.token" }),
|
|
1200
|
+
setHostedOneWallSwitch: route({ name: "setHostedOneWallSwitch", method: "POST", path: "/hosted-one-wall-switch", group: "administration", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.oneWallSwitch" }),
|
|
1201
|
+
readHostedOneWallSwitch: route({ name: "readHostedOneWallSwitch", method: "POST", path: "/hosted-one-wall-switch/read", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.oneWallSwitchRead" }),
|
|
1202
|
+
grantHostedOneWall: route({ name: "grantHostedOneWall", method: "POST", path: "/hosted-one-wall-grants", group: "administration", selector: "project", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.oneWallGrant" }),
|
|
1203
|
+
withdrawHostedOneWall: route({ name: "withdrawHostedOneWall", method: "POST", path: "/hosted-one-wall-withdrawals", group: "administration", selector: "project", subject: "project", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.oneWallWithdrawal" }),
|
|
1204
|
+
listHostedOneWallGrants: route({ name: "listHostedOneWallGrants", method: "POST", path: "/hosted-one-wall-grants/list", group: "read", selector: "none", subject: "none", idempotent: false, admission: admitting("user"), versioned: true, module: "hosted-apps-sdk", capability: "hostedApps.oneWallGrants" })
|
|
930
1205
|
});
|
|
931
1206
|
var ROUTE_CARRIES_CREDENTIAL = Object.freeze({
|
|
932
1207
|
createObjectSet: false,
|
|
@@ -952,8 +1227,11 @@ var ROUTE_CARRIES_CREDENTIAL = Object.freeze({
|
|
|
952
1227
|
decideConsent: false,
|
|
953
1228
|
listConnectedApps: false,
|
|
954
1229
|
revokeConnectedApp: false,
|
|
1230
|
+
stageAttachment: false,
|
|
1231
|
+
readAttachment: false,
|
|
955
1232
|
readObject: false,
|
|
956
1233
|
queryObjects: false,
|
|
1234
|
+
queryRows: false,
|
|
957
1235
|
aggregateObjects: false,
|
|
958
1236
|
discoverVerbs: false,
|
|
959
1237
|
readHistory: false,
|
|
@@ -978,6 +1256,9 @@ var ROUTE_CARRIES_CREDENTIAL = Object.freeze({
|
|
|
978
1256
|
grantMembership: false,
|
|
979
1257
|
revokeMembership: false,
|
|
980
1258
|
setModelConfiguration: true,
|
|
1259
|
+
setModelId: false,
|
|
1260
|
+
readModelConfigurationStatus: false,
|
|
1261
|
+
readAccount: false,
|
|
981
1262
|
readDisplayNames: false,
|
|
982
1263
|
listMembers: false,
|
|
983
1264
|
changeMembershipRole: false,
|
|
@@ -1002,9 +1283,13 @@ var ROUTE_CARRIES_CREDENTIAL = Object.freeze({
|
|
|
1002
1283
|
readProposal: false,
|
|
1003
1284
|
refuseProposal: false,
|
|
1004
1285
|
readBranchDiff: false,
|
|
1286
|
+
readLinkStatus: false,
|
|
1287
|
+
clearLinks: false,
|
|
1288
|
+
readChangeImpact: false,
|
|
1005
1289
|
diffBranches: false,
|
|
1006
1290
|
readBranchHistory: false,
|
|
1007
1291
|
listAudit: false,
|
|
1292
|
+
listOrganisationAudit: false,
|
|
1008
1293
|
readRefHead: false,
|
|
1009
1294
|
inspectBranchOperation: false,
|
|
1010
1295
|
abandonBranch: false,
|
|
@@ -1065,7 +1350,22 @@ var ROUTE_CARRIES_CREDENTIAL = Object.freeze({
|
|
|
1065
1350
|
revokeConnection: false,
|
|
1066
1351
|
startImportRun: false,
|
|
1067
1352
|
listImportRuns: false,
|
|
1068
|
-
closeImportRun: false
|
|
1353
|
+
closeImportRun: false,
|
|
1354
|
+
createHostedApp: false,
|
|
1355
|
+
publishHostedVersion: false,
|
|
1356
|
+
readHostedBundle: false,
|
|
1357
|
+
listHostedApps: false,
|
|
1358
|
+
listHostedVersions: false,
|
|
1359
|
+
revokeHostedApp: false,
|
|
1360
|
+
revokeHostedVersion: false,
|
|
1361
|
+
openHostedApp: false,
|
|
1362
|
+
endHostedLaunch: false,
|
|
1363
|
+
mintHostedAppToken: false,
|
|
1364
|
+
setHostedOneWallSwitch: false,
|
|
1365
|
+
readHostedOneWallSwitch: false,
|
|
1366
|
+
grantHostedOneWall: false,
|
|
1367
|
+
withdrawHostedOneWall: false,
|
|
1368
|
+
listHostedOneWallGrants: false
|
|
1069
1369
|
});
|
|
1070
1370
|
function routeEntriesOf(module) {
|
|
1071
1371
|
const names = Object.keys(ROUTES).filter((name) => ROUTES[name].module === module);
|
|
@@ -1074,20 +1374,157 @@ function routeEntriesOf(module) {
|
|
|
1074
1374
|
|
|
1075
1375
|
// packages/api-contract/dist/client-scopes.js
|
|
1076
1376
|
var CLIENT_SCOPES = Object.freeze({
|
|
1077
|
-
"objects.read": Object.freeze({
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1377
|
+
"objects.read": Object.freeze({
|
|
1378
|
+
capabilities: Object.freeze([
|
|
1379
|
+
"objects.read",
|
|
1380
|
+
"objects.query",
|
|
1381
|
+
"objects.traverse",
|
|
1382
|
+
"objects.aggregate",
|
|
1383
|
+
"objects.history",
|
|
1384
|
+
"objects.catalogue",
|
|
1385
|
+
"objects.projects",
|
|
1386
|
+
"branches.list",
|
|
1387
|
+
"links.status"
|
|
1388
|
+
]),
|
|
1389
|
+
consentLine: "Read your objects, their history and your projects' types."
|
|
1390
|
+
}),
|
|
1391
|
+
"objects.write": Object.freeze({
|
|
1392
|
+
capabilities: Object.freeze([
|
|
1393
|
+
"objects.write",
|
|
1394
|
+
"objects.verb",
|
|
1395
|
+
"links.clear"
|
|
1396
|
+
]),
|
|
1397
|
+
consentLine: "Create, change and delete objects, and run actions on them, as you."
|
|
1398
|
+
}),
|
|
1399
|
+
"branches.read": Object.freeze({
|
|
1400
|
+
capabilities: Object.freeze([
|
|
1401
|
+
"branches.head",
|
|
1402
|
+
"branches.diff",
|
|
1403
|
+
"branches.history",
|
|
1404
|
+
"branches.conflicts",
|
|
1405
|
+
"branches.inspection",
|
|
1406
|
+
"branches.pendingProposal",
|
|
1407
|
+
"branches.proposalList",
|
|
1408
|
+
"branches.proposalRead",
|
|
1409
|
+
"branches.proposalDiff",
|
|
1410
|
+
"branches.list",
|
|
1411
|
+
"branches.impact"
|
|
1412
|
+
]),
|
|
1413
|
+
consentLine: "Read your branches, their history and proposals."
|
|
1414
|
+
}),
|
|
1415
|
+
"branches.write": Object.freeze({
|
|
1416
|
+
capabilities: Object.freeze([
|
|
1417
|
+
"branches.create",
|
|
1418
|
+
"branches.abandonment",
|
|
1419
|
+
"branches.proposalSubmit",
|
|
1420
|
+
"branches.proposalRefusal",
|
|
1421
|
+
"branches.head",
|
|
1422
|
+
"branches.diff",
|
|
1423
|
+
"branches.history",
|
|
1424
|
+
"branches.conflicts",
|
|
1425
|
+
"branches.inspection",
|
|
1426
|
+
"branches.pendingProposal",
|
|
1427
|
+
"branches.proposalList",
|
|
1428
|
+
"branches.proposalRead",
|
|
1429
|
+
"branches.proposalDiff",
|
|
1430
|
+
"branches.list",
|
|
1431
|
+
"branches.impact"
|
|
1432
|
+
]),
|
|
1433
|
+
consentLine: "Create and abandon branches, submit and refuse proposals, and read your branches, as you."
|
|
1434
|
+
}),
|
|
1081
1435
|
"branches.manage": Object.freeze({ capabilities: Object.freeze(["branches.merge", "branches.disposal", "objects.recovery"]), consentLine: "Merge branches into the branches and trunks you may change, delete branches and other refs, and recover changes, as you." }),
|
|
1082
1436
|
offline_access: Object.freeze({ capabilities: Object.freeze([]), consentLine: "Stay connected when you are away, until you disconnect it." })
|
|
1083
1437
|
});
|
|
1084
1438
|
|
|
1439
|
+
// packages/api-contract/dist/attachment-headers.js
|
|
1440
|
+
var ATTACHMENT_SELECTOR_HEADER = "x-oe2-selector";
|
|
1441
|
+
var ATTACHMENT_NAME_HEADER = "x-oe2-attachment-name";
|
|
1442
|
+
function attachmentNameHeader(name) {
|
|
1443
|
+
return `UTF-8''${encodeURIComponent(name).replace(/[!'()*]/g, (character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`)}`;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
// packages/api-contract/dist/links.js
|
|
1447
|
+
var MAX_CLEAR_ENTRIES = 100;
|
|
1448
|
+
|
|
1449
|
+
// packages/sdk-dispatch/dist/response.js
|
|
1450
|
+
function responseOf(status, body, reason, headers = {}) {
|
|
1451
|
+
let read = false;
|
|
1452
|
+
const claim = () => {
|
|
1453
|
+
if (read)
|
|
1454
|
+
throw new Error("the response body has already been read");
|
|
1455
|
+
read = true;
|
|
1456
|
+
};
|
|
1457
|
+
const source = async function* () {
|
|
1458
|
+
if (typeof body === "string")
|
|
1459
|
+
yield Buffer.from(body, "utf8");
|
|
1460
|
+
else if (body instanceof Uint8Array)
|
|
1461
|
+
yield body;
|
|
1462
|
+
else
|
|
1463
|
+
yield* body;
|
|
1464
|
+
};
|
|
1465
|
+
const members = {
|
|
1466
|
+
status,
|
|
1467
|
+
...reason === void 0 || reason === "" ? {} : { reason },
|
|
1468
|
+
header: (name) => {
|
|
1469
|
+
const entry2 = Object.entries(headers).find(([key]) => key.toLowerCase() === name.toLowerCase());
|
|
1470
|
+
const value = entry2?.[1];
|
|
1471
|
+
return value === void 0 ? null : typeof value === "string" || typeof value === "number" ? String(value) : value.join(", ");
|
|
1472
|
+
},
|
|
1473
|
+
bytes: () => {
|
|
1474
|
+
claim();
|
|
1475
|
+
let iterated = false;
|
|
1476
|
+
return {
|
|
1477
|
+
async *[Symbol.asyncIterator]() {
|
|
1478
|
+
if (iterated)
|
|
1479
|
+
throw new Error("the response body has already been read");
|
|
1480
|
+
iterated = true;
|
|
1481
|
+
yield* source();
|
|
1482
|
+
}
|
|
1483
|
+
};
|
|
1484
|
+
},
|
|
1485
|
+
json: async () => {
|
|
1486
|
+
claim();
|
|
1487
|
+
const chunks = [];
|
|
1488
|
+
for await (const chunk of source())
|
|
1489
|
+
chunks.push(chunk);
|
|
1490
|
+
const value = JSON.parse(Buffer.concat(chunks).toString("utf8"));
|
|
1491
|
+
return value;
|
|
1492
|
+
}
|
|
1493
|
+
};
|
|
1494
|
+
return new Proxy(members, {
|
|
1495
|
+
get(target, member) {
|
|
1496
|
+
if (member === "status" || member === "reason" || member === "json" || member === "header" || member === "bytes") {
|
|
1497
|
+
return target[member];
|
|
1498
|
+
}
|
|
1499
|
+
if (member === "then" || typeof member === "symbol")
|
|
1500
|
+
return void 0;
|
|
1501
|
+
throw new Error(`the response member ${String(member)} is not implemented`);
|
|
1502
|
+
}
|
|
1503
|
+
});
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1085
1506
|
// packages/sdk-dispatch/dist/explain.js
|
|
1507
|
+
var BOUND_LABEL = {
|
|
1508
|
+
"request-body": "the request-body size",
|
|
1509
|
+
"query-limit": "the query page size",
|
|
1510
|
+
"concurrency-per-principal": "the concurrent-request limit per principal",
|
|
1511
|
+
"rate-per-principal": "the request-rate limit per principal",
|
|
1512
|
+
"rate-per-address": "the request-rate limit per address",
|
|
1513
|
+
"resolve-in-flight": "the concurrent name-resolution limit",
|
|
1514
|
+
"pending-sign-ins": "the pending sign-in limit"
|
|
1515
|
+
};
|
|
1086
1516
|
function explainKind(kind) {
|
|
1087
1517
|
if (!Object.hasOwn(BY_KIND, kind)) {
|
|
1088
1518
|
throw new Error(`the refusal kind ${JSON.stringify(kind)} has no entry in the refusal catalogue`);
|
|
1089
1519
|
}
|
|
1090
|
-
|
|
1520
|
+
const explanation = BY_KIND[kind];
|
|
1521
|
+
if (kind !== "bound-exceeded") {
|
|
1522
|
+
return Object.freeze({ explanation, explains: "kind" });
|
|
1523
|
+
}
|
|
1524
|
+
return Object.freeze({ explanation: withMeaning(explanation, "The exceeded limit is the request-body, query-page, concurrency, request-rate, address-rate, resolve-capacity or pending-sign-in limit."), explains: "kind" });
|
|
1525
|
+
}
|
|
1526
|
+
function withMeaning(explanation, detail) {
|
|
1527
|
+
return Object.freeze({ meaning: `${explanation.meaning} ${detail}`, next: explanation.next });
|
|
1091
1528
|
}
|
|
1092
1529
|
function explainClass(refusalClass) {
|
|
1093
1530
|
return Object.freeze({ explanation: BY_CLASS[refusalClass], explains: "class" });
|
|
@@ -1101,17 +1538,36 @@ function explainResultRefusal(rule, refusalClass) {
|
|
|
1101
1538
|
}
|
|
1102
1539
|
return explainClass(refusalClass);
|
|
1103
1540
|
}
|
|
1104
|
-
function explainRefused(refusal2) {
|
|
1105
|
-
|
|
1106
|
-
|
|
1541
|
+
function explainRefused(refusal2, request3) {
|
|
1542
|
+
const apiRule = Object.hasOwn(BY_API_RULE, refusal2.rule);
|
|
1543
|
+
const hasRuleExplanation = isRefusalRule(refusal2.rule) || apiRule;
|
|
1544
|
+
const explanation = isRefusalRule(refusal2.rule) ? BY_RULE[refusal2.rule] : apiRule ? BY_API_RULE[refusal2.rule] : BY_CLASS[refusal2.class];
|
|
1545
|
+
if (refusal2.rule === "ref-exists") {
|
|
1546
|
+
const input = typeof request3 === "object" && request3 !== null && !Array.isArray(request3) && "input" in request3 ? request3.input : void 0;
|
|
1547
|
+
const name = typeof input === "object" && input !== null && !Array.isArray(input) && "name" in input ? input.name : void 0;
|
|
1548
|
+
if (typeof name === "string") {
|
|
1549
|
+
return Object.freeze({ explanation: withMeaning(explanation, `The requested ref name is ${JSON.stringify(name)}.`), explains: hasRuleExplanation ? "rule" : "class" });
|
|
1550
|
+
}
|
|
1107
1551
|
}
|
|
1108
|
-
|
|
1552
|
+
if (refusal2.rule === "malformed-query" && refusal2.violations.length > 0) {
|
|
1553
|
+
const paths = refusal2.violations.map((violation) => violation.path.join(".") || "the request").join(", ");
|
|
1554
|
+
return Object.freeze({ explanation: withMeaning(explanation, `Invalid field path: ${paths}.`), explains: hasRuleExplanation ? "rule" : "class" });
|
|
1555
|
+
}
|
|
1556
|
+
if (refusal2.rule === "over-bound" && refusal2.violations.length > 0) {
|
|
1557
|
+
const paths = refusal2.violations.map((violation) => violation.path.join(".") || "the request").join(", ");
|
|
1558
|
+
return Object.freeze({ explanation: withMeaning(explanation, `The exceeded limit is ${paths}.`), explains: hasRuleExplanation ? "rule" : "class" });
|
|
1559
|
+
}
|
|
1560
|
+
return hasRuleExplanation ? Object.freeze({ explanation, explains: "rule" }) : explainClass(refusal2.class);
|
|
1109
1561
|
}
|
|
1110
|
-
function explainedRefusalOf(refusal2) {
|
|
1562
|
+
function explainedRefusalOf(refusal2, request3) {
|
|
1111
1563
|
if (refusal2.kind === "refused") {
|
|
1112
|
-
return Object.freeze({ ...refusal2, ...explainRefused(refusal2) });
|
|
1564
|
+
return Object.freeze({ ...refusal2, ...explainRefused(refusal2, request3) });
|
|
1565
|
+
}
|
|
1566
|
+
const explanation = explainKind(refusal2.kind);
|
|
1567
|
+
if (refusal2.kind === "bound-exceeded") {
|
|
1568
|
+
return Object.freeze({ ...refusal2, ...explanation, explanation: withMeaning(explanation.explanation, `The exceeded limit is ${BOUND_LABEL[refusal2.bound]}.`) });
|
|
1113
1569
|
}
|
|
1114
|
-
return Object.freeze({ ...refusal2, ...
|
|
1570
|
+
return Object.freeze({ ...refusal2, ...explanation });
|
|
1115
1571
|
}
|
|
1116
1572
|
function isRefusedResult(value) {
|
|
1117
1573
|
return typeof value === "object" && value !== null && !Array.isArray(value) && "kind" in value && value.kind === "refused";
|
|
@@ -1131,10 +1587,10 @@ function explainReplayedRefusal(replay) {
|
|
|
1131
1587
|
}
|
|
1132
1588
|
return explainResultRefusal(replay.rule, replay.class);
|
|
1133
1589
|
}
|
|
1134
|
-
function explainedEnvelopeOf(envelope) {
|
|
1590
|
+
function explainedEnvelopeOf(envelope, request3) {
|
|
1135
1591
|
if ("refusal" in envelope) {
|
|
1136
1592
|
const stamped = envelope.correlationId;
|
|
1137
|
-
return { version: envelope.version, refusal: explainedRefusalOf(envelope.refusal), correlationId: typeof stamped === "string" ? stamped : null };
|
|
1593
|
+
return { version: envelope.version, refusal: explainedRefusalOf(envelope.refusal, request3), correlationId: typeof stamped === "string" ? stamped : null };
|
|
1138
1594
|
}
|
|
1139
1595
|
if (envelope.replayed === true) {
|
|
1140
1596
|
const replay = envelope.result;
|
|
@@ -1164,39 +1620,12 @@ function unauthenticatedEnvelope() {
|
|
|
1164
1620
|
|
|
1165
1621
|
// packages/sdk-dispatch/dist/socket-transport.js
|
|
1166
1622
|
import { request } from "node:http";
|
|
1167
|
-
|
|
1168
|
-
// packages/sdk-dispatch/dist/response.js
|
|
1169
|
-
function responseOf(status, text, reason) {
|
|
1170
|
-
let read = false;
|
|
1171
|
-
const members = {
|
|
1172
|
-
status,
|
|
1173
|
-
...reason === void 0 || reason === "" ? {} : { reason },
|
|
1174
|
-
json: async () => {
|
|
1175
|
-
if (read) {
|
|
1176
|
-
throw new Error("the response body has already been read");
|
|
1177
|
-
}
|
|
1178
|
-
read = true;
|
|
1179
|
-
return JSON.parse(text);
|
|
1180
|
-
}
|
|
1181
|
-
};
|
|
1182
|
-
return new Proxy(members, {
|
|
1183
|
-
get(target, member) {
|
|
1184
|
-
if (member === "status" || member === "json") {
|
|
1185
|
-
return target[member];
|
|
1186
|
-
}
|
|
1187
|
-
if (member === "reason") {
|
|
1188
|
-
return target.reason;
|
|
1189
|
-
}
|
|
1190
|
-
if (member === "then" || typeof member === "symbol") {
|
|
1191
|
-
return void 0;
|
|
1192
|
-
}
|
|
1193
|
-
throw new Error(`the response member ${String(member)} is not implemented`);
|
|
1194
|
-
}
|
|
1195
|
-
});
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
// packages/sdk-dispatch/dist/socket-transport.js
|
|
1199
1623
|
var REQUEST_DEADLINE_MS = 1e4;
|
|
1624
|
+
function requestDeadlineOf(path, method, override) {
|
|
1625
|
+
if (override !== void 0)
|
|
1626
|
+
return override;
|
|
1627
|
+
return [...BINARY_REQUEST_ROUTE_NAMES, ...BINARY_RESPONSE_ROUTE_NAMES].some((name) => ROUTES[name].path === path && ROUTES[name].method === method) ? 12e4 : REQUEST_DEADLINE_MS;
|
|
1628
|
+
}
|
|
1200
1629
|
var HostOutcomeUnknown = class extends Error {
|
|
1201
1630
|
path;
|
|
1202
1631
|
reason;
|
|
@@ -1234,11 +1663,11 @@ var INIT_MEMBERS = Object.freeze(["method", "headers", "body", "signal"]);
|
|
|
1234
1663
|
function unsupported(member) {
|
|
1235
1664
|
return new Error(`the socket-bound request function does not implement ${member}`);
|
|
1236
1665
|
}
|
|
1237
|
-
function
|
|
1666
|
+
function isPlainObject2(value) {
|
|
1238
1667
|
return typeof value === "object" && value !== null && Object.getPrototypeOf(value) === Object.prototype;
|
|
1239
1668
|
}
|
|
1240
1669
|
function checkedInit(init) {
|
|
1241
|
-
if (!
|
|
1670
|
+
if (!isPlainObject2(init)) {
|
|
1242
1671
|
throw unsupported("an init that is not a plain object");
|
|
1243
1672
|
}
|
|
1244
1673
|
for (const member of Object.keys(init)) {
|
|
@@ -1250,7 +1679,7 @@ function checkedInit(init) {
|
|
|
1250
1679
|
if (typeof method !== "string") {
|
|
1251
1680
|
throw unsupported("a method that is not a string");
|
|
1252
1681
|
}
|
|
1253
|
-
if (!
|
|
1682
|
+
if (!isPlainObject2(headers)) {
|
|
1254
1683
|
throw unsupported("headers that are not a plain object of strings");
|
|
1255
1684
|
}
|
|
1256
1685
|
const sent = {};
|
|
@@ -1260,8 +1689,8 @@ function checkedInit(init) {
|
|
|
1260
1689
|
}
|
|
1261
1690
|
sent[name] = value;
|
|
1262
1691
|
}
|
|
1263
|
-
if (body !== void 0 && typeof body !== "string") {
|
|
1264
|
-
throw unsupported("a body that is
|
|
1692
|
+
if (body !== void 0 && typeof body !== "string" && !(body instanceof Uint8Array)) {
|
|
1693
|
+
throw unsupported("a body that is neither a string nor bytes");
|
|
1265
1694
|
}
|
|
1266
1695
|
if (signal !== void 0 && !(signal instanceof AbortSignal)) {
|
|
1267
1696
|
throw unsupported("a signal that is not an AbortSignal");
|
|
@@ -1269,7 +1698,7 @@ function checkedInit(init) {
|
|
|
1269
1698
|
return { method, headers: sent, body: body === void 0 ? null : body, signal: signal === void 0 ? null : signal };
|
|
1270
1699
|
}
|
|
1271
1700
|
var SOCKET_ORIGIN = "http://localhost";
|
|
1272
|
-
function createHostFetch(socketPath, deadlineMs
|
|
1701
|
+
function createHostFetch(socketPath, deadlineMs) {
|
|
1273
1702
|
return async (input, init) => {
|
|
1274
1703
|
if (typeof input !== "string") {
|
|
1275
1704
|
throw unsupported("an input that is not a string URL");
|
|
@@ -1286,7 +1715,9 @@ function createHostFetch(socketPath, deadlineMs = REQUEST_DEADLINE_MS) {
|
|
|
1286
1715
|
throw unsupported(`the protocol ${url.protocol}`);
|
|
1287
1716
|
}
|
|
1288
1717
|
const path = `${url.pathname}${url.search}`;
|
|
1718
|
+
const requestDeadlineMs = requestDeadlineOf(url.pathname, checked.method, deadlineMs);
|
|
1289
1719
|
return new Promise((resolve, reject) => {
|
|
1720
|
+
let responseBody = null;
|
|
1290
1721
|
let written = false;
|
|
1291
1722
|
let settled = false;
|
|
1292
1723
|
let deadline = null;
|
|
@@ -1306,14 +1737,28 @@ function createHostFetch(socketPath, deadlineMs = REQUEST_DEADLINE_MS) {
|
|
|
1306
1737
|
});
|
|
1307
1738
|
};
|
|
1308
1739
|
const outgoing = request({ socketPath, method: checked.method, path, headers: checked.headers }, (incoming) => {
|
|
1740
|
+
responseBody = incoming;
|
|
1741
|
+
const binary = BINARY_RESPONSE_ROUTE_NAMES.some((name) => ROUTES[name].path === url.pathname && ROUTES[name].method === checked.method);
|
|
1309
1742
|
const chunks = [];
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1743
|
+
if (binary) {
|
|
1744
|
+
if (incoming.statusCode === void 0) {
|
|
1745
|
+
settle2(() => reject(new Error("the host's response carried no status")));
|
|
1746
|
+
incoming.destroy();
|
|
1747
|
+
return;
|
|
1748
|
+
}
|
|
1749
|
+
resolve(responseOf(incoming.statusCode, incoming, incoming.statusMessage, incoming.headers));
|
|
1750
|
+
} else {
|
|
1751
|
+
incoming.on("data", (chunk) => {
|
|
1752
|
+
chunks.push(chunk);
|
|
1753
|
+
});
|
|
1754
|
+
}
|
|
1313
1755
|
incoming.on("error", lost);
|
|
1314
1756
|
incoming.on("close", () => {
|
|
1315
1757
|
if (!incoming.complete) {
|
|
1316
1758
|
lost(new Error("the connection closed before the whole response arrived"));
|
|
1759
|
+
} else {
|
|
1760
|
+
settle2(() => {
|
|
1761
|
+
});
|
|
1317
1762
|
}
|
|
1318
1763
|
});
|
|
1319
1764
|
incoming.on("end", () => {
|
|
@@ -1327,16 +1772,17 @@ function createHostFetch(socketPath, deadlineMs = REQUEST_DEADLINE_MS) {
|
|
|
1327
1772
|
reject(new Error("the host's response carried no status"));
|
|
1328
1773
|
return;
|
|
1329
1774
|
}
|
|
1330
|
-
|
|
1775
|
+
if (!binary)
|
|
1776
|
+
resolve(responseOf(status, Buffer.concat(chunks), reason, incoming.headers));
|
|
1331
1777
|
});
|
|
1332
1778
|
});
|
|
1333
1779
|
});
|
|
1334
1780
|
deadline = setTimeout(() => {
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1781
|
+
const error = new HostOutcomeUnknown(path, "deadline", `the host did not answer ${path} within the deadline of ${String(requestDeadlineMs)} ms`);
|
|
1782
|
+
settle2(() => reject(error));
|
|
1783
|
+
responseBody?.destroy(error);
|
|
1338
1784
|
outgoing.destroy();
|
|
1339
|
-
},
|
|
1785
|
+
}, requestDeadlineMs);
|
|
1340
1786
|
outgoing.on("finish", () => {
|
|
1341
1787
|
written = true;
|
|
1342
1788
|
});
|
|
@@ -1525,6 +1971,36 @@ async function readEnvelope(response, path) {
|
|
|
1525
1971
|
}
|
|
1526
1972
|
return envelope;
|
|
1527
1973
|
}
|
|
1974
|
+
function isByteStream(value) {
|
|
1975
|
+
return typeof value === "object" && value !== null && Symbol.asyncIterator in value && typeof value[Symbol.asyncIterator] === "function";
|
|
1976
|
+
}
|
|
1977
|
+
async function requestBodyOf(route2, body, headers) {
|
|
1978
|
+
if (!isBinaryRequestRoute(route2))
|
|
1979
|
+
return JSON.stringify(body);
|
|
1980
|
+
if (typeof body !== "object" || body === null || !("selector" in body) || !("input" in body)) {
|
|
1981
|
+
throw new TypeError("a binary request needs a selector and upload");
|
|
1982
|
+
}
|
|
1983
|
+
const input = body.input;
|
|
1984
|
+
if (typeof input !== "object" || input === null || !("name" in input) || typeof input.name !== "string" || !("body" in input) || !isByteStream(input.body)) {
|
|
1985
|
+
throw new TypeError("a binary upload needs a name and byte stream");
|
|
1986
|
+
}
|
|
1987
|
+
headers["content-type"] = "application/octet-stream";
|
|
1988
|
+
headers[ATTACHMENT_SELECTOR_HEADER] = JSON.stringify(body.selector);
|
|
1989
|
+
headers[ATTACHMENT_NAME_HEADER] = attachmentNameHeader(input.name);
|
|
1990
|
+
const chunks = [];
|
|
1991
|
+
let length = 0;
|
|
1992
|
+
for await (const chunk of input.body) {
|
|
1993
|
+
chunks.push(chunk);
|
|
1994
|
+
length += chunk.byteLength;
|
|
1995
|
+
}
|
|
1996
|
+
const bytes = new Uint8Array(length);
|
|
1997
|
+
let offset = 0;
|
|
1998
|
+
for (const chunk of chunks) {
|
|
1999
|
+
bytes.set(chunk, offset);
|
|
2000
|
+
offset += chunk.byteLength;
|
|
2001
|
+
}
|
|
2002
|
+
return bytes;
|
|
2003
|
+
}
|
|
1528
2004
|
async function call(transport, origin, route2, body, token, idempotencyKey) {
|
|
1529
2005
|
const entry2 = ROUTES[route2];
|
|
1530
2006
|
if (entry2.idempotent !== (idempotencyKey !== null)) {
|
|
@@ -1543,8 +2019,9 @@ async function call(transport, origin, route2, body, token, idempotencyKey) {
|
|
|
1543
2019
|
if (idempotencyKey !== null) {
|
|
1544
2020
|
headers[IDEMPOTENCY_HEADER] = idempotencyKey;
|
|
1545
2021
|
}
|
|
1546
|
-
const
|
|
1547
|
-
|
|
2022
|
+
const sent = await requestBodyOf(route2, body, headers);
|
|
2023
|
+
const response = await transport(`${origin}${entry2.path}`, { method: entry2.method, headers, body: sent });
|
|
2024
|
+
return explainedEnvelopeOf(await readEnvelope(response, entry2.path), body);
|
|
1548
2025
|
}
|
|
1549
2026
|
var StreamedRouteRefusal = class extends Error {
|
|
1550
2027
|
refusal;
|
|
@@ -1594,6 +2071,60 @@ async function* callStreamed(transport, origin, route2, body, token, signal) {
|
|
|
1594
2071
|
yield JSON.parse(line);
|
|
1595
2072
|
}
|
|
1596
2073
|
}
|
|
2074
|
+
function attachmentDescriptorOf(response) {
|
|
2075
|
+
const fault = () => new Error("the host answered /attachments/read with invalid attachment headers");
|
|
2076
|
+
const sha256 = response.header("x-oe2-attachment-sha256");
|
|
2077
|
+
const mediaType = response.header("content-type");
|
|
2078
|
+
const length = response.header("content-length");
|
|
2079
|
+
const disposition = response.header("content-disposition");
|
|
2080
|
+
const encodedName = disposition === null ? null : /;\s*filename\*=UTF-8''([^;]+)/i.exec(disposition)?.[1];
|
|
2081
|
+
if (sha256 === null || !/^[0-9a-f]{64}$/.test(sha256) || mediaType === null || mediaType.length === 0 || length === null || !/^(0|[1-9][0-9]*)$/.test(length) || !Number.isSafeInteger(Number(length)) || encodedName === null || encodedName === void 0)
|
|
2082
|
+
throw fault();
|
|
2083
|
+
let name;
|
|
2084
|
+
try {
|
|
2085
|
+
name = decodeURIComponent(encodedName);
|
|
2086
|
+
} catch (error) {
|
|
2087
|
+
if (!(error instanceof URIError))
|
|
2088
|
+
throw error;
|
|
2089
|
+
throw fault();
|
|
2090
|
+
}
|
|
2091
|
+
return { sha256, name, mediaType, bytes: Number(length) };
|
|
2092
|
+
}
|
|
2093
|
+
async function callAttachment(transport, origin, selector, input, token) {
|
|
2094
|
+
if (token === null)
|
|
2095
|
+
return unauthenticatedEnvelope();
|
|
2096
|
+
const entry2 = ROUTES.readAttachment;
|
|
2097
|
+
let response = await transport(`${origin}${entry2.path}`, {
|
|
2098
|
+
method: entry2.method,
|
|
2099
|
+
headers: {
|
|
2100
|
+
"content-type": "application/json",
|
|
2101
|
+
[VERSION_HEADER]: String(PROTOCOL_VERSION),
|
|
2102
|
+
[TOKEN_HEADER]: `Bearer ${token}`
|
|
2103
|
+
},
|
|
2104
|
+
body: JSON.stringify({ selector, input })
|
|
2105
|
+
});
|
|
2106
|
+
if ([302, 303, 307].includes(response.status)) {
|
|
2107
|
+
const location = response.header("location");
|
|
2108
|
+
if (location === null)
|
|
2109
|
+
throw new Error("the host answered /attachments/read with a redirect without Location");
|
|
2110
|
+
const target = new URL(location, origin);
|
|
2111
|
+
if (target.origin === new URL(origin).origin) {
|
|
2112
|
+
throw new Error("the host answered /attachments/read with a same-origin redirect");
|
|
2113
|
+
}
|
|
2114
|
+
const redirected = await fetch(target.href, {
|
|
2115
|
+
redirect: "follow",
|
|
2116
|
+
credentials: "omit",
|
|
2117
|
+
signal: AbortSignal.timeout(12e4)
|
|
2118
|
+
});
|
|
2119
|
+
if (redirected.body === null)
|
|
2120
|
+
throw new Error("the attachment redirect answered without a body");
|
|
2121
|
+
response = responseOf(redirected.status, redirected.body, redirected.statusText, Object.fromEntries(redirected.headers));
|
|
2122
|
+
}
|
|
2123
|
+
if (response.status !== 200)
|
|
2124
|
+
return explainedEnvelopeOf(await readEnvelope(response, entry2.path));
|
|
2125
|
+
const descriptor2 = attachmentDescriptorOf(response);
|
|
2126
|
+
return { version: PROTOCOL_VERSION, result: { descriptor: descriptor2, body: response.bytes() } };
|
|
2127
|
+
}
|
|
1597
2128
|
|
|
1598
2129
|
// packages/sdk-dispatch/dist/module-factory.js
|
|
1599
2130
|
function freezeDoc(doc2) {
|
|
@@ -1618,13 +2149,13 @@ function methodOf(entry2, transport, origin, token) {
|
|
|
1618
2149
|
headers[IDEMPOTENCY_HEADER] = idempotencyKey;
|
|
1619
2150
|
}
|
|
1620
2151
|
const response = await transport(`${origin}${entry2.path}`, { method: entry2.method, headers, body: JSON.stringify(body) });
|
|
1621
|
-
return explainedEnvelopeOf(await readEnvelope(response, entry2.path));
|
|
2152
|
+
return explainedEnvelopeOf(await readEnvelope(response, entry2.path), body);
|
|
1622
2153
|
};
|
|
1623
2154
|
return Object.freeze(Object.assign(send, { doc: freezeDoc(entry2.doc) }));
|
|
1624
2155
|
}
|
|
1625
|
-
function createModuleFactory(
|
|
2156
|
+
function createModuleFactory(entries7, transport, origin, token) {
|
|
1626
2157
|
const byCapability = {};
|
|
1627
|
-
for (const entry2 of
|
|
2158
|
+
for (const entry2 of entries7) {
|
|
1628
2159
|
const methods = byCapability[entry2.capability] ?? {};
|
|
1629
2160
|
methods[entry2.name] = methodOf(entry2, transport, origin, token);
|
|
1630
2161
|
byCapability[entry2.capability] = methods;
|
|
@@ -1633,9 +2164,9 @@ function createModuleFactory(entries6, transport, origin, token) {
|
|
|
1633
2164
|
}
|
|
1634
2165
|
|
|
1635
2166
|
// packages/sdk-dispatch/dist/typed-client.js
|
|
1636
|
-
function createTypedClient(names,
|
|
1637
|
-
const factory = createModuleFactory(
|
|
1638
|
-
const byName = new Map(
|
|
2167
|
+
function createTypedClient(names, entries7, transport, origin, token) {
|
|
2168
|
+
const factory = createModuleFactory(entries7, transport, origin, token);
|
|
2169
|
+
const byName = new Map(entries7.map((entry2) => [entry2.name, entry2]));
|
|
1639
2170
|
const client = {};
|
|
1640
2171
|
for (const name of names) {
|
|
1641
2172
|
const entry2 = byName.get(name);
|
|
@@ -1653,7 +2184,7 @@ function createTypedClient(names, entries6, transport, origin, token) {
|
|
|
1653
2184
|
|
|
1654
2185
|
// packages/sdk-dispatch/dist/https-transport.js
|
|
1655
2186
|
import { request as request2 } from "node:https";
|
|
1656
|
-
function createHttpsTransport(origin, options = {}, deadlineMs
|
|
2187
|
+
function createHttpsTransport(origin, options = {}, deadlineMs) {
|
|
1657
2188
|
const originUrl = new URL(origin);
|
|
1658
2189
|
if (originUrl.protocol !== "https:") {
|
|
1659
2190
|
throw new Error(`the origin ${origin} is not an https: URL`);
|
|
@@ -1663,7 +2194,9 @@ function createHttpsTransport(origin, options = {}, deadlineMs = REQUEST_DEADLIN
|
|
|
1663
2194
|
if (url.origin !== originUrl.origin) {
|
|
1664
2195
|
throw new Error(`the request ${input} is not on the transport's own origin ${originUrl.origin}`);
|
|
1665
2196
|
}
|
|
2197
|
+
const requestDeadlineMs = requestDeadlineOf(url.pathname, init.method, deadlineMs);
|
|
1666
2198
|
return new Promise((resolve, reject) => {
|
|
2199
|
+
let responseBody = null;
|
|
1667
2200
|
let written = false;
|
|
1668
2201
|
let settled = false;
|
|
1669
2202
|
let deadline = null;
|
|
@@ -1691,11 +2224,29 @@ function createHttpsTransport(origin, options = {}, deadlineMs = REQUEST_DEADLIN
|
|
|
1691
2224
|
headers: init.headers,
|
|
1692
2225
|
ca: options.ca
|
|
1693
2226
|
}, (incoming) => {
|
|
2227
|
+
responseBody = incoming;
|
|
2228
|
+
const binary = BINARY_RESPONSE_ROUTE_NAMES.some((name) => ROUTES[name].path === url.pathname && ROUTES[name].method === init.method);
|
|
1694
2229
|
const chunks = [];
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
2230
|
+
if (binary) {
|
|
2231
|
+
if (incoming.statusCode === void 0) {
|
|
2232
|
+
settle2(() => reject(new Error("the host's response carried no status")));
|
|
2233
|
+
incoming.destroy();
|
|
2234
|
+
return;
|
|
2235
|
+
}
|
|
2236
|
+
resolve(responseOf(incoming.statusCode, incoming, incoming.statusMessage, incoming.headers));
|
|
2237
|
+
} else {
|
|
2238
|
+
incoming.on("data", (chunk) => {
|
|
2239
|
+
chunks.push(chunk);
|
|
2240
|
+
});
|
|
2241
|
+
}
|
|
1698
2242
|
incoming.on("error", lost);
|
|
2243
|
+
incoming.on("close", () => {
|
|
2244
|
+
if (!incoming.complete)
|
|
2245
|
+
lost(new Error("the connection closed before the whole response arrived"));
|
|
2246
|
+
else
|
|
2247
|
+
settle2(() => {
|
|
2248
|
+
});
|
|
2249
|
+
});
|
|
1699
2250
|
incoming.on("end", () => {
|
|
1700
2251
|
const status = incoming.statusCode;
|
|
1701
2252
|
const reason = incoming.statusMessage;
|
|
@@ -1704,16 +2255,17 @@ function createHttpsTransport(origin, options = {}, deadlineMs = REQUEST_DEADLIN
|
|
|
1704
2255
|
reject(new Error("the host's response carried no status"));
|
|
1705
2256
|
return;
|
|
1706
2257
|
}
|
|
1707
|
-
|
|
2258
|
+
if (!binary)
|
|
2259
|
+
resolve(responseOf(status, Buffer.concat(chunks), reason, incoming.headers));
|
|
1708
2260
|
});
|
|
1709
2261
|
});
|
|
1710
2262
|
});
|
|
1711
2263
|
deadline = setTimeout(() => {
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
2264
|
+
const error = new HostOutcomeUnknown(path, "deadline", `the host did not answer ${path} within the deadline of ${String(requestDeadlineMs)} ms`);
|
|
2265
|
+
settle2(() => reject(error));
|
|
2266
|
+
responseBody?.destroy(error);
|
|
1715
2267
|
outgoing.destroy();
|
|
1716
|
-
},
|
|
2268
|
+
}, requestDeadlineMs);
|
|
1717
2269
|
outgoing.on("finish", () => {
|
|
1718
2270
|
written = true;
|
|
1719
2271
|
});
|
|
@@ -1760,6 +2312,9 @@ var ADMIN_ROUTE_NAMES = Object.freeze([
|
|
|
1760
2312
|
"grantMembership",
|
|
1761
2313
|
"revokeMembership",
|
|
1762
2314
|
"setModelConfiguration",
|
|
2315
|
+
"setModelId",
|
|
2316
|
+
"readModelConfigurationStatus",
|
|
2317
|
+
"readAccount",
|
|
1763
2318
|
"readDisplayNames",
|
|
1764
2319
|
"listMembers",
|
|
1765
2320
|
"changeMembershipRole",
|
|
@@ -1778,6 +2333,7 @@ var ADMIN_ROUTE_NAMES = Object.freeze([
|
|
|
1778
2333
|
"readWebOrigin",
|
|
1779
2334
|
"readCallerCapabilities",
|
|
1780
2335
|
"listAudit",
|
|
2336
|
+
"listOrganisationAudit",
|
|
1781
2337
|
"createProject",
|
|
1782
2338
|
"createOrganisation",
|
|
1783
2339
|
"addRefRule",
|
|
@@ -1847,6 +2403,7 @@ var BRANCHES_ROUTE_NAMES = Object.freeze([
|
|
|
1847
2403
|
"refuseProposal",
|
|
1848
2404
|
"readBranchDiff",
|
|
1849
2405
|
"diffBranches",
|
|
2406
|
+
"readChangeImpact",
|
|
1850
2407
|
"readBranchHistory",
|
|
1851
2408
|
"readRefHead",
|
|
1852
2409
|
"inspectBranchOperation",
|
|
@@ -1915,14 +2472,17 @@ function exploreViewAddress(address, state) {
|
|
|
1915
2472
|
if (state.setId !== void 0 && state.setId !== null && state.setId.length > 0) {
|
|
1916
2473
|
query2.set("set", state.setId);
|
|
1917
2474
|
}
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
2475
|
+
const types = state.typeKeys ?? (state.typeKey === null ? [] : [state.typeKey]);
|
|
2476
|
+
for (const key of [...new Set(types)].sort())
|
|
2477
|
+
query2.append("type", key);
|
|
1921
2478
|
if (state.objectId !== null) {
|
|
1922
2479
|
query2.set("object", state.objectId);
|
|
1923
2480
|
}
|
|
1924
2481
|
return query2.size === 0 ? path : `${path}?${query2.toString()}`;
|
|
1925
2482
|
}
|
|
2483
|
+
function exploreOpenObjectAddress(address, objectId) {
|
|
2484
|
+
return withViewState(typePageAddress(address), { object: objectId });
|
|
2485
|
+
}
|
|
1926
2486
|
function projectAddress(organisationId, projectId, ref) {
|
|
1927
2487
|
return withSubject(projectBase(organisationId, projectId), { ref, q: null });
|
|
1928
2488
|
}
|
|
@@ -1945,6 +2505,19 @@ function settingsAddress(organisationId, page) {
|
|
|
1945
2505
|
function proposalAddress(organisationId, projectId, proposalId, ref) {
|
|
1946
2506
|
return withSubject(`${projectBase(organisationId, projectId)}/reviews/${encodeURIComponent(proposalId)}`, { ref, q: null });
|
|
1947
2507
|
}
|
|
2508
|
+
function withViewState(address, state) {
|
|
2509
|
+
const split = address.indexOf("?");
|
|
2510
|
+
const path = split === -1 ? address : address.slice(0, split);
|
|
2511
|
+
const query2 = new URLSearchParams(split === -1 ? "" : address.slice(split + 1));
|
|
2512
|
+
for (const [name, value] of Object.entries(state)) {
|
|
2513
|
+
if (value === null || value === "") {
|
|
2514
|
+
query2.delete(name);
|
|
2515
|
+
} else {
|
|
2516
|
+
query2.set(name, value);
|
|
2517
|
+
}
|
|
2518
|
+
}
|
|
2519
|
+
return query2.size === 0 ? path : `${path}?${query2.toString()}`;
|
|
2520
|
+
}
|
|
1948
2521
|
function branchDiffAddress(organisationId, projectId, ref) {
|
|
1949
2522
|
return withSubject(`${projectBase(organisationId, projectId)}/branches/diff`, { ref, q: null });
|
|
1950
2523
|
}
|
|
@@ -1965,12 +2538,12 @@ function parseLinkSubject(value) {
|
|
|
1965
2538
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
1966
2539
|
return null;
|
|
1967
2540
|
}
|
|
1968
|
-
const
|
|
1969
|
-
const { kind } =
|
|
1970
|
-
const keys = Object.keys(
|
|
2541
|
+
const record2 = value;
|
|
2542
|
+
const { kind } = record2;
|
|
2543
|
+
const keys = Object.keys(record2);
|
|
1971
2544
|
const only = (...fields) => keys.length === fields.length + 1 && keys.includes("kind") && fields.every((field) => keys.includes(field));
|
|
1972
2545
|
const text = (field) => {
|
|
1973
|
-
const entry2 =
|
|
2546
|
+
const entry2 = record2[field];
|
|
1974
2547
|
return typeof entry2 === "string" && entry2.length > 0 ? entry2 : null;
|
|
1975
2548
|
};
|
|
1976
2549
|
const identifier = (field) => {
|
|
@@ -2046,9 +2619,23 @@ function linkPath(organisationId, projectId, subject, ref) {
|
|
|
2046
2619
|
}
|
|
2047
2620
|
}
|
|
2048
2621
|
|
|
2622
|
+
// packages/objects-sdk/dist/display.js
|
|
2623
|
+
function displayPropertyValue(value, definition) {
|
|
2624
|
+
if (typeof value === "number" && typeof definition === "object" && definition !== null && "kind" in definition && (definition.kind === "number" || definition.kind === "integer") && "unit" in definition && typeof definition.unit === "string") {
|
|
2625
|
+
return `${value} ${definition.unit}`;
|
|
2626
|
+
}
|
|
2627
|
+
if (typeof value === "string")
|
|
2628
|
+
return value;
|
|
2629
|
+
if (value === void 0)
|
|
2630
|
+
return "absent";
|
|
2631
|
+
return JSON.stringify(value);
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2049
2634
|
// packages/objects-sdk/dist/transport-client.js
|
|
2050
2635
|
var OBJECTS_ROUTE_ENTRIES = routeEntriesOf("objects-sdk");
|
|
2051
2636
|
var OBJECTS_ROUTE_NAMES = [
|
|
2637
|
+
"stageAttachment",
|
|
2638
|
+
"readAttachment",
|
|
2052
2639
|
"createObjectSet",
|
|
2053
2640
|
"listObjectSets",
|
|
2054
2641
|
"readObjectSet",
|
|
@@ -2056,6 +2643,7 @@ var OBJECTS_ROUTE_NAMES = [
|
|
|
2056
2643
|
"deleteObjectSet",
|
|
2057
2644
|
"readObject",
|
|
2058
2645
|
"queryObjects",
|
|
2646
|
+
"queryRows",
|
|
2059
2647
|
"aggregateObjects",
|
|
2060
2648
|
"discoverVerbs",
|
|
2061
2649
|
"readHistory",
|
|
@@ -2070,6 +2658,8 @@ var OBJECTS_ROUTE_NAMES = [
|
|
|
2070
2658
|
"queryGraph",
|
|
2071
2659
|
"readStructure",
|
|
2072
2660
|
"findPaths",
|
|
2661
|
+
"readLinkStatus",
|
|
2662
|
+
"clearLinks",
|
|
2073
2663
|
"searchPeople",
|
|
2074
2664
|
"searchObjectReaders",
|
|
2075
2665
|
"listSubscribers",
|
|
@@ -2081,19 +2671,627 @@ var OBJECTS_ROUTE_NAMES = [
|
|
|
2081
2671
|
"listApps",
|
|
2082
2672
|
"setObjectLock"
|
|
2083
2673
|
];
|
|
2674
|
+
var JSON_OBJECTS_ROUTE_NAMES = OBJECTS_ROUTE_NAMES.filter((name) => !isBinaryRequestRoute(name) && !BINARY_RESPONSE_ROUTE_NAMES.some((route2) => route2 === name));
|
|
2084
2675
|
function entries4() {
|
|
2085
|
-
return
|
|
2676
|
+
return JSON_OBJECTS_ROUTE_NAMES.map((name) => ROUTES[name]);
|
|
2086
2677
|
}
|
|
2087
2678
|
function createObjectsTransportClient(transport, origin, token) {
|
|
2088
|
-
return
|
|
2679
|
+
return Object.freeze({
|
|
2680
|
+
...createTypedClient(JSON_OBJECTS_ROUTE_NAMES, entries4(), transport, origin, token),
|
|
2681
|
+
readAttachment: (selector, input) => callAttachment(transport, origin, selector, input, token),
|
|
2682
|
+
stageAttachment: (selector, file) => call(transport, origin, "stageAttachment", {
|
|
2683
|
+
selector,
|
|
2684
|
+
input: { name: file.name, body: (async function* () {
|
|
2685
|
+
yield file.bytes;
|
|
2686
|
+
})() }
|
|
2687
|
+
}, token, null)
|
|
2688
|
+
});
|
|
2089
2689
|
}
|
|
2090
2690
|
|
|
2091
2691
|
// packages/schema-language/dist/version.js
|
|
2092
2692
|
var SCHEMA_LANGUAGE_VERSION = "1";
|
|
2093
2693
|
|
|
2694
|
+
// packages/schema-language/dist/attachment-classes.js
|
|
2695
|
+
var ATTACHMENT_CLASSES = {
|
|
2696
|
+
image: [
|
|
2697
|
+
{ mediaType: "image/png", extensions: [".png"] },
|
|
2698
|
+
{ mediaType: "image/jpeg", extensions: [".jpg", ".jpeg"] },
|
|
2699
|
+
{ mediaType: "image/webp", extensions: [".webp"] },
|
|
2700
|
+
{ mediaType: "image/gif", extensions: [".gif"] }
|
|
2701
|
+
],
|
|
2702
|
+
pdf: [{ mediaType: "application/pdf", extensions: [".pdf"] }],
|
|
2703
|
+
step: [{ mediaType: "model/step", extensions: [".step", ".stp"] }],
|
|
2704
|
+
mesh: [{ mediaType: "model/stl", extensions: [".stl"] }],
|
|
2705
|
+
text: [{
|
|
2706
|
+
mediaType: "text/plain; charset=utf-8",
|
|
2707
|
+
extensions: [
|
|
2708
|
+
".txt",
|
|
2709
|
+
".md",
|
|
2710
|
+
".csv",
|
|
2711
|
+
".json",
|
|
2712
|
+
".yaml",
|
|
2713
|
+
".yml",
|
|
2714
|
+
".toml",
|
|
2715
|
+
".ini",
|
|
2716
|
+
".log",
|
|
2717
|
+
".xml",
|
|
2718
|
+
".ts",
|
|
2719
|
+
".tsx",
|
|
2720
|
+
".js",
|
|
2721
|
+
".py",
|
|
2722
|
+
".c",
|
|
2723
|
+
".h",
|
|
2724
|
+
".cpp",
|
|
2725
|
+
".hpp",
|
|
2726
|
+
".rs",
|
|
2727
|
+
".go",
|
|
2728
|
+
".java",
|
|
2729
|
+
".m",
|
|
2730
|
+
".sql",
|
|
2731
|
+
".sh"
|
|
2732
|
+
]
|
|
2733
|
+
}]
|
|
2734
|
+
};
|
|
2735
|
+
|
|
2736
|
+
// packages/schema-language/dist/datetime.js
|
|
2737
|
+
var DATETIME_PATTERN = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,3}))?(?:(Z)|([+-])(\d{2}):(\d{2}))$/;
|
|
2738
|
+
var MILLISECONDS_PER_MINUTE = 6e4;
|
|
2739
|
+
function normaliseDatetime(text) {
|
|
2740
|
+
const match = DATETIME_PATTERN.exec(text);
|
|
2741
|
+
if (match === null) {
|
|
2742
|
+
return void 0;
|
|
2743
|
+
}
|
|
2744
|
+
const year = Number(match[1]);
|
|
2745
|
+
const month = Number(match[2]);
|
|
2746
|
+
const day = Number(match[3]);
|
|
2747
|
+
const hour = Number(match[4]);
|
|
2748
|
+
const minute = Number(match[5]);
|
|
2749
|
+
const second = Number(match[6]);
|
|
2750
|
+
const millisecond = match[7] === void 0 ? 0 : Number(match[7].padEnd(3, "0"));
|
|
2751
|
+
if (minute > 59 || second > 59) {
|
|
2752
|
+
return void 0;
|
|
2753
|
+
}
|
|
2754
|
+
const local = /* @__PURE__ */ new Date(0);
|
|
2755
|
+
local.setUTCFullYear(year, month - 1, day);
|
|
2756
|
+
local.setUTCHours(hour, minute, second, millisecond);
|
|
2757
|
+
if (local.getUTCMonth() !== month - 1 || local.getUTCDate() !== day) {
|
|
2758
|
+
return void 0;
|
|
2759
|
+
}
|
|
2760
|
+
let offsetMinutes = 0;
|
|
2761
|
+
if (match[8] === void 0) {
|
|
2762
|
+
const offsetHour = Number(match[10]);
|
|
2763
|
+
const offsetMinute = Number(match[11]);
|
|
2764
|
+
if (offsetHour > 23 || offsetMinute > 59) {
|
|
2765
|
+
return void 0;
|
|
2766
|
+
}
|
|
2767
|
+
offsetMinutes = (match[9] === "-" ? -1 : 1) * (offsetHour * 60 + offsetMinute);
|
|
2768
|
+
}
|
|
2769
|
+
const instant = new Date(local.getTime() - offsetMinutes * MILLISECONDS_PER_MINUTE);
|
|
2770
|
+
if (instant.getUTCFullYear() < 0 || instant.getUTCFullYear() > 9999) {
|
|
2771
|
+
return void 0;
|
|
2772
|
+
}
|
|
2773
|
+
return instant.toISOString();
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
// packages/schema-language/dist/identifiers.js
|
|
2777
|
+
function normaliseIdentifier(value) {
|
|
2778
|
+
return value.normalize("NFC").toLowerCase();
|
|
2779
|
+
}
|
|
2780
|
+
var PROTOTYPE_AFFECTING_KEYS = ["__proto__", "constructor", "prototype"];
|
|
2781
|
+
|
|
2782
|
+
// packages/schema-language/dist/units.js
|
|
2783
|
+
function unit(dimension, factor, affine = false) {
|
|
2784
|
+
return Object.freeze({ dimension, factor, affine });
|
|
2785
|
+
}
|
|
2786
|
+
var UNITS = Object.freeze({
|
|
2787
|
+
"1": unit("dimensionless", 1),
|
|
2788
|
+
"%": unit("dimensionless", 0.01),
|
|
2789
|
+
m: unit("length", 1),
|
|
2790
|
+
km: unit("length", 1e3),
|
|
2791
|
+
cm: unit("length", 0.01),
|
|
2792
|
+
mm: unit("length", 1e-3),
|
|
2793
|
+
um: unit("length", 1e-6),
|
|
2794
|
+
nm: unit("length", 1e-9),
|
|
2795
|
+
kg: unit("mass", 1),
|
|
2796
|
+
g: unit("mass", 1e-3),
|
|
2797
|
+
mg: unit("mass", 1e-6),
|
|
2798
|
+
ug: unit("mass", 1e-9),
|
|
2799
|
+
s: unit("time", 1),
|
|
2800
|
+
ms: unit("time", 1e-3),
|
|
2801
|
+
us: unit("time", 1e-6),
|
|
2802
|
+
ns: unit("time", 1e-9),
|
|
2803
|
+
min: unit("time", 60),
|
|
2804
|
+
h: unit("time", 3600),
|
|
2805
|
+
A: unit("current", 1),
|
|
2806
|
+
kA: unit("current", 1e3),
|
|
2807
|
+
mA: unit("current", 1e-3),
|
|
2808
|
+
uA: unit("current", 1e-6),
|
|
2809
|
+
K: unit("temperature", 1),
|
|
2810
|
+
// The factor is the linear scale only; an affine unit is convertible to itself alone.
|
|
2811
|
+
degC: unit("temperature", 1, true),
|
|
2812
|
+
degF: unit("temperature", 0.5555555555555556, true),
|
|
2813
|
+
mol: unit("amount", 1),
|
|
2814
|
+
mmol: unit("amount", 1e-3),
|
|
2815
|
+
cd: unit("luminous-intensity", 1),
|
|
2816
|
+
rad: unit("angle", 1),
|
|
2817
|
+
sr: unit("solid-angle", 1),
|
|
2818
|
+
"rad/s": unit("angular-speed", 1),
|
|
2819
|
+
rpm: unit("angular-speed", 0.10471975511965977),
|
|
2820
|
+
Hz: unit("frequency", 1),
|
|
2821
|
+
kHz: unit("frequency", 1e3),
|
|
2822
|
+
MHz: unit("frequency", 1e6),
|
|
2823
|
+
GHz: unit("frequency", 1e9),
|
|
2824
|
+
N: unit("force", 1),
|
|
2825
|
+
kN: unit("force", 1e3),
|
|
2826
|
+
mN: unit("force", 1e-3),
|
|
2827
|
+
Pa: unit("pressure", 1),
|
|
2828
|
+
kPa: unit("pressure", 1e3),
|
|
2829
|
+
MPa: unit("pressure", 1e6),
|
|
2830
|
+
GPa: unit("pressure", 1e9),
|
|
2831
|
+
bar: unit("pressure", 1e5),
|
|
2832
|
+
J: unit("energy", 1),
|
|
2833
|
+
kJ: unit("energy", 1e3),
|
|
2834
|
+
MJ: unit("energy", 1e6),
|
|
2835
|
+
W: unit("power", 1),
|
|
2836
|
+
mW: unit("power", 1e-3),
|
|
2837
|
+
kW: unit("power", 1e3),
|
|
2838
|
+
MW: unit("power", 1e6),
|
|
2839
|
+
C: unit("charge", 1),
|
|
2840
|
+
mC: unit("charge", 1e-3),
|
|
2841
|
+
V: unit("voltage", 1),
|
|
2842
|
+
mV: unit("voltage", 1e-3),
|
|
2843
|
+
uV: unit("voltage", 1e-6),
|
|
2844
|
+
kV: unit("voltage", 1e3),
|
|
2845
|
+
F: unit("capacitance", 1),
|
|
2846
|
+
mF: unit("capacitance", 1e-3),
|
|
2847
|
+
uF: unit("capacitance", 1e-6),
|
|
2848
|
+
nF: unit("capacitance", 1e-9),
|
|
2849
|
+
pF: unit("capacitance", 1e-12),
|
|
2850
|
+
ohm: unit("resistance", 1),
|
|
2851
|
+
kohm: unit("resistance", 1e3),
|
|
2852
|
+
Mohm: unit("resistance", 1e6),
|
|
2853
|
+
S: unit("conductance", 1),
|
|
2854
|
+
mS: unit("conductance", 1e-3),
|
|
2855
|
+
uS: unit("conductance", 1e-6),
|
|
2856
|
+
Wb: unit("magnetic-flux", 1),
|
|
2857
|
+
mWb: unit("magnetic-flux", 1e-3),
|
|
2858
|
+
T: unit("magnetic-flux-density", 1),
|
|
2859
|
+
mT: unit("magnetic-flux-density", 1e-3),
|
|
2860
|
+
uT: unit("magnetic-flux-density", 1e-6),
|
|
2861
|
+
H: unit("inductance", 1),
|
|
2862
|
+
mH: unit("inductance", 1e-3),
|
|
2863
|
+
uH: unit("inductance", 1e-6),
|
|
2864
|
+
lm: unit("luminous-flux", 1),
|
|
2865
|
+
lx: unit("illuminance", 1),
|
|
2866
|
+
Bq: unit("activity", 1),
|
|
2867
|
+
Gy: unit("absorbed-dose", 1),
|
|
2868
|
+
Sv: unit("equivalent-dose", 1),
|
|
2869
|
+
kat: unit("catalytic-activity", 1)
|
|
2870
|
+
});
|
|
2871
|
+
function isUnitSymbol(value) {
|
|
2872
|
+
return typeof value === "string" && Object.hasOwn(UNITS, value);
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
// packages/schema-language/dist/validate-value.js
|
|
2876
|
+
var RULE_TYPE_MISMATCH = "type-mismatch";
|
|
2877
|
+
var RULE_UNDECLARED_PROPERTY = "undeclared-property";
|
|
2878
|
+
var RULE_MISSING_REQUIRED_PROPERTY = "missing-required-property";
|
|
2879
|
+
var RULE_ENUM_VIOLATION = "enum-violation";
|
|
2880
|
+
var RULE_ARRAY_BOUND_EXCEEDED = "array-bound-exceeded";
|
|
2881
|
+
var RULE_INVALID_DATETIME = "invalid-datetime";
|
|
2882
|
+
function validateValue(schema, value) {
|
|
2883
|
+
const violations = [];
|
|
2884
|
+
walk(schema, value, [], violations);
|
|
2885
|
+
return violations.length === 0 ? { ok: true } : { ok: false, violations };
|
|
2886
|
+
}
|
|
2887
|
+
function walk(schema, value, path, violations, ownerProperties) {
|
|
2888
|
+
switch (schema.kind) {
|
|
2889
|
+
case "bound": {
|
|
2890
|
+
checkBound(value, path, violations, ownerProperties);
|
|
2891
|
+
return;
|
|
2892
|
+
}
|
|
2893
|
+
case "attachment": {
|
|
2894
|
+
if (!isAttachmentDescriptor(value))
|
|
2895
|
+
violations.push({ path, rule: "invalid-attachment" });
|
|
2896
|
+
return;
|
|
2897
|
+
}
|
|
2898
|
+
case "null": {
|
|
2899
|
+
if (value !== null) {
|
|
2900
|
+
violations.push({ path, rule: RULE_TYPE_MISMATCH });
|
|
2901
|
+
}
|
|
2902
|
+
return;
|
|
2903
|
+
}
|
|
2904
|
+
case "boolean": {
|
|
2905
|
+
if (typeof value !== "boolean") {
|
|
2906
|
+
violations.push({ path, rule: RULE_TYPE_MISMATCH });
|
|
2907
|
+
}
|
|
2908
|
+
return;
|
|
2909
|
+
}
|
|
2910
|
+
case "string":
|
|
2911
|
+
case "person": {
|
|
2912
|
+
if (typeof value !== "string") {
|
|
2913
|
+
violations.push({ path, rule: RULE_TYPE_MISMATCH });
|
|
2914
|
+
}
|
|
2915
|
+
return;
|
|
2916
|
+
}
|
|
2917
|
+
case "datetime": {
|
|
2918
|
+
if (typeof value !== "string") {
|
|
2919
|
+
violations.push({ path, rule: RULE_TYPE_MISMATCH });
|
|
2920
|
+
} else if (normaliseDatetime(value) === void 0) {
|
|
2921
|
+
violations.push({ path, rule: RULE_INVALID_DATETIME });
|
|
2922
|
+
}
|
|
2923
|
+
return;
|
|
2924
|
+
}
|
|
2925
|
+
case "number": {
|
|
2926
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
2927
|
+
violations.push({ path, rule: RULE_TYPE_MISMATCH });
|
|
2928
|
+
}
|
|
2929
|
+
return;
|
|
2930
|
+
}
|
|
2931
|
+
case "integer": {
|
|
2932
|
+
if (typeof value !== "number" || !Number.isInteger(value)) {
|
|
2933
|
+
violations.push({ path, rule: RULE_TYPE_MISMATCH });
|
|
2934
|
+
}
|
|
2935
|
+
return;
|
|
2936
|
+
}
|
|
2937
|
+
case "enum": {
|
|
2938
|
+
if (!schema.members.includes(value)) {
|
|
2939
|
+
violations.push({ path, rule: RULE_ENUM_VIOLATION });
|
|
2940
|
+
}
|
|
2941
|
+
return;
|
|
2942
|
+
}
|
|
2943
|
+
case "array": {
|
|
2944
|
+
if (!Array.isArray(value)) {
|
|
2945
|
+
violations.push({ path, rule: RULE_TYPE_MISMATCH });
|
|
2946
|
+
return;
|
|
2947
|
+
}
|
|
2948
|
+
if (value.length > schema.maxItems) {
|
|
2949
|
+
violations.push({ path, rule: RULE_ARRAY_BOUND_EXCEEDED });
|
|
2950
|
+
}
|
|
2951
|
+
value.forEach((item, index) => {
|
|
2952
|
+
walk(schema.items, item, [...path, String(index)], violations, ownerProperties);
|
|
2953
|
+
});
|
|
2954
|
+
return;
|
|
2955
|
+
}
|
|
2956
|
+
case "object": {
|
|
2957
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
2958
|
+
violations.push({ path, rule: RULE_TYPE_MISMATCH });
|
|
2959
|
+
return;
|
|
2960
|
+
}
|
|
2961
|
+
const record2 = value;
|
|
2962
|
+
for (const key of schema.required) {
|
|
2963
|
+
if (!Object.prototype.hasOwnProperty.call(record2, key)) {
|
|
2964
|
+
violations.push({ path: [...path, key], rule: RULE_MISSING_REQUIRED_PROPERTY });
|
|
2965
|
+
}
|
|
2966
|
+
}
|
|
2967
|
+
for (const key of Object.keys(record2)) {
|
|
2968
|
+
if (!Object.prototype.hasOwnProperty.call(schema.properties, key)) {
|
|
2969
|
+
violations.push({ path: [...path, key], rule: RULE_UNDECLARED_PROPERTY });
|
|
2970
|
+
continue;
|
|
2971
|
+
}
|
|
2972
|
+
walk(schema.properties[key], record2[key], [...path, key], violations, schema.properties);
|
|
2973
|
+
}
|
|
2974
|
+
return;
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
}
|
|
2978
|
+
var BOUND_FIELDS = ["quantity", "comparison", "value", "unit", "tolerance", "over"];
|
|
2979
|
+
var BOUND_COMPARISONS = ["<", "<=", ">", ">=", "within"];
|
|
2980
|
+
var BOUND_AGGREGATES = ["each", "sum", "min", "max", "count"];
|
|
2981
|
+
function isRecord(value) {
|
|
2982
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2983
|
+
}
|
|
2984
|
+
function isPropertyKey(value) {
|
|
2985
|
+
return typeof value === "string" && value.length > 0 && value.length <= 64 && !PROTOTYPE_AFFECTING_KEYS.includes(value);
|
|
2986
|
+
}
|
|
2987
|
+
function checkBound(value, path, violations, ownerProperties) {
|
|
2988
|
+
if (!isRecord(value)) {
|
|
2989
|
+
violations.push({ path, rule: "invalid-bound" });
|
|
2990
|
+
return;
|
|
2991
|
+
}
|
|
2992
|
+
for (const key of Object.keys(value)) {
|
|
2993
|
+
if (!BOUND_FIELDS.includes(key))
|
|
2994
|
+
violations.push({ path: [...path, key], rule: RULE_UNDECLARED_PROPERTY });
|
|
2995
|
+
}
|
|
2996
|
+
if (!Object.hasOwn(value, "over") || typeof value.over !== "string" || !BOUND_AGGREGATES.includes(value.over)) {
|
|
2997
|
+
violations.push({ path: [...path, "over"], rule: "invalid-bound-over" });
|
|
2998
|
+
}
|
|
2999
|
+
if (!Object.hasOwn(value, "comparison") || typeof value.comparison !== "string" || !BOUND_COMPARISONS.includes(value.comparison)) {
|
|
3000
|
+
violations.push({ path: [...path, "comparison"], rule: "invalid-bound-comparison" });
|
|
3001
|
+
}
|
|
3002
|
+
if (value.over === "count") {
|
|
3003
|
+
if (Object.hasOwn(value, "quantity")) {
|
|
3004
|
+
violations.push({ path: [...path, "quantity"], rule: "count-bound-quantity" });
|
|
3005
|
+
}
|
|
3006
|
+
} else if (!Object.hasOwn(value, "quantity") || !isPropertyKey(value.quantity)) {
|
|
3007
|
+
violations.push({ path: [...path, "quantity"], rule: "invalid-bound-quantity" });
|
|
3008
|
+
}
|
|
3009
|
+
if (!Object.hasOwn(value, "value")) {
|
|
3010
|
+
violations.push({ path: [...path, "value"], rule: "invalid-bound-value" });
|
|
3011
|
+
} else if (isRecord(value.value)) {
|
|
3012
|
+
checkBoundReference(value.value, value.over === "count", path, violations, ownerProperties);
|
|
3013
|
+
if (Object.hasOwn(value, "unit"))
|
|
3014
|
+
violations.push({ path: [...path, "unit"], rule: "bound-reference-unit" });
|
|
3015
|
+
} else if (typeof value.value !== "number" || !Number.isFinite(value.value)) {
|
|
3016
|
+
violations.push({ path: [...path, "value"], rule: "invalid-bound-value" });
|
|
3017
|
+
} else if (value.over === "count") {
|
|
3018
|
+
if (Object.hasOwn(value, "unit") && value.unit !== "1") {
|
|
3019
|
+
violations.push({ path: [...path, "unit"], rule: "count-bound-unit" });
|
|
3020
|
+
}
|
|
3021
|
+
} else if (!Object.hasOwn(value, "unit") || !isUnitSymbol(value.unit)) {
|
|
3022
|
+
violations.push({ path: [...path, "unit"], rule: "unknown-unit" });
|
|
3023
|
+
}
|
|
3024
|
+
if (value.comparison === "within") {
|
|
3025
|
+
if (!Object.hasOwn(value, "tolerance")) {
|
|
3026
|
+
violations.push({ path: [...path, "tolerance"], rule: "missing-bound-tolerance" });
|
|
3027
|
+
} else if (typeof value.tolerance !== "number" || !Number.isFinite(value.tolerance) || value.tolerance < 0) {
|
|
3028
|
+
violations.push({ path: [...path, "tolerance"], rule: "invalid-bound-tolerance" });
|
|
3029
|
+
}
|
|
3030
|
+
} else if (Object.hasOwn(value, "tolerance")) {
|
|
3031
|
+
violations.push({ path: [...path, "tolerance"], rule: "unexpected-bound-tolerance" });
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3034
|
+
function checkBoundReference(reference, count, path, violations, ownerProperties) {
|
|
3035
|
+
if (Object.keys(reference).length !== 1 || !Object.hasOwn(reference, "property") || !isPropertyKey(reference.property) || ownerProperties === void 0 || !Object.hasOwn(ownerProperties, reference.property)) {
|
|
3036
|
+
violations.push({ path: [...path, "value"], rule: "invalid-bound-reference" });
|
|
3037
|
+
return;
|
|
3038
|
+
}
|
|
3039
|
+
const property = ownerProperties[reference.property];
|
|
3040
|
+
if (property.kind !== "number" && property.kind !== "integer") {
|
|
3041
|
+
violations.push({ path: [...path, "value"], rule: "invalid-bound-reference" });
|
|
3042
|
+
} else if (count && property.unit !== void 0 && property.unit !== "1") {
|
|
3043
|
+
violations.push({ path: [...path, "value"], rule: "count-bound-unit" });
|
|
3044
|
+
}
|
|
3045
|
+
}
|
|
3046
|
+
function isAttachmentDescriptor(value) {
|
|
3047
|
+
if (typeof value !== "object" || value === null || Array.isArray(value) || !("sha256" in value) || !("name" in value) || !("mediaType" in value) || !("bytes" in value))
|
|
3048
|
+
return false;
|
|
3049
|
+
if (Object.keys(value).length !== 4 || !["sha256", "name", "mediaType", "bytes"].every((key) => Object.hasOwn(value, key)) || typeof value.sha256 !== "string" || value.sha256.length !== 64 || !/^[a-f0-9]{64}$/.test(value.sha256) || typeof value.name !== "string" || value.name.length < 1 || value.name.length > 255 || value.name.startsWith(".") || hasForbiddenNameCharacter(value.name) || typeof value.mediaType !== "string" || typeof value.bytes !== "number" || !Number.isSafeInteger(value.bytes) || value.bytes <= 0 || value.bytes > 26214400)
|
|
3050
|
+
return false;
|
|
3051
|
+
const name = value.name.toLowerCase();
|
|
3052
|
+
return Object.values(ATTACHMENT_CLASSES).some((formats) => formats.some((format) => format.mediaType === value.mediaType && format.extensions.some((extension) => name.endsWith(extension))));
|
|
3053
|
+
}
|
|
3054
|
+
function hasForbiddenNameCharacter(name) {
|
|
3055
|
+
for (let index = 0; index < name.length; index++) {
|
|
3056
|
+
const code = name.charCodeAt(index);
|
|
3057
|
+
if (name[index] === "/" || name[index] === "\\" || code < 32 || code >= 127 && code <= 159)
|
|
3058
|
+
return true;
|
|
3059
|
+
}
|
|
3060
|
+
return false;
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3063
|
+
// packages/schema-language/dist/language-version.js
|
|
3064
|
+
var KINDS_VERSION_1 = Object.freeze([
|
|
3065
|
+
"null",
|
|
3066
|
+
"boolean",
|
|
3067
|
+
"string",
|
|
3068
|
+
"number",
|
|
3069
|
+
"integer",
|
|
3070
|
+
"person",
|
|
3071
|
+
"enum",
|
|
3072
|
+
"array",
|
|
3073
|
+
"object"
|
|
3074
|
+
]);
|
|
3075
|
+
var KINDS_VERSION_2 = Object.freeze([...KINDS_VERSION_1, "datetime"]);
|
|
3076
|
+
var KINDS_VERSION_3 = Object.freeze([...KINDS_VERSION_2, "attachment"]);
|
|
3077
|
+
var KINDS_VERSION_4 = Object.freeze([...KINDS_VERSION_3, "bound"]);
|
|
3078
|
+
var KINDS_BY_LANGUAGE_VERSION = /* @__PURE__ */ new Map([
|
|
3079
|
+
["1", KINDS_VERSION_1],
|
|
3080
|
+
["2", KINDS_VERSION_2],
|
|
3081
|
+
["3", KINDS_VERSION_3],
|
|
3082
|
+
["4", KINDS_VERSION_4]
|
|
3083
|
+
]);
|
|
3084
|
+
function schemaKindsFor(languageVersion) {
|
|
3085
|
+
return KINDS_BY_LANGUAGE_VERSION.get(languageVersion);
|
|
3086
|
+
}
|
|
3087
|
+
|
|
3088
|
+
// packages/schema-language/dist/canonical-json.js
|
|
3089
|
+
function canonicalJson(value) {
|
|
3090
|
+
return JSON.stringify(sortKeys(value, /* @__PURE__ */ new Set()));
|
|
3091
|
+
}
|
|
3092
|
+
function utf8ByteLength(text) {
|
|
3093
|
+
return new TextEncoder().encode(text).length;
|
|
3094
|
+
}
|
|
3095
|
+
function sortKeys(value, ancestors) {
|
|
3096
|
+
if (Array.isArray(value)) {
|
|
3097
|
+
if (ancestors.has(value)) {
|
|
3098
|
+
return null;
|
|
3099
|
+
}
|
|
3100
|
+
ancestors.add(value);
|
|
3101
|
+
const sorted = value.map((item) => sortKeys(item, ancestors));
|
|
3102
|
+
ancestors.delete(value);
|
|
3103
|
+
return sorted;
|
|
3104
|
+
}
|
|
3105
|
+
if (value !== null && typeof value === "object") {
|
|
3106
|
+
if (ancestors.has(value)) {
|
|
3107
|
+
return null;
|
|
3108
|
+
}
|
|
3109
|
+
ancestors.add(value);
|
|
3110
|
+
const sorted = {};
|
|
3111
|
+
for (const key of Object.keys(value).sort()) {
|
|
3112
|
+
sorted[key] = sortKeys(value[key], ancestors);
|
|
3113
|
+
}
|
|
3114
|
+
ancestors.delete(value);
|
|
3115
|
+
return sorted;
|
|
3116
|
+
}
|
|
3117
|
+
return value;
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3120
|
+
// packages/schema-language/dist/limits.js
|
|
3121
|
+
var LIMITS_VERSION_1 = {
|
|
3122
|
+
maxDocumentBytes: 65536,
|
|
3123
|
+
maxDepth: 8,
|
|
3124
|
+
maxPropertiesPerObject: 256,
|
|
3125
|
+
maxArrayItems: 1024,
|
|
3126
|
+
maxIdentifierLength: 64
|
|
3127
|
+
};
|
|
3128
|
+
var LIMITS_BY_LANGUAGE_VERSION = /* @__PURE__ */ new Map([
|
|
3129
|
+
["1", LIMITS_VERSION_1],
|
|
3130
|
+
["2", LIMITS_VERSION_1],
|
|
3131
|
+
["3", LIMITS_VERSION_1],
|
|
3132
|
+
["4", LIMITS_VERSION_1]
|
|
3133
|
+
]);
|
|
3134
|
+
function limitsForLanguageVersion(languageVersion) {
|
|
3135
|
+
return LIMITS_BY_LANGUAGE_VERSION.get(languageVersion);
|
|
3136
|
+
}
|
|
3137
|
+
|
|
2094
3138
|
// packages/schema-language/dist/validate-schema.js
|
|
2095
|
-
var
|
|
2096
|
-
var
|
|
3139
|
+
var RULE_UNKNOWN_LANGUAGE_VERSION = "unknown-language-version";
|
|
3140
|
+
var RULE_SIZE = "size-limit";
|
|
3141
|
+
var RULE_DEPTH = "depth-limit";
|
|
3142
|
+
var RULE_FIELD_COUNT = "field-count-limit";
|
|
3143
|
+
var RULE_ARRAY_BOUND = "array-bound-limit";
|
|
3144
|
+
var RULE_IDENTIFIER_LENGTH = "identifier-length-limit";
|
|
3145
|
+
var RULE_PROTOTYPE_KEY = "prototype-key";
|
|
3146
|
+
var RULE_COLLISION = "identifier-collision";
|
|
3147
|
+
var RULE_RECURSIVE = "recursive-reference";
|
|
3148
|
+
var RULE_UNKNOWN_KIND = "unknown-kind";
|
|
3149
|
+
var RULE_MALFORMED_SCHEMA = "malformed-schema";
|
|
3150
|
+
var RULE_UNDECLARED_REQUIRED_KEY = "undeclared-required-key";
|
|
3151
|
+
function validateSchema(schema, languageVersion, category) {
|
|
3152
|
+
const limits = limitsForLanguageVersion(languageVersion);
|
|
3153
|
+
const kinds = schemaKindsFor(languageVersion);
|
|
3154
|
+
if (limits === void 0 || kinds === void 0) {
|
|
3155
|
+
return { ok: false, violations: [{ path: [], rule: RULE_UNKNOWN_LANGUAGE_VERSION }] };
|
|
3156
|
+
}
|
|
3157
|
+
if (typeof schema !== "object" || schema === null || Array.isArray(schema)) {
|
|
3158
|
+
return { ok: false, violations: [{ path: [], rule: RULE_MALFORMED_SCHEMA }] };
|
|
3159
|
+
}
|
|
3160
|
+
const sizeBytes = utf8ByteLength(canonicalJson(schema));
|
|
3161
|
+
if (sizeBytes > limits.maxDocumentBytes) {
|
|
3162
|
+
return { ok: false, violations: [{ path: [], rule: RULE_SIZE }] };
|
|
3163
|
+
}
|
|
3164
|
+
const violations = [];
|
|
3165
|
+
walk2(schema, [], 1, /* @__PURE__ */ new Set(), limits, kinds, category, violations);
|
|
3166
|
+
return violations.length === 0 ? { ok: true, schema } : { ok: false, violations };
|
|
3167
|
+
}
|
|
3168
|
+
function walk2(node, path, depth, ancestors, limits, kinds, category, violations) {
|
|
3169
|
+
if (ancestors.has(node)) {
|
|
3170
|
+
violations.push({ path, rule: RULE_RECURSIVE });
|
|
3171
|
+
return;
|
|
3172
|
+
}
|
|
3173
|
+
if (depth > limits.maxDepth) {
|
|
3174
|
+
violations.push({ path, rule: RULE_DEPTH });
|
|
3175
|
+
return;
|
|
3176
|
+
}
|
|
3177
|
+
if (typeof node !== "object" || node === null || Array.isArray(node)) {
|
|
3178
|
+
violations.push({ path, rule: RULE_MALFORMED_SCHEMA });
|
|
3179
|
+
return;
|
|
3180
|
+
}
|
|
3181
|
+
const record2 = node;
|
|
3182
|
+
const kind = record2.kind;
|
|
3183
|
+
if (typeof kind !== "string" || !kinds.includes(kind)) {
|
|
3184
|
+
violations.push({ path, rule: RULE_UNKNOWN_KIND, allowed: kinds });
|
|
3185
|
+
return;
|
|
3186
|
+
}
|
|
3187
|
+
ancestors.add(node);
|
|
3188
|
+
try {
|
|
3189
|
+
if (Object.hasOwn(record2, "unit")) {
|
|
3190
|
+
if (!kinds.includes("bound")) {
|
|
3191
|
+
violations.push({ path: [...path, "unit"], rule: "unit-language-version" });
|
|
3192
|
+
} else if (kind !== "number" && kind !== "integer") {
|
|
3193
|
+
violations.push({ path: [...path, "unit"], rule: "unit-kind" });
|
|
3194
|
+
} else if (!isUnitSymbol(record2.unit)) {
|
|
3195
|
+
violations.push({ path: [...path, "unit"], rule: "unknown-unit" });
|
|
3196
|
+
}
|
|
3197
|
+
}
|
|
3198
|
+
if (kind === "bound") {
|
|
3199
|
+
const topLevel = path.length === 2 && path[0] === "properties";
|
|
3200
|
+
const topLevelArray = path.length === 3 && path[0] === "properties" && path[2] === "items";
|
|
3201
|
+
if (category !== "object" || !topLevel && !topLevelArray) {
|
|
3202
|
+
violations.push({ path, rule: "bound-position" });
|
|
3203
|
+
}
|
|
3204
|
+
return;
|
|
3205
|
+
}
|
|
3206
|
+
if (kind === "attachment") {
|
|
3207
|
+
if (category !== "object" || path.length !== 2 || path[0] !== "properties") {
|
|
3208
|
+
violations.push({ path, rule: "attachment-position" });
|
|
3209
|
+
}
|
|
3210
|
+
if (!Array.isArray(record2.accept) || record2.accept.length === 0 || record2.accept.some((entry2) => typeof entry2 !== "string" || !Object.hasOwn(ATTACHMENT_CLASSES, entry2))) {
|
|
3211
|
+
violations.push({ path, rule: RULE_MALFORMED_SCHEMA });
|
|
3212
|
+
}
|
|
3213
|
+
return;
|
|
3214
|
+
}
|
|
3215
|
+
if (kind === "object") {
|
|
3216
|
+
const properties = record2.properties;
|
|
3217
|
+
if (typeof properties !== "object" || properties === null || Array.isArray(properties)) {
|
|
3218
|
+
violations.push({ path, rule: RULE_MALFORMED_SCHEMA });
|
|
3219
|
+
return;
|
|
3220
|
+
}
|
|
3221
|
+
if (!Array.isArray(record2.required) || !record2.required.every((key) => typeof key === "string")) {
|
|
3222
|
+
violations.push({ path, rule: RULE_MALFORMED_SCHEMA });
|
|
3223
|
+
return;
|
|
3224
|
+
}
|
|
3225
|
+
const propertyRecord = properties;
|
|
3226
|
+
const keys = Object.keys(propertyRecord);
|
|
3227
|
+
if (keys.length > limits.maxPropertiesPerObject) {
|
|
3228
|
+
violations.push({ path, rule: RULE_FIELD_COUNT });
|
|
3229
|
+
}
|
|
3230
|
+
checkIdentifiers(keys, path, limits, violations);
|
|
3231
|
+
for (const requiredKey of record2.required) {
|
|
3232
|
+
if (!keys.includes(requiredKey)) {
|
|
3233
|
+
violations.push({ path: [...path, requiredKey], rule: RULE_UNDECLARED_REQUIRED_KEY });
|
|
3234
|
+
}
|
|
3235
|
+
}
|
|
3236
|
+
for (const key of keys) {
|
|
3237
|
+
walk2(propertyRecord[key], [...path, "properties", key], depth + 1, ancestors, limits, kinds, category, violations);
|
|
3238
|
+
}
|
|
3239
|
+
return;
|
|
3240
|
+
}
|
|
3241
|
+
if (kind === "array") {
|
|
3242
|
+
if (typeof record2.maxItems !== "number" || !Number.isFinite(record2.maxItems)) {
|
|
3243
|
+
violations.push({ path, rule: RULE_MALFORMED_SCHEMA });
|
|
3244
|
+
return;
|
|
3245
|
+
}
|
|
3246
|
+
if (record2.maxItems > limits.maxArrayItems) {
|
|
3247
|
+
violations.push({ path, rule: RULE_ARRAY_BOUND });
|
|
3248
|
+
}
|
|
3249
|
+
walk2(record2.items, [...path, "items"], depth + 1, ancestors, limits, kinds, category, violations);
|
|
3250
|
+
return;
|
|
3251
|
+
}
|
|
3252
|
+
if (kind === "enum") {
|
|
3253
|
+
if (!Array.isArray(record2.members) || !record2.members.every((member) => typeof member === "string" || typeof member === "number" && Number.isFinite(member))) {
|
|
3254
|
+
violations.push({ path, rule: RULE_MALFORMED_SCHEMA });
|
|
3255
|
+
return;
|
|
3256
|
+
}
|
|
3257
|
+
const stringMembers = record2.members.filter((member) => typeof member === "string");
|
|
3258
|
+
checkIdentifiers(stringMembers, [...path, "members"], limits, violations);
|
|
3259
|
+
return;
|
|
3260
|
+
}
|
|
3261
|
+
} finally {
|
|
3262
|
+
ancestors.delete(node);
|
|
3263
|
+
}
|
|
3264
|
+
}
|
|
3265
|
+
function checkIdentifiers(names, path, limits, violations) {
|
|
3266
|
+
const byNormalised = /* @__PURE__ */ new Map();
|
|
3267
|
+
for (const name of names) {
|
|
3268
|
+
if (name.length > limits.maxIdentifierLength) {
|
|
3269
|
+
violations.push({ path: [...path, name], rule: RULE_IDENTIFIER_LENGTH });
|
|
3270
|
+
}
|
|
3271
|
+
if (PROTOTYPE_AFFECTING_KEYS.includes(name)) {
|
|
3272
|
+
violations.push({ path: [...path, name], rule: RULE_PROTOTYPE_KEY });
|
|
3273
|
+
}
|
|
3274
|
+
const normalised = normaliseIdentifier(name);
|
|
3275
|
+
const group = byNormalised.get(normalised);
|
|
3276
|
+
if (group) {
|
|
3277
|
+
group.push(name);
|
|
3278
|
+
} else {
|
|
3279
|
+
byNormalised.set(normalised, [name]);
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
3282
|
+
for (const group of byNormalised.values()) {
|
|
3283
|
+
if (group.length > 1) {
|
|
3284
|
+
for (const name of group) {
|
|
3285
|
+
violations.push({ path: [...path, name], rule: RULE_COLLISION });
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3290
|
+
|
|
3291
|
+
// packages/schema-language/dist/object-schema.js
|
|
3292
|
+
function objectSchemaOf(propertyDefinitions, requiredPropertyKeys) {
|
|
3293
|
+
return { kind: "object", properties: propertyDefinitions, required: requiredPropertyKeys };
|
|
3294
|
+
}
|
|
2097
3295
|
|
|
2098
3296
|
// packages/schema-language/dist/view-catalogue.js
|
|
2099
3297
|
var MAX_ELEMENT_CHILDREN = 100;
|
|
@@ -2185,10 +3383,42 @@ var VIEW_CATALOGUE = deepFreeze2({
|
|
|
2185
3383
|
views: ["object"],
|
|
2186
3384
|
role: "leaf",
|
|
2187
3385
|
props: {
|
|
2188
|
-
property: {
|
|
3386
|
+
property: {
|
|
3387
|
+
kind: "string",
|
|
3388
|
+
required: true,
|
|
3389
|
+
minLength: 1,
|
|
3390
|
+
maxLength: 64,
|
|
3391
|
+
propertyKey: true,
|
|
3392
|
+
attachmentClass: "mesh",
|
|
3393
|
+
error: "Unknown geometry property"
|
|
3394
|
+
},
|
|
2189
3395
|
label: { kind: "string", minLength: 1, maxLength: 160, error: "Invalid geometry label" }
|
|
2190
3396
|
}
|
|
2191
3397
|
},
|
|
3398
|
+
ImageViewer: {
|
|
3399
|
+
views: ["object"],
|
|
3400
|
+
role: "leaf",
|
|
3401
|
+
props: {
|
|
3402
|
+
property: { kind: "string", required: true, minLength: 1, maxLength: 64, propertyKey: true, attachmentClass: "image", error: "Unknown image property" },
|
|
3403
|
+
alt: { kind: "string", required: true, minLength: 1, maxLength: 500, error: "Invalid alternative text" }
|
|
3404
|
+
}
|
|
3405
|
+
},
|
|
3406
|
+
PdfViewer: {
|
|
3407
|
+
views: ["object"],
|
|
3408
|
+
role: "leaf",
|
|
3409
|
+
props: {
|
|
3410
|
+
property: {
|
|
3411
|
+
kind: "string",
|
|
3412
|
+
required: true,
|
|
3413
|
+
minLength: 1,
|
|
3414
|
+
maxLength: 64,
|
|
3415
|
+
propertyKey: true,
|
|
3416
|
+
attachmentClass: "pdf",
|
|
3417
|
+
error: "Unknown PDF property"
|
|
3418
|
+
},
|
|
3419
|
+
label: { kind: "string", minLength: 1, maxLength: 160, error: "Invalid PDF label" }
|
|
3420
|
+
}
|
|
3421
|
+
},
|
|
2192
3422
|
AppBody: {
|
|
2193
3423
|
views: ["app", "page"],
|
|
2194
3424
|
role: "container",
|
|
@@ -2284,11 +3514,22 @@ var VIEW_CATALOGUE = deepFreeze2({
|
|
|
2284
3514
|
Stat: {
|
|
2285
3515
|
views: ["object", "app", "page"],
|
|
2286
3516
|
role: "leaf",
|
|
3517
|
+
exactlyOneOf: { props: ["value", "aggregate"], error: "Invalid stat source" },
|
|
2287
3518
|
props: {
|
|
2288
3519
|
label: { kind: "string", required: true, minLength: 1, maxLength: 160, error: "Invalid stat label" },
|
|
2289
|
-
value: { kind: "scalar",
|
|
3520
|
+
value: { kind: "scalar", maxLength: 160, bindable: "read", error: "Invalid stat value" },
|
|
2290
3521
|
unit: { kind: "string", minLength: 1, maxLength: 32, error: "Invalid unit" },
|
|
2291
|
-
query: { kind: "string", minLength: 1, maxLength: 64, part: true, error: "Unknown query part" }
|
|
3522
|
+
query: { kind: "string", minLength: 1, maxLength: 64, part: true, error: "Unknown query part" },
|
|
3523
|
+
aggregate: { kind: "string", views: ["object", "app"], minLength: 1, maxLength: 64, aggregatePart: true, error: "Unknown aggregate part" }
|
|
3524
|
+
}
|
|
3525
|
+
},
|
|
3526
|
+
Aggregate: {
|
|
3527
|
+
views: ["object", "app"],
|
|
3528
|
+
role: "leaf",
|
|
3529
|
+
props: {
|
|
3530
|
+
reach: { kind: "json", required: true, error: "Invalid aggregate reach" },
|
|
3531
|
+
measure: { kind: "json", required: true, error: "Invalid aggregate measure" },
|
|
3532
|
+
ends: { kind: "choice", required: true, values: ["visible", "all"], error: "Invalid aggregate ends" }
|
|
2292
3533
|
}
|
|
2293
3534
|
},
|
|
2294
3535
|
Link: {
|
|
@@ -2481,30 +3722,50 @@ var VERB_TEMPLATE = deepFreeze3({
|
|
|
2481
3722
|
}
|
|
2482
3723
|
});
|
|
2483
3724
|
|
|
3725
|
+
// packages/objects-sdk/dist/validation.js
|
|
3726
|
+
function validateLocally(schema, languageVersion, value, category) {
|
|
3727
|
+
const checked = validateSchema(schema, languageVersion, category);
|
|
3728
|
+
return checked.ok ? validateValue(checked.schema, value) : { ok: false, violations: checked.violations };
|
|
3729
|
+
}
|
|
3730
|
+
function checkSampleAgainstChanges(changes, typeKey, sample) {
|
|
3731
|
+
const entries7 = entryChangesOf(changes);
|
|
3732
|
+
const document = Object.hasOwn(entries7, typeKey) ? entries7[typeKey] : void 0;
|
|
3733
|
+
if (document === void 0) {
|
|
3734
|
+
return { kind: "no-such-type" };
|
|
3735
|
+
}
|
|
3736
|
+
if (document.typeCategory === "verb") {
|
|
3737
|
+
return { kind: "no-properties" };
|
|
3738
|
+
}
|
|
3739
|
+
return {
|
|
3740
|
+
kind: "checked",
|
|
3741
|
+
result: validateLocally(objectSchemaOf(document.propertyDefinitions, document.requiredPropertyKeys), document.schemaLanguageVersion, sample, document.typeCategory)
|
|
3742
|
+
};
|
|
3743
|
+
}
|
|
3744
|
+
|
|
2484
3745
|
// packages/ontology-sdk/dist/type-delta.js
|
|
2485
3746
|
var NOT_COMPARED = /* @__PURE__ */ new Set(["typeCategory", "typeKey", "version"]);
|
|
2486
|
-
function
|
|
3747
|
+
function isRecord2(value) {
|
|
2487
3748
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2488
3749
|
}
|
|
2489
3750
|
function isStringList(value) {
|
|
2490
3751
|
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
2491
3752
|
}
|
|
2492
3753
|
function isStructureView(value) {
|
|
2493
|
-
if (!
|
|
3754
|
+
if (!isRecord2(value) || typeof value.key !== "string" || typeof value.label !== "string" || !isStringList(value.steps)) {
|
|
2494
3755
|
return false;
|
|
2495
3756
|
}
|
|
2496
3757
|
const { decoration } = value;
|
|
2497
|
-
return decoration === void 0 || Array.isArray(decoration) && decoration.every((entry2) =>
|
|
3758
|
+
return decoration === void 0 || Array.isArray(decoration) && decoration.every((entry2) => isRecord2(entry2) && typeof entry2.key === "string" && typeof entry2.label === "string");
|
|
2498
3759
|
}
|
|
2499
3760
|
function isStructureDeclaration(value) {
|
|
2500
|
-
if (!
|
|
3761
|
+
if (!isRecord2(value)) {
|
|
2501
3762
|
return false;
|
|
2502
3763
|
}
|
|
2503
3764
|
const { relationships, views } = value;
|
|
2504
3765
|
return (relationships === void 0 || isStringList(relationships)) && (views === void 0 || Array.isArray(views) && views.every(isStructureView));
|
|
2505
3766
|
}
|
|
2506
3767
|
function recordOf(value, what) {
|
|
2507
|
-
if (!
|
|
3768
|
+
if (!isRecord2(value)) {
|
|
2508
3769
|
throw new Error(`${what} is not an object`);
|
|
2509
3770
|
}
|
|
2510
3771
|
return value;
|
|
@@ -2561,7 +3822,8 @@ function edgeProspective(published) {
|
|
|
2561
3822
|
propertyDefinitions: recordOf(published.propertyDefinitions, `${what} propertyDefinitions`),
|
|
2562
3823
|
requiredPropertyKeys: stringListOf(published.requiredPropertyKeys, `${what} requiredPropertyKeys`),
|
|
2563
3824
|
readRule: oneOf(published.readRule, RULES, `${what} readRule`),
|
|
2564
|
-
writeRule: oneOf(published.writeRule, RULES, `${what} writeRule`)
|
|
3825
|
+
writeRule: oneOf(published.writeRule, RULES, `${what} writeRule`),
|
|
3826
|
+
...published.review === void 0 || published.review === null ? {} : { review: published.review }
|
|
2565
3827
|
};
|
|
2566
3828
|
}
|
|
2567
3829
|
function verbProspective(published) {
|
|
@@ -2593,7 +3855,7 @@ function sameValue(left, right) {
|
|
|
2593
3855
|
if (Array.isArray(left) || Array.isArray(right)) {
|
|
2594
3856
|
return Array.isArray(left) && Array.isArray(right) && left.length === right.length && left.every((item, index) => sameValue(item, right[index]));
|
|
2595
3857
|
}
|
|
2596
|
-
if (
|
|
3858
|
+
if (isRecord2(left) && isRecord2(right)) {
|
|
2597
3859
|
const leftKeys = Object.keys(left);
|
|
2598
3860
|
return leftKeys.length === Object.keys(right).length && leftKeys.every((key) => Object.hasOwn(right, key) && sameValue(left[key], right[key]));
|
|
2599
3861
|
}
|
|
@@ -2708,6 +3970,7 @@ var exitCodeOfRefusal = (refusal2) => {
|
|
|
2708
3970
|
|
|
2709
3971
|
// packages/cli/src/generated/help.ts
|
|
2710
3972
|
function schemasOf(entry2) {
|
|
3973
|
+
if (isBinaryRequestRoute(entry2.name)) throw new Error("this route takes a binary request body and has no JSON input schema");
|
|
2711
3974
|
return { input: ROUTE_INPUT_SCHEMAS[entry2.name], selector: entry2.selector === "none" ? null : SELECTOR_SCHEMAS[entry2.selector] };
|
|
2712
3975
|
}
|
|
2713
3976
|
var DEFS_PREFIX = "#/$defs/";
|
|
@@ -2762,7 +4025,7 @@ function kindMembers(schema, root) {
|
|
|
2762
4025
|
}
|
|
2763
4026
|
return members;
|
|
2764
4027
|
}
|
|
2765
|
-
var
|
|
4028
|
+
var isRecord3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2766
4029
|
function resolveField(field, schemas, sent) {
|
|
2767
4030
|
const [root, ...keys] = field.split(".");
|
|
2768
4031
|
let schema;
|
|
@@ -2783,47 +4046,53 @@ function resolveField(field, schemas, sent) {
|
|
|
2783
4046
|
if (schema === null) {
|
|
2784
4047
|
return null;
|
|
2785
4048
|
}
|
|
2786
|
-
let
|
|
2787
|
-
if (
|
|
2788
|
-
const members2 = kindMembers(
|
|
4049
|
+
let node2 = deref(schema, rootSchema);
|
|
4050
|
+
if (node2.oneOf !== void 0) {
|
|
4051
|
+
const members2 = kindMembers(node2, rootSchema);
|
|
2789
4052
|
const discriminator2 = members2?.[0]?.discriminator;
|
|
2790
4053
|
if (discriminator2 !== void 0 && key === discriminator2) {
|
|
2791
4054
|
return { allowedKinds: members2?.map((candidate) => candidate.kind) ?? [], discriminator: discriminator2 };
|
|
2792
4055
|
}
|
|
2793
|
-
const sentKind = discriminator2 !== void 0 &&
|
|
4056
|
+
const sentKind = discriminator2 !== void 0 && isRecord3(value) ? value[discriminator2] : void 0;
|
|
2794
4057
|
const chosen = members2?.find((candidate) => candidate.kind === sentKind);
|
|
2795
4058
|
if (chosen === void 0) {
|
|
2796
4059
|
return null;
|
|
2797
4060
|
}
|
|
2798
|
-
|
|
4061
|
+
node2 = chosen.member;
|
|
2799
4062
|
}
|
|
2800
|
-
if (
|
|
2801
|
-
if (
|
|
4063
|
+
if (node2.type === "array") {
|
|
4064
|
+
if (node2.items === void 0 || !Array.isArray(value) || !/^(0|[1-9]\d*)$/.test(key) || Number(key) >= value.length) {
|
|
2802
4065
|
return null;
|
|
2803
4066
|
}
|
|
2804
|
-
schema =
|
|
4067
|
+
schema = node2.items;
|
|
2805
4068
|
value = value[Number(key)];
|
|
2806
4069
|
continue;
|
|
2807
4070
|
}
|
|
2808
|
-
const property =
|
|
4071
|
+
const property = node2.properties?.[key];
|
|
2809
4072
|
if (property !== void 0) {
|
|
2810
4073
|
schema = property;
|
|
2811
|
-
} else if (typeof
|
|
2812
|
-
if (
|
|
4074
|
+
} else if (typeof node2.additionalProperties === "object") {
|
|
4075
|
+
if (isRecord3(value) && Object.keys(value).some((name) => name.includes("."))) {
|
|
2813
4076
|
return null;
|
|
2814
4077
|
}
|
|
2815
|
-
schema =
|
|
4078
|
+
schema = node2.additionalProperties;
|
|
2816
4079
|
} else {
|
|
2817
4080
|
return null;
|
|
2818
4081
|
}
|
|
2819
|
-
value =
|
|
4082
|
+
value = isRecord3(value) ? value[key] : void 0;
|
|
2820
4083
|
}
|
|
2821
4084
|
if (schema === null) {
|
|
2822
4085
|
return null;
|
|
2823
4086
|
}
|
|
2824
4087
|
const members = kindMembers(schema, rootSchema);
|
|
2825
4088
|
const discriminator = members?.[0]?.discriminator;
|
|
2826
|
-
|
|
4089
|
+
const node = deref(schema, rootSchema);
|
|
4090
|
+
const allowedValues = node.enum ?? (node.const === void 0 ? [] : [node.const]);
|
|
4091
|
+
return {
|
|
4092
|
+
allowedKinds: members?.map((candidate) => candidate.kind) ?? [],
|
|
4093
|
+
...allowedValues.length === 0 ? {} : { allowedValues },
|
|
4094
|
+
...discriminator === void 0 ? {} : { discriminator }
|
|
4095
|
+
};
|
|
2827
4096
|
}
|
|
2828
4097
|
var CORRELATION_FIELD = "correlation";
|
|
2829
4098
|
var DEPTH_LIMIT = 3;
|
|
@@ -2939,9 +4208,17 @@ function fieldLines(schema, root, indent) {
|
|
|
2939
4208
|
return lines;
|
|
2940
4209
|
}
|
|
2941
4210
|
function withoutCorrelation(example) {
|
|
2942
|
-
return
|
|
4211
|
+
return isRecord3(example) ? Object.fromEntries(Object.entries(example).filter(([name]) => name !== CORRELATION_FIELD)) : example;
|
|
2943
4212
|
}
|
|
2944
4213
|
function schemaHelpLines(entry2) {
|
|
4214
|
+
if (isBinaryRequestRoute(entry2.name)) {
|
|
4215
|
+
const binary = BINARY_REQUEST_INPUTS[entry2.name];
|
|
4216
|
+
return [
|
|
4217
|
+
`content-type: ${binary.contentType}`,
|
|
4218
|
+
`${binary.selectorHeader}: selector as JSON text`,
|
|
4219
|
+
`${binary.nameHeader}: attachment name as an RFC 8187 ext-value`
|
|
4220
|
+
];
|
|
4221
|
+
}
|
|
2945
4222
|
const schemas = schemasOf(entry2);
|
|
2946
4223
|
const input = fieldLines(schemas.input, schemas.input, " ");
|
|
2947
4224
|
const lines = ["input fields:", ...input.length === 0 ? [" none"] : input];
|
|
@@ -3011,12 +4288,75 @@ function explanationLines(heading, explanation) {
|
|
|
3011
4288
|
}
|
|
3012
4289
|
return lines;
|
|
3013
4290
|
}
|
|
4291
|
+
function displayExplanationOf(rule, explanation, merge = false) {
|
|
4292
|
+
if (rule === "merge-not-permitted" || merge && (rule === "not-permitted" || rule === "capability-missing")) {
|
|
4293
|
+
return {
|
|
4294
|
+
explains: explanation.explains,
|
|
4295
|
+
explanation: {
|
|
4296
|
+
meaning: `${explanation.explanation.meaning} The merge requires the \`branches.merge\` capability in the target scope.`,
|
|
4297
|
+
next: explanation.explanation.next
|
|
4298
|
+
}
|
|
4299
|
+
};
|
|
4300
|
+
}
|
|
4301
|
+
if (rule === "merge-conflict") {
|
|
4302
|
+
return {
|
|
4303
|
+
explains: explanation.explains,
|
|
4304
|
+
explanation: {
|
|
4305
|
+
meaning: "The merge found changes both branches made from their common base.",
|
|
4306
|
+
next: [{ option: "Read the conflict fields with readMergeConflicts, setting input.name to the source branch's name." }]
|
|
4307
|
+
}
|
|
4308
|
+
};
|
|
4309
|
+
}
|
|
4310
|
+
return rule === "not-a-ref-head" ? {
|
|
4311
|
+
explains: "rule",
|
|
4312
|
+
explanation: {
|
|
4313
|
+
meaning: "This branch has new commits since this review began.",
|
|
4314
|
+
next: [{ option: "Reload the proposal to review its latest commit." }]
|
|
4315
|
+
}
|
|
4316
|
+
} : explanation;
|
|
4317
|
+
}
|
|
4318
|
+
function branchNameRule(request3) {
|
|
4319
|
+
const input = request3.sent.input;
|
|
4320
|
+
const name = typeof input === "object" && input !== null && !Array.isArray(input) ? input.name : void 0;
|
|
4321
|
+
if (typeof name !== "string") {
|
|
4322
|
+
return "The branch name must be a string containing one ref segment.";
|
|
4323
|
+
}
|
|
4324
|
+
if (name.includes("/")) {
|
|
4325
|
+
return "The branch name must be one ref segment and cannot contain a slash.";
|
|
4326
|
+
}
|
|
4327
|
+
if (!/^[A-Za-z0-9._-]+$/.test(name)) {
|
|
4328
|
+
return "A ref segment uses only ASCII letters, digits, dot, underscore and hyphen.";
|
|
4329
|
+
}
|
|
4330
|
+
if (name.startsWith(".")) {
|
|
4331
|
+
return "A ref segment cannot start with a dot.";
|
|
4332
|
+
}
|
|
4333
|
+
if (name.endsWith(".")) {
|
|
4334
|
+
return "A ref segment cannot end with a dot.";
|
|
4335
|
+
}
|
|
4336
|
+
if (name.endsWith(".lock")) {
|
|
4337
|
+
return "A ref segment cannot end in .lock.";
|
|
4338
|
+
}
|
|
4339
|
+
if (name.includes("..")) {
|
|
4340
|
+
return "A ref segment cannot contain two consecutive dots.";
|
|
4341
|
+
}
|
|
4342
|
+
return "The branch name must fit the database's UTF-8 byte binding limit.";
|
|
4343
|
+
}
|
|
3014
4344
|
function refusalLines(refusal2, settle2, request3, host, reference) {
|
|
3015
|
-
const lines = explanationLines(refusalHeading(refusal2), refusal2);
|
|
4345
|
+
const lines = explanationLines(refusalHeading(refusal2), displayExplanationOf(refusal2.kind === "refused" ? refusal2.rule : void 0, refusal2, request3?.command === "openeng branches-sdk merge"));
|
|
4346
|
+
if (refusal2.kind === "refused" && refusal2.rule === "owned-type-not-presentation" && refusal2.detail !== void 0) {
|
|
4347
|
+
lines.push(`type: ${refusal2.detail.typeKey}; field: ${refusal2.detail.field}`);
|
|
4348
|
+
}
|
|
3016
4349
|
const allowed = allowedFieldOf(refusal2, request3);
|
|
4350
|
+
const allowedValues = allowed?.allowedValues ?? [];
|
|
3017
4351
|
if (request3 !== void 0 && allowed !== null && allowed.allowedKinds.length > 0 && allowed.discriminator !== void 0) {
|
|
3018
4352
|
lines.push(`allowed ${allowed.discriminator}: ${allowed.allowedKinds.join(", ")}`, `${request3.command} --help shows each shape`);
|
|
3019
4353
|
}
|
|
4354
|
+
if (request3 !== void 0 && allowedValues.length > 0) {
|
|
4355
|
+
lines.push(`allowed values: ${allowedValues.map((value) => JSON.stringify(value)).join(", ")}`);
|
|
4356
|
+
}
|
|
4357
|
+
if (request3?.command === "openeng branches-sdk createBranch" && refusal2.kind === "invalid-request" && refusal2.field === "input.name") {
|
|
4358
|
+
lines.push(`Branch name rule: ${branchNameRule(request3)}`);
|
|
4359
|
+
}
|
|
3020
4360
|
if (refusal2.kind === "unknown-outcome") {
|
|
3021
4361
|
lines.push(`The operation may or may not have taken effect, and openeng will not repeat it. Settle it with: ${settle2}`);
|
|
3022
4362
|
}
|
|
@@ -3029,6 +4369,9 @@ function refusalLines(refusal2, settle2, request3, host, reference) {
|
|
|
3029
4369
|
lines.push(`${versions}; the host did not read this CLI's protocol version (read: ${read})`);
|
|
3030
4370
|
}
|
|
3031
4371
|
}
|
|
4372
|
+
if (refusal2.kind === "protocol-mismatch") {
|
|
4373
|
+
lines.push("Update with: npm install -g @openengio/cli@latest");
|
|
4374
|
+
}
|
|
3032
4375
|
if (reference !== void 0) {
|
|
3033
4376
|
lines.push(`reference: ${reference}`);
|
|
3034
4377
|
}
|
|
@@ -3037,11 +4380,20 @@ function refusalLines(refusal2, settle2, request3, host, reference) {
|
|
|
3037
4380
|
function refusalValue(refusal2, settle2, request3, host, reference) {
|
|
3038
4381
|
const referenced = reference === void 0 ? {} : { reference };
|
|
3039
4382
|
if (refusal2.kind === "protocol-mismatch") {
|
|
3040
|
-
return { ...refusal2, clientVersion: PROTOCOL_VERSION, ...host === void 0 ? {} : { host }, ...referenced };
|
|
4383
|
+
return { ...refusal2, clientVersion: PROTOCOL_VERSION, update: "npm install -g @openengio/cli@latest", ...host === void 0 ? {} : { host }, ...referenced };
|
|
3041
4384
|
}
|
|
3042
4385
|
const allowed = allowedFieldOf(refusal2, request3);
|
|
3043
4386
|
const settled = refusal2.kind === "unknown-outcome" ? { ...refusal2, settle: settle2 } : refusal2;
|
|
3044
|
-
|
|
4387
|
+
const explained = refusal2.kind === "refused" ? { ...settled, ...displayExplanationOf(refusal2.rule, refusal2, request3?.command === "openeng branches-sdk merge") } : settled;
|
|
4388
|
+
if (allowed === null) {
|
|
4389
|
+
return { ...explained, ...referenced };
|
|
4390
|
+
}
|
|
4391
|
+
return {
|
|
4392
|
+
...explained,
|
|
4393
|
+
...allowed.allowedKinds.length === 0 ? {} : { allowedKinds: allowed.allowedKinds },
|
|
4394
|
+
...(allowed.allowedValues?.length ?? 0) === 0 ? {} : { allowedValues: allowed.allowedValues },
|
|
4395
|
+
...referenced
|
|
4396
|
+
};
|
|
3045
4397
|
}
|
|
3046
4398
|
function jsonLine(value) {
|
|
3047
4399
|
return `${JSON.stringify(value)}
|
|
@@ -3106,16 +4458,20 @@ var render = (outcome, json, scope, host) => {
|
|
|
3106
4458
|
const result = outcome.result;
|
|
3107
4459
|
const resultReference = typeof result.correlationId === "string" ? result.correlationId : void 0;
|
|
3108
4460
|
if (json) {
|
|
3109
|
-
const
|
|
4461
|
+
const explained = { ...result, ...displayExplanationOf(result.rule, result, result.rule === "merge-not-permitted") };
|
|
4462
|
+
const referenced = resultReference === void 0 ? explained : { ...explained, reference: resultReference };
|
|
3110
4463
|
return { exitCode, stdout: jsonLine(scopedValue(referenced, scope)), stderr: echo };
|
|
3111
4464
|
}
|
|
3112
|
-
const lines = explanationLines(`refused: ${typeof result.rule === "string" ? result.rule : "no rule named"}`, result);
|
|
4465
|
+
const lines = explanationLines(`refused: ${typeof result.rule === "string" ? result.rule : "no rule named"}`, displayExplanationOf(result.rule, result, result.rule === "merge-not-permitted"));
|
|
3113
4466
|
for (const conflict of result.conflicts ?? []) {
|
|
3114
4467
|
lines.push(`conflict: ${conflict.property}; current: ${conflict.current === null ? "absent" : JSON.stringify(conflict.current)}`);
|
|
3115
4468
|
}
|
|
3116
4469
|
for (const violation of result.violations ?? []) {
|
|
3117
4470
|
lines.push(`violation: ${violation.path.join(".")}; rule: ${violation.rule}`);
|
|
3118
4471
|
}
|
|
4472
|
+
if (typeof result.linkId === "string") {
|
|
4473
|
+
lines.push(`link: ${result.linkId}`);
|
|
4474
|
+
}
|
|
3119
4475
|
if (resultReference !== void 0) {
|
|
3120
4476
|
lines.push(`reference: ${resultReference}`);
|
|
3121
4477
|
}
|
|
@@ -3299,6 +4655,39 @@ import { join as join2 } from "node:path";
|
|
|
3299
4655
|
import { realpathSync } from "node:fs";
|
|
3300
4656
|
import { isAbsolute as isAbsolute2 } from "node:path";
|
|
3301
4657
|
|
|
4658
|
+
// packages/hosted-apps-sdk/dist/index.js
|
|
4659
|
+
var HOSTED_APPS_ROUTE_ENTRIES = routeEntriesOf("hosted-apps-sdk");
|
|
4660
|
+
var HOSTED_APPS_ROUTE_NAMES = Object.freeze([
|
|
4661
|
+
"createHostedApp",
|
|
4662
|
+
"readHostedBundle",
|
|
4663
|
+
"listHostedApps",
|
|
4664
|
+
"listHostedVersions",
|
|
4665
|
+
"revokeHostedApp",
|
|
4666
|
+
"revokeHostedVersion",
|
|
4667
|
+
"openHostedApp",
|
|
4668
|
+
"endHostedLaunch",
|
|
4669
|
+
"mintHostedAppToken",
|
|
4670
|
+
"setHostedOneWallSwitch",
|
|
4671
|
+
"readHostedOneWallSwitch",
|
|
4672
|
+
"grantHostedOneWall",
|
|
4673
|
+
"withdrawHostedOneWall",
|
|
4674
|
+
"listHostedOneWallGrants"
|
|
4675
|
+
]);
|
|
4676
|
+
function entries6() {
|
|
4677
|
+
return HOSTED_APPS_ROUTE_NAMES.map((name) => ROUTES[name]);
|
|
4678
|
+
}
|
|
4679
|
+
function createHostedAppsClient(transport, origin, token) {
|
|
4680
|
+
return Object.freeze({
|
|
4681
|
+
...createTypedClient(HOSTED_APPS_ROUTE_NAMES, entries6(), transport, origin, token),
|
|
4682
|
+
publishHostedVersion: (selector, file) => call(transport, origin, "publishHostedVersion", {
|
|
4683
|
+
selector,
|
|
4684
|
+
input: { name: file.appKey, body: (async function* () {
|
|
4685
|
+
yield file.bytes;
|
|
4686
|
+
})() }
|
|
4687
|
+
}, token, null)
|
|
4688
|
+
});
|
|
4689
|
+
}
|
|
4690
|
+
|
|
3302
4691
|
// packages/cli/src/session-store.ts
|
|
3303
4692
|
import { createHash, randomBytes } from "node:crypto";
|
|
3304
4693
|
import { chmodSync, closeSync, mkdirSync, openSync, readFileSync, renameSync, unlinkSync, writeSync } from "node:fs";
|
|
@@ -3375,27 +4764,61 @@ function quotedForSecurity(text) {
|
|
|
3375
4764
|
function failureOf(store, operation, command, result) {
|
|
3376
4765
|
return new SessionStoreError(store, operation, `${command} exited ${String(result.exitCode)} and wrote ${String(result.stderr.length)} characters to its standard error`);
|
|
3377
4766
|
}
|
|
4767
|
+
var KEYCHAIN_ENCODING = "openeng-session:v1:";
|
|
4768
|
+
function keychainTextOf(text) {
|
|
4769
|
+
let bytes;
|
|
4770
|
+
if (text.startsWith(KEYCHAIN_ENCODING)) {
|
|
4771
|
+
const encoded = text.slice(KEYCHAIN_ENCODING.length);
|
|
4772
|
+
bytes = Buffer.from(encoded, "base64");
|
|
4773
|
+
if (bytes.toString("base64") !== encoded) {
|
|
4774
|
+
throw new SessionStoreError("macos-keychain", "read", "the stored entry is not canonical base64");
|
|
4775
|
+
}
|
|
4776
|
+
} else if (/^(?:[0-9a-fA-F]{2})+$/.test(text)) {
|
|
4777
|
+
bytes = Buffer.from(text, "hex");
|
|
4778
|
+
} else {
|
|
4779
|
+
return text;
|
|
4780
|
+
}
|
|
4781
|
+
const decoded = bytes.toString("utf8");
|
|
4782
|
+
if (!Buffer.from(decoded, "utf8").equals(bytes)) {
|
|
4783
|
+
throw new SessionStoreError("macos-keychain", "read", "the stored entry is not UTF-8");
|
|
4784
|
+
}
|
|
4785
|
+
return decoded;
|
|
4786
|
+
}
|
|
4787
|
+
function keychainOutputOf(result) {
|
|
4788
|
+
return result.stdout.endsWith("\n") ? result.stdout.slice(0, -1) : result.stdout;
|
|
4789
|
+
}
|
|
4790
|
+
function keychainReadRequest(hostKey) {
|
|
4791
|
+
return { command: SECURITY, args: ["find-generic-password", "-a", hostKey, "-s", SERVICE, "-w"], stdin: "" };
|
|
4792
|
+
}
|
|
3378
4793
|
function macosStore(spawn2) {
|
|
3379
4794
|
const kind = "macos-keychain";
|
|
3380
4795
|
return {
|
|
3381
4796
|
kind,
|
|
3382
4797
|
async read(hostKey) {
|
|
3383
|
-
const result = await spawn2(
|
|
4798
|
+
const result = await spawn2(keychainReadRequest(hostKey));
|
|
3384
4799
|
if (result.exitCode === SECURITY_NOT_FOUND) {
|
|
3385
4800
|
return null;
|
|
3386
4801
|
}
|
|
3387
4802
|
if (result.exitCode !== 0) {
|
|
3388
4803
|
throw failureOf(kind, "read", "security", result);
|
|
3389
4804
|
}
|
|
3390
|
-
return entryOf(kind, hostKey,
|
|
4805
|
+
return entryOf(kind, hostKey, keychainTextOf(keychainOutputOf(result)));
|
|
3391
4806
|
},
|
|
3392
4807
|
async write(hostKey, session, organisation) {
|
|
3393
|
-
const
|
|
4808
|
+
const secret = KEYCHAIN_ENCODING + Buffer.from(secretOf(hostKey, session, organisation), "utf8").toString("base64");
|
|
4809
|
+
const command = ["add-generic-password", "-U", "-a", quotedForSecurity(hostKey), "-s", SERVICE, "-w", quotedForSecurity(secret)].join(" ");
|
|
3394
4810
|
const result = await spawn2({ command: SECURITY, args: ["-i"], stdin: `${command}
|
|
3395
4811
|
` });
|
|
3396
4812
|
if (result.exitCode !== 0 || result.stderr !== "") {
|
|
3397
4813
|
throw failureOf(kind, "write", "security -i", result);
|
|
3398
4814
|
}
|
|
4815
|
+
const stored = await spawn2(keychainReadRequest(hostKey));
|
|
4816
|
+
if (stored.exitCode !== 0 || stored.stderr !== "") {
|
|
4817
|
+
throw failureOf(kind, "write", "security read-back", stored);
|
|
4818
|
+
}
|
|
4819
|
+
if (keychainOutputOf(stored) !== secret) {
|
|
4820
|
+
throw new SessionStoreError(kind, "write", "the keychain did not retain the written entry");
|
|
4821
|
+
}
|
|
3399
4822
|
},
|
|
3400
4823
|
async delete(hostKey) {
|
|
3401
4824
|
const result = await spawn2({ command: SECURITY, args: ["delete-generic-password", "-a", hostKey, "-s", SERVICE], stdin: "" });
|
|
@@ -3464,11 +4887,11 @@ var createFileStore = (configDirectory) => {
|
|
|
3464
4887
|
try {
|
|
3465
4888
|
mkdirSync(directory, { recursive: true, mode: 448 });
|
|
3466
4889
|
chmodSync(directory, 448);
|
|
3467
|
-
const
|
|
4890
|
+
const descriptor2 = openSync(temporary, "wx", 384);
|
|
3468
4891
|
try {
|
|
3469
|
-
writeSync(
|
|
4892
|
+
writeSync(descriptor2, secretOf(hostKey, session, organisation));
|
|
3470
4893
|
} finally {
|
|
3471
|
-
closeSync(
|
|
4894
|
+
closeSync(descriptor2);
|
|
3472
4895
|
}
|
|
3473
4896
|
renameSync(temporary, final);
|
|
3474
4897
|
} catch (error) {
|
|
@@ -3597,6 +5020,7 @@ var buildClients = async (host, store, transport, streamTransport) => {
|
|
|
3597
5020
|
admin: createAdminClient(transport, origin, token),
|
|
3598
5021
|
agents: createAgentsClient(transport, origin, token),
|
|
3599
5022
|
branches: createBranchesClient(transport, origin, token),
|
|
5023
|
+
hostedApps: createHostedAppsClient(transport, origin, token),
|
|
3600
5024
|
objects: createObjectsTransportClient(transport, origin, token),
|
|
3601
5025
|
organisations: {
|
|
3602
5026
|
list: () => listOrganisations(transport, origin, token, { input: {} }),
|
|
@@ -3843,11 +5267,11 @@ async function takeLock(path, deps) {
|
|
|
3843
5267
|
let unreadableSince = null;
|
|
3844
5268
|
for (; ; ) {
|
|
3845
5269
|
try {
|
|
3846
|
-
const
|
|
5270
|
+
const descriptor2 = openSync2(path, "wx", 384);
|
|
3847
5271
|
try {
|
|
3848
|
-
writeSync2(
|
|
5272
|
+
writeSync2(descriptor2, text);
|
|
3849
5273
|
} finally {
|
|
3850
|
-
closeSync2(
|
|
5274
|
+
closeSync2(descriptor2);
|
|
3851
5275
|
}
|
|
3852
5276
|
return () => {
|
|
3853
5277
|
if (readLockText(path) === text) {
|
|
@@ -4099,6 +5523,26 @@ var REFRESH_UNANSWERED_ADVICE = [
|
|
|
4099
5523
|
"if the next command is refused, run `openeng login`"
|
|
4100
5524
|
].join(" ");
|
|
4101
5525
|
|
|
5526
|
+
// packages/cli/src/commands/object-display.ts
|
|
5527
|
+
function record(value) {
|
|
5528
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5529
|
+
}
|
|
5530
|
+
function objectText(object, catalogue) {
|
|
5531
|
+
const type = catalogue.objects.find((candidate) => candidate.typeKey === object.typeKey);
|
|
5532
|
+
if (type === void 0 || !record(type.propertyDefinitions) || !record(object.properties)) {
|
|
5533
|
+
throw new Error("the object or its catalogue has no readable property definitions");
|
|
5534
|
+
}
|
|
5535
|
+
const definitions = type.propertyDefinitions;
|
|
5536
|
+
const properties = Object.fromEntries(Object.entries(object.properties).map(([key, envelope]) => {
|
|
5537
|
+
if (!record(envelope) || !("value" in envelope) || !Object.hasOwn(definitions, key)) {
|
|
5538
|
+
throw new Error(`the object property ${key} has no declared value shape`);
|
|
5539
|
+
}
|
|
5540
|
+
const definition = definitions[key];
|
|
5541
|
+
return [key, typeof envelope.value === "number" && record(definition) && typeof definition.unit === "string" ? { ...envelope, value: displayPropertyValue(envelope.value, definition) } : envelope];
|
|
5542
|
+
}));
|
|
5543
|
+
return JSON.stringify({ ...object, properties }, null, 2);
|
|
5544
|
+
}
|
|
5545
|
+
|
|
4102
5546
|
// packages/cli/src/generated/build.ts
|
|
4103
5547
|
var ORGANISATION_BY_SUBJECT = {
|
|
4104
5548
|
project: "required",
|
|
@@ -4222,8 +5666,19 @@ async function runGenerated(entry2, context) {
|
|
|
4222
5666
|
}
|
|
4223
5667
|
const settle2 = settleOf(entry2, key.key);
|
|
4224
5668
|
let run2;
|
|
5669
|
+
let displayedObject;
|
|
4225
5670
|
try {
|
|
4226
5671
|
run2 = await runAuthenticated(context.host, context.deps, async (clients) => {
|
|
5672
|
+
if (entry2.name === "readObject" && !context.options.json) {
|
|
5673
|
+
const request3 = body.body;
|
|
5674
|
+
const answer2 = await clients.objects.readObject(request3);
|
|
5675
|
+
if ("refusal" in answer2 || answer2.replayed === true) return answer2;
|
|
5676
|
+
const catalogue = await clients.objects.readCatalogue({ selector: { projectId: request3.selector.projectId }, input: {} });
|
|
5677
|
+
if ("refusal" in catalogue) return answer2;
|
|
5678
|
+
if (catalogue.replayed === true) return catalogue;
|
|
5679
|
+
displayedObject = objectText(answer2.result, catalogue.result);
|
|
5680
|
+
return answer2;
|
|
5681
|
+
}
|
|
4227
5682
|
const method = clientOf(clients, entry2.module)?.[entry2.name];
|
|
4228
5683
|
if (typeof method === "function") {
|
|
4229
5684
|
return await method(body.body, key.key);
|
|
@@ -4271,7 +5726,7 @@ async function runGenerated(entry2, context) {
|
|
|
4271
5726
|
if (replayed) {
|
|
4272
5727
|
context.note("the host answered a replay of an earlier request that carried this idempotency key");
|
|
4273
5728
|
}
|
|
4274
|
-
return outcomeOfEnvelope(replayed ? withoutReplay(answer) : answer, settle2, (result) => JSON.stringify(result, null, 2), {
|
|
5729
|
+
return outcomeOfEnvelope(replayed ? withoutReplay(answer) : answer, settle2, (result) => displayedObject === void 0 ? JSON.stringify(result, null, 2) : displayedObject, {
|
|
4275
5730
|
command: `openeng ${entry2.module} ${entry2.name}`,
|
|
4276
5731
|
schemas: schemasOf(entry2),
|
|
4277
5732
|
sent: body.body
|
|
@@ -4287,8 +5742,8 @@ function generatedCommandOf(entry2) {
|
|
|
4287
5742
|
run: (context) => runGenerated(entry2, context)
|
|
4288
5743
|
};
|
|
4289
5744
|
}
|
|
4290
|
-
function generatedCommandsOf(
|
|
4291
|
-
const commands =
|
|
5745
|
+
function generatedCommandsOf(entries7) {
|
|
5746
|
+
const commands = entries7.filter((entry2) => !entry2.carriesCredential).map(generatedCommandOf);
|
|
4292
5747
|
const seen = /* @__PURE__ */ new Set();
|
|
4293
5748
|
for (const command of commands) {
|
|
4294
5749
|
const words = command.words.join(" ");
|
|
@@ -8573,6 +10028,8 @@ function choice(members) {
|
|
|
8573
10028
|
}
|
|
8574
10029
|
var REQUIREMENT_STATUSES = ["Draft", "In review", "Approved", "Baselined"];
|
|
8575
10030
|
var REQUIREMENT_PRIORITIES = ["Must", "Should", "Could"];
|
|
10031
|
+
var REQUIREMENT_VERIFICATION_METHODS = ["Test", "Analysis", "Inspection", "Demonstration"];
|
|
10032
|
+
var REQUIREMENT_CATEGORIES = ["Performance", "Interface", "Safety", "Environmental", "Regulatory"];
|
|
8576
10033
|
var SPECIFICATION_STATUSES = ["Draft", "In review", "Approved"];
|
|
8577
10034
|
var VERIFICATION_STATUSES = ["Planned", "In progress", "Passed", "Failed"];
|
|
8578
10035
|
var VERIFICATION_METHODS = ["Test", "Inspection", "Test and analysis", "Demonstration"];
|
|
@@ -8588,7 +10045,7 @@ var DEMO_OBJECT_TYPES = Object.freeze([
|
|
|
8588
10045
|
displayName: "System",
|
|
8589
10046
|
propertyDefinitions: { identifier: STRING, name: STRING, owner: PERSON },
|
|
8590
10047
|
requiredPropertyKeys: ["identifier", "name"],
|
|
8591
|
-
presentationBindings: { title: "name", typeIcon: "account_tree" },
|
|
10048
|
+
presentationBindings: { title: "name", typeIcon: "account_tree", propertyOrder: ["identifier", "name", "owner"] },
|
|
8592
10049
|
// A system's parent is the system it is contained by: contains' source is the parent, its
|
|
8593
10050
|
// target the child, so a system resolves its own parent through the same edge type.
|
|
8594
10051
|
structureDeclaration: { relationships: ["contains"] }
|
|
@@ -8596,9 +10053,20 @@ var DEMO_OBJECT_TYPES = Object.freeze([
|
|
|
8596
10053
|
{
|
|
8597
10054
|
typeKey: "requirement",
|
|
8598
10055
|
displayName: "Requirement",
|
|
8599
|
-
propertyDefinitions: {
|
|
8600
|
-
|
|
8601
|
-
|
|
10056
|
+
propertyDefinitions: {
|
|
10057
|
+
identifier: STRING,
|
|
10058
|
+
statement: STRING,
|
|
10059
|
+
status: choice(REQUIREMENT_STATUSES),
|
|
10060
|
+
priority: choice(REQUIREMENT_PRIORITIES),
|
|
10061
|
+
owner: PERSON,
|
|
10062
|
+
rationale: STRING,
|
|
10063
|
+
verificationMethod: choice(REQUIREMENT_VERIFICATION_METHODS),
|
|
10064
|
+
acceptanceCriteria: STRING,
|
|
10065
|
+
source: STRING,
|
|
10066
|
+
category: choice(REQUIREMENT_CATEGORIES)
|
|
10067
|
+
},
|
|
10068
|
+
requiredPropertyKeys: ["identifier", "statement", "status", "priority", "verificationMethod", "category"],
|
|
10069
|
+
presentationBindings: { title: "statement", typeIcon: "assignment", propertyOrder: ["identifier", "statement", "category", "status", "priority", "verificationMethod", "acceptanceCriteria", "rationale", "source", "owner"] },
|
|
8602
10070
|
structureDeclaration: { relationships: ["has-requirement"] }
|
|
8603
10071
|
},
|
|
8604
10072
|
{
|
|
@@ -8606,7 +10074,7 @@ var DEMO_OBJECT_TYPES = Object.freeze([
|
|
|
8606
10074
|
displayName: "Specification",
|
|
8607
10075
|
propertyDefinitions: { identifier: STRING, statement: STRING, status: choice(SPECIFICATION_STATUSES), owner: PERSON },
|
|
8608
10076
|
requiredPropertyKeys: ["identifier", "statement", "status"],
|
|
8609
|
-
presentationBindings: { title: "statement", typeIcon: "description" },
|
|
10077
|
+
presentationBindings: { title: "statement", typeIcon: "description", propertyOrder: ["identifier", "statement", "status", "owner"] },
|
|
8610
10078
|
structureDeclaration: { relationships: ["has-specification"] }
|
|
8611
10079
|
},
|
|
8612
10080
|
{
|
|
@@ -8614,7 +10082,7 @@ var DEMO_OBJECT_TYPES = Object.freeze([
|
|
|
8614
10082
|
displayName: "Verification",
|
|
8615
10083
|
propertyDefinitions: { identifier: STRING, statement: STRING, method: choice(VERIFICATION_METHODS), status: choice(VERIFICATION_STATUSES), owner: PERSON },
|
|
8616
10084
|
requiredPropertyKeys: ["identifier", "statement", "method", "status"],
|
|
8617
|
-
presentationBindings: { title: "statement", typeIcon: "fact_check" },
|
|
10085
|
+
presentationBindings: { title: "statement", typeIcon: "fact_check", propertyOrder: ["identifier", "statement", "method", "status", "owner"] },
|
|
8618
10086
|
structureDeclaration: { relationships: ["has-verification"] }
|
|
8619
10087
|
},
|
|
8620
10088
|
{
|
|
@@ -8622,7 +10090,7 @@ var DEMO_OBJECT_TYPES = Object.freeze([
|
|
|
8622
10090
|
displayName: "Risk",
|
|
8623
10091
|
propertyDefinitions: { identifier: STRING, statement: STRING, severity: choice(RISK_SEVERITIES), likelihood: choice(RISK_LIKELIHOODS), owner: PERSON },
|
|
8624
10092
|
requiredPropertyKeys: ["identifier", "statement", "severity", "likelihood"],
|
|
8625
|
-
presentationBindings: { title: "statement", typeIcon: "warning" },
|
|
10093
|
+
presentationBindings: { title: "statement", typeIcon: "warning", propertyOrder: ["identifier", "statement", "severity", "likelihood", "owner"] },
|
|
8626
10094
|
structureDeclaration: { relationships: ["has-risk"] }
|
|
8627
10095
|
},
|
|
8628
10096
|
{
|
|
@@ -8639,7 +10107,7 @@ var DEMO_OBJECT_TYPES = Object.freeze([
|
|
|
8639
10107
|
cadReference: STRING
|
|
8640
10108
|
},
|
|
8641
10109
|
requiredPropertyKeys: ["identifier", "name", "makeOrBuy", "lifecycleState"],
|
|
8642
|
-
presentationBindings: { title: "name", typeIcon: "precision_manufacturing" },
|
|
10110
|
+
presentationBindings: { title: "name", typeIcon: "precision_manufacturing", propertyOrder: ["identifier", "name", "makeOrBuy", "lifecycleState", "material", "mass", "cadReference", "owner"] },
|
|
8643
10111
|
structureDeclaration: {
|
|
8644
10112
|
relationships: ["has-part"],
|
|
8645
10113
|
views: [
|
|
@@ -8653,7 +10121,7 @@ var DEMO_OBJECT_TYPES = Object.freeze([
|
|
|
8653
10121
|
displayName: "BOM line",
|
|
8654
10122
|
propertyDefinitions: { reference: STRING, quantity: NUMBER, findNumber: NUMBER },
|
|
8655
10123
|
requiredPropertyKeys: ["reference", "quantity", "findNumber"],
|
|
8656
|
-
presentationBindings: { title: "reference", typeIcon: "format_list_numbered" },
|
|
10124
|
+
presentationBindings: { title: "reference", typeIcon: "format_list_numbered", propertyOrder: ["reference", "findNumber", "quantity"] },
|
|
8657
10125
|
// A BOM line's parent is the part that itemises it: itemises' source is the assembly part
|
|
8658
10126
|
// (parentEnd "source"), its target the BOM line, so a BOM line resolves its own parent
|
|
8659
10127
|
// through the same edge type `system` resolves its own parent through, above.
|
|
@@ -8664,7 +10132,7 @@ var DEMO_OBJECT_TYPES = Object.freeze([
|
|
|
8664
10132
|
displayName: "Revision",
|
|
8665
10133
|
propertyDefinitions: { name: STRING, code: STRING, state: choice(REVISION_STATES), changeNote: STRING },
|
|
8666
10134
|
requiredPropertyKeys: ["name", "code", "state", "changeNote"],
|
|
8667
|
-
presentationBindings: { title: "name", typeIcon: "history" },
|
|
10135
|
+
presentationBindings: { title: "name", typeIcon: "history", propertyOrder: ["name", "code", "state", "changeNote"] },
|
|
8668
10136
|
structureDeclaration: { relationships: ["has-revision"] }
|
|
8669
10137
|
},
|
|
8670
10138
|
{
|
|
@@ -8672,7 +10140,7 @@ var DEMO_OBJECT_TYPES = Object.freeze([
|
|
|
8672
10140
|
displayName: "Release",
|
|
8673
10141
|
propertyDefinitions: { identifier: STRING, name: STRING, status: choice(RELEASE_STATUSES), effectiveFrom: STRING },
|
|
8674
10142
|
requiredPropertyKeys: ["identifier", "name", "status"],
|
|
8675
|
-
presentationBindings: { title: "name", typeIcon: "verified" },
|
|
10143
|
+
presentationBindings: { title: "name", typeIcon: "verified", propertyOrder: ["identifier", "name", "status", "effectiveFrom"] },
|
|
8676
10144
|
structureDeclaration: { relationships: [] }
|
|
8677
10145
|
}
|
|
8678
10146
|
]);
|
|
@@ -8765,7 +10233,12 @@ function fullWorld(size, owner, data) {
|
|
|
8765
10233
|
statement: row.statement,
|
|
8766
10234
|
status: rotate(REQUIREMENT_STATUSES, index),
|
|
8767
10235
|
priority: rotate(REQUIREMENT_PRIORITIES, index),
|
|
8768
|
-
owner
|
|
10236
|
+
owner,
|
|
10237
|
+
rationale: row.rationale,
|
|
10238
|
+
verificationMethod: row.verificationMethod,
|
|
10239
|
+
acceptanceCriteria: row.acceptanceCriteria,
|
|
10240
|
+
source: row.source,
|
|
10241
|
+
category: row.category
|
|
8769
10242
|
}
|
|
8770
10243
|
})),
|
|
8771
10244
|
...data.specifications.map((row, index) => ({
|
|
@@ -8914,31 +10387,31 @@ var SYSTEM_TREE = [
|
|
|
8914
10387
|
{ identifier: "BOP-WW", name: "Water Wash System", parent: "BOP" }
|
|
8915
10388
|
];
|
|
8916
10389
|
var REQUIREMENTS = [
|
|
8917
|
-
{ identifier: "OCGT-REQ-001", statement: "The plant shall deliver a net electrical output of not less than 50 MW at ISO ambient conditions (15 \xB0C, 101.3 kPa, 60% relative humidity), measured at the high-voltage terminals of the step-up transformer.", derivesFrom: null, allocatedTo: "OCGT" },
|
|
8918
|
-
{ identifier: "OCGT-REQ-002", statement: "The net heat rate on natural gas, lower heating value basis, shall not exceed 10,800 kJ/kWh at ISO conditions and base load.", derivesFrom: null, allocatedTo: "OCGT" },
|
|
8919
|
-
{ identifier: "OCGT-REQ-003", statement: "The unit shall reach full load within 10 minutes of a start command from standstill.", derivesFrom: null, allocatedTo: "OCGT" },
|
|
8920
|
-
{ identifier: "OCGT-REQ-004", statement: "The unit shall sustain a load ramp rate of not less than 8 MW per minute between 40% and 100% load.", derivesFrom: null, allocatedTo: "OCGT" },
|
|
8921
|
-
{ identifier: "OCGT-REQ-005", statement: "Stack NOx shall not exceed 25 ppmvd corrected to 15% oxygen between 50% and 100% load on natural gas.", derivesFrom: null, allocatedTo: "OCGT" },
|
|
8922
|
-
{ identifier: "OCGT-REQ-006", statement: "Stack CO shall not exceed 25 ppmvd corrected to 15% oxygen between 50% and 100% load on natural gas.", derivesFrom: null, allocatedTo: "OCGT" },
|
|
8923
|
-
{ identifier: "OCGT-REQ-007", statement: "Sound pressure level shall not exceed 85 dB(A) at 1 m from any enclosure and 55 dB(A) at the site boundary.", derivesFrom: null, allocatedTo: "OCGT" },
|
|
8924
|
-
{ identifier: "OCGT-REQ-008", statement: "Plant availability shall be not less than 95% over a rolling 12-month period, excluding scheduled outages.", derivesFrom: null, allocatedTo: "OCGT" },
|
|
8925
|
-
{ identifier: "OCGT-REQ-009", statement: "The unit shall be designed for not fewer than 250 starts per year over a 25-year design life.", derivesFrom: null, allocatedTo: "OCGT" },
|
|
8926
|
-
{ identifier: "OCGT-REQ-010", statement: "No single failure shall cause an uncontrolled release of fuel gas or an unprotected overspeed event.", derivesFrom: null, allocatedTo: "OCGT" },
|
|
8927
|
-
{ identifier: "OCGT-REQ-101", statement: "The fuel gas system shall accept a supply pressure of 22 to 30 bar(g) and deliver conditioned gas to the combustor within \xB11% of the demanded flow.", derivesFrom: "OCGT-REQ-001", allocatedTo: "FGS" },
|
|
8928
|
-
{ identifier: "OCGT-REQ-102", statement: "Inlet air filtration shall limit clean pressure loss to not more than 1.0 kPa and remove particles above 0.3 \xB5m with not less than 99.5% efficiency.", derivesFrom: "OCGT-REQ-001", allocatedTo: "AIR-FH" },
|
|
8929
|
-
{ identifier: "OCGT-REQ-103", statement: "The compressor shall deliver a pressure ratio of not less than 16:1 at ISO base load.", derivesFrom: "OCGT-REQ-002", allocatedTo: "GT-CMP" },
|
|
8930
|
-
{ identifier: "OCGT-REQ-105", statement: "The burners shall hold stable lean premixed combustion between 50% and 100% load with dynamic pressure amplitude below 25 mbar rms.", derivesFrom: "OCGT-REQ-005", allocatedTo: "GT-CMB" },
|
|
8931
|
-
{ identifier: "OCGT-REQ-106", statement: "The fuel metering skid shall control fuel flow to within \xB10.5% of full scale over the load range.", derivesFrom: "OCGT-REQ-004", allocatedTo: "FGS-MS" },
|
|
8932
|
-
{ identifier: "OCGT-REQ-107", statement: "The starting system shall accelerate the rotor from turning gear to ignition speed in not more than 120 s.", derivesFrom: "OCGT-REQ-003", allocatedTo: "GEN" },
|
|
8933
|
-
{ identifier: "OCGT-REQ-108", statement: "Overspeed protection shall trip the fuel valves at 110% of rated speed through two independent channels.", derivesFrom: "OCGT-REQ-010", allocatedTo: "CPS-OS" },
|
|
8934
|
-
{ identifier: "OCGT-REQ-109", statement: "The emergency shutoff valves shall close within 1 s of a trip signal with seat leakage not worse than Class V.", derivesFrom: "OCGT-REQ-010", allocatedTo: "FGS-ESV" },
|
|
8935
|
-
{ identifier: "OCGT-REQ-110", statement: "Fire and gas detection shall alarm at 20% of the lower explosive limit and trip the unit at 40% in the enclosure.", derivesFrom: "OCGT-REQ-010", allocatedTo: "CPS-FG" },
|
|
8936
|
-
{ identifier: "OCGT-REQ-111", statement: "The exhaust silencer shall attenuate exhaust noise to not more than 70 dB(A) at 100 m.", derivesFrom: "OCGT-REQ-007", allocatedTo: "EXH-SL" },
|
|
8937
|
-
{ identifier: "OCGT-REQ-112", statement: "Enclosure ventilation shall keep enclosure air below 55 \xB0C and provide not fewer than 12 air changes per hour.", derivesFrom: "OCGT-REQ-010", allocatedTo: "ENC" },
|
|
8938
|
-
{ identifier: "OCGT-REQ-113", statement: "The lube oil system shall supply oil at 45 to 55 \xB0C and not less than 1.5 bar at the bearing headers, and shall carry the rotor through coast-down on loss of AC power.", derivesFrom: "OCGT-REQ-008", allocatedTo: "LOS" },
|
|
8939
|
-
{ identifier: "OCGT-REQ-114", statement: "The generator shall be rated at not less than 62.5 MVA at 0.8 power factor and 11 kV.", derivesFrom: "OCGT-REQ-001", allocatedTo: "GEN" },
|
|
8940
|
-
{ identifier: "OCGT-REQ-115", statement: "The step-up transformer shall transform 11 kV to 132 kV with load losses not exceeding 0.4% at rated load.", derivesFrom: "OCGT-REQ-001", allocatedTo: "ELE-TX" },
|
|
8941
|
-
{ identifier: "OCGT-REQ-116", statement: "The unit control system shall run the start sequence automatically with no operator action beyond the start command.", derivesFrom: "OCGT-REQ-003", allocatedTo: "CPS-UC" }
|
|
10390
|
+
{ identifier: "OCGT-REQ-001", statement: "The plant shall deliver a net electrical output of not less than 50 MW at ISO ambient conditions (15 \xB0C, 101.3 kPa, 60% relative humidity), measured at the high-voltage terminals of the step-up transformer.", derivesFrom: null, allocatedTo: "OCGT", rationale: "The 50 MW peaking contract sets the plant's revenue; ISO conditions give a common basis for comparing bids and measured performance.", verificationMethod: "Test", acceptanceCriteria: "Corrected net output at the transformer high-voltage terminals is at least 50.0 MW in the acceptance performance test.", source: "Grid peaking capacity agreement, schedule 2", category: "Performance" },
|
|
10391
|
+
{ identifier: "OCGT-REQ-002", statement: "The net heat rate on natural gas, lower heating value basis, shall not exceed 10,800 kJ/kWh at ISO conditions and base load.", derivesFrom: null, allocatedTo: "OCGT", rationale: "Fuel is the dominant operating cost of a peaking plant, and the heat rate sets the dispatch price against the market.", verificationMethod: "Test", acceptanceCriteria: "Corrected net heat rate on natural gas (LHV) is at most 10,800 kJ/kWh at base load.", source: "Grid peaking capacity agreement, schedule 2", category: "Performance" },
|
|
10392
|
+
{ identifier: "OCGT-REQ-003", statement: "The unit shall reach full load within 10 minutes of a start command from standstill.", derivesFrom: null, allocatedTo: "OCGT", rationale: "A peaker earns most when it answers a short-notice call; a slow start loses dispatch hours.", verificationMethod: "Demonstration", acceptanceCriteria: "Ten consecutive cold starts reach full load in no more than 10 minutes each.", source: "Grid operator ancillary service rules, fast start class", category: "Performance" },
|
|
10393
|
+
{ identifier: "OCGT-REQ-004", statement: "The unit shall sustain a load ramp rate of not less than 8 MW per minute between 40% and 100% load.", derivesFrom: null, allocatedTo: "OCGT", rationale: "The ramp rate lets the plant follow the grid operator's set-point changes without penalty.", verificationMethod: "Test", acceptanceCriteria: "Recorded ramp between 40% and 100% load averages at least 8 MW per minute.", source: "Grid operator ancillary service rules, ramp clause", category: "Performance" },
|
|
10394
|
+
{ identifier: "OCGT-REQ-005", statement: "Stack NOx shall not exceed 25 ppmvd corrected to 15% oxygen between 50% and 100% load on natural gas.", derivesFrom: null, allocatedTo: "OCGT", rationale: "The air permit caps NOx; the limit has to hold across the load range the plant will run in.", verificationMethod: "Test", acceptanceCriteria: "Extractive analyser readings at 50%, 75% and 100% load are all at or below 25 ppmvd at 15% O2.", source: "Site air permit, condition 4", category: "Environmental" },
|
|
10395
|
+
{ identifier: "OCGT-REQ-006", statement: "Stack CO shall not exceed 25 ppmvd corrected to 15% oxygen between 50% and 100% load on natural gas.", derivesFrom: null, allocatedTo: "OCGT", rationale: "The air permit caps CO; low-load combustion can raise CO, so the limit applies down to 50% load.", verificationMethod: "Test", acceptanceCriteria: "Extractive analyser readings at 50%, 75% and 100% load are all at or below 25 ppmvd at 15% O2.", source: "Site air permit, condition 5", category: "Environmental" },
|
|
10396
|
+
{ identifier: "OCGT-REQ-007", statement: "Sound pressure level shall not exceed 85 dB(A) at 1 m from any enclosure and 55 dB(A) at the site boundary.", derivesFrom: null, allocatedTo: "OCGT", rationale: "Neighbours and the planning consent limit noise at the boundary; the enclosure limit protects operators.", verificationMethod: "Test", acceptanceCriteria: "Survey results are at most 85 dB(A) at 1 m from every enclosure and 55 dB(A) at the site boundary.", source: "Planning consent, noise condition 12", category: "Environmental" },
|
|
10397
|
+
{ identifier: "OCGT-REQ-008", statement: "Plant availability shall be not less than 95% over a rolling 12-month period, excluding scheduled outages.", derivesFrom: null, allocatedTo: "OCGT", rationale: "The capacity agreement pays on availability, and a lower figure triggers a penalty.", verificationMethod: "Inspection", acceptanceCriteria: "Outage records over the 12-month reliability run show availability of at least 95%, scheduled outages excluded.", source: "Grid peaking capacity agreement, schedule 4", category: "Performance" },
|
|
10398
|
+
{ identifier: "OCGT-REQ-009", statement: "The unit shall be designed for not fewer than 250 starts per year over a 25-year design life.", derivesFrom: null, allocatedTo: "OCGT", rationale: "A peaker starts often; the hot gas path life is consumed by starts as much as by running hours.", verificationMethod: "Analysis", acceptanceCriteria: "Low-cycle fatigue assessment shows no hot gas path part reaches its life limit within 250 starts per year over 25 years.", source: "Owner's technical specification, section 3.4", category: "Performance" },
|
|
10399
|
+
{ identifier: "OCGT-REQ-010", statement: "No single failure shall cause an uncontrolled release of fuel gas or an unprotected overspeed event.", derivesFrom: null, allocatedTo: "OCGT", rationale: "A single fault must never release fuel gas or let the rotor overspeed; both events are potentially fatal.", verificationMethod: "Analysis", acceptanceCriteria: "The hazard and operability review and the trip matrix functional test find no single failure that releases fuel gas or defeats overspeed protection.", source: "Functional safety standard IEC 61511, owner's safety case", category: "Safety" },
|
|
10400
|
+
{ identifier: "OCGT-REQ-101", statement: "The fuel gas system shall accept a supply pressure of 22 to 30 bar(g) and deliver conditioned gas to the combustor within \xB11% of the demanded flow.", derivesFrom: "OCGT-REQ-001", allocatedTo: "FGS", rationale: "The gas supply pressure varies with the pipeline; the skid has to absorb it and still meter accurately.", verificationMethod: "Test", acceptanceCriteria: "At supply pressures from 22 to 30 bar(g) the delivered flow stays within 1% of demand.", source: "Gas transporter connection agreement", category: "Interface" },
|
|
10401
|
+
{ identifier: "OCGT-REQ-102", statement: "Inlet air filtration shall limit clean pressure loss to not more than 1.0 kPa and remove particles above 0.3 \xB5m with not less than 99.5% efficiency.", derivesFrom: "OCGT-REQ-001", allocatedTo: "AIR-FH", rationale: "Dirty air fouls the compressor and cuts output; a high pressure loss at the filters does the same.", verificationMethod: "Test", acceptanceCriteria: "Clean pressure loss is at most 1.0 kPa and particle removal above 0.3 um is at least 99.5% on the filter test rig.", source: "Filter standard EN ISO 16890, class F9", category: "Performance" },
|
|
10402
|
+
{ identifier: "OCGT-REQ-103", statement: "The compressor shall deliver a pressure ratio of not less than 16:1 at ISO base load.", derivesFrom: "OCGT-REQ-002", allocatedTo: "GT-CMP", rationale: "The pressure ratio sets the cycle efficiency and so the heat rate target.", verificationMethod: "Test", acceptanceCriteria: "Measured compressor pressure ratio at ISO base load is at least 16:1.", source: "Gas turbine supplier performance guarantee", category: "Performance" },
|
|
10403
|
+
{ identifier: "OCGT-REQ-105", statement: "The burners shall hold stable lean premixed combustion between 50% and 100% load with dynamic pressure amplitude below 25 mbar rms.", derivesFrom: "OCGT-REQ-005", allocatedTo: "GT-CMB", rationale: "Combustion dynamics damage burners and limit the load range in which the NOx limit holds.", verificationMethod: "Test", acceptanceCriteria: "Dynamic pressure amplitude stays below 25 mbar rms from 50% to 100% load.", source: "Gas turbine supplier operating limits", category: "Performance" },
|
|
10404
|
+
{ identifier: "OCGT-REQ-106", statement: "The fuel metering skid shall control fuel flow to within \xB10.5% of full scale over the load range.", derivesFrom: "OCGT-REQ-004", allocatedTo: "FGS-MS", rationale: "Flow accuracy decides how closely the unit holds load and emissions.", verificationMethod: "Test", acceptanceCriteria: "Metered flow error is within 0.5% of full scale at five points across the load range.", source: "Gas turbine supplier fuel interface specification", category: "Interface" },
|
|
10405
|
+
{ identifier: "OCGT-REQ-107", statement: "The starting system shall accelerate the rotor from turning gear to ignition speed in not more than 120 s.", derivesFrom: "OCGT-REQ-003", allocatedTo: "GEN", rationale: "The start time budget leaves 120 s for acceleration; a slower starter breaks the 10 minute start.", verificationMethod: "Test", acceptanceCriteria: "Acceleration from turning gear to ignition speed takes at most 120 s in the commissioning start.", source: "Owner's technical specification, section 5.1", category: "Performance" },
|
|
10406
|
+
{ identifier: "OCGT-REQ-108", statement: "Overspeed protection shall trip the fuel valves at 110% of rated speed through two independent channels.", derivesFrom: "OCGT-REQ-010", allocatedTo: "CPS-OS", rationale: "Overspeed can burst the rotor; two independent channels guard against a single channel fault.", verificationMethod: "Test", acceptanceCriteria: "Each channel trips the fuel valves at 110% speed in a simulation, and a physical trip confirms it.", source: "Machinery safety standard ISO 21789", category: "Safety" },
|
|
10407
|
+
{ identifier: "OCGT-REQ-109", statement: "The emergency shutoff valves shall close within 1 s of a trip signal with seat leakage not worse than Class V.", derivesFrom: "OCGT-REQ-010", allocatedTo: "FGS-ESV", rationale: "A fast, tight shutoff limits the gas that can reach a burning or faulty machine.", verificationMethod: "Test", acceptanceCriteria: "Each installed valve closes in at most 1 s with seat leakage within Class V.", source: "Fuel gas code NFPA 85, shutoff valve clause", category: "Safety" },
|
|
10408
|
+
{ identifier: "OCGT-REQ-110", statement: "Fire and gas detection shall alarm at 20% of the lower explosive limit and trip the unit at 40% in the enclosure.", derivesFrom: "OCGT-REQ-010", allocatedTo: "CPS-FG", rationale: "Gas accumulating in the enclosure is an explosion hazard; staged alarms give operators time to act.", verificationMethod: "Test", acceptanceCriteria: "Test gas at each detector gives an alarm at 20% of the lower explosive limit and a trip at 40%.", source: "Fuel gas code NFPA 85, enclosure clause", category: "Safety" },
|
|
10409
|
+
{ identifier: "OCGT-REQ-111", statement: "The exhaust silencer shall attenuate exhaust noise to not more than 70 dB(A) at 100 m.", derivesFrom: "OCGT-REQ-007", allocatedTo: "EXH-SL", rationale: "Exhaust noise is the dominant far-field source, so the silencer carries most of the boundary noise budget.", verificationMethod: "Analysis", acceptanceCriteria: "The measured level at 100 m is at most 70 dB(A) and agrees with the silencer model.", source: "Planning consent, noise condition 12", category: "Environmental" },
|
|
10410
|
+
{ identifier: "OCGT-REQ-112", statement: "Enclosure ventilation shall keep enclosure air below 55 \xB0C and provide not fewer than 12 air changes per hour.", derivesFrom: "OCGT-REQ-010", allocatedTo: "ENC", rationale: "A hot enclosure shortens electronics life and trips the unit; air changes also dilute any leaked gas.", verificationMethod: "Inspection", acceptanceCriteria: "Commissioning records show enclosure air below 55 C at full load and at least 12 air changes per hour.", source: "Fuel gas code NFPA 85, ventilation clause", category: "Safety" },
|
|
10411
|
+
{ identifier: "OCGT-REQ-113", statement: "The lube oil system shall supply oil at 45 to 55 \xB0C and not less than 1.5 bar at the bearing headers, and shall carry the rotor through coast-down on loss of AC power.", derivesFrom: "OCGT-REQ-008", allocatedTo: "LOS", rationale: "Bearings need oil at the right temperature and pressure, and a power loss must not run them dry during coast-down.", verificationMethod: "Demonstration", acceptanceCriteria: "A simulated loss of AC power keeps header pressure at or above 1.5 bar through coast-down.", source: "Gas turbine supplier lube oil specification", category: "Interface" },
|
|
10412
|
+
{ identifier: "OCGT-REQ-114", statement: "The generator shall be rated at not less than 62.5 MVA at 0.8 power factor and 11 kV.", derivesFrom: "OCGT-REQ-001", allocatedTo: "GEN", rationale: "The generator rating has to cover the turbine output with margin at the lagging power factor the grid asks for.", verificationMethod: "Inspection", acceptanceCriteria: "The generator nameplate and factory test report show at least 62.5 MVA at 0.8 power factor and 11 kV.", source: "Grid code, reactive power requirement", category: "Interface" },
|
|
10413
|
+
{ identifier: "OCGT-REQ-115", statement: "The step-up transformer shall transform 11 kV to 132 kV with load losses not exceeding 0.4% at rated load.", derivesFrom: "OCGT-REQ-001", allocatedTo: "ELE-TX", rationale: "The transformer connects the plant to the 132 kV grid; its losses subtract from net output.", verificationMethod: "Test", acceptanceCriteria: "The factory test shows 11 kV to 132 kV transformation and load losses of at most 0.4% at rated load.", source: "Grid connection agreement", category: "Interface" },
|
|
10414
|
+
{ identifier: "OCGT-REQ-116", statement: "The unit control system shall run the start sequence automatically with no operator action beyond the start command.", derivesFrom: "OCGT-REQ-003", allocatedTo: "CPS-UC", rationale: "An automatic sequence removes operator error and makes every start repeatable.", verificationMethod: "Demonstration", acceptanceCriteria: "Ten starts complete with no operator action after the start command.", source: "Owner's operating philosophy, section 2", category: "Performance" }
|
|
8942
10415
|
];
|
|
8943
10416
|
var SPECIFICATIONS = [
|
|
8944
10417
|
{ identifier: "OCGT-SPEC-001", statement: "Single-shaft industrial gas turbine with a 16-stage axial compressor and a 3-stage axial turbine, ISO base rating 52 MW at the generator terminals.", satisfies: ["OCGT-REQ-001", "OCGT-REQ-103"] },
|
|
@@ -9234,8 +10707,8 @@ function canonicalJson2(value) {
|
|
|
9234
10707
|
return `[${value.map((item) => canonicalJson2(item)).join(",")}]`;
|
|
9235
10708
|
}
|
|
9236
10709
|
if (typeof value === "object" && value !== null) {
|
|
9237
|
-
const
|
|
9238
|
-
return `{${
|
|
10710
|
+
const entries7 = Object.entries(value).filter(([, member]) => member !== void 0).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0);
|
|
10711
|
+
return `{${entries7.map(([key, member]) => `${JSON.stringify(key)}:${canonicalJson2(member)}`).join(",")}}`;
|
|
9239
10712
|
}
|
|
9240
10713
|
return JSON.stringify(value);
|
|
9241
10714
|
}
|
|
@@ -9696,11 +11169,11 @@ var connectorRun = {
|
|
|
9696
11169
|
return run2.ok ? outcomeOfEnvelope(run2.answer, settle2, (started) => `started run ${started.runId}: read it with openeng connector runs ${connectionId}`) : outcomeOfSessionFailure(run2.failure, settle2);
|
|
9697
11170
|
}
|
|
9698
11171
|
};
|
|
9699
|
-
var runText = (
|
|
9700
|
-
const counts =
|
|
9701
|
-
const complete =
|
|
9702
|
-
const failure2 =
|
|
9703
|
-
return `${
|
|
11172
|
+
var runText = (record2) => {
|
|
11173
|
+
const counts = record2.counts === null ? "counts none" : `created ${String(record2.counts.created)} updated ${String(record2.counts.updated)} unchanged ${String(record2.counts.unchanged)} withdrawn ${String(record2.counts.withdrawn)} carried ${String(record2.counts.carried)} overwritten ${String(record2.counts.overwritten)}`;
|
|
11174
|
+
const complete = record2.complete === null ? "complete unknown" : record2.complete ? "complete" : "incomplete";
|
|
11175
|
+
const failure2 = record2.failure === null ? "" : ` failure ${record2.failure.kind}: ${record2.failure.text}`;
|
|
11176
|
+
return `${record2.runId} ${record2.state} started ${record2.startedAt} finished ${record2.finishedAt === null ? "-" : record2.finishedAt} ${complete} ${counts}${failure2}`;
|
|
9704
11177
|
};
|
|
9705
11178
|
var connectorRuns = {
|
|
9706
11179
|
organisation: "required",
|
|
@@ -9733,14 +11206,14 @@ var IDENTIFIER_FIELD = Object.freeze({
|
|
|
9733
11206
|
app: "appKey",
|
|
9734
11207
|
"app-draft": "appKey"
|
|
9735
11208
|
});
|
|
9736
|
-
var PROJECT_REF_USAGE = "openeng link <
|
|
9737
|
-
var
|
|
11209
|
+
var PROJECT_REF_USAGE = "openeng link <branch-diff|project> --project <id> --ref <ref>";
|
|
11210
|
+
var EXPLORE_USAGE = "openeng link explore --project <id> --ref <ref> (--object <id> | --object-set <id>)";
|
|
9738
11211
|
var REF_USAGE = "openeng link <ontology|change-set> --ref <ref>";
|
|
9739
11212
|
var DRAFT_USAGE = "openeng link app-draft <appKey> --ref <ref>";
|
|
9740
11213
|
var IDENTIFIED_USAGE = "openeng link <object|type|proposal|app> <identifier> --project <id> --ref <ref>";
|
|
9741
11214
|
var APP_PAGE_USAGE = "openeng link app-page <appKey> <pageKey> --project <id> --ref <ref>";
|
|
9742
11215
|
var PAGE_USAGE = "openeng link organisation-page <page>";
|
|
9743
|
-
var LINK_HELP = [PROJECT_REF_USAGE,
|
|
11216
|
+
var LINK_HELP = [PROJECT_REF_USAGE, EXPLORE_USAGE, REF_USAGE, DRAFT_USAGE, IDENTIFIED_USAGE, APP_PAGE_USAGE, PAGE_USAGE];
|
|
9744
11217
|
var refusal = (message) => ({ kind: "client-refusal", message });
|
|
9745
11218
|
var SCOPE_OF_KIND = Object.freeze({
|
|
9746
11219
|
object: "project-and-ref",
|
|
@@ -9799,12 +11272,6 @@ function subjectReads(clients, subject, scope) {
|
|
|
9799
11272
|
));
|
|
9800
11273
|
}
|
|
9801
11274
|
switch (subject.kind) {
|
|
9802
|
-
case "object":
|
|
9803
|
-
reads.push(checkedRead(
|
|
9804
|
-
clients.objects.readObject({ selector: { projectId: scope.project, ref: scope.ref }, input: { objectId: subject.objectId } }),
|
|
9805
|
-
`no object ${subject.objectId} in project ${scope.project} on ref ${scope.ref}`
|
|
9806
|
-
));
|
|
9807
|
-
break;
|
|
9808
11275
|
case "type":
|
|
9809
11276
|
reads.push(checkedRead(
|
|
9810
11277
|
clients.objects.readCatalogue({ selector: { projectId: scope.project }, input: {} }),
|
|
@@ -9871,30 +11338,62 @@ async function link(context) {
|
|
|
9871
11338
|
if (typeof scope === "string") {
|
|
9872
11339
|
return refusal(`openeng link ${subject.kind} ${scope}`);
|
|
9873
11340
|
}
|
|
9874
|
-
if (
|
|
9875
|
-
|
|
11341
|
+
if (subject.kind === "explore") {
|
|
11342
|
+
if (options.object === void 0 === (options.objectSet === void 0) || options.object === "" || options.objectSet === "") {
|
|
11343
|
+
return refusal("openeng link explore needs exactly one of --object <id> or --object-set <id>");
|
|
11344
|
+
}
|
|
11345
|
+
} else if (options.object !== void 0 || options.objectSet !== void 0) {
|
|
11346
|
+
return refusal("--object and --object-set are only for openeng link explore");
|
|
9876
11347
|
}
|
|
9877
11348
|
const objectSet = options.objectSet;
|
|
9878
|
-
const
|
|
11349
|
+
const objectId = subject.kind === "object" ? subject.objectId : options.object;
|
|
9879
11350
|
const run2 = await runAuthenticated(host, deps, async (clients) => {
|
|
9880
|
-
const [origin, checks, saved] = await Promise.all([
|
|
11351
|
+
const [origin, checks, saved, object] = await Promise.all([
|
|
9881
11352
|
clients.admin.readWebOrigin({ input: {} }),
|
|
9882
11353
|
Promise.all(subjectReads(clients, subject, scope)),
|
|
9883
11354
|
objectSet === void 0 ? Promise.resolve(null) : clients.objects.readObjectSet({
|
|
9884
11355
|
selector: { projectId: scope.project, ref: scope.ref },
|
|
9885
11356
|
input: { setId: objectSet }
|
|
11357
|
+
}),
|
|
11358
|
+
objectId === void 0 ? Promise.resolve(null) : clients.objects.readObject({
|
|
11359
|
+
selector: { projectId: scope.project, ref: scope.ref },
|
|
11360
|
+
input: { objectId }
|
|
9886
11361
|
})
|
|
9887
11362
|
]);
|
|
9888
11363
|
if (saved !== null && ("refusal" in saved || saved.replayed === true)) return saved;
|
|
9889
11364
|
const blocked = checks.find((check) => check.missing === null && ("refusal" in check.answer || check.answer.replayed === true));
|
|
9890
11365
|
if (blocked !== void 0) return blocked.answer;
|
|
11366
|
+
if (object !== null) {
|
|
11367
|
+
if ("refusal" in object) {
|
|
11368
|
+
return object.refusal.kind === "not-found" ? refusal(`no object ${objectId} in project ${scope.project} on ref ${scope.ref}`) : object;
|
|
11369
|
+
}
|
|
11370
|
+
if (object.replayed === true) return object;
|
|
11371
|
+
}
|
|
9891
11372
|
if ("refusal" in origin) {
|
|
9892
11373
|
return origin.refusal.kind === "not-found" ? refusal("the host's web application was not found") : origin;
|
|
9893
11374
|
}
|
|
9894
11375
|
if (origin.replayed === true) return origin;
|
|
9895
11376
|
const missing = checks.find((check) => check.missing !== null);
|
|
9896
11377
|
if (missing !== void 0 && missing.missing !== null) return refusal(missing.missing);
|
|
9897
|
-
|
|
11378
|
+
let path;
|
|
11379
|
+
if (subject.kind === "object") {
|
|
11380
|
+
if (object === null) throw new Error("an object link needs its object read");
|
|
11381
|
+
path = exploreOpenObjectAddress({
|
|
11382
|
+
organisationId: organisation.id,
|
|
11383
|
+
projectId: scope.project,
|
|
11384
|
+
ref: scope.ref,
|
|
11385
|
+
typeKey: object.result.typeKey
|
|
11386
|
+
}, subject.objectId);
|
|
11387
|
+
} else if (subject.kind === "explore") {
|
|
11388
|
+
path = exploreViewAddress({ organisationId: organisation.id, projectId: scope.project, ref: scope.ref, q: null }, {
|
|
11389
|
+
typeKey: null,
|
|
11390
|
+
objectId: options.object ?? null,
|
|
11391
|
+
setId: objectSet ?? null
|
|
11392
|
+
});
|
|
11393
|
+
} else {
|
|
11394
|
+
path = linkPath(organisation.id, scope.project, subject, scope.ref);
|
|
11395
|
+
}
|
|
11396
|
+
return { kind: "link-ready", webOrigin: origin.result.webOrigin, path };
|
|
9898
11397
|
});
|
|
9899
11398
|
if (!run2.ok) {
|
|
9900
11399
|
return outcomeOfSessionFailure(run2.failure, SETTLE2);
|
|
@@ -9902,7 +11401,7 @@ async function link(context) {
|
|
|
9902
11401
|
const { answer } = run2;
|
|
9903
11402
|
if ("kind" in answer) {
|
|
9904
11403
|
if (answer.kind === "client-refusal") return answer;
|
|
9905
|
-
const { webOrigin } = answer;
|
|
11404
|
+
const { webOrigin, path } = answer;
|
|
9906
11405
|
if (webOrigin === null) {
|
|
9907
11406
|
return refusal("this host has no web application configured, so it has no page to link to");
|
|
9908
11407
|
}
|
|
@@ -9919,10 +11418,22 @@ var spec = (argumentCount, usage) => ({
|
|
|
9919
11418
|
usage,
|
|
9920
11419
|
help: [
|
|
9921
11420
|
...LINK_HELP,
|
|
11421
|
+
"object: the object's type page with the object open; its type comes from the object read",
|
|
11422
|
+
"type: the type's page",
|
|
11423
|
+
"explore: Explore with exactly one --object or --object-set seed",
|
|
11424
|
+
"branch-diff: the branch comparison page",
|
|
11425
|
+
"project: the project page",
|
|
11426
|
+
"proposal: the proposal review page",
|
|
11427
|
+
"ontology: the organisation's Types workspace",
|
|
11428
|
+
"change-set: the organisation's Change set workspace",
|
|
11429
|
+
"app: the published app's first page",
|
|
11430
|
+
"app-page: the named page of a published app",
|
|
11431
|
+
"app-draft: the app's draft screen in the Types workspace",
|
|
11432
|
+
"organisation-page: the named organisation administration page or settings",
|
|
9922
11433
|
"does: reads the page's subject before printing its web address for the attached organisation",
|
|
9923
11434
|
"ref: --ref takes main or <projectId>/<branch>, the ref the platform returns; match --project when given",
|
|
9924
11435
|
"refusal: a subject not found by the page's own read prints no address",
|
|
9925
|
-
"example: openeng link explore --project proj_abc123 --ref main",
|
|
11436
|
+
"example: openeng link explore --project proj_abc123 --ref main --object obj_abc123",
|
|
9926
11437
|
"output: the address on one line; under --json an object with link"
|
|
9927
11438
|
],
|
|
9928
11439
|
run: link
|
|
@@ -10400,7 +11911,9 @@ var FLAG_NAME = {
|
|
|
10400
11911
|
project: "--project",
|
|
10401
11912
|
changeSet: "--change-set",
|
|
10402
11913
|
revision: "--revision",
|
|
10403
|
-
from: "--from"
|
|
11914
|
+
from: "--from",
|
|
11915
|
+
type: "--type",
|
|
11916
|
+
sample: "--sample"
|
|
10404
11917
|
};
|
|
10405
11918
|
function required(usage, context, keys) {
|
|
10406
11919
|
const values = {};
|
|
@@ -10657,7 +12170,7 @@ var typesDraftState = {
|
|
|
10657
12170
|
return run2.ok ? outcomeOfEnvelope(run2.answer, settle2, (state) => `change set ${changeSetId} is ${state.state} at revision ${state.revision}`) : outcomeOfSessionFailure(run2.failure, settle2);
|
|
10658
12171
|
}
|
|
10659
12172
|
};
|
|
10660
|
-
function
|
|
12173
|
+
function objectOfFile(path, shape) {
|
|
10661
12174
|
let text;
|
|
10662
12175
|
try {
|
|
10663
12176
|
text = readFileSync5(path, "utf8");
|
|
@@ -10677,9 +12190,13 @@ function changesOfFile(path) {
|
|
|
10677
12190
|
throw error;
|
|
10678
12191
|
}
|
|
10679
12192
|
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
10680
|
-
return { ok: false, outcome: { kind: "client-refusal", message: `the file ${JSON.stringify(path)} is not
|
|
12193
|
+
return { ok: false, outcome: { kind: "client-refusal", message: `the file ${JSON.stringify(path)} is not ${shape}` } };
|
|
10681
12194
|
}
|
|
10682
|
-
return { ok: true,
|
|
12195
|
+
return { ok: true, object: parsed };
|
|
12196
|
+
}
|
|
12197
|
+
function changesOfFile(path) {
|
|
12198
|
+
const file = objectOfFile(path, "a JSON object keyed by type key");
|
|
12199
|
+
return file.ok ? { ok: true, changes: file.object } : file;
|
|
10683
12200
|
}
|
|
10684
12201
|
function railGroupsOfFlag(text) {
|
|
10685
12202
|
if (text === void 0) {
|
|
@@ -10766,6 +12283,81 @@ var typesDraftValidate = {
|
|
|
10766
12283
|
return outcome.kind === "success" && violated ? { kind: "findings", value: outcome.value, text: outcome.text } : outcome;
|
|
10767
12284
|
}
|
|
10768
12285
|
};
|
|
12286
|
+
var typesDraftTry = {
|
|
12287
|
+
organisation: "required",
|
|
12288
|
+
words: ["types", "draft", "try"],
|
|
12289
|
+
usage: "openeng types draft try --type <key> --sample <file> [--change-set <id>]",
|
|
12290
|
+
help: [
|
|
12291
|
+
"openeng types draft try --type <key> --sample <file> [--change-set <id>]",
|
|
12292
|
+
"does: checks one sample instance against the open change set's version of a type, with the check a write runs; writes nothing",
|
|
12293
|
+
"example: openeng types draft try --type part --sample sample.json",
|
|
12294
|
+
"output: a line saying the sample fits, or a count and one line per violation (exit 4); under --json an object with valid and violations, each with path and rule"
|
|
12295
|
+
],
|
|
12296
|
+
run: async (context) => {
|
|
12297
|
+
const flags = required("openeng types draft try", context, ["type", "sample"]);
|
|
12298
|
+
if (!flags.ok) {
|
|
12299
|
+
return flags.outcome;
|
|
12300
|
+
}
|
|
12301
|
+
const { type: typeKey, sample: samplePath } = flags.values;
|
|
12302
|
+
const file = objectOfFile(samplePath, "a JSON object of property values");
|
|
12303
|
+
if (!file.ok) {
|
|
12304
|
+
return file.outcome;
|
|
12305
|
+
}
|
|
12306
|
+
const sample = file.object;
|
|
12307
|
+
const named = context.options.changeSet;
|
|
12308
|
+
const settle2 = "repeat openeng types draft try, which only reads";
|
|
12309
|
+
const run2 = await runAuthenticated(context.host, context.deps, async (clients) => {
|
|
12310
|
+
let changeSetId = named;
|
|
12311
|
+
if (changeSetId === void 0) {
|
|
12312
|
+
const current = await clients.ontology.readCurrentChangeSet({ input: {} });
|
|
12313
|
+
if ("refusal" in current) {
|
|
12314
|
+
return { refusal: current.refusal, correlationId: current.correlationId };
|
|
12315
|
+
}
|
|
12316
|
+
if (current.replayed === true) {
|
|
12317
|
+
throw new Error("the host answered a replay to a read that carried no idempotency key");
|
|
12318
|
+
}
|
|
12319
|
+
if (current.result === null) {
|
|
12320
|
+
return { noChangeSet: true };
|
|
12321
|
+
}
|
|
12322
|
+
changeSetId = current.result.changeSetId;
|
|
12323
|
+
}
|
|
12324
|
+
const read = await clients.ontology.readChangeSet({ input: { changeSetId } });
|
|
12325
|
+
if ("refusal" in read) {
|
|
12326
|
+
return { refusal: read.refusal, correlationId: read.correlationId };
|
|
12327
|
+
}
|
|
12328
|
+
if (read.replayed === true) {
|
|
12329
|
+
throw new Error("the host answered a replay to a read that carried no idempotency key");
|
|
12330
|
+
}
|
|
12331
|
+
return { check: checkSampleAgainstChanges(read.result.changes, typeKey, sample) };
|
|
12332
|
+
});
|
|
12333
|
+
if (!run2.ok) {
|
|
12334
|
+
return outcomeOfSessionFailure(run2.failure, settle2);
|
|
12335
|
+
}
|
|
12336
|
+
const answer = run2.answer;
|
|
12337
|
+
if ("refusal" in answer) {
|
|
12338
|
+
return outcomeOfRouteRefusal(answer.refusal, settle2, answer.correlationId);
|
|
12339
|
+
}
|
|
12340
|
+
if ("noChangeSet" in answer) {
|
|
12341
|
+
return { kind: "client-refusal", message: "no change set is open; open one with openeng types draft open" };
|
|
12342
|
+
}
|
|
12343
|
+
const check = answer.check;
|
|
12344
|
+
if (check.kind === "no-such-type") {
|
|
12345
|
+
return { kind: "client-refusal", message: `the change set holds no type by the key ${JSON.stringify(typeKey)}` };
|
|
12346
|
+
}
|
|
12347
|
+
if (check.kind === "no-properties") {
|
|
12348
|
+
return { kind: "client-refusal", message: `${JSON.stringify(typeKey)} is a verb type, which has no properties an instance could carry` };
|
|
12349
|
+
}
|
|
12350
|
+
if (check.result.ok) {
|
|
12351
|
+
return { kind: "success", value: { valid: true, violations: [] }, text: "the sample fits" };
|
|
12352
|
+
}
|
|
12353
|
+
const violations = check.result.violations.map((violation) => ({ path: violation.path, rule: violation.rule }));
|
|
12354
|
+
return {
|
|
12355
|
+
kind: "findings",
|
|
12356
|
+
value: { valid: false, violations },
|
|
12357
|
+
text: [`${String(violations.length)} ${violations.length === 1 ? "violation" : "violations"}`, ...violations.map((violation) => ` ${JSON.stringify(violation)}`)].join("\n")
|
|
12358
|
+
};
|
|
12359
|
+
}
|
|
12360
|
+
};
|
|
10769
12361
|
var typesDraftDiscard = {
|
|
10770
12362
|
organisation: "required",
|
|
10771
12363
|
words: ["types", "draft", "discard"],
|
|
@@ -10810,6 +12402,495 @@ var typesDraftAccept = {
|
|
|
10810
12402
|
}
|
|
10811
12403
|
};
|
|
10812
12404
|
|
|
12405
|
+
// packages/cli/src/commands/attachment.ts
|
|
12406
|
+
import { createHash as createHash3, randomUUID as randomUUID5 } from "node:crypto";
|
|
12407
|
+
import { readFileSync as readFileSync6, writeFileSync } from "node:fs";
|
|
12408
|
+
import { basename } from "node:path";
|
|
12409
|
+
var usageAdd = "openeng attachment add <object> <property> <file> --project <id> --ref <ref>";
|
|
12410
|
+
var usageGet = "openeng attachment get <object> <property> [--out <path>] --project <id> --ref <ref>";
|
|
12411
|
+
var usageList = "openeng attachment list <object> --project <id> --ref <ref>";
|
|
12412
|
+
var invalid = (message) => ({ kind: "client-refusal", message });
|
|
12413
|
+
var malformed2 = (field) => ({ kind: "internal-failure", message: `the host answered with malformed ${field}` });
|
|
12414
|
+
function selectorOf2(context) {
|
|
12415
|
+
const { project, ref } = context.options;
|
|
12416
|
+
if (project === void 0 || ref === void 0) return invalid("attachment commands need --project <id> and --ref <ref>");
|
|
12417
|
+
return { projectId: project, ref };
|
|
12418
|
+
}
|
|
12419
|
+
function positional(context, count, usage) {
|
|
12420
|
+
if (context.args.length !== count || context.args.some((argument) => argument.length === 0)) return invalid(`usage: ${usage}`);
|
|
12421
|
+
return context.args;
|
|
12422
|
+
}
|
|
12423
|
+
function isOutcome(value) {
|
|
12424
|
+
return !Array.isArray(value) && typeof value === "object" && value !== null && "kind" in value;
|
|
12425
|
+
}
|
|
12426
|
+
function isSelector(value) {
|
|
12427
|
+
return "projectId" in value;
|
|
12428
|
+
}
|
|
12429
|
+
function isRecord4(value) {
|
|
12430
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12431
|
+
}
|
|
12432
|
+
function descriptor(value) {
|
|
12433
|
+
return isRecord4(value) && typeof value.sha256 === "string" && typeof value.name === "string" && typeof value.mediaType === "string" && typeof value.bytes === "number";
|
|
12434
|
+
}
|
|
12435
|
+
async function saveDescriptor(context, selector, objectId, property, file) {
|
|
12436
|
+
const bytes = new Uint8Array(readFileSync6(file));
|
|
12437
|
+
const name = basename(file);
|
|
12438
|
+
const settle2 = `openeng attachment get ${objectId} ${property} --project ${selector.projectId} --ref ${selector.ref}`;
|
|
12439
|
+
const run2 = await runAuthenticated(context.host, context.deps, async (clients) => {
|
|
12440
|
+
const staged = await clients.objects.stageAttachment(selector, { name, bytes });
|
|
12441
|
+
if ("refusal" in staged) return { outcome: outcomeOfEnvelope(staged, settle2, (value2) => JSON.stringify(value2)) };
|
|
12442
|
+
if (staged.replayed === true) return { outcome: outcomeOfEnvelope(staged, settle2, (value2) => JSON.stringify(value2)) };
|
|
12443
|
+
const object = await clients.objects.readObject({ selector, input: { objectId } });
|
|
12444
|
+
if ("refusal" in object) return { outcome: outcomeOfEnvelope(object, settle2, (value2) => JSON.stringify(value2)) };
|
|
12445
|
+
if (object.replayed === true) return { outcome: outcomeOfEnvelope(object, settle2, (value2) => JSON.stringify(value2)) };
|
|
12446
|
+
const catalogue = await clients.objects.readCatalogue({ selector: { projectId: selector.projectId }, input: {} });
|
|
12447
|
+
if ("refusal" in catalogue) return { outcome: outcomeOfEnvelope(catalogue, settle2, (value2) => JSON.stringify(value2)) };
|
|
12448
|
+
if (catalogue.replayed === true) return { outcome: outcomeOfEnvelope(catalogue, settle2, (value2) => JSON.stringify(value2)) };
|
|
12449
|
+
const type = catalogue.result.objects.find((candidate) => candidate.typeKey === object.result.typeKey);
|
|
12450
|
+
if (type === void 0) return { outcome: invalid(`could not find the published type version for object ${objectId}`) };
|
|
12451
|
+
if (!isRecord4(type.propertyDefinitions)) return { outcome: malformed2("propertyDefinitions") };
|
|
12452
|
+
const definitions = type.propertyDefinitions;
|
|
12453
|
+
if (definitions[property] === void 0) return { outcome: invalid(`property ${property} is not declared on ${type.typeKey}`) };
|
|
12454
|
+
if (!isRecord4(object.result.properties)) return { outcome: malformed2("object properties") };
|
|
12455
|
+
const props = object.result.properties;
|
|
12456
|
+
const current = props[property];
|
|
12457
|
+
const previous = isRecord4(current) && "value" in current ? { value: current.value } : { absent: true };
|
|
12458
|
+
const saved = await clients.objects.mutate({ selector, input: {
|
|
12459
|
+
correlation: { kind: "mint" },
|
|
12460
|
+
operation: { kind: "update-object", objectId, typeVersion: type.version, changes: { [property]: { from: previous, to: { value: staged.result } } } }
|
|
12461
|
+
} }, randomUUID5());
|
|
12462
|
+
if ("refusal" in saved) return { outcome: outcomeOfEnvelope(saved, settle2, (value2) => JSON.stringify(value2)) };
|
|
12463
|
+
if (saved.replayed === true) return { outcome: outcomeOfEnvelope(saved, settle2, (value2) => JSON.stringify(value2)) };
|
|
12464
|
+
if (saved.result.kind === "unknown") {
|
|
12465
|
+
const outcome2 = {
|
|
12466
|
+
kind: "unknown-outcome-no-answer",
|
|
12467
|
+
message: `the mutation outcome is unknown (correlation ${saved.result.correlationId}; trailer ${saved.result.trailer})`,
|
|
12468
|
+
settle: `recover this mutation on ref ${selector.ref} with correlation ${saved.result.correlationId}; recovery searches the trailer ${saved.result.trailer}`
|
|
12469
|
+
};
|
|
12470
|
+
return {
|
|
12471
|
+
outcome: outcome2
|
|
12472
|
+
};
|
|
12473
|
+
}
|
|
12474
|
+
if (saved.result.kind === "refused") return { outcome: outcomeOfEnvelope(saved, settle2, (value2) => JSON.stringify(value2)) };
|
|
12475
|
+
const outcome = { kind: "success", value: staged.result, text: JSON.stringify(staged.result) };
|
|
12476
|
+
return {
|
|
12477
|
+
outcome,
|
|
12478
|
+
descriptor: staged.result
|
|
12479
|
+
};
|
|
12480
|
+
});
|
|
12481
|
+
if (!run2.ok) return outcomeOfSessionFailure(run2.failure, settle2);
|
|
12482
|
+
if (run2.answer.outcome.kind !== "success") return run2.answer.outcome;
|
|
12483
|
+
const value = run2.answer.descriptor;
|
|
12484
|
+
return { kind: "success", value, text: JSON.stringify(value) };
|
|
12485
|
+
}
|
|
12486
|
+
var attachmentAdd = {
|
|
12487
|
+
words: ["attachment", "add"],
|
|
12488
|
+
arguments: 3,
|
|
12489
|
+
organisation: "required",
|
|
12490
|
+
usage: usageAdd,
|
|
12491
|
+
help: [
|
|
12492
|
+
usageAdd,
|
|
12493
|
+
"does: stages a file and saves its descriptor on the object's attachment property",
|
|
12494
|
+
"example: openeng attachment add obj_abc drawing ./drawing.pdf --project proj_abc --ref main",
|
|
12495
|
+
"output: the attachment descriptor as JSON"
|
|
12496
|
+
],
|
|
12497
|
+
run: async (context) => {
|
|
12498
|
+
const args = positional(context, 3, usageAdd);
|
|
12499
|
+
const selector = selectorOf2(context);
|
|
12500
|
+
if (isOutcome(args)) return args;
|
|
12501
|
+
if (!isSelector(selector)) return selector;
|
|
12502
|
+
const [objectId, property, file] = args;
|
|
12503
|
+
if (objectId === void 0 || property === void 0 || file === void 0) return invalid(`usage: ${usageAdd}`);
|
|
12504
|
+
return saveDescriptor(context, selector, objectId, property, file);
|
|
12505
|
+
}
|
|
12506
|
+
};
|
|
12507
|
+
var attachmentGet = {
|
|
12508
|
+
words: ["attachment", "get"],
|
|
12509
|
+
arguments: 2,
|
|
12510
|
+
organisation: "required",
|
|
12511
|
+
usage: usageGet,
|
|
12512
|
+
help: [
|
|
12513
|
+
usageGet,
|
|
12514
|
+
"does: downloads an object's attachment property to --out or the descriptor's name",
|
|
12515
|
+
"example: openeng attachment get obj_abc drawing --out ./drawing.pdf --project proj_abc --ref main",
|
|
12516
|
+
"output: the path written"
|
|
12517
|
+
],
|
|
12518
|
+
run: async (context) => {
|
|
12519
|
+
const args = positional(context, 2, usageGet);
|
|
12520
|
+
const selector = selectorOf2(context);
|
|
12521
|
+
if (isOutcome(args)) return args;
|
|
12522
|
+
if (!isSelector(selector)) return selector;
|
|
12523
|
+
const [objectId, property] = args;
|
|
12524
|
+
if (objectId === void 0 || property === void 0) return invalid(`usage: ${usageGet}`);
|
|
12525
|
+
const settle2 = `repeat openeng attachment get ${objectId} ${property} --project ${selector.projectId} --ref ${selector.ref}`;
|
|
12526
|
+
const run2 = await runAuthenticated(context.host, context.deps, async (clients) => {
|
|
12527
|
+
const answer = await clients.objects.readAttachment(selector, { objectId, property });
|
|
12528
|
+
if ("refusal" in answer) return { outcome: outcomeOfEnvelope(answer, settle2, (value) => JSON.stringify(value)) };
|
|
12529
|
+
if (answer.replayed === true) return { outcome: outcomeOfEnvelope(answer, settle2, (value) => JSON.stringify(value)) };
|
|
12530
|
+
const chunks = [];
|
|
12531
|
+
for await (const chunk of answer.result.body) chunks.push(chunk);
|
|
12532
|
+
const bytes = Buffer.concat(chunks);
|
|
12533
|
+
const digest = createHash3("sha256").update(bytes).digest("hex");
|
|
12534
|
+
if (digest !== answer.result.descriptor.sha256) {
|
|
12535
|
+
const outcome2 = { kind: "internal-failure", message: "the downloaded attachment did not match its descriptor's SHA-256" };
|
|
12536
|
+
return { outcome: outcome2 };
|
|
12537
|
+
}
|
|
12538
|
+
const path = context.options.out ?? answer.result.descriptor.name;
|
|
12539
|
+
writeFileSync(path, bytes);
|
|
12540
|
+
const outcome = { kind: "success", value: { path }, text: path };
|
|
12541
|
+
return { outcome };
|
|
12542
|
+
});
|
|
12543
|
+
return run2.ok ? run2.answer.outcome : outcomeOfSessionFailure(run2.failure, settle2);
|
|
12544
|
+
}
|
|
12545
|
+
};
|
|
12546
|
+
function attachmentProperties(object, propertyDefinitions) {
|
|
12547
|
+
if (!isRecord4(propertyDefinitions)) return { ok: false, outcome: malformed2("propertyDefinitions") };
|
|
12548
|
+
if (!isRecord4(object.properties)) return { ok: false, outcome: malformed2("object properties") };
|
|
12549
|
+
const properties = object.properties;
|
|
12550
|
+
const entries7 = Object.entries(propertyDefinitions).flatMap(([property, definition]) => {
|
|
12551
|
+
if (!isRecord4(definition) || definition.kind !== "attachment") return [];
|
|
12552
|
+
const stored = properties[property];
|
|
12553
|
+
if (!isRecord4(stored) || !descriptor(stored.value)) return [];
|
|
12554
|
+
return [{ property, descriptor: stored.value }];
|
|
12555
|
+
});
|
|
12556
|
+
return { ok: true, entries: entries7 };
|
|
12557
|
+
}
|
|
12558
|
+
var attachmentList = {
|
|
12559
|
+
words: ["attachment", "list"],
|
|
12560
|
+
arguments: 1,
|
|
12561
|
+
organisation: "required",
|
|
12562
|
+
usage: usageList,
|
|
12563
|
+
help: [
|
|
12564
|
+
usageList,
|
|
12565
|
+
"does: lists the object's attachment-kind properties",
|
|
12566
|
+
"example: openeng attachment list obj_abc --project proj_abc --ref main",
|
|
12567
|
+
"output: one JSON object per attachment property with its descriptor"
|
|
12568
|
+
],
|
|
12569
|
+
run: async (context) => {
|
|
12570
|
+
const args = positional(context, 1, usageList);
|
|
12571
|
+
const selector = selectorOf2(context);
|
|
12572
|
+
if (isOutcome(args)) return args;
|
|
12573
|
+
if (!isSelector(selector)) return selector;
|
|
12574
|
+
const objectId = args[0];
|
|
12575
|
+
if (objectId === void 0) return invalid(`usage: ${usageList}`);
|
|
12576
|
+
const settle2 = `openeng attachment list ${objectId} --project ${selector.projectId} --ref ${selector.ref}`;
|
|
12577
|
+
const run2 = await runAuthenticated(context.host, context.deps, async (clients) => {
|
|
12578
|
+
const object = await clients.objects.readObject({ selector, input: { objectId } });
|
|
12579
|
+
if ("refusal" in object) return { outcome: outcomeOfEnvelope(object, settle2, (value) => JSON.stringify(value)) };
|
|
12580
|
+
if (object.replayed === true) return { outcome: outcomeOfEnvelope(object, settle2, (value) => JSON.stringify(value)) };
|
|
12581
|
+
const catalogue = await clients.objects.readCatalogue({ selector: { projectId: selector.projectId }, input: {} });
|
|
12582
|
+
if ("refusal" in catalogue) return { outcome: outcomeOfEnvelope(catalogue, settle2, (value) => JSON.stringify(value)) };
|
|
12583
|
+
if (catalogue.replayed === true) return { outcome: outcomeOfEnvelope(catalogue, settle2, (value) => JSON.stringify(value)) };
|
|
12584
|
+
const type = catalogue.result.objects.find((candidate) => candidate.typeKey === object.result.typeKey);
|
|
12585
|
+
if (type === void 0) return { outcome: invalid(`could not find the published type version for object ${objectId}`) };
|
|
12586
|
+
const listed = attachmentProperties(object.result, type.propertyDefinitions);
|
|
12587
|
+
if (!listed.ok) return { outcome: listed.outcome };
|
|
12588
|
+
const entries7 = listed.entries;
|
|
12589
|
+
const outcome = { kind: "success", value: entries7, text: entries7.map((entry2) => JSON.stringify(entry2)).join("\n") || "no attachments" };
|
|
12590
|
+
return { outcome };
|
|
12591
|
+
});
|
|
12592
|
+
return run2.ok ? run2.answer.outcome : outcomeOfSessionFailure(run2.failure, settle2);
|
|
12593
|
+
}
|
|
12594
|
+
};
|
|
12595
|
+
|
|
12596
|
+
// packages/cli/src/commands/links.ts
|
|
12597
|
+
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
12598
|
+
function boundText(bound) {
|
|
12599
|
+
const name = `${bound.property}${bound.index === void 0 ? "" : `[${bound.index}]`}`;
|
|
12600
|
+
const label = `${name}${bound.quantity === void 0 ? "" : ` quantity ${bound.quantity}`}${"over" in bound ? ` ${bound.over} ${bound.coverage}` : ""}`;
|
|
12601
|
+
switch (bound.state) {
|
|
12602
|
+
case "in":
|
|
12603
|
+
case "out": {
|
|
12604
|
+
const definition = { kind: "number", unit: bound.unit };
|
|
12605
|
+
return `${label}: ${bound.state}; ${displayPropertyValue(bound.value, definition)} ${bound.comparison} ${displayPropertyValue(bound.limit, definition)}` + (bound.tolerance === void 0 ? "" : `; tolerance ${displayPropertyValue(bound.tolerance, definition)}`);
|
|
12606
|
+
}
|
|
12607
|
+
case "no-value":
|
|
12608
|
+
return `${label}: no-value; missing ${bound.missing}${"propertyMissing" in bound ? `; property ${bound.propertyMissing}` : ""}`;
|
|
12609
|
+
case "not-visible":
|
|
12610
|
+
return `${label}: not-visible; hidden ${bound.hidden}`;
|
|
12611
|
+
case "unit-mismatch":
|
|
12612
|
+
return `${label}: unit-mismatch`;
|
|
12613
|
+
case "too-many-links":
|
|
12614
|
+
return `${label}: too-many-links`;
|
|
12615
|
+
}
|
|
12616
|
+
}
|
|
12617
|
+
function boundsText(bounds) {
|
|
12618
|
+
return "bounds" in bounds ? `${bounds.state}; ${bounds.bounds.map(boundText).join("; ")}` : bounds.state;
|
|
12619
|
+
}
|
|
12620
|
+
function statusText(answer) {
|
|
12621
|
+
return [
|
|
12622
|
+
`head: ${answer.head}`,
|
|
12623
|
+
...answer.links.length === 0 ? ["no tracked links"] : answer.links.map((link2) => `${link2.linkId} (${link2.typeKey}) ${link2.upstream.projectId}/${link2.upstream.objectId} -> ${link2.downstream.projectId}/${link2.downstream.objectId}
|
|
12624
|
+
review: ${link2.review.state}${"upstreamVersion" in link2.review ? `; version ${link2.review.upstreamVersion}` : ""}
|
|
12625
|
+
bounds: ${boundsText(link2.bounds)}` + (link2.clearing === null ? "" : `
|
|
12626
|
+
cleared by ${link2.clearing.clearedBy} at ${link2.clearing.clearedAt}`)),
|
|
12627
|
+
...answer.aggregates.map((bound) => `aggregate ${boundText(bound)}`)
|
|
12628
|
+
].join("\n");
|
|
12629
|
+
}
|
|
12630
|
+
var linksStatus = {
|
|
12631
|
+
words: ["links", "status"],
|
|
12632
|
+
arguments: 1,
|
|
12633
|
+
organisation: "required",
|
|
12634
|
+
usage: "openeng links status <object> --project <id> --ref <ref>",
|
|
12635
|
+
help: [
|
|
12636
|
+
"openeng links status <object> --project <id> --ref <ref>",
|
|
12637
|
+
"does: reads review and bounds states, clearing attribution and upstream versions; bounds show units",
|
|
12638
|
+
"example: openeng links status obj_abc --project proj_abc --ref main",
|
|
12639
|
+
"output: head, tracked links and aggregate bounds; --json returns the complete answer"
|
|
12640
|
+
],
|
|
12641
|
+
run: async ({ host, deps, options, args }) => {
|
|
12642
|
+
const { project, ref } = options;
|
|
12643
|
+
const [objectId] = args;
|
|
12644
|
+
if (project === void 0 || ref === void 0 || objectId === void 0 || objectId.length === 0) {
|
|
12645
|
+
return { kind: "client-refusal", message: "links status needs <object>, --project <id> and --ref <ref>" };
|
|
12646
|
+
}
|
|
12647
|
+
const settle2 = `openeng links status ${objectId} --project ${project} --ref ${ref}`;
|
|
12648
|
+
const run2 = await runAuthenticated(host, deps, (clients) => clients.objects.readLinkStatus({
|
|
12649
|
+
selector: { projectId: project, ref },
|
|
12650
|
+
input: { objectId }
|
|
12651
|
+
}));
|
|
12652
|
+
return run2.ok ? outcomeOfEnvelope(run2.answer, settle2, statusText) : outcomeOfSessionFailure(run2.failure, settle2);
|
|
12653
|
+
}
|
|
12654
|
+
};
|
|
12655
|
+
var linksClear = {
|
|
12656
|
+
words: ["links", "clear"],
|
|
12657
|
+
arguments: "rest",
|
|
12658
|
+
organisation: "required",
|
|
12659
|
+
usage: "openeng links clear <link>... --version <v>... --project <id> --ref <ref>",
|
|
12660
|
+
help: [
|
|
12661
|
+
"openeng links clear <link>... --version <v>... --project <id> --ref <ref>",
|
|
12662
|
+
"does: clears 1 to 100 links atomically; supply one upstream version from links status per link, in the same order",
|
|
12663
|
+
"example: openeng links clear edg_abc --version <upstream-version> --project proj_abc --ref main",
|
|
12664
|
+
"output: the clearing commit and correlation; upstream-changed requires reading the status and reviewing again"
|
|
12665
|
+
],
|
|
12666
|
+
run: async ({ host, deps, options, args }) => {
|
|
12667
|
+
const { project, ref, upstreamVersions } = options;
|
|
12668
|
+
if (project === void 0 || ref === void 0 || upstreamVersions === void 0 || args.length < 1 || args.length > MAX_CLEAR_ENTRIES || upstreamVersions.length !== args.length || args.some((link2) => link2.length === 0) || upstreamVersions.some((version) => version.length === 0)) {
|
|
12669
|
+
return { kind: "client-refusal", message: "links clear needs 1 to 100 links, one --version per link, --project <id> and --ref <ref>" };
|
|
12670
|
+
}
|
|
12671
|
+
const entries7 = args.map((linkId, index) => {
|
|
12672
|
+
const upstreamVersion = upstreamVersions[index];
|
|
12673
|
+
if (upstreamVersion === void 0) throw new Error("a clearing entry has no upstream version");
|
|
12674
|
+
return { linkId, upstreamVersion };
|
|
12675
|
+
});
|
|
12676
|
+
const settle2 = `read link status on ref ${ref} or recover the clearing by its correlation id`;
|
|
12677
|
+
const run2 = await runAuthenticated(host, deps, (clients) => clients.objects.clearLinks({
|
|
12678
|
+
selector: { projectId: project },
|
|
12679
|
+
input: { correlation: { kind: "mint" }, ref, entries: entries7 }
|
|
12680
|
+
}, randomUUID6()));
|
|
12681
|
+
if (!run2.ok) return outcomeOfSessionFailure(run2.failure, settle2);
|
|
12682
|
+
if ("result" in run2.answer && run2.answer.result.kind === "unknown") {
|
|
12683
|
+
return { kind: "unknown-outcome-no-answer", message: `clearing outcome unknown; correlation ${run2.answer.result.correlationId}`, settle: settle2 };
|
|
12684
|
+
}
|
|
12685
|
+
return outcomeOfEnvelope(run2.answer, settle2, (answer) => {
|
|
12686
|
+
if (answer.kind !== "succeeded") throw new Error("a clearing success was required");
|
|
12687
|
+
return `cleared ${entries7.length} ${entries7.length === 1 ? "link" : "links"}; ${"hash" in answer.commit ? `commit ${answer.commit.hash}` : "no change"}; correlation ${answer.correlationId}`;
|
|
12688
|
+
});
|
|
12689
|
+
}
|
|
12690
|
+
};
|
|
12691
|
+
|
|
12692
|
+
// packages/cli/src/commands/branches.ts
|
|
12693
|
+
function impactText(answer) {
|
|
12694
|
+
return [
|
|
12695
|
+
`base head: ${answer.baseHead}
|
|
12696
|
+
head: ${answer.head}
|
|
12697
|
+
withheld: ${answer.withheld}`,
|
|
12698
|
+
...answer.reviewChanges.map((change) => `review ${change.linkId}: ${change.base.state} -> ${change.head.state}`),
|
|
12699
|
+
...answer.boundsChanges.map((change) => `bounds ${change.linkId}: ${boundsText(change.base)} -> ${boundsText(change.head)}`),
|
|
12700
|
+
...answer.aggregateChanges.map((change) => `aggregate ${change.owner.projectId}/${change.owner.objectId} ${change.property}${change.index === void 0 ? "" : `[${change.index}]`}: ${"over" in change.base ? boundText(change.base) : change.base.state} -> ${"over" in change.head ? boundText(change.head) : change.head.state}`),
|
|
12701
|
+
...answer.reach.map((entry2) => `reach ${entry2.depth}: ${entry2.address.projectId}/${entry2.address.objectId} via ${entry2.linkId}`),
|
|
12702
|
+
...answer.hidden.map((entry2) => `hidden ${entry2.depth}: ${entry2.count}`)
|
|
12703
|
+
].join("\n");
|
|
12704
|
+
}
|
|
12705
|
+
var branchesImpact = {
|
|
12706
|
+
words: ["branches", "impact"],
|
|
12707
|
+
arguments: 1,
|
|
12708
|
+
organisation: "required",
|
|
12709
|
+
usage: "openeng branches impact <ref> --base <base> --project <id>",
|
|
12710
|
+
help: [
|
|
12711
|
+
"openeng branches impact <ref> --base <base> --project <id>",
|
|
12712
|
+
"does: reads review and bounds changes against the merge base, downstream reach and hidden counts",
|
|
12713
|
+
"example: openeng branches impact proj_abc/work --base main --project proj_abc",
|
|
12714
|
+
"output: both heads, changes with units, reach and hidden counts; --json returns the complete answer"
|
|
12715
|
+
],
|
|
12716
|
+
run: async ({ host, deps, options, args }) => {
|
|
12717
|
+
const { project, base } = options;
|
|
12718
|
+
const [ref] = args;
|
|
12719
|
+
if (project === void 0 || base === void 0 || ref === void 0 || ref.length === 0) {
|
|
12720
|
+
return { kind: "client-refusal", message: "branches impact needs <ref>, --base <base> and --project <id>" };
|
|
12721
|
+
}
|
|
12722
|
+
const settle2 = `openeng branches impact ${ref} --base ${base} --project ${project}`;
|
|
12723
|
+
const run2 = await runAuthenticated(host, deps, (clients) => clients.branches.readChangeImpact({
|
|
12724
|
+
selector: { projectId: project },
|
|
12725
|
+
input: { ref, base }
|
|
12726
|
+
}));
|
|
12727
|
+
return run2.ok ? outcomeOfEnvelope(run2.answer, settle2, impactText) : outcomeOfSessionFailure(run2.failure, settle2);
|
|
12728
|
+
}
|
|
12729
|
+
};
|
|
12730
|
+
|
|
12731
|
+
// packages/cli/src/commands/hosted-app.ts
|
|
12732
|
+
import { readFileSync as readFileSync7 } from "node:fs";
|
|
12733
|
+
var ONE_WALL_WARNING = "This app runs without the WebRTC wall. Its code can send anything a viewer of the app can read to any host on the internet, over WebRTC or through DNS lookups, and nothing reports it. It runs with each viewer's authority. Review the current code, and every later version, for WebRTC use, DNS hints and other exploits before people open it. A coding agent can do the review. Withdrawing this permission stops the app's next request, but not data it has already read.";
|
|
12734
|
+
var ONE_WALL_UNKNOWN = "This account cannot read whether the app may send data out of the browser. An administrator can check its one-wall permission.";
|
|
12735
|
+
var usagePublish = "openeng hosted-app publish <bundle> --project <id> --key <app key>";
|
|
12736
|
+
var usageList2 = "openeng hosted-app list --project <id>";
|
|
12737
|
+
var usageVersions = "openeng hosted-app versions <app key> --project <id>";
|
|
12738
|
+
var usageRevoke = "openeng hosted-app revoke <app key | app id | version id> --project <id>";
|
|
12739
|
+
var invalid2 = (message) => ({ kind: "client-refusal", message });
|
|
12740
|
+
function projectOf(context, name) {
|
|
12741
|
+
const { project } = context.options;
|
|
12742
|
+
return project === void 0 || project === "" ? invalid2(`openeng hosted-app ${name} needs --project <id>`) : project;
|
|
12743
|
+
}
|
|
12744
|
+
function argumentOf(context, usage) {
|
|
12745
|
+
const [first, ...rest] = context.args;
|
|
12746
|
+
return first === void 0 || first === "" || rest.length > 0 ? invalid2(`usage: ${usage}`) : first;
|
|
12747
|
+
}
|
|
12748
|
+
function isOutcome2(value) {
|
|
12749
|
+
return typeof value !== "string";
|
|
12750
|
+
}
|
|
12751
|
+
var appLine = (app) => `${app.key} ${app.appId} ${app.state} created ${app.createdAt} by ${app.createdBy}`;
|
|
12752
|
+
var versionLine = (version) => `${version.versionId} ${version.state} sha256 ${version.bundleSha256} ${String(version.size)} bytes published ${version.publishedAt} by ${version.publishedBy}`;
|
|
12753
|
+
async function appOfKey(clients, projectId, key, settle2) {
|
|
12754
|
+
const listed = await clients.hostedApps.listHostedApps({ selector: { projectId }, input: {} });
|
|
12755
|
+
if ("refusal" in listed || listed.replayed === true) return { outcome: outcomeOfEnvelope(listed, settle2, () => "") };
|
|
12756
|
+
const app = listed.result.apps.find((candidate) => candidate.key === key);
|
|
12757
|
+
return app === void 0 ? { outcome: invalid2(`project ${projectId} has no hosted app with key ${key}`) } : { app };
|
|
12758
|
+
}
|
|
12759
|
+
var hostedAppPublish = {
|
|
12760
|
+
words: ["hosted-app", "publish"],
|
|
12761
|
+
arguments: 1,
|
|
12762
|
+
organisation: "required",
|
|
12763
|
+
usage: usagePublish,
|
|
12764
|
+
help: [
|
|
12765
|
+
usagePublish,
|
|
12766
|
+
"does: publishes a bundle file as the next version of the project's hosted app under the key, creating the app when the project has none under that key",
|
|
12767
|
+
"example: openeng hosted-app publish ./dist/app.js --project proj_abc --key rover-dashboard",
|
|
12768
|
+
"output: the version id, its SHA-256 and its size; for an app that holds the one-wall permission, the one-wall warning as well"
|
|
12769
|
+
],
|
|
12770
|
+
run: async (context) => {
|
|
12771
|
+
const project = projectOf(context, "publish");
|
|
12772
|
+
if (isOutcome2(project)) return project;
|
|
12773
|
+
const file = argumentOf(context, usagePublish);
|
|
12774
|
+
if (isOutcome2(file)) return file;
|
|
12775
|
+
const key = context.options.key;
|
|
12776
|
+
if (key === void 0 || key === "") return invalid2(`openeng hosted-app publish needs --key <app key>; usage: ${usagePublish}`);
|
|
12777
|
+
const bytes = new Uint8Array(readFileSync7(file));
|
|
12778
|
+
const settle2 = `openeng hosted-app versions ${key} --project ${project}, which only reads; publish again only if the version is absent`;
|
|
12779
|
+
const run2 = await runAuthenticated(context.host, context.deps, async (clients) => {
|
|
12780
|
+
const found = await appOfKey(clients, project, key, settle2);
|
|
12781
|
+
let appId;
|
|
12782
|
+
if ("app" in found) {
|
|
12783
|
+
appId = found.app.appId;
|
|
12784
|
+
} else if (found.outcome.kind === "client-refusal") {
|
|
12785
|
+
const created = await clients.hostedApps.createHostedApp({ selector: { projectId: project }, input: { key } });
|
|
12786
|
+
if ("refusal" in created || created.replayed === true) return { outcome: outcomeOfEnvelope(created, settle2, () => "") };
|
|
12787
|
+
appId = created.result.appId;
|
|
12788
|
+
} else {
|
|
12789
|
+
return { outcome: found.outcome };
|
|
12790
|
+
}
|
|
12791
|
+
const published = await clients.hostedApps.publishHostedVersion({ projectId: project }, { appKey: key, bytes });
|
|
12792
|
+
if ("refusal" in published || published.replayed === true) return { outcome: outcomeOfEnvelope(published, settle2, () => "") };
|
|
12793
|
+
const grants = await clients.hostedApps.listHostedOneWallGrants({ input: {} });
|
|
12794
|
+
const unreadable = "refusal" in grants && (grants.refusal.kind === "not-found" || grants.refusal.kind === "refused" && grants.refusal.rule === "not-permitted");
|
|
12795
|
+
if (!unreadable && ("refusal" in grants || grants.replayed === true)) return { outcome: outcomeOfEnvelope(grants, settle2, () => "") };
|
|
12796
|
+
const oneWall = "result" in grants ? grants.result.grants.some((grant) => grant.appId === appId) : "unknown";
|
|
12797
|
+
const notes = oneWall === true ? [ONE_WALL_WARNING] : oneWall === "unknown" ? [ONE_WALL_UNKNOWN] : [];
|
|
12798
|
+
const text = (version) => [`published ${version.versionId} of ${key} sha256 ${version.bundleSha256} ${String(version.size)} bytes`, ...notes].join("\n");
|
|
12799
|
+
const outcome = outcomeOfEnvelope(published, settle2, text);
|
|
12800
|
+
if (outcome.kind !== "success") return { outcome };
|
|
12801
|
+
return {
|
|
12802
|
+
outcome: {
|
|
12803
|
+
...outcome,
|
|
12804
|
+
value: {
|
|
12805
|
+
...outcome.value,
|
|
12806
|
+
oneWall,
|
|
12807
|
+
...oneWall === false ? {} : { warning: oneWall === true ? ONE_WALL_WARNING : ONE_WALL_UNKNOWN }
|
|
12808
|
+
}
|
|
12809
|
+
}
|
|
12810
|
+
};
|
|
12811
|
+
});
|
|
12812
|
+
return run2.ok ? run2.answer.outcome : outcomeOfSessionFailure(run2.failure, settle2);
|
|
12813
|
+
}
|
|
12814
|
+
};
|
|
12815
|
+
var hostedAppList = {
|
|
12816
|
+
words: ["hosted-app", "list"],
|
|
12817
|
+
organisation: "required",
|
|
12818
|
+
usage: usageList2,
|
|
12819
|
+
help: [
|
|
12820
|
+
usageList2,
|
|
12821
|
+
"does: lists the hosted apps of the project",
|
|
12822
|
+
"example: openeng hosted-app list --project proj_abc",
|
|
12823
|
+
"output: one line per app: key, id, state, creation time and creator"
|
|
12824
|
+
],
|
|
12825
|
+
run: async (context) => {
|
|
12826
|
+
const project = projectOf(context, "list");
|
|
12827
|
+
if (isOutcome2(project)) return project;
|
|
12828
|
+
const settle2 = "repeat openeng hosted-app list, which only reads";
|
|
12829
|
+
const run2 = await runAuthenticated(context.host, context.deps, (clients) => clients.hostedApps.listHostedApps({ selector: { projectId: project }, input: {} }));
|
|
12830
|
+
return run2.ok ? outcomeOfEnvelope(run2.answer, settle2, (listed) => listed.apps.length === 0 ? "no hosted apps" : listed.apps.map(appLine).join("\n")) : outcomeOfSessionFailure(run2.failure, settle2);
|
|
12831
|
+
}
|
|
12832
|
+
};
|
|
12833
|
+
var hostedAppVersions = {
|
|
12834
|
+
words: ["hosted-app", "versions"],
|
|
12835
|
+
arguments: 1,
|
|
12836
|
+
organisation: "required",
|
|
12837
|
+
usage: usageVersions,
|
|
12838
|
+
help: [
|
|
12839
|
+
usageVersions,
|
|
12840
|
+
"does: lists the versions of the project's hosted app under the key, newest first",
|
|
12841
|
+
"example: openeng hosted-app versions rover-dashboard --project proj_abc",
|
|
12842
|
+
"output: one line per version: id, state, SHA-256, size, publication time and publisher"
|
|
12843
|
+
],
|
|
12844
|
+
run: async (context) => {
|
|
12845
|
+
const project = projectOf(context, "versions");
|
|
12846
|
+
if (isOutcome2(project)) return project;
|
|
12847
|
+
const key = argumentOf(context, usageVersions);
|
|
12848
|
+
if (isOutcome2(key)) return key;
|
|
12849
|
+
const settle2 = `repeat ${usageVersions}, which only reads`;
|
|
12850
|
+
const run2 = await runAuthenticated(context.host, context.deps, async (clients) => {
|
|
12851
|
+
const found = await appOfKey(clients, project, key, settle2);
|
|
12852
|
+
if ("outcome" in found) return { outcome: found.outcome };
|
|
12853
|
+
const listed = await clients.hostedApps.listHostedVersions({ selector: { projectId: project }, input: { appId: found.app.appId } });
|
|
12854
|
+
return { outcome: outcomeOfEnvelope(listed, settle2, (result) => result.versions.length === 0 ? "no versions" : result.versions.map(versionLine).join("\n")) };
|
|
12855
|
+
});
|
|
12856
|
+
return run2.ok ? run2.answer.outcome : outcomeOfSessionFailure(run2.failure, settle2);
|
|
12857
|
+
}
|
|
12858
|
+
};
|
|
12859
|
+
var hostedAppRevoke = {
|
|
12860
|
+
words: ["hosted-app", "revoke"],
|
|
12861
|
+
arguments: 1,
|
|
12862
|
+
organisation: "required",
|
|
12863
|
+
usage: usageRevoke,
|
|
12864
|
+
help: [
|
|
12865
|
+
usageRevoke,
|
|
12866
|
+
"does: revokes one version (an argument starting hav_) or the whole app (its key or app_ id); the next call under any launch of it is refused",
|
|
12867
|
+
"example: openeng hosted-app revoke hav_abc... --project proj_abc",
|
|
12868
|
+
"output: one line naming what was revoked"
|
|
12869
|
+
],
|
|
12870
|
+
run: async (context) => {
|
|
12871
|
+
const project = projectOf(context, "revoke");
|
|
12872
|
+
if (isOutcome2(project)) return project;
|
|
12873
|
+
const target = argumentOf(context, usageRevoke);
|
|
12874
|
+
if (isOutcome2(target)) return target;
|
|
12875
|
+
const settle2 = `repeat openeng hosted-app list --project ${project}, then revoke again only if the app or version is still live`;
|
|
12876
|
+
const run2 = await runAuthenticated(context.host, context.deps, async (clients) => {
|
|
12877
|
+
if (target.startsWith("hav_")) {
|
|
12878
|
+
const revoked2 = await clients.hostedApps.revokeHostedVersion({ selector: { projectId: project }, input: { versionId: target } });
|
|
12879
|
+
return { outcome: outcomeOfEnvelope(revoked2, settle2, (result) => `revoked version ${result.versionId}`) };
|
|
12880
|
+
}
|
|
12881
|
+
if (target.startsWith("app_")) {
|
|
12882
|
+
const revoked2 = await clients.hostedApps.revokeHostedApp({ selector: { projectId: project }, input: { appId: target } });
|
|
12883
|
+
return { outcome: outcomeOfEnvelope(revoked2, settle2, (result) => `revoked app ${target} (${result.appId})`) };
|
|
12884
|
+
}
|
|
12885
|
+
const found = await appOfKey(clients, project, target, settle2);
|
|
12886
|
+
if ("outcome" in found) return { outcome: found.outcome };
|
|
12887
|
+
const revoked = await clients.hostedApps.revokeHostedApp({ selector: { projectId: project }, input: { appId: found.app.appId } });
|
|
12888
|
+
return { outcome: outcomeOfEnvelope(revoked, settle2, (result) => `revoked app ${target} (${result.appId})`) };
|
|
12889
|
+
});
|
|
12890
|
+
return run2.ok ? run2.answer.outcome : outcomeOfSessionFailure(run2.failure, settle2);
|
|
12891
|
+
}
|
|
12892
|
+
};
|
|
12893
|
+
|
|
10813
12894
|
// packages/cli/src/commands/public.ts
|
|
10814
12895
|
var loginCommand = {
|
|
10815
12896
|
words: ["login"],
|
|
@@ -10884,6 +12965,16 @@ var PUBLIC_HAND_WRITTEN_COMMANDS = [
|
|
|
10884
12965
|
ceilingSet,
|
|
10885
12966
|
schemaUpdateRequest,
|
|
10886
12967
|
schemaUpdateShow,
|
|
12968
|
+
attachmentAdd,
|
|
12969
|
+
attachmentGet,
|
|
12970
|
+
attachmentList,
|
|
12971
|
+
linksStatus,
|
|
12972
|
+
linksClear,
|
|
12973
|
+
branchesImpact,
|
|
12974
|
+
hostedAppPublish,
|
|
12975
|
+
hostedAppList,
|
|
12976
|
+
hostedAppVersions,
|
|
12977
|
+
hostedAppRevoke,
|
|
10887
12978
|
typesList,
|
|
10888
12979
|
typesExport,
|
|
10889
12980
|
typesDraftOpen,
|
|
@@ -10891,6 +12982,7 @@ var PUBLIC_HAND_WRITTEN_COMMANDS = [
|
|
|
10891
12982
|
typesDraftShow,
|
|
10892
12983
|
typesDraftState,
|
|
10893
12984
|
typesDraftRevise,
|
|
12985
|
+
typesDraftTry,
|
|
10894
12986
|
typesDraftValidate,
|
|
10895
12987
|
typesDraftDiscard,
|
|
10896
12988
|
typesDraftAccept,
|
|
@@ -10913,7 +13005,7 @@ var PUBLIC_COMMANDS = [
|
|
|
10913
13005
|
|
|
10914
13006
|
// packages/cli/src/main.ts
|
|
10915
13007
|
import { spawn } from "node:child_process";
|
|
10916
|
-
import { readFileSync as
|
|
13008
|
+
import { readFileSync as readFileSync9 } from "node:fs";
|
|
10917
13009
|
import { homedir } from "node:os";
|
|
10918
13010
|
import { parseArgs } from "node:util";
|
|
10919
13011
|
|
|
@@ -10934,11 +13026,14 @@ var CLI_OPTIONS = {
|
|
|
10934
13026
|
consequence: { type: "string" },
|
|
10935
13027
|
"rule-id": { type: "string" },
|
|
10936
13028
|
ref: { type: "string" },
|
|
13029
|
+
base: { type: "string" },
|
|
10937
13030
|
name: { type: "string" },
|
|
10938
13031
|
"change-set": { type: "string" },
|
|
10939
13032
|
revision: { type: "string" },
|
|
10940
13033
|
from: { type: "string" },
|
|
10941
13034
|
"rail-groups": { type: "string" },
|
|
13035
|
+
type: { type: "string" },
|
|
13036
|
+
sample: { type: "string" },
|
|
10942
13037
|
size: { type: "string" },
|
|
10943
13038
|
world: { type: "string" },
|
|
10944
13039
|
selector: { type: "string" },
|
|
@@ -10951,12 +13046,15 @@ var CLI_OPTIONS = {
|
|
|
10951
13046
|
team: { type: "string" },
|
|
10952
13047
|
owner: { type: "string" },
|
|
10953
13048
|
label: { type: "string" },
|
|
13049
|
+
out: { type: "string" },
|
|
13050
|
+
key: { type: "string" },
|
|
10954
13051
|
help: { type: "boolean", short: "h" },
|
|
10955
13052
|
version: { type: "boolean" }
|
|
10956
13053
|
};
|
|
13054
|
+
var APP_KEY_FORM = /^[a-z0-9][a-z0-9-]{0,62}$/;
|
|
10957
13055
|
|
|
10958
13056
|
// packages/cli/src/cli-version.ts
|
|
10959
|
-
var PATCH_VERSION =
|
|
13057
|
+
var PATCH_VERSION = 0;
|
|
10960
13058
|
var CLI_VERSION = `0.${PROTOCOL_VERSION}.${PATCH_VERSION}`;
|
|
10961
13059
|
|
|
10962
13060
|
// packages/cli/src/environment.ts
|
|
@@ -10964,12 +13062,99 @@ var readEnvironment = () => Object.freeze({
|
|
|
10964
13062
|
OPENENG_HOST: process.env.OPENENG_HOST,
|
|
10965
13063
|
OPENENG_SIGN_IN_ORIGIN: process.env.OPENENG_SIGN_IN_ORIGIN,
|
|
10966
13064
|
OPENENG_SESSION_STORE: process.env.OPENENG_SESSION_STORE,
|
|
10967
|
-
XDG_CONFIG_HOME: process.env.XDG_CONFIG_HOME
|
|
13065
|
+
XDG_CONFIG_HOME: process.env.XDG_CONFIG_HOME,
|
|
13066
|
+
OPENENG_NO_UPDATE_CHECK: process.env.OPENENG_NO_UPDATE_CHECK,
|
|
13067
|
+
CI: process.env.CI
|
|
10968
13068
|
});
|
|
10969
13069
|
|
|
10970
13070
|
// packages/cli/src/transport.ts
|
|
10971
13071
|
var createTransport = (host) => host.kind === "unix" ? createHostFetch(host.socketPath) : createHttpsTransport(host.origin);
|
|
10972
13072
|
|
|
13073
|
+
// packages/cli/src/update-check.ts
|
|
13074
|
+
import { randomUUID as randomUUID7 } from "node:crypto";
|
|
13075
|
+
import { existsSync, mkdirSync as mkdirSync3, readFileSync as readFileSync8, renameSync as renameSync2, unlinkSync as unlinkSync3, writeFileSync as writeFileSync2 } from "node:fs";
|
|
13076
|
+
import { join as join4 } from "node:path";
|
|
13077
|
+
function versionParts(value) {
|
|
13078
|
+
if (typeof value !== "string" || !/^\d+\.\d+\.\d+$/.test(value)) {
|
|
13079
|
+
return null;
|
|
13080
|
+
}
|
|
13081
|
+
const parts = value.split(".").map(Number);
|
|
13082
|
+
return parts.every(Number.isSafeInteger) ? parts : null;
|
|
13083
|
+
}
|
|
13084
|
+
function readCache(file) {
|
|
13085
|
+
if (!existsSync(file)) {
|
|
13086
|
+
return null;
|
|
13087
|
+
}
|
|
13088
|
+
const value = JSON.parse(readFileSync8(file, "utf8"));
|
|
13089
|
+
if (typeof value !== "object" || value === null || !("latest" in value) || !("checkedAt" in value)) {
|
|
13090
|
+
return null;
|
|
13091
|
+
}
|
|
13092
|
+
return typeof value.latest === "string" && versionParts(value.latest) !== null && typeof value.checkedAt === "number" && Number.isFinite(value.checkedAt) ? { latest: value.latest, checkedAt: value.checkedAt } : null;
|
|
13093
|
+
}
|
|
13094
|
+
async function publishedVersion(signal) {
|
|
13095
|
+
const response = await fetch("https://registry.npmjs.org/@openengio%2fcli/latest", { signal, redirect: "error" });
|
|
13096
|
+
if (!response.ok) {
|
|
13097
|
+
return null;
|
|
13098
|
+
}
|
|
13099
|
+
const value = await response.json();
|
|
13100
|
+
return typeof value === "object" && value !== null && "version" in value && typeof value.version === "string" && versionParts(value.version) !== null ? value.version : null;
|
|
13101
|
+
}
|
|
13102
|
+
async function fetchLatest() {
|
|
13103
|
+
const controller = new AbortController();
|
|
13104
|
+
let timer;
|
|
13105
|
+
const deadline = new Promise((resolve) => {
|
|
13106
|
+
timer = setTimeout(() => {
|
|
13107
|
+
controller.abort();
|
|
13108
|
+
resolve(null);
|
|
13109
|
+
}, 1500);
|
|
13110
|
+
});
|
|
13111
|
+
try {
|
|
13112
|
+
return await Promise.race([publishedVersion(controller.signal), deadline]);
|
|
13113
|
+
} finally {
|
|
13114
|
+
clearTimeout(timer);
|
|
13115
|
+
}
|
|
13116
|
+
}
|
|
13117
|
+
function writeCache(directory, file, cache) {
|
|
13118
|
+
mkdirSync3(directory, { recursive: true, mode: 448 });
|
|
13119
|
+
const temporary = `${file}.${randomUUID7()}.tmp`;
|
|
13120
|
+
try {
|
|
13121
|
+
writeFileSync2(temporary, JSON.stringify(cache), { flag: "wx", mode: 384 });
|
|
13122
|
+
renameSync2(temporary, file);
|
|
13123
|
+
} finally {
|
|
13124
|
+
if (existsSync(temporary)) {
|
|
13125
|
+
unlinkSync3(temporary);
|
|
13126
|
+
}
|
|
13127
|
+
}
|
|
13128
|
+
}
|
|
13129
|
+
async function checkForUpdate(configDirectory) {
|
|
13130
|
+
try {
|
|
13131
|
+
const directory = join4(configDirectory, "openeng");
|
|
13132
|
+
const file = join4(directory, "update-check.json");
|
|
13133
|
+
const now = Date.now();
|
|
13134
|
+
let cache = readCache(file);
|
|
13135
|
+
if (cache === null || now < cache.checkedAt || now - cache.checkedAt >= 864e5) {
|
|
13136
|
+
const latest2 = await fetchLatest();
|
|
13137
|
+
if (latest2 === null) {
|
|
13138
|
+
return;
|
|
13139
|
+
}
|
|
13140
|
+
cache = { latest: latest2, checkedAt: now };
|
|
13141
|
+
writeCache(directory, file, cache);
|
|
13142
|
+
}
|
|
13143
|
+
const latest = versionParts(cache.latest);
|
|
13144
|
+
const current = versionParts(CLI_VERSION);
|
|
13145
|
+
if (latest === null || current === null) {
|
|
13146
|
+
return;
|
|
13147
|
+
}
|
|
13148
|
+
const difference = latest.findIndex((part, index) => part !== current[index]);
|
|
13149
|
+
if (difference !== -1 && latest[difference] > current[difference]) {
|
|
13150
|
+
process.stderr.write(`openeng ${cache.latest} is available (you have ${CLI_VERSION}): npm install -g @openengio/cli@latest
|
|
13151
|
+
`);
|
|
13152
|
+
}
|
|
13153
|
+
} catch {
|
|
13154
|
+
return;
|
|
13155
|
+
}
|
|
13156
|
+
}
|
|
13157
|
+
|
|
10973
13158
|
// packages/cli/src/main.ts
|
|
10974
13159
|
var clock = {
|
|
10975
13160
|
now: () => Date.now(),
|
|
@@ -11054,12 +13239,22 @@ var addressPrinter = (json) => (address) => {
|
|
|
11054
13239
|
var promptSecret = createSecretPrompt(process.stdin, process.stderr);
|
|
11055
13240
|
function parseInvocation(argv) {
|
|
11056
13241
|
try {
|
|
13242
|
+
const preliminary = parseArgs({
|
|
13243
|
+
args: [...argv],
|
|
13244
|
+
allowPositionals: true,
|
|
13245
|
+
strict: false,
|
|
13246
|
+
options: CLI_OPTIONS
|
|
13247
|
+
});
|
|
13248
|
+
const clearing = preliminary.positionals[0] === "links" && preliminary.positionals[1] === "clear";
|
|
11057
13249
|
const { values, positionals } = parseArgs({
|
|
11058
13250
|
args: [...argv],
|
|
11059
13251
|
allowPositionals: true,
|
|
11060
13252
|
strict: true,
|
|
11061
|
-
options: CLI_OPTIONS
|
|
13253
|
+
options: clearing ? { ...CLI_OPTIONS, version: { type: "string", multiple: true } } : CLI_OPTIONS
|
|
11062
13254
|
});
|
|
13255
|
+
if (values.key !== void 0 && !APP_KEY_FORM.test(values.key)) {
|
|
13256
|
+
return { kind: "client-refusal", message: "--key takes an app key: lower-case letters, digits and hyphens, starting with a letter or digit, at most 63 characters" };
|
|
13257
|
+
}
|
|
11063
13258
|
return {
|
|
11064
13259
|
words: positionals,
|
|
11065
13260
|
help: values.help === true,
|
|
@@ -11080,11 +13275,15 @@ function parseInvocation(argv) {
|
|
|
11080
13275
|
consequence: values.consequence,
|
|
11081
13276
|
ruleId: values["rule-id"],
|
|
11082
13277
|
ref: values.ref,
|
|
13278
|
+
base: values.base,
|
|
13279
|
+
...clearing && Array.isArray(values.version) ? { upstreamVersions: values.version } : {},
|
|
11083
13280
|
name: values.name,
|
|
11084
13281
|
changeSet: values["change-set"],
|
|
11085
13282
|
revision: values.revision,
|
|
11086
13283
|
from: values.from,
|
|
11087
13284
|
railGroups: values["rail-groups"],
|
|
13285
|
+
type: values.type,
|
|
13286
|
+
sample: values.sample,
|
|
11088
13287
|
size: values.size,
|
|
11089
13288
|
world: values.world,
|
|
11090
13289
|
selector: values.selector,
|
|
@@ -11096,7 +13295,9 @@ function parseInvocation(argv) {
|
|
|
11096
13295
|
company: values.company,
|
|
11097
13296
|
team: values.team,
|
|
11098
13297
|
owner: values.owner,
|
|
11099
|
-
label: values.label
|
|
13298
|
+
label: values.label,
|
|
13299
|
+
out: values.out,
|
|
13300
|
+
key: values.key
|
|
11100
13301
|
}
|
|
11101
13302
|
};
|
|
11102
13303
|
} catch (error) {
|
|
@@ -11117,11 +13318,11 @@ async function run(commands, argv) {
|
|
|
11117
13318
|
}
|
|
11118
13319
|
const { options } = invocation;
|
|
11119
13320
|
if (invocation.version) {
|
|
11120
|
-
return { outcome: { kind: "success", value: { version: CLI_VERSION }, text: CLI_VERSION }, json: options.json, scope: null };
|
|
13321
|
+
return { outcome: { kind: "success", value: { version: CLI_VERSION }, text: CLI_VERSION }, json: options.json, scope: null, skipUpdateCheck: true };
|
|
11121
13322
|
}
|
|
11122
13323
|
const helped = outcomeOfHelp(commands, invocation.words, invocation.help);
|
|
11123
13324
|
if (helped !== void 0) {
|
|
11124
|
-
return { outcome: helped, json: options.json, scope: null };
|
|
13325
|
+
return { outcome: helped, json: options.json, scope: null, skipUpdateCheck: true };
|
|
11125
13326
|
}
|
|
11126
13327
|
const command = findCommand(commands, invocation.words);
|
|
11127
13328
|
if (command === void 0) {
|
|
@@ -11169,7 +13370,7 @@ ${usageLines(commands).join("\n")}` : unknownCommandMessage(commands, invocation
|
|
|
11169
13370
|
deps,
|
|
11170
13371
|
options,
|
|
11171
13372
|
args: invocation.words.slice(command.words.length),
|
|
11172
|
-
readStandardInput: () =>
|
|
13373
|
+
readStandardInput: () => readFileSync9(0, "utf8"),
|
|
11173
13374
|
promptSecret,
|
|
11174
13375
|
writeLine: (line) => process.stdout.write(`${line}
|
|
11175
13376
|
`),
|
|
@@ -11224,6 +13425,10 @@ async function main(commands) {
|
|
|
11224
13425
|
`);
|
|
11225
13426
|
}
|
|
11226
13427
|
process.exitCode = rendered.exitCode;
|
|
13428
|
+
const environment = readEnvironment();
|
|
13429
|
+
if (result.skipUpdateCheck !== true && environment.OPENENG_NO_UPDATE_CHECK !== "1" && environment.CI === void 0) {
|
|
13430
|
+
await checkForUpdate(configurationDirectory(environment.XDG_CONFIG_HOME, homedir()));
|
|
13431
|
+
}
|
|
11227
13432
|
}
|
|
11228
13433
|
|
|
11229
13434
|
// packages/cli/src/bin-public.ts
|