@andco/protocol 0.0.14 → 0.1.0-ti.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.
Files changed (101) hide show
  1. package/README.md +2 -2
  2. package/dist/api-errors.d.ts +9 -9
  3. package/dist/api-errors.js +9 -9
  4. package/dist/authorization-preparation.d.ts +1 -1
  5. package/dist/authorization-preparation.js +2 -2
  6. package/dist/authorization.d.ts +1 -1
  7. package/dist/authorization.js +1 -1
  8. package/dist/consent.d.ts +2 -2
  9. package/dist/consent.js +2 -2
  10. package/dist/errors.d.ts +10 -10
  11. package/dist/errors.js +10 -10
  12. package/dist/index.d.ts +1 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +1 -0
  15. package/dist/intent-input.d.ts +452 -880
  16. package/dist/intent-input.d.ts.map +1 -1
  17. package/dist/intent-input.js +164 -127
  18. package/dist/intent-status.d.ts +5 -6
  19. package/dist/intent-status.d.ts.map +1 -1
  20. package/dist/intent-status.js +12 -7
  21. package/dist/miniapp-manifest.d.ts +3 -3
  22. package/dist/miniapp-manifest.js +1 -1
  23. package/dist/native-intent.d.ts +82 -68
  24. package/dist/native-intent.d.ts.map +1 -1
  25. package/dist/native-intent.js +137 -84
  26. package/dist/native.d.ts +1 -1
  27. package/dist/rar/account-matchers.d.ts +35 -30
  28. package/dist/rar/account-matchers.d.ts.map +1 -1
  29. package/dist/rar/account-matchers.js +27 -21
  30. package/dist/rar/bank.d.ts +357 -85
  31. package/dist/rar/bank.d.ts.map +1 -1
  32. package/dist/rar/bank.js +43 -5
  33. package/dist/rar/catalog.d.ts +174 -49
  34. package/dist/rar/catalog.d.ts.map +1 -1
  35. package/dist/rar/catalog.js +6 -6
  36. package/dist/rar/detail.d.ts +1 -1
  37. package/dist/rar/detail.js +1 -1
  38. package/dist/rar/json-schemas.generated.d.ts +1 -1
  39. package/dist/rar/json-schemas.generated.d.ts.map +1 -1
  40. package/dist/rar/json-schemas.generated.js +393 -21
  41. package/dist/rar/money.d.ts +1 -1
  42. package/dist/rar/money.js +1 -1
  43. package/dist/rar/subject-data.d.ts +1 -1
  44. package/dist/rar/subject-data.js +1 -1
  45. package/dist/rar/subject.d.ts +1 -1
  46. package/dist/rar/subject.js +1 -1
  47. package/dist/rest/accounts.d.ts +28 -28
  48. package/dist/rest/accounts.d.ts.map +1 -1
  49. package/dist/rest/accounts.js +22 -22
  50. package/dist/rest/api-error.d.ts +1 -1
  51. package/dist/rest/api-error.js +1 -1
  52. package/dist/rest/catalog.d.ts +3 -3
  53. package/dist/rest/catalog.js +2 -2
  54. package/dist/rest/common.d.ts +3 -3
  55. package/dist/rest/common.js +3 -3
  56. package/dist/rest/contract.d.ts +1183 -547
  57. package/dist/rest/contract.d.ts.map +1 -1
  58. package/dist/rest/contract.js +21 -5
  59. package/dist/rest/events.d.ts +1 -1
  60. package/dist/rest/events.d.ts.map +1 -1
  61. package/dist/rest/events.js +2 -2
  62. package/dist/rest/identity.d.ts +22 -22
  63. package/dist/rest/identity.d.ts.map +1 -1
  64. package/dist/rest/identity.js +5 -5
  65. package/dist/rest/index.d.ts +1 -0
  66. package/dist/rest/index.d.ts.map +1 -1
  67. package/dist/rest/index.js +1 -0
  68. package/dist/rest/intents.d.ts +973 -743
  69. package/dist/rest/intents.d.ts.map +1 -1
  70. package/dist/rest/intents.js +112 -89
  71. package/dist/rest/signatures.d.ts +25 -5
  72. package/dist/rest/signatures.d.ts.map +1 -1
  73. package/dist/rest/signatures.js +52 -0
  74. package/dist/rest/transfers.d.ts +988 -0
  75. package/dist/rest/transfers.d.ts.map +1 -0
  76. package/dist/rest/transfers.js +142 -0
  77. package/dist/scopes.d.ts +1 -1
  78. package/dist/signing.d.ts +17 -3
  79. package/dist/signing.d.ts.map +1 -1
  80. package/dist/signing.js +8 -1
  81. package/dist/transfer.d.ts +399 -0
  82. package/dist/transfer.d.ts.map +1 -0
  83. package/dist/transfer.js +313 -0
  84. package/dist/transport/financial-events.d.ts +82 -27
  85. package/dist/transport/financial-events.d.ts.map +1 -1
  86. package/dist/transport/financial-events.js +34 -0
  87. package/dist/transport/generated/oauth-api.d.ts +1420 -333
  88. package/dist/transport/generated/oauth-api.d.ts.map +1 -1
  89. package/dist/transport/intents.d.ts +29 -13
  90. package/dist/transport/intents.d.ts.map +1 -1
  91. package/dist/transport/intents.js +1 -1
  92. package/dist/transport/rest.d.ts +5 -5
  93. package/dist/urls.d.ts +2 -2
  94. package/dist/urls.js +3 -3
  95. package/dist/userinfo.d.ts +2 -2
  96. package/dist/userinfo.js +2 -2
  97. package/dist/webhooks.d.ts +16 -16
  98. package/dist/webhooks.js +14 -14
  99. package/dist/window-features.d.ts +2 -2
  100. package/dist/window-features.js +2 -2
  101. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"intent-input.d.ts","sourceRoot":"","sources":["../src/intent-input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,WAAW,EAAkB,MAAM,aAAa,CAAC;AAS3E;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;sKAS9B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;yYASxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;sIAK9B,CAAC;AASF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;uKAQ5B,CAAC;AA6BF,0EAA0E;AAC1E,eAAO,MAAM,sBAAsB;;;;;;2EAGlC,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,qBAAqB;;;;;;mDAGjC,CAAC;AAEF,0GAA0G;AAC1G,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;6KAKvC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;0XAK/B,CAAC;AACF,QAAA,MAAM,YAAY;;;;;;;;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C;AAEX;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAWzE;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;aASrC,CAAC;AAEH,sFAAsF;AACtF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEpF;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,UAAU,CAAC,GAAG,KAAK,EAAE,CAE7G;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAE3F"}
@@ -3,6 +3,7 @@ import { ANDCO_API_ORIGIN } from "./constants.js";
3
3
  import { parseWithRules } from "./issues.js";
4
4
  import { AccountKeySchema } from "./rar/account-matchers.js";
5
5
  import { MoneySchema } from "./rar/money.js";
6
+ import { BankCodeSchema, PesosSchema, TransferAccountTypeSchema, transferCommentIssues } from "./transfer.js";
6
7
  const text = (max) => v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(max));
7
8
  /** A person's or an account's name, trimmed and never blank. Its length is a rule, in code points. */
8
9
  const nameText = /* @__PURE__ */ v.pipe(v.string(), v.trim(), v.minLength(1));
@@ -21,97 +22,114 @@ export const IntentAmountSchema = /* @__PURE__ */ v.pipe(v.strictObject({
21
22
  }), v.description("The amount a deposit asks for. `editable: true` lets the payer change it on the screen. It is never what moved: a deposit answers that in `progress.credited`."));
22
23
  /**
23
24
  * The amount a transfer proposes. `editable: true` lets the person who confirms set the amount on
24
- * Andco's confirmation screen, and `value` is the initial proposal shown there; the server checks it
25
- * against the Grant's `transactions.minimum` and `transactions.maximum` and the available balance.
26
- * Without `editable` (or with `false`) the amount is locked. What moved is `settled`.
25
+ * AndCo's confirmation screen, and `value` is the initial proposal shown there; the server checks it
26
+ * against the Grant's `transactions.minimum` and `transactions.maximum` and the balance.
27
+ * Without `editable` (or with `false`) the amount is locked. What moved is `settled`. `value` is
28
+ * an integer in the minor unit of the currency (CLP: whole pesos), at most 2147483647.
27
29
  *
28
30
  * @example
29
- * const amount = { currency: "CLP", value: "40000", editable: true };
31
+ * const amount = { currency: "CLP", value: 40000, editable: true };
30
32
  */
31
33
  export const TransferAmountProposalSchema = /* @__PURE__ */ v.pipe(v.strictObject({
32
34
  currency: v.literal("CLP"),
33
- value: MoneySchema,
35
+ value: PesosSchema,
34
36
  editable: v.pipe(v.optional(v.boolean(), false), v.description("Defaults to false when omitted.")),
35
- }), v.description("The amount a transfer proposes. `editable: true` lets the person who confirms set the amount on Andco's confirmation screen, and `value` is the initial proposal shown there; the amount must fall within the Grant's `transactions.minimum` and `transactions.maximum` and not exceed the available balance. Without `editable` (or with `false`) the amount is locked. What moved is `settled`."));
37
+ }), v.description("The amount a transfer proposes: `value` is an integer in the minor unit of the currency (CLP: whole pesos), at most 2147483647. `editable: true` lets the person who confirms set the amount on AndCo's confirmation screen, and `value` is the initial proposal shown there; the amount must fall within the Grant's `transactions.minimum` and `transactions.maximum` and not exceed the balance. Without `editable` (or with `false`) the amount is locked. What moved is `settled`."));
38
+ /**
39
+ * An amount with nothing left for a person to change: the same `{ currency, value }` as a request,
40
+ * without `editable`. It is how an event reports an amount.
41
+ */
42
+ export const SignedAmountSchema = /* @__PURE__ */ v.pipe(v.strictObject({ currency: v.literal("CLP"), value: MoneySchema }), v.description("An amount with nothing left for a person to change: the same `{ currency, value }` as a request, without `editable`."));
36
43
  /**
37
- * The amount a Signed Instruction orders: the same `{ currency, value }` as a request, with nothing
38
- * left for a person to change, so there is no `editable`.
44
+ * The comment a transfer asks for: at most 60 bytes of UTF-8, which is a rule
45
+ * (`comment_too_long`). `editable: true` lets the person who confirms change it.
46
+ *
47
+ * @example
48
+ * const comment = { value: "Factura 42", editable: true };
39
49
  */
40
- export const SignedAmountSchema = /* @__PURE__ */ v.pipe(v.strictObject({ currency: v.literal("CLP"), value: MoneySchema }), v.description("The amount a Signed Instruction orders: the same `{ currency, value }` as a request, with nothing left for a person to change."));
50
+ export const TransferCommentProposalSchema = /* @__PURE__ */ v.pipe(v.strictObject({
51
+ value: v.pipe(v.pipe(v.string(), v.trim()), v.description("Trimmed comment. An empty one is allowed.")),
52
+ editable: v.pipe(v.optional(v.boolean(), false), v.description("Defaults to false when omitted.")),
53
+ }), v.description("The comment a transfer asks for: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation."));
41
54
  // `MoneySchema`'s pattern is the whole bound of an amount: at most 15 digits, which also keeps every
42
55
  // value inside `Number.MAX_SAFE_INTEGER` for whoever converts it. JSON Schema says the same pattern,
43
56
  // so no numeric check sits on top, and an amount never goes through `Number()` here.
44
57
  /** A note's text, trimmed. Its length is a rule ({@link NOTE_MAX_LENGTH}), counted in code points. */
45
58
  const noteText = /* @__PURE__ */ v.pipe(v.string(), v.trim());
46
59
  /**
47
- * The bank reference a request asks for. `editable: true` lets the person who confirms change it.
60
+ * The comment a request asks for. `editable: true` lets the person who confirms change it.
48
61
  *
49
62
  * @example
50
63
  * const note = { value: "Factura 42", editable: true };
51
64
  */
52
65
  export const IntentNoteSchema = /* @__PURE__ */ v.pipe(v.strictObject({
53
- value: v.pipe(noteText, v.description("Trimmed bank reference. An empty reference is allowed.")),
66
+ value: v.pipe(noteText, v.description("Trimmed comment. An empty reference is allowed.")),
54
67
  editable: v.pipe(v.optional(v.boolean(), false), v.description("Defaults to false when omitted.")),
55
- }), v.description("The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation."));
68
+ }), v.description("The comment a request asks for. `editable: true` lets the person who confirms change it; each operation freezes its own final note at confirmation."));
56
69
  /**
57
70
  * The account a transfer names, in the vocabulary of the `bank_transfer` matchers it has to fit:
58
- * `{ type: "account_key", accountKey }` and `{ type: "account", id }` name one Andco account, and
59
- * `{ type: "external", ... }` names one account at another Chilean bank with every field the
60
- * `external` matcher can fix. A transfer names exactly one account, so nothing here is a pattern.
71
+ * `{ type: "account_key", accountKey }` and `{ type: "account", id }` name one AndCo account, and
72
+ * `{ type: "external", ... }` names a Receptor at a Chilean bank in the transfer vocabulary of the API,
73
+ * with every field the `external` matcher can fix. A transfer names exactly one account, so nothing
74
+ * here is a pattern.
61
75
  *
62
76
  * @example
63
77
  * const source: TransferAccount = { type: "account_key", accountKey: "caja-santiago" };
64
78
  * const payroll: TransferAccount = {
65
- * type: "external", bank_id: "banco_de_chile", account_type: "checking", account_id: "1234567890",
66
- * holder_id: "12345678-5", holder_name: "Ada Lovelace",
79
+ * type: "external", country: "CL", bank_code: "0001", account_type: "20", account_number: "1234567890",
80
+ * name: "Ada Lovelace", national_kind_id: "RUT", national_id: "12345678-5",
67
81
  * };
68
82
  */
69
83
  const transferAccountKey = { type: /* @__PURE__ */ v.literal("account_key"), accountKey: AccountKeySchema };
70
84
  const transferAccount = { type: /* @__PURE__ */ v.literal("account"), id: accountId };
71
85
  const transferExternal = {
72
86
  type: /* @__PURE__ */ v.literal("external"),
73
- bank_id: /* @__PURE__ */ v.pipe(v.string(), v.regex(/^[a-z0-9][a-z0-9_-]{0,63}$/)),
74
- account_type: /* @__PURE__ */ v.picklist(["checking", "debit", "savings"]),
75
- account_id: text(64),
76
- holder_id: text(64),
77
- holder_name: /* @__PURE__ */ v.pipe(nameText, v.description("The holder's name, at most 256 code points (`holder_name_too_long`).")),
87
+ country: /* @__PURE__ */ v.literal("CL"),
88
+ bank_code: BankCodeSchema,
89
+ account_type: TransferAccountTypeSchema,
90
+ account_number: text(64),
91
+ name: /* @__PURE__ */ v.pipe(nameText, v.description("The holder's name, at most 256 code points (`holder_name_too_long`).")),
92
+ national_kind_id: /* @__PURE__ */ v.literal("RUT"),
93
+ national_id: /* @__PURE__ */ v.pipe(text(64), v.description("The holder's RUT.")),
78
94
  };
79
- /** One Andco account of the Grant's subject, named by its Account Key. */
80
- export const IntentAccountKeySchema = /* @__PURE__ */ v.pipe(v.strictObject(transferAccountKey), v.description("One Andco account of the Grant's subject, named by its Account Key."));
81
- /** One Andco account, named by its identifier. */
82
- export const IntentAccountIdSchema = /* @__PURE__ */ v.pipe(v.strictObject(transferAccount), v.description("One Andco account, named by its identifier."));
83
- /** One account at another Chilean bank, with every field a `bank_transfer` `external` matcher can fix. */
84
- export const IntentAccountExternalSchema = /* @__PURE__ */ v.pipe(v.strictObject(transferExternal), v.description("One account at another Chilean bank, with every field a `bank_transfer` `external` matcher can fix, so the Grant's destinations are asked about exactly this account."));
95
+ /** One AndCo account of the Grant's subject, named by its Account Key. */
96
+ export const IntentAccountKeySchema = /* @__PURE__ */ v.pipe(v.strictObject(transferAccountKey), v.description("One AndCo account of the Grant's subject, named by its Account Key."));
97
+ /** One AndCo account, named by its identifier. */
98
+ export const IntentAccountIdSchema = /* @__PURE__ */ v.pipe(v.strictObject(transferAccount), v.description("One AndCo account, named by its identifier."));
99
+ /**
100
+ * A Receptor at a Chilean bank, in the transfer vocabulary of the API: the fields of a transfer's `receiver` without the
101
+ * amount, which the Intent carries apart. `country` and `national_kind_id` are always declared.
102
+ */
103
+ export const IntentAccountExternalSchema = /* @__PURE__ */ v.pipe(v.strictObject(transferExternal), v.description('A Receptor at a Chilean bank, in the transfer vocabulary of the API (`receiver` without the amount): the four-digit `bank_code` (AndCo is `0739`), the `account_type` code (`"10"` savings, `"20"` checking, `"40"` debit), the `account_number`, and the holder\'s `name` and RUT. `country` and `national_kind_id` are always declared. It carries every field a `bank_transfer` `external` matcher can fix, so the Grant\'s destinations are asked about exactly this account.'));
85
104
  /**
86
- * One Andco account of the Grant's subject, named by Account Key or by identifier: where a
105
+ * One AndCo account of the Grant's subject, named by Account Key or by identifier: where a
87
106
  * transfer's money leaves from, where a deposit lands, and the account a closure closes.
88
107
  *
89
108
  * @example
90
109
  * const account: IntentAccount = { type: "account_key", accountKey: "ventas" };
91
110
  */
92
- export const IntentAccountSchema = /* @__PURE__ */ v.pipe(v.variant("type", [IntentAccountKeySchema, IntentAccountIdSchema]), v.description('One Andco account of the Grant\'s subject, in the account matcher vocabulary: by Account Key (`{ type: "account_key", accountKey }`) or by identifier (`{ type: "account", id }`). It is where a transfer\'s money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.'));
111
+ export const IntentAccountSchema = /* @__PURE__ */ v.pipe(v.variant("type", [IntentAccountKeySchema, IntentAccountIdSchema]), v.description('One AndCo account of the Grant\'s subject, in the account matcher vocabulary: by Account Key (`{ type: "account_key", accountKey }`) or by identifier (`{ type: "account", id }`). It is where a transfer\'s money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.'));
93
112
  const andcoAccount = IntentAccountSchema;
94
- /** Where a transfer's money leaves from: always an Andco account of the Grant's subject. */
95
- const transferSource = andcoAccount;
96
- /** Where a signed transfer's money lands: nothing on this path is left for a person to complete. */
97
- export const TransferDestinationSchema = /* @__PURE__ */ v.pipe(v.variant("type", [IntentAccountKeySchema, IntentAccountIdSchema, IntentAccountExternalSchema]), v.description("Where a signed transfer's money lands, in the `bank_transfer` matcher vocabulary: an Andco account by AccountKey or identifier, or an account at another Chilean bank."));
98
- const signedTransferDestination = TransferDestinationSchema;
113
+ /** The Remitente of a transfer Intent: always an AndCo account of the Grant's subject. */
114
+ const transferSender = andcoAccount;
115
+ /** The Receptor of a transfer, with nothing left to complete: how an event reports it. */
116
+ export const TransferIntentReceiverSchema = /* @__PURE__ */ v.pipe(v.variant("type", [IntentAccountKeySchema, IntentAccountIdSchema, IntentAccountExternalSchema]), v.description("The Receptor of a transfer, in the `bank_transfer` matcher vocabulary: an AndCo account by AccountKey or identifier, or a Receptor at a Chilean bank in the transfer vocabulary of the API."));
99
117
  /**
100
- * Where a proposed transfer's money lands when the request names it: locked on the confirmation
101
- * screen, which shows it and lets the person confirm it or not. `editable` only accepts `false`: a
102
- * named destination is never redirected at confirmation, so `editable: true` is an `invalid_request`
103
- * at creation. To let the person choose where the money goes, leave the destination out with `null`
104
- * (see {@link IntentCreateSchema}).
118
+ * The Receptor of a proposed transfer when the request names it: locked on the confirmation screen,
119
+ * which shows it and lets the person confirm it or not. `editable` only accepts `false`: a named
120
+ * Receptor is never redirected at confirmation, so `editable: true` is an `invalid_request` at
121
+ * creation. To let the person choose where the money goes, leave it out with `receiver: null` (see
122
+ * {@link IntentCreateSchema}).
105
123
  */
106
- const lockedDestination = { editable: /* @__PURE__ */ v.optional(v.literal(false), false) };
107
- export const TransferDestinationProposalSchema = /* @__PURE__ */ v.pipe(v.variant("type", [
108
- v.strictObject({ ...transferAccountKey, ...lockedDestination }),
109
- v.strictObject({ ...transferAccount, ...lockedDestination }),
110
- v.strictObject({ ...transferExternal, ...lockedDestination }),
111
- ]), v.description("Where a transfer's money lands when it is named, in the request and in the answered Intent alike. A named destination is always locked on the confirmation screen: `editable` only admits `false`, and `editable: true` fails at creation with `invalid_request`. To let the person choose where the money goes, the request says `destination: null` instead (`TransferIntentCreate`). Defaults to false in a request; an answered Intent always states it, including a destination the person completed on the screen, which is locked once she confirms."));
112
- const proposedTransferDestination = TransferDestinationProposalSchema;
124
+ const lockedReceiver = { editable: /* @__PURE__ */ v.optional(v.literal(false), false) };
125
+ export const TransferIntentReceiverProposalSchema = /* @__PURE__ */ v.pipe(v.variant("type", [
126
+ v.strictObject({ ...transferAccountKey, ...lockedReceiver }),
127
+ v.strictObject({ ...transferAccount, ...lockedReceiver }),
128
+ v.strictObject({ ...transferExternal, ...lockedReceiver }),
129
+ ]), v.description("The Receptor of a transfer when it is named, in the request and in the answered Intent alike. A named Receptor is always locked on the confirmation screen: `editable` only admits `false`, and `editable: true` fails at creation with `invalid_request`. To let the person choose where the money goes, the request says `receiver: null` instead (`TransferIntentCreate`). Defaults to false in a request; an answered Intent always states it, including a Receptor the person completed on the screen, which is locked once she confirms."));
130
+ const proposedTransferReceiver = TransferIntentReceiverProposalSchema;
113
131
  /**
114
- * The display label a Cuenta Vista is opened with. Mutable afterwards, and read by no permission. Its
132
+ * The display label a cuenta digital is opened with. Mutable afterwards, and read by no permission. Its
115
133
  * length is a rule ({@link ACCOUNT_NAME_MAX_LENGTH}), counted in code points.
116
134
  */
117
135
  const accountName = nameText;
@@ -166,16 +184,17 @@ export const DepositIntentCreateSchema = /* @__PURE__ */ v.pipe(withOneExpiratio
166
184
  }, expiresAtOrNever), v.description("The `application/json` half of collecting money into an account of the Grant's subject: an Intent born waiting for a payer. Exactly one of `expires_in` and `expires_at`; `expires_at: null` (never expires) only when `amount` is omitted."));
167
185
  /** A proposal to move money, born waiting for an Approval. See {@link IntentCreateSchema}. */
168
186
  export const TransferIntentCreateSchema = /* @__PURE__ */ v.pipe(withOneExpiration({
169
- ...common,
187
+ metadata: common.metadata,
170
188
  type: v.literal("transfer"),
171
189
  amount: TransferAmountProposalSchema,
172
190
  // Null or omitted: the person picks among the Grant's sources on the confirmation screen.
173
- source: v.pipe(v.optional(v.nullable(transferSource), null), v.description("The Andco account the money leaves. Null leaves that choice to a person on a screen.")),
191
+ sender: v.pipe(v.optional(v.nullable(transferSender), null), v.description("The Remitente: the AndCo account the money leaves. Null leaves that choice to a person on a screen.")),
174
192
  // Null or omitted: the person completes where the money goes on the confirmation screen, within
175
193
  // the Grant's destinations. A named one is locked there.
176
- destination: v.pipe(v.optional(v.nullable(proposedTransferDestination), null), v.description("Where the money lands. Null leaves it to a person on the screen, within the Grant's destinations.")),
177
- }, expiresAtOrNever), v.description("The `application/json` half of creating a transfer: an Intent born waiting for an Approval. A null `source` is the confirmation screen, where a person picks the account the money leaves from among the Grant's sources, and a null `destination` is the screen too: the person completes where the money goes (the bank, the type and number of the account, and its holder's RUT and name), and the server checks what she wrote against the Grant's `destinations` when she confirms, refusing one outside them with `invalid_destination`. Both default to null when omitted. A destination the request names is locked on the screen (`editable: true` is an `invalid_request`), and the amount is too unless `amount.editable` is true, in which case the person sets it. The `application/jwt` half is `SignedTransferIntentClaims`, and the two are separate schemas rather than one with optional fields on purpose: when signed and unsigned members share an object, something eventually reads the wrong ones."));
178
- /** A proposal to open a Cuenta Vista, born waiting for an Approval. See {@link IntentCreateSchema}. */
194
+ receiver: v.pipe(v.optional(v.nullable(proposedTransferReceiver), null), v.description("The Receptor: where the money lands. Null leaves it to a person on the screen, within the Grant's destinations.")),
195
+ comment: v.optional(TransferCommentProposalSchema),
196
+ }, expiresAtOrNever), v.description("The `application/json` half of creating a transfer: an Intent born waiting for an Approval, in the transfer vocabulary of the API: `sender`, `receiver`, an integer `amount.value` and a `comment` of at most 60 bytes. A null `sender` is the confirmation screen, where a person picks the account the money leaves from among the Grant's sources, and a null `receiver` is the screen too: the person completes where the money goes (the bank, the type and number of the account, and its holder's RUT and name), and the server checks what she wrote against the Grant's `destinations` when she confirms, refusing one outside them with `invalid_destination`. Both default to null when omitted. A Receptor the request names is locked on the screen (`editable: true` is an `invalid_request`), and the amount is too unless `amount.editable` is true, in which case the person sets it. A Receptor at a bank is named in the transfer vocabulary of the API (`IntentAccountExternal`). A signed transfer is not an Intent: it is submitted to `POST /transfers` as a `SignedTransferEnvelope`."));
197
+ /** A proposal to open a cuenta digital, born waiting for an Approval. See {@link IntentCreateSchema}. */
179
198
  export const AccountOpeningIntentCreateSchema = /* @__PURE__ */ v.pipe(withOneExpiration({
180
199
  ...common,
181
200
  type: v.literal("account_opening"),
@@ -184,9 +203,9 @@ export const AccountOpeningIntentCreateSchema = /* @__PURE__ */ v.pipe(withOneEx
184
203
  accountKey: AccountKeySchema,
185
204
  name: v.pipe(v.optional(accountName), v.description("The display label the account opens with. Mutable afterwards, and read by no permission.")),
186
205
  upsert: v.pipe(v.optional(v.boolean(), false), v.description("Whether naming an AccountKey that already exists answers with that account instead of failing. It defaults to false, so one name never quietly becomes two accounts.")),
187
- }, expiresAtOrNever), v.description("The `application/json` half of opening a Cuenta Vista: an Intent born waiting for an Approval. `/accounts` has no `POST` because everything with banking consequence happens through an Intent, and an opening carries no amount, no source and no destination -- only the name the account will answer to. Opening is asynchronous: the answer is the Intent and its status, and the Número de Cuenta arrives on the account's event stream."));
188
- /** A proposal to close a Cuenta Vista, born waiting for an Approval. See {@link IntentCreateSchema}. */
189
- export const AccountClosureIntentCreateSchema = /* @__PURE__ */ v.pipe(withOneExpiration({ ...common, type: v.literal("account_closure"), account: andcoAccount }, expiresAt), v.description("The `application/json` half of closing a Cuenta Vista: an Intent born waiting for an Approval. `/accounts` has no `DELETE` because everything with banking consequence happens through an Intent. It carries no amount, no source and no destination -- only a reference to the account it closes."));
206
+ }, expiresAtOrNever), v.description("The `application/json` half of opening a cuenta digital: an Intent born waiting for an Approval. `/accounts` has no `POST` because everything that changes an account happens through an Intent, and an opening carries no amount, no source and no destination -- only the name the account will answer to. Opening is asynchronous: the answer is the Intent and its status, and the Número de Cuenta arrives on the account's event stream."));
207
+ /** A proposal to close a cuenta digital, born waiting for an Approval. See {@link IntentCreateSchema}. */
208
+ export const AccountClosureIntentCreateSchema = /* @__PURE__ */ v.pipe(withOneExpiration({ ...common, type: v.literal("account_closure"), account: andcoAccount }, expiresAt), v.description("The `application/json` half of closing a cuenta digital: an Intent born waiting for an Approval. `/accounts` has no `DELETE` because everything that changes an account happens through an Intent. It carries no amount, no source and no destination -- only a reference to the account it closes."));
190
209
  /**
191
210
  * Public creation validation shared by the API and SDK. SQL resolves deadlines and enforces authorization.
192
211
  *
@@ -196,33 +215,33 @@ export const AccountClosureIntentCreateSchema = /* @__PURE__ */ v.pipe(withOneEx
196
215
  * on purpose — when signed and unsigned members share an object, something eventually reads the
197
216
  * wrong ones.
198
217
  *
199
- * `transfer` is the only way money movement is expressed: money leaving an account towards a
200
- * `destination`, both named in the `bank_transfer` matcher vocabulary (`account_key`, `account`,
201
- * `external`). A null `source` is the confirmation screen's source picker, and a null `destination` is
202
- * the screen's destination form: the person completes where the money goes (another bank's account, or
203
- * another Andco customer's), and the server checks what she wrote against the Grant's `destinations`
204
- * when she confirms. Both are the screen's when omitted. A destination the request does name is locked
218
+ * `transfer` is the only way money movement is expressed: money leaving a `sender` account towards a
219
+ * `receiver`, both named in the `bank_transfer` matcher vocabulary (`account_key`, `account`,
220
+ * `external`, whose Receptor speaks the transfer vocabulary of the API). A null `sender` is the confirmation screen's
221
+ * source picker, and a null `receiver` is the screen's receiver form: the person completes where the
222
+ * money goes (another bank's account, or another AndCo customer's), and the server checks what she
223
+ * wrote against the Grant's `destinations` when she confirms. Both are the screen's when omitted. A
224
+ * Receptor the request does name is locked
205
225
  * there (`editable: true` is refused), and so is the amount unless it says `editable: true`, in which
206
226
  * case the person sets it. Who may approve the Intent without a person belongs to the Grant, never to
207
227
  * the operation itself.
208
228
  *
209
229
  * @example
210
230
  * parseIntentInput({
211
- * type: "transfer", expires_in: "30 minutes", source: null,
212
- * destination: { type: "account_key", accountKey: "proveedores" },
213
- * amount: { currency: "CLP", value: "40000" },
214
- * note: { value: "Factura 42", editable: true },
231
+ * type: "transfer", expires_in: "30 minutes", sender: null,
232
+ * receiver: { type: "account_key", accountKey: "proveedores" },
233
+ * amount: { currency: "CLP", value: 40000 },
234
+ * comment: { value: "Factura 42", editable: true },
215
235
  * });
216
236
  *
217
237
  * @example
218
- * // The person picks both accounts on Andco's confirmation screen.
238
+ * // The person picks both accounts on AndCo's confirmation screen.
219
239
  * parseIntentInput({
220
- * type: "transfer", expires_in: "30 minutes", source: null, destination: null,
221
- * amount: { currency: "CLP", value: "40000", editable: true },
240
+ * type: "transfer", expires_in: "30 minutes", sender: null, receiver: null,
241
+ * amount: { currency: "CLP", value: 40000, editable: true },
222
242
  * });
223
243
  *
224
- * `account_opening` is here for the same reason money movement is: everything with banking
225
- * consequence happens through an Intent, so `/accounts` has no `POST`. It carries no amount, no
244
+ * `account_opening` is here for the same reason money movement is: everything that changes an account * consequence happens through an Intent, so `/accounts` has no `POST`. It carries no amount, no
226
245
  * source and no destination — only the name the account will answer to, and whether naming one that
227
246
  * already exists is an error or a request for the account that is already there.
228
247
  */
@@ -269,14 +288,14 @@ function nameIssues(input) {
269
288
  issues.push({ type: "name_too_long", path: [{ key: "name" }], requirement: ACCOUNT_NAME_MAX_LENGTH });
270
289
  }
271
290
  if (input.type === "transfer")
272
- issues.push(...holderNameIssues(input.destination));
291
+ issues.push(...holderNameIssues(input.receiver));
273
292
  return issues;
274
293
  }
275
- function holderNameIssues(destination) {
276
- if (destination?.holder_name === undefined || codePoints(destination.holder_name) <= HOLDER_NAME_MAX_LENGTH) {
294
+ function holderNameIssues(receiver) {
295
+ if (receiver?.name === undefined || codePoints(receiver.name) <= HOLDER_NAME_MAX_LENGTH) {
277
296
  return [];
278
297
  }
279
- const path = [{ key: "destination" }, { key: "holder_name" }];
298
+ const path = [{ key: "receiver" }, { key: "name" }];
280
299
  return [{ type: "holder_name_too_long", path, requirement: HOLDER_NAME_MAX_LENGTH }];
281
300
  }
282
301
  function metadataIssues(metadata) {
@@ -290,9 +309,11 @@ function metadataIssues(metadata) {
290
309
  *
291
310
  * - `invalid_expiration_interval`: `expires_in` is not a whole number of seconds, minutes, hours or days.
292
311
  * - `invalid_expiration_datetime`: `expires_at` is not a real calendar datetime with a timezone.
293
- * - `note_too_long`: the note has more than {@link NOTE_MAX_LENGTH} code points.
312
+ * - `note_too_long`: the note of a deposit or an account Intent has more than {@link NOTE_MAX_LENGTH}
313
+ * code points.
314
+ * - `comment_too_long`: a transfer's comment has more than 60 bytes of UTF-8.
294
315
  * - `name_too_long`: an account opening's `name` has more than {@link ACCOUNT_NAME_MAX_LENGTH} code points.
295
- * - `holder_name_too_long`: an external destination's `holder_name` has more than
316
+ * - `holder_name_too_long`: an external Receptor's holder `name` has more than
296
317
  * {@link HOLDER_NAME_MAX_LENGTH} code points.
297
318
  * - `passive_deposit_requires_no_target`: a deposit that never expires names an amount; only a
298
319
  * deposit with a target must expire.
@@ -304,7 +325,12 @@ function metadataIssues(metadata) {
304
325
  */
305
326
  export function intentInputIssues(input) {
306
327
  const issues = expirationIssues(input);
307
- issues.push(...noteIssues(input.note?.value, [{ key: "note" }, { key: "value" }]));
328
+ if (input.type === "transfer") {
329
+ issues.push(...transferCommentIssues(input.comment?.value, [{ key: "comment" }, { key: "value" }]));
330
+ }
331
+ else {
332
+ issues.push(...noteIssues(input.note?.value, [{ key: "note" }, { key: "value" }]));
333
+ }
308
334
  issues.push(...nameIssues(input));
309
335
  if (input.type === "deposit" && input.expires_at === null && input.amount !== undefined) {
310
336
  issues.push({ type: "passive_deposit_requires_no_target", path: undefined, requirement: undefined });
@@ -319,10 +345,10 @@ export function intentInputIssues(input) {
319
345
  *
320
346
  * @example
321
347
  * const parsed = parseIntentInput({
322
- * type: "transfer", expires_in: "30 minutes", source: null,
323
- * destination: { type: "account_key", accountKey: "proveedores" },
324
- * amount: { currency: "CLP", value: "40000" },
325
- * note: { value: "Factura 42", editable: true },
348
+ * type: "transfer", expires_in: "30 minutes", sender: null,
349
+ * receiver: { type: "account_key", accountKey: "proveedores" },
350
+ * amount: { currency: "CLP", value: 40000 },
351
+ * comment: { value: "Factura 42", editable: true },
326
352
  * });
327
353
  * if (!parsed.success) console.log(parsed.issues.map((issue) => issue.type)); // e.g. ["note_too_long"]
328
354
  */
@@ -338,15 +364,6 @@ const signedEnvelope = {
338
364
  nbf: /* @__PURE__ */ v.optional(v.pipe(v.number(), v.integer())),
339
365
  metadata: /* @__PURE__ */ v.optional(v.record(v.string(), v.unknown()), {}),
340
366
  };
341
- /** The verified claims of a Signed Instruction that moves money. See {@link SignedIntentSchema}. */
342
- export const SignedTransferIntentClaimsSchema = /* @__PURE__ */ v.pipe(withOneExpiration({
343
- ...signedEnvelope,
344
- type: v.literal("transfer"),
345
- source: transferSource,
346
- destination: signedTransferDestination,
347
- amount: SignedAmountSchema,
348
- note: v.pipe(v.optional(noteText), v.description("A plain bank reference; a Signed Instruction proposes nothing.")),
349
- }, expiresAtOrNever), v.description("The verified claims of a Signed Instruction, sent to the same endpoint as `application/jwt`. Nothing here is optional that the transfer needs and nothing here is editable: an instruction that does not say where the money comes from or where it goes is not signable, so `source` and `destination` are required (and neither may be `null`: there is no screen on this path to complete it) and the amount carries no `editable`. `note` is a plain reference for the same reason -- there is no screen on this path, so there is nobody to propose it to. When a signature is present, every value the transfer uses comes from these claims and none from the envelope carrying them. `exp` bounds how long the instruction may be submitted; `expires_in` or `expires_at` bounds how long the Intent may be approved and executed. They are different deadlines."));
350
367
  /** The verified claims of a Signed Instruction that opens an account. See {@link SignedIntentSchema}. */
351
368
  export const SignedAccountOpeningIntentClaimsSchema = /* @__PURE__ */ v.pipe(withOneExpiration({
352
369
  ...signedEnvelope,
@@ -366,20 +383,18 @@ export const SignedAccountClosureIntentClaimsSchema = /* @__PURE__ */ v.pipe(wit
366
383
  account: andcoAccount,
367
384
  }, expiresAt), v.description("The verified claims of a Signed Instruction that closes an account. `account` is required and never editable: an instruction that does not say which account it closes is not signable."));
368
385
  /**
369
- * The verified claims of a Signed Instruction: the `application/jwt` half of the same creation.
386
+ * The verified claims of a Signed Instruction: the `application/jwt` half of the same creation, for
387
+ * opening and closing an account.
370
388
  *
371
- * Nothing here is optional that the transfer needs and nothing here is editable. An instruction that
372
- * does not say where the money comes from or where it goes is not signable, so `source` and
373
- * `destination` are required (a `null` for either is refused: there is no screen on this path to
374
- * complete it) and the amount carries no `editable`. `note` is a plain reference for the same reason:
375
- * there is nobody to propose it to.
389
+ * A signed transfer is not here: it is a Transfer of its own, submitted to `POST /transfers` as a
390
+ * `SignedTransferEnvelope` whose claims are `SignedTransferClaims`.
376
391
  *
377
392
  * There is no `org_id`: the subject is the one of the Grant behind the access token that submits the
378
393
  * instruction, and nothing inside the signature may name another.
379
394
  *
380
395
  * The expiration is present on this side too, and it is not `exp`. `exp` bounds how long the
381
396
  * instruction may be *submitted*; the Intent expiration bounds how long the Intent may be approved
382
- * and executed. They are different deadlines, and because every value a signed transfer uses has to
397
+ * and executed. They are different deadlines, and because every value a signed Intent uses has to
383
398
  * come from inside the signature, the second one cannot arrive in a header or a query string.
384
399
  *
385
400
  * `account_opening` is signed on the same terms, and `upsert` is the reason it matters here. The
@@ -390,24 +405,20 @@ export const SignedAccountClosureIntentClaimsSchema = /* @__PURE__ */ v.pipe(wit
390
405
  *
391
406
  * @example
392
407
  * const claims = parseSignedIntentInput(verification.claims);
393
- * if (claims.success && claims.output.type === "transfer") console.log(claims.output.jti, claims.output.amount.value);
408
+ * if (claims.success && claims.output.type === "account_opening") console.log(claims.output.jti, claims.output.accountKey);
394
409
  */
395
410
  export const SignedIntentSchema = /* @__PURE__ */ v.variant("type", [
396
- SignedTransferIntentClaimsSchema,
397
411
  SignedAccountOpeningIntentClaimsSchema,
398
412
  SignedAccountClosureIntentClaimsSchema,
399
413
  ]);
400
414
  /**
401
415
  * The rules of a Signed Instruction's claims that JSON Schema does not say, over claims that already
402
416
  * have their shape ({@link SignedIntentSchema}): `invalid_expiration_interval`,
403
- * `invalid_expiration_datetime`, `note_too_long`, `name_too_long`, `holder_name_too_long` and
404
- * `metadata_too_large`, as in
417
+ * `invalid_expiration_datetime`, `name_too_long` and `metadata_too_large`, as in
405
418
  * {@link intentInputIssues}.
406
419
  */
407
420
  export function signedIntentInputIssues(input) {
408
421
  const issues = expirationIssues(input);
409
- if (input.type === "transfer")
410
- issues.push(...noteIssues(input.note, [{ key: "note" }]));
411
422
  issues.push(...nameIssues(input));
412
423
  issues.push(...metadataIssues(input.metadata));
413
424
  return issues;
@@ -423,24 +434,28 @@ export function signedIntentInputIssues(input) {
423
434
  export function parseSignedIntentInput(input) {
424
435
  return parseWithRules(SignedIntentSchema, signedIntentInputIssues, input);
425
436
  }
426
- /** Why an Intent is cancelled or rejected: trimmed and never blank. Its length is a rule. */
427
- const decisionReason = /* @__PURE__ */ v.pipe(v.string(), v.trim(), v.minLength(1));
437
+ /**
438
+ * Why an Intent is cancelled or rejected: optional, and when given trimmed and never blank. Its length
439
+ * is a rule.
440
+ */
441
+ const decisionReason = /* @__PURE__ */ v.optional(v.pipe(v.string(), v.trim(), v.minLength(1)));
428
442
  /**
429
443
  * The rule of a Cancellation's or a Rejection's reason that JSON Schema does not say in code points
430
444
  * the way the server counts them: `reason_too_long`, past {@link REASON_MAX_LENGTH}.
431
445
  */
432
446
  export function intentDecisionIssues(input) {
433
- if (codePoints(input.reason) <= REASON_MAX_LENGTH)
447
+ if (input.reason === undefined || codePoints(input.reason) <= REASON_MAX_LENGTH)
434
448
  return [];
435
449
  return [{ type: "reason_too_long", path: [{ key: "reason" }], requirement: REASON_MAX_LENGTH }];
436
450
  }
437
451
  /**
438
- * Cancelling names why, because an Intent that vanished without a reason is an unexplained gap.
439
- * A Cancellation is the creator withdrawing its own request: only the client that created the
452
+ * Cancelling may say why: the reason is optional, and when given it has 1 to 280 code points. A
453
+ * Cancellation is the creator withdrawing its own request: only the client that created the
440
454
  * Intent may cancel it. An approver declining it is a Rejection ({@link IntentRejectionSchema}).
441
455
  *
442
456
  * @example
443
457
  * parseIntentCancellation({ reason: "rejected_by_erp" });
458
+ * parseIntentCancellation({}); // a reason is optional
444
459
  */
445
460
  export const IntentCancellationSchema = /* @__PURE__ */ v.strictObject({ reason: decisionReason });
446
461
  /** Parses a cancellation: its shape and then {@link intentDecisionIssues}. */
@@ -448,12 +463,14 @@ export function parseIntentCancellation(input) {
448
463
  return parseWithRules(IntentCancellationSchema, intentDecisionIssues, input);
449
464
  }
450
465
  /**
451
- * Rejecting names why. A Rejection is an approver declining an Intent with a Grant holding the
466
+ * Rejecting may say why: the reason is optional, and when given it has 1 to 280 code points. A
467
+ * Rejection is an approver declining an Intent with a Grant holding the
452
468
  * family's `reject` action (`bank_transfer` for a transfer); the audit keeps it apart from a
453
469
  * Cancellation, which is the creator withdrawing its own request.
454
470
  *
455
471
  * @example
456
472
  * parseIntentRejection({ reason: "duplicated_invoice" });
473
+ * parseIntentRejection({}); // a reason is optional
457
474
  */
458
475
  export const IntentRejectionSchema = /* @__PURE__ */ v.strictObject({ reason: decisionReason });
459
476
  /** Parses a rejection: its shape and then {@link intentDecisionIssues}. */
@@ -476,7 +493,7 @@ export const ANDCO_INTENT_ERROR_CODES = {
476
493
  */
477
494
  ACCOUNT_CLOSURE_NOT_IMPLEMENTED: "account_closure_not_implemented",
478
495
  /**
479
- * Opening an additional account by Account Key works where the bank serves it. Where it does not,
496
+ * Opening an additional account by Account Key works where AndCo serves it. Where it does not,
480
497
  * the server answers `not_implemented` (501) with this stable `code`: at Intent creation, once the
481
498
  * request is valid and the Grant holds `bank_account` `create` (otherwise `400` or `403` come
482
499
  * first) and nothing is created, and at approval, with the `intent_id`, leaving the Intent as it
@@ -485,12 +502,30 @@ export const ANDCO_INTENT_ERROR_CODES = {
485
502
  ACCOUNT_OPENING_NOT_IMPLEMENTED: "account_opening_not_implemented",
486
503
  /**
487
504
  * A transfer between two accounts of the same holder (the destination is an Account Key or an
488
- * Andco account of the Grant's subject) works where the bank serves it. Where it does not, the
505
+ * AndCo account of the Grant's subject) works where AndCo serves it. Where it does not, the
489
506
  * server answers `not_implemented` (501) with this stable `code`: at Intent creation, with
490
507
  * nothing created, and at approval, with the `intent_id`. A transfer to another bank or to
491
- * another Andco customer is not affected.
508
+ * another AndCo customer is not affected.
492
509
  */
493
510
  OWN_ACCOUNT_TRANSFER_NOT_IMPLEMENTED: "own_account_transfer_not_implemented",
511
+ /**
512
+ * A signed transfer that leaves its holder (to another bank or to another AndCo customer) moves
513
+ * only where AndCo serves that rail. Where it does not, `POST /transfers`
514
+ * answers `not_implemented` (501) with this stable `code` once the instruction verified and the
515
+ * Grant covers it, and nothing is created. A signed transfer between two accounts of the same
516
+ * holder is not affected.
517
+ */
518
+ SIGNED_OUTGOING_TRANSFER_NOT_IMPLEMENTED: "signed_outgoing_transfer_not_implemented",
519
+ /**
520
+ * `POST /transfers` answers `400` with this code for a signed transfer with `approved: false`: that
521
+ * transfer waits for a decision, so it is an Intent. Send it to `POST /intents`. Nothing is recorded.
522
+ */
523
+ APPROVAL_REQUIRED_USE_INTENTS: "approval_required_use_intents",
524
+ /**
525
+ * `POST /intents` answers `400` with this code for a signed transfer with `approved: true`: its
526
+ * signature is the approval, so it is a Transfer. Send it to `POST /transfers`. Nothing is recorded.
527
+ */
528
+ APPROVED_USE_TRANSFERS: "approved_use_transfers",
494
529
  };
495
530
  /**
496
531
  * Identifies recognized unsupported Intents without silently dropping their extra instructions: an
@@ -504,7 +539,8 @@ export function unsupportedIntentShape(input) {
504
539
  return ANDCO_INTENT_ERROR_CODES.ACCOUNT_CLOSURE_NOT_IMPLEMENTED;
505
540
  if (!["deposit", "transfer"].includes(String(record["type"])))
506
541
  return undefined;
507
- if (Object.hasOwn(record, "destinations") || Array.isArray(record["destination"]))
542
+ const several = record["type"] === "transfer" ? "receiver" : "destination";
543
+ if (Object.hasOwn(record, `${several}s`) || Array.isArray(record[several]))
508
544
  return "multiple_destinations_not_implemented";
509
545
  if (Object.hasOwn(record, "allocations") || Object.hasOwn(record, "split"))
510
546
  return "split_payments_not_implemented";
@@ -517,26 +553,27 @@ export function unsupportedIntentShape(input) {
517
553
  *
518
554
  * Every member but `intent_id` is optional because nothing here is necessarily editable: a screen
519
555
  * sends only what the Intent left open, and a value that was frozen has nowhere to arrive from.
520
- * `destination` is the one the person completes when the Intent was created with `destination: null`,
521
- * and is required then; a transfer that named its destination takes none. `amount` is accepted only
522
- * when the Intent was created with `amount.editable: true`. The server checks the destination against
523
- * the Grant's `destinations` and refuses one outside them with `invalid_destination`.
556
+ * `receiver` is the one the person completes when the Intent was created with `receiver: null`, and
557
+ * is required then; a transfer that named its Receptor takes none. `amount` (in the minor unit of the currency) is accepted
558
+ * only when the Intent was created with `amount.editable: true`. The server checks the Receptor
559
+ * against the Grant's `destinations` and refuses one outside them with `invalid_destination`.
524
560
  */
525
561
  export const TransferConfirmationSchema = /* @__PURE__ */ v.strictObject({
526
562
  intent_id: accountId,
527
- source_account_id: v.optional(accountId),
528
- amount: v.optional(MoneySchema),
529
- // What the person wrote is always the account of a bank: another bank's, or Andco's own as the bank
530
- // `andco`. An Andco account of the Grant's subject is not offered on the screen yet.
531
- destination: v.optional(v.strictObject(transferExternal)),
532
- note: v.optional(noteText),
563
+ sender_account_id: v.optional(accountId),
564
+ amount: v.optional(PesosSchema),
565
+ // What the person wrote is always a Receptor at a bank, in the transfer vocabulary of the API:
566
+ // another bank's, or another AndCo customer's with bank code `0739`. An AndCo account of the Grant's subject is not
567
+ // offered on the screen yet.
568
+ receiver: v.optional(v.strictObject(transferExternal)),
569
+ comment: v.optional(noteText),
533
570
  });
534
571
  /**
535
- * The rules of a confirmation that JSON Schema does not say in code points: `note_too_long`, past
536
- * {@link NOTE_MAX_LENGTH}, and `holder_name_too_long`, past {@link HOLDER_NAME_MAX_LENGTH}.
572
+ * The rules of a confirmation that JSON Schema does not say: `comment_too_long`, past 60 bytes
573
+ * of UTF-8, and `holder_name_too_long`, past {@link HOLDER_NAME_MAX_LENGTH} code points.
537
574
  */
538
575
  export function transferConfirmationIssues(input) {
539
- return [...noteIssues(input.note, [{ key: "note" }]), ...holderNameIssues(input.destination)];
576
+ return [...transferCommentIssues(input.comment, [{ key: "comment" }]), ...holderNameIssues(input.receiver)];
540
577
  }
541
578
  /**
542
579
  * Parses proposed confirmation fields: their shape and then {@link transferConfirmationIssues}. The
@@ -2,8 +2,7 @@
2
2
  * The lifecycle stage of an Intent status: what precedes the first dot of `<base>[.<detail>]`.
3
3
  *
4
4
  * Decide on the base, or with {@link IS_INTENT_TERMINAL_STATUS}, never with an exhaustive `switch` over
5
- * the whole status: its vocabulary is open, and `failed.<code>` can carry a code Identity answered with
6
- * that no enum lists.
5
+ * the whole status: its vocabulary is open, and a detail can be one that no enum lists yet.
7
6
  *
8
7
  * @example
9
8
  * ```ts
@@ -14,15 +13,15 @@
14
13
  export declare function INTENT_STATUS_BASE(status: string): string;
15
14
  /**
16
15
  * Whether an Intent status is one the Intent never leaves, decided by its base alone so a detail the
17
- * server adds later is never misread: `succeeded`, `completed`, `closed`, `failed`, `cancelled`,
18
- * `rejected` and `expired` are terminal with or without a detail; `requires_action` and
19
- * `processing` are not. Use it, and {@link INTENT_STATUS_BASE}, instead of an exhaustive `switch` over
16
+ * server adds later is never misread: `approved`, `completed`, `closed`, `cancelled`, `rejected` and
17
+ * `expired` are terminal with or without a detail (so are `succeeded` and `failed`, which only the
18
+ * native presentation reports); `requires_action` and `processing` are not. Use it, and {@link INTENT_STATUS_BASE}, instead of an exhaustive `switch` over
20
19
  * the whole status, whose vocabulary is open.
21
20
  *
22
21
  * @example
23
22
  * ```ts
24
23
  * IS_INTENT_TERMINAL_STATUS("cancelled.grant_revoked"); // true
25
- * IS_INTENT_TERMINAL_STATUS("processing.opening"); // false
24
+ * IS_INTENT_TERMINAL_STATUS("approved"); // true: an Intent ends at its decision
26
25
  * ```
27
26
  */
28
27
  export declare function IS_INTENT_TERMINAL_STATUS(status: string): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"intent-status.d.ts","sourceRoot":"","sources":["../src/intent-status.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEjE"}
1
+ {"version":3,"file":"intent-status.d.ts","sourceRoot":"","sources":["../src/intent-status.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEjE"}