@andco/protocol 0.0.7 → 0.0.8
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/README.md +22 -73
- package/dist/api-errors.d.ts +5 -5
- package/dist/api-errors.d.ts.map +1 -1
- package/dist/api-errors.js +5 -5
- package/dist/consent.d.ts +2 -2
- package/dist/consent.d.ts.map +1 -1
- package/dist/consent.js +10 -19
- package/dist/errors.d.ts +41 -7
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +46 -8
- package/dist/format-money.d.ts +3 -0
- package/dist/format-money.d.ts.map +1 -0
- package/dist/format-money.js +7 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/intent-input.d.ts +124 -124
- package/dist/intent-input.d.ts.map +1 -1
- package/dist/intent-input.js +14 -14
- package/dist/miniapp-icon.d.ts +2 -2
- package/dist/miniapp-icon.d.ts.map +1 -1
- package/dist/miniapp-icon.js +6 -58
- package/dist/native-intent.d.ts +20 -29
- package/dist/native-intent.d.ts.map +1 -1
- package/dist/native-intent.js +13 -56
- package/dist/pagination.d.ts +71 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +63 -0
- package/dist/rar/account-matchers.d.ts +52 -52
- package/dist/rar/account-matchers.d.ts.map +1 -1
- package/dist/rar/account-matchers.js +81 -72
- package/dist/rar/bank.d.ts +86 -84
- package/dist/rar/bank.d.ts.map +1 -1
- package/dist/rar/bank.js +26 -24
- package/dist/rar/catalog.d.ts +57 -56
- package/dist/rar/catalog.d.ts.map +1 -1
- package/dist/rar/catalog.js +1 -0
- package/dist/rar/detail.d.ts +1 -1
- package/dist/rar/detail.d.ts.map +1 -1
- package/dist/rar/detail.js +1 -1
- package/dist/service-grants.d.ts +4 -2
- package/dist/service-grants.d.ts.map +1 -1
- package/dist/service-grants.js +15 -2
- package/dist/transport/financial-events.d.ts +10 -22
- package/dist/transport/financial-events.d.ts.map +1 -1
- package/dist/transport/financial-events.js +36 -62
- package/dist/transport/generated/oauth-api.d.ts +269 -96
- package/dist/transport/generated/oauth-api.d.ts.map +1 -1
- package/dist/transport/intents.d.ts +11 -10
- package/dist/transport/intents.d.ts.map +1 -1
- package/dist/transport/intents.js +20 -19
- package/dist/transport/rest.d.ts +3 -3
- package/dist/transport/rest.d.ts.map +1 -1
- package/dist/transport/rest.js +1 -1
- package/dist/transport/runtime.js +3 -3
- package/dist/utils.js +3 -3
- package/dist/webhooks.d.ts +15 -4
- package/dist/webhooks.d.ts.map +1 -1
- package/dist/webhooks.js +50 -17
- package/package.json +1 -1
- package/dist/native-copy.d.ts +0 -28
- package/dist/native-copy.d.ts.map +0 -1
- package/dist/native-copy.js +0 -400
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;AAoC7B,0EAA0E;AAC1E,eAAO,MAAM,yBAAyB,mCAAoC,CAAC;AAC3E,
|
|
1
|
+
{"version":3,"file":"bank.d.ts","sourceRoot":"","sources":["../../src/rar/bank.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAoC7B,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,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,mBAAoB,CAAC;AAC1D,sDAAsD;AACtD,eAAO,MAAM,4BAA4B,qBAAsB,CAAC;AAChE,6FAA6F;AAC7F,eAAO,MAAM,8BAA8B,gCAAiC,CAAC;AAC7E,0DAA0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AG,CAAC,CAAC,WAAW,CAAC,OAAO,sBAAsB,CAAC,CAAC;AA8D5E,mEAAmE;AACnE,eAAO,MAAM,sCAAsC,yBAmBjD,CAAC;AACH,4DAA4D;AAC5D,eAAO,MAAM,8BAA8B,yBAmBzC,CAAC;AAEH,uEAAuE;AACvE,eAAO,MAAM,0CAA0C,yBAOrD,CAAC;AACH,gEAAgE;AAChE,eAAO,MAAM,kCAAkC,yBAO7C,CAAC;AAEH,oEAAoE;AACpE,eAAO,MAAM,uCAAuC,yBAoBlD,CAAC;AACH,6DAA6D;AAC7D,eAAO,MAAM,+BAA+B,yBAmB1C,CAAC;AAEH,mEAAmE;AACnE,eAAO,MAAM,sCAAsC,yBAOjD,CAAC;AACH,4DAA4D;AAC5D,eAAO,MAAM,8BAA8B,yBAOzC,CAAC"}
|
package/dist/rar/bank.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import {
|
|
2
|
+
import { ACCOUNT_KEY_PATTERN_SYNTAX, AccountKeyMatcherSchema, accountMatcherList, accountMatcherListJsonSchema, accountSelectionIsAbsent, accountSelectionIsCoherent, DESTINATION_ACCOUNT_MATCHER_JSON_SCHEMA, DestinationAccountMatcherSchema, GRANTED_DESTINATION_ACCOUNT_MATCHER_JSON_SCHEMA, GRANTED_OWN_ACCOUNT_MATCHER_JSON_SCHEMA, GrantedAccountKeySchema, GrantedDestinationAccountMatcherSchema, GrantedOwnAccountMatcherSchema, OWN_ACCOUNT_MATCHER_JSON_SCHEMA, OwnAccountMatcherSchema, } from "./account-matchers.js";
|
|
3
3
|
import { AndcoRarLocationsSchema, actionSet, actionSetJson, detailFormJson, detailTypeJson, nullableJson, } from "./detail.js";
|
|
4
4
|
import { compareMoney, TRANSACTION_LIMIT_PATTERN, TransactionLimitSchema } from "./money.js";
|
|
5
5
|
import { GRANTED_SUBJECT_JSON_SCHEMA, GrantedSubjectSchema, SUBJECT_PICKER_JSON_SCHEMA, SubjectPickerSchema, } from "./subject.js";
|
|
6
6
|
// -- Actions ------------------------------------------------------------------------------------
|
|
7
7
|
/** Reading accounts and their balances. `create` never implies either. */
|
|
8
8
|
export const BANK_ACCOUNT_READ_ACTIONS = ["read", "read_balance"];
|
|
9
|
-
/** Opening and closing accounts, within the
|
|
9
|
+
/** Opening and closing accounts, within the accountKey patterns of `accounts`. Each is an Intent. */
|
|
10
10
|
export const BANK_ACCOUNT_MANAGE_ACTIONS = ["create", "close"];
|
|
11
11
|
/** Approving or rejecting an Account Opening or closing someone else created: dual control. */
|
|
12
12
|
export const BANK_ACCOUNT_APPROVAL_ACTIONS = ["approve", "reject"];
|
|
@@ -32,10 +32,10 @@ export const BANK_CURRENCIES = ["CLP"];
|
|
|
32
32
|
const currency = /* @__PURE__ */ v.picklist(BANK_CURRENCIES);
|
|
33
33
|
const ownList = /* @__PURE__ */ v.pipe(accountMatcherList(OwnAccountMatcherSchema), v.check((matchers) => accountSelectionIsCoherent(matchers), "account_selection_incoherent"));
|
|
34
34
|
const destinationList = /* @__PURE__ */ v.pipe(accountMatcherList(DestinationAccountMatcherSchema), v.check((matchers) => accountSelectionIsAbsent(matchers), "account_selection_not_pickable"));
|
|
35
|
-
const
|
|
35
|
+
const accountKeyList = /* @__PURE__ */ v.pipe(accountMatcherList(AccountKeyMatcherSchema), v.check((matchers) => accountSelectionIsAbsent(matchers), "account_selection_not_pickable"));
|
|
36
36
|
const grantedOwnList = /* @__PURE__ */ accountMatcherList(GrantedOwnAccountMatcherSchema);
|
|
37
37
|
const grantedDestinationList = /* @__PURE__ */ accountMatcherList(GrantedDestinationAccountMatcherSchema);
|
|
38
|
-
const
|
|
38
|
+
const grantedAccountKeyList = /* @__PURE__ */ accountMatcherList(GrantedAccountKeySchema);
|
|
39
39
|
const present = (value) => value !== undefined && value !== null;
|
|
40
40
|
/** `value` fixes an exact amount, so it cannot travel with a range. */
|
|
41
41
|
const valueExcludesRange = (limits) => !present(limits.value) || (!present(limits.minimum) && !present(limits.maximum));
|
|
@@ -72,7 +72,7 @@ export const ApprovalLimitsGrantSchema = /* @__PURE__ */ v.pipe(v.strictObject({
|
|
|
72
72
|
* `bank_account` Grant Request: three forms, one per action family, never mixed in one detail.
|
|
73
73
|
*
|
|
74
74
|
* - `read`/`read_balance` over `accounts` (own matchers; absent means every own account).
|
|
75
|
-
* - `create`/`close` within `accounts`, which is required and only takes
|
|
75
|
+
* - `create`/`close` within `accounts`, which is required and only takes accountKey patterns: an
|
|
76
76
|
* application opens the accounts its naming convention owns.
|
|
77
77
|
* - `approve`/`reject` of openings and closings, without accounts.
|
|
78
78
|
*
|
|
@@ -82,7 +82,7 @@ export const ApprovalLimitsGrantSchema = /* @__PURE__ */ v.pipe(v.strictObject({
|
|
|
82
82
|
* actions: ["read", "read_balance"],
|
|
83
83
|
* locations: ["https://api.andco.com"],
|
|
84
84
|
* subject: { type: "organization", editable: true },
|
|
85
|
-
* accounts: [{ type: "
|
|
85
|
+
* accounts: [{ type: "account_key", pattern: "caja-*", editable: true }],
|
|
86
86
|
* };
|
|
87
87
|
*/
|
|
88
88
|
export const BankAccountGrantRequestSchema = /* @__PURE__ */ v.union([
|
|
@@ -98,7 +98,7 @@ export const BankAccountGrantRequestSchema = /* @__PURE__ */ v.union([
|
|
|
98
98
|
actions: actionSet(BANK_ACCOUNT_MANAGE_ACTIONS),
|
|
99
99
|
locations: AndcoRarLocationsSchema,
|
|
100
100
|
subject: SubjectPickerSchema,
|
|
101
|
-
accounts:
|
|
101
|
+
accounts: accountKeyList,
|
|
102
102
|
}),
|
|
103
103
|
v.strictObject({
|
|
104
104
|
type: v.literal("bank_account"),
|
|
@@ -121,7 +121,7 @@ export const BankAccountGrantSchema = /* @__PURE__ */ v.union([
|
|
|
121
121
|
actions: actionSet(BANK_ACCOUNT_MANAGE_ACTIONS),
|
|
122
122
|
locations: AndcoRarLocationsSchema,
|
|
123
123
|
subject: GrantedSubjectSchema,
|
|
124
|
-
accounts:
|
|
124
|
+
accounts: grantedAccountKeyList,
|
|
125
125
|
}),
|
|
126
126
|
v.strictObject({
|
|
127
127
|
type: v.literal("bank_account"),
|
|
@@ -163,8 +163,10 @@ export const BankTransactionGrantSchema = /* @__PURE__ */ v.strictObject({
|
|
|
163
163
|
/**
|
|
164
164
|
* `bank_transfer` Grant Request, create form: propose Transfers within explicit bounds.
|
|
165
165
|
*
|
|
166
|
-
* `sources` only takes own matchers (absent means any own account)
|
|
167
|
-
* matcher
|
|
166
|
+
* `sources` only takes own matchers (absent means any own account). `destinations` is required and
|
|
167
|
+
* takes every matcher: a request that omits it, or sends `null`, is refused, and asking for any
|
|
168
|
+
* account, other banks included, is written out as `[{ type: "any", limit: "all" }]`. `currency` is
|
|
169
|
+
* required. `budgets` is
|
|
168
170
|
* reserved and must be absent or `null`.
|
|
169
171
|
*
|
|
170
172
|
* @example
|
|
@@ -173,8 +175,8 @@ export const BankTransactionGrantSchema = /* @__PURE__ */ v.strictObject({
|
|
|
173
175
|
* actions: ["create"],
|
|
174
176
|
* locations: ["https://api.andco.com"],
|
|
175
177
|
* subject: { type: "organization" },
|
|
176
|
-
* sources: [{ type: "
|
|
177
|
-
* destinations: [{ type: "
|
|
178
|
+
* sources: [{ type: "account_key", pattern: "caja-*", editable: true }],
|
|
179
|
+
* destinations: [{ type: "account_key", pattern: "proveedores" }, { type: "external", bank_id: "banco_de_chile" }],
|
|
178
180
|
* currency: "CLP",
|
|
179
181
|
* transactions: { minimum: "1000", maximum: "5000000", editable: true },
|
|
180
182
|
* budgets: null,
|
|
@@ -186,7 +188,7 @@ export const BankTransferCreateGrantRequestSchema = /* @__PURE__ */ v.strictObje
|
|
|
186
188
|
locations: AndcoRarLocationsSchema,
|
|
187
189
|
subject: SubjectPickerSchema,
|
|
188
190
|
sources: v.nullish(ownList),
|
|
189
|
-
destinations:
|
|
191
|
+
destinations: destinationList,
|
|
190
192
|
currency,
|
|
191
193
|
transactions: v.nullish(TransferLimitsRequestSchema),
|
|
192
194
|
budgets: v.optional(v.null()),
|
|
@@ -251,7 +253,7 @@ export const BankTransferGrantSchema = /* @__PURE__ */ v.union([
|
|
|
251
253
|
* actions: ["create", "read", "close"],
|
|
252
254
|
* locations: ["https://api.andco.com"],
|
|
253
255
|
* subject: { type: "organization" },
|
|
254
|
-
* destinations: [{ type: "
|
|
256
|
+
* destinations: [{ type: "account_key", pattern: "ventas" }],
|
|
255
257
|
* };
|
|
256
258
|
*/
|
|
257
259
|
export const BankDepositGrantRequestSchema = /* @__PURE__ */ v.strictObject({
|
|
@@ -273,7 +275,7 @@ export const BankDepositGrantSchema = /* @__PURE__ */ v.strictObject({
|
|
|
273
275
|
//
|
|
274
276
|
// Written by hand, like every catalog mirror: `@valibot/to-json-schema` drops `v.check(...)`
|
|
275
277
|
// silently. What JSON Schema cannot say is enforced by valibot and by the gate's SQL: a `minimum`
|
|
276
|
-
// above its `maximum`, uniqueness of matchers that differ only by `editable` or an omitted
|
|
278
|
+
// above its `maximum`, uniqueness of matchers that differ only by `editable` or an omitted accountKey
|
|
277
279
|
// `type`, and that an `account` source belongs to the subject.
|
|
278
280
|
const limitJson = { type: "string", pattern: TRANSACTION_LIMIT_PATTERN };
|
|
279
281
|
const currencyJson = { enum: [...BANK_CURRENCIES] };
|
|
@@ -281,21 +283,21 @@ const ownListJson = accountMatcherListJsonSchema(OWN_ACCOUNT_MATCHER_JSON_SCHEMA
|
|
|
281
283
|
const destinationListJson = accountMatcherListJsonSchema(DESTINATION_ACCOUNT_MATCHER_JSON_SCHEMA);
|
|
282
284
|
const grantedOwnListJson = accountMatcherListJsonSchema(GRANTED_OWN_ACCOUNT_MATCHER_JSON_SCHEMA);
|
|
283
285
|
const grantedDestinationListJson = accountMatcherListJsonSchema(GRANTED_DESTINATION_ACCOUNT_MATCHER_JSON_SCHEMA);
|
|
284
|
-
const
|
|
286
|
+
const accountKeyListJson = accountMatcherListJsonSchema({
|
|
285
287
|
type: "object",
|
|
286
288
|
additionalProperties: false,
|
|
287
289
|
required: ["pattern"],
|
|
288
290
|
properties: {
|
|
289
|
-
type: nullableJson({ const: "
|
|
290
|
-
pattern: { type: "string", pattern:
|
|
291
|
+
type: nullableJson({ const: "account_key" }),
|
|
292
|
+
pattern: { type: "string", pattern: ACCOUNT_KEY_PATTERN_SYNTAX },
|
|
291
293
|
editable: nullableJson({ type: "boolean" }),
|
|
292
294
|
},
|
|
293
295
|
});
|
|
294
|
-
const
|
|
296
|
+
const grantedAccountKeyListJson = accountMatcherListJsonSchema({
|
|
295
297
|
type: "object",
|
|
296
298
|
additionalProperties: false,
|
|
297
299
|
required: ["type", "pattern"],
|
|
298
|
-
properties: { type: { const: "
|
|
300
|
+
properties: { type: { const: "account_key" }, pattern: { type: "string", pattern: ACCOUNT_KEY_PATTERN_SYNTAX } },
|
|
299
301
|
});
|
|
300
302
|
const transferLimitsRequestJson = nullableJson({
|
|
301
303
|
type: "object",
|
|
@@ -329,13 +331,13 @@ const approvalLimitsGrantJson = {
|
|
|
329
331
|
/** JSON Schema mirror of {@link BankAccountGrantRequestSchema}. */
|
|
330
332
|
export const BANK_ACCOUNT_GRANT_REQUEST_JSON_SCHEMA = /* @__PURE__ */ detailTypeJson([
|
|
331
333
|
detailFormJson("bank_account", actionSetJson(BANK_ACCOUNT_READ_ACTIONS), { subject: SUBJECT_PICKER_JSON_SCHEMA, accounts: nullableJson(ownListJson) }, []),
|
|
332
|
-
detailFormJson("bank_account", actionSetJson(BANK_ACCOUNT_MANAGE_ACTIONS), { subject: SUBJECT_PICKER_JSON_SCHEMA, accounts:
|
|
334
|
+
detailFormJson("bank_account", actionSetJson(BANK_ACCOUNT_MANAGE_ACTIONS), { subject: SUBJECT_PICKER_JSON_SCHEMA, accounts: accountKeyListJson }, ["accounts"]),
|
|
333
335
|
detailFormJson("bank_account", actionSetJson(BANK_ACCOUNT_APPROVAL_ACTIONS), { subject: SUBJECT_PICKER_JSON_SCHEMA }, []),
|
|
334
336
|
]);
|
|
335
337
|
/** JSON Schema mirror of {@link BankAccountGrantSchema}. */
|
|
336
338
|
export const BANK_ACCOUNT_GRANT_JSON_SCHEMA = /* @__PURE__ */ detailTypeJson([
|
|
337
339
|
detailFormJson("bank_account", actionSetJson(BANK_ACCOUNT_READ_ACTIONS), { subject: GRANTED_SUBJECT_JSON_SCHEMA, accounts: grantedOwnListJson }, ["subject", "accounts"]),
|
|
338
|
-
detailFormJson("bank_account", actionSetJson(BANK_ACCOUNT_MANAGE_ACTIONS), { subject: GRANTED_SUBJECT_JSON_SCHEMA, accounts:
|
|
340
|
+
detailFormJson("bank_account", actionSetJson(BANK_ACCOUNT_MANAGE_ACTIONS), { subject: GRANTED_SUBJECT_JSON_SCHEMA, accounts: grantedAccountKeyListJson }, ["subject", "accounts"]),
|
|
339
341
|
detailFormJson("bank_account", actionSetJson(BANK_ACCOUNT_APPROVAL_ACTIONS), { subject: GRANTED_SUBJECT_JSON_SCHEMA }, ["subject"]),
|
|
340
342
|
]);
|
|
341
343
|
/** JSON Schema mirror of {@link BankTransactionGrantRequestSchema}. */
|
|
@@ -351,11 +353,11 @@ export const BANK_TRANSFER_GRANT_REQUEST_JSON_SCHEMA = /* @__PURE__ */ detailTyp
|
|
|
351
353
|
detailFormJson("bank_transfer", actionSetJson(BANK_TRANSFER_CREATE_ACTIONS), {
|
|
352
354
|
subject: SUBJECT_PICKER_JSON_SCHEMA,
|
|
353
355
|
sources: nullableJson(ownListJson),
|
|
354
|
-
destinations:
|
|
356
|
+
destinations: destinationListJson,
|
|
355
357
|
currency: currencyJson,
|
|
356
358
|
transactions: transferLimitsRequestJson,
|
|
357
359
|
budgets: { type: "null" },
|
|
358
|
-
}, ["currency"]),
|
|
360
|
+
}, ["destinations", "currency"]),
|
|
359
361
|
detailFormJson("bank_transfer", actionSetJson(BANK_TRANSFER_APPROVAL_ACTIONS), { subject: SUBJECT_PICKER_JSON_SCHEMA, transactions: approvalLimitsRequestJson }, []),
|
|
360
362
|
]);
|
|
361
363
|
/** JSON Schema mirror of {@link BankTransferGrantSchema}. */
|