@andco/protocol 0.0.15 → 0.1.0-ti.1
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/dist/authorization-preparation.d.ts +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/intent-input.d.ts +67 -54
- package/dist/intent-input.d.ts.map +1 -1
- package/dist/intent-input.js +39 -23
- package/dist/intent-status.d.ts +5 -6
- package/dist/intent-status.d.ts.map +1 -1
- package/dist/intent-status.js +12 -7
- package/dist/miniapp-manifest.d.ts +2 -2
- package/dist/miniapp-manifest.js +1 -1
- package/dist/native-intent.d.ts +12 -12
- package/dist/native-intent.d.ts.map +1 -1
- package/dist/native-intent.js +7 -4
- package/dist/rar/account-matchers.d.ts +10 -10
- package/dist/rar/account-matchers.js +2 -2
- package/dist/rar/bank.d.ts +295 -23
- package/dist/rar/bank.d.ts.map +1 -1
- package/dist/rar/bank.js +54 -16
- package/dist/rar/catalog.d.ts +134 -9
- package/dist/rar/catalog.d.ts.map +1 -1
- package/dist/rar/catalog.js +6 -6
- package/dist/rar/json-schemas.generated.d.ts.map +1 -1
- package/dist/rar/json-schemas.generated.js +375 -7
- package/dist/rar/money.d.ts +1 -1
- package/dist/rar/money.js +1 -1
- package/dist/rar/subject-data.d.ts +1 -1
- package/dist/rar/subject-data.js +1 -1
- package/dist/rest/accounts.d.ts +69 -47
- package/dist/rest/accounts.d.ts.map +1 -1
- package/dist/rest/accounts.js +32 -22
- package/dist/rest/catalog.d.ts +3 -3
- package/dist/rest/catalog.js +2 -2
- package/dist/rest/contract.d.ts +581 -316
- package/dist/rest/contract.d.ts.map +1 -1
- package/dist/rest/contract.js +10 -6
- package/dist/rest/events.js +1 -1
- package/dist/rest/identity.d.ts +22 -22
- package/dist/rest/identity.d.ts.map +1 -1
- package/dist/rest/identity.js +4 -4
- package/dist/rest/intents.d.ts +301 -142
- package/dist/rest/intents.d.ts.map +1 -1
- package/dist/rest/intents.js +67 -53
- package/dist/rest/signatures.d.ts +19 -5
- package/dist/rest/signatures.d.ts.map +1 -1
- package/dist/rest/signatures.js +47 -5
- package/dist/rest/transfers.d.ts +738 -362
- package/dist/rest/transfers.d.ts.map +1 -1
- package/dist/rest/transfers.js +71 -44
- package/dist/signing.d.ts +6 -2
- package/dist/signing.d.ts.map +1 -1
- package/dist/signing.js +2 -1
- package/dist/transfer.d.ts +101 -65
- package/dist/transfer.d.ts.map +1 -1
- package/dist/transfer.js +69 -43
- package/dist/transport/financial-events.d.ts +65 -14
- package/dist/transport/financial-events.d.ts.map +1 -1
- package/dist/transport/financial-events.js +34 -0
- package/dist/transport/generated/oauth-api.d.ts +384 -110
- package/dist/transport/generated/oauth-api.d.ts.map +1 -1
- package/dist/transport/intents.d.ts +6 -6
- package/dist/transport/intents.d.ts.map +1 -1
- package/dist/transport/rest.d.ts +9 -8
- package/dist/transport/rest.d.ts.map +1 -1
- package/dist/transport/rest.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intents.d.ts","sourceRoot":"","sources":["../../src/rest/intents.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAc7B,OAAO,EAEL,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,QAAQ,EAER,eAAe,EACf,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"intents.d.ts","sourceRoot":"","sources":["../../src/rest/intents.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAc7B,OAAO,EAEL,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,QAAQ,EAER,eAAe,EACf,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,kBA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4cA6BR,CAAC;AAElB,sDAAsD;AACtD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0aA4BR,CAAC;AAElB,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8PAuBA,CAAC"}
|
package/dist/rest/intents.js
CHANGED
|
@@ -3,12 +3,12 @@ import * as v from "valibot";
|
|
|
3
3
|
import { IntentAccountSchema, IntentCancellationSchema, IntentCreateSchema, IntentNoteSchema, IntentRejectionSchema, TransferCommentProposalSchema, TransferIntentReceiverProposalSchema, } from "../intent-input.js";
|
|
4
4
|
import { AccountKeySchema } from "../rar/account-matchers.js";
|
|
5
5
|
import { MoneySchema } from "../rar/money.js";
|
|
6
|
-
import { PesosSchema } from "../transfer.js";
|
|
6
|
+
import { PesosSchema, SignedTransferEnvelopeSchema } from "../transfer.js";
|
|
7
7
|
import { AndcoAPIError, errors } from "./api-error.js";
|
|
8
8
|
import { ApiIssue, InsufficientAuthorization, InvalidIdentifier, InvalidOrigin, InvalidRequest, InvalidToken, NotFound, PageQuery, PayloadTooLarge, ServerError, TemporarilyUnavailable, UnsupportedMediaType, UnsupportedVersion, } from "./common.js";
|
|
9
9
|
import { FinancialEventPage } from "./events.js";
|
|
10
10
|
import { http } from "./http.js";
|
|
11
|
-
import { SignedInstructionRejectionReason,
|
|
11
|
+
import { SignedInstructionRejectionReason, servedAsSignedInstructionOrTransfer, signedInstructionBody, } from "./signatures.js";
|
|
12
12
|
const uuid = /* @__PURE__ */ v.pipe(v.string(), v.uuid());
|
|
13
13
|
const dateTime = /* @__PURE__ */ v.pipe(v.string(), v.isoTimestamp());
|
|
14
14
|
const url = /* @__PURE__ */ v.pipe(v.string(), v.url());
|
|
@@ -26,6 +26,26 @@ export class IdempotencyKeyNotAllowed extends /* @__PURE__ */ AndcoAPIError.defi
|
|
|
26
26
|
super({}, message);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* A signed transfer with `approved: false` arrived at `POST /transfers`. That door takes a transfer
|
|
31
|
+
* its own signature approved. A signed transfer that waits for a decision is an Intent: send it to
|
|
32
|
+
* `POST /intents`. Nothing was recorded.
|
|
33
|
+
*/
|
|
34
|
+
export class ApprovalRequiredUseIntents extends /* @__PURE__ */ AndcoAPIError.define("approval_required_use_intents", 400, v.pipe(v.object({}), v.description("`POST /transfers` takes only a signed transfer with `approved: true`. Send one with `approved: false` to `POST /intents`."))) {
|
|
35
|
+
constructor(message) {
|
|
36
|
+
super({}, message);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A signed transfer with `approved: true` arrived at `POST /intents`. Its signature is the approval,
|
|
41
|
+
* so no decision is left to wait for: send it to `POST /transfers`. A signed account opening or
|
|
42
|
+
* closure with `approved: true` stays accepted here. Nothing was recorded.
|
|
43
|
+
*/
|
|
44
|
+
export class ApprovedUseTransfers extends /* @__PURE__ */ AndcoAPIError.define("approved_use_transfers", 400, v.pipe(v.object({}), v.description("`POST /intents` takes a signed transfer only with `approved: false`. Send one with `approved: true` to `POST /transfers`."))) {
|
|
45
|
+
constructor(message) {
|
|
46
|
+
super({}, message);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
29
49
|
/**
|
|
30
50
|
* The Signed Instruction sent to create an Intent was refused: it did not verify (`reason` names the
|
|
31
51
|
* one cause), or its verified claims are not an Intent (`invalid_claims`, with `issues`). An expired
|
|
@@ -129,8 +149,8 @@ export class BankAccountQuotaExceeded extends /* @__PURE__ */ AndcoAPIError.defi
|
|
|
129
149
|
}
|
|
130
150
|
/**
|
|
131
151
|
* The base of an error that refuses what an Intent asks (`422`): the request is valid, but the Grant or
|
|
132
|
-
* AndCo does not let it go on. On a release, `intent_id` names the Intent, which
|
|
133
|
-
* the same word when AndCo answered.
|
|
152
|
+
* AndCo does not let it go on. On a release, `intent_id` names the Intent, which stays `approved`; the
|
|
153
|
+
* Transfer it names, or the opening, reads `failed` with the same word when AndCo answered.
|
|
134
154
|
*/
|
|
135
155
|
/* @__NO_SIDE_EFFECTS__ */
|
|
136
156
|
function intentRefusal(error, description) {
|
|
@@ -190,13 +210,13 @@ export class BankHolderWithoutAccount extends /* @__PURE__ */ intentRefusal("ban
|
|
|
190
210
|
/** AndCo's own ceiling of accounts for the holder is reached. */
|
|
191
211
|
export class BankAccountLimitReached extends /* @__PURE__ */ intentRefusal("bank_account_limit_reached", "The holder reached AndCo's ceiling of accounts.") {
|
|
192
212
|
}
|
|
193
|
-
/** AndCo
|
|
213
|
+
/** AndCo refused the request before accepting it; no money moved. */
|
|
194
214
|
export class BankRefused extends /* @__PURE__ */ intentRefusal("bank_refused", "AndCo refused the request.") {
|
|
195
215
|
}
|
|
196
216
|
/** The source account does not hold enough money for this movement. */
|
|
197
217
|
export class InsufficientFunds extends /* @__PURE__ */ intentRefusal("insufficient_funds", "The source account does not hold enough money.") {
|
|
198
218
|
}
|
|
199
|
-
/**
|
|
219
|
+
/** AndCo rejected the movement and nothing stays moved. */
|
|
200
220
|
export class BankRejected extends /* @__PURE__ */ intentRefusal("bank_rejected", "AndCo rejected the movement; nothing stays moved.") {
|
|
201
221
|
}
|
|
202
222
|
/**
|
|
@@ -230,49 +250,22 @@ export class NotImplemented extends /* @__PURE__ */ AndcoAPIError.define("not_im
|
|
|
230
250
|
}
|
|
231
251
|
// -- Intents ------------------------------------------------------------------------------------
|
|
232
252
|
/**
|
|
233
|
-
* `<base>[.<detail>]`: where an Intent stands.
|
|
253
|
+
* `<base>[.<detail>]`: where an Intent stands in its decision. An Intent ends at its decision: it has
|
|
254
|
+
* no `processing`, `succeeded` or `failed` status. Decide on the base with `INTENT_STATUS_BASE` and
|
|
234
255
|
* `IS_INTENT_TERMINAL_STATUS`, never on the whole value.
|
|
235
256
|
*/
|
|
236
257
|
export const IntentStatus = /* @__PURE__ */ v.pipe(v.picklist([
|
|
237
258
|
"requires_action",
|
|
238
|
-
"
|
|
239
|
-
"
|
|
240
|
-
"processing.reversing",
|
|
241
|
-
"processing.reconciling",
|
|
242
|
-
"processing.opening",
|
|
243
|
-
"processing.closing",
|
|
244
|
-
"succeeded",
|
|
245
|
-
"failed",
|
|
246
|
-
"failed.insufficient_funds",
|
|
247
|
-
"failed.fraud_rejected",
|
|
248
|
-
"failed.bank_refused",
|
|
249
|
-
"failed.bank_rejected",
|
|
250
|
-
"failed.bank_review_required",
|
|
251
|
-
"failed.own_account_transfer_not_implemented",
|
|
252
|
-
"failed.bank_challenge_required",
|
|
253
|
-
"failed.unknown_key",
|
|
254
|
-
"failed.revoked_key",
|
|
255
|
-
"failed.expired_key",
|
|
256
|
-
"failed.invalid_signature",
|
|
257
|
-
"failed.expired_signed_instruction",
|
|
258
|
-
"failed.sender_mismatch",
|
|
259
|
-
"failed.bank_authorization_denied",
|
|
260
|
-
"failed.bank_holder_without_account",
|
|
261
|
-
"failed.bank_account_limit_reached",
|
|
262
|
-
"failed.account_opening_not_implemented",
|
|
263
|
-
"failed.bank_core_unavailable",
|
|
264
|
-
"failed.bank_account_save_failed",
|
|
265
|
-
"failed.bank_connection_unavailable",
|
|
266
|
-
"failed.bank_account_quota_exceeded",
|
|
267
|
-
"failed.account_key_taken",
|
|
268
|
-
"failed.bank_account_not_found",
|
|
269
|
-
"failed.bank_account_balance_not_zero",
|
|
259
|
+
"approved",
|
|
260
|
+
"rejected",
|
|
270
261
|
"cancelled",
|
|
271
262
|
"cancelled.grant_revoked",
|
|
272
263
|
"cancelled.grant_expired",
|
|
273
|
-
"
|
|
264
|
+
"cancelled.migration",
|
|
274
265
|
"expired",
|
|
275
|
-
|
|
266
|
+
"completed",
|
|
267
|
+
"closed",
|
|
268
|
+
]), v.description("`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why."));
|
|
276
269
|
/** What every answered Intent carries, whatever its type, but its note or comment. */
|
|
277
270
|
const answeredIntentBase = {
|
|
278
271
|
id: uuid,
|
|
@@ -342,7 +335,6 @@ export const DepositIntent = /* @__PURE__ */ v.object({
|
|
|
342
335
|
"cancelled",
|
|
343
336
|
"cancelled.grant_revoked",
|
|
344
337
|
"cancelled.grant_expired",
|
|
345
|
-
"failed",
|
|
346
338
|
]), v.description("`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.")),
|
|
347
339
|
attribution_version: v.pipe(v.number(), v.integer(), v.minValue(0)),
|
|
348
340
|
closure: v.nullable(depositClosure),
|
|
@@ -371,6 +363,7 @@ export const TransferIntent = /* @__PURE__ */ v.pipe(v.object({
|
|
|
371
363
|
...openEndedDeadline,
|
|
372
364
|
type: v.literal("transfer"),
|
|
373
365
|
status: IntentStatus,
|
|
366
|
+
transfer_id: v.pipe(v.nullable(uuid), v.description("The id of the Transfer that exists after the Intent is approved: read it with `GET /transfers/{transfer_id}`. Null while the Intent waits, and for ever when it ends rejected, cancelled or expired, because no Transfer exists then.")),
|
|
374
367
|
signed,
|
|
375
368
|
sender: v.pipe(v.nullable(IntentAccountSchema), v.description("The Remitente. Null while the person has yet to pick where the money leaves from. An AccountKey is answered back as an AccountKey, because it stays unresolved until execution.")),
|
|
376
369
|
receiver: v.pipe(v.nullable(TransferIntentReceiverProposalSchema), v.description("The Receptor. Null while the person has yet to complete where the money lands, when the request left it to the screen. Once she confirms, the account she wrote is answered back here, locked.")),
|
|
@@ -378,14 +371,32 @@ export const TransferIntent = /* @__PURE__ */ v.pipe(v.object({
|
|
|
378
371
|
amount: TransferAmount,
|
|
379
372
|
settled: v.nullable(TransferSettlement),
|
|
380
373
|
fee: noFee,
|
|
381
|
-
interaction_reason: v.pipe(v.optional(v.picklist(["
|
|
382
|
-
}), v.description("Authoritative Project-facing state of a transfer, in
|
|
374
|
+
interaction_reason: v.pipe(v.optional(v.picklist(["source_account_required"])), v.description("Present on every read of the Intent while it is `requires_action` and only a person can complete it; absent once the Intent is no longer `requires_action`. `source_account_required`: the person still picks the account the money leaves from. A step that the bank asks after the approval, for example a verification with the web AndPass and an SMS code, belongs to the Transfer and is not an Intent reason.")),
|
|
375
|
+
}), v.description("Authoritative Project-facing state of a transfer request, in the transfer vocabulary of the API. The Intent is the request for a decision and ends at it: once it is `approved` it names its Transfer in `transfer_id`, and the money is followed on the Transfer. `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request and `amount.confirmed` the amount the person confirmed (null until then; it is what moves). `transfer.confirmed` and the events after it report the confirmed amount."));
|
|
376
|
+
/**
|
|
377
|
+
* The outcome of an approved account opening or closure, beside the Intent's own `approved`.
|
|
378
|
+
* It is null while the Intent waits for its decision.
|
|
379
|
+
*/
|
|
380
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
381
|
+
function accountOutcomeStatus(operation) {
|
|
382
|
+
return v.pipe(v.nullable(v.picklist(["processing", "succeeded", "failed"])), v.description(`The outcome of the account ${operation} once the Intent is \`approved\`: \`processing\` from the approval until AndCo answers, then \`succeeded\` or \`failed\`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays \`approved\` in every case: a refusal does not revive it, and a new try is a new Intent.`));
|
|
383
|
+
}
|
|
384
|
+
/** The word that says why an account opening or closure failed. */
|
|
385
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
386
|
+
function accountOutcomeDetail(operation) {
|
|
387
|
+
const words = operation === "opening"
|
|
388
|
+
? "`bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`"
|
|
389
|
+
: "`bank_account_not_found` and `bank_account_balance_not_zero`";
|
|
390
|
+
return v.pipe(v.nullable(v.string()), v.description(`Why the ${operation} failed, null when it did not: ${words}. The vocabulary is open: a word added later appears here as it is, so decide on the status.`));
|
|
391
|
+
}
|
|
383
392
|
/** Authoritative Project-facing state of an account opening. */
|
|
384
393
|
export const AccountOpeningIntent = /* @__PURE__ */ v.pipe(v.object({
|
|
385
394
|
...answeredIntent,
|
|
386
395
|
...openEndedDeadline,
|
|
387
396
|
type: v.literal("account_opening"),
|
|
388
397
|
status: IntentStatus,
|
|
398
|
+
account_opening_status: accountOutcomeStatus("opening"),
|
|
399
|
+
account_opening_status_detail: accountOutcomeDetail("opening"),
|
|
389
400
|
signed,
|
|
390
401
|
account: v.strictObject({
|
|
391
402
|
accountKey: AccountKeySchema,
|
|
@@ -393,12 +404,14 @@ export const AccountOpeningIntent = /* @__PURE__ */ v.pipe(v.object({
|
|
|
393
404
|
upsert: v.boolean(),
|
|
394
405
|
bank_account_id: v.nullable(uuid),
|
|
395
406
|
}),
|
|
396
|
-
}), v.description("Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until
|
|
407
|
+
}), v.description("Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until AndCo assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response."));
|
|
397
408
|
/** Authoritative Project-facing state of an account closure. */
|
|
398
409
|
export const AccountClosureIntent = /* @__PURE__ */ v.pipe(v.object({
|
|
399
410
|
...answeredIntent,
|
|
400
411
|
type: v.literal("account_closure"),
|
|
401
412
|
status: IntentStatus,
|
|
413
|
+
account_closure_status: accountOutcomeStatus("closure"),
|
|
414
|
+
account_closure_status_detail: accountOutcomeDetail("closure"),
|
|
402
415
|
signed,
|
|
403
416
|
account: IntentAccountSchema,
|
|
404
417
|
resolved_account_id: v.pipe(v.nullable(uuid), v.description("The account the reference resolved to, once resolution has happened, whether or not the closure itself has settled yet.")),
|
|
@@ -444,16 +457,16 @@ export const createIntent = /* @__PURE__ */ oc
|
|
|
444
457
|
method: "POST",
|
|
445
458
|
path: "/intents",
|
|
446
459
|
summary: "Create an intent under the exact OAuth Grant",
|
|
447
|
-
description: "The same creation has
|
|
460
|
+
description: "The same creation has three representations, and the content type picks between them. An `application/json` body is an Intent born waiting for an Approval. An `application/jwt` body is one Signed Instruction, sent as a compact JWS whose verified payload is `SignedAccountOpeningIntentClaims` or `SignedAccountClosureIntentClaims`, and every value the operation uses comes from those claims and none from the envelope carrying them. An `application/jose+json` body is a signed transfer with `approved: false`: a `SignedTransferEnvelope`, a JWS in the General JSON Serialization, whose payload is `SignedTransferClaims`. It creates a transfer Intent that waits for a decision and answers a TransferIntent with `transfer_id` null. It is verified as `POST /transfers` verifies a signed transfer, with the same rules for the `jti` (a UUID in lowercase, and the only idempotency-key), `exp`, the keys, the `sender` and the `receiver`; the `unusable_key` reason means that the key is registered, but AndCo could not load it to check this signature, so its person registers a new key and revokes this one, then you sign again. A repeat of the same envelope answers the same Intent, and another body under the same `jti` answers `409 idempotency_conflict`. A signed transfer with `approved: true` answers `400 approved_use_transfers` and nothing is recorded: its signature is the approval, so send it to `POST /transfers`. A signed account opening or closure with `approved: true` stays accepted here and is born approved. A string body sent as anything but `application/jwt` answers `415 unsupported_media_type`. A Signed Instruction that does not verify answers `400 invalid_signed_instruction` with its `reason`, and one whose `exp` passed `401 expired_signed_instruction`. A signed account Intent is born approved when the signing client's Grant holds the family's `approve` action (`bank_account`); otherwise it waits, like a proposal, for the person on the hosted screen or for `POST /intents/{intent_id}/approve` by a Grant that holds it. Opening and closing an account fail synchronously with `403 account_key_out_of_grant` when the account_key is outside the Grant's `accounts` patterns and with `409 account_key_taken` when the account_key names an account of the subject (always for a closed one; otherwise unless `upsert`). The new account's number arrives in the `account_opening.succeeded` event as `account: { id, accountKey, number, name }`. Once the request is valid and authorized (a malformed body is still `400 invalid_request` and a Grant without the permission still `403 insufficient_authorization`), an opening and a transfer between two accounts of the same holder work where the bank serves them: the answer is `201` with the Intent `requires_action` and its `authorization_url`, or, for a signed account Intent whose signer also holds the family's `approve`, the Intent born `approved`. Where the deployment's bank does not serve one, the same request answers `501 not_implemented` with `code: account_opening_not_implemented` or `code: own_account_transfer_not_implemented`; a closure always answers `501 not_implemented` with `code: account_closure_not_implemented`. Nothing is created in those cases. A subject without a bank connection to a company cannot open an account: `422 bank_connection_unavailable` with the `intent_id`. A signed account Intent born approved answers the refusals of `POST /intents/{intent_id}/approve`.",
|
|
448
461
|
successStatus: 201,
|
|
449
462
|
successDescription: "Intent created or returned from an idempotent retry",
|
|
450
463
|
inputStructure: "detailed",
|
|
451
|
-
spec: (operation) =>
|
|
464
|
+
spec: (operation) => servedAsSignedInstructionOrTransfer(withCanonicalHeaderNames(operation)),
|
|
452
465
|
}))
|
|
453
|
-
.errors(errors(InvalidRequest, IdempotencyKeyNotAllowed, InvalidSignedInstruction, InvalidToken, ExpiredSignedInstruction, InvalidOrigin, InsufficientAuthorization, AccountKeyOutOfGrant, NotFound, UnsupportedVersion, ServerError, IdempotencyConflict, IntentInteractionRequired, AccountKeyTaken, BankAccountQuotaExceeded, InvalidIntentState, IntentExpired, PayloadTooLarge, UnsupportedMediaType, DepositAmountOutOfBounds, DepositDestinationAmbiguous, ...releaseRefusals, NotImplemented, TemporarilyUnavailable))
|
|
466
|
+
.errors(errors(InvalidRequest, IdempotencyKeyNotAllowed, ApprovedUseTransfers, InvalidSignedInstruction, InvalidToken, ExpiredSignedInstruction, InvalidOrigin, InsufficientAuthorization, AccountKeyOutOfGrant, NotFound, UnsupportedVersion, ServerError, IdempotencyConflict, IntentInteractionRequired, AccountKeyTaken, BankAccountQuotaExceeded, InvalidIntentState, IntentExpired, PayloadTooLarge, UnsupportedMediaType, DepositAmountOutOfBounds, DepositDestinationAmbiguous, ...releaseRefusals, NotImplemented, TemporarilyUnavailable))
|
|
454
467
|
.input(v.object({
|
|
455
468
|
headers: v.object({
|
|
456
|
-
"idempotency-key": v.pipe(v.optional(v.pipe(v.string(), v.regex(/^[A-Za-z0-9._:-]{1,128}$/))), v.description("Required with `application/json`, and refused with `application/jwt`, which
|
|
469
|
+
"idempotency-key": v.pipe(v.optional(v.pipe(v.string(), v.regex(/^[A-Za-z0-9._:-]{1,128}$/))), v.description("Required with `application/json`, and refused with `application/jwt` and `application/jose+json`, which answer `400 idempotency_key_not_allowed` when it arrives beside a signature: the idempotency key of a Signed Instruction is its own `jti`, and two candidates for one key is exactly the ambiguity that gets read the wrong way round. OpenAPI cannot make a header conditional on the media type, so it is published as optional rather than demanding what the server refuses.")),
|
|
457
470
|
}),
|
|
458
471
|
body: v.union([
|
|
459
472
|
IntentCreateSchema,
|
|
@@ -463,6 +476,7 @@ export const createIntent = /* @__PURE__ */ oc
|
|
|
463
476
|
{ $ref: "#/components/schemas/SignedAccountClosureIntentClaims" },
|
|
464
477
|
],
|
|
465
478
|
}),
|
|
479
|
+
SignedTransferEnvelopeSchema,
|
|
466
480
|
]),
|
|
467
481
|
}))
|
|
468
482
|
.output(Intent);
|
|
@@ -483,7 +497,7 @@ export const closeDeposit = /* @__PURE__ */ oc
|
|
|
483
497
|
method: "POST",
|
|
484
498
|
path: "/intents/{intent_id}/close",
|
|
485
499
|
summary: "Close this application's no-target deposit collection with an explicit close Grant action",
|
|
486
|
-
description: "Idempotent. Preserves existing terminal outcomes. Does not move funds, cancel commands AndCo already accepted, or grant account
|
|
500
|
+
description: "Idempotent. Preserves existing terminal outcomes. Does not move funds, cancel commands AndCo already accepted, or grant account movement access.",
|
|
487
501
|
successDescription: "Current terminal state and historical manual closure, if any",
|
|
488
502
|
}))
|
|
489
503
|
.errors(errors(InvalidIdentifier, InvalidToken, InvalidOrigin, InsufficientAuthorization, NotFound, UnsupportedVersion, ServerError, InvalidIntentState, TemporarilyUnavailable))
|
|
@@ -495,7 +509,7 @@ export const approveIntent = /* @__PURE__ */ oc
|
|
|
495
509
|
method: "POST",
|
|
496
510
|
path: "/intents/{intent_id}/approve",
|
|
497
511
|
summary: "Approve an Intent with a Grant holding the family's approve action",
|
|
498
|
-
description: "Approval by a credential, without a person: the Grant behind the token must hold `approve` on the family that releases this Intent type (`bank_transfer` for a transfer) for the same subject, and within that detail's `transactions.maximum`. Above it the call answers `422 amount_out_of_grant` and the Intent stays pending for another approver. A transfer only a person can release answers `409 interaction_required` with `authorization_url` and `reason`, before any approval is recorded and before the bank is called: `bank_verification_required` for a transfer that leaves its holder's own accounts (to another bank or to another AndCo customer), which the bank moves only after that person confirms it with their web AndPass and a code the bank sends to their phone, and also for a transfer created with `receiver: null` that nobody has completed yet; and `source_account_required` when the person still picks the source.
|
|
512
|
+
description: "Approval by a credential, without a person: the Grant behind the token must hold `approve` on the family that releases this Intent type (`bank_transfer` for a transfer) for the same subject, and within that detail's `transactions.maximum`. Above it the call answers `422 amount_out_of_grant` and the Intent stays pending for another approver. A transfer only a person can release answers `409 interaction_required` with `authorization_url` and `reason`, before any approval is recorded and before the bank is called: `bank_verification_required` for a transfer that leaves its holder's own accounts (to another bank or to another AndCo customer), which the bank moves only after that person confirms it with their web AndPass and a code the bank sends to their phone, and also for a transfer created with `receiver: null` that nobody has completed yet; and `source_account_required` when the person still picks the source. The approval ends the Intent: the answer is the Intent `approved`, and an approved transfer Intent names its Transfer in `transfer_id`. Approved is not moved: read the Transfer, or wait for `transfer.succeeded` or `transfer.failed`.\n\nTwo kinds of Intent are released with nobody present. Opening an additional account by Account Key needs `bank_account` `approve`; the answer is the Intent `approved`, with its outcome in `account_opening_status`, and the account number never comes back in it: it arrives in the `account_opening.succeeded` event. A transfer between two accounts of the same holder needs `bank_transfer` `approve`; the bank asks no proof because the money does not leave the holder, and the answer is the Intent `approved` with its `transfer_id`. The Transfer it names is released at once: it reads `succeeded`, or `processing` when the bank has not answered for good yet, in which case nothing else is needed from the caller: the server asks the bank again under the same key on a bounded schedule and the outcome arrives as `transfer.succeeded` or `transfer.failed`. \"Same holder\" is decided by the bank: two accounts of one Organization (or of one person's business) qualify, while an account of a person and an account of a Company they represent do not, and that transfer is an ordinary one that leaves its holder.\n\nRefusals of such a release: `409 interaction_required` with `intent_id`, `reason` and `interaction_url`, where `reason` is `bank_connection_pin_required`, `bank_connection_reconnect_required` or `bank_representative_replacement_required`; the bank asks no proof, but the web session that acts for the holder needs its person back (or the Organization must connect another account representative), nothing was opened, frozen or moved, the Intent is untouched and the same request succeeds once the person has acted at `interaction_url`. Also `409 bank_account_quota_exceeded` (with `used` and `quota`), `409 account_key_taken` (with `reason`), `409 intent_expired`, `409 invalid_intent_state` and `403 insufficient_authorization`. `422` with `intent_id` and `error` one of `bank_connection_unavailable` (the subject has no bank connection to a company), `bank_authorization_denied` (the bank does not let that person open accounts for that company), `bank_holder_without_account`, `bank_account_limit_reached`, `bank_refused`, `insufficient_funds`, `bank_rejected` or `bank_review_required`; the Intent stays `approved`, and the Transfer it names, or the opening, reads `failed` with the same detail (see `IntentStatus`). `503 temporarily_unavailable` means the bank could not be asked: asking again for the same Intent is safe and answers the same result, because the bank is asked under the same idempotency-key. Where the bank does not serve the capability, `501 not_implemented` with `account_opening_not_implemented` or `own_account_transfer_not_implemented` and the `intent_id`; the Intent stays as it was. Safe to retry.",
|
|
499
513
|
successDescription: "The Intent after its approval",
|
|
500
514
|
}))
|
|
501
515
|
.errors(errors(InvalidRequest, InvalidIdentifier, InvalidToken, InvalidOrigin, InsufficientAuthorization, NotFound, UnsupportedVersion, ServerError, IntentInteractionRequired, AccountKeyTaken, BankAccountQuotaExceeded, InvalidIntentState, IntentExpired, TransferAmountRequired, TransferDestinationRequired, ...releaseRefusals, NotImplemented, TemporarilyUnavailable))
|
|
@@ -507,7 +521,7 @@ export const rejectIntent = /* @__PURE__ */ oc
|
|
|
507
521
|
method: "POST",
|
|
508
522
|
path: "/intents/{intent_id}/reject",
|
|
509
523
|
summary: "Reject an Intent with a Grant holding the family's reject action",
|
|
510
|
-
description: "An approver declining an Intent, recorded as a Rejection and kept apart from a Cancellation (the creator withdrawing it). The Grant behind the token must hold `reject` on the family that releases this Intent type for the same subject; no maximum applies to a rejection. Answers `409 intent_expired` when the Intent's deadline has passed.",
|
|
524
|
+
description: "An approver declining an Intent, recorded as a Rejection and kept apart from a Cancellation (the creator withdrawing it). The Grant behind the token must hold `reject` on the family that releases this Intent type for the same subject; no maximum applies to a rejection. The `reason` is optional: when given it has 1 to 280 characters, and it is recorded with the Rejection. Answers `409 intent_expired` when the Intent's deadline has passed.",
|
|
511
525
|
successDescription: "Rejected Intent",
|
|
512
526
|
inputStructure: "detailed",
|
|
513
527
|
}))
|
|
@@ -520,7 +534,7 @@ export const cancelIntent = /* @__PURE__ */ oc
|
|
|
520
534
|
method: "POST",
|
|
521
535
|
path: "/intents/{intent_id}/cancel",
|
|
522
536
|
summary: "Withdraw an Intent the calling client created",
|
|
523
|
-
description: "A Cancellation is the creator withdrawing its own request: only the client and Grant that created the Intent may cancel it. An approver declining it uses `reject`, and the audit keeps the two apart.
|
|
537
|
+
description: "A Cancellation is the creator withdrawing its own request: only the client and Grant that created the Intent may cancel it. An approver declining it uses `reject`, and the audit keeps the two apart. The `reason` is optional: when given it has 1 to 280 characters, and it is recorded with the Cancellation. Answers `409 intent_expired` when the Intent's deadline to be approved and executed has already passed.",
|
|
524
538
|
successDescription: "Cancelled Intent",
|
|
525
539
|
inputStructure: "detailed",
|
|
526
540
|
}))
|
|
@@ -2,6 +2,12 @@ import * as v from "valibot";
|
|
|
2
2
|
import { InvalidOrigin, InvalidToken, PayloadTooLarge, ServerError, TemporarilyUnavailable, UnsupportedMediaType, UnsupportedVersion } from "./common.js";
|
|
3
3
|
/** The media type a Signed Instruction travels as: one compact JWS, as text. */
|
|
4
4
|
export declare const SIGNED_INSTRUCTION_MEDIA_TYPE = "application/jwt";
|
|
5
|
+
/**
|
|
6
|
+
* The media type a signed transfer travels as: a JWS in the General JSON Serialization (RFC 7515
|
|
7
|
+
* §7.2.1), the `SignedTransferEnvelope` itself. `POST /transfers` takes it, and so does `POST /intents`
|
|
8
|
+
* for a signed transfer with `approved: false`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SIGNED_TRANSFER_MEDIA_TYPE = "application/jose+json";
|
|
5
11
|
/**
|
|
6
12
|
* A Signed Instruction as the body of a request: the compact JWS, as text. The schema reads any
|
|
7
13
|
* string, and the pattern is only documented, because an assertion that is not a compact JWS is
|
|
@@ -22,16 +28,24 @@ export declare function signedInstructionBody(description: string, claims?: Reco
|
|
|
22
28
|
* `contentMediaType` as a file, and then writes the JSON branches inline instead of by reference.
|
|
23
29
|
*/
|
|
24
30
|
export declare function servedAsSignedInstruction(operation: Record<string, unknown>): Record<string, unknown>;
|
|
31
|
+
/**
|
|
32
|
+
* Like {@link servedAsSignedInstruction}, for an operation whose body also takes a signed transfer:
|
|
33
|
+
* the branch that is the `SignedTransferEnvelope` moves to `application/jose+json`, the compact JWS
|
|
34
|
+
* string moves to `application/jwt`, and the JSON proposals stay in `application/json`. It is the
|
|
35
|
+
* `spec` of `POST /intents`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function servedAsSignedInstructionOrTransfer(operation: Record<string, unknown>): Record<string, unknown>;
|
|
25
38
|
/**
|
|
26
39
|
* Why a Signed Instruction did not verify. Every refusal names one cause, so an integrator can tell a
|
|
27
40
|
* `kid` that was never registered from one that was revoked, a clock that ran out from an audience
|
|
28
41
|
* that was wrong, and any of those from a payload altered in flight.
|
|
29
42
|
*
|
|
30
|
-
*
|
|
31
|
-
* whose `signatures` is empty
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
43
|
+
* Four causes belong to a signed transfer (`POST /transfers`, and `POST /intents` with `approved: false`):
|
|
44
|
+
* `missing_signature`, an envelope whose `signatures` is empty; `unsynced_key`, a key AndCo does not
|
|
45
|
+
* accept yet for a signed transfer; `unusable_key`, a key that is registered but that AndCo could not
|
|
46
|
+
* load to check this signature (its person registers a new key and revokes this one, then you sign
|
|
47
|
+
* again); and `expiration_too_soon`, the `exp` of a new `jti` less than 15 minutes after the submission
|
|
48
|
+
* (a repeat of a stored transfer is never refused for it).
|
|
35
49
|
*/
|
|
36
50
|
export declare const SignedInstructionRejectionReason: v.PicklistSchema<["malformed_assertion", "missing_signature", "missing_key_id", "disallowed_algorithm", "unknown_key", "revoked_key", "expired_key", "unusable_key", "unsynced_key", "invalid_signature", "expired_assertion", "premature_assertion", "missing_expiration", "expiration_too_soon", "missing_instruction_id", "missing_claim", "wrong_audience", "wrong_issuer", "verification_failed"], undefined>;
|
|
37
51
|
/** Why a Signed Instruction did not verify. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signatures.d.ts","sourceRoot":"","sources":["../../src/rest/signatures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,eAAe,EACf,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAGrB,gFAAgF;AAChF,eAAO,MAAM,6BAA6B,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"signatures.d.ts","sourceRoot":"","sources":["../../src/rest/signatures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,eAAe,EACf,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAGrB,gFAAgF;AAChF,eAAO,MAAM,6BAA6B,oBAAoB,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,0BAA0B,CAAC;AAKlE;;;;;;;;GAQG;AAEH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,kJAM1F;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsBrG;AAKD;;;;;GAKG;AACH,wBAAgB,mCAAmC,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0B/G;AAQD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gCAAgC,oZAoB3C,CAAC;AAEH,+CAA+C;AAC/C,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,gCAAgC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtG;;;;GAIG;AACH,qBAAa,2BAA4B,SAAQ,eAAe,CAAC,gCAahE;gBACa,IAAI,EAAE;QAAE,MAAM,EAAE,gCAAgC,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,OAAO,CAAC,EAAE,MAAM;CAGxG;AAED,wEAAwE;AACxE,eAAO,MAAM,6BAA6B;;;;;;;;;;mWAYzC,CAAC;AAEF,wEAAwE;AACxE,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEhG,sGAAsG;AACtG,eAAO,MAAM,eAAe;;;;;;;;;;4mBAyBY,CAAC"}
|
package/dist/rest/signatures.js
CHANGED
|
@@ -5,6 +5,12 @@ import { InvalidOrigin, InvalidToken, PayloadTooLarge, ServerError, TemporarilyU
|
|
|
5
5
|
import { http } from "./http.js";
|
|
6
6
|
/** The media type a Signed Instruction travels as: one compact JWS, as text. */
|
|
7
7
|
export const SIGNED_INSTRUCTION_MEDIA_TYPE = "application/jwt";
|
|
8
|
+
/**
|
|
9
|
+
* The media type a signed transfer travels as: a JWS in the General JSON Serialization (RFC 7515
|
|
10
|
+
* §7.2.1), the `SignedTransferEnvelope` itself. `POST /transfers` takes it, and so does `POST /intents`
|
|
11
|
+
* for a signed transfer with `approved: false`.
|
|
12
|
+
*/
|
|
13
|
+
export const SIGNED_TRANSFER_MEDIA_TYPE = "application/jose+json";
|
|
8
14
|
/** What a compact JWS looks like: three base64url segments separated by dots. */
|
|
9
15
|
const COMPACT_JWS_PATTERN = "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$";
|
|
10
16
|
/**
|
|
@@ -57,16 +63,52 @@ export function servedAsSignedInstruction(operation) {
|
|
|
57
63
|
};
|
|
58
64
|
return { ...operation, requestBody: { ...requestBody, content } };
|
|
59
65
|
}
|
|
66
|
+
/** The reference that the OpenAPI document gives the signed transfer envelope. */
|
|
67
|
+
const SIGNED_TRANSFER_ENVELOPE_REF = "#/components/schemas/SignedTransferEnvelope";
|
|
68
|
+
/**
|
|
69
|
+
* Like {@link servedAsSignedInstruction}, for an operation whose body also takes a signed transfer:
|
|
70
|
+
* the branch that is the `SignedTransferEnvelope` moves to `application/jose+json`, the compact JWS
|
|
71
|
+
* string moves to `application/jwt`, and the JSON proposals stay in `application/json`. It is the
|
|
72
|
+
* `spec` of `POST /intents`.
|
|
73
|
+
*/
|
|
74
|
+
export function servedAsSignedInstructionOrTransfer(operation) {
|
|
75
|
+
const requestBody = operation["requestBody"];
|
|
76
|
+
const schema = requestBody?.content?.["application/json"]?.schema;
|
|
77
|
+
if (requestBody?.content === undefined || schema === undefined) {
|
|
78
|
+
throw new Error("The operation has no body to serve as a Signed Instruction.");
|
|
79
|
+
}
|
|
80
|
+
const branches = schema.anyOf ?? [schema];
|
|
81
|
+
const envelopes = branches.filter((branch) => branch["$ref"] === SIGNED_TRANSFER_ENVELOPE_REF);
|
|
82
|
+
if (envelopes.length !== 1) {
|
|
83
|
+
throw new Error("The body of the operation declares no signed transfer.");
|
|
84
|
+
}
|
|
85
|
+
const rest = branches.filter((branch) => branch["$ref"] !== SIGNED_TRANSFER_ENVELOPE_REF);
|
|
86
|
+
const served = servedAsSignedInstruction({
|
|
87
|
+
...operation,
|
|
88
|
+
requestBody: {
|
|
89
|
+
...requestBody,
|
|
90
|
+
content: { "application/json": { schema: rest.length === 1 ? rest[0] : { anyOf: rest } } },
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
return {
|
|
94
|
+
...served,
|
|
95
|
+
requestBody: {
|
|
96
|
+
...served.requestBody,
|
|
97
|
+
content: { ...served.requestBody.content, [SIGNED_TRANSFER_MEDIA_TYPE]: { schema: envelopes[0] } },
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
60
101
|
/**
|
|
61
102
|
* Why a Signed Instruction did not verify. Every refusal names one cause, so an integrator can tell a
|
|
62
103
|
* `kid` that was never registered from one that was revoked, a clock that ran out from an audience
|
|
63
104
|
* that was wrong, and any of those from a payload altered in flight.
|
|
64
105
|
*
|
|
65
|
-
*
|
|
66
|
-
* whose `signatures` is empty
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
106
|
+
* Four causes belong to a signed transfer (`POST /transfers`, and `POST /intents` with `approved: false`):
|
|
107
|
+
* `missing_signature`, an envelope whose `signatures` is empty; `unsynced_key`, a key AndCo does not
|
|
108
|
+
* accept yet for a signed transfer; `unusable_key`, a key that is registered but that AndCo could not
|
|
109
|
+
* load to check this signature (its person registers a new key and revokes this one, then you sign
|
|
110
|
+
* again); and `expiration_too_soon`, the `exp` of a new `jti` less than 15 minutes after the submission
|
|
111
|
+
* (a repeat of a stored transfer is never refused for it).
|
|
70
112
|
*/
|
|
71
113
|
export const SignedInstructionRejectionReason = /* @__PURE__ */ v.picklist([
|
|
72
114
|
"malformed_assertion",
|