@andco/protocol 0.0.4 → 0.0.6

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.
@@ -47,8 +47,8 @@ export declare function isIntentDeadline(value: string): boolean;
47
47
  *
48
48
  * `transfer` is the only way money movement is expressed: money leaving an account towards a
49
49
  * `destination`, both named in the `bank_transfer` matcher vocabulary (`alias`, `account`,
50
- * `external`). A null `source` is the confirmation screen's source picker; `editable: false` locks
51
- * the destination there. Who may approve the Intent without a person belongs to the Grant, never to
50
+ * `external`). A null `source` is the confirmation screen's source picker; the amount and the
51
+ * destination are always locked there (`editable: true` is refused). Who may approve the Intent without a person belongs to the Grant, never to
52
52
  * the operation itself.
53
53
  *
54
54
  * @example
@@ -90,7 +90,7 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
90
90
  readonly amount: v.StrictObjectSchema<{
91
91
  currency: v.LiteralSchema<"CLP", undefined>;
92
92
  value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, v.CheckAction<string, undefined>]>;
93
- editable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
93
+ editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
94
94
  }, undefined>;
95
95
  readonly source: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.StrictObjectSchema<{
96
96
  type: v.LiteralSchema<"alias", undefined>;
@@ -108,7 +108,7 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
108
108
  readonly type: v.LiteralSchema<"account", undefined>;
109
109
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
110
110
  }, undefined>, v.StrictObjectSchema<{
111
- readonly editable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
111
+ readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
112
112
  readonly type: v.LiteralSchema<"external", undefined>;
113
113
  readonly bank_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
114
114
  readonly account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
@@ -179,7 +179,7 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
179
179
  amount: {
180
180
  currency: "CLP";
181
181
  value: string;
182
- editable: boolean;
182
+ editable: false;
183
183
  };
184
184
  source: {
185
185
  type: "alias";
@@ -197,7 +197,7 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
197
197
  type: "account";
198
198
  id: string;
199
199
  } | {
200
- editable: boolean;
200
+ editable: false;
201
201
  type: "external";
202
202
  bank_id: string;
203
203
  account_type: "checking" | "debit" | "savings";
@@ -274,7 +274,7 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
274
274
  amount: {
275
275
  currency: "CLP";
276
276
  value: string;
277
- editable: boolean;
277
+ editable: false;
278
278
  };
279
279
  source: {
280
280
  type: "alias";
@@ -292,7 +292,7 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
292
292
  type: "account";
293
293
  id: string;
294
294
  } | {
295
- editable: boolean;
295
+ editable: false;
296
296
  type: "external";
297
297
  bank_id: string;
298
298
  account_type: "checking" | "debit" | "savings";
@@ -369,7 +369,7 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
369
369
  amount: {
370
370
  currency: "CLP";
371
371
  value: string;
372
- editable: boolean;
372
+ editable: false;
373
373
  };
374
374
  source: {
375
375
  type: "alias";
@@ -387,7 +387,7 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
387
387
  type: "account";
388
388
  id: string;
389
389
  } | {
390
- editable: boolean;
390
+ editable: false;
391
391
  type: "external";
392
392
  bank_id: string;
393
393
  account_type: "checking" | "debit" | "savings";
@@ -466,7 +466,7 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
466
466
  readonly amount: v.StrictObjectSchema<{
467
467
  currency: v.LiteralSchema<"CLP", undefined>;
468
468
  value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, v.CheckAction<string, undefined>]>;
469
- editable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
469
+ editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
470
470
  }, undefined>;
471
471
  readonly source: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.StrictObjectSchema<{
472
472
  type: v.LiteralSchema<"alias", undefined>;
@@ -484,7 +484,7 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
484
484
  readonly type: v.LiteralSchema<"account", undefined>;
485
485
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
486
486
  }, undefined>, v.StrictObjectSchema<{
487
- readonly editable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
487
+ readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
488
488
  readonly type: v.LiteralSchema<"external", undefined>;
489
489
  readonly bank_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
490
490
  readonly account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
@@ -555,7 +555,7 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
555
555
  amount: {
556
556
  currency: "CLP";
557
557
  value: string;
558
- editable: boolean;
558
+ editable: false;
559
559
  };
560
560
  source: {
561
561
  type: "alias";
@@ -573,7 +573,7 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
573
573
  type: "account";
574
574
  id: string;
575
575
  } | {
576
- editable: boolean;
576
+ editable: false;
577
577
  type: "external";
578
578
  bank_id: string;
579
579
  account_type: "checking" | "debit" | "savings";
@@ -650,7 +650,7 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
650
650
  amount: {
651
651
  currency: "CLP";
652
652
  value: string;
653
- editable: boolean;
653
+ editable: false;
654
654
  };
655
655
  source: {
656
656
  type: "alias";
@@ -668,7 +668,7 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
668
668
  type: "account";
669
669
  id: string;
670
670
  } | {
671
- editable: boolean;
671
+ editable: false;
672
672
  type: "external";
673
673
  bank_id: string;
674
674
  account_type: "checking" | "debit" | "savings";
@@ -745,7 +745,7 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
745
745
  amount: {
746
746
  currency: "CLP";
747
747
  value: string;
748
- editable: boolean;
748
+ editable: false;
749
749
  };
750
750
  source: {
751
751
  type: "alias";
@@ -763,7 +763,7 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
763
763
  type: "account";
764
764
  id: string;
765
765
  } | {
766
- editable: boolean;
766
+ editable: false;
767
767
  type: "external";
768
768
  bank_id: string;
769
769
  account_type: "checking" | "debit" | "savings";
@@ -1334,6 +1334,9 @@ export declare function unsupportedIntentPaymentShape(input: unknown): string |
1334
1334
  *
1335
1335
  * Every member but `intent_id` is optional because nothing here is necessarily editable: a screen
1336
1336
  * sends only what the Intent left open, and a value that was frozen has nowhere to arrive from.
1337
+ * A transfer is created with its amount and destination locked (`editable: true` is refused at
1338
+ * creation), so today `amount` and `destination` always meet `transfer_value_editing_not_implemented`;
1339
+ * they stay in the shape for when confirmation-time editing exists.
1337
1340
  */
1338
1341
  export declare const TransferConfirmationSchema: v.StrictObjectSchema<{
1339
1342
  readonly intent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
@@ -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;AAsE7B;;;;;;GAMG;AACH,QAAA,MAAM,YAAY;;;;;;0BAGhB,CAAC;AAEH,kGAAkG;AAClG,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC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MAAM,GAAG,SAAS,CAShF;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;aAOrC,CAAC;AAEH,gGAAgG;AAChG,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO;;;;;;;;;;;;;eAE3D"}
@@ -12,18 +12,30 @@ const accountId = /* @__PURE__ */ v.pipe(v.string(), v.uuid());
12
12
  // silently shipping an unsafe integer.
13
13
  const amountValue = /* @__PURE__ */ v.pipe(MoneySchema, v.check((value) => Number.isSafeInteger(Number(value))));
14
14
  /**
15
- * The amount a request asks for: `value` is the number, and `editable: true` lets the person who
16
- * confirms change it on the screen. It is never what moved; an answered Intent says that apart
17
- * (`settled` on a transfer, `progress.credited` on a deposit).
15
+ * The amount a deposit asks for: `value` is the number, and `editable: true` lets the payer change
16
+ * it on the screen. It is never what moved; an answered Intent says that apart (`progress.credited`).
18
17
  *
19
18
  * @example
20
- * const amount = { currency: "CLP", value: "40000", editable: false };
19
+ * const amount = { currency: "CLP", value: "40000", editable: true };
21
20
  */
22
- const proposedAmount = {
21
+ const depositAmount = {
23
22
  currency: v.literal("CLP"),
24
23
  value: amountValue,
25
24
  editable: v.optional(v.boolean(), false),
26
25
  };
26
+ /**
27
+ * The amount a transfer proposes. `editable` only accepts `false`: the confirmation screen cannot
28
+ * change what a transfer moves yet (TODO), so asking for an editable amount is an
29
+ * `invalid_request` at creation instead of an Intent nobody can confirm. What moved is `settled`.
30
+ *
31
+ * @example
32
+ * const amount = { currency: "CLP", value: "40000" };
33
+ */
34
+ const transferAmount = {
35
+ currency: v.literal("CLP"),
36
+ value: amountValue,
37
+ editable: v.optional(v.literal(false), false),
38
+ };
27
39
  /**
28
40
  * The amount a Signed Instruction orders: the same `{ currency, value }` as a request, with nothing
29
41
  * left for a person to change, so there is no `editable`.
@@ -74,14 +86,15 @@ const signedTransferDestination = /* @__PURE__ */ v.variant("type", [
74
86
  v.strictObject(transferExternal),
75
87
  ]);
76
88
  /**
77
- * Where a proposed transfer's money lands. `editable: false` locks it on the confirmation screen;
78
- * only another bank's account can ever be editable, because an Andco account named by Alias or by
79
- * identifier already denotes exactly one account.
89
+ * Where a proposed transfer's money lands, always locked on the confirmation screen. `editable`
90
+ * only accepts `false`: redirecting a transfer at confirmation is not implemented yet (TODO), so
91
+ * `editable: true` is an `invalid_request` at creation instead of an Intent nobody can confirm.
80
92
  */
93
+ const lockedDestination = { editable: /* @__PURE__ */ v.optional(v.literal(false), false) };
81
94
  const proposedTransferDestination = /* @__PURE__ */ v.variant("type", [
82
- v.strictObject({ ...transferAlias, editable: v.optional(v.literal(false), false) }),
83
- v.strictObject({ ...transferAccount, editable: v.optional(v.literal(false), false) }),
84
- v.strictObject({ ...transferExternal, editable: v.optional(v.boolean(), false) }),
95
+ v.strictObject({ ...transferAlias, ...lockedDestination }),
96
+ v.strictObject({ ...transferAccount, ...lockedDestination }),
97
+ v.strictObject({ ...transferExternal, ...lockedDestination }),
85
98
  ]);
86
99
  /** The display label a Cuenta Vista is opened with. Mutable afterwards, and read by no permission. */
87
100
  const accountName = /* @__PURE__ */ v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(80));
@@ -124,8 +137,8 @@ const common = {
124
137
  *
125
138
  * `transfer` is the only way money movement is expressed: money leaving an account towards a
126
139
  * `destination`, both named in the `bank_transfer` matcher vocabulary (`alias`, `account`,
127
- * `external`). A null `source` is the confirmation screen's source picker; `editable: false` locks
128
- * the destination there. Who may approve the Intent without a person belongs to the Grant, never to
140
+ * `external`). A null `source` is the confirmation screen's source picker; the amount and the
141
+ * destination are always locked there (`editable: true` is refused). Who may approve the Intent without a person belongs to the Grant, never to
129
142
  * the operation itself.
130
143
  *
131
144
  * @example
@@ -146,13 +159,13 @@ export const IntentCreateSchema = /* @__PURE__ */ v.pipe(v.variant("type", [
146
159
  ...common,
147
160
  type: v.literal("deposit"),
148
161
  destination: v.optional(andcoAccount),
149
- amount: v.optional(v.strictObject(proposedAmount)),
162
+ amount: v.optional(v.strictObject(depositAmount)),
150
163
  expires_at: v.optional(v.nullable(expiresAt)),
151
164
  }),
152
165
  v.strictObject({
153
166
  ...common,
154
167
  type: v.literal("transfer"),
155
- amount: v.strictObject(proposedAmount),
168
+ amount: v.strictObject(transferAmount),
156
169
  // Null or omitted: the person picks among the Grant's sources on the confirmation screen.
157
170
  source: v.optional(v.nullable(transferSource), null),
158
171
  destination: proposedTransferDestination,
@@ -314,6 +327,9 @@ export function unsupportedIntentPaymentShape(input) {
314
327
  *
315
328
  * Every member but `intent_id` is optional because nothing here is necessarily editable: a screen
316
329
  * sends only what the Intent left open, and a value that was frozen has nowhere to arrive from.
330
+ * A transfer is created with its amount and destination locked (`editable: true` is refused at
331
+ * creation), so today `amount` and `destination` always meet `transfer_value_editing_not_implemented`;
332
+ * they stay in the shape for when confirmation-time editing exists.
317
333
  */
318
334
  export const TransferConfirmationSchema = /* @__PURE__ */ v.strictObject({
319
335
  intent_id: accountId,
@@ -259,16 +259,16 @@ const COPY = {
259
259
  "Transfira para esta conta ou deposite de uma de suas contas Andco. Fechar esta tela não cancela o depósito.",
260
260
  "Transfiere a esta cuenta o abona desde una de tus cuentas Andco. Cerrar esta pantalla no cancela el depósito.",
261
261
  ],
262
- "Selecciona una Empresa": ["Choose a Company", "Selecione uma Empresa", "Selecciona una Empresa"],
263
- "Solo se muestran Empresas en las que puedes autorizar aplicaciones.": [
264
- "Only Companies where you can authorize applications are shown.",
265
- "São exibidas apenas Empresas nas quais você pode autorizar aplicativos.",
266
- "Solo se muestran Empresas en las que puedes autorizar aplicaciones.",
262
+ "Selecciona una Organización": ["Choose an Organization", "Selecione uma Organização", "Selecciona una Organización"],
263
+ "Solo se muestran Organizaciones en las que puedes autorizar aplicaciones.": [
264
+ "Only Organizations where you can authorize applications are shown.",
265
+ "São exibidas apenas Organizações nas quais você pode autorizar aplicativos.",
266
+ "Solo se muestran Organizaciones en las que puedes autorizar aplicaciones.",
267
267
  ],
268
- "Ya no tienes permiso para autorizar esta conexión. Revisa el acceso a la Empresa e inténtalo nuevamente.": [
269
- "You can no longer authorize this connection. Check your Company access and try again.",
270
- "Você não pode mais autorizar esta conexão. Confira seu acesso à Empresa e tente novamente.",
271
- "Ya no tienes permiso para autorizar esta conexión. Revisa el acceso a la Empresa e inténtalo nuevamente.",
268
+ "Ya no tienes permiso para autorizar esta conexión. Revisa el acceso a la Organización e inténtalo nuevamente.": [
269
+ "You can no longer authorize this connection. Check your Organization access and try again.",
270
+ "Você não pode mais autorizar esta conexão. Confira seu acesso à Organização e tente novamente.",
271
+ "Ya no tienes permiso para autorizar esta conexión. Revisa el acceso a la Organización e inténtalo nuevamente.",
272
272
  ],
273
273
  "Cuenta autorizada": ["Authorized account", "Conta autorizada", "Cuenta autorizada"],
274
274
  "Elige la cuenta exacta. La Miniapp no tendrá acceso a tus demás cuentas.": [
@@ -279,13 +279,29 @@ const COPY = {
279
279
  "Esta Miniapp podrá": ["This Miniapp will be able to", "Esta Miniapp poderá", "Esta Miniapp podrá"],
280
280
  "Sin número visible": ["No visible number", "Sem número visível", "Sin número visible"],
281
281
  Requerido: ["Required", "Obrigatório", "Requerido"],
282
+ "Compartir con {{name}}": ["Share with {{name}}", "Compartilhar com {{name}}", "Compartir con {{name}}"],
283
+ "Opcional: puedes autorizar sin este proveedor.": [
284
+ "Optional: you can authorize without this provider.",
285
+ "Opcional: você pode autorizar sem este provedor.",
286
+ "Opcional: puedes autorizar sin este proveedor.",
287
+ ],
288
+ "No se compartirá nada con {{name}}.": [
289
+ "Nothing will be shared with {{name}}.",
290
+ "Nada será compartilhado com {{name}}.",
291
+ "No se compartirá nada con {{name}}.",
292
+ ],
293
+ "Requerido: la aplicación necesita todos estos permisos.": [
294
+ "Required: the application needs all of these permissions.",
295
+ "Obrigatório: o aplicativo precisa de todas estas permissões.",
296
+ "Requerido: la aplicación necesita todos estos permisos.",
297
+ ],
282
298
  Preseleccionado: ["Preselected", "Pré-selecionado", "Preseleccionado"],
283
299
  Opcional: ["Optional", "Opcional", "Opcional"],
284
300
  "Concedido el {{date}}": ["Granted on {{date}}", "Concedido em {{date}}", "Concedido el {{date}}"],
285
- "Concedido por tu Empresa el {{date}}": [
286
- "Granted by your Company on {{date}}",
287
- "Concedido pela sua Empresa em {{date}}",
288
- "Concedido por tu Empresa el {{date}}",
301
+ "Concedido por tu Organización el {{date}}": [
302
+ "Granted by your Organization on {{date}}",
303
+ "Concedido pela sua Organização em {{date}}",
304
+ "Concedido por tu Organización el {{date}}",
289
305
  ],
290
306
  REQUERIDO: ["REQUIRED", "OBRIGATÓRIO", "REQUERIDO"],
291
307
  PRESELECCIONADO: ["PRESELECTED", "PRÉ-SELECIONADO", "PRESELECCIONADO"],
@@ -312,7 +328,11 @@ const COPY = {
312
328
  "Compartir información con {{project}}",
313
329
  ],
314
330
  "Autorizar a {{project}}": ["Authorize {{project}}", "Autorizar {{project}}", "Autorizar a {{project}}"],
315
- "Empresa: {{company}}": ["Company: {{company}}", "Empresa: {{company}}", "Empresa: {{company}}"],
331
+ "Organización: {{organization}}": [
332
+ "Organization: {{organization}}",
333
+ "Organización: {{organization}}",
334
+ "Organización: {{organization}}",
335
+ ],
316
336
  "Cuenta Andco: {{email}}": ["Andco account: {{email}}", "Conta Andco: {{email}}", "Cuenta Andco: {{email}}"],
317
337
  "Retorno: {{host}}": ["Return to: {{host}}", "Retorno: {{host}}", "Retorno: {{host}}"],
318
338
  "Vence en {{seconds}} segundos": [
@@ -330,10 +350,10 @@ const COPY = {
330
350
  "Selecione entre {{min}} e {{max}} contas.",
331
351
  "Selecciona entre {{min}} y {{max}} cuentas.",
332
352
  ],
333
- "Autorizar a {{project}} en nombre de esta Empresa.": [
334
- "Authorize {{project}} on behalf of this Company.",
335
- "Autorizar {{project}} em nome desta Empresa.",
336
- "Autorizar a {{project}} en nombre de esta Empresa.",
353
+ "Autorizar a {{project}} en nombre de esta Organización.": [
354
+ "Authorize {{project}} on behalf of this Organization.",
355
+ "Autorizar {{project}} em nome desta Organização.",
356
+ "Autorizar a {{project}} en nombre de esta Organización.",
337
357
  ],
338
358
  "Consultar el saldo y los datos públicos de esta cuenta.": [
339
359
  "Read this account’s balance and public details.",
@@ -345,7 +345,7 @@ export interface paths {
345
345
  };
346
346
  /**
347
347
  * List one account's transactions
348
- * @description Answers with the same cursor page the account's statement presentation reads, so an integrator sees exactly the transactions a person would see. Granted by a `bank_transaction` authorization detail with `read` whose `accounts` reach this account.
348
+ * @description Answers the transactions the account's statement presentation reads, so an integrator sees exactly what a person would see, one page at a time in the same shape as `GET /accounts`: feed `next_cursor` back as `?after=` while `has_more`. Granted by a `bank_transaction` authorization detail with `read` whose `accounts` reach this account.
349
349
  */
350
350
  get: operations["listAccountTransactions"];
351
351
  put?: never;
@@ -526,6 +526,8 @@ export interface components {
526
526
  /** @description RAR type the Grant has to cover for this operation, on `insufficient_authorization`. */
527
527
  required_type?: string;
528
528
  required_action?: string;
529
+ /** @description The path parameter that is not well formed, on `invalid_identifier`. */
530
+ parameter?: string;
529
531
  code?: string;
530
532
  message?: string;
531
533
  };
@@ -722,7 +724,8 @@ export interface components {
722
724
  /** @description A cursor page of accounts, in the same opaque-cursor shape as `FinancialEventPage`: `next_cursor` is only ever fed back as `?after=`, never parsed by the caller. */
723
725
  AccountPage: {
724
726
  data: components["schemas"]["BankAccount"][];
725
- next_cursor: string;
727
+ /** @description Feed back as `?after=` while `has_more`; never parse it. */
728
+ next_cursor: string | null;
726
729
  has_more: boolean;
727
730
  };
728
731
  /** @description One account transaction, newest first. Keys are camelCase because this schema describes the wire shape the server actually sends here, which differs from the snake_case used by the rest of this contract -- the route answers with its existing internal projection rather than a bespoke public representation. */
@@ -743,10 +746,11 @@ export interface components {
743
746
  reversed: boolean;
744
747
  note: string | null;
745
748
  };
749
+ /** @description A page of one account's transactions, newest first, in the shape of `AccountPage`: `next_cursor` is only ever fed back as `?after=`, and is `null` once `has_more` is false. */
746
750
  BankTransactionPage: {
747
751
  data: components["schemas"]["BankTransaction"][];
748
- nextCursor: string | null;
749
- pageSize: number;
752
+ next_cursor: string | null;
753
+ has_more: boolean;
750
754
  };
751
755
  /** @description The monetary scalar, defined once. It travels as a string because CLP has no minor unit and an exact peso amount does not survive a JSON number. Every envelope carries it as `value`: what a request or a Signed Instruction asks for, what an Intent was asked for, and what a transfer actually moved (`settled.value`). */
752
756
  MonetaryValue: string;
@@ -780,7 +784,7 @@ export interface components {
780
784
  IntentAccount: components["schemas"]["IntentAccountAlias"] | components["schemas"]["IntentAccountId"];
781
785
  /** @description Where a signed transfer's money lands, in the `bank_transfer` matcher vocabulary: an Andco account by Alias or identifier, or an account at another Chilean bank. */
782
786
  TransferDestination: components["schemas"]["IntentAccountAlias"] | components["schemas"]["IntentAccountId"] | components["schemas"]["IntentAccountExternal"];
783
- /** @description Where a proposed transfer's money lands, in the request and in the answered Intent alike. `editable: false` locks it on the confirmation screen. Only an account at another bank can be editable, because an Andco account named by Alias or identifier already denotes exactly one account. Defaults to false in a request; an answered Intent always states it. */
787
+ /** @description Where a proposed transfer's money lands, in the request and in the answered Intent alike. It is always locked on the confirmation screen: `editable` only admits `false`, because redirecting a transfer at confirmation is not implemented yet, and `editable: true` fails at creation with `invalid_request`. Defaults to false in a request; an answered Intent always states it. */
784
788
  TransferDestinationProposal: {
785
789
  /** @constant */
786
790
  type: "alias";
@@ -803,9 +807,10 @@ export interface components {
803
807
  account_id: string;
804
808
  holder_id: string;
805
809
  holder_name: string;
806
- editable?: boolean;
810
+ /** @constant */
811
+ editable?: false;
807
812
  };
808
- /** @description The amount a request asks for. `editable: true` lets the person who confirms change it on the screen. It is never what moved: a transfer answers that in `settled`, a deposit in `progress.credited`. */
813
+ /** @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`. */
809
814
  IntentAmount: {
810
815
  /** @constant */
811
816
  currency: "CLP";
@@ -813,13 +818,24 @@ export interface components {
813
818
  /** @description Defaults to false when omitted. */
814
819
  editable?: boolean;
815
820
  };
821
+ /** @description The amount a transfer proposes. `editable` only admits `false`: changing what a transfer moves at confirmation is not implemented yet, so `editable: true` fails at creation with `invalid_request` instead of leaving an Intent nobody can confirm. What moved is `settled`. */
822
+ TransferAmountProposal: {
823
+ /** @constant */
824
+ currency: "CLP";
825
+ value: components["schemas"]["MonetaryValue"];
826
+ /**
827
+ * @description Defaults to false when omitted.
828
+ * @constant
829
+ */
830
+ editable?: false;
831
+ };
816
832
  /** @description The amount a Signed Instruction orders: the same `{ currency, value }` as a request, with nothing left for a person to change. */
817
833
  SignedAmount: {
818
834
  /** @constant */
819
835
  currency: "CLP";
820
836
  value: components["schemas"]["MonetaryValue"];
821
837
  };
822
- /** @description The amount a transfer orders, as it is answered: the request's `value`, or the person's correction once confirmed when `editable` is true. It is never proof that money moved; read `settled` for that. */
838
+ /** @description The amount a transfer orders, as it is answered: the request's `value`. `editable` is always false while confirmation-time editing is not implemented. It is never proof that money moved; read `settled` for that. */
823
839
  TransferAmount: {
824
840
  /** @constant */
825
841
  currency: "CLP";
@@ -1005,7 +1021,7 @@ export interface components {
1005
1021
  /** Format: uri */
1006
1022
  authorization_url: string;
1007
1023
  };
1008
- /** @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; `editable: false` locks the destination there. 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. */
1024
+ /** @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; the amount and the destination are always locked there (`editable: true` is an `invalid_request`). 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. */
1009
1025
  TransferIntentCreate: {
1010
1026
  /** @description Positive fixed duration, anchored once when the operation is first created. */
1011
1027
  expires_in?: string;
@@ -1019,7 +1035,7 @@ export interface components {
1019
1035
  /** @description The Andco account the money leaves. Null leaves that choice to a person on a screen. */
1020
1036
  source?: null | components["schemas"]["IntentAccount"];
1021
1037
  destination: components["schemas"]["TransferDestinationProposal"];
1022
- amount: components["schemas"]["IntentAmount"];
1038
+ amount: components["schemas"]["TransferAmountProposal"];
1023
1039
  note?: components["schemas"]["IntentNote"];
1024
1040
  metadata?: {
1025
1041
  [key: string]: unknown;
@@ -1259,7 +1275,7 @@ export interface components {
1259
1275
  "application/json": components["schemas"]["ApiError"];
1260
1276
  };
1261
1277
  };
1262
- /** @description The request body or headers are invalid */
1278
+ /** @description The request body, query or headers are invalid (`invalid_request`), or an identifier in the path is not well formed (`invalid_identifier`, with `parameter` naming it). A malformed identifier is refused before authorization and never answers `not_found`. */
1263
1279
  InvalidRequest: {
1264
1280
  headers: {
1265
1281
  [name: string]: unknown;
@@ -1624,6 +1640,7 @@ export interface operations {
1624
1640
  "application/json": components["schemas"]["OrganizationPage"];
1625
1641
  };
1626
1642
  };
1643
+ 400: components["responses"]["InvalidRequest"];
1627
1644
  401: components["responses"]["InvalidToken"];
1628
1645
  403: components["responses"]["Forbidden"];
1629
1646
  404: components["responses"]["UnsupportedVersion"];
@@ -1651,6 +1668,7 @@ export interface operations {
1651
1668
  "application/json": components["schemas"]["OrganizationIdentityPage"];
1652
1669
  };
1653
1670
  };
1671
+ 400: components["responses"]["InvalidRequest"];
1654
1672
  401: components["responses"]["InvalidToken"];
1655
1673
  403: components["responses"]["Forbidden"];
1656
1674
  404: components["responses"]["NotFound"];
@@ -1905,7 +1923,9 @@ export interface operations {
1905
1923
  listAccountTransactions: {
1906
1924
  parameters: {
1907
1925
  query?: {
1908
- cursor?: string;
1926
+ /** @description Opaque cursor from a previous page's `next_cursor`. Omit for the first page. */
1927
+ after?: string;
1928
+ limit?: number;
1909
1929
  };
1910
1930
  header?: never;
1911
1931
  path: {
@@ -1980,6 +2000,7 @@ export interface operations {
1980
2000
  "application/json": components["schemas"]["DepositIntent"] | components["schemas"]["TransferIntent"] | components["schemas"]["AccountOpeningIntent"] | components["schemas"]["AccountClosureIntent"];
1981
2001
  };
1982
2002
  };
2003
+ 400: components["responses"]["InvalidRequest"];
1983
2004
  401: components["responses"]["InvalidToken"];
1984
2005
  403: components["responses"]["Forbidden"];
1985
2006
  404: components["responses"]["NotFound"];
@@ -2006,6 +2027,7 @@ export interface operations {
2006
2027
  "application/json": components["schemas"]["DepositCloseResult"];
2007
2028
  };
2008
2029
  };
2030
+ 400: components["responses"]["InvalidRequest"];
2009
2031
  401: components["responses"]["InvalidToken"];
2010
2032
  403: components["responses"]["Forbidden"];
2011
2033
  404: components["responses"]["NotFound"];
@@ -2033,6 +2055,7 @@ export interface operations {
2033
2055
  "application/json": components["schemas"]["DepositIntent"] | components["schemas"]["TransferIntent"] | components["schemas"]["AccountOpeningIntent"] | components["schemas"]["AccountClosureIntent"];
2034
2056
  };
2035
2057
  };
2058
+ 400: components["responses"]["InvalidRequest"];
2036
2059
  401: components["responses"]["InvalidToken"];
2037
2060
  403: components["responses"]["Forbidden"];
2038
2061
  404: components["responses"]["NotFound"];