@deliverd/sdk 0.8.0 → 0.8.2
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/LICENSE +21 -21
- package/README.md +562 -562
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +84 -5
- package/dist/released.d.ts +1 -1
- package/dist/released.d.ts.map +1 -1
- package/dist/released.js +839 -12
- package/package.json +55 -55
- package/src/approvals.ts +322 -322
- package/src/collections.ts +236 -236
- package/src/dev.ts +761 -761
- package/src/duration.ts +21 -21
- package/src/errors.ts +62 -62
- package/src/flows.ts +222 -222
- package/src/gates.ts +230 -230
- package/src/http.ts +217 -217
- package/src/index.ts +443 -443
- package/src/messages.ts +161 -82
- package/src/paging.ts +64 -64
- package/src/released.ts +2072 -1243
- package/src/reports.ts +490 -490
- package/src/reviews.ts +225 -225
- package/src/types.ts +838 -838
- package/src/webhooks.ts +98 -98
package/dist/messages.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,WAAW;IAC1B,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,WAAW;IAC1B,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAsIpD,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAI5F"}
|
package/dist/messages.js
CHANGED
|
@@ -16,14 +16,22 @@ export const EXPLANATIONS = {
|
|
|
16
16
|
},
|
|
17
17
|
auth_error: {
|
|
18
18
|
message: "That credential was not accepted.",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/*
|
|
20
|
+
* Both families, because both work: a `dlv_` key somebody created, or a
|
|
21
|
+
* `dlvo_` access token from an OAuth connector. Naming only the first is
|
|
22
|
+
* how a connector's token gets thrown away and replaced with a key
|
|
23
|
+
* nobody needed to create.
|
|
24
|
+
*
|
|
25
|
+
* Credentials only. A missing scope is `insufficient_scope` below and has
|
|
26
|
+
* been since `ApiScopeError` existed — the two shared this code before
|
|
27
|
+
* that, which is how somebody whose key was perfectly good came to be told
|
|
28
|
+
* to go and check their key.
|
|
29
|
+
*/
|
|
23
30
|
hint: "Check DELIVERD_API_KEY. An API key starts with dlv_ and is created in Settings → API tokens; an OAuth access token starts with dlvo_ and needs no setup.",
|
|
24
31
|
},
|
|
25
32
|
insufficient_scope: {
|
|
26
|
-
|
|
33
|
+
message: "That credential is valid and does not carry the scope this call needs.",
|
|
34
|
+
hint: "Reissue the key with the scope named above, or re-consent the connector for it. A credential issued before a scope existed does not have it — nothing is wrong with the key itself, so replacing it with another of the same scopes will fail the same way.",
|
|
27
35
|
},
|
|
28
36
|
unknown_approver: {
|
|
29
37
|
message: "No approver could be found for this request.",
|
|
@@ -61,6 +69,77 @@ export const EXPLANATIONS = {
|
|
|
61
69
|
timeout: {
|
|
62
70
|
hint: "You stopped waiting; the request is still open at the URL above until it expires. If an approver asked a question, answer it with an `onQuestion` handler — an unanswered question is the commonest reason a wait runs out.",
|
|
63
71
|
},
|
|
72
|
+
/*
|
|
73
|
+
* The one code every namespace can return, and the only entry here that is
|
|
74
|
+
* about what a status *means* rather than about a particular call.
|
|
75
|
+
*
|
|
76
|
+
* It had none until a policy id that does not exist stopped answering 500,
|
|
77
|
+
* and the reason to write one is the half a reader does not expect: a 404
|
|
78
|
+
* is also what this API says when the thing is there and not theirs. It is
|
|
79
|
+
* one answer on purpose — telling the two apart would say whether the id
|
|
80
|
+
* exists for somebody else — so "it was deleted" is a guess, and a retry
|
|
81
|
+
* cannot turn it into anything else.
|
|
82
|
+
*
|
|
83
|
+
* No `message`: the server's own sentence names the resource, and this
|
|
84
|
+
* table cannot, being shared by approvals, reports and policies alike.
|
|
85
|
+
*/
|
|
86
|
+
not_found: {
|
|
87
|
+
hint: "Nothing with that id, or nothing this key may see — the API does not say which, because saying would tell you whether it exists for somebody else. Check the id, and that the key belongs to the organisation that owns it. Retrying will not change the answer.",
|
|
88
|
+
},
|
|
89
|
+
/*
|
|
90
|
+
* The 404s that name their own resource. Each is here for a fact the
|
|
91
|
+
* server's sentence cannot carry, which is the only reason to add one —
|
|
92
|
+
* repeating "not found" under a longer name would be noise.
|
|
93
|
+
*
|
|
94
|
+
* `report_not_found` is deliberately absent. Placing and releasing a legal
|
|
95
|
+
* hold is web-only by design, so no route can send it and an entry would be
|
|
96
|
+
* advice nobody receives; `sdk-parity.test.ts` holds that omission to the
|
|
97
|
+
* reason the app already records, and fails if the code ever becomes
|
|
98
|
+
* reachable.
|
|
99
|
+
*/
|
|
100
|
+
agent_not_found: {
|
|
101
|
+
message: "The agent identity this key acts as is not there any more.",
|
|
102
|
+
hint: "Nothing is wrong with the credential — it still authenticates, and what is gone is the identity it speaks as. Recreate the agent under Admin → Agents, or issue a key bound to one that exists. Every call this key makes fails the same way until then.",
|
|
103
|
+
},
|
|
104
|
+
upload_not_found: {
|
|
105
|
+
hint: "A publish consumes the bundle it reads, so this is what a *second* publish with the same `uploadId` gets — which means the first one may well have worked. Look at the report before uploading again, or you will publish it twice.",
|
|
106
|
+
},
|
|
107
|
+
question_not_found: {
|
|
108
|
+
hint: "Question ids belong to one approval, so this is usually an id from a different one. Take it from that approval's own questions — an `onQuestion` handler is handed it — rather than from anywhere you cached it. A question already answered is `already_answered`, not this.",
|
|
109
|
+
},
|
|
110
|
+
quote_not_found: {
|
|
111
|
+
hint: "The passage is not in the version the message names. A republish rewrites the text, so a quote taken before one stops matching: read the current version and quote what it says now. A quote that matches in several places is `quote_ambiguous` instead, and an empty one is `quote_empty`.",
|
|
112
|
+
},
|
|
113
|
+
/*
|
|
114
|
+
* The gate and its policy, which had no entries at all until the codes were
|
|
115
|
+
* told apart — the newest surface in the API and the one a reader is least
|
|
116
|
+
* likely to recognise, falling through to the server's own message with no
|
|
117
|
+
* next step.
|
|
118
|
+
*
|
|
119
|
+
* The first two are met through `deliverd.gate()`. The last three come from
|
|
120
|
+
* authoring, which no namespace covers, so a caller reaches them through
|
|
121
|
+
* `deliverd.http` — still the API's codes, still worth explaining, and the
|
|
122
|
+
* reason this table is keyed on what the API returns rather than on which
|
|
123
|
+
* namespace produced it.
|
|
124
|
+
*/
|
|
125
|
+
unknown_action: {
|
|
126
|
+
message: "No action by that name is registered.",
|
|
127
|
+
hint: "Register it first — `deliverd actions push`, or POST /v1/actions — and use the same dotted id. A gate on an unregistered action is refused before any rule is read, so this is not a policy saying no.",
|
|
128
|
+
},
|
|
129
|
+
invalid_input: {
|
|
130
|
+
message: "The arguments do not match the action's registered schema.",
|
|
131
|
+
hint: "Read `details` for the field. The schema is the one your organisation registered for this action, so either the call is wrong or the registration is out of date.",
|
|
132
|
+
},
|
|
133
|
+
invalid_rules: {
|
|
134
|
+
message: "Those rules cannot be stored as written.",
|
|
135
|
+
hint: "Read `details` — it names each condition that could not be checked, usually a field no registered action declares. This is refused now rather than at evaluation, where the rule would match nothing and look like one that had simply not fired.",
|
|
136
|
+
},
|
|
137
|
+
duplicate: {
|
|
138
|
+
hint: "Something with that name is already there. Add a version to it rather than creating a second one.",
|
|
139
|
+
},
|
|
140
|
+
superseded: {
|
|
141
|
+
hint: "It was replaced while you were working. Read the current one and act on that; copy its contents into a new version rather than reviving the old, because a past decision points at what it said.",
|
|
142
|
+
},
|
|
64
143
|
invalid_signature: {
|
|
65
144
|
hint: "Check the endpoint's signing secret, and that you passed the raw request body rather than a re-encoded object.",
|
|
66
145
|
},
|
package/dist/released.d.ts
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
* **Add the version here when you publish it, not before.** An entry is a
|
|
44
44
|
* claim that `npm install @deliverd/sdk@x` works today.
|
|
45
45
|
*/
|
|
46
|
-
export declare const PUBLISHED_TO_NPM: readonly ["0.1.0", "0.2.0", "0.3.0", "0.4.0", "0.5.0", "0.6.0", "0.6.1", "0.6.2", "0.7.0", "0.7.1"];
|
|
46
|
+
export declare const PUBLISHED_TO_NPM: readonly ["0.1.0", "0.2.0", "0.3.0", "0.4.0", "0.5.0", "0.6.0", "0.6.1", "0.6.2", "0.7.0", "0.7.1", "0.8.0", "0.8.1"];
|
|
47
47
|
/**
|
|
48
48
|
* A fingerprint of what each *published* version recorded.
|
|
49
49
|
*
|
package/dist/released.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"released.d.ts","sourceRoot":"","sources":["../src/released.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"released.d.ts","sourceRoot":"","sources":["../src/released.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,uHAanB,CAAC;AAEX;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAczC,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAy7DtD,CAAC"}
|