@andco/protocol 0.1.0-ti.0 → 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/rar/bank.d.ts +12 -12
- package/dist/rar/bank.d.ts.map +1 -1
- package/dist/rar/bank.js +13 -13
- package/dist/rar/catalog.d.ts +4 -4
- package/dist/rar/catalog.d.ts.map +1 -1
- package/dist/rar/catalog.js +6 -6
- package/dist/rar/json-schemas.generated.js +3 -3
- package/dist/rar/money.d.ts +1 -1
- package/dist/rar/money.js +1 -1
- package/dist/rest/accounts.d.ts +66 -44
- package/dist/rest/accounts.d.ts.map +1 -1
- package/dist/rest/accounts.js +31 -21
- package/dist/rest/contract.d.ts +20 -14
- package/dist/rest/contract.d.ts.map +1 -1
- package/dist/rest/contract.js +4 -4
- package/dist/rest/events.js +1 -1
- package/dist/rest/intents.js +1 -1
- package/dist/transport/financial-events.d.ts +1 -1
- package/dist/transport/generated/oauth-api.d.ts +32 -22
- package/dist/transport/generated/oauth-api.d.ts.map +1 -1
- package/dist/transport/rest.d.ts +5 -4
- package/dist/transport/rest.d.ts.map +1 -1
- package/dist/transport/rest.js +1 -1
- package/package.json +1 -1
package/dist/rar/bank.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export declare const BANK_ACCOUNT_MANAGE_ACTIONS: readonly ["create", "close"];
|
|
|
8
8
|
export declare const BANK_ACCOUNT_APPROVAL_ACTIONS: readonly ["approve", "reject"];
|
|
9
9
|
/** Every `bank_account` action, across its three forms. */
|
|
10
10
|
export declare const BANK_ACCOUNT_ACTIONS: readonly ["read", "read_balance", "create", "close", "approve", "reject"];
|
|
11
|
-
/** Reading the
|
|
12
|
-
export declare const
|
|
11
|
+
/** Reading the Movements of accounts. */
|
|
12
|
+
export declare const BANK_MOVEMENT_ACTIONS: readonly ["read"];
|
|
13
13
|
/** Proposing Transfers within the detail's bounds. */
|
|
14
14
|
export declare const BANK_TRANSFER_CREATE_ACTIONS: readonly ["create"];
|
|
15
15
|
/** Reading every Transfer that leaves the accounts of `accounts`, whoever made it and in any status. */
|
|
@@ -316,20 +316,20 @@ export declare const BankAccountGrantSchema: v.UnionSchema<[v.StrictObjectSchema
|
|
|
316
316
|
}, undefined>], undefined>;
|
|
317
317
|
export type BankAccountGrant = v.InferOutput<typeof BankAccountGrantSchema>;
|
|
318
318
|
/**
|
|
319
|
-
* `
|
|
319
|
+
* `bank_movement` Grant Request: read the Movements of `accounts` (absent means every own
|
|
320
320
|
* account).
|
|
321
321
|
*
|
|
322
322
|
* @example
|
|
323
|
-
* const statement:
|
|
324
|
-
* type: "
|
|
323
|
+
* const statement: BankMovementGrantRequest = {
|
|
324
|
+
* type: "bank_movement",
|
|
325
325
|
* actions: ["read"],
|
|
326
326
|
* locations: ["https://api.andco.com"],
|
|
327
327
|
* subject: { type: "profile" },
|
|
328
328
|
* accounts: [{ type: "any", limit: "own" }],
|
|
329
329
|
* };
|
|
330
330
|
*/
|
|
331
|
-
export declare const
|
|
332
|
-
readonly type: v.LiteralSchema<"
|
|
331
|
+
export declare const BankMovementGrantRequestSchema: v.StrictObjectSchema<{
|
|
332
|
+
readonly type: v.LiteralSchema<"bank_movement", undefined>;
|
|
333
333
|
readonly actions: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["read"], undefined>, undefined>, v.MinLengthAction<"read"[], 1, undefined>, v.MetadataAction<"read"[], {
|
|
334
334
|
readonly uniqueItems: true;
|
|
335
335
|
}>]>;
|
|
@@ -402,10 +402,10 @@ export declare const BankTransactionGrantRequestSchema: v.StrictObjectSchema<{
|
|
|
402
402
|
readonly uniqueItems: true;
|
|
403
403
|
}>]>, undefined>;
|
|
404
404
|
}, undefined>;
|
|
405
|
-
export type
|
|
406
|
-
/** `
|
|
407
|
-
export declare const
|
|
408
|
-
readonly type: v.LiteralSchema<"
|
|
405
|
+
export type BankMovementGrantRequest = v.InferInput<typeof BankMovementGrantRequestSchema>;
|
|
406
|
+
/** `bank_movement` Grant. */
|
|
407
|
+
export declare const BankMovementGrantSchema: v.StrictObjectSchema<{
|
|
408
|
+
readonly type: v.LiteralSchema<"bank_movement", undefined>;
|
|
409
409
|
readonly actions: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["read"], undefined>, undefined>, v.MinLengthAction<"read"[], 1, undefined>, v.MetadataAction<"read"[], {
|
|
410
410
|
readonly uniqueItems: true;
|
|
411
411
|
}>]>;
|
|
@@ -457,7 +457,7 @@ export declare const BankTransactionGrantSchema: v.StrictObjectSchema<{
|
|
|
457
457
|
readonly uniqueItems: true;
|
|
458
458
|
}>]>;
|
|
459
459
|
}, undefined>;
|
|
460
|
-
export type
|
|
460
|
+
export type BankMovementGrant = v.InferOutput<typeof BankMovementGrantSchema>;
|
|
461
461
|
/**
|
|
462
462
|
* `bank_transfer` Grant Request, create form: propose Transfers within explicit bounds.
|
|
463
463
|
*
|
package/dist/rar/bank.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bank.d.ts","sourceRoot":"","sources":["../../src/rar/bank.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAgB1C,0EAA0E;AAC1E,eAAO,MAAM,yBAAyB,mCAAoC,CAAC;AAC3E,qGAAqG;AACrG,eAAO,MAAM,2BAA2B,8BAA+B,CAAC;AACxE,+FAA+F;AAC/F,eAAO,MAAM,6BAA6B,gCAAiC,CAAC;AAC5E,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,2EAIvB,CAAC;AACX,
|
|
1
|
+
{"version":3,"file":"bank.d.ts","sourceRoot":"","sources":["../../src/rar/bank.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAgB1C,0EAA0E;AAC1E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BANK_ACCOUNT_ACTIONS = [
|
|
|
16
16
|
...BANK_ACCOUNT_MANAGE_ACTIONS,
|
|
17
17
|
...BANK_ACCOUNT_APPROVAL_ACTIONS,
|
|
18
18
|
];
|
|
19
|
-
/** Reading the
|
|
20
|
-
export const
|
|
19
|
+
/** Reading the Movements of accounts. */
|
|
20
|
+
export const BANK_MOVEMENT_ACTIONS = ["read"];
|
|
21
21
|
/** Proposing Transfers within the detail's bounds. */
|
|
22
22
|
export const BANK_TRANSFER_CREATE_ACTIONS = ["create"];
|
|
23
23
|
/** Reading every Transfer that leaves the accounts of `accounts`, whoever made it and in any status. */
|
|
@@ -175,31 +175,31 @@ export const BankAccountGrantSchema = /* @__PURE__ */ v.union([
|
|
|
175
175
|
subject: GrantedSubjectSchema,
|
|
176
176
|
}),
|
|
177
177
|
]);
|
|
178
|
-
// --
|
|
178
|
+
// -- bank_movement ------------------------------------------------------------------------------
|
|
179
179
|
/**
|
|
180
|
-
* `
|
|
180
|
+
* `bank_movement` Grant Request: read the Movements of `accounts` (absent means every own
|
|
181
181
|
* account).
|
|
182
182
|
*
|
|
183
183
|
* @example
|
|
184
|
-
* const statement:
|
|
185
|
-
* type: "
|
|
184
|
+
* const statement: BankMovementGrantRequest = {
|
|
185
|
+
* type: "bank_movement",
|
|
186
186
|
* actions: ["read"],
|
|
187
187
|
* locations: ["https://api.andco.com"],
|
|
188
188
|
* subject: { type: "profile" },
|
|
189
189
|
* accounts: [{ type: "any", limit: "own" }],
|
|
190
190
|
* };
|
|
191
191
|
*/
|
|
192
|
-
export const
|
|
193
|
-
type: v.literal("
|
|
194
|
-
actions: actionSet(
|
|
192
|
+
export const BankMovementGrantRequestSchema = /* @__PURE__ */ v.strictObject({
|
|
193
|
+
type: v.literal("bank_movement"),
|
|
194
|
+
actions: actionSet(BANK_MOVEMENT_ACTIONS),
|
|
195
195
|
locations: AndcoRarLocationsSchema,
|
|
196
196
|
subject: SubjectPickerSchema,
|
|
197
197
|
accounts: v.nullish(ownList),
|
|
198
198
|
});
|
|
199
|
-
/** `
|
|
200
|
-
export const
|
|
201
|
-
type: v.literal("
|
|
202
|
-
actions: actionSet(
|
|
199
|
+
/** `bank_movement` Grant. */
|
|
200
|
+
export const BankMovementGrantSchema = /* @__PURE__ */ v.strictObject({
|
|
201
|
+
type: v.literal("bank_movement"),
|
|
202
|
+
actions: actionSet(BANK_MOVEMENT_ACTIONS),
|
|
203
203
|
locations: AndcoRarLocationsSchema,
|
|
204
204
|
subject: GrantedSubjectSchema,
|
|
205
205
|
accounts: grantedOwnList,
|
package/dist/rar/catalog.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as v from "valibot";
|
|
|
2
2
|
import { ErrorExtendable } from "../errors.js";
|
|
3
3
|
import { type Issue } from "../issues.js";
|
|
4
4
|
/** Every authorization detail type AndCo's Resource Server implements. */
|
|
5
|
-
export declare const ANDCO_RAR_TYPES: readonly ["bank_account", "
|
|
5
|
+
export declare const ANDCO_RAR_TYPES: readonly ["bank_account", "bank_movement", "bank_transfer", "bank_deposit", "identity", "address", "organization", "profile", "project_users"];
|
|
6
6
|
export type AndcoRarType = (typeof ANDCO_RAR_TYPES)[number];
|
|
7
7
|
/**
|
|
8
8
|
* Types that belong to the model but are not built yet. A detail naming one is rejected with
|
|
@@ -260,10 +260,10 @@ export declare const ANDCO_RAR_CATALOG: {
|
|
|
260
260
|
}, undefined>], undefined>;
|
|
261
261
|
}, undefined>], undefined>;
|
|
262
262
|
};
|
|
263
|
-
readonly
|
|
263
|
+
readonly bank_movement: {
|
|
264
264
|
readonly actions: readonly ["read"];
|
|
265
265
|
readonly grantRequest: v.StrictObjectSchema<{
|
|
266
|
-
readonly type: v.LiteralSchema<"
|
|
266
|
+
readonly type: v.LiteralSchema<"bank_movement", undefined>;
|
|
267
267
|
readonly actions: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["read"], undefined>, undefined>, v.MinLengthAction<"read"[], 1, undefined>, v.MetadataAction<"read"[], {
|
|
268
268
|
readonly uniqueItems: true;
|
|
269
269
|
}>]>;
|
|
@@ -337,7 +337,7 @@ export declare const ANDCO_RAR_CATALOG: {
|
|
|
337
337
|
}>]>, undefined>;
|
|
338
338
|
}, undefined>;
|
|
339
339
|
readonly grant: v.StrictObjectSchema<{
|
|
340
|
-
readonly type: v.LiteralSchema<"
|
|
340
|
+
readonly type: v.LiteralSchema<"bank_movement", undefined>;
|
|
341
341
|
readonly actions: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["read"], undefined>, undefined>, v.MinLengthAction<"read"[], 1, undefined>, v.MetadataAction<"read"[], {
|
|
342
342
|
readonly uniqueItems: true;
|
|
343
343
|
}>]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/rar/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,KAAK,KAAK,EAAsB,MAAM,cAAc,CAAC;AAwC9D,0EAA0E;AAC1E,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/rar/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,KAAK,KAAK,EAAsB,MAAM,cAAc,CAAC;AAwC9D,0EAA0E;AAC1E,eAAO,MAAM,eAAe,gJAUlB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,wBAAwB,uDAAwD,CAAC;AAC9F,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;A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AAG,iBAAiB,CAAC;AAEtE;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,eAAe;IAChD,SAAgB,IAAI,EAAE,iBAAiB,CAAC;IACxC,SAAgB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,SAAgB,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;gBAGvC,IAAI,EAAE,iBAAiB,EACvB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,MAAM,GAAE,SAAS,KAAK,EAAO,EAC7B,OAAO,CAAC,EAAE,YAAY;CAOzB;AAED,wDAAwD;AACxD,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,YAAY,CAElE;AAED,iEAAiE;AACjE,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,oBAAoB,CAElF;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,IAAI,UAAU,CAEpF;AA+BD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,iBAAiB,GAAG,UAAU,GAAG,KAAK,EAAE,CAsB9E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,iBAAiB,CAEzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,UAAU,CAE3D"}
|
package/dist/rar/catalog.js
CHANGED
|
@@ -2,7 +2,7 @@ import * as v from "valibot";
|
|
|
2
2
|
import { ErrorExtendable } from "../errors.js";
|
|
3
3
|
import { issuesAt, issuesOf } from "../issues.js";
|
|
4
4
|
import { accountMatcherListIssues } from "./account-matchers.js";
|
|
5
|
-
import { amountRangeIssues, BANK_ACCOUNT_ACTIONS, BANK_DEPOSIT_ACTIONS,
|
|
5
|
+
import { amountRangeIssues, BANK_ACCOUNT_ACTIONS, BANK_DEPOSIT_ACTIONS, BANK_MOVEMENT_ACTIONS, BANK_TRANSFER_ACTIONS, BankAccountGrantRequestSchema, BankAccountGrantSchema, BankDepositGrantRequestSchema, BankDepositGrantSchema, BankMovementGrantRequestSchema, BankMovementGrantSchema, BankTransferGrantRequestSchema, BankTransferGrantSchema, } from "./bank.js";
|
|
6
6
|
import { actionSetIssues } from "./detail.js";
|
|
7
7
|
import { PROJECT_USERS_ACTIONS, ProjectUsersGrantRequestSchema, ProjectUsersGrantSchema, projectUsersIssues, } from "./project-users.js";
|
|
8
8
|
import { subjectIssues } from "./subject.js";
|
|
@@ -10,7 +10,7 @@ import { ADDRESS_ACTIONS, AddressGrantRequestSchema, AddressGrantSchema, IDENTIT
|
|
|
10
10
|
/** Every authorization detail type AndCo's Resource Server implements. */
|
|
11
11
|
export const ANDCO_RAR_TYPES = [
|
|
12
12
|
"bank_account",
|
|
13
|
-
"
|
|
13
|
+
"bank_movement",
|
|
14
14
|
"bank_transfer",
|
|
15
15
|
"bank_deposit",
|
|
16
16
|
"identity",
|
|
@@ -40,10 +40,10 @@ export const ANDCO_RAR_CATALOG = {
|
|
|
40
40
|
grantRequest: BankAccountGrantRequestSchema,
|
|
41
41
|
grant: BankAccountGrantSchema,
|
|
42
42
|
},
|
|
43
|
-
|
|
44
|
-
actions:
|
|
45
|
-
grantRequest:
|
|
46
|
-
grant:
|
|
43
|
+
bank_movement: {
|
|
44
|
+
actions: BANK_MOVEMENT_ACTIONS,
|
|
45
|
+
grantRequest: BankMovementGrantRequestSchema,
|
|
46
|
+
grant: BankMovementGrantSchema,
|
|
47
47
|
},
|
|
48
48
|
bank_transfer: {
|
|
49
49
|
actions: BANK_TRANSFER_ACTIONS,
|
|
@@ -802,12 +802,12 @@ export const ANDCO_RAR_JSON_SCHEMAS = {
|
|
|
802
802
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
803
803
|
}
|
|
804
804
|
},
|
|
805
|
-
"
|
|
805
|
+
"bank_movement": {
|
|
806
806
|
"grantRequest": {
|
|
807
807
|
"type": "object",
|
|
808
808
|
"properties": {
|
|
809
809
|
"type": {
|
|
810
|
-
"const": "
|
|
810
|
+
"const": "bank_movement"
|
|
811
811
|
},
|
|
812
812
|
"actions": {
|
|
813
813
|
"type": "array",
|
|
@@ -1041,7 +1041,7 @@ export const ANDCO_RAR_JSON_SCHEMAS = {
|
|
|
1041
1041
|
"type": "object",
|
|
1042
1042
|
"properties": {
|
|
1043
1043
|
"type": {
|
|
1044
|
-
"const": "
|
|
1044
|
+
"const": "bank_movement"
|
|
1045
1045
|
},
|
|
1046
1046
|
"actions": {
|
|
1047
1047
|
"type": "array",
|
package/dist/rar/money.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare const MINIMUM_TRANSACTION_AMOUNT = "1000";
|
|
|
40
40
|
/**
|
|
41
41
|
* {@link MONEY_PATTERN} restricted to amounts of at least {@link MINIMUM_TRANSACTION_AMOUNT}: four to
|
|
42
42
|
* fifteen digits without a leading zero. It is a separate scalar, not a change to `MONEY_PATTERN`,
|
|
43
|
-
* because only the limits of a permission carry the floor; a
|
|
43
|
+
* because only the limits of a permission carry the floor; a Movement read back from an account
|
|
44
44
|
* may be smaller.
|
|
45
45
|
*
|
|
46
46
|
* The floor lives in the regex, rather than in a numeric comparison, because the generated JSON
|
package/dist/rar/money.js
CHANGED
|
@@ -38,7 +38,7 @@ export const MINIMUM_TRANSACTION_AMOUNT = "1000";
|
|
|
38
38
|
/**
|
|
39
39
|
* {@link MONEY_PATTERN} restricted to amounts of at least {@link MINIMUM_TRANSACTION_AMOUNT}: four to
|
|
40
40
|
* fifteen digits without a leading zero. It is a separate scalar, not a change to `MONEY_PATTERN`,
|
|
41
|
-
* because only the limits of a permission carry the floor; a
|
|
41
|
+
* because only the limits of a permission carry the floor; a Movement read back from an account
|
|
42
42
|
* may be smaller.
|
|
43
43
|
*
|
|
44
44
|
* The floor lives in the regex, rather than in a numeric comparison, because the generated JSON
|
package/dist/rest/accounts.d.ts
CHANGED
|
@@ -117,7 +117,7 @@ declare const InvalidCursor_base: (abstract new (data: {}, message?: string, hin
|
|
|
117
117
|
};
|
|
118
118
|
};
|
|
119
119
|
/**
|
|
120
|
-
* The `after` of the
|
|
120
|
+
* The `after` of the movements walk is not the cursor AndCo issued for the next page. The
|
|
121
121
|
* AndCo's cursor travels untouched: take it from `pageInfo.endCursor` and nothing else.
|
|
122
122
|
*/
|
|
123
123
|
export declare class InvalidCursor extends /* @__PURE__ */ InvalidCursor_base {
|
|
@@ -176,41 +176,54 @@ export declare const AccountPage: v.SchemaWithPipe<readonly [v.StrictObjectSchem
|
|
|
176
176
|
};
|
|
177
177
|
}, string>]>;
|
|
178
178
|
/**
|
|
179
|
-
* One account
|
|
180
|
-
*
|
|
181
|
-
*
|
|
179
|
+
* One Movement of an account: a credit or a debit, as AndCo reports it. The node is a closed list of
|
|
180
|
+
* fields with the names AndCo gives them, in snake_case: nothing else leaves the API, and a camelCase
|
|
181
|
+
* node or a field outside the list is refused. "Transaction" means only a ledger id, `transaction_id`.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* const movement: Movement = {
|
|
185
|
+
* object: "movement", id, transaction_id: "88213", description: "Transferencia", amount: 500000,
|
|
186
|
+
* currency: "CLP", movement_type: "withdrawal", movement_origin: null, movement_date,
|
|
187
|
+
* running_balance: 1200000, payment_type: null, reversed: false, note: null, transfer_id,
|
|
188
|
+
* };
|
|
182
189
|
*/
|
|
183
|
-
export declare const
|
|
190
|
+
export declare const Movement: v.StrictObjectSchema<{
|
|
191
|
+
readonly object: v.LiteralSchema<"movement", undefined>;
|
|
184
192
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
185
|
-
readonly
|
|
193
|
+
readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the transaction that posted this Movement, or null when AndCo has none. A Transfer that succeeded carries the same id of its debit.">]>;
|
|
186
194
|
readonly description: v.StringSchema<undefined>;
|
|
187
|
-
readonly amount: v.SchemaWithPipe<readonly [v.
|
|
188
|
-
readonly
|
|
189
|
-
readonly
|
|
190
|
-
readonly
|
|
191
|
-
readonly
|
|
192
|
-
readonly
|
|
195
|
+
readonly amount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>, v.DescriptionAction<number, "A positive integer in whole pesos (CLP). What tells an inflow from an outflow is `movement_type`, not a sign.">]>;
|
|
196
|
+
readonly currency: v.SchemaWithPipe<readonly [v.LiteralSchema<"CLP", undefined>, v.DescriptionAction<"CLP", "The currency of the account: a permission never assumes it, so the node names it.">]>;
|
|
197
|
+
readonly movement_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["deposit", "interest", "withdrawal"], undefined>, v.DescriptionAction<"deposit" | "interest" | "withdrawal", "The kind of Movement, in AndCo's own words. `deposit` and `interest` bring money into this account and raise its balance; `withdrawal` takes money out and lowers it. `amount` is always positive, so `movement_type` is what tells an inflow from an outflow.">]>;
|
|
198
|
+
readonly movement_origin: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
199
|
+
readonly movement_date: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
200
|
+
readonly running_balance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, number, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>, v.DescriptionAction<number | null, "The balance after this Movement, an integer in whole pesos, or null when AndCo did not send one: it is never made up. Real balances do go negative, so the sign is not narrowed away.">]>;
|
|
201
|
+
readonly payment_type: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
193
202
|
readonly reversed: v.BooleanSchema<undefined>;
|
|
194
203
|
readonly note: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
204
|
+
readonly transfer_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The id of the Transfer that this debit belongs to, only when the Grant may read that Transfer: one this client created for the same subject, or any Transfer of an account that a `bank_transfer` `read` detail covers. Always present. A null never means that no Transfer exists: it means no Transfer that this Grant may read, and it is also null for a credit, for a Movement without a `transaction_id` and for one that AndCo has posted before AndCo recorded the Transfer, which fills on a later read.">]>;
|
|
195
205
|
}, undefined>;
|
|
196
|
-
/** One
|
|
197
|
-
export type
|
|
198
|
-
/** A page of one account's
|
|
199
|
-
export declare const
|
|
206
|
+
/** One Movement of an account. */
|
|
207
|
+
export type Movement = v.InferOutput<typeof Movement>;
|
|
208
|
+
/** A page of one account's Movements, read live from the bank. */
|
|
209
|
+
export declare const MovementPage: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
200
210
|
readonly edges: v.ArraySchema<v.StrictObjectSchema<{
|
|
201
211
|
readonly cursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
202
212
|
readonly node: v.StrictObjectSchema<{
|
|
213
|
+
readonly object: v.LiteralSchema<"movement", undefined>;
|
|
203
214
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
204
|
-
readonly
|
|
215
|
+
readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the transaction that posted this Movement, or null when AndCo has none. A Transfer that succeeded carries the same id of its debit.">]>;
|
|
205
216
|
readonly description: v.StringSchema<undefined>;
|
|
206
|
-
readonly amount: v.SchemaWithPipe<readonly [v.
|
|
207
|
-
readonly
|
|
208
|
-
readonly
|
|
209
|
-
readonly
|
|
210
|
-
readonly
|
|
211
|
-
readonly
|
|
217
|
+
readonly amount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>, v.DescriptionAction<number, "A positive integer in whole pesos (CLP). What tells an inflow from an outflow is `movement_type`, not a sign.">]>;
|
|
218
|
+
readonly currency: v.SchemaWithPipe<readonly [v.LiteralSchema<"CLP", undefined>, v.DescriptionAction<"CLP", "The currency of the account: a permission never assumes it, so the node names it.">]>;
|
|
219
|
+
readonly movement_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["deposit", "interest", "withdrawal"], undefined>, v.DescriptionAction<"deposit" | "interest" | "withdrawal", "The kind of Movement, in AndCo's own words. `deposit` and `interest` bring money into this account and raise its balance; `withdrawal` takes money out and lowers it. `amount` is always positive, so `movement_type` is what tells an inflow from an outflow.">]>;
|
|
220
|
+
readonly movement_origin: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
221
|
+
readonly movement_date: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
222
|
+
readonly running_balance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, number, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>, v.DescriptionAction<number | null, "The balance after this Movement, an integer in whole pesos, or null when AndCo did not send one: it is never made up. Real balances do go negative, so the sign is not narrowed away.">]>;
|
|
223
|
+
readonly payment_type: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
212
224
|
readonly reversed: v.BooleanSchema<undefined>;
|
|
213
225
|
readonly note: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
226
|
+
readonly transfer_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The id of the Transfer that this debit belongs to, only when the Grant may read that Transfer: one this client created for the same subject, or any Transfer of an account that a `bank_transfer` `read` detail covers. Always present. A null never means that no Transfer exists: it means no Transfer that this Grant may read, and it is also null for a credit, for a Movement without a `transaction_id` and for one that AndCo has posted before AndCo recorded the Transfer, which fills on a later read.">]>;
|
|
214
227
|
}, undefined>;
|
|
215
228
|
}, undefined>, undefined>;
|
|
216
229
|
readonly pageInfo: v.StrictObjectSchema<{
|
|
@@ -223,17 +236,20 @@ export declare const BankTransactionPage: v.SchemaWithPipe<readonly [v.StrictObj
|
|
|
223
236
|
edges: {
|
|
224
237
|
cursor: string | null;
|
|
225
238
|
node: {
|
|
239
|
+
object: "movement";
|
|
226
240
|
id: string;
|
|
227
|
-
|
|
241
|
+
transaction_id: string | null;
|
|
228
242
|
description: string;
|
|
229
|
-
amount:
|
|
243
|
+
amount: number;
|
|
244
|
+
currency: "CLP";
|
|
230
245
|
movement_type: "deposit" | "interest" | "withdrawal";
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
246
|
+
movement_origin: string | null;
|
|
247
|
+
movement_date: string;
|
|
248
|
+
running_balance: number | null;
|
|
249
|
+
payment_type: string | null;
|
|
235
250
|
reversed: boolean;
|
|
236
251
|
note: string | null;
|
|
252
|
+
transfer_id: string | null;
|
|
237
253
|
};
|
|
238
254
|
}[];
|
|
239
255
|
pageInfo: {
|
|
@@ -291,8 +307,8 @@ export declare const listAccounts: import("@orpc/contract").ProcedureContractBui
|
|
|
291
307
|
hasNextPage: boolean;
|
|
292
308
|
};
|
|
293
309
|
}, string>]>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidRequest, typeof InvalidAccountsCursor, typeof InvalidToken, typeof InvalidOrigin, typeof InsufficientAuthorization, typeof UnsupportedVersion, typeof ServerError, typeof BankConnectionInteractionRequired, typeof TemporarilyUnavailable]>>;
|
|
294
|
-
/** Lists one account's
|
|
295
|
-
export declare const
|
|
310
|
+
/** Lists one account's Movements, newest first, read from the bank. */
|
|
311
|
+
export declare const listAccountMovements: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.ObjectSchema<{
|
|
296
312
|
readonly after: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.DescriptionAction<string, "Opaque cursor previously returned by this collection.">]>, undefined>;
|
|
297
313
|
readonly first: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 100, undefined>]>, undefined>, v.DescriptionAction<number | undefined, "Cursor page size; forward and backward argument families are exclusive.">]>;
|
|
298
314
|
readonly bank_account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account's identifier (a UUID) or its Account Key.">]>;
|
|
@@ -300,17 +316,20 @@ export declare const listAccountTransactions: import("@orpc/contract").Procedure
|
|
|
300
316
|
readonly edges: v.ArraySchema<v.StrictObjectSchema<{
|
|
301
317
|
readonly cursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
302
318
|
readonly node: v.StrictObjectSchema<{
|
|
319
|
+
readonly object: v.LiteralSchema<"movement", undefined>;
|
|
303
320
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
304
|
-
readonly
|
|
321
|
+
readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the transaction that posted this Movement, or null when AndCo has none. A Transfer that succeeded carries the same id of its debit.">]>;
|
|
305
322
|
readonly description: v.StringSchema<undefined>;
|
|
306
|
-
readonly amount: v.SchemaWithPipe<readonly [v.
|
|
307
|
-
readonly
|
|
308
|
-
readonly
|
|
309
|
-
readonly
|
|
310
|
-
readonly
|
|
311
|
-
readonly
|
|
323
|
+
readonly amount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>, v.DescriptionAction<number, "A positive integer in whole pesos (CLP). What tells an inflow from an outflow is `movement_type`, not a sign.">]>;
|
|
324
|
+
readonly currency: v.SchemaWithPipe<readonly [v.LiteralSchema<"CLP", undefined>, v.DescriptionAction<"CLP", "The currency of the account: a permission never assumes it, so the node names it.">]>;
|
|
325
|
+
readonly movement_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["deposit", "interest", "withdrawal"], undefined>, v.DescriptionAction<"deposit" | "interest" | "withdrawal", "The kind of Movement, in AndCo's own words. `deposit` and `interest` bring money into this account and raise its balance; `withdrawal` takes money out and lowers it. `amount` is always positive, so `movement_type` is what tells an inflow from an outflow.">]>;
|
|
326
|
+
readonly movement_origin: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
327
|
+
readonly movement_date: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
328
|
+
readonly running_balance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, number, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>, v.DescriptionAction<number | null, "The balance after this Movement, an integer in whole pesos, or null when AndCo did not send one: it is never made up. Real balances do go negative, so the sign is not narrowed away.">]>;
|
|
329
|
+
readonly payment_type: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
312
330
|
readonly reversed: v.BooleanSchema<undefined>;
|
|
313
331
|
readonly note: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
332
|
+
readonly transfer_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The id of the Transfer that this debit belongs to, only when the Grant may read that Transfer: one this client created for the same subject, or any Transfer of an account that a `bank_transfer` `read` detail covers. Always present. A null never means that no Transfer exists: it means no Transfer that this Grant may read, and it is also null for a credit, for a Movement without a `transaction_id` and for one that AndCo has posted before AndCo recorded the Transfer, which fills on a later read.">]>;
|
|
314
333
|
}, undefined>;
|
|
315
334
|
}, undefined>, undefined>;
|
|
316
335
|
readonly pageInfo: v.StrictObjectSchema<{
|
|
@@ -323,17 +342,20 @@ export declare const listAccountTransactions: import("@orpc/contract").Procedure
|
|
|
323
342
|
edges: {
|
|
324
343
|
cursor: string | null;
|
|
325
344
|
node: {
|
|
345
|
+
object: "movement";
|
|
326
346
|
id: string;
|
|
327
|
-
|
|
347
|
+
transaction_id: string | null;
|
|
328
348
|
description: string;
|
|
329
|
-
amount:
|
|
349
|
+
amount: number;
|
|
350
|
+
currency: "CLP";
|
|
330
351
|
movement_type: "deposit" | "interest" | "withdrawal";
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
352
|
+
movement_origin: string | null;
|
|
353
|
+
movement_date: string;
|
|
354
|
+
running_balance: number | null;
|
|
355
|
+
payment_type: string | null;
|
|
335
356
|
reversed: boolean;
|
|
336
357
|
note: string | null;
|
|
358
|
+
transfer_id: string | null;
|
|
337
359
|
};
|
|
338
360
|
}[];
|
|
339
361
|
pageInfo: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/rest/accounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAG7B,OAAO,EAIL,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,QAAQ,EAER,WAAW,EACX,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAGrB;;;;;GAKG;AACH,eAAO,MAAM,WAAW,0FAAyE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElG;;;;;GAKG;AACH,qBAAa,iCAAkC,SAAQ,eAA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
|
}
|
|
38
38
|
/**
|
|
39
|
-
* The `after` of the
|
|
39
|
+
* The `after` of the movements walk is not the cursor AndCo issued for the next page. The
|
|
40
40
|
* AndCo's cursor travels untouched: take it from `pageInfo.endCursor` and nothing else.
|
|
41
41
|
*/
|
|
42
42
|
export class InvalidCursor extends /* @__PURE__ */ AndcoAPIError.define("invalid_cursor", 400, v.pipe(v.object({}), v.description("`after` is not a cursor AndCo issued."))) {
|
|
@@ -57,25 +57,35 @@ export const BankAccount = /* @__PURE__ */ v.strictObject({
|
|
|
57
57
|
/** A page of the subject's accounts. */
|
|
58
58
|
export const AccountPage = /* @__PURE__ */ connection(BankAccount, "A standard connection. Edge cursors remain present on nonempty terminal pages. Reads are live; offset positions can shift under concurrent changes.");
|
|
59
59
|
/**
|
|
60
|
-
* One account
|
|
61
|
-
*
|
|
62
|
-
*
|
|
60
|
+
* One Movement of an account: a credit or a debit, as AndCo reports it. The node is a closed list of
|
|
61
|
+
* fields with the names AndCo gives them, in snake_case: nothing else leaves the API, and a camelCase
|
|
62
|
+
* node or a field outside the list is refused. "Transaction" means only a ledger id, `transaction_id`.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* const movement: Movement = {
|
|
66
|
+
* object: "movement", id, transaction_id: "88213", description: "Transferencia", amount: 500000,
|
|
67
|
+
* currency: "CLP", movement_type: "withdrawal", movement_origin: null, movement_date,
|
|
68
|
+
* running_balance: 1200000, payment_type: null, reversed: false, note: null, transfer_id,
|
|
69
|
+
* };
|
|
63
70
|
*/
|
|
64
|
-
export const
|
|
71
|
+
export const Movement = /* @__PURE__ */ v.strictObject({
|
|
72
|
+
object: v.literal("movement"),
|
|
65
73
|
id: v.pipe(v.string(), v.uuid()),
|
|
66
|
-
|
|
74
|
+
transaction_id: v.pipe(v.nullable(v.string()), v.description("The ledger id of the transaction that posted this Movement, or null when AndCo has none. A Transfer that succeeded carries the same id of its debit.")),
|
|
67
75
|
description: v.string(),
|
|
68
|
-
amount: v.pipe(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
amount: v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(Number.MAX_SAFE_INTEGER), v.description("A positive integer in whole pesos (CLP). What tells an inflow from an outflow is `movement_type`, not a sign.")),
|
|
77
|
+
currency: v.pipe(v.literal("CLP"), v.description("The currency of the account: a permission never assumes it, so the node names it.")),
|
|
78
|
+
movement_type: v.pipe(v.picklist(["deposit", "interest", "withdrawal"]), v.description("The kind of Movement, in AndCo's own words. `deposit` and `interest` bring money into this account and raise its balance; `withdrawal` takes money out and lowers it. `amount` is always positive, so `movement_type` is what tells an inflow from an outflow.")),
|
|
79
|
+
movement_origin: v.nullable(v.string()),
|
|
80
|
+
movement_date: v.pipe(v.string(), v.isoTimestamp()),
|
|
81
|
+
running_balance: v.pipe(v.nullable(v.pipe(v.number(), v.integer(), v.minValue(Number.MIN_SAFE_INTEGER), v.maxValue(Number.MAX_SAFE_INTEGER))), v.description("The balance after this Movement, an integer in whole pesos, or null when AndCo did not send one: it is never made up. Real balances do go negative, so the sign is not narrowed away.")),
|
|
82
|
+
payment_type: v.nullable(v.string()),
|
|
74
83
|
reversed: v.boolean(),
|
|
75
84
|
note: v.nullable(v.string()),
|
|
85
|
+
transfer_id: v.pipe(v.nullable(v.pipe(v.string(), v.uuid())), v.description("The id of the Transfer that this debit belongs to, only when the Grant may read that Transfer: one this client created for the same subject, or any Transfer of an account that a `bank_transfer` `read` detail covers. Always present. A null never means that no Transfer exists: it means no Transfer that this Grant may read, and it is also null for a credit, for a Movement without a `transaction_id` and for one that AndCo has posted before AndCo recorded the Transfer, which fills on a later read.")),
|
|
76
86
|
});
|
|
77
|
-
/** A page of one account's
|
|
78
|
-
export const
|
|
87
|
+
/** A page of one account's Movements, read live from the bank. */
|
|
88
|
+
export const MovementPage = /* @__PURE__ */ cursorlessConnection(Movement, "A connection read live from AndCo, which issues one cursor per page and walks forward only. `pageInfo.endCursor` is that cursor and is null on the last page; `pageInfo.startCursor` is always null and `pageInfo.hasPreviousPage` always false. An edge's `cursor` is null: AndCo names no position inside a page, so a walk resumes from the end of a page, never from one Movement.");
|
|
79
89
|
/** Lists the personal digital accounts the Grant reaches, with their balances. */
|
|
80
90
|
export const listAccounts = /* @__PURE__ */ oc
|
|
81
91
|
.meta(http({
|
|
@@ -91,18 +101,18 @@ export const listAccounts = /* @__PURE__ */ oc
|
|
|
91
101
|
...PageQuery,
|
|
92
102
|
}))
|
|
93
103
|
.output(AccountPage);
|
|
94
|
-
/** Lists one account's
|
|
95
|
-
export const
|
|
104
|
+
/** Lists one account's Movements, newest first, read from the bank. */
|
|
105
|
+
export const listAccountMovements = /* @__PURE__ */ oc
|
|
96
106
|
.meta(http({
|
|
97
107
|
method: "GET",
|
|
98
|
-
path: "/accounts/{bank_account_id}/
|
|
99
|
-
summary: "List one account's
|
|
100
|
-
description: "Answers the
|
|
101
|
-
successDescription: "Authorized cursor page of account
|
|
108
|
+
path: "/accounts/{bank_account_id}/movements",
|
|
109
|
+
summary: "List one account's Movements",
|
|
110
|
+
description: "Answers the Movements the account's statement presentation reads, so an integrator sees exactly what a person would see, newest first, one page at a time: feed `pageInfo.endCursor` back as `?after=` while `pageInfo.hasNextPage`. Granted by a `bank_movement` authorization detail with `read` whose `accounts` reach this account. The account is named by its identifier or by its Account Key, whichever the integrator knows: a segment shaped like a UUID is an identifier, any other is an Account Key of the Grant's subject. The permission is the same for both and the key is resolved on this request: an account the Grant does not reach, by identifier or by key, and a key that names no account of the subject answer `404`, as if it did not exist, whether or not the account exists. The page is read from AndCo on behalf of the subject, and its read model walks forward only: `pageInfo.endCursor` is AndCo's own cursor for the next page, handed over untouched, and `after` accepts nothing else (`invalid_cursor` otherwise). There is no cursor per Movement, no backward walk and no offset: `before`, `last`, `offset` and `limit` answer `invalid_request`. Returns edges and camelCase pageInfo.",
|
|
111
|
+
successDescription: "Authorized cursor page of account Movements, newest first",
|
|
102
112
|
}))
|
|
103
113
|
.errors(errors(InvalidRequest, InvalidIdentifier, InvalidCursor, InvalidToken, InvalidOrigin, InsufficientAuthorization, NotFound, UnsupportedVersion, ServerError, BankConnectionInteractionRequired, TemporarilyUnavailable))
|
|
104
114
|
.input(v.object({
|
|
105
115
|
bank_account_id: v.pipe(v.string(), v.maxLength(64), v.description("The account's identifier (a UUID) or its Account Key.")),
|
|
106
116
|
...ForwardPageQuery,
|
|
107
117
|
}))
|
|
108
|
-
.output(
|
|
118
|
+
.output(MovementPage);
|