@andco/protocol 0.0.11 → 0.0.13

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/dist/api-errors.d.ts +5 -128
  2. package/dist/api-errors.d.ts.map +1 -1
  3. package/dist/api-errors.js +5 -131
  4. package/dist/authorization-preparation.d.ts +3 -3
  5. package/dist/authorization-preparation.d.ts.map +1 -1
  6. package/dist/authorization-preparation.js +4 -0
  7. package/dist/authorization.js +2 -2
  8. package/dist/errors.d.ts +111 -16
  9. package/dist/errors.d.ts.map +1 -1
  10. package/dist/errors.js +124 -12
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +1 -0
  14. package/dist/intent-input.d.ts +1791 -725
  15. package/dist/intent-input.d.ts.map +1 -1
  16. package/dist/intent-input.js +325 -157
  17. package/dist/issues.d.ts +62 -0
  18. package/dist/issues.d.ts.map +1 -0
  19. package/dist/issues.js +61 -0
  20. package/dist/messages/index.d.ts +2 -2
  21. package/dist/messages/index.d.ts.map +1 -1
  22. package/dist/messages/index.js +10 -3
  23. package/dist/messages/set-preferences.d.ts +13 -1
  24. package/dist/messages/set-preferences.d.ts.map +1 -1
  25. package/dist/messages/set-preferences.js +31 -9
  26. package/dist/miniapp-manifest.d.ts +2 -2
  27. package/dist/miniapp-manifest.d.ts.map +1 -1
  28. package/dist/miniapp-manifest.js +1 -1
  29. package/dist/native-intent.d.ts +48 -28
  30. package/dist/native-intent.d.ts.map +1 -1
  31. package/dist/native-intent.js +76 -24
  32. package/dist/pagination.d.ts +37 -31
  33. package/dist/pagination.d.ts.map +1 -1
  34. package/dist/pagination.js +72 -24
  35. package/dist/rar/account-matchers.d.ts +47 -240
  36. package/dist/rar/account-matchers.d.ts.map +1 -1
  37. package/dist/rar/account-matchers.js +52 -131
  38. package/dist/rar/bank.d.ts +280 -392
  39. package/dist/rar/bank.d.ts.map +1 -1
  40. package/dist/rar/bank.js +68 -137
  41. package/dist/rar/catalog.d.ts +305 -288
  42. package/dist/rar/catalog.d.ts.map +1 -1
  43. package/dist/rar/catalog.js +69 -29
  44. package/dist/rar/detail.d.ts +15 -32
  45. package/dist/rar/detail.d.ts.map +1 -1
  46. package/dist/rar/detail.js +14 -34
  47. package/dist/rar/index.d.ts +2 -1
  48. package/dist/rar/index.d.ts.map +1 -1
  49. package/dist/rar/index.js +2 -1
  50. package/dist/rar/json-schemas.generated.d.ts +4 -0
  51. package/dist/rar/json-schemas.generated.d.ts.map +1 -0
  52. package/dist/rar/json-schemas.generated.js +3570 -0
  53. package/dist/rar/money.d.ts +5 -5
  54. package/dist/rar/money.d.ts.map +1 -1
  55. package/dist/rar/money.js +5 -5
  56. package/dist/rar/project-users.d.ts +40 -14
  57. package/dist/rar/project-users.d.ts.map +1 -1
  58. package/dist/rar/project-users.js +20 -23
  59. package/dist/rar/subject-data.d.ts +96 -48
  60. package/dist/rar/subject-data.d.ts.map +1 -1
  61. package/dist/rar/subject-data.js +61 -34
  62. package/dist/rar/subject.d.ts +18 -85
  63. package/dist/rar/subject.d.ts.map +1 -1
  64. package/dist/rar/subject.js +23 -51
  65. package/dist/rest/accounts.d.ts +347 -0
  66. package/dist/rest/accounts.d.ts.map +1 -0
  67. package/dist/rest/accounts.js +108 -0
  68. package/dist/rest/addresses.d.ts +581 -0
  69. package/dist/rest/addresses.d.ts.map +1 -0
  70. package/dist/rest/addresses.js +190 -0
  71. package/dist/rest/api-error.d.ts +104 -0
  72. package/dist/rest/api-error.d.ts.map +1 -0
  73. package/dist/rest/api-error.js +103 -0
  74. package/dist/rest/authorization.d.ts +123 -0
  75. package/dist/rest/authorization.d.ts.map +1 -0
  76. package/dist/rest/authorization.js +62 -0
  77. package/dist/rest/catalog.d.ts +199 -0
  78. package/dist/rest/catalog.d.ts.map +1 -0
  79. package/dist/rest/catalog.js +63 -0
  80. package/dist/rest/common.d.ts +637 -0
  81. package/dist/rest/common.d.ts.map +1 -0
  82. package/dist/rest/common.js +172 -0
  83. package/dist/rest/contract.d.ts +3480 -0
  84. package/dist/rest/contract.d.ts.map +1 -0
  85. package/dist/rest/contract.js +120 -0
  86. package/dist/rest/events.d.ts +145 -0
  87. package/dist/rest/events.d.ts.map +1 -0
  88. package/dist/rest/events.js +42 -0
  89. package/dist/rest/http.d.ts +49 -0
  90. package/dist/rest/http.d.ts.map +1 -0
  91. package/dist/rest/http.js +25 -0
  92. package/dist/rest/identity.d.ts +627 -0
  93. package/dist/rest/identity.d.ts.map +1 -0
  94. package/dist/rest/identity.js +128 -0
  95. package/dist/rest/index.d.ts +14 -0
  96. package/dist/rest/index.d.ts.map +1 -0
  97. package/dist/rest/index.js +13 -0
  98. package/dist/rest/intents.d.ts +4556 -0
  99. package/dist/rest/intents.d.ts.map +1 -0
  100. package/dist/rest/intents.js +551 -0
  101. package/dist/rest/signatures.d.ts +110 -0
  102. package/dist/rest/signatures.d.ts.map +1 -0
  103. package/dist/rest/signatures.js +113 -0
  104. package/dist/rest/subjects.d.ts +14 -0
  105. package/dist/rest/subjects.d.ts.map +1 -0
  106. package/dist/rest/subjects.js +22 -0
  107. package/dist/service-grants.d.ts +2 -2
  108. package/dist/service-grants.d.ts.map +1 -1
  109. package/dist/service-grants.js +1 -1
  110. package/dist/transport/generated/oauth-api.d.ts +5547 -1448
  111. package/dist/transport/generated/oauth-api.d.ts.map +1 -1
  112. package/dist/transport/intents.d.ts +9 -134
  113. package/dist/transport/intents.d.ts.map +1 -1
  114. package/dist/transport/intents.js +21 -405
  115. package/dist/transport/rest.d.ts +15 -5
  116. package/dist/transport/rest.d.ts.map +1 -1
  117. package/dist/userinfo.d.ts +22 -9
  118. package/dist/userinfo.d.ts.map +1 -1
  119. package/dist/userinfo.js +17 -12
  120. package/package.json +13 -2
@@ -1,128 +1,3 @@
1
- /**
2
- * What the Andco API answers with in `{ "error": "..." }`. The SDK relays these untouched, so the
3
- * string an integrator receives here is the one the API reference documents.
4
- *
5
- * Known values, not an exhaustive type. The server gains codes without an SDK release -- closing
6
- * this would make every new server condition wait for a coordinated publish of four SDKs, and would
7
- * leave a code the server already sends unnameable until then. `AndcoError.code` stays a `string`
8
- * for the same reason, and {@link ANDCO_ERROR_CODES} shows the comparison shape: branch on the
9
- * members you handle, keep a `default` for the rest.
10
- *
11
- * @see https://sdk.andco.com/docs/reference/error-codes
12
- */
13
- export declare const ANDCO_API_ERROR_CODES: {
14
- /**
15
- * The access token is missing, malformed, or no longer valid. Refresh once and retry; a second
16
- * failure means the Grant is gone and the person has to authorize the application again.
17
- */
18
- readonly INVALID_TOKEN: "invalid_token";
19
- /**
20
- * The Grant is valid but carries no scope for this operation. Not retryable: the application has
21
- * to request that scope and the person has to consent to it. The missing one arrives in
22
- * `error.details.required_scope`.
23
- */
24
- readonly INSUFFICIENT_SCOPE: "insufficient_scope";
25
- /**
26
- * The Grant covers the scope but not this exact resource -- an account outside the pattern it was
27
- * given, an action its authorization details do not name.
28
- */
29
- readonly INSUFFICIENT_AUTHORIZATION: "insufficient_authorization";
30
- /** The request arrived from an origin this Client is not registered for. */
31
- readonly INVALID_ORIGIN: "invalid_origin";
32
- /**
33
- * A Service asked for a token and no approved Grant matches its subject and resource. Someone has
34
- * to approve the permissions in Platform; there is nothing to retry.
35
- */
36
- readonly AUTHORIZATION_REQUIRED: "authorization_required";
37
- /**
38
- * More than one Grant of the Service matches its subject and resource. `error.details.candidate_grant_ids`
39
- * names them; pin one with `grant`.
40
- */
41
- readonly AMBIGUOUS_GRANT: "ambiguous_grant";
42
- /** The request body or parameters did not satisfy the contract. `error.details` names the fields. */
43
- readonly INVALID_REQUEST: "invalid_request";
44
- /**
45
- * An identifier in the path (an account, an Intent) is not well formed. The SDKs check it before
46
- * any request and fail with this same code, so a typo never reads as `not_found`.
47
- */
48
- readonly INVALID_IDENTIFIER: "invalid_identifier";
49
- /** The addressed resource does not exist, or exists outside what this Grant can see. */
50
- readonly NOT_FOUND: "not_found";
51
- /** The route exists and this case of it is not built yet. Not a client error: do not retry. */
52
- readonly NOT_IMPLEMENTED: "not_implemented";
53
- /** The `Content-Type` is not one this endpoint accepts. */
54
- readonly UNSUPPORTED_MEDIA_TYPE: "unsupported_media_type";
55
- /** The API version in the path is not one this deployment serves. */
56
- readonly UNSUPPORTED_VERSION: "unsupported_version";
57
- /**
58
- * An `Idempotency-Key` was reused for a different money movement. The first operation stands and
59
- * this one is refused on purpose: replaying a key with changed values is the shape a duplicated
60
- * payment takes.
61
- */
62
- readonly IDEMPOTENCY_CONFLICT: "idempotency_conflict";
63
- /**
64
- * The amount of an Intent is outside what the Grant allows: it exceeds `transactions.maximum` (or
65
- * differs from `transactions.value`) at creation, or exceeds the approver's maximum at approval,
66
- * which leaves the Intent pending for another approver. Raised before anything is presented.
67
- */
68
- readonly AMOUNT_OUT_OF_GRANT: "amount_out_of_grant";
69
- /** The accountKey of an account to open does not match the `bank_account` Grant's accountKey patterns. */
70
- readonly ACCOUNT_KEY_OUT_OF_GRANT: "account_key_out_of_grant";
71
- /**
72
- * The Account Key is already in use by an account of this subject and `upsert` was not asked, or
73
- * it belonged to an account that was closed: AccountKeys are never reused.
74
- */
75
- readonly ACCOUNT_KEY_TAKEN: "account_key_taken";
76
- /** The source of a transfer is not one the Grant's `sources` admit. */
77
- readonly INVALID_SOURCE: "invalid_source";
78
- /** The destination of a transfer, or the account a deposit names, is not one the Grant admits. */
79
- readonly INVALID_DESTINATION: "invalid_destination";
80
- /**
81
- * A deposit named no `destination` and the `bank_deposit` Grant admits more than one account.
82
- * Name the account in `destination`; a new Grant is not needed.
83
- */
84
- readonly DEPOSIT_DESTINATION_AMBIGUOUS: "deposit_destination_ambiguous";
85
- /**
86
- * A person has to act before this can succeed. For an Intent: only a person can release it, so it
87
- * cannot be approved by API. `error.details.reason` says why and `error.details.authorization_url`
88
- * is where the person does it: `bank_verification_required` when the transfer leaves its holder's
89
- * own accounts, which the bank accepts only after that person confirms it with their web PIN and a
90
- * code the bank sends to their phone (the Intent stays `requires_action` until then, and carries
91
- * the same word as `interaction_reason`); `source_account_required` when they still pick the account
92
- * the money leaves from. Nothing was approved or sent. For a read, a command on the bank, or the
93
- * release of an Intent that moves with nobody present (`POST /intents/{id}/approve`, or a Signed
94
- * Instruction whose signer may approve): the subject's connection with the bank needs the person
95
- * back, and `error.details.code` is one of {@link ANDCO_BANK_CONNECTION_ERROR_CODES} with
96
- * `error.details.interaction_url` naming where in Platform they do it. On an Intent,
97
- * the answer has `error.details.reason` with that value instead of `error.details.code`,
98
- * and `error.details.intent_id` names the Intent.
99
- * A credential's approval stays recorded, but nothing was frozen, sent or moved and the Intent
100
- * is still `requires_action`: the same request releases it once the person has acted. Not
101
- * retryable until then.
102
- */
103
- readonly INTERACTION_REQUIRED: "interaction_required";
104
- /** The source account does not hold enough money for this movement. */
105
- readonly INSUFFICIENT_FUNDS: "insufficient_funds";
106
- /** The Intent is not in a state where this operation applies -- already decided, already executed. */
107
- readonly INVALID_INTENT_STATE: "invalid_intent_state";
108
- /** The Intent's deadline passed before it was decided. A new Intent is the only way forward. */
109
- readonly INTENT_EXPIRED: "intent_expired";
110
- /** The compact JWS carrying the instruction did not verify against a registered signing key. */
111
- readonly INVALID_SIGNED_INSTRUCTION: "invalid_signed_instruction";
112
- /** The cursor was not issued for this collection, or was issued to a different caller. */
113
- readonly INVALID_CURSOR: "invalid_cursor";
114
- /** The cursor was not issued for this account listing. */
115
- readonly INVALID_ACCOUNTS_CURSOR: "invalid_accounts_cursor";
116
- /** The cursor was not issued for this event feed. */
117
- readonly INVALID_EVENT_CURSOR: "invalid_event_cursor";
118
- /**
119
- * Andco could not serve the request and the caller did nothing wrong. Safe to retry with backoff;
120
- * a money operation should carry the same `Idempotency-Key` when it does.
121
- */
122
- readonly TEMPORARILY_UNAVAILABLE: "temporarily_unavailable";
123
- };
124
- /** One of the conditions {@link ANDCO_API_ERROR_CODES} names. */
125
- export type AndcoApiErrorCode = (typeof ANDCO_API_ERROR_CODES)[keyof typeof ANDCO_API_ERROR_CODES];
126
1
  /**
127
2
  * Why a subject's connection with the bank needs the person back, sent as `code` next to
128
3
  * `interaction_required` (409), on a read, a bank command, and the release of an Intent (where
@@ -132,9 +7,11 @@ export type AndcoApiErrorCode = (typeof ANDCO_API_ERROR_CODES)[keyof typeof ANDC
132
7
  *
133
8
  * @example
134
9
  * ```ts
135
- * const { error } = await bank.accounts.list();
136
- * if (error?.code === "interaction_required" && error.details?.code === ANDCO_BANK_CONNECTION_ERROR_CODES.PIN_REQUIRED) {
137
- * askThePersonToOpen(error.details.interaction_url);
10
+ * const { error } = await bank.client.http.GET("/accounts");
11
+ * if (error?.code === "interaction_required") {
12
+ * if (error.data["code"] === ANDCO_BANK_CONNECTION_ERROR_CODES.PIN_REQUIRED) {
13
+ * askThePersonToOpen(error.data["interaction_url"]);
14
+ * }
138
15
  * }
139
16
  * ```
140
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"api-errors.d.ts","sourceRoot":"","sources":["../src/api-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB;IAEhC;;;OAGG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;IAEH,4EAA4E;;IAE5E;;;OAGG;;IAEH;;;OAGG;;IAIH,qGAAqG;;IAErG;;;OAGG;;IAEH,wFAAwF;;IAExF,+FAA+F;;IAE/F,2DAA2D;;IAE3D,qEAAqE;;IAIrE;;;;OAIG;;IAEH;;;;OAIG;;IAEH,0GAA0G;;IAE1G;;;OAGG;;IAEH,uEAAuE;;IAEvE,kGAAkG;;IAElG;;;OAGG;;IAEH;;;;;;;;;;;;;;;;;OAiBG;;IAEH,uEAAuE;;IAEvE,sGAAsG;;IAEtG,gGAAgG;;IAEhG,gGAAgG;;IAIhG,0FAA0F;;IAE1F,0DAA0D;;IAE1D,qDAAqD;;IAIrD;;;OAGG;;CAEK,CAAC;AAEX,iEAAiE;AACjE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAEnG;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iCAAiC;IAC5C;;;;OAIG;;IAEH;;;OAGG;;IAEH;;;OAGG;;CAEK,CAAC;AAEX,0EAA0E;AAC1E,MAAM,MAAM,4BAA4B,GACtC,CAAC,OAAO,iCAAiC,CAAC,CAAC,MAAM,OAAO,iCAAiC,CAAC,CAAC"}
1
+ {"version":3,"file":"api-errors.d.ts","sourceRoot":"","sources":["../src/api-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iCAAiC;IAC5C;;;;OAIG;;IAEH;;;OAGG;;IAEH;;;OAGG;;CAEK,CAAC;AAEX,0EAA0E;AAC1E,MAAM,MAAM,4BAA4B,GACtC,CAAC,OAAO,iCAAiC,CAAC,CAAC,MAAM,OAAO,iCAAiC,CAAC,CAAC"}
@@ -1,131 +1,3 @@
1
- /**
2
- * What the Andco API answers with in `{ "error": "..." }`. The SDK relays these untouched, so the
3
- * string an integrator receives here is the one the API reference documents.
4
- *
5
- * Known values, not an exhaustive type. The server gains codes without an SDK release -- closing
6
- * this would make every new server condition wait for a coordinated publish of four SDKs, and would
7
- * leave a code the server already sends unnameable until then. `AndcoError.code` stays a `string`
8
- * for the same reason, and {@link ANDCO_ERROR_CODES} shows the comparison shape: branch on the
9
- * members you handle, keep a `default` for the rest.
10
- *
11
- * @see https://sdk.andco.com/docs/reference/error-codes
12
- */
13
- export const ANDCO_API_ERROR_CODES = {
14
- // -- Authorization ---------------------------------------------------------------------------
15
- /**
16
- * The access token is missing, malformed, or no longer valid. Refresh once and retry; a second
17
- * failure means the Grant is gone and the person has to authorize the application again.
18
- */
19
- INVALID_TOKEN: "invalid_token",
20
- /**
21
- * The Grant is valid but carries no scope for this operation. Not retryable: the application has
22
- * to request that scope and the person has to consent to it. The missing one arrives in
23
- * `error.details.required_scope`.
24
- */
25
- INSUFFICIENT_SCOPE: "insufficient_scope",
26
- /**
27
- * The Grant covers the scope but not this exact resource -- an account outside the pattern it was
28
- * given, an action its authorization details do not name.
29
- */
30
- INSUFFICIENT_AUTHORIZATION: "insufficient_authorization",
31
- /** The request arrived from an origin this Client is not registered for. */
32
- INVALID_ORIGIN: "invalid_origin",
33
- /**
34
- * A Service asked for a token and no approved Grant matches its subject and resource. Someone has
35
- * to approve the permissions in Platform; there is nothing to retry.
36
- */
37
- AUTHORIZATION_REQUIRED: "authorization_required",
38
- /**
39
- * More than one Grant of the Service matches its subject and resource. `error.details.candidate_grant_ids`
40
- * names them; pin one with `grant`.
41
- */
42
- AMBIGUOUS_GRANT: "ambiguous_grant",
43
- // -- Request ---------------------------------------------------------------------------------
44
- /** The request body or parameters did not satisfy the contract. `error.details` names the fields. */
45
- INVALID_REQUEST: "invalid_request",
46
- /**
47
- * An identifier in the path (an account, an Intent) is not well formed. The SDKs check it before
48
- * any request and fail with this same code, so a typo never reads as `not_found`.
49
- */
50
- INVALID_IDENTIFIER: "invalid_identifier",
51
- /** The addressed resource does not exist, or exists outside what this Grant can see. */
52
- NOT_FOUND: "not_found",
53
- /** The route exists and this case of it is not built yet. Not a client error: do not retry. */
54
- NOT_IMPLEMENTED: "not_implemented",
55
- /** The `Content-Type` is not one this endpoint accepts. */
56
- UNSUPPORTED_MEDIA_TYPE: "unsupported_media_type",
57
- /** The API version in the path is not one this deployment serves. */
58
- UNSUPPORTED_VERSION: "unsupported_version",
59
- // -- Money -----------------------------------------------------------------------------------
60
- /**
61
- * An `Idempotency-Key` was reused for a different money movement. The first operation stands and
62
- * this one is refused on purpose: replaying a key with changed values is the shape a duplicated
63
- * payment takes.
64
- */
65
- IDEMPOTENCY_CONFLICT: "idempotency_conflict",
66
- /**
67
- * The amount of an Intent is outside what the Grant allows: it exceeds `transactions.maximum` (or
68
- * differs from `transactions.value`) at creation, or exceeds the approver's maximum at approval,
69
- * which leaves the Intent pending for another approver. Raised before anything is presented.
70
- */
71
- AMOUNT_OUT_OF_GRANT: "amount_out_of_grant",
72
- /** The accountKey of an account to open does not match the `bank_account` Grant's accountKey patterns. */
73
- ACCOUNT_KEY_OUT_OF_GRANT: "account_key_out_of_grant",
74
- /**
75
- * The Account Key is already in use by an account of this subject and `upsert` was not asked, or
76
- * it belonged to an account that was closed: AccountKeys are never reused.
77
- */
78
- ACCOUNT_KEY_TAKEN: "account_key_taken",
79
- /** The source of a transfer is not one the Grant's `sources` admit. */
80
- INVALID_SOURCE: "invalid_source",
81
- /** The destination of a transfer, or the account a deposit names, is not one the Grant admits. */
82
- INVALID_DESTINATION: "invalid_destination",
83
- /**
84
- * A deposit named no `destination` and the `bank_deposit` Grant admits more than one account.
85
- * Name the account in `destination`; a new Grant is not needed.
86
- */
87
- DEPOSIT_DESTINATION_AMBIGUOUS: "deposit_destination_ambiguous",
88
- /**
89
- * A person has to act before this can succeed. For an Intent: only a person can release it, so it
90
- * cannot be approved by API. `error.details.reason` says why and `error.details.authorization_url`
91
- * is where the person does it: `bank_verification_required` when the transfer leaves its holder's
92
- * own accounts, which the bank accepts only after that person confirms it with their web PIN and a
93
- * code the bank sends to their phone (the Intent stays `requires_action` until then, and carries
94
- * the same word as `interaction_reason`); `source_account_required` when they still pick the account
95
- * the money leaves from. Nothing was approved or sent. For a read, a command on the bank, or the
96
- * release of an Intent that moves with nobody present (`POST /intents/{id}/approve`, or a Signed
97
- * Instruction whose signer may approve): the subject's connection with the bank needs the person
98
- * back, and `error.details.code` is one of {@link ANDCO_BANK_CONNECTION_ERROR_CODES} with
99
- * `error.details.interaction_url` naming where in Platform they do it. On an Intent,
100
- * the answer has `error.details.reason` with that value instead of `error.details.code`,
101
- * and `error.details.intent_id` names the Intent.
102
- * A credential's approval stays recorded, but nothing was frozen, sent or moved and the Intent
103
- * is still `requires_action`: the same request releases it once the person has acted. Not
104
- * retryable until then.
105
- */
106
- INTERACTION_REQUIRED: "interaction_required",
107
- /** The source account does not hold enough money for this movement. */
108
- INSUFFICIENT_FUNDS: "insufficient_funds",
109
- /** The Intent is not in a state where this operation applies -- already decided, already executed. */
110
- INVALID_INTENT_STATE: "invalid_intent_state",
111
- /** The Intent's deadline passed before it was decided. A new Intent is the only way forward. */
112
- INTENT_EXPIRED: "intent_expired",
113
- /** The compact JWS carrying the instruction did not verify against a registered signing key. */
114
- INVALID_SIGNED_INSTRUCTION: "invalid_signed_instruction",
115
- // -- Pagination ------------------------------------------------------------------------------
116
- /** The cursor was not issued for this collection, or was issued to a different caller. */
117
- INVALID_CURSOR: "invalid_cursor",
118
- /** The cursor was not issued for this account listing. */
119
- INVALID_ACCOUNTS_CURSOR: "invalid_accounts_cursor",
120
- /** The cursor was not issued for this event feed. */
121
- INVALID_EVENT_CURSOR: "invalid_event_cursor",
122
- // -- Availability ----------------------------------------------------------------------------
123
- /**
124
- * Andco could not serve the request and the caller did nothing wrong. Safe to retry with backoff;
125
- * a money operation should carry the same `Idempotency-Key` when it does.
126
- */
127
- TEMPORARILY_UNAVAILABLE: "temporarily_unavailable",
128
- };
129
1
  /**
130
2
  * Why a subject's connection with the bank needs the person back, sent as `code` next to
131
3
  * `interaction_required` (409), on a read, a bank command, and the release of an Intent (where
@@ -135,9 +7,11 @@ export const ANDCO_API_ERROR_CODES = {
135
7
  *
136
8
  * @example
137
9
  * ```ts
138
- * const { error } = await bank.accounts.list();
139
- * if (error?.code === "interaction_required" && error.details?.code === ANDCO_BANK_CONNECTION_ERROR_CODES.PIN_REQUIRED) {
140
- * askThePersonToOpen(error.details.interaction_url);
10
+ * const { error } = await bank.client.http.GET("/accounts");
11
+ * if (error?.code === "interaction_required") {
12
+ * if (error.data["code"] === ANDCO_BANK_CONNECTION_ERROR_CODES.PIN_REQUIRED) {
13
+ * askThePersonToOpen(error.data["interaction_url"]);
14
+ * }
141
15
  * }
142
16
  * ```
143
17
  */
@@ -73,7 +73,7 @@ export declare const AndCoAuthorizationPreparationSchema: v.VariantSchema<"statu
73
73
  readonly uri: v.StringSchema<undefined>;
74
74
  readonly logoUri: v.StringSchema<undefined>;
75
75
  }, undefined>;
76
- readonly requirement: v.PicklistSchema<["phone", "personal_identity", "address", "bank_account"], undefined>;
76
+ readonly requirement: v.PicklistSchema<["phone", "personal_identity", "address", "bank_account", "identity_validation"], undefined>;
77
77
  readonly addressKind: v.NullableSchema<v.PicklistSchema<["home", "work", "any"], undefined>, undefined>;
78
78
  readonly progress: v.ObjectSchema<{
79
79
  readonly completed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
@@ -330,10 +330,10 @@ export declare const AndCoAuthorizationErrorSchema: v.ObjectSchema<{
330
330
  readonly error: v.ObjectSchema<{
331
331
  readonly code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
332
332
  readonly message: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>]>;
333
- readonly requirement: v.OptionalSchema<v.PicklistSchema<["phone", "personal_identity", "address", "bank_account"], undefined>, undefined>;
333
+ readonly requirement: v.OptionalSchema<v.PicklistSchema<["phone", "personal_identity", "address", "bank_account", "identity_validation"], undefined>, undefined>;
334
334
  }, undefined>;
335
335
  }, undefined>;
336
- /** Canonical consent state resolved by bank-webapp for one authorization. */
336
+ /** Canonical consent state resolved by andco-webapp for one authorization. */
337
337
  export type AndCoAuthorizationPreparation = v.InferOutput<typeof AndCoAuthorizationPreparationSchema>;
338
338
  /** Completed approve or deny result containing the safe OAuth continuation URL. */
339
339
  export type AndCoAuthorizationCompletion = v.InferOutput<typeof AndCoAuthorizationCompletionSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"authorization-preparation.d.ts","sourceRoot":"","sources":["../src/authorization-preparation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAG7B,uEAAuE;AACvE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;aAkBlC,CAA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AAC,OAAO,6BAA6B,CAAC,CAAC,OAAO,CAAC,CAAC"}
@@ -67,11 +67,15 @@ const AndCoAuthorizationClientSchema = /* @__PURE__ */ v.object({
67
67
  uri: v.string(),
68
68
  logoUri: v.string(),
69
69
  });
70
+ // `identity_validation` is the Validación de identidad an `identity` detail asks for with
71
+ // `validation: { required: true }`. Andco's authorization details are consented on the web only, so a
72
+ // native Host never receives it.
70
73
  const OAuthPrerequisiteRequirementSchema = /* @__PURE__ */ v.picklist([
71
74
  "phone",
72
75
  "personal_identity",
73
76
  "address",
74
77
  "bank_account",
78
+ "identity_validation",
75
79
  ]);
76
80
  const AndCoAuthorizationSignInRequiredSchema = /* @__PURE__ */ v.object({
77
81
  status: v.literal("sign_in_required"),
@@ -1,5 +1,5 @@
1
1
  import * as v from "valibot";
2
- import { SubjectPickerSchema } from "./rar/subject.js";
2
+ import { SubjectPickerSchema, subjectIssues } from "./rar/subject.js";
3
3
  import { SafeURL } from "./urls.js";
4
4
  /**
5
5
  * OAuth parameter names that automatically require PAR.
@@ -145,7 +145,7 @@ function SUBJECT_KEY(input) {
145
145
  if (input === undefined || input === null)
146
146
  return null;
147
147
  const parsed = v.safeParse(SubjectPickerSchema, input);
148
- if (!parsed.success || !parsed.output) {
148
+ if (!parsed.success || !parsed.output || subjectIssues(parsed.output).length > 0) {
149
149
  throw new AndCoAuthorizationRequestError("invalid_authorization_request", 'An authorization detail subject is { type: "profile" | "organization", identifier? }');
150
150
  }
151
151
  return `${parsed.output.type}:${parsed.output.identifier ?? ""}`;
package/dist/errors.d.ts CHANGED
@@ -1,10 +1,13 @@
1
+ import type { GrantedOrganizationSubject } from "./rar/subject.js";
1
2
  /**
2
3
  * Conditions Andco's own client code detects, in the shape the Andco API already uses for the codes
3
4
  * it sends: lower snake_case, no prefix. Both vocabularies end up in the same `error.code` field, so
4
5
  * an integrator should not have to remember which half of a failure produced the string in hand.
5
6
  *
6
- * The backend never reports any of these -- it cannot see a blocked popup or a browser without Web
7
- * Crypto -- which is why they live apart from {@link ANDCO_API_ERROR_CODES} rather than in one list.
7
+ * The backend never reports most of these -- it cannot see a blocked popup or a browser without Web
8
+ * Crypto -- which is why they live apart from the codes the API answers, which its OpenAPI document
9
+ * declares, each with its status and data. The two it shares, `invalid_identifier` and
10
+ * `invalid_request`, are here for the times the SDK refuses an argument before sending it.
8
11
  *
9
12
  * Compare against a member rather than a literal, and always leave a branch for a code you do not
10
13
  * recognise. This list grows, `AndcoError.code` is a plain `string` for that reason, and an
@@ -93,6 +96,14 @@ export declare const ANDCO_ERROR_CODES: {
93
96
  readonly UNTRUSTED_ORIGIN: "untrusted_origin";
94
97
  /** The person closed or rejected the authorization before it completed. Not a failure: a decision. */
95
98
  readonly AUTHORIZATION_CANCELLED: "authorization_cancelled";
99
+ /**
100
+ * The factory handed to `andco.auth.present(factory, ...)` threw, so there was no authorization
101
+ * URL to present. What failed is the application's own server (or whatever the factory called),
102
+ * not the SDK's configuration: `cause` holds the original error, and an `AndcoError` the factory
103
+ * throws itself is passed through with its own code. The window is already open when the factory
104
+ * runs, so it closes without navigating.
105
+ */
106
+ readonly AUTHORIZATION_FACTORY_FAILED: "authorization_factory_failed";
96
107
  /**
97
108
  * The authorization needs a bank account that is not open yet, because the bank is still
98
109
  * reviewing its opening. The Authorization Server ends the authorization with
@@ -110,6 +121,15 @@ export declare const ANDCO_ERROR_CODES: {
110
121
  * Not a cancellation. Start a new authorization; the progress made on the bank side is kept.
111
122
  */
112
123
  readonly AUTHORIZATION_EXPIRED: "authorization_expired";
124
+ /**
125
+ * The authorization asked for an Organization, and the person who signed in belongs to none where
126
+ * they may authorize applications. The Authorization Server ends it with
127
+ * `error=access_denied&error_description=organization_required` when they choose to go back.
128
+ *
129
+ * Not a cancellation. The consent screen offers to create an Empresa first; a new authorization
130
+ * after that lets them pick it.
131
+ */
132
+ readonly ORGANIZATION_REQUIRED: "organization_required";
113
133
  /** The authorization did not complete before its timeout elapsed. */
114
134
  readonly AUTHORIZATION_TIMEOUT: "authorization_timeout";
115
135
  /** Building or pushing (RFC 9126 PAR) an authorization request failed. */
@@ -149,6 +169,18 @@ export declare const ANDCO_ERROR_CODES: {
149
169
  readonly CONFIDENTIAL_CLIENT_REQUIRED: "confidential_client_required";
150
170
  /** The pushed authorization request (RFC 9126) answered without a usable `request_uri`. */
151
171
  readonly INVALID_PAR_RESPONSE: "invalid_par_response";
172
+ /**
173
+ * An identifier the caller passed (an Intent's, an account's) is not well formed, so no request was
174
+ * made. The API answers the same code when the malformed identifier reaches it; here the SDK caught
175
+ * it first. Not retryable: fix the identifier.
176
+ */
177
+ readonly INVALID_IDENTIFIER: "invalid_identifier";
178
+ /**
179
+ * An argument the caller passed, such as pagination that mixes cursor and offset families or asks
180
+ * for zero items, is not one the operation takes, so no request was made. `details.issues` names
181
+ * each problem as `{ type, path }`. The API answers the same code for the same request.
182
+ */
183
+ readonly INVALID_REQUEST: "invalid_request";
152
184
  /**
153
185
  * An Intent watch was stopped, by `stop()` or its signal, before the Intent reached a terminal
154
186
  * status. A decision of the caller, not a failure; the watch's `intent` still holds the last read.
@@ -181,6 +213,26 @@ export declare const ANDCO_ERROR_CODES: {
181
213
  };
182
214
  /** One of the conditions {@link ANDCO_ERROR_CODES} names. */
183
215
  export type AndcoErrorCode = (typeof ANDCO_ERROR_CODES)[keyof typeof ANDCO_ERROR_CODES];
216
+ /**
217
+ * The codes of the failures the SDK's own credentials throw instead of a token, which stop a call
218
+ * before it goes out:
219
+ *
220
+ * - `session_missing`, `storage_failed`, `browser_required`, `refresh_failed` and
221
+ * `invalid_token_response`, from the credentials of a session.
222
+ * - `ambiguous_grant`, `invalid_grant` and `invalid_response`, which `AndcoService`'s token exchange
223
+ * relays from the Authorization Server (or raises when the issuer answers something unusable).
224
+ * - `invalid_configuration`, from a `Bank` built without credentials.
225
+ *
226
+ * `authorization_required` is one more, thrown as an {@link AndcoAuthorizationRequiredError}. Any
227
+ * other code the Authorization Server relays (its vocabulary is open) and any code a resolver an
228
+ * integrator wrote throws reach the caller as `request_failed` with the error as `cause`.
229
+ *
230
+ * `no_token_for_resource` is not here: the credentials turn it into a call without an
231
+ * `Authorization` header, so the API answers it instead.
232
+ */
233
+ export declare const ANDCO_CREDENTIALS_ERROR_CODES: readonly ["session_missing", "storage_failed", "browser_required", "refresh_failed", "invalid_token_response", "ambiguous_grant", "invalid_grant", "invalid_response", "invalid_configuration"];
234
+ /** One of the codes {@link ANDCO_CREDENTIALS_ERROR_CODES} lists. */
235
+ export type AndcoCredentialsErrorCode = (typeof ANDCO_CREDENTIALS_ERROR_CODES)[number];
184
236
  /**
185
237
  * The subset a widget may report to its host page over postMessage.
186
238
  *
@@ -196,7 +248,7 @@ export declare const ANDCO_BRIDGE_ERROR_CODES: readonly ["invalid_endpoint_auth"
196
248
  * `error=access_denied` although nobody declined. Each is also the {@link ANDCO_ERROR_CODES} member
197
249
  * of the same value. The one list every parser of the authorization redirect consults.
198
250
  */
199
- export declare const ANDCO_ACCESS_DENIED_WITHOUT_DECISION: readonly ["bank_account_pending_review", "authorization_expired"];
251
+ export declare const ANDCO_ACCESS_DENIED_WITHOUT_DECISION: readonly ["bank_account_pending_review", "authorization_expired", "organization_required"];
200
252
  /**
201
253
  * Whether an authorization redirect's error is `access_denied` with a description that names a
202
254
  * condition rather than a person's decision. Such a redirect is an error, never a dismissal.
@@ -220,38 +272,42 @@ export declare class ErrorExtendable extends Error {
220
272
  * The single error type every Andco operation reports.
221
273
  *
222
274
  * An integrator writes one `catch`-equivalent branch and compares one `code`, whether the failure
223
- * came from authentication, an Intent, the resource API or the SDK itself. `code` is a plain string
224
- * because it also carries codes this package does not own, such as the Authorization Server's OAuth
225
- * error identifiers, and the same string identifies the same condition in the Python SDK.
275
+ * came from authentication, an Intent, the resource API or the SDK itself. A failure the API answered
276
+ * is an `AndcoResponseError` (`@andco/sdk`), a subclass whose `code` is the API's `error` and whose
277
+ * `data` carries the error's own fields.
278
+ *
279
+ * `Code` narrows `code` where the set is known, so a union of errors is discriminated by it: an
280
+ * operation's error is one member per code it can answer. It defaults to a plain string because
281
+ * `code` also carries codes this package does not own, such as the Authorization Server's OAuth error
282
+ * identifiers, and the same string identifies the same condition in the Python SDK.
226
283
  *
227
284
  * @example
228
285
  * ```ts
229
286
  * const { data, error } = await andco.intents.get(intentId);
230
287
  * if (error) {
231
- * if (error.code === "insufficient_authorization") return reconnect();
288
+ * if (error.code === "not_found") return showUnknownOrder();
232
289
  * throw error;
233
290
  * }
234
291
  * ```
235
292
  */
236
- export declare class AndcoError extends Error {
293
+ export declare class AndcoError<Code extends string = string> extends Error {
237
294
  /** Stable identifier. Branch on this, never on `message`. */
238
- readonly code: string;
295
+ readonly code: Code;
239
296
  /** HTTP status when the error came from a response. */
240
297
  readonly status: number | undefined;
241
298
  /**
242
- * The remaining fields of the error body.
243
- *
244
- * Andco reports more than a code — `required_scope` on an authorization failure, per-field notes
245
- * on a rejected input. Branch on `code`, but surface these: without them an integrator can only
246
- * tell a user that something failed, not which permission is missing.
299
+ * What the SDK learned about a failure it detected itself, beyond its code: the Intent of
300
+ * `intent_ended`, the problems of a refused argument (`issues`).
247
301
  *
248
302
  * When the Authorization Server refused an exchange (a refresh, a code or device exchange, a
249
303
  * revocation) with an RFC 6749 error body, it carries two keys of its own: `oauth_error`, the
250
304
  * answer's `error` (`"invalid_grant"`, `"temporarily_unavailable"`, ...), and, when the server sent
251
305
  * one, `oauth_error_description`. They are absent when the server answered nothing OAuth-shaped.
306
+ *
307
+ * The fields of an error the API answered are not here: they are an `AndcoResponseError`'s `data`.
252
308
  */
253
309
  readonly details: Readonly<Record<string, unknown>> | undefined;
254
- constructor(code: string, options?: {
310
+ constructor(code: Code, options?: {
255
311
  message?: string;
256
312
  status?: number;
257
313
  cause?: unknown;
@@ -261,11 +317,28 @@ export declare class AndcoError extends Error {
261
317
  static from(cause: unknown, fallbackCode: AndcoErrorCode): AndcoError;
262
318
  /** Whether a value is an `AndcoError`. */
263
319
  static is(cause: unknown): cause is AndcoError;
320
+ /**
321
+ * Whether a value is one of the failures the SDK's own credentials throw instead of a token: an
322
+ * `AndcoError` with a code of {@link ANDCO_CREDENTIALS_ERROR_CODES}, or an
323
+ * {@link AndcoAuthorizationRequiredError}. Any other `AndcoError` is not, whatever its code.
324
+ *
325
+ * @example
326
+ * ```ts
327
+ * try {
328
+ * return await credentials.accessTokenFor(resource);
329
+ * } catch (cause) {
330
+ * if (AndcoError.isCredentialsError(cause)) return signOut(cause.code);
331
+ * throw cause;
332
+ * }
333
+ * ```
334
+ */
335
+ static isCredentialsError(cause: unknown): cause is AndcoCredentialsError;
264
336
  /**
265
337
  * Whether the Grant or session behind a failure no longer works, so the only way out is for the
266
338
  * person to authorize again. It is `true` for:
267
339
  *
268
- * - a `401` from the Resource API,
340
+ * - a `401` from the Resource API (`invalid_token`, the only error the API answers with 401 for a
341
+ * bad token), as an `AndcoError` or as the raw error body `rest.raw` hands through,
269
342
  * - `session_missing`,
270
343
  * - `no_token_for_resource`,
271
344
  * - `refresh_failed` whose `details.oauth_error` is `invalid_grant` or `invalid_token`.
@@ -285,4 +358,26 @@ export declare class AndcoError extends Error {
285
358
  */
286
359
  static isAuthorizationEnded(cause: unknown): boolean;
287
360
  }
361
+ /**
362
+ * No approved Grant covers a Service's subject and resource. Version one never opens a login flow:
363
+ * a person approves the Grant in Platform.
364
+ *
365
+ * @example
366
+ * ```ts
367
+ * const { error } = await bank.client.http.GET("/accounts");
368
+ * if (error?.code === "authorization_required") console.error(error.subject, error.resource);
369
+ * ```
370
+ */
371
+ export declare class AndcoAuthorizationRequiredError extends AndcoError<"authorization_required"> {
372
+ readonly subject: GrantedOrganizationSubject;
373
+ readonly resource: string;
374
+ constructor(subject: GrantedOrganizationSubject, resource: string);
375
+ }
376
+ /**
377
+ * What the SDK's own credentials throw instead of a token: an `AndcoError` of one of the
378
+ * {@link AndcoCredentialsErrorCode}s, or an {@link AndcoAuthorizationRequiredError}, which carries
379
+ * the subject and the resource. It is part of the error of every operation that sends a request
380
+ * (see `AndcoOperationError` in `@andco/sdk`), so comparing `code` narrows it.
381
+ */
382
+ export type AndcoCredentialsError = AndcoError<AndcoCredentialsErrorCode> | AndcoAuthorizationRequiredError;
288
383
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,iBAAiB;IAE5B,uGAAuG;;IAEvG,6EAA6E;;IAE7E,uGAAuG;;IAEvG,6DAA6D;;IAE7D,wFAAwF;;IAMxF,+GAA+G;;IAE/G,wEAAwE;;IAExE,6DAA6D;;IAE7D,0DAA0D;;IAE1D,iEAAiE;;IAEjE,wGAAwG;;IAExG,mEAAmE;;IAEnE,8EAA8E;;IAE9E,uEAAuE;;IAEvE,8DAA8D;;IAE9D,6EAA6E;;IAE7E,uGAAuG;;IAIvG;;;OAGG;;IAEH,yFAAyF;;IAEzF,+EAA+E;;IAE/E,mEAAmE;;IAEnE,qEAAqE;;IAErE,sGAAsG;;IAEtG,sFAAsF;;IAEtF;;;OAGG;;IAEH;;;;OAIG;;IAIH,sGAAsG;;IAEtG;;;;;;;OAOG;;IAEH;;;;;;OAMG;;IAEH,qEAAqE;;IAErE,0EAA0E;;IAE1E,6DAA6D;;IAE7D,gEAAgE;;IAEhE,8EAA8E;;IAE9E,4FAA4F;;IAE5F;;;OAGG;;IAEH,4DAA4D;;IAE5D,qGAAqG;;IAErG,wGAAwG;;IAExG,mGAAmG;;IAEnG;;;OAGG;;IAEH,sGAAsG;;IAGtG;;;OAGG;;IAEH,2FAA2F;;IAI3F;;;OAGG;;IAEH;;;;OAIG;;IAEH;;;;;;OAMG;;IAEH;;;;OAIG;;IAEH,yDAAyD;;IAIzD,qGAAqG;;CAE7F,CAAC;AAEX,6DAA6D;AAC7D,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAi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