@andco/protocol 0.0.14 → 0.0.15
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.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 +9 -9
- package/dist/errors.js +9 -9
- 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 +431 -872
- package/dist/intent-input.d.ts.map +1 -1
- package/dist/intent-input.js +142 -121
- package/dist/miniapp-manifest.d.ts +1 -1
- package/dist/native-intent.d.ts +82 -68
- package/dist/native-intent.d.ts.map +1 -1
- package/dist/native-intent.js +134 -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 +81 -81
- package/dist/rar/bank.js +1 -1
- package/dist/rar/catalog.d.ts +48 -48
- 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 +25 -21
- 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 +905 -528
- package/dist/rest/contract.d.ts.map +1 -1
- package/dist/rest/contract.js +17 -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.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 +787 -716
- package/dist/rest/intents.d.ts.map +1 -1
- package/dist/rest/intents.js +62 -53
- package/dist/rest/signatures.d.ts +11 -5
- package/dist/rest/signatures.d.ts.map +1 -1
- package/dist/rest/signatures.js +10 -0
- package/dist/rest/transfers.d.ts +612 -0
- package/dist/rest/transfers.d.ts.map +1 -0
- package/dist/rest/transfers.js +115 -0
- package/dist/scopes.d.ts +1 -1
- package/dist/signing.d.ts +12 -2
- package/dist/signing.d.ts.map +1 -1
- package/dist/signing.js +6 -0
- package/dist/transfer.d.ts +363 -0
- package/dist/transfer.d.ts.map +1 -0
- package/dist/transfer.js +287 -0
- package/dist/transport/financial-events.d.ts +21 -17
- package/dist/transport/financial-events.d.ts.map +1 -1
- package/dist/transport/generated/oauth-api.d.ts +1017 -194
- package/dist/transport/generated/oauth-api.d.ts.map +1 -1
- package/dist/transport/intents.d.ts +28 -12
- package/dist/transport/intents.d.ts.map +1 -1
- package/dist/transport/intents.js +1 -1
- package/dist/transport/rest.d.ts +4 -4
- 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/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,mBAo/GpC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** The draft-07 JSON Schema of every
|
|
1
|
+
/** The draft-07 JSON Schema of every AndCo authorization detail type, in both forms. */
|
|
2
2
|
export const ANDCO_RAR_JSON_SCHEMAS = {
|
|
3
3
|
"bank_account": {
|
|
4
4
|
"grantRequest": {
|
|
@@ -1568,13 +1568,12 @@ export const ANDCO_RAR_JSON_SCHEMAS = {
|
|
|
1568
1568
|
"type": {
|
|
1569
1569
|
"const": "external"
|
|
1570
1570
|
},
|
|
1571
|
-
"
|
|
1571
|
+
"bank_code": {
|
|
1572
1572
|
"anyOf": [
|
|
1573
1573
|
{
|
|
1574
1574
|
"type": "string",
|
|
1575
|
-
"
|
|
1576
|
-
"
|
|
1577
|
-
"pattern": "\\S"
|
|
1575
|
+
"pattern": "^\\d{4}$",
|
|
1576
|
+
"description": "The bank's four-digit code in Core's catalog. Andco is `0739`."
|
|
1578
1577
|
},
|
|
1579
1578
|
{
|
|
1580
1579
|
"type": "null"
|
|
@@ -1584,17 +1583,20 @@ export const ANDCO_RAR_JSON_SCHEMAS = {
|
|
|
1584
1583
|
"account_type": {
|
|
1585
1584
|
"anyOf": [
|
|
1586
1585
|
{
|
|
1586
|
+
"enum": [
|
|
1587
|
+
"10",
|
|
1588
|
+
"20",
|
|
1589
|
+
"40"
|
|
1590
|
+
],
|
|
1587
1591
|
"type": "string",
|
|
1588
|
-
"
|
|
1589
|
-
"maxLength": 128,
|
|
1590
|
-
"pattern": "\\S"
|
|
1592
|
+
"description": "Core's account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista)."
|
|
1591
1593
|
},
|
|
1592
1594
|
{
|
|
1593
1595
|
"type": "null"
|
|
1594
1596
|
}
|
|
1595
1597
|
]
|
|
1596
1598
|
},
|
|
1597
|
-
"
|
|
1599
|
+
"account_number": {
|
|
1598
1600
|
"anyOf": [
|
|
1599
1601
|
{
|
|
1600
1602
|
"type": "string",
|
|
@@ -1607,7 +1609,7 @@ export const ANDCO_RAR_JSON_SCHEMAS = {
|
|
|
1607
1609
|
}
|
|
1608
1610
|
]
|
|
1609
1611
|
},
|
|
1610
|
-
"
|
|
1612
|
+
"national_id": {
|
|
1611
1613
|
"anyOf": [
|
|
1612
1614
|
{
|
|
1613
1615
|
"type": "string",
|
|
@@ -1620,7 +1622,7 @@ export const ANDCO_RAR_JSON_SCHEMAS = {
|
|
|
1620
1622
|
}
|
|
1621
1623
|
]
|
|
1622
1624
|
},
|
|
1623
|
-
"
|
|
1625
|
+
"name": {
|
|
1624
1626
|
"anyOf": [
|
|
1625
1627
|
{
|
|
1626
1628
|
"type": "string",
|
|
@@ -2117,31 +2119,33 @@ export const ANDCO_RAR_JSON_SCHEMAS = {
|
|
|
2117
2119
|
"type": {
|
|
2118
2120
|
"const": "external"
|
|
2119
2121
|
},
|
|
2120
|
-
"
|
|
2122
|
+
"bank_code": {
|
|
2121
2123
|
"type": "string",
|
|
2122
|
-
"
|
|
2123
|
-
"
|
|
2124
|
-
"pattern": "\\S"
|
|
2124
|
+
"pattern": "^\\d{4}$",
|
|
2125
|
+
"description": "The bank's four-digit code in Core's catalog. Andco is `0739`."
|
|
2125
2126
|
},
|
|
2126
2127
|
"account_type": {
|
|
2128
|
+
"enum": [
|
|
2129
|
+
"10",
|
|
2130
|
+
"20",
|
|
2131
|
+
"40"
|
|
2132
|
+
],
|
|
2127
2133
|
"type": "string",
|
|
2128
|
-
"
|
|
2129
|
-
"maxLength": 128,
|
|
2130
|
-
"pattern": "\\S"
|
|
2134
|
+
"description": "Core's account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista)."
|
|
2131
2135
|
},
|
|
2132
|
-
"
|
|
2136
|
+
"account_number": {
|
|
2133
2137
|
"type": "string",
|
|
2134
2138
|
"minLength": 1,
|
|
2135
2139
|
"maxLength": 128,
|
|
2136
2140
|
"pattern": "\\S"
|
|
2137
2141
|
},
|
|
2138
|
-
"
|
|
2142
|
+
"national_id": {
|
|
2139
2143
|
"type": "string",
|
|
2140
2144
|
"minLength": 1,
|
|
2141
2145
|
"maxLength": 128,
|
|
2142
2146
|
"pattern": "\\S"
|
|
2143
2147
|
},
|
|
2144
|
-
"
|
|
2148
|
+
"name": {
|
|
2145
2149
|
"type": "string",
|
|
2146
2150
|
"minLength": 1,
|
|
2147
2151
|
"maxLength": 128,
|
|
@@ -8,7 +8,7 @@ export declare const ORGANIZATION_ACTIONS: readonly ["list"];
|
|
|
8
8
|
/** Editing the signed-in person's Profile. Replaces the former `profile:write` scope. */
|
|
9
9
|
export declare const PROFILE_ACTIONS: readonly ["update"];
|
|
10
10
|
/**
|
|
11
|
-
* The `validation` of an `identity` detail: the application asks that
|
|
11
|
+
* The `validation` of an `identity` detail: the application asks that AndCo Core has validated the
|
|
12
12
|
* person's identity (the ID card, a liveness check and the comparison of the face with the card's),
|
|
13
13
|
* and reads that validation together with the identity.
|
|
14
14
|
*
|
package/dist/rar/subject-data.js
CHANGED
|
@@ -10,7 +10,7 @@ export const ORGANIZATION_ACTIONS = ["list"];
|
|
|
10
10
|
/** Editing the signed-in person's Profile. Replaces the former `profile:write` scope. */
|
|
11
11
|
export const PROFILE_ACTIONS = ["update"];
|
|
12
12
|
/**
|
|
13
|
-
* The `validation` of an `identity` detail: the application asks that
|
|
13
|
+
* The `validation` of an `identity` detail: the application asks that AndCo Core has validated the
|
|
14
14
|
* person's identity (the ID card, a liveness check and the comparison of the face with the card's),
|
|
15
15
|
* and reads that validation together with the identity.
|
|
16
16
|
*
|
package/dist/rar/subject.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare const OrganizationSubjectPickerSchema: v.StrictObjectSchema<{
|
|
|
37
37
|
}, undefined>;
|
|
38
38
|
/**
|
|
39
39
|
* Whose resources a Grant Request asks for. `null` or absent takes the type's default (the
|
|
40
|
-
* signed-in Profile for every
|
|
40
|
+
* signed-in Profile for every AndCo type that has a subject). `attr?`, `undefined` and `null` mean
|
|
41
41
|
* the same in a Grant Request.
|
|
42
42
|
*
|
|
43
43
|
* @example
|
package/dist/rar/subject.js
CHANGED
|
@@ -39,7 +39,7 @@ export const OrganizationSubjectPickerSchema = /* @__PURE__ */ v.strictObject({
|
|
|
39
39
|
});
|
|
40
40
|
/**
|
|
41
41
|
* Whose resources a Grant Request asks for. `null` or absent takes the type's default (the
|
|
42
|
-
* signed-in Profile for every
|
|
42
|
+
* signed-in Profile for every AndCo type that has a subject). `attr?`, `undefined` and `null` mean
|
|
43
43
|
* the same in a Grant Request.
|
|
44
44
|
*
|
|
45
45
|
* @example
|
package/dist/rest/accounts.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { InsufficientAuthorization, InvalidIdentifier, InvalidOrigin, InvalidRequest, InvalidToken, NotFound, ServerError, TemporarilyUnavailable, UnsupportedVersion } from "./common.js";
|
|
3
3
|
/**
|
|
4
|
-
* A decimal figure issued by
|
|
5
|
-
* no bound on its digits.
|
|
6
|
-
* byte with
|
|
7
|
-
* legitimate
|
|
4
|
+
* A decimal figure issued by AndCo, as AndCo sent it: a string, never a number, with
|
|
5
|
+
* no bound on its digits. AndCo republishes it untouched so a reconciliation can compare it byte for
|
|
6
|
+
* byte with AndCo's own record; tightening it would turn a quirk of AndCo into the refusal of a
|
|
7
|
+
* legitimate fact.
|
|
8
8
|
*/
|
|
9
9
|
export declare const BankDecimal: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
10
10
|
declare const BankConnectionInteractionRequired_base: (abstract new (data: {
|
|
@@ -25,12 +25,12 @@ declare const BankConnectionInteractionRequired_base: (abstract new (data: {
|
|
|
25
25
|
readonly error: "interaction_required";
|
|
26
26
|
readonly status: 409;
|
|
27
27
|
readonly data: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
28
|
-
readonly code: v.SchemaWithPipe<readonly [v.PicklistSchema<["bank_connection_pin_required", "bank_connection_reconnect_required", "bank_representative_replacement_required"], undefined>, v.DescriptionAction<"bank_connection_pin_required" | "bank_connection_reconnect_required" | "bank_representative_replacement_required", "What the person has to do: type the web
|
|
28
|
+
readonly code: v.SchemaWithPipe<readonly [v.PicklistSchema<["bank_connection_pin_required", "bank_connection_reconnect_required", "bank_representative_replacement_required"], undefined>, v.DescriptionAction<"bank_connection_pin_required" | "bank_connection_reconnect_required" | "bank_representative_replacement_required", "What the person has to do: type the web AndPass (`bank_connection_pin_required`), connect the account again (`bank_connection_reconnect_required`) or, for an Organization, connect another account representative (`bank_representative_replacement_required`).">]>;
|
|
29
29
|
readonly interaction_url: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "Where in Platform the person does what `code` names.">]>;
|
|
30
30
|
}, undefined>, v.DescriptionAction<{
|
|
31
31
|
code: "bank_connection_pin_required" | "bank_connection_reconnect_required" | "bank_representative_replacement_required";
|
|
32
32
|
interaction_url?: string | undefined;
|
|
33
|
-
}, "The subject's
|
|
33
|
+
}, "The subject's AndCo account connection needs the person back before AndCo can answer for them.">]>;
|
|
34
34
|
define<const Code extends string, const Status extends number, Data extends import("./api-error.js").AndcoAPIErrorDataSchema>(error: Code, status: Status, data: Data): (abstract new (data: v.InferOutput<Data>, message?: string, hint?: string) => {
|
|
35
35
|
readonly error: Code;
|
|
36
36
|
readonly hint?: string;
|
|
@@ -47,7 +47,7 @@ declare const BankConnectionInteractionRequired_base: (abstract new (data: {
|
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
50
|
-
* The subject's connection with
|
|
50
|
+
* The subject's connection with AndCo needs the person back before AndCo can answer for them.
|
|
51
51
|
* `code` says what the person has to do, and `interaction_url` is where they do it in Platform.
|
|
52
52
|
* Nothing is wrong with the Grant: the same request succeeds afterwards, and retrying before then
|
|
53
53
|
* answers the same.
|
|
@@ -100,7 +100,7 @@ declare const InvalidCursor_base: (abstract new (data: {}, message?: string, hin
|
|
|
100
100
|
}) & {
|
|
101
101
|
readonly error: "invalid_cursor";
|
|
102
102
|
readonly status: 400;
|
|
103
|
-
readonly data: v.SchemaWithPipe<readonly [v.ObjectSchema<{}, undefined>, v.DescriptionAction<{}, "`after` is not a cursor
|
|
103
|
+
readonly data: v.SchemaWithPipe<readonly [v.ObjectSchema<{}, undefined>, v.DescriptionAction<{}, "`after` is not a cursor AndCo issued.">]>;
|
|
104
104
|
define<const Code extends string, const Status extends number, Data extends import("./api-error.js").AndcoAPIErrorDataSchema>(error: Code, status: Status, data: Data): (abstract new (data: v.InferOutput<Data>, message?: string, hint?: string) => {
|
|
105
105
|
readonly error: Code;
|
|
106
106
|
readonly hint?: string;
|
|
@@ -117,13 +117,13 @@ declare const InvalidCursor_base: (abstract new (data: {}, message?: string, hin
|
|
|
117
117
|
};
|
|
118
118
|
};
|
|
119
119
|
/**
|
|
120
|
-
* The `after` of the transactions walk is not the cursor
|
|
121
|
-
*
|
|
120
|
+
* The `after` of the transactions walk is not the cursor AndCo issued for the next page. The
|
|
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 {
|
|
124
124
|
constructor(message?: string);
|
|
125
125
|
}
|
|
126
|
-
/** One of the subject's personal
|
|
126
|
+
/** One of the subject's personal digital accounts. */
|
|
127
127
|
export declare const BankAccount: v.StrictObjectSchema<{
|
|
128
128
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
129
129
|
readonly accountKey: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Account Key its holder chose, or null for an account opened before account keys existed. Exact-match input for `GET /accounts?accountKey=`.">]>;
|
|
@@ -131,9 +131,9 @@ export declare const BankAccount: v.StrictObjectSchema<{
|
|
|
131
131
|
readonly number: v.StringSchema<undefined>;
|
|
132
132
|
readonly type: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Null while the balance projection does not know the account yet.">]>;
|
|
133
133
|
readonly currency: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "Null while the balance projection does not know the account yet.">]>;
|
|
134
|
-
readonly balance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The ledger balance
|
|
134
|
+
readonly balance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The ledger balance AndCo maintains for the account, as a decimal string, never a number. It is what the account holds after its last movement; funds on hold are not subtracted from it. Null while the balance projection does not know the account yet, for example right after it is opened, and null when the Grant lacks `read_balance`; a listing never fails for it and never makes up a zero.">]>;
|
|
135
135
|
}, undefined>;
|
|
136
|
-
/** One of the subject's personal
|
|
136
|
+
/** One of the subject's personal digital accounts. */
|
|
137
137
|
export type BankAccount = v.InferOutput<typeof BankAccount>;
|
|
138
138
|
/** A page of the subject's accounts. */
|
|
139
139
|
export declare const AccountPage: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
@@ -146,7 +146,7 @@ export declare const AccountPage: v.SchemaWithPipe<readonly [v.StrictObjectSchem
|
|
|
146
146
|
readonly number: v.StringSchema<undefined>;
|
|
147
147
|
readonly type: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Null while the balance projection does not know the account yet.">]>;
|
|
148
148
|
readonly currency: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "Null while the balance projection does not know the account yet.">]>;
|
|
149
|
-
readonly balance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The ledger balance
|
|
149
|
+
readonly balance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The ledger balance AndCo maintains for the account, as a decimal string, never a number. It is what the account holds after its last movement; funds on hold are not subtracted from it. Null while the balance projection does not know the account yet, for example right after it is opened, and null when the Grant lacks `read_balance`; a listing never fails for it and never makes up a zero.">]>;
|
|
150
150
|
}, undefined>;
|
|
151
151
|
}, undefined>, undefined>;
|
|
152
152
|
readonly pageInfo: v.StrictObjectSchema<{
|
|
@@ -176,24 +176,24 @@ export declare const AccountPage: v.SchemaWithPipe<readonly [v.StrictObjectSchem
|
|
|
176
176
|
};
|
|
177
177
|
}, string>]>;
|
|
178
178
|
/**
|
|
179
|
-
* One account transaction, as
|
|
179
|
+
* One account transaction, as AndCo reports it. Keys are camelCase because this schema describes
|
|
180
180
|
* the wire shape the server sends here, which differs from the snake_case of the rest of the
|
|
181
|
-
* contract; `movement_type` keeps
|
|
181
|
+
* contract; `movement_type` keeps AndCo's own field name.
|
|
182
182
|
*/
|
|
183
183
|
export declare const BankTransaction: v.StrictObjectSchema<{
|
|
184
184
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
185
185
|
readonly transactionId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
186
186
|
readonly description: v.StringSchema<undefined>;
|
|
187
|
-
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Issued by
|
|
188
|
-
readonly movement_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["deposit", "interest", "withdrawal"], undefined>, v.DescriptionAction<"deposit" | "interest" | "withdrawal", "The kind of movement, under
|
|
187
|
+
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Issued by AndCo and republished exactly as AndCo sent it, with none of the digit-count bound of an AndCo-defined amount. What tells an inflow from an outflow is `movement_type`, not a sign: AndCo sends the amount as a positive figure.">]>;
|
|
188
|
+
readonly movement_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["deposit", "interest", "withdrawal"], undefined>, v.DescriptionAction<"deposit" | "interest" | "withdrawal", "The kind of movement, under AndCo's own field name and in its 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.">]>;
|
|
189
189
|
readonly origin: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
190
190
|
readonly date: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
191
|
-
readonly runningBalance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "Same provenance as `amount`: issued by
|
|
191
|
+
readonly runningBalance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "Same provenance as `amount`: issued by AndCo and republished exactly, never normalized. Real balances do go negative, so the sign is not narrowed away.">]>;
|
|
192
192
|
readonly paymentType: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
193
193
|
readonly reversed: v.BooleanSchema<undefined>;
|
|
194
194
|
readonly note: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
195
195
|
}, undefined>;
|
|
196
|
-
/** One account transaction, as
|
|
196
|
+
/** One account transaction, as AndCo reports it. */
|
|
197
197
|
export type BankTransaction = v.InferOutput<typeof BankTransaction>;
|
|
198
198
|
/** A page of one account's transactions, read live from the bank. */
|
|
199
199
|
export declare const BankTransactionPage: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
@@ -203,11 +203,11 @@ export declare const BankTransactionPage: v.SchemaWithPipe<readonly [v.StrictObj
|
|
|
203
203
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
204
204
|
readonly transactionId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
205
205
|
readonly description: v.StringSchema<undefined>;
|
|
206
|
-
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Issued by
|
|
207
|
-
readonly movement_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["deposit", "interest", "withdrawal"], undefined>, v.DescriptionAction<"deposit" | "interest" | "withdrawal", "The kind of movement, under
|
|
206
|
+
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Issued by AndCo and republished exactly as AndCo sent it, with none of the digit-count bound of an AndCo-defined amount. What tells an inflow from an outflow is `movement_type`, not a sign: AndCo sends the amount as a positive figure.">]>;
|
|
207
|
+
readonly movement_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["deposit", "interest", "withdrawal"], undefined>, v.DescriptionAction<"deposit" | "interest" | "withdrawal", "The kind of movement, under AndCo's own field name and in its 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.">]>;
|
|
208
208
|
readonly origin: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
209
209
|
readonly date: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
210
|
-
readonly runningBalance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "Same provenance as `amount`: issued by
|
|
210
|
+
readonly runningBalance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "Same provenance as `amount`: issued by AndCo and republished exactly, never normalized. Real balances do go negative, so the sign is not narrowed away.">]>;
|
|
211
211
|
readonly paymentType: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
212
212
|
readonly reversed: v.BooleanSchema<undefined>;
|
|
213
213
|
readonly note: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -243,7 +243,7 @@ export declare const BankTransactionPage: v.SchemaWithPipe<readonly [v.StrictObj
|
|
|
243
243
|
hasNextPage: boolean;
|
|
244
244
|
};
|
|
245
245
|
}, string>]>;
|
|
246
|
-
/** Lists the personal
|
|
246
|
+
/** Lists the personal digital accounts the Grant reaches, with their balances. */
|
|
247
247
|
export declare const listAccounts: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.ObjectSchema<{
|
|
248
248
|
readonly offset: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "Nonnegative position in live ordered results.">]>, undefined>;
|
|
249
249
|
readonly limit: 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, "Offset page size; do not combine with cursor arguments.">]>;
|
|
@@ -262,7 +262,7 @@ export declare const listAccounts: import("@orpc/contract").ProcedureContractBui
|
|
|
262
262
|
readonly number: v.StringSchema<undefined>;
|
|
263
263
|
readonly type: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Null while the balance projection does not know the account yet.">]>;
|
|
264
264
|
readonly currency: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "Null while the balance projection does not know the account yet.">]>;
|
|
265
|
-
readonly balance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The ledger balance
|
|
265
|
+
readonly balance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The ledger balance AndCo maintains for the account, as a decimal string, never a number. It is what the account holds after its last movement; funds on hold are not subtracted from it. Null while the balance projection does not know the account yet, for example right after it is opened, and null when the Grant lacks `read_balance`; a listing never fails for it and never makes up a zero.">]>;
|
|
266
266
|
}, undefined>;
|
|
267
267
|
}, undefined>, undefined>;
|
|
268
268
|
readonly pageInfo: v.StrictObjectSchema<{
|
|
@@ -303,11 +303,11 @@ export declare const listAccountTransactions: import("@orpc/contract").Procedure
|
|
|
303
303
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
304
304
|
readonly transactionId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
305
305
|
readonly description: v.StringSchema<undefined>;
|
|
306
|
-
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Issued by
|
|
307
|
-
readonly movement_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["deposit", "interest", "withdrawal"], undefined>, v.DescriptionAction<"deposit" | "interest" | "withdrawal", "The kind of movement, under
|
|
306
|
+
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Issued by AndCo and republished exactly as AndCo sent it, with none of the digit-count bound of an AndCo-defined amount. What tells an inflow from an outflow is `movement_type`, not a sign: AndCo sends the amount as a positive figure.">]>;
|
|
307
|
+
readonly movement_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["deposit", "interest", "withdrawal"], undefined>, v.DescriptionAction<"deposit" | "interest" | "withdrawal", "The kind of movement, under AndCo's own field name and in its 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.">]>;
|
|
308
308
|
readonly origin: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
309
309
|
readonly date: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
310
|
-
readonly runningBalance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "Same provenance as `amount`: issued by
|
|
310
|
+
readonly runningBalance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "Same provenance as `amount`: issued by AndCo and republished exactly, never normalized. Real balances do go negative, so the sign is not narrowed away.">]>;
|
|
311
311
|
readonly paymentType: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
312
312
|
readonly reversed: v.BooleanSchema<undefined>;
|
|
313
313
|
readonly note: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -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,eAAe,CAAC,sCAsBtE;gBAEG,IAAI,EAAE;QAAE,IAAI,EAAE,iCAAiC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,EAC3F,OAAO,CAAC,EAAE,MAAM;CAInB;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED,yGAAyG;AACzG,qBAAa,qBAAsB,SAAQ,eAAe,CAAC,0BAI1D;gBACa,OAAO,CAAC,EAAE,MAAM;CAG7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED;;;GAGG;AACH,qBAAa,aAAc,SAAQ,eAAe,CAAC,kBAIlD;gBACa,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,
|
|
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,eAAe,CAAC,sCAsBtE;gBAEG,IAAI,EAAE;QAAE,IAAI,EAAE,iCAAiC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,EAC3F,OAAO,CAAC,EAAE,MAAM;CAInB;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED,yGAAyG;AACzG,qBAAa,qBAAsB,SAAQ,eAAe,CAAC,0BAI1D;gBACa,OAAO,CAAC,EAAE,MAAM;CAG7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED;;;GAGG;AACH,qBAAa,aAAc,SAAQ,eAAe,CAAC,kBAIlD;gBACa,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,sDAAsD;AACtD,eAAO,MAAM,WAAW;;;;;;;;aA6BtB,CAAC;AAEH,sDAAsD;AACtD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,WAAW,CAAC,CAAC;AAE5D,wCAAwC;AACxC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAGvB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;aA2B1B,CAAC;AAEH,oDAAoD;AACpD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,eAAe,CAAC,CAAC;AAEpE,qEAAqE;AACrE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAG/B,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6TAiCH,CAAC;AAEvB,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gWAoCN,CAAC"}
|
package/dist/rest/accounts.js
CHANGED
|
@@ -5,14 +5,14 @@ import { AndcoAPIError, errors } from "./api-error.js";
|
|
|
5
5
|
import { connection, cursorlessConnection, ForwardPageQuery, InsufficientAuthorization, InvalidIdentifier, InvalidOrigin, InvalidRequest, InvalidToken, NotFound, PageQuery, ServerError, TemporarilyUnavailable, UnsupportedVersion, } from "./common.js";
|
|
6
6
|
import { http } from "./http.js";
|
|
7
7
|
/**
|
|
8
|
-
* A decimal figure issued by
|
|
9
|
-
* no bound on its digits.
|
|
10
|
-
* byte with
|
|
11
|
-
* legitimate
|
|
8
|
+
* A decimal figure issued by AndCo, as AndCo sent it: a string, never a number, with
|
|
9
|
+
* no bound on its digits. AndCo republishes it untouched so a reconciliation can compare it byte for
|
|
10
|
+
* byte with AndCo's own record; tightening it would turn a quirk of AndCo into the refusal of a
|
|
11
|
+
* legitimate fact.
|
|
12
12
|
*/
|
|
13
13
|
export const BankDecimal = /* @__PURE__ */ v.pipe(v.string(), v.regex(/^-?[0-9]+(?:\.[0-9]+)?$/));
|
|
14
14
|
/**
|
|
15
|
-
* The subject's connection with
|
|
15
|
+
* The subject's connection with AndCo needs the person back before AndCo can answer for them.
|
|
16
16
|
* `code` says what the person has to do, and `interaction_url` is where they do it in Platform.
|
|
17
17
|
* Nothing is wrong with the Grant: the same request succeeds afterwards, and retrying before then
|
|
18
18
|
* answers the same.
|
|
@@ -22,9 +22,9 @@ export class BankConnectionInteractionRequired extends /* @__PURE__ */ AndcoAPIE
|
|
|
22
22
|
"bank_connection_pin_required",
|
|
23
23
|
"bank_connection_reconnect_required",
|
|
24
24
|
"bank_representative_replacement_required",
|
|
25
|
-
]), v.description("What the person has to do: type the web
|
|
25
|
+
]), v.description("What the person has to do: type the web AndPass (`bank_connection_pin_required`), connect the account again (`bank_connection_reconnect_required`) or, for an Organization, connect another account representative (`bank_representative_replacement_required`).")),
|
|
26
26
|
interaction_url: v.pipe(v.optional(v.pipe(v.string(), v.url())), v.description("Where in Platform the person does what `code` names.")),
|
|
27
|
-
}), v.description("The subject's
|
|
27
|
+
}), v.description("The subject's AndCo account connection needs the person back before AndCo can answer for them."))) {
|
|
28
28
|
constructor(data, message) {
|
|
29
29
|
super(data, message);
|
|
30
30
|
}
|
|
@@ -36,15 +36,15 @@ export class InvalidAccountsCursor extends /* @__PURE__ */ AndcoAPIError.define(
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* The `after` of the transactions walk is not the cursor
|
|
40
|
-
*
|
|
39
|
+
* The `after` of the transactions walk is not the cursor AndCo issued for the next page. The
|
|
40
|
+
* AndCo's cursor travels untouched: take it from `pageInfo.endCursor` and nothing else.
|
|
41
41
|
*/
|
|
42
|
-
export class InvalidCursor extends /* @__PURE__ */ AndcoAPIError.define("invalid_cursor", 400, v.pipe(v.object({}), v.description("`after` is not a cursor
|
|
42
|
+
export class InvalidCursor extends /* @__PURE__ */ AndcoAPIError.define("invalid_cursor", 400, v.pipe(v.object({}), v.description("`after` is not a cursor AndCo issued."))) {
|
|
43
43
|
constructor(message) {
|
|
44
44
|
super({}, message);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
/** One of the subject's personal
|
|
47
|
+
/** One of the subject's personal digital accounts. */
|
|
48
48
|
export const BankAccount = /* @__PURE__ */ v.strictObject({
|
|
49
49
|
id: v.pipe(v.string(), v.uuid()),
|
|
50
50
|
accountKey: v.pipe(v.nullable(AccountKeySchema), v.description("The Account Key its holder chose, or null for an account opened before account keys existed. Exact-match input for `GET /accounts?accountKey=`.")),
|
|
@@ -52,38 +52,38 @@ export const BankAccount = /* @__PURE__ */ v.strictObject({
|
|
|
52
52
|
number: v.string(),
|
|
53
53
|
type: v.pipe(v.nullable(v.string()), v.description("Null while the balance projection does not know the account yet.")),
|
|
54
54
|
currency: v.pipe(v.nullable(v.pipe(v.string(), v.regex(/^[A-Z]{3}$/))), v.description("Null while the balance projection does not know the account yet.")),
|
|
55
|
-
balance: v.pipe(v.nullable(BankDecimal), v.description("The ledger balance
|
|
55
|
+
balance: v.pipe(v.nullable(BankDecimal), v.description("The ledger balance AndCo maintains for the account, as a decimal string, never a number. It is what the account holds after its last movement; funds on hold are not subtracted from it. Null while the balance projection does not know the account yet, for example right after it is opened, and null when the Grant lacks `read_balance`; a listing never fails for it and never makes up a zero.")),
|
|
56
56
|
});
|
|
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 transaction, as
|
|
60
|
+
* One account transaction, as AndCo reports it. Keys are camelCase because this schema describes
|
|
61
61
|
* the wire shape the server sends here, which differs from the snake_case of the rest of the
|
|
62
|
-
* contract; `movement_type` keeps
|
|
62
|
+
* contract; `movement_type` keeps AndCo's own field name.
|
|
63
63
|
*/
|
|
64
64
|
export const BankTransaction = /* @__PURE__ */ v.strictObject({
|
|
65
65
|
id: v.pipe(v.string(), v.uuid()),
|
|
66
66
|
transactionId: v.nullable(v.string()),
|
|
67
67
|
description: v.string(),
|
|
68
|
-
amount: v.pipe(BankDecimal, v.description("Issued by
|
|
69
|
-
movement_type: v.pipe(v.picklist(["deposit", "interest", "withdrawal"]), v.description("The kind of movement, under
|
|
68
|
+
amount: v.pipe(BankDecimal, v.description("Issued by AndCo and republished exactly as AndCo sent it, with none of the digit-count bound of an AndCo-defined amount. What tells an inflow from an outflow is `movement_type`, not a sign: AndCo sends the amount as a positive figure.")),
|
|
69
|
+
movement_type: v.pipe(v.picklist(["deposit", "interest", "withdrawal"]), v.description("The kind of movement, under AndCo's own field name and in its 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.")),
|
|
70
70
|
origin: v.nullable(v.string()),
|
|
71
71
|
date: v.pipe(v.string(), v.isoTimestamp()),
|
|
72
|
-
runningBalance: v.pipe(v.nullable(BankDecimal), v.description("Same provenance as `amount`: issued by
|
|
72
|
+
runningBalance: v.pipe(v.nullable(BankDecimal), v.description("Same provenance as `amount`: issued by AndCo and republished exactly, never normalized. Real balances do go negative, so the sign is not narrowed away.")),
|
|
73
73
|
paymentType: v.nullable(v.string()),
|
|
74
74
|
reversed: v.boolean(),
|
|
75
75
|
note: v.nullable(v.string()),
|
|
76
76
|
});
|
|
77
77
|
/** A page of one account's transactions, read live from the bank. */
|
|
78
|
-
export const BankTransactionPage = /* @__PURE__ */ cursorlessConnection(BankTransaction, "A connection read live from
|
|
79
|
-
/** Lists the personal
|
|
78
|
+
export const BankTransactionPage = /* @__PURE__ */ cursorlessConnection(BankTransaction, "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 transaction.");
|
|
79
|
+
/** Lists the personal digital accounts the Grant reaches, with their balances. */
|
|
80
80
|
export const listAccounts = /* @__PURE__ */ oc
|
|
81
81
|
.meta(http({
|
|
82
82
|
method: "GET",
|
|
83
83
|
path: "/accounts",
|
|
84
|
-
summary: "List personal
|
|
84
|
+
summary: "List personal digital accounts and balances",
|
|
85
85
|
description: "Paginated by cursor, in publication order. `?accountKey=` switches from walking the collection to addressing one account by the identifier its holder chose: an exact match, not a search, and `after`/`first` are ignored alongside it. Returns edges and camelCase pageInfo. Cursor and offset argument families cannot be mixed.",
|
|
86
|
-
successDescription: "Active
|
|
86
|
+
successDescription: "Active digital accounts granted by bank_accounts:read",
|
|
87
87
|
}))
|
|
88
88
|
.errors(errors(InvalidRequest, InvalidAccountsCursor, InvalidToken, InvalidOrigin, InsufficientAuthorization, UnsupportedVersion, ServerError, BankConnectionInteractionRequired, TemporarilyUnavailable))
|
|
89
89
|
.input(v.object({
|
|
@@ -97,7 +97,7 @@ export const listAccountTransactions = /* @__PURE__ */ oc
|
|
|
97
97
|
method: "GET",
|
|
98
98
|
path: "/accounts/{bank_account_id}/transactions",
|
|
99
99
|
summary: "List one account's transactions",
|
|
100
|
-
description: "Answers the transactions 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_transaction` 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
|
|
100
|
+
description: "Answers the transactions 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_transaction` 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 transaction, no backward walk and no offset: `before`, `last`, `offset` and `limit` answer `invalid_request`. Returns edges and camelCase pageInfo.",
|
|
101
101
|
successDescription: "Authorized cursor page of account transactions, newest first",
|
|
102
102
|
}))
|
|
103
103
|
.errors(errors(InvalidRequest, InvalidIdentifier, InvalidCursor, InvalidToken, InvalidOrigin, InsufficientAuthorization, NotFound, UnsupportedVersion, ServerError, BankConnectionInteractionRequired, TemporarilyUnavailable))
|
package/dist/rest/api-error.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type RouterContract } from "@orpc/contract";
|
|
2
2
|
import type * as v from "valibot";
|
|
3
3
|
/**
|
|
4
|
-
* An error the
|
|
4
|
+
* An error the AndCo API answers, as a class: its `error` code, its HTTP status and the schema of
|
|
5
5
|
* its data are declared once with {@link AndcoAPIError.define}, next to the operations that answer
|
|
6
6
|
* it, and the generated OpenAPI and the server's status map are read from those declarations.
|
|
7
7
|
*
|
package/dist/rest/api-error.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProcedureContract } from "@orpc/contract";
|
|
2
2
|
/**
|
|
3
|
-
* An error the
|
|
3
|
+
* An error the AndCo API answers, as a class: its `error` code, its HTTP status and the schema of
|
|
4
4
|
* its data are declared once with {@link AndcoAPIError.define}, next to the operations that answer
|
|
5
5
|
* it, and the generated OpenAPI and the server's status map are read from those declarations.
|
|
6
6
|
*
|
package/dist/rest/catalog.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { BankConnectionInteractionRequired } from "./accounts.js";
|
|
|
3
3
|
import { InsufficientAuthorization, InvalidOrigin, InvalidRequest, InvalidToken, ServerError, TemporarilyUnavailable, UnsupportedVersion } from "./common.js";
|
|
4
4
|
/** A bank a transfer can be sent to. */
|
|
5
5
|
export declare const BankCatalogEntry: v.StrictObjectSchema<{
|
|
6
|
-
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The `
|
|
6
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code in Core's catalog: the `bank_code` of a Receptor.">]>;
|
|
7
7
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "The bank's name as the bank lists it.">]>;
|
|
8
8
|
}, undefined>;
|
|
9
9
|
/** The whole list of banks as one page. */
|
|
@@ -11,7 +11,7 @@ export declare const BankCatalogPage: v.SchemaWithPipe<readonly [v.StrictObjectS
|
|
|
11
11
|
readonly edges: v.ArraySchema<v.StrictObjectSchema<{
|
|
12
12
|
readonly cursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
13
13
|
readonly node: v.StrictObjectSchema<{
|
|
14
|
-
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The `
|
|
14
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code in Core's catalog: the `bank_code` of a Receptor.">]>;
|
|
15
15
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "The bank's name as the bank lists it.">]>;
|
|
16
16
|
}, undefined>;
|
|
17
17
|
}, undefined>, undefined>;
|
|
@@ -110,7 +110,7 @@ export declare const getBankCatalog: import("@orpc/contract").ProcedureContractB
|
|
|
110
110
|
readonly edges: v.ArraySchema<v.StrictObjectSchema<{
|
|
111
111
|
readonly cursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
112
112
|
readonly node: v.StrictObjectSchema<{
|
|
113
|
-
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The `
|
|
113
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code in Core's catalog: the `bank_code` of a Receptor.">]>;
|
|
114
114
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "The bank's name as the bank lists it.">]>;
|
|
115
115
|
}, undefined>;
|
|
116
116
|
}, undefined>, undefined>;
|