@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.
- package/README.md +2 -2
- package/dist/api-errors.d.ts +9 -9
- package/dist/api-errors.js +9 -9
- package/dist/authorization-preparation.d.ts +1 -1
- package/dist/authorization-preparation.js +2 -2
- package/dist/authorization.d.ts +1 -1
- package/dist/authorization.js +1 -1
- package/dist/consent.d.ts +2 -2
- package/dist/consent.js +2 -2
- package/dist/errors.d.ts +10 -10
- package/dist/errors.js +10 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/intent-input.d.ts +452 -880
- package/dist/intent-input.d.ts.map +1 -1
- package/dist/intent-input.js +164 -127
- package/dist/intent-status.d.ts +5 -6
- package/dist/intent-status.d.ts.map +1 -1
- package/dist/intent-status.js +12 -7
- package/dist/miniapp-manifest.d.ts +3 -3
- package/dist/miniapp-manifest.js +1 -1
- package/dist/native-intent.d.ts +82 -68
- package/dist/native-intent.d.ts.map +1 -1
- package/dist/native-intent.js +137 -84
- package/dist/native.d.ts +1 -1
- package/dist/rar/account-matchers.d.ts +35 -30
- package/dist/rar/account-matchers.d.ts.map +1 -1
- package/dist/rar/account-matchers.js +27 -21
- package/dist/rar/bank.d.ts +357 -85
- package/dist/rar/bank.d.ts.map +1 -1
- package/dist/rar/bank.js +43 -5
- package/dist/rar/catalog.d.ts +174 -49
- package/dist/rar/catalog.d.ts.map +1 -1
- package/dist/rar/catalog.js +6 -6
- package/dist/rar/detail.d.ts +1 -1
- package/dist/rar/detail.js +1 -1
- package/dist/rar/json-schemas.generated.d.ts +1 -1
- package/dist/rar/json-schemas.generated.d.ts.map +1 -1
- package/dist/rar/json-schemas.generated.js +393 -21
- package/dist/rar/money.d.ts +1 -1
- package/dist/rar/money.js +1 -1
- package/dist/rar/subject-data.d.ts +1 -1
- package/dist/rar/subject-data.js +1 -1
- package/dist/rar/subject.d.ts +1 -1
- package/dist/rar/subject.js +1 -1
- package/dist/rest/accounts.d.ts +28 -28
- package/dist/rest/accounts.d.ts.map +1 -1
- package/dist/rest/accounts.js +22 -22
- package/dist/rest/api-error.d.ts +1 -1
- package/dist/rest/api-error.js +1 -1
- package/dist/rest/catalog.d.ts +3 -3
- package/dist/rest/catalog.js +2 -2
- package/dist/rest/common.d.ts +3 -3
- package/dist/rest/common.js +3 -3
- package/dist/rest/contract.d.ts +1183 -547
- package/dist/rest/contract.d.ts.map +1 -1
- package/dist/rest/contract.js +21 -5
- package/dist/rest/events.d.ts +1 -1
- package/dist/rest/events.d.ts.map +1 -1
- package/dist/rest/events.js +2 -2
- package/dist/rest/identity.d.ts +22 -22
- package/dist/rest/identity.d.ts.map +1 -1
- package/dist/rest/identity.js +5 -5
- package/dist/rest/index.d.ts +1 -0
- package/dist/rest/index.d.ts.map +1 -1
- package/dist/rest/index.js +1 -0
- package/dist/rest/intents.d.ts +973 -743
- package/dist/rest/intents.d.ts.map +1 -1
- package/dist/rest/intents.js +112 -89
- package/dist/rest/signatures.d.ts +25 -5
- package/dist/rest/signatures.d.ts.map +1 -1
- package/dist/rest/signatures.js +52 -0
- package/dist/rest/transfers.d.ts +988 -0
- package/dist/rest/transfers.d.ts.map +1 -0
- package/dist/rest/transfers.js +142 -0
- package/dist/scopes.d.ts +1 -1
- package/dist/signing.d.ts +17 -3
- package/dist/signing.d.ts.map +1 -1
- package/dist/signing.js +8 -1
- package/dist/transfer.d.ts +399 -0
- package/dist/transfer.d.ts.map +1 -0
- package/dist/transfer.js +313 -0
- package/dist/transport/financial-events.d.ts +82 -27
- package/dist/transport/financial-events.d.ts.map +1 -1
- package/dist/transport/financial-events.js +34 -0
- package/dist/transport/generated/oauth-api.d.ts +1420 -333
- package/dist/transport/generated/oauth-api.d.ts.map +1 -1
- package/dist/transport/intents.d.ts +29 -13
- package/dist/transport/intents.d.ts.map +1 -1
- package/dist/transport/intents.js +1 -1
- package/dist/transport/rest.d.ts +5 -5
- package/dist/urls.d.ts +2 -2
- package/dist/urls.js +3 -3
- package/dist/userinfo.d.ts +2 -2
- package/dist/userinfo.js +2 -2
- package/dist/webhooks.d.ts +16 -16
- package/dist/webhooks.js +14 -14
- package/dist/window-features.d.ts +2 -2
- package/dist/window-features.js +2 -2
- package/package.json +2 -2
package/dist/rar/bank.js
CHANGED
|
@@ -16,14 +16,20 @@ export const BANK_ACCOUNT_ACTIONS = [
|
|
|
16
16
|
...BANK_ACCOUNT_MANAGE_ACTIONS,
|
|
17
17
|
...BANK_ACCOUNT_APPROVAL_ACTIONS,
|
|
18
18
|
];
|
|
19
|
-
/** Reading the Transactions (
|
|
19
|
+
/** Reading the Transactions (movements) of accounts. */
|
|
20
20
|
export const BANK_TRANSACTION_ACTIONS = ["read"];
|
|
21
21
|
/** Proposing Transfers within the detail's bounds. */
|
|
22
22
|
export const BANK_TRANSFER_CREATE_ACTIONS = ["create"];
|
|
23
|
+
/** Reading every Transfer that leaves the accounts of `accounts`, whoever made it and in any status. */
|
|
24
|
+
export const BANK_TRANSFER_READ_ACTIONS = ["read"];
|
|
23
25
|
/** Approving or rejecting Transfers someone else created: the other half of dual control. */
|
|
24
26
|
export const BANK_TRANSFER_APPROVAL_ACTIONS = ["approve", "reject"];
|
|
25
|
-
/** Every `bank_transfer` action, across its
|
|
26
|
-
export const BANK_TRANSFER_ACTIONS = [
|
|
27
|
+
/** Every `bank_transfer` action, across its three forms. */
|
|
28
|
+
export const BANK_TRANSFER_ACTIONS = [
|
|
29
|
+
...BANK_TRANSFER_CREATE_ACTIONS,
|
|
30
|
+
...BANK_TRANSFER_READ_ACTIONS,
|
|
31
|
+
...BANK_TRANSFER_APPROVAL_ACTIONS,
|
|
32
|
+
];
|
|
27
33
|
/** Creating, reading and closing Deposits. A Deposit needs no Approval: money arriving is not money leaving. */
|
|
28
34
|
export const BANK_DEPOSIT_ACTIONS = ["create", "read", "close"];
|
|
29
35
|
/** The only currency a bank detail names today. It is still required: a permission never assumes CLP. */
|
|
@@ -215,7 +221,7 @@ export const BankTransactionGrantSchema = /* @__PURE__ */ v.strictObject({
|
|
|
215
221
|
* locations: ["https://api.andco.com"],
|
|
216
222
|
* subject: { type: "organization" },
|
|
217
223
|
* sources: [{ type: "account_key", pattern: "caja-*", editable: true }],
|
|
218
|
-
* destinations: [{ type: "account_key", pattern: "proveedores" }, { type: "external",
|
|
224
|
+
* destinations: [{ type: "account_key", pattern: "proveedores" }, { type: "external", bank_code: "0001" }],
|
|
219
225
|
* currency: "CLP",
|
|
220
226
|
* transactions: { minimum: "1000", maximum: "5000000", editable: true },
|
|
221
227
|
* budgets: null,
|
|
@@ -252,9 +258,32 @@ export const BankTransferApprovalGrantRequestSchema = /* @__PURE__ */ v.strictOb
|
|
|
252
258
|
subject: SubjectPickerSchema,
|
|
253
259
|
transactions: v.nullish(ApprovalLimitsRequestSchema),
|
|
254
260
|
});
|
|
255
|
-
/**
|
|
261
|
+
/**
|
|
262
|
+
* `bank_transfer` Grant Request, read form: read every Transfer that leaves `accounts` (own matchers;
|
|
263
|
+
* absent means every own account), in any status and of any origin. It is a bound on accounts only:
|
|
264
|
+
* no `sources`, `destinations`, `currency` or `transactions`. Without it, a client reads only the
|
|
265
|
+
* Transfers it created itself.
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* const observe: BankTransferReadGrantRequest = {
|
|
269
|
+
* type: "bank_transfer",
|
|
270
|
+
* actions: ["read"],
|
|
271
|
+
* locations: ["https://api.andco.com"],
|
|
272
|
+
* subject: { type: "organization" },
|
|
273
|
+
* accounts: [{ type: "account_key", pattern: "caja-*", editable: true }],
|
|
274
|
+
* };
|
|
275
|
+
*/
|
|
276
|
+
export const BankTransferReadGrantRequestSchema = /* @__PURE__ */ v.strictObject({
|
|
277
|
+
type: v.literal("bank_transfer"),
|
|
278
|
+
actions: actionSet(BANK_TRANSFER_READ_ACTIONS),
|
|
279
|
+
locations: AndcoRarLocationsSchema,
|
|
280
|
+
subject: SubjectPickerSchema,
|
|
281
|
+
accounts: v.nullish(ownList),
|
|
282
|
+
});
|
|
283
|
+
/** `bank_transfer` Grant Request: the create, read or approval form, never mixed in one detail. */
|
|
256
284
|
export const BankTransferGrantRequestSchema = /* @__PURE__ */ v.union([
|
|
257
285
|
BankTransferCreateGrantRequestSchema,
|
|
286
|
+
BankTransferReadGrantRequestSchema,
|
|
258
287
|
BankTransferApprovalGrantRequestSchema,
|
|
259
288
|
]);
|
|
260
289
|
/** `bank_transfer` Grant, create form: sources and destinations materialized, no `budgets`. */
|
|
@@ -276,9 +305,18 @@ export const BankTransferApprovalGrantSchema = /* @__PURE__ */ v.strictObject({
|
|
|
276
305
|
subject: GrantedSubjectSchema,
|
|
277
306
|
transactions: v.optional(ApprovalLimitsGrantSchema),
|
|
278
307
|
});
|
|
308
|
+
/** `bank_transfer` Grant, read form: the subject resolved and `accounts` materialized. */
|
|
309
|
+
export const BankTransferReadGrantSchema = /* @__PURE__ */ v.strictObject({
|
|
310
|
+
type: v.literal("bank_transfer"),
|
|
311
|
+
actions: actionSet(BANK_TRANSFER_READ_ACTIONS),
|
|
312
|
+
locations: AndcoRarLocationsSchema,
|
|
313
|
+
subject: GrantedSubjectSchema,
|
|
314
|
+
accounts: grantedOwnList,
|
|
315
|
+
});
|
|
279
316
|
/** `bank_transfer` Grant. */
|
|
280
317
|
export const BankTransferGrantSchema = /* @__PURE__ */ v.union([
|
|
281
318
|
BankTransferCreateGrantSchema,
|
|
319
|
+
BankTransferReadGrantSchema,
|
|
282
320
|
BankTransferApprovalGrantSchema,
|
|
283
321
|
]);
|
|
284
322
|
// -- bank_deposit -------------------------------------------------------------------------------
|
package/dist/rar/catalog.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { ErrorExtendable } from "../errors.js";
|
|
3
3
|
import { type Issue } from "../issues.js";
|
|
4
|
-
/** Every authorization detail type
|
|
4
|
+
/** Every authorization detail type AndCo's Resource Server implements. */
|
|
5
5
|
export declare const ANDCO_RAR_TYPES: readonly ["bank_account", "bank_transaction", "bank_transfer", "bank_deposit", "identity", "address", "organization", "profile", "project_users"];
|
|
6
6
|
export type AndcoRarType = (typeof ANDCO_RAR_TYPES)[number];
|
|
7
7
|
/**
|
|
@@ -32,7 +32,7 @@ export type AndcoRarCatalogEntry = {
|
|
|
32
32
|
readonly grant: v.GenericSchema;
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
|
-
* The whole
|
|
35
|
+
* The whole AndCo authorization detail catalog, keyed by type. The gate's seeds store `actions` as
|
|
36
36
|
* each type's registered actions and, as its request schema, the JSON Schema `ANDCO_RAR_JSON_SCHEMAS`
|
|
37
37
|
* holds, generated from `grantRequest`; a guard test compares them. The schemas describe shape only:
|
|
38
38
|
* the rules JSON Schema cannot say are {@link andcoRarIssues}, which the parse functions apply and
|
|
@@ -391,7 +391,7 @@ export declare const ANDCO_RAR_CATALOG: {
|
|
|
391
391
|
}, undefined>;
|
|
392
392
|
};
|
|
393
393
|
readonly bank_transfer: {
|
|
394
|
-
readonly actions: readonly ["create", "approve", "reject"];
|
|
394
|
+
readonly actions: readonly ["create", "read", "approve", "reject"];
|
|
395
395
|
readonly grantRequest: v.UnionSchema<[v.StrictObjectSchema<{
|
|
396
396
|
readonly type: v.LiteralSchema<"bank_transfer", undefined>;
|
|
397
397
|
readonly actions: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["create"], undefined>, undefined>, v.MinLengthAction<"create"[], 1, undefined>, v.MetadataAction<"create"[], {
|
|
@@ -488,11 +488,11 @@ export declare const ANDCO_RAR_CATALOG: {
|
|
|
488
488
|
readonly limit: v.LiteralSchema<"all", undefined>;
|
|
489
489
|
}, undefined>, v.StrictObjectSchema<{
|
|
490
490
|
readonly type: v.LiteralSchema<"external", undefined>;
|
|
491
|
-
readonly
|
|
492
|
-
readonly account_type: v.NullishSchema<v.SchemaWithPipe<readonly [v.
|
|
493
|
-
readonly
|
|
494
|
-
readonly
|
|
495
|
-
readonly
|
|
491
|
+
readonly bank_code: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`.">]>, undefined>;
|
|
492
|
+
readonly account_type: v.NullishSchema<v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "The account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>, undefined>;
|
|
493
|
+
readonly account_number: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
494
|
+
readonly national_id: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
495
|
+
readonly name: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
496
496
|
readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
497
497
|
}, undefined>], undefined>, undefined>, v.MinLengthAction<({
|
|
498
498
|
type?: "account_key" | null | undefined;
|
|
@@ -517,11 +517,11 @@ export declare const ANDCO_RAR_CATALOG: {
|
|
|
517
517
|
limit: "all";
|
|
518
518
|
} | {
|
|
519
519
|
type: "external";
|
|
520
|
-
|
|
521
|
-
account_type?:
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
520
|
+
bank_code?: string | null | undefined;
|
|
521
|
+
account_type?: "10" | "20" | "40" | null | undefined;
|
|
522
|
+
account_number?: string | null | undefined;
|
|
523
|
+
national_id?: string | null | undefined;
|
|
524
|
+
name?: string | null | undefined;
|
|
525
525
|
editable?: boolean | null | undefined;
|
|
526
526
|
})[], 1, undefined>, v.MaxLengthAction<({
|
|
527
527
|
type?: "account_key" | null | undefined;
|
|
@@ -546,11 +546,11 @@ export declare const ANDCO_RAR_CATALOG: {
|
|
|
546
546
|
limit: "all";
|
|
547
547
|
} | {
|
|
548
548
|
type: "external";
|
|
549
|
-
|
|
550
|
-
account_type?:
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
549
|
+
bank_code?: string | null | undefined;
|
|
550
|
+
account_type?: "10" | "20" | "40" | null | undefined;
|
|
551
|
+
account_number?: string | null | undefined;
|
|
552
|
+
national_id?: string | null | undefined;
|
|
553
|
+
name?: string | null | undefined;
|
|
554
554
|
editable?: boolean | null | undefined;
|
|
555
555
|
})[], 100, undefined>, v.MetadataAction<({
|
|
556
556
|
type?: "account_key" | null | undefined;
|
|
@@ -575,11 +575,11 @@ export declare const ANDCO_RAR_CATALOG: {
|
|
|
575
575
|
limit: "all";
|
|
576
576
|
} | {
|
|
577
577
|
type: "external";
|
|
578
|
-
|
|
579
|
-
account_type?:
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
578
|
+
bank_code?: string | null | undefined;
|
|
579
|
+
account_type?: "10" | "20" | "40" | null | undefined;
|
|
580
|
+
account_number?: string | null | undefined;
|
|
581
|
+
national_id?: string | null | undefined;
|
|
582
|
+
name?: string | null | undefined;
|
|
583
583
|
editable?: boolean | null | undefined;
|
|
584
584
|
})[], {
|
|
585
585
|
readonly uniqueItems: true;
|
|
@@ -597,6 +597,79 @@ export declare const ANDCO_RAR_CATALOG: {
|
|
|
597
597
|
readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
598
598
|
}, undefined>], undefined>, undefined>;
|
|
599
599
|
readonly budgets: v.OptionalSchema<v.NullSchema<undefined>, undefined>;
|
|
600
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
601
|
+
readonly type: v.LiteralSchema<"bank_transfer", undefined>;
|
|
602
|
+
readonly actions: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["read"], undefined>, undefined>, v.MinLengthAction<"read"[], 1, undefined>, v.MetadataAction<"read"[], {
|
|
603
|
+
readonly uniqueItems: true;
|
|
604
|
+
}>]>;
|
|
605
|
+
readonly locations: v.StrictTupleSchema<[v.LiteralSchema<"https://api.andco.com", undefined>], undefined>;
|
|
606
|
+
readonly subject: v.NullishSchema<v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
607
|
+
readonly type: v.LiteralSchema<"profile", undefined>;
|
|
608
|
+
readonly identifier: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
609
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
610
|
+
readonly type: v.LiteralSchema<"organization", undefined>;
|
|
611
|
+
readonly identifier: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
612
|
+
readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
613
|
+
}, undefined>], undefined>, undefined>;
|
|
614
|
+
readonly accounts: v.NullishSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StrictObjectSchema<{
|
|
615
|
+
readonly type: v.NullishSchema<v.LiteralSchema<"account_key", undefined>, undefined>;
|
|
616
|
+
readonly pattern: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
617
|
+
readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
618
|
+
readonly selection: v.NullishSchema<v.PicklistSchema<readonly ["single", "multiple"], undefined>, undefined>;
|
|
619
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
620
|
+
readonly type: v.LiteralSchema<"account", undefined>;
|
|
621
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
622
|
+
readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
623
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
624
|
+
readonly type: v.LiteralSchema<"any", undefined>;
|
|
625
|
+
readonly limit: v.LiteralSchema<"own", undefined>;
|
|
626
|
+
readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
627
|
+
readonly selection: v.NullishSchema<v.PicklistSchema<readonly ["single", "multiple"], undefined>, undefined>;
|
|
628
|
+
}, undefined>], undefined>, undefined>, v.MinLengthAction<({
|
|
629
|
+
type?: "account_key" | null | undefined;
|
|
630
|
+
pattern: string;
|
|
631
|
+
editable?: boolean | null | undefined;
|
|
632
|
+
selection?: "single" | "multiple" | null | undefined;
|
|
633
|
+
} | {
|
|
634
|
+
type: "account";
|
|
635
|
+
id: string;
|
|
636
|
+
editable?: boolean | null | undefined;
|
|
637
|
+
} | {
|
|
638
|
+
type: "any";
|
|
639
|
+
limit: "own";
|
|
640
|
+
editable?: boolean | null | undefined;
|
|
641
|
+
selection?: "single" | "multiple" | null | undefined;
|
|
642
|
+
})[], 1, undefined>, v.MaxLengthAction<({
|
|
643
|
+
type?: "account_key" | null | undefined;
|
|
644
|
+
pattern: string;
|
|
645
|
+
editable?: boolean | null | undefined;
|
|
646
|
+
selection?: "single" | "multiple" | null | undefined;
|
|
647
|
+
} | {
|
|
648
|
+
type: "account";
|
|
649
|
+
id: string;
|
|
650
|
+
editable?: boolean | null | undefined;
|
|
651
|
+
} | {
|
|
652
|
+
type: "any";
|
|
653
|
+
limit: "own";
|
|
654
|
+
editable?: boolean | null | undefined;
|
|
655
|
+
selection?: "single" | "multiple" | null | undefined;
|
|
656
|
+
})[], 100, undefined>, v.MetadataAction<({
|
|
657
|
+
type?: "account_key" | null | undefined;
|
|
658
|
+
pattern: string;
|
|
659
|
+
editable?: boolean | null | undefined;
|
|
660
|
+
selection?: "single" | "multiple" | null | undefined;
|
|
661
|
+
} | {
|
|
662
|
+
type: "account";
|
|
663
|
+
id: string;
|
|
664
|
+
editable?: boolean | null | undefined;
|
|
665
|
+
} | {
|
|
666
|
+
type: "any";
|
|
667
|
+
limit: "own";
|
|
668
|
+
editable?: boolean | null | undefined;
|
|
669
|
+
selection?: "single" | "multiple" | null | undefined;
|
|
670
|
+
})[], {
|
|
671
|
+
readonly uniqueItems: true;
|
|
672
|
+
}>]>, undefined>;
|
|
600
673
|
}, undefined>, v.StrictObjectSchema<{
|
|
601
674
|
readonly type: v.LiteralSchema<"bank_transfer", undefined>;
|
|
602
675
|
readonly actions: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["approve", "reject"], undefined>, undefined>, v.MinLengthAction<("approve" | "reject")[], 1, undefined>, v.MetadataAction<("approve" | "reject")[], {
|
|
@@ -685,11 +758,11 @@ export declare const ANDCO_RAR_CATALOG: {
|
|
|
685
758
|
readonly limit: v.LiteralSchema<"all", undefined>;
|
|
686
759
|
}, undefined>, v.StrictObjectSchema<{
|
|
687
760
|
readonly type: v.LiteralSchema<"external", undefined>;
|
|
688
|
-
readonly
|
|
689
|
-
readonly account_type: v.OptionalSchema<v.SchemaWithPipe<readonly [v.
|
|
690
|
-
readonly
|
|
691
|
-
readonly
|
|
692
|
-
readonly
|
|
761
|
+
readonly bank_code: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`.">]>, undefined>;
|
|
762
|
+
readonly account_type: v.OptionalSchema<v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "The account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>, undefined>;
|
|
763
|
+
readonly account_number: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
764
|
+
readonly national_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
765
|
+
readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
693
766
|
}, undefined>], undefined>, undefined>, v.MinLengthAction<({
|
|
694
767
|
type: "any";
|
|
695
768
|
limit: "all";
|
|
@@ -707,11 +780,11 @@ export declare const ANDCO_RAR_CATALOG: {
|
|
|
707
780
|
limit: "local";
|
|
708
781
|
} | {
|
|
709
782
|
type: "external";
|
|
710
|
-
|
|
711
|
-
account_type?:
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
783
|
+
bank_code?: string | undefined;
|
|
784
|
+
account_type?: "10" | "20" | "40" | undefined;
|
|
785
|
+
account_number?: string | undefined;
|
|
786
|
+
national_id?: string | undefined;
|
|
787
|
+
name?: string | undefined;
|
|
715
788
|
})[], 1, undefined>, v.MaxLengthAction<({
|
|
716
789
|
type: "any";
|
|
717
790
|
limit: "all";
|
|
@@ -729,11 +802,11 @@ export declare const ANDCO_RAR_CATALOG: {
|
|
|
729
802
|
limit: "local";
|
|
730
803
|
} | {
|
|
731
804
|
type: "external";
|
|
732
|
-
|
|
733
|
-
account_type?:
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
805
|
+
bank_code?: string | undefined;
|
|
806
|
+
account_type?: "10" | "20" | "40" | undefined;
|
|
807
|
+
account_number?: string | undefined;
|
|
808
|
+
national_id?: string | undefined;
|
|
809
|
+
name?: string | undefined;
|
|
737
810
|
})[], 100, undefined>, v.MetadataAction<({
|
|
738
811
|
type: "any";
|
|
739
812
|
limit: "all";
|
|
@@ -751,11 +824,11 @@ export declare const ANDCO_RAR_CATALOG: {
|
|
|
751
824
|
limit: "local";
|
|
752
825
|
} | {
|
|
753
826
|
type: "external";
|
|
754
|
-
|
|
755
|
-
account_type?:
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
827
|
+
bank_code?: string | undefined;
|
|
828
|
+
account_type?: "10" | "20" | "40" | undefined;
|
|
829
|
+
account_number?: string | undefined;
|
|
830
|
+
national_id?: string | undefined;
|
|
831
|
+
name?: string | undefined;
|
|
759
832
|
})[], {
|
|
760
833
|
readonly uniqueItems: true;
|
|
761
834
|
}>]>;
|
|
@@ -769,6 +842,58 @@ export declare const ANDCO_RAR_CATALOG: {
|
|
|
769
842
|
readonly minimum: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
770
843
|
readonly maximum: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
771
844
|
}, undefined>], undefined>, undefined>;
|
|
845
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
846
|
+
readonly type: v.LiteralSchema<"bank_transfer", undefined>;
|
|
847
|
+
readonly actions: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["read"], undefined>, undefined>, v.MinLengthAction<"read"[], 1, undefined>, v.MetadataAction<"read"[], {
|
|
848
|
+
readonly uniqueItems: true;
|
|
849
|
+
}>]>;
|
|
850
|
+
readonly locations: v.StrictTupleSchema<[v.LiteralSchema<"https://api.andco.com", undefined>], undefined>;
|
|
851
|
+
readonly subject: v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
852
|
+
readonly type: v.LiteralSchema<"profile", undefined>;
|
|
853
|
+
readonly identifier: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
854
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
855
|
+
readonly type: v.LiteralSchema<"organization", undefined>;
|
|
856
|
+
readonly identifier: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
857
|
+
}, undefined>], undefined>;
|
|
858
|
+
readonly accounts: v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StrictObjectSchema<{
|
|
859
|
+
readonly type: v.LiteralSchema<"account_key", undefined>;
|
|
860
|
+
readonly pattern: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
861
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
862
|
+
readonly type: v.LiteralSchema<"account", undefined>;
|
|
863
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
864
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
865
|
+
readonly type: v.LiteralSchema<"any", undefined>;
|
|
866
|
+
readonly limit: v.LiteralSchema<"own", undefined>;
|
|
867
|
+
}, undefined>], undefined>, undefined>, v.MinLengthAction<({
|
|
868
|
+
type: "account_key";
|
|
869
|
+
pattern: string;
|
|
870
|
+
} | {
|
|
871
|
+
type: "account";
|
|
872
|
+
id: string;
|
|
873
|
+
} | {
|
|
874
|
+
type: "any";
|
|
875
|
+
limit: "own";
|
|
876
|
+
})[], 1, undefined>, v.MaxLengthAction<({
|
|
877
|
+
type: "account_key";
|
|
878
|
+
pattern: string;
|
|
879
|
+
} | {
|
|
880
|
+
type: "account";
|
|
881
|
+
id: string;
|
|
882
|
+
} | {
|
|
883
|
+
type: "any";
|
|
884
|
+
limit: "own";
|
|
885
|
+
})[], 100, undefined>, v.MetadataAction<({
|
|
886
|
+
type: "account_key";
|
|
887
|
+
pattern: string;
|
|
888
|
+
} | {
|
|
889
|
+
type: "account";
|
|
890
|
+
id: string;
|
|
891
|
+
} | {
|
|
892
|
+
type: "any";
|
|
893
|
+
limit: "own";
|
|
894
|
+
})[], {
|
|
895
|
+
readonly uniqueItems: true;
|
|
896
|
+
}>]>;
|
|
772
897
|
}, undefined>, v.StrictObjectSchema<{
|
|
773
898
|
readonly type: v.LiteralSchema<"bank_transfer", undefined>;
|
|
774
899
|
readonly actions: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["approve", "reject"], undefined>, undefined>, v.MinLengthAction<("approve" | "reject")[], 1, undefined>, v.MetadataAction<("approve" | "reject")[], {
|
|
@@ -1090,11 +1215,11 @@ export declare const ANDCO_RAR_CATALOG: {
|
|
|
1090
1215
|
}, undefined>;
|
|
1091
1216
|
};
|
|
1092
1217
|
};
|
|
1093
|
-
/** Any
|
|
1218
|
+
/** Any AndCo authorization detail in its Grant Request form. */
|
|
1094
1219
|
export type AndcoGrantRequest = {
|
|
1095
1220
|
[Type in AndcoRarType]: v.InferOutput<(typeof ANDCO_RAR_CATALOG)[Type]["grantRequest"]>;
|
|
1096
1221
|
}[AndcoRarType];
|
|
1097
|
-
/** Any
|
|
1222
|
+
/** Any AndCo authorization detail in its Grant form, as `GET /authorization` returns it. */
|
|
1098
1223
|
export type AndcoGrant = {
|
|
1099
1224
|
[Type in AndcoRarType]: v.InferOutput<(typeof ANDCO_RAR_CATALOG)[Type]["grant"]>;
|
|
1100
1225
|
}[AndcoRarType];
|
|
@@ -1116,7 +1241,7 @@ export declare function isAndcoRarType(type: unknown): type is AndcoRarType;
|
|
|
1116
1241
|
/** Whether `type` is one of {@link ANDCO_RESERVED_RAR_TYPES}. */
|
|
1117
1242
|
export declare function isAndcoReservedRarType(type: unknown): type is AndcoReservedRarType;
|
|
1118
1243
|
/**
|
|
1119
|
-
* Whether an authorization detail is one of
|
|
1244
|
+
* Whether an authorization detail is one of AndCo's own types. Over a union with third-party details
|
|
1120
1245
|
* (`AndcoGrantDetail`) it narrows to {@link AndcoGrant}, which `detail["type"] === "bank_account"` cannot do:
|
|
1121
1246
|
* a third party may name its own types freely, so its `type` is any string.
|
|
1122
1247
|
*
|
|
@@ -1127,7 +1252,7 @@ export declare function isAndcoGrant(detail: {
|
|
|
1127
1252
|
readonly type: string;
|
|
1128
1253
|
}): detail is AndcoGrant;
|
|
1129
1254
|
/**
|
|
1130
|
-
* The rules of an
|
|
1255
|
+
* The rules of an AndCo authorization detail that already matches its schema, in either form: what
|
|
1131
1256
|
* JSON Schema cannot say, each answered as an {@link Issue} with its code in `type`.
|
|
1132
1257
|
*
|
|
1133
1258
|
* - `duplicate_action` at an action listed twice.
|
|
@@ -1153,7 +1278,7 @@ export declare function isAndcoGrant(detail: {
|
|
|
1153
1278
|
*/
|
|
1154
1279
|
export declare function andcoRarIssues(detail: AndcoGrantRequest | AndcoGrant): Issue[];
|
|
1155
1280
|
/**
|
|
1156
|
-
* Validates one
|
|
1281
|
+
* Validates one AndCo authorization detail in its Grant Request form, dispatching on `type`.
|
|
1157
1282
|
* Throws {@link AndcoRarError}: `not_implemented` for a reserved type, `invalid_request` otherwise.
|
|
1158
1283
|
*
|
|
1159
1284
|
* @example
|
|
@@ -1169,7 +1294,7 @@ export declare function andcoRarIssues(detail: AndcoGrantRequest | AndcoGrant):
|
|
|
1169
1294
|
*/
|
|
1170
1295
|
export declare function parseAndcoGrantRequest(detail: unknown): AndcoGrantRequest;
|
|
1171
1296
|
/**
|
|
1172
|
-
* Validates one
|
|
1297
|
+
* Validates one AndCo authorization detail in its Grant form, as `GET /authorization` returns it.
|
|
1173
1298
|
* Throws {@link AndcoRarError} like {@link parseAndcoGrantRequest}.
|
|
1174
1299
|
*
|
|
1175
1300
|
* @example
|
|
@@ -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,mJAUlB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,C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AAG,iBAAiB,GAAG,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
|
@@ -7,7 +7,7 @@ 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";
|
|
9
9
|
import { ADDRESS_ACTIONS, AddressGrantRequestSchema, AddressGrantSchema, IDENTITY_ACTIONS, IdentityGrantRequestSchema, IdentityGrantSchema, ORGANIZATION_ACTIONS, OrganizationGrantRequestSchema, OrganizationGrantSchema, PROFILE_ACTIONS, ProfileGrantRequestSchema, ProfileGrantSchema, } from "./subject-data.js";
|
|
10
|
-
/** Every authorization detail type
|
|
10
|
+
/** Every authorization detail type AndCo's Resource Server implements. */
|
|
11
11
|
export const ANDCO_RAR_TYPES = [
|
|
12
12
|
"bank_account",
|
|
13
13
|
"bank_transaction",
|
|
@@ -25,7 +25,7 @@ export const ANDCO_RAR_TYPES = [
|
|
|
25
25
|
*/
|
|
26
26
|
export const ANDCO_RESERVED_RAR_TYPES = ["bank_beneficiaries", "identity_documents"];
|
|
27
27
|
/**
|
|
28
|
-
* The whole
|
|
28
|
+
* The whole AndCo authorization detail catalog, keyed by type. The gate's seeds store `actions` as
|
|
29
29
|
* each type's registered actions and, as its request schema, the JSON Schema `ANDCO_RAR_JSON_SCHEMAS`
|
|
30
30
|
* holds, generated from `grantRequest`; a guard test compares them. The schemas describe shape only:
|
|
31
31
|
* the rules JSON Schema cannot say are {@link andcoRarIssues}, which the parse functions apply and
|
|
@@ -106,7 +106,7 @@ export function isAndcoReservedRarType(type) {
|
|
|
106
106
|
return typeof type === "string" && ANDCO_RESERVED_RAR_TYPES.includes(type);
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
|
-
* Whether an authorization detail is one of
|
|
109
|
+
* Whether an authorization detail is one of AndCo's own types. Over a union with third-party details
|
|
110
110
|
* (`AndcoGrantDetail`) it narrows to {@link AndcoGrant}, which `detail["type"] === "bank_account"` cannot do:
|
|
111
111
|
* a third party may name its own types freely, so its `type` is any string.
|
|
112
112
|
*
|
|
@@ -145,7 +145,7 @@ function parseForm(detail, form, caller) {
|
|
|
145
145
|
return result.output;
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
|
-
* The rules of an
|
|
148
|
+
* The rules of an AndCo authorization detail that already matches its schema, in either form: what
|
|
149
149
|
* JSON Schema cannot say, each answered as an {@link Issue} with its code in `type`.
|
|
150
150
|
*
|
|
151
151
|
* - `duplicate_action` at an action listed twice.
|
|
@@ -193,7 +193,7 @@ export function andcoRarIssues(detail) {
|
|
|
193
193
|
return issues;
|
|
194
194
|
}
|
|
195
195
|
/**
|
|
196
|
-
* Validates one
|
|
196
|
+
* Validates one AndCo authorization detail in its Grant Request form, dispatching on `type`.
|
|
197
197
|
* Throws {@link AndcoRarError}: `not_implemented` for a reserved type, `invalid_request` otherwise.
|
|
198
198
|
*
|
|
199
199
|
* @example
|
|
@@ -211,7 +211,7 @@ export function parseAndcoGrantRequest(detail) {
|
|
|
211
211
|
return parseForm(detail, "grantRequest", "parseAndcoGrantRequest");
|
|
212
212
|
}
|
|
213
213
|
/**
|
|
214
|
-
* Validates one
|
|
214
|
+
* Validates one AndCo authorization detail in its Grant form, as `GET /authorization` returns it.
|
|
215
215
|
* Throws {@link AndcoRarError} like {@link parseAndcoGrantRequest}.
|
|
216
216
|
*
|
|
217
217
|
* @example
|
package/dist/rar/detail.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { type Issue } from "../issues.js";
|
|
3
|
-
/** The `locations` every
|
|
3
|
+
/** The `locations` every AndCo authorization detail carries: AndCo's Resource Server, alone. */
|
|
4
4
|
export declare const ANDCO_RAR_LOCATIONS: readonly ["https://api.andco.com"];
|
|
5
5
|
/** Valibot schema of {@link ANDCO_RAR_LOCATIONS}. */
|
|
6
6
|
export declare const AndcoRarLocationsSchema: v.StrictTupleSchema<[v.LiteralSchema<"https://api.andco.com", undefined>], undefined>;
|
package/dist/rar/detail.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { ANDCO_API_ORIGIN } from "../constants.js";
|
|
3
3
|
import { duplicateIssues } from "../issues.js";
|
|
4
|
-
/** The `locations` every
|
|
4
|
+
/** The `locations` every AndCo authorization detail carries: AndCo's Resource Server, alone. */
|
|
5
5
|
export const ANDCO_RAR_LOCATIONS = [ANDCO_API_ORIGIN];
|
|
6
6
|
/** Valibot schema of {@link ANDCO_RAR_LOCATIONS}. */
|
|
7
7
|
export const AndcoRarLocationsSchema = /* @__PURE__ */ v.strictTuple([v.literal(ANDCO_API_ORIGIN)]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AndcoRarJsonSchemas } from "./catalog.js";
|
|
2
|
-
/** The draft-07 JSON Schema of every
|
|
2
|
+
/** The draft-07 JSON Schema of every AndCo authorization detail type, in both forms. */
|
|
3
3
|
export declare const ANDCO_RAR_JSON_SCHEMAS: AndcoRarJsonSchemas;
|
|
4
4
|
//# sourceMappingURL=json-schemas.generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schemas.generated.d.ts","sourceRoot":"","sources":["../../src/rar/json-schemas.generated.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,wFAAwF;AACxF,eAAO,MAAM,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"json-schemas.generated.d.ts","sourceRoot":"","sources":["../../src/rar/json-schemas.generated.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,wFAAwF;AACxF,eAAO,MAAM,sBAAsB,EAAE,mBAo2HpC,CAAC"}
|