@andco/protocol 0.0.1 → 0.0.4

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.
Files changed (120) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +33 -3
  3. package/dist/api-errors.d.ts +109 -0
  4. package/dist/api-errors.d.ts.map +1 -0
  5. package/dist/api-errors.js +111 -0
  6. package/dist/authorization-preparation.d.ts +52 -543
  7. package/dist/authorization-preparation.d.ts.map +1 -1
  8. package/dist/authorization-preparation.js +19 -42
  9. package/dist/authorization.d.ts +64 -22
  10. package/dist/authorization.d.ts.map +1 -1
  11. package/dist/authorization.js +136 -55
  12. package/dist/consent.d.ts +5 -8
  13. package/dist/consent.d.ts.map +1 -1
  14. package/dist/consent.js +5 -62
  15. package/dist/constants.d.ts +19 -3
  16. package/dist/constants.d.ts.map +1 -1
  17. package/dist/constants.js +19 -3
  18. package/dist/errors.d.ts +156 -58
  19. package/dist/errors.d.ts.map +1 -1
  20. package/dist/errors.js +176 -57
  21. package/dist/index.d.ts +5 -5
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +5 -5
  24. package/dist/intent-input.d.ts +1010 -279
  25. package/dist/intent-input.d.ts.map +1 -1
  26. package/dist/intent-input.js +268 -40
  27. package/dist/messages/error.d.ts +1 -2
  28. package/dist/messages/error.d.ts.map +1 -1
  29. package/dist/messages/error.js +5 -2
  30. package/dist/messages/index.d.ts +3 -3
  31. package/dist/messages/index.js +2 -2
  32. package/dist/messages/presentation-response.d.ts +20 -0
  33. package/dist/messages/presentation-response.d.ts.map +1 -0
  34. package/dist/messages/presentation-response.js +17 -0
  35. package/dist/native-copy.d.ts +23 -2
  36. package/dist/native-copy.d.ts.map +1 -1
  37. package/dist/native-copy.js +42 -98
  38. package/dist/native-intent.d.ts +126 -75
  39. package/dist/native-intent.d.ts.map +1 -1
  40. package/dist/native-intent.js +140 -48
  41. package/dist/rar/account-matchers.d.ts +579 -0
  42. package/dist/rar/account-matchers.d.ts.map +1 -0
  43. package/dist/rar/account-matchers.js +480 -0
  44. package/dist/rar/bank.d.ts +1549 -0
  45. package/dist/rar/bank.d.ts.map +1 -0
  46. package/dist/rar/bank.js +379 -0
  47. package/dist/rar/catalog.d.ts +1155 -0
  48. package/dist/rar/catalog.d.ts.map +1 -0
  49. package/dist/rar/catalog.js +175 -0
  50. package/dist/rar/detail.d.ts +39 -0
  51. package/dist/rar/detail.d.ts.map +1 -0
  52. package/dist/rar/detail.js +44 -0
  53. package/dist/rar/index.d.ts +9 -0
  54. package/dist/rar/index.d.ts.map +1 -0
  55. package/dist/rar/index.js +8 -0
  56. package/dist/rar/money.d.ts +58 -0
  57. package/dist/rar/money.d.ts.map +1 -0
  58. package/dist/rar/money.js +61 -0
  59. package/dist/rar/project-users.d.ts +43 -0
  60. package/dist/rar/project-users.d.ts.map +1 -0
  61. package/dist/rar/project-users.js +63 -0
  62. package/dist/rar/subject-data.d.ts +170 -0
  63. package/dist/rar/subject-data.d.ts.map +1 -0
  64. package/dist/rar/subject-data.js +127 -0
  65. package/dist/rar/subject.d.ts +166 -0
  66. package/dist/rar/subject.d.ts.map +1 -0
  67. package/dist/rar/subject.js +119 -0
  68. package/dist/scopes.d.ts +5 -30
  69. package/dist/scopes.d.ts.map +1 -1
  70. package/dist/scopes.js +0 -13
  71. package/dist/service-grants.d.ts +44 -0
  72. package/dist/service-grants.d.ts.map +1 -0
  73. package/dist/service-grants.js +45 -0
  74. package/dist/signing.d.ts +56 -0
  75. package/dist/signing.d.ts.map +1 -0
  76. package/dist/signing.js +233 -0
  77. package/dist/transport/financial-events.d.ts +90 -35
  78. package/dist/transport/financial-events.d.ts.map +1 -1
  79. package/dist/transport/financial-events.js +7 -1
  80. package/dist/transport/generated/oauth-api.d.ts +908 -440
  81. package/dist/transport/generated/oauth-api.d.ts.map +1 -1
  82. package/dist/transport/index.d.ts +0 -1
  83. package/dist/transport/index.d.ts.map +1 -1
  84. package/dist/transport/index.js +0 -1
  85. package/dist/transport/intents.d.ts +155 -23
  86. package/dist/transport/intents.d.ts.map +1 -1
  87. package/dist/transport/intents.js +192 -59
  88. package/dist/transport/rest.d.ts +18 -8
  89. package/dist/transport/rest.d.ts.map +1 -1
  90. package/dist/transport/rest.js +1 -1
  91. package/dist/urls.d.ts.map +1 -1
  92. package/dist/urls.js +1 -1
  93. package/dist/userinfo.d.ts +10 -1
  94. package/dist/userinfo.d.ts.map +1 -1
  95. package/dist/userinfo.js +10 -1
  96. package/dist/utils.d.ts +15 -0
  97. package/dist/utils.d.ts.map +1 -1
  98. package/dist/utils.js +31 -0
  99. package/dist/webhooks.d.ts +154 -0
  100. package/dist/webhooks.d.ts.map +1 -0
  101. package/dist/webhooks.js +249 -0
  102. package/package.json +18 -1
  103. package/dist/automatic-charge.d.ts +0 -314
  104. package/dist/automatic-charge.d.ts.map +0 -1
  105. package/dist/automatic-charge.js +0 -126
  106. package/dist/bank-account-authorization.d.ts +0 -6
  107. package/dist/bank-account-authorization.d.ts.map +0 -1
  108. package/dist/bank-account-authorization.js +0 -13
  109. package/dist/messages/authorization-response.d.ts +0 -12
  110. package/dist/messages/authorization-response.d.ts.map +0 -1
  111. package/dist/messages/authorization-response.js +0 -9
  112. package/dist/transport/webhooks.d.ts +0 -27
  113. package/dist/transport/webhooks.d.ts.map +0 -1
  114. package/dist/transport/webhooks.js +0 -68
  115. package/dist/webhook-input.d.ts +0 -22
  116. package/dist/webhook-input.d.ts.map +0 -1
  117. package/dist/webhook-input.js +0 -11
  118. package/dist/webhook-signature.d.ts +0 -54
  119. package/dist/webhook-signature.d.ts.map +0 -1
  120. package/dist/webhook-signature.js +0 -74
@@ -0,0 +1,579 @@
1
+ import * as v from "valibot";
2
+ /**
3
+ * Syntax of an Account Alias: the name that identifies one Cuenta Vista among the accounts of its
4
+ * Subject, unique per Subject regardless of which Project opened it.
5
+ */
6
+ export declare const ACCOUNT_ALIAS_SYNTAX = "^[a-z][a-z0-9_-]{0,63}$";
7
+ /**
8
+ * Syntax of the `pattern` carried by an `alias` matcher, and the entire grammar of the language:
9
+ * one alias literal (`caja-chica-1`), one alias literal followed by a single trailing `*`
10
+ * (`caja-chica-*`), or `*` alone. There is no other metacharacter, no anchor and no alternation.
11
+ *
12
+ * Regular expressions were rejected on a decisive technical ground, not on taste. The
13
+ * authorization decision has to answer whether one resolved detail is *contained* in the requested
14
+ * one, and containment of regular languages is PSPACE-complete; with prefix globs it is the three
15
+ * lines of {@link accountAliasPatternContains}. Two further reasons hold independently: the
16
+ * decision runs in Postgres while the schema is validated in JavaScript, and POSIX and ECMAScript
17
+ * are not the same language, so one permission would mean two things depending on where it ran;
18
+ * and Postgres `~` is unanchored, so `cliente-1` would silently also authorize `evil-cliente-123`,
19
+ * failing towards granting more.
20
+ */
21
+ export declare const ACCOUNT_ALIAS_PATTERN_SYNTAX = "^(?:\\*|[a-z][a-z0-9_-]{0,63}\\*?)$";
22
+ /** Syntax of an Andco account identifier: a UUID. */
23
+ export declare const ACCOUNT_ID_PATTERN = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$";
24
+ /** An Account Alias, exactly as its holder chose it. */
25
+ export declare const AccountAliasSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
26
+ /** A prefix glob over Account Aliases. See {@link ACCOUNT_ALIAS_PATTERN_SYNTAX} for the grammar. */
27
+ export declare const AccountAliasPatternSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
28
+ /** Upper bound of every matcher list. */
29
+ export declare const ACCOUNT_MATCHER_LIST_CEILING = 100;
30
+ /** The fields an `external` matcher may fix, each narrowing the accounts it admits. */
31
+ export declare const ACCOUNT_EXTERNAL_FIELDS: readonly ["bank_id", "account_type", "account_id", "holder_id", "holder_name"];
32
+ /**
33
+ * How many accounts the person picks at consent for an `editable` matcher of a list she narrows:
34
+ * `"multiple"` (the default) lets her keep several, `"single"` asks for exactly one, which the
35
+ * Grant then fixes as one `account` matcher. Only an `editable` own matcher (`alias` or
36
+ * `any`/`own`) of a source, `accounts` or Deposit destination list may carry it, and every editable
37
+ * matcher of that list must agree.
38
+ *
39
+ * @example
40
+ * // Firma Ya charges from exactly one account the person chooses.
41
+ * const sources: OwnAccountMatcher[] = [{ type: "any", limit: "own", editable: true, selection: "single" }];
42
+ */
43
+ export declare const ACCOUNT_SELECTIONS: readonly ["single", "multiple"];
44
+ export type AccountSelection = (typeof ACCOUNT_SELECTIONS)[number];
45
+ /**
46
+ * Accounts of the Subject whose Account Alias matches `pattern` (literal, `prefix*` or `*`),
47
+ * including accounts that will exist tomorrow. `type` may be omitted. With `editable`, the person
48
+ * may narrow it at consent to accounts it currently matches, which the Grant then fixes as
49
+ * `account` matchers.
50
+ *
51
+ * @example
52
+ * const caja: AccountAlias = { type: "alias", pattern: "caja-*", editable: true };
53
+ * const short: AccountAlias = { pattern: "ventas" };
54
+ */
55
+ export declare const AccountAliasMatcherSchema: v.StrictObjectSchema<{
56
+ readonly type: v.NullishSchema<v.LiteralSchema<"alias", undefined>, undefined>;
57
+ readonly pattern: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
58
+ readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
59
+ readonly selection: v.NullishSchema<v.PicklistSchema<readonly ["single", "multiple"], undefined>, undefined>;
60
+ }, undefined>;
61
+ export type AccountAlias = v.InferInput<typeof AccountAliasMatcherSchema>;
62
+ /**
63
+ * One exact Andco account. As a source or in `accounts` it must be an account of the Subject; the
64
+ * gate checks ownership, since the schema cannot.
65
+ */
66
+ export declare const AccountInternalMatcherSchema: v.StrictObjectSchema<{
67
+ readonly type: v.LiteralSchema<"account", undefined>;
68
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
69
+ readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
70
+ }, undefined>;
71
+ export type AccountInternal = v.InferInput<typeof AccountInternalMatcherSchema>;
72
+ /** Every account of the Subject. With `editable`, the person picks which ones (see {@link ACCOUNT_SELECTIONS}). */
73
+ export declare const AnyOwnMatcherSchema: v.StrictObjectSchema<{
74
+ readonly type: v.LiteralSchema<"any", undefined>;
75
+ readonly limit: v.LiteralSchema<"own", undefined>;
76
+ readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
77
+ readonly selection: v.NullishSchema<v.PicklistSchema<readonly ["single", "multiple"], undefined>, undefined>;
78
+ }, undefined>;
79
+ export type AnyOwn = v.InferInput<typeof AnyOwnMatcherSchema>;
80
+ /** Every Andco account, of any Subject. Only a destination. */
81
+ export declare const AnyLocalMatcherSchema: v.StrictObjectSchema<{
82
+ readonly type: v.LiteralSchema<"any", undefined>;
83
+ readonly limit: v.LiteralSchema<"local", undefined>;
84
+ readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
85
+ }, undefined>;
86
+ export type AnyLocal = v.InferInput<typeof AnyLocalMatcherSchema>;
87
+ /** Every account, at Andco or at another bank. Only a destination, and never `editable`. */
88
+ export declare const AnyAllMatcherSchema: v.StrictObjectSchema<{
89
+ readonly type: v.LiteralSchema<"any", undefined>;
90
+ readonly limit: v.LiteralSchema<"all", undefined>;
91
+ }, undefined>;
92
+ export type AnyAll = v.InferInput<typeof AnyAllMatcherSchema>;
93
+ /**
94
+ * Accounts at other banks, narrowed by every field it fixes. `{ type: "external" }` alone admits
95
+ * every account outside Andco. Only a destination.
96
+ *
97
+ * @example
98
+ * const payroll: AccountExternal = { type: "external", bank_id: "banco_de_chile", account_id: "00123456" };
99
+ */
100
+ export declare const AccountExternalMatcherSchema: v.StrictObjectSchema<{
101
+ readonly type: v.LiteralSchema<"external", undefined>;
102
+ readonly bank_id: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
103
+ readonly account_type: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
104
+ readonly account_id: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
105
+ readonly holder_id: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
106
+ readonly holder_name: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
107
+ readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
108
+ }, undefined>;
109
+ export type AccountExternal = v.InferInput<typeof AccountExternalMatcherSchema>;
110
+ /**
111
+ * A matcher bounded by the Subject: the only kinds a source, an `accounts` list or a Deposit
112
+ * destination accepts, so that no permission can debit, read or collect into someone else's account.
113
+ */
114
+ export declare const OwnAccountMatcherSchema: v.UnionSchema<[v.StrictObjectSchema<{
115
+ readonly type: v.NullishSchema<v.LiteralSchema<"alias", undefined>, undefined>;
116
+ readonly pattern: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
117
+ readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
118
+ readonly selection: v.NullishSchema<v.PicklistSchema<readonly ["single", "multiple"], undefined>, undefined>;
119
+ }, undefined>, v.StrictObjectSchema<{
120
+ readonly type: v.LiteralSchema<"account", undefined>;
121
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
122
+ readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
123
+ }, undefined>, v.StrictObjectSchema<{
124
+ readonly type: v.LiteralSchema<"any", undefined>;
125
+ readonly limit: v.LiteralSchema<"own", undefined>;
126
+ readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
127
+ readonly selection: v.NullishSchema<v.PicklistSchema<readonly ["single", "multiple"], undefined>, undefined>;
128
+ }, undefined>], undefined>;
129
+ export type OwnAccountMatcher = v.InferInput<typeof OwnAccountMatcherSchema>;
130
+ /** Every matcher kind; what a Transfer destination accepts. */
131
+ export declare const DestinationAccountMatcherSchema: v.UnionSchema<[v.StrictObjectSchema<{
132
+ readonly type: v.NullishSchema<v.LiteralSchema<"alias", undefined>, undefined>;
133
+ readonly pattern: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
134
+ readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
135
+ readonly selection: v.NullishSchema<v.PicklistSchema<readonly ["single", "multiple"], undefined>, undefined>;
136
+ }, undefined>, v.StrictObjectSchema<{
137
+ readonly type: v.LiteralSchema<"account", undefined>;
138
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
139
+ readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
140
+ }, undefined>, v.StrictObjectSchema<{
141
+ readonly type: v.LiteralSchema<"any", undefined>;
142
+ readonly limit: v.LiteralSchema<"own", undefined>;
143
+ readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
144
+ readonly selection: v.NullishSchema<v.PicklistSchema<readonly ["single", "multiple"], undefined>, undefined>;
145
+ }, undefined>, v.StrictObjectSchema<{
146
+ readonly type: v.LiteralSchema<"any", undefined>;
147
+ readonly limit: v.LiteralSchema<"local", undefined>;
148
+ readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
149
+ }, undefined>, v.StrictObjectSchema<{
150
+ readonly type: v.LiteralSchema<"any", undefined>;
151
+ readonly limit: v.LiteralSchema<"all", undefined>;
152
+ }, undefined>, v.StrictObjectSchema<{
153
+ readonly type: v.LiteralSchema<"external", undefined>;
154
+ readonly bank_id: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
155
+ readonly account_type: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
156
+ readonly account_id: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
157
+ readonly holder_id: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
158
+ readonly holder_name: v.NullishSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
159
+ readonly editable: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
160
+ }, undefined>], undefined>;
161
+ export type DestinationAccountMatcher = v.InferInput<typeof DestinationAccountMatcherSchema>;
162
+ /** {@link AccountAliasMatcherSchema} as granted: `type` present, no `editable`. */
163
+ export declare const GrantedAccountAliasSchema: v.StrictObjectSchema<{
164
+ readonly type: v.LiteralSchema<"alias", undefined>;
165
+ readonly pattern: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
166
+ }, undefined>;
167
+ /** {@link AccountInternalMatcherSchema} as granted. */
168
+ export declare const GrantedAccountInternalSchema: v.StrictObjectSchema<{
169
+ readonly type: v.LiteralSchema<"account", undefined>;
170
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
171
+ }, undefined>;
172
+ /** {@link AnyOwnMatcherSchema} as granted. */
173
+ export declare const GrantedAnyOwnSchema: v.StrictObjectSchema<{
174
+ readonly type: v.LiteralSchema<"any", undefined>;
175
+ readonly limit: v.LiteralSchema<"own", undefined>;
176
+ }, undefined>;
177
+ /** {@link AnyLocalMatcherSchema} as granted. */
178
+ export declare const GrantedAnyLocalSchema: v.StrictObjectSchema<{
179
+ readonly type: v.LiteralSchema<"any", undefined>;
180
+ readonly limit: v.LiteralSchema<"local", undefined>;
181
+ }, undefined>;
182
+ /** {@link AnyAllMatcherSchema} as granted. */
183
+ export declare const GrantedAnyAllSchema: v.StrictObjectSchema<{
184
+ readonly type: v.LiteralSchema<"any", undefined>;
185
+ readonly limit: v.LiteralSchema<"all", undefined>;
186
+ }, undefined>;
187
+ /** {@link AccountExternalMatcherSchema} as granted: absent fields are unrestricted, never `null`. */
188
+ export declare const GrantedAccountExternalSchema: v.StrictObjectSchema<{
189
+ readonly type: v.LiteralSchema<"external", undefined>;
190
+ readonly bank_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
191
+ readonly account_type: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
192
+ readonly account_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
193
+ readonly holder_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
194
+ readonly holder_name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
195
+ }, undefined>;
196
+ export type GrantedAccountAlias = v.InferOutput<typeof GrantedAccountAliasSchema>;
197
+ export type GrantedAccountInternal = v.InferOutput<typeof GrantedAccountInternalSchema>;
198
+ export type GrantedAnyOwn = v.InferOutput<typeof GrantedAnyOwnSchema>;
199
+ export type GrantedAnyLocal = v.InferOutput<typeof GrantedAnyLocalSchema>;
200
+ export type GrantedAnyAll = v.InferOutput<typeof GrantedAnyAllSchema>;
201
+ export type GrantedAccountExternal = v.InferOutput<typeof GrantedAccountExternalSchema>;
202
+ /** {@link OwnAccountMatcherSchema} as granted. */
203
+ export declare const GrantedOwnAccountMatcherSchema: v.UnionSchema<[v.StrictObjectSchema<{
204
+ readonly type: v.LiteralSchema<"alias", undefined>;
205
+ readonly pattern: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
206
+ }, undefined>, v.StrictObjectSchema<{
207
+ readonly type: v.LiteralSchema<"account", undefined>;
208
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
209
+ }, undefined>, v.StrictObjectSchema<{
210
+ readonly type: v.LiteralSchema<"any", undefined>;
211
+ readonly limit: v.LiteralSchema<"own", undefined>;
212
+ }, undefined>], undefined>;
213
+ export type GrantedOwnAccountMatcher = v.InferOutput<typeof GrantedOwnAccountMatcherSchema>;
214
+ /** {@link DestinationAccountMatcherSchema} as granted. */
215
+ export declare const GrantedDestinationAccountMatcherSchema: v.UnionSchema<[v.StrictObjectSchema<{
216
+ readonly type: v.LiteralSchema<"alias", undefined>;
217
+ readonly pattern: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
218
+ }, undefined>, v.StrictObjectSchema<{
219
+ readonly type: v.LiteralSchema<"account", undefined>;
220
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
221
+ }, undefined>, v.StrictObjectSchema<{
222
+ readonly type: v.LiteralSchema<"any", undefined>;
223
+ readonly limit: v.LiteralSchema<"own", undefined>;
224
+ }, undefined>, v.StrictObjectSchema<{
225
+ readonly type: v.LiteralSchema<"any", undefined>;
226
+ readonly limit: v.LiteralSchema<"local", undefined>;
227
+ }, undefined>, v.StrictObjectSchema<{
228
+ readonly type: v.LiteralSchema<"any", undefined>;
229
+ readonly limit: v.LiteralSchema<"all", undefined>;
230
+ }, undefined>, v.StrictObjectSchema<{
231
+ readonly type: v.LiteralSchema<"external", undefined>;
232
+ readonly bank_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
233
+ readonly account_type: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
234
+ readonly account_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
235
+ readonly holder_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
236
+ readonly holder_name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, undefined>]>, undefined>;
237
+ }, undefined>], undefined>;
238
+ export type GrantedDestinationAccountMatcher = v.InferOutput<typeof GrantedDestinationAccountMatcherSchema>;
239
+ /**
240
+ * Identity of a matcher inside one list, used to reject duplicates without rejecting overlap.
241
+ * `editable` is not part of it: two entries differing only there say the same thing twice.
242
+ */
243
+ export declare function accountMatcherKey(matcher: DestinationAccountMatcher): string;
244
+ /**
245
+ * A non-empty list of distinct matchers. Empty is rejected rather than read as "everything": a
246
+ * permission that listed no account authorizes zero, never all. Absent or `null` is how a Grant
247
+ * Request asks for the type's default.
248
+ */
249
+ export declare function accountMatcherList<Schema extends v.GenericSchema<DestinationAccountMatcher, DestinationAccountMatcher | GrantedDestinationAccountMatcher>>(schema: Schema): v.SchemaWithPipe<readonly [v.ArraySchema<Schema, undefined>, v.MinLengthAction<v.InferOutput<Schema>[], 1, undefined>, v.MaxLengthAction<v.InferOutput<Schema>[], 100, undefined>, v.CheckAction<v.InferOutput<Schema>[], "duplicate_account_matcher">]>;
250
+ /**
251
+ * Whether the `selection` of a list's matchers is coherent: it only sits on `editable` matchers, and
252
+ * every editable matcher of the list asks for the same one. Lists that are never picked from (the
253
+ * aliases of accounts to open, a Transfer's destinations) must carry none: {@link accountSelectionIsAbsent}.
254
+ *
255
+ * @example
256
+ * accountSelectionIsCoherent([{ type: "any", limit: "own", editable: true, selection: "single" }]); // true
257
+ * accountSelectionIsCoherent([{ type: "any", limit: "own", selection: "single" }]); // false
258
+ */
259
+ export declare function accountSelectionIsCoherent(matchers: readonly DestinationAccountMatcher[]): boolean;
260
+ /** Whether no matcher of a list carries a `selection`: what a list nobody picks from must satisfy. */
261
+ export declare function accountSelectionIsAbsent(matchers: readonly DestinationAccountMatcher[]): boolean;
262
+ /** Whether the person picks exactly one account for this list's editable matchers. */
263
+ export declare function accountSelectionIsSingle(matchers: readonly DestinationAccountMatcher[]): boolean;
264
+ /** What an absent or `null` source list, `accounts` list or deposit destination list means. */
265
+ export declare const DEFAULT_OWN_ACCOUNT_MATCHERS: readonly GrantedOwnAccountMatcher[];
266
+ /** What an absent or `null` Transfer destination list means. */
267
+ export declare const DEFAULT_DESTINATION_ACCOUNT_MATCHERS: readonly GrantedDestinationAccountMatcher[];
268
+ /** JSON Schema mirror of {@link OwnAccountMatcherSchema}. */
269
+ export declare const OWN_ACCOUNT_MATCHER_JSON_SCHEMA: {
270
+ anyOf: ({
271
+ type: string;
272
+ additionalProperties: boolean;
273
+ required: string[];
274
+ properties: {
275
+ type: {
276
+ anyOf: ({
277
+ const: string;
278
+ } | {
279
+ type: string;
280
+ })[];
281
+ };
282
+ pattern: {
283
+ type: string;
284
+ pattern: string;
285
+ };
286
+ editable: {
287
+ anyOf: ({
288
+ type: string;
289
+ } | {
290
+ type: string;
291
+ })[];
292
+ };
293
+ selection: {
294
+ anyOf: ({
295
+ enum: ("single" | "multiple")[];
296
+ } | {
297
+ type: string;
298
+ })[];
299
+ };
300
+ };
301
+ } | {
302
+ type: string;
303
+ additionalProperties: boolean;
304
+ required: string[];
305
+ properties: {
306
+ type: {
307
+ const: string;
308
+ };
309
+ id: {
310
+ type: string;
311
+ pattern: string;
312
+ };
313
+ editable: {
314
+ anyOf: ({
315
+ type: string;
316
+ } | {
317
+ type: string;
318
+ })[];
319
+ };
320
+ };
321
+ } | {
322
+ type: string;
323
+ additionalProperties: boolean;
324
+ required: string[];
325
+ properties: {
326
+ type: {
327
+ const: string;
328
+ };
329
+ limit: {
330
+ const: "own";
331
+ };
332
+ editable: {
333
+ anyOf: ({
334
+ type: string;
335
+ } | {
336
+ type: string;
337
+ })[];
338
+ };
339
+ selection: {
340
+ anyOf: ({
341
+ enum: ("single" | "multiple")[];
342
+ } | {
343
+ type: string;
344
+ })[];
345
+ };
346
+ } | {
347
+ type: {
348
+ const: string;
349
+ };
350
+ limit: {
351
+ const: "local";
352
+ };
353
+ editable: {
354
+ anyOf: ({
355
+ type: string;
356
+ } | {
357
+ type: string;
358
+ })[];
359
+ };
360
+ selection?: undefined;
361
+ };
362
+ })[];
363
+ };
364
+ /** JSON Schema mirror of {@link DestinationAccountMatcherSchema}. */
365
+ export declare const DESTINATION_ACCOUNT_MATCHER_JSON_SCHEMA: {
366
+ anyOf: ({
367
+ type: string;
368
+ additionalProperties: boolean;
369
+ required: string[];
370
+ properties: {
371
+ type: {
372
+ anyOf: ({
373
+ const: string;
374
+ } | {
375
+ type: string;
376
+ })[];
377
+ };
378
+ pattern: {
379
+ type: string;
380
+ pattern: string;
381
+ };
382
+ editable: {
383
+ anyOf: ({
384
+ type: string;
385
+ } | {
386
+ type: string;
387
+ })[];
388
+ };
389
+ selection: {
390
+ anyOf: ({
391
+ enum: ("single" | "multiple")[];
392
+ } | {
393
+ type: string;
394
+ })[];
395
+ };
396
+ };
397
+ } | {
398
+ type: string;
399
+ additionalProperties: boolean;
400
+ required: string[];
401
+ properties: {
402
+ type: {
403
+ const: string;
404
+ };
405
+ limit: {
406
+ const: string;
407
+ };
408
+ };
409
+ } | {
410
+ type: string;
411
+ additionalProperties: boolean;
412
+ required: string[];
413
+ properties: {
414
+ editable: {
415
+ anyOf: ({
416
+ type: string;
417
+ } | {
418
+ type: string;
419
+ })[];
420
+ };
421
+ type: {
422
+ const: string;
423
+ };
424
+ };
425
+ })[];
426
+ };
427
+ /** JSON Schema mirror of {@link GrantedOwnAccountMatcherSchema}. */
428
+ export declare const GRANTED_OWN_ACCOUNT_MATCHER_JSON_SCHEMA: {
429
+ anyOf: ({
430
+ type: string;
431
+ additionalProperties: boolean;
432
+ required: string[];
433
+ properties: {
434
+ type: {
435
+ const: string;
436
+ };
437
+ pattern: {
438
+ type: string;
439
+ pattern: string;
440
+ };
441
+ };
442
+ } | {
443
+ type: string;
444
+ additionalProperties: boolean;
445
+ required: string[];
446
+ properties: {
447
+ type: {
448
+ const: string;
449
+ };
450
+ id: {
451
+ type: string;
452
+ pattern: string;
453
+ };
454
+ };
455
+ } | {
456
+ type: string;
457
+ additionalProperties: boolean;
458
+ required: string[];
459
+ properties: {
460
+ type: {
461
+ const: string;
462
+ };
463
+ limit: {
464
+ const: "own" | "local";
465
+ };
466
+ };
467
+ })[];
468
+ };
469
+ /** JSON Schema mirror of {@link GrantedDestinationAccountMatcherSchema}. */
470
+ export declare const GRANTED_DESTINATION_ACCOUNT_MATCHER_JSON_SCHEMA: {
471
+ anyOf: {
472
+ type: string;
473
+ additionalProperties: boolean;
474
+ required: string[];
475
+ properties: {
476
+ type: {
477
+ const: string;
478
+ };
479
+ };
480
+ }[];
481
+ };
482
+ /**
483
+ * JSON Schema mirror of {@link accountMatcherList}. `uniqueItems` compares whole objects, so it is
484
+ * looser than the valibot check, which ignores `editable` and an omitted alias `type`; the gate's
485
+ * own comparison closes the gap.
486
+ */
487
+ export declare function accountMatcherListJsonSchema(items: object): {
488
+ type: string;
489
+ minItems: number;
490
+ maxItems: number;
491
+ uniqueItems: boolean;
492
+ items: object;
493
+ };
494
+ /**
495
+ * Decides whether `alias` belongs to the set described by `pattern`.
496
+ *
497
+ * The grammar of {@link ACCOUNT_ALIAS_PATTERN_SYNTAX} leaves only two cases: a literal matches by
498
+ * equality, and a trailing `*` matches by prefix. `*` alone has the empty prefix and therefore
499
+ * matches every alias — but only an alias: an account that carries none is matched by nothing.
500
+ * A malformed pattern can only match fewer aliases, never more: `caja*chica` has no trailing `*`,
501
+ * so it is compared as a literal.
502
+ *
503
+ * @example
504
+ * accountAliasPatternMatches("caja-*", "caja-chica"); // true
505
+ * accountAliasPatternMatches("caja-chica", "caja-chica-1"); // false
506
+ */
507
+ export declare function accountAliasPatternMatches(pattern: string, alias: string): boolean;
508
+ /**
509
+ * Decides whether every alias matched by `inner` is also matched by `outer`, for every possible
510
+ * set of aliases rather than for the ones that happen to exist right now.
511
+ *
512
+ * A literal `outer` denotes a single alias, so it can only contain itself — in particular
513
+ * `caja-chica` does not contain `caja-chica*`, whose language is infinite. A glob `outer` contains
514
+ * `inner` exactly when `inner`'s literal prefix starts with `outer`'s.
515
+ *
516
+ * @example
517
+ * accountAliasPatternContains("caja-*", "caja-chica-*"); // true
518
+ * accountAliasPatternContains("caja-chica", "caja-chica*"); // false
519
+ */
520
+ export declare function accountAliasPatternContains(outer: string, inner: string): boolean;
521
+ /**
522
+ * The facts containment cannot derive from the matchers themselves, and that only the database
523
+ * holds. Everything it leaves out makes containment fail closed rather than guess.
524
+ */
525
+ export type AccountMatcherFacts = {
526
+ /**
527
+ * The Subject's own accounts, keyed by account id, each with its Account Alias (`null` for an
528
+ * account that carries none). An account absent from this record is not known to be the
529
+ * Subject's.
530
+ */
531
+ readonly ownAccounts?: Readonly<Record<string, string | null>>;
532
+ };
533
+ /** The six kinds of matcher, with the three `any` limits told apart. */
534
+ export type AccountMatcherKind = "all" | "local" | "own" | "alias" | "account" | "external";
535
+ /** Classifies a matcher; an alias matcher may omit its `type`. */
536
+ export declare function accountMatcherKind(matcher: DestinationAccountMatcher): AccountMatcherKind;
537
+ /**
538
+ * Decides whether every account admitted by `inner` is also admitted by `outer`. The Grant's (or the
539
+ * Grant Request's) matcher is `outer`; the narrower Grant, or the account an operation names, is
540
+ * `inner`. Containment must keep holding as accounts and aliases change.
541
+ *
542
+ * The order is `any(all) ⊇ any(local) ⊇ any(own) ⊇ alias ⊇ account`, and `external` only under
543
+ * `all`:
544
+ *
545
+ * - `any(all)` contains every matcher; only `any(all)` contains `any(all)`.
546
+ * - `external` is contained by `any(all)`, and by an `external` whose every fixed field `inner`
547
+ * fixes to the same value. Nothing else contains it, and it contains nothing but such an
548
+ * `external`.
549
+ * - `any(local)` contains every Andco matcher: `any(local)`, `any(own)`, `alias` and `account`.
550
+ * - `any(own)` contains `any(own)` and `alias` (an alias names an account of the Subject by
551
+ * construction), and an `account` only when `facts.ownAccounts` says it is the Subject's.
552
+ * - `alias:q` contains `alias:p` per {@link accountAliasPatternContains}, and an `account` only when
553
+ * `facts.ownAccounts` gives it an alias that `q` matches.
554
+ * - `account:id` contains only `account:id`. It never contains a pattern, not even one matching
555
+ * exactly one account today, because it could match two tomorrow.
556
+ *
557
+ * `editable` never changes the answer. The relation is mirrored in SQL by the gate; the cases in
558
+ * `scripts/account-matcher-containment-cases.mjs` pin both to the same table.
559
+ *
560
+ * @example
561
+ * accountMatcherContains({ type: "any", limit: "local" }, { type: "alias", pattern: "caja-*" }); // true
562
+ * accountMatcherContains({ type: "any", limit: "local" }, { type: "external" }); // false
563
+ * accountMatcherContains(
564
+ * { type: "alias", pattern: "caja-*" },
565
+ * { type: "account", id: "00000000-0000-4000-8000-000000000001" },
566
+ * { ownAccounts: { "00000000-0000-4000-8000-000000000001": "caja-chica" } },
567
+ * ); // true
568
+ */
569
+ export declare function accountMatcherContains(outer: DestinationAccountMatcher, inner: DestinationAccountMatcher, facts?: AccountMatcherFacts): boolean;
570
+ /**
571
+ * Decides whether the set described by the `inner` list is contained in the one described by
572
+ * `outer`: every `inner` matcher must be contained in at least one `outer` matcher.
573
+ *
574
+ * An empty `inner` is contained in anything, since it admits no account at all, and a non-empty
575
+ * `inner` is never contained in an empty `outer`. Containment is not distributed across `outer`:
576
+ * `[alias:a-*, alias:b-*]` does not contain `alias:*`, and refusing it is the sound answer.
577
+ */
578
+ export declare function accountMatchersContain(outer: readonly DestinationAccountMatcher[], inner: readonly DestinationAccountMatcher[], facts?: AccountMatcherFacts): boolean;
579
+ //# sourceMappingURL=account-matchers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-matchers.d.ts","sourceRoot":"","sources":["../../src/rar/account-matchers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B;;;GAGG;AACH,eAAO,MAAM,oBAAoB,4BAA4B,CAAC;AAE9D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,4BAA4B,wCAAwC,CAAC;AAElF,qDAAqD;AACrD,eAAO,MAAM,kBAAkB,+FAC+D,CAAC;AAE/F,wDAAwD;AACxD,eAAO,MAAM,kBAAkB,0FAAgF,CAAC;AAChH,oGAAoG;AACpG,eAAO,MAAM,yBAAyB,0FAGrC,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAKhD,uFAAuF;AACvF,eAAO,MAAM,uBAAuB,g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