@andco/protocol 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-errors.d.ts +5 -128
- package/dist/api-errors.d.ts.map +1 -1
- package/dist/api-errors.js +5 -131
- package/dist/authorization-preparation.d.ts +3 -3
- package/dist/authorization-preparation.d.ts.map +1 -1
- package/dist/authorization-preparation.js +4 -0
- package/dist/authorization.js +2 -2
- package/dist/errors.d.ts +52 -16
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +52 -12
- 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 +1791 -725
- package/dist/intent-input.d.ts.map +1 -1
- package/dist/intent-input.js +325 -157
- package/dist/issues.d.ts +61 -0
- package/dist/issues.d.ts.map +1 -0
- package/dist/issues.js +61 -0
- package/dist/messages/index.d.ts +2 -2
- package/dist/messages/index.d.ts.map +1 -1
- package/dist/messages/index.js +10 -3
- package/dist/messages/set-preferences.d.ts +13 -1
- package/dist/messages/set-preferences.d.ts.map +1 -1
- package/dist/messages/set-preferences.js +31 -9
- package/dist/miniapp-manifest.d.ts +2 -2
- package/dist/miniapp-manifest.d.ts.map +1 -1
- package/dist/miniapp-manifest.js +1 -1
- package/dist/native-intent.d.ts +48 -28
- package/dist/native-intent.d.ts.map +1 -1
- package/dist/native-intent.js +76 -24
- package/dist/pagination.d.ts +37 -31
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +72 -24
- package/dist/rar/account-matchers.d.ts +47 -240
- package/dist/rar/account-matchers.d.ts.map +1 -1
- package/dist/rar/account-matchers.js +52 -131
- package/dist/rar/bank.d.ts +280 -392
- package/dist/rar/bank.d.ts.map +1 -1
- package/dist/rar/bank.js +68 -137
- package/dist/rar/catalog.d.ts +305 -288
- package/dist/rar/catalog.d.ts.map +1 -1
- package/dist/rar/catalog.js +69 -29
- package/dist/rar/detail.d.ts +15 -32
- package/dist/rar/detail.d.ts.map +1 -1
- package/dist/rar/detail.js +14 -34
- package/dist/rar/index.d.ts +2 -1
- package/dist/rar/index.d.ts.map +1 -1
- package/dist/rar/index.js +2 -1
- package/dist/rar/json-schemas.generated.d.ts +4 -0
- package/dist/rar/json-schemas.generated.d.ts.map +1 -0
- package/dist/rar/json-schemas.generated.js +3570 -0
- package/dist/rar/money.d.ts +5 -5
- package/dist/rar/money.d.ts.map +1 -1
- package/dist/rar/money.js +5 -5
- package/dist/rar/project-users.d.ts +40 -14
- package/dist/rar/project-users.d.ts.map +1 -1
- package/dist/rar/project-users.js +20 -23
- package/dist/rar/subject-data.d.ts +96 -48
- package/dist/rar/subject-data.d.ts.map +1 -1
- package/dist/rar/subject-data.js +61 -34
- package/dist/rar/subject.d.ts +18 -85
- package/dist/rar/subject.d.ts.map +1 -1
- package/dist/rar/subject.js +23 -51
- package/dist/rest/accounts.d.ts +347 -0
- package/dist/rest/accounts.d.ts.map +1 -0
- package/dist/rest/accounts.js +108 -0
- package/dist/rest/addresses.d.ts +581 -0
- package/dist/rest/addresses.d.ts.map +1 -0
- package/dist/rest/addresses.js +190 -0
- package/dist/rest/api-error.d.ts +104 -0
- package/dist/rest/api-error.d.ts.map +1 -0
- package/dist/rest/api-error.js +103 -0
- package/dist/rest/authorization.d.ts +123 -0
- package/dist/rest/authorization.d.ts.map +1 -0
- package/dist/rest/authorization.js +62 -0
- package/dist/rest/catalog.d.ts +199 -0
- package/dist/rest/catalog.d.ts.map +1 -0
- package/dist/rest/catalog.js +63 -0
- package/dist/rest/common.d.ts +637 -0
- package/dist/rest/common.d.ts.map +1 -0
- package/dist/rest/common.js +172 -0
- package/dist/rest/contract.d.ts +3480 -0
- package/dist/rest/contract.d.ts.map +1 -0
- package/dist/rest/contract.js +120 -0
- package/dist/rest/events.d.ts +145 -0
- package/dist/rest/events.d.ts.map +1 -0
- package/dist/rest/events.js +42 -0
- package/dist/rest/http.d.ts +49 -0
- package/dist/rest/http.d.ts.map +1 -0
- package/dist/rest/http.js +25 -0
- package/dist/rest/identity.d.ts +627 -0
- package/dist/rest/identity.d.ts.map +1 -0
- package/dist/rest/identity.js +128 -0
- package/dist/rest/index.d.ts +14 -0
- package/dist/rest/index.d.ts.map +1 -0
- package/dist/rest/index.js +13 -0
- package/dist/rest/intents.d.ts +4556 -0
- package/dist/rest/intents.d.ts.map +1 -0
- package/dist/rest/intents.js +551 -0
- package/dist/rest/signatures.d.ts +110 -0
- package/dist/rest/signatures.d.ts.map +1 -0
- package/dist/rest/signatures.js +113 -0
- package/dist/rest/subjects.d.ts +14 -0
- package/dist/rest/subjects.d.ts.map +1 -0
- package/dist/rest/subjects.js +22 -0
- package/dist/service-grants.d.ts +2 -2
- package/dist/service-grants.d.ts.map +1 -1
- package/dist/service-grants.js +1 -1
- package/dist/transport/generated/oauth-api.d.ts +5547 -1448
- package/dist/transport/generated/oauth-api.d.ts.map +1 -1
- package/dist/transport/intents.d.ts +9 -134
- package/dist/transport/intents.d.ts.map +1 -1
- package/dist/transport/intents.js +21 -405
- package/dist/transport/rest.d.ts +15 -5
- package/dist/transport/rest.d.ts.map +1 -1
- package/dist/userinfo.d.ts +22 -9
- package/dist/userinfo.d.ts.map +1 -1
- package/dist/userinfo.js +17 -12
- package/package.json +13 -2
package/dist/rar/subject.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
+
import type { Issue } from "../issues.js";
|
|
2
3
|
/**
|
|
3
4
|
* Syntax of a Profile identifier: the Supabase Auth user id, any UUID-shaped value. No version or
|
|
4
5
|
* variant digit is checked, because Auth stores whatever id a user was created with (seeded users
|
|
@@ -9,9 +10,9 @@ export declare const PROFILE_IDENTIFIER_PATTERN = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4
|
|
|
9
10
|
* Syntax of an Organization identifier: a positive decimal integer of at most ten digits.
|
|
10
11
|
*
|
|
11
12
|
* The regex alone admits values above the `int4` ceiling of `organizations.organization_id`; the
|
|
12
|
-
*
|
|
13
|
-
* numeric comparison over strings, so the
|
|
14
|
-
* Organization does the rest.
|
|
13
|
+
* rule {@link subjectIssues} adds the numeric comparison against {@link ANDCO_MAX_ORGANIZATION_ID}.
|
|
14
|
+
* JSON Schema has no numeric comparison over strings, so the generated JSON Schema stays at the digit
|
|
15
|
+
* count and the gate's join on the Organization does the rest.
|
|
15
16
|
*/
|
|
16
17
|
export declare const ORGANIZATION_IDENTIFIER_PATTERN = "^[1-9][0-9]{0,9}$";
|
|
17
18
|
/**
|
|
@@ -31,7 +32,7 @@ export declare const ProfileSubjectPickerSchema: v.StrictObjectSchema<{
|
|
|
31
32
|
*/
|
|
32
33
|
export declare const OrganizationSubjectPickerSchema: v.StrictObjectSchema<{
|
|
33
34
|
readonly type: v.LiteralSchema<"organization", undefined>;
|
|
34
|
-
readonly identifier: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined
|
|
35
|
+
readonly identifier: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
35
36
|
readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
36
37
|
}, undefined>;
|
|
37
38
|
/**
|
|
@@ -49,7 +50,7 @@ export declare const SubjectPickerSchema: v.NullishSchema<v.VariantSchema<"type"
|
|
|
49
50
|
readonly identifier: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
50
51
|
}, undefined>, v.StrictObjectSchema<{
|
|
51
52
|
readonly type: v.LiteralSchema<"organization", undefined>;
|
|
52
|
-
readonly identifier: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined
|
|
53
|
+
readonly identifier: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
53
54
|
readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
54
55
|
}, undefined>], undefined>, undefined>;
|
|
55
56
|
export type SubjectPicker = v.InferInput<typeof SubjectPickerSchema>;
|
|
@@ -67,7 +68,7 @@ export type ProfileOnlySubjectPicker = v.InferInput<typeof ProfileOnlySubjectPic
|
|
|
67
68
|
*/
|
|
68
69
|
export declare const GrantedOrganizationSubjectSchema: v.StrictObjectSchema<{
|
|
69
70
|
readonly type: v.LiteralSchema<"organization", undefined>;
|
|
70
|
-
readonly identifier: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined
|
|
71
|
+
readonly identifier: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
71
72
|
}, undefined>;
|
|
72
73
|
export type GrantedOrganizationSubject = v.InferOutput<typeof GrantedOrganizationSubjectSchema>;
|
|
73
74
|
/** The subject of a Grant: always resolved to an identifier, never editable. */
|
|
@@ -76,7 +77,7 @@ export declare const GrantedSubjectSchema: v.VariantSchema<"type", [v.StrictObje
|
|
|
76
77
|
readonly identifier: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
77
78
|
}, undefined>, v.StrictObjectSchema<{
|
|
78
79
|
readonly type: v.LiteralSchema<"organization", undefined>;
|
|
79
|
-
readonly identifier: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined
|
|
80
|
+
readonly identifier: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
80
81
|
}, undefined>], undefined>;
|
|
81
82
|
export type GrantedSubject = v.InferOutput<typeof GrantedSubjectSchema>;
|
|
82
83
|
/** The Profile form of {@link GrantedSubjectSchema}. */
|
|
@@ -85,82 +86,14 @@ export declare const GrantedProfileSubjectSchema: v.StrictObjectSchema<{
|
|
|
85
86
|
readonly identifier: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
86
87
|
}, undefined>;
|
|
87
88
|
export type GrantedProfileSubject = v.InferOutput<typeof GrantedProfileSubjectSchema>;
|
|
88
|
-
/**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
identifier: {
|
|
99
|
-
anyOf: ({
|
|
100
|
-
type: string;
|
|
101
|
-
pattern: string;
|
|
102
|
-
} | {
|
|
103
|
-
type: string;
|
|
104
|
-
})[];
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
} | {
|
|
108
|
-
type: string;
|
|
109
|
-
})[];
|
|
110
|
-
};
|
|
111
|
-
/** JSON Schema mirror of {@link ProfileOnlySubjectPickerSchema}. */
|
|
112
|
-
export declare const PROFILE_ONLY_SUBJECT_PICKER_JSON_SCHEMA: {
|
|
113
|
-
anyOf: ({
|
|
114
|
-
type: string;
|
|
115
|
-
additionalProperties: boolean;
|
|
116
|
-
required: string[];
|
|
117
|
-
properties: {
|
|
118
|
-
type: {
|
|
119
|
-
const: string;
|
|
120
|
-
};
|
|
121
|
-
identifier: {
|
|
122
|
-
anyOf: ({
|
|
123
|
-
type: string;
|
|
124
|
-
pattern: string;
|
|
125
|
-
} | {
|
|
126
|
-
type: string;
|
|
127
|
-
})[];
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
} | {
|
|
131
|
-
type: string;
|
|
132
|
-
})[];
|
|
133
|
-
};
|
|
134
|
-
/** JSON Schema mirror of {@link GrantedSubjectSchema}. */
|
|
135
|
-
export declare const GRANTED_SUBJECT_JSON_SCHEMA: {
|
|
136
|
-
anyOf: {
|
|
137
|
-
type: string;
|
|
138
|
-
additionalProperties: boolean;
|
|
139
|
-
required: string[];
|
|
140
|
-
properties: {
|
|
141
|
-
type: {
|
|
142
|
-
const: string;
|
|
143
|
-
};
|
|
144
|
-
identifier: {
|
|
145
|
-
type: string;
|
|
146
|
-
pattern: string;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
}[];
|
|
150
|
-
};
|
|
151
|
-
/** JSON Schema mirror of {@link GrantedProfileSubjectSchema}. */
|
|
152
|
-
export declare const GRANTED_PROFILE_SUBJECT_JSON_SCHEMA: {
|
|
153
|
-
type: string;
|
|
154
|
-
additionalProperties: boolean;
|
|
155
|
-
required: string[];
|
|
156
|
-
properties: {
|
|
157
|
-
type: {
|
|
158
|
-
const: string;
|
|
159
|
-
};
|
|
160
|
-
identifier: {
|
|
161
|
-
type: string;
|
|
162
|
-
pattern: string;
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
};
|
|
89
|
+
/**
|
|
90
|
+
* The rule of a subject, in a Grant Request or a Grant: `identifier_exceeds_organization_id` at
|
|
91
|
+
* `identifier` when an Organization identifier that passed {@link ORGANIZATION_IDENTIFIER_PATTERN} is
|
|
92
|
+
* above {@link ANDCO_MAX_ORGANIZATION_ID}, so it can never name an Organization.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* subjectIssues({ type: "organization", identifier: "9999999999" });
|
|
96
|
+
* // [{ type: "identifier_exceeds_organization_id", path: [{ key: "identifier" }] }]
|
|
97
|
+
*/
|
|
98
|
+
export declare function subjectIssues(subject: SubjectPicker | GrantedSubject): Issue[];
|
|
166
99
|
//# sourceMappingURL=subject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subject.d.ts","sourceRoot":"","sources":["../../src/rar/subject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"subject.d.ts","sourceRoot":"","sources":["../../src/rar/subject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,kFAC0C,CAAC;AAElF;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,sBAAsB,CAAC;AAKnE;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B;;;aAGrC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,+BAA+B;;;;aAI1C,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB;;;;;;;sCAE/B,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAErE,iGAAiG;AACjG,eAAO,MAAM,8BAA8B;;;yBAAwD,CAAC;AACpG,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC;;;aAG3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAEhG,gFAAgF;AAChF,eAAO,MAAM,oBAAoB;;;;;;0BAG/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,wDAAwD;AACxD,eAAO,MAAM,2BAA2B;;;aAGtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEtF;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,cAAc,GAAG,KAAK,EAAE,CAS9E"}
|
package/dist/rar/subject.js
CHANGED
|
@@ -10,13 +10,13 @@ export const PROFILE_IDENTIFIER_PATTERN = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-
|
|
|
10
10
|
* Syntax of an Organization identifier: a positive decimal integer of at most ten digits.
|
|
11
11
|
*
|
|
12
12
|
* The regex alone admits values above the `int4` ceiling of `organizations.organization_id`; the
|
|
13
|
-
*
|
|
14
|
-
* numeric comparison over strings, so the
|
|
15
|
-
* Organization does the rest.
|
|
13
|
+
* rule {@link subjectIssues} adds the numeric comparison against {@link ANDCO_MAX_ORGANIZATION_ID}.
|
|
14
|
+
* JSON Schema has no numeric comparison over strings, so the generated JSON Schema stays at the digit
|
|
15
|
+
* count and the gate's join on the Organization does the rest.
|
|
16
16
|
*/
|
|
17
17
|
export const ORGANIZATION_IDENTIFIER_PATTERN = "^[1-9][0-9]{0,9}$";
|
|
18
18
|
const profileIdentifier = /* @__PURE__ */ v.pipe(v.string(), v.regex(new RegExp(PROFILE_IDENTIFIER_PATTERN)));
|
|
19
|
-
const organizationIdentifier = /* @__PURE__ */ v.pipe(v.string(), v.regex(new RegExp(ORGANIZATION_IDENTIFIER_PATTERN))
|
|
19
|
+
const organizationIdentifier = /* @__PURE__ */ v.pipe(v.string(), v.regex(new RegExp(ORGANIZATION_IDENTIFIER_PATTERN)));
|
|
20
20
|
/**
|
|
21
21
|
* A Profile subject in a Grant Request. Without `identifier` it resolves to the signed-in person's
|
|
22
22
|
* Profile at consent; with one, the consent only applies when the signed-in person is that Profile.
|
|
@@ -70,50 +70,22 @@ export const GrantedProfileSubjectSchema = /* @__PURE__ */ v.strictObject({
|
|
|
70
70
|
type: v.literal("profile"),
|
|
71
71
|
identifier: profileIdentifier,
|
|
72
72
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
};
|
|
93
|
-
/** JSON Schema mirror of {@link SubjectPickerSchema}. */
|
|
94
|
-
export const SUBJECT_PICKER_JSON_SCHEMA = { anyOf: [{ type: "null" }, profilePickerJson, organizationPickerJson] };
|
|
95
|
-
/** JSON Schema mirror of {@link ProfileOnlySubjectPickerSchema}. */
|
|
96
|
-
export const PROFILE_ONLY_SUBJECT_PICKER_JSON_SCHEMA = { anyOf: [{ type: "null" }, profilePickerJson] };
|
|
97
|
-
const grantedProfileJson = {
|
|
98
|
-
type: "object",
|
|
99
|
-
additionalProperties: false,
|
|
100
|
-
required: ["type", "identifier"],
|
|
101
|
-
properties: { type: { const: "profile" }, identifier: { type: "string", pattern: PROFILE_IDENTIFIER_PATTERN } },
|
|
102
|
-
};
|
|
103
|
-
/** JSON Schema mirror of {@link GrantedSubjectSchema}. */
|
|
104
|
-
export const GRANTED_SUBJECT_JSON_SCHEMA = {
|
|
105
|
-
anyOf: [
|
|
106
|
-
grantedProfileJson,
|
|
107
|
-
{
|
|
108
|
-
type: "object",
|
|
109
|
-
additionalProperties: false,
|
|
110
|
-
required: ["type", "identifier"],
|
|
111
|
-
properties: {
|
|
112
|
-
type: { const: "organization" },
|
|
113
|
-
identifier: { type: "string", pattern: ORGANIZATION_IDENTIFIER_PATTERN },
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
};
|
|
118
|
-
/** JSON Schema mirror of {@link GrantedProfileSubjectSchema}. */
|
|
119
|
-
export const GRANTED_PROFILE_SUBJECT_JSON_SCHEMA = grantedProfileJson;
|
|
73
|
+
/**
|
|
74
|
+
* The rule of a subject, in a Grant Request or a Grant: `identifier_exceeds_organization_id` at
|
|
75
|
+
* `identifier` when an Organization identifier that passed {@link ORGANIZATION_IDENTIFIER_PATTERN} is
|
|
76
|
+
* above {@link ANDCO_MAX_ORGANIZATION_ID}, so it can never name an Organization.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* subjectIssues({ type: "organization", identifier: "9999999999" });
|
|
80
|
+
* // [{ type: "identifier_exceeds_organization_id", path: [{ key: "identifier" }] }]
|
|
81
|
+
*/
|
|
82
|
+
export function subjectIssues(subject) {
|
|
83
|
+
if (subject === undefined || subject === null || subject.type !== "organization") {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
const identifier = subject.identifier;
|
|
87
|
+
if (identifier === undefined || identifier === null || Number(identifier) <= ANDCO_MAX_ORGANIZATION_ID) {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
return [{ type: "identifier_exceeds_organization_id", path: [{ key: "identifier" }] }];
|
|
91
|
+
}
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { InsufficientAuthorization, InvalidIdentifier, InvalidOrigin, InvalidRequest, InvalidToken, NotFound, ServerError, TemporarilyUnavailable, UnsupportedVersion } from "./common.js";
|
|
3
|
+
/**
|
|
4
|
+
* A decimal figure issued by the external bank, as the bank 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 the bank's own record; tightening it would turn a quirk of the bank into the refusal of a
|
|
7
|
+
* legitimate bank fact.
|
|
8
|
+
*/
|
|
9
|
+
export declare const BankDecimal: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
10
|
+
declare const BankConnectionInteractionRequired_base: (abstract new (data: {
|
|
11
|
+
code: "bank_connection_pin_required" | "bank_connection_reconnect_required" | "bank_representative_replacement_required";
|
|
12
|
+
interaction_url?: string | undefined;
|
|
13
|
+
}, message?: string, hint?: string) => {
|
|
14
|
+
readonly error: "interaction_required";
|
|
15
|
+
readonly hint?: string;
|
|
16
|
+
readonly data: {
|
|
17
|
+
code: "bank_connection_pin_required" | "bank_connection_reconnect_required" | "bank_representative_replacement_required";
|
|
18
|
+
interaction_url?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
name: string;
|
|
21
|
+
message: string;
|
|
22
|
+
stack?: string;
|
|
23
|
+
cause?: unknown;
|
|
24
|
+
}) & {
|
|
25
|
+
readonly error: "interaction_required";
|
|
26
|
+
readonly status: 409;
|
|
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 PIN (`bank_connection_pin_required`), connect the account again (`bank_connection_reconnect_required`) or, for an Organization, connect another bank representative (`bank_representative_replacement_required`).">]>;
|
|
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
|
+
}, undefined>, v.DescriptionAction<{
|
|
31
|
+
code: "bank_connection_pin_required" | "bank_connection_reconnect_required" | "bank_representative_replacement_required";
|
|
32
|
+
interaction_url?: string | undefined;
|
|
33
|
+
}, "The subject's bank connection needs the person back before the bank can answer for them.">]>;
|
|
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
|
+
readonly error: Code;
|
|
36
|
+
readonly hint?: string;
|
|
37
|
+
readonly data: v.InferOutput<Data>;
|
|
38
|
+
name: string;
|
|
39
|
+
message: string;
|
|
40
|
+
stack?: string;
|
|
41
|
+
cause?: unknown;
|
|
42
|
+
}) & {
|
|
43
|
+
readonly error: Code;
|
|
44
|
+
readonly status: Status;
|
|
45
|
+
readonly data: Data;
|
|
46
|
+
define<const Code extends string, const Status extends number, Data extends import("./api-error.js").AndcoAPIErrorDataSchema>(error: Code, status: Status, data: Data): /*elided*/ any;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* The subject's connection with the bank needs the person back before the bank can answer for them.
|
|
51
|
+
* `code` says what the person has to do, and `interaction_url` is where they do it in Platform.
|
|
52
|
+
* Nothing is wrong with the Grant: the same request succeeds afterwards, and retrying before then
|
|
53
|
+
* answers the same.
|
|
54
|
+
*/
|
|
55
|
+
export declare class BankConnectionInteractionRequired extends /* @__PURE__ */ BankConnectionInteractionRequired_base {
|
|
56
|
+
constructor(data: {
|
|
57
|
+
code: BankConnectionInteractionRequired["data"]["code"];
|
|
58
|
+
interaction_url?: string;
|
|
59
|
+
}, message?: string);
|
|
60
|
+
}
|
|
61
|
+
declare const InvalidAccountsCursor_base: (abstract new (data: {}, message?: string, hint?: string) => {
|
|
62
|
+
readonly error: "invalid_accounts_cursor";
|
|
63
|
+
readonly hint?: string;
|
|
64
|
+
readonly data: {};
|
|
65
|
+
name: string;
|
|
66
|
+
message: string;
|
|
67
|
+
stack?: string;
|
|
68
|
+
cause?: unknown;
|
|
69
|
+
}) & {
|
|
70
|
+
readonly error: "invalid_accounts_cursor";
|
|
71
|
+
readonly status: 400;
|
|
72
|
+
readonly data: v.SchemaWithPipe<readonly [v.ObjectSchema<{}, undefined>, v.DescriptionAction<{}, "`after` or `before` is not a cursor the accounts collection returned.">]>;
|
|
73
|
+
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) => {
|
|
74
|
+
readonly error: Code;
|
|
75
|
+
readonly hint?: string;
|
|
76
|
+
readonly data: v.InferOutput<Data>;
|
|
77
|
+
name: string;
|
|
78
|
+
message: string;
|
|
79
|
+
stack?: string;
|
|
80
|
+
cause?: unknown;
|
|
81
|
+
}) & {
|
|
82
|
+
readonly error: Code;
|
|
83
|
+
readonly status: Status;
|
|
84
|
+
readonly data: Data;
|
|
85
|
+
define<const Code extends string, const Status extends number, Data extends import("./api-error.js").AndcoAPIErrorDataSchema>(error: Code, status: Status, data: Data): /*elided*/ any;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
/** The `after` of the accounts walk is not a cursor this collection returned. Start again without it. */
|
|
89
|
+
export declare class InvalidAccountsCursor extends /* @__PURE__ */ InvalidAccountsCursor_base {
|
|
90
|
+
constructor(message?: string);
|
|
91
|
+
}
|
|
92
|
+
declare const InvalidCursor_base: (abstract new (data: {}, message?: string, hint?: string) => {
|
|
93
|
+
readonly error: "invalid_cursor";
|
|
94
|
+
readonly hint?: string;
|
|
95
|
+
readonly data: {};
|
|
96
|
+
name: string;
|
|
97
|
+
message: string;
|
|
98
|
+
stack?: string;
|
|
99
|
+
cause?: unknown;
|
|
100
|
+
}) & {
|
|
101
|
+
readonly error: "invalid_cursor";
|
|
102
|
+
readonly status: 400;
|
|
103
|
+
readonly data: v.SchemaWithPipe<readonly [v.ObjectSchema<{}, undefined>, v.DescriptionAction<{}, "`after` is not a cursor the bank issued.">]>;
|
|
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
|
+
readonly error: Code;
|
|
106
|
+
readonly hint?: string;
|
|
107
|
+
readonly data: v.InferOutput<Data>;
|
|
108
|
+
name: string;
|
|
109
|
+
message: string;
|
|
110
|
+
stack?: string;
|
|
111
|
+
cause?: unknown;
|
|
112
|
+
}) & {
|
|
113
|
+
readonly error: Code;
|
|
114
|
+
readonly status: Status;
|
|
115
|
+
readonly data: Data;
|
|
116
|
+
define<const Code extends string, const Status extends number, Data extends import("./api-error.js").AndcoAPIErrorDataSchema>(error: Code, status: Status, data: Data): /*elided*/ any;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* The `after` of the transactions walk is not the cursor the bank issued for the next page. The
|
|
121
|
+
* bank's cursor travels untouched: take it from `pageInfo.endCursor` and nothing else.
|
|
122
|
+
*/
|
|
123
|
+
export declare class InvalidCursor extends /* @__PURE__ */ InvalidCursor_base {
|
|
124
|
+
constructor(message?: string);
|
|
125
|
+
}
|
|
126
|
+
/** One of the subject's personal bank accounts. */
|
|
127
|
+
export declare const BankAccount: v.StrictObjectSchema<{
|
|
128
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
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=`.">]>;
|
|
130
|
+
readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The account's own name, the one `account_opening.succeeded` announces; the product name for an account nobody named; null for an account nobody named that the balance projection does not know yet. Show the Account Key or a placeholder of your own for null, never made-up text.">]>;
|
|
131
|
+
readonly number: v.StringSchema<undefined>;
|
|
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
|
+
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 the bank maintains for the account, as a decimal string, never a number. It is what the account holds after its last movement; funds the bank has 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
|
+
}, undefined>;
|
|
136
|
+
/** One of the subject's personal bank accounts. */
|
|
137
|
+
export type BankAccount = v.InferOutput<typeof BankAccount>;
|
|
138
|
+
/** A page of the subject's accounts. */
|
|
139
|
+
export declare const AccountPage: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
140
|
+
readonly edges: v.ArraySchema<v.StrictObjectSchema<{
|
|
141
|
+
readonly cursor: v.StringSchema<undefined>;
|
|
142
|
+
readonly node: v.StrictObjectSchema<{
|
|
143
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
144
|
+
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=`.">]>;
|
|
145
|
+
readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The account's own name, the one `account_opening.succeeded` announces; the product name for an account nobody named; null for an account nobody named that the balance projection does not know yet. Show the Account Key or a placeholder of your own for null, never made-up text.">]>;
|
|
146
|
+
readonly number: v.StringSchema<undefined>;
|
|
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
|
+
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 the bank maintains for the account, as a decimal string, never a number. It is what the account holds after its last movement; funds the bank has 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
|
+
}, undefined>;
|
|
151
|
+
}, undefined>, undefined>;
|
|
152
|
+
readonly pageInfo: v.StrictObjectSchema<{
|
|
153
|
+
readonly startCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
154
|
+
readonly endCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
155
|
+
readonly hasPreviousPage: v.BooleanSchema<undefined>;
|
|
156
|
+
readonly hasNextPage: v.BooleanSchema<undefined>;
|
|
157
|
+
}, undefined>;
|
|
158
|
+
}, undefined>, v.DescriptionAction<{
|
|
159
|
+
edges: {
|
|
160
|
+
cursor: string;
|
|
161
|
+
node: {
|
|
162
|
+
id: string;
|
|
163
|
+
accountKey: string | null;
|
|
164
|
+
name: string | null;
|
|
165
|
+
number: string;
|
|
166
|
+
type: string | null;
|
|
167
|
+
currency: string | null;
|
|
168
|
+
balance: string | null;
|
|
169
|
+
};
|
|
170
|
+
}[];
|
|
171
|
+
pageInfo: {
|
|
172
|
+
startCursor: string | null;
|
|
173
|
+
endCursor: string | null;
|
|
174
|
+
hasPreviousPage: boolean;
|
|
175
|
+
hasNextPage: boolean;
|
|
176
|
+
};
|
|
177
|
+
}, string>]>;
|
|
178
|
+
/**
|
|
179
|
+
* One account transaction, as the bank reports it. Keys are camelCase because this schema describes
|
|
180
|
+
* the wire shape the server sends here, which differs from the snake_case of the rest of the
|
|
181
|
+
* contract; `movement_type` keeps the bank's own field name.
|
|
182
|
+
*/
|
|
183
|
+
export declare const BankTransaction: v.StrictObjectSchema<{
|
|
184
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
185
|
+
readonly transactionId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
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 the external bank and republished exactly as the bank 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: the bank 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 the bank'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
|
+
readonly origin: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
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 the external bank and republished exactly, never normalized. Real balances do go negative, so the sign is not narrowed away.">]>;
|
|
192
|
+
readonly paymentType: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
193
|
+
readonly reversed: v.BooleanSchema<undefined>;
|
|
194
|
+
readonly note: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
195
|
+
}, undefined>;
|
|
196
|
+
/** One account transaction, as the bank reports it. */
|
|
197
|
+
export type BankTransaction = v.InferOutput<typeof BankTransaction>;
|
|
198
|
+
/** A page of one account's transactions, read live from the bank. */
|
|
199
|
+
export declare const BankTransactionPage: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
200
|
+
readonly edges: v.ArraySchema<v.StrictObjectSchema<{
|
|
201
|
+
readonly cursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
202
|
+
readonly node: v.StrictObjectSchema<{
|
|
203
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
204
|
+
readonly transactionId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
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 the external bank and republished exactly as the bank 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: the bank 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 the bank'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
|
+
readonly origin: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
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 the external bank and republished exactly, never normalized. Real balances do go negative, so the sign is not narrowed away.">]>;
|
|
211
|
+
readonly paymentType: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
212
|
+
readonly reversed: v.BooleanSchema<undefined>;
|
|
213
|
+
readonly note: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
214
|
+
}, undefined>;
|
|
215
|
+
}, undefined>, undefined>;
|
|
216
|
+
readonly pageInfo: v.StrictObjectSchema<{
|
|
217
|
+
readonly startCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
218
|
+
readonly endCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
219
|
+
readonly hasPreviousPage: v.BooleanSchema<undefined>;
|
|
220
|
+
readonly hasNextPage: v.BooleanSchema<undefined>;
|
|
221
|
+
}, undefined>;
|
|
222
|
+
}, undefined>, v.DescriptionAction<{
|
|
223
|
+
edges: {
|
|
224
|
+
cursor: string | null;
|
|
225
|
+
node: {
|
|
226
|
+
id: string;
|
|
227
|
+
transactionId: string | null;
|
|
228
|
+
description: string;
|
|
229
|
+
amount: string;
|
|
230
|
+
movement_type: "deposit" | "interest" | "withdrawal";
|
|
231
|
+
origin: string | null;
|
|
232
|
+
date: string;
|
|
233
|
+
runningBalance: string | null;
|
|
234
|
+
paymentType: string | null;
|
|
235
|
+
reversed: boolean;
|
|
236
|
+
note: string | null;
|
|
237
|
+
};
|
|
238
|
+
}[];
|
|
239
|
+
pageInfo: {
|
|
240
|
+
startCursor: string | null;
|
|
241
|
+
endCursor: string | null;
|
|
242
|
+
hasPreviousPage: boolean;
|
|
243
|
+
hasNextPage: boolean;
|
|
244
|
+
};
|
|
245
|
+
}, string>]>;
|
|
246
|
+
/** Lists the personal bank accounts the Grant reaches, with their balances. */
|
|
247
|
+
export declare const listAccounts: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.ObjectSchema<{
|
|
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
|
+
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.">]>;
|
|
250
|
+
readonly before: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.DescriptionAction<string, "Opaque cursor previously returned by this collection.">]>, undefined>;
|
|
251
|
+
readonly last: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 100, undefined>]>, undefined>, v.DescriptionAction<number | undefined, "Cursor page size; forward and backward argument families are exclusive.">]>;
|
|
252
|
+
readonly after: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.DescriptionAction<string, "Opaque cursor previously returned by this collection.">]>, undefined>;
|
|
253
|
+
readonly first: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 100, undefined>]>, undefined>, v.DescriptionAction<number | undefined, "Cursor page size; forward and backward argument families are exclusive.">]>;
|
|
254
|
+
readonly accountKey: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "Exact-match lookup by Account Key. Not compatible with `after`/`limit` paging.">]>;
|
|
255
|
+
}, undefined>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
256
|
+
readonly edges: v.ArraySchema<v.StrictObjectSchema<{
|
|
257
|
+
readonly cursor: v.StringSchema<undefined>;
|
|
258
|
+
readonly node: v.StrictObjectSchema<{
|
|
259
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
260
|
+
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=`.">]>;
|
|
261
|
+
readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The account's own name, the one `account_opening.succeeded` announces; the product name for an account nobody named; null for an account nobody named that the balance projection does not know yet. Show the Account Key or a placeholder of your own for null, never made-up text.">]>;
|
|
262
|
+
readonly number: v.StringSchema<undefined>;
|
|
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
|
+
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 the bank maintains for the account, as a decimal string, never a number. It is what the account holds after its last movement; funds the bank has 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
|
+
}, undefined>;
|
|
267
|
+
}, undefined>, undefined>;
|
|
268
|
+
readonly pageInfo: v.StrictObjectSchema<{
|
|
269
|
+
readonly startCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
270
|
+
readonly endCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
271
|
+
readonly hasPreviousPage: v.BooleanSchema<undefined>;
|
|
272
|
+
readonly hasNextPage: v.BooleanSchema<undefined>;
|
|
273
|
+
}, undefined>;
|
|
274
|
+
}, undefined>, v.DescriptionAction<{
|
|
275
|
+
edges: {
|
|
276
|
+
cursor: string;
|
|
277
|
+
node: {
|
|
278
|
+
id: string;
|
|
279
|
+
accountKey: string | null;
|
|
280
|
+
name: string | null;
|
|
281
|
+
number: string;
|
|
282
|
+
type: string | null;
|
|
283
|
+
currency: string | null;
|
|
284
|
+
balance: string | null;
|
|
285
|
+
};
|
|
286
|
+
}[];
|
|
287
|
+
pageInfo: {
|
|
288
|
+
startCursor: string | null;
|
|
289
|
+
endCursor: string | null;
|
|
290
|
+
hasPreviousPage: boolean;
|
|
291
|
+
hasNextPage: boolean;
|
|
292
|
+
};
|
|
293
|
+
}, string>]>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidRequest, typeof InvalidAccountsCursor, typeof InvalidToken, typeof InvalidOrigin, typeof InsufficientAuthorization, typeof UnsupportedVersion, typeof ServerError, typeof BankConnectionInteractionRequired, typeof TemporarilyUnavailable]>>;
|
|
294
|
+
/** Lists one account's transactions, newest first, read from the bank. */
|
|
295
|
+
export declare const listAccountTransactions: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.ObjectSchema<{
|
|
296
|
+
readonly after: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.DescriptionAction<string, "Opaque cursor previously returned by this collection.">]>, undefined>;
|
|
297
|
+
readonly first: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 100, undefined>]>, undefined>, v.DescriptionAction<number | undefined, "Cursor page size; forward and backward argument families are exclusive.">]>;
|
|
298
|
+
readonly bank_account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account's identifier (a UUID) or its Account Key.">]>;
|
|
299
|
+
}, undefined>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
300
|
+
readonly edges: v.ArraySchema<v.StrictObjectSchema<{
|
|
301
|
+
readonly cursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
302
|
+
readonly node: v.StrictObjectSchema<{
|
|
303
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
304
|
+
readonly transactionId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
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 the external bank and republished exactly as the bank 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: the bank 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 the bank'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
|
+
readonly origin: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
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 the external bank and republished exactly, never normalized. Real balances do go negative, so the sign is not narrowed away.">]>;
|
|
311
|
+
readonly paymentType: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
312
|
+
readonly reversed: v.BooleanSchema<undefined>;
|
|
313
|
+
readonly note: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
314
|
+
}, undefined>;
|
|
315
|
+
}, undefined>, undefined>;
|
|
316
|
+
readonly pageInfo: v.StrictObjectSchema<{
|
|
317
|
+
readonly startCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
318
|
+
readonly endCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
319
|
+
readonly hasPreviousPage: v.BooleanSchema<undefined>;
|
|
320
|
+
readonly hasNextPage: v.BooleanSchema<undefined>;
|
|
321
|
+
}, undefined>;
|
|
322
|
+
}, undefined>, v.DescriptionAction<{
|
|
323
|
+
edges: {
|
|
324
|
+
cursor: string | null;
|
|
325
|
+
node: {
|
|
326
|
+
id: string;
|
|
327
|
+
transactionId: string | null;
|
|
328
|
+
description: string;
|
|
329
|
+
amount: string;
|
|
330
|
+
movement_type: "deposit" | "interest" | "withdrawal";
|
|
331
|
+
origin: string | null;
|
|
332
|
+
date: string;
|
|
333
|
+
runningBalance: string | null;
|
|
334
|
+
paymentType: string | null;
|
|
335
|
+
reversed: boolean;
|
|
336
|
+
note: string | null;
|
|
337
|
+
};
|
|
338
|
+
}[];
|
|
339
|
+
pageInfo: {
|
|
340
|
+
startCursor: string | null;
|
|
341
|
+
endCursor: string | null;
|
|
342
|
+
hasPreviousPage: boolean;
|
|
343
|
+
hasNextPage: boolean;
|
|
344
|
+
};
|
|
345
|
+
}, string>]>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidRequest, typeof InvalidIdentifier, typeof InvalidCursor, typeof InvalidToken, typeof InvalidOrigin, typeof InsufficientAuthorization, typeof NotFound, typeof UnsupportedVersion, typeof ServerError, typeof BankConnectionInteractionRequired, typeof TemporarilyUnavailable]>>;
|
|
346
|
+
export {};
|
|
347
|
+
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -0,0 +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,mDAAmD;AACnD,eAAO,MAAM,WAAW;;;;;;;;aA6BtB,CAAC;AAEH,mDAAmD;AACnD,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,uDAAuD;AACvD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,eAAe,CAAC,CAAC;AAEpE,qEAAqE;AACrE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAG/B,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6TAiCH,CAAC;AAEvB,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gWAoCN,CAAC"}
|