@andco/protocol 0.0.14 → 0.1.0-ti.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/api-errors.d.ts +9 -9
- package/dist/api-errors.js +9 -9
- package/dist/authorization-preparation.d.ts +1 -1
- package/dist/authorization-preparation.js +2 -2
- package/dist/authorization.d.ts +1 -1
- package/dist/authorization.js +1 -1
- package/dist/consent.d.ts +2 -2
- package/dist/consent.js +2 -2
- package/dist/errors.d.ts +10 -10
- package/dist/errors.js +10 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/intent-input.d.ts +452 -880
- package/dist/intent-input.d.ts.map +1 -1
- package/dist/intent-input.js +164 -127
- package/dist/intent-status.d.ts +5 -6
- package/dist/intent-status.d.ts.map +1 -1
- package/dist/intent-status.js +12 -7
- package/dist/miniapp-manifest.d.ts +3 -3
- package/dist/miniapp-manifest.js +1 -1
- package/dist/native-intent.d.ts +82 -68
- package/dist/native-intent.d.ts.map +1 -1
- package/dist/native-intent.js +137 -84
- package/dist/native.d.ts +1 -1
- package/dist/rar/account-matchers.d.ts +35 -30
- package/dist/rar/account-matchers.d.ts.map +1 -1
- package/dist/rar/account-matchers.js +27 -21
- package/dist/rar/bank.d.ts +357 -85
- package/dist/rar/bank.d.ts.map +1 -1
- package/dist/rar/bank.js +43 -5
- package/dist/rar/catalog.d.ts +174 -49
- package/dist/rar/catalog.d.ts.map +1 -1
- package/dist/rar/catalog.js +6 -6
- package/dist/rar/detail.d.ts +1 -1
- package/dist/rar/detail.js +1 -1
- package/dist/rar/json-schemas.generated.d.ts +1 -1
- package/dist/rar/json-schemas.generated.d.ts.map +1 -1
- package/dist/rar/json-schemas.generated.js +393 -21
- package/dist/rar/money.d.ts +1 -1
- package/dist/rar/money.js +1 -1
- package/dist/rar/subject-data.d.ts +1 -1
- package/dist/rar/subject-data.js +1 -1
- package/dist/rar/subject.d.ts +1 -1
- package/dist/rar/subject.js +1 -1
- package/dist/rest/accounts.d.ts +28 -28
- package/dist/rest/accounts.d.ts.map +1 -1
- package/dist/rest/accounts.js +22 -22
- package/dist/rest/api-error.d.ts +1 -1
- package/dist/rest/api-error.js +1 -1
- package/dist/rest/catalog.d.ts +3 -3
- package/dist/rest/catalog.js +2 -2
- package/dist/rest/common.d.ts +3 -3
- package/dist/rest/common.js +3 -3
- package/dist/rest/contract.d.ts +1183 -547
- package/dist/rest/contract.d.ts.map +1 -1
- package/dist/rest/contract.js +21 -5
- package/dist/rest/events.d.ts +1 -1
- package/dist/rest/events.d.ts.map +1 -1
- package/dist/rest/events.js +2 -2
- package/dist/rest/identity.d.ts +22 -22
- package/dist/rest/identity.d.ts.map +1 -1
- package/dist/rest/identity.js +5 -5
- package/dist/rest/index.d.ts +1 -0
- package/dist/rest/index.d.ts.map +1 -1
- package/dist/rest/index.js +1 -0
- package/dist/rest/intents.d.ts +973 -743
- package/dist/rest/intents.d.ts.map +1 -1
- package/dist/rest/intents.js +112 -89
- package/dist/rest/signatures.d.ts +25 -5
- package/dist/rest/signatures.d.ts.map +1 -1
- package/dist/rest/signatures.js +52 -0
- package/dist/rest/transfers.d.ts +988 -0
- package/dist/rest/transfers.d.ts.map +1 -0
- package/dist/rest/transfers.js +142 -0
- package/dist/scopes.d.ts +1 -1
- package/dist/signing.d.ts +17 -3
- package/dist/signing.d.ts.map +1 -1
- package/dist/signing.js +8 -1
- package/dist/transfer.d.ts +399 -0
- package/dist/transfer.d.ts.map +1 -0
- package/dist/transfer.js +313 -0
- package/dist/transport/financial-events.d.ts +82 -27
- package/dist/transport/financial-events.d.ts.map +1 -1
- package/dist/transport/financial-events.js +34 -0
- package/dist/transport/generated/oauth-api.d.ts +1420 -333
- package/dist/transport/generated/oauth-api.d.ts.map +1 -1
- package/dist/transport/intents.d.ts +29 -13
- package/dist/transport/intents.d.ts.map +1 -1
- package/dist/transport/intents.js +1 -1
- package/dist/transport/rest.d.ts +5 -5
- package/dist/urls.d.ts +2 -2
- package/dist/urls.js +3 -3
- package/dist/userinfo.d.ts +2 -2
- package/dist/userinfo.js +2 -2
- package/dist/webhooks.d.ts +16 -16
- package/dist/webhooks.js +14 -14
- package/dist/window-features.d.ts +2 -2
- package/dist/window-features.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `@andco/protocol`
|
|
2
2
|
|
|
3
|
-
Shared protocol schemas, validators, OAuth helpers, message contracts, typed transport, and webhook verification used by the
|
|
3
|
+
Shared protocol schemas, validators, OAuth helpers, message contracts, typed transport, and webhook verification used by the AndCo SDK.
|
|
4
4
|
|
|
5
5
|
Developer preview: APIs may change before 1.0.
|
|
6
6
|
|
|
@@ -31,7 +31,7 @@ const detail = parseAndcoGrantRequest({
|
|
|
31
31
|
- Compose resource-specific authorization and resolve GET/PAR transport.
|
|
32
32
|
- Share hosted iframe and native authorization message contracts.
|
|
33
33
|
- Use `@andco/protocol/transport` for the generated resource contract.
|
|
34
|
-
- Use `@andco/protocol/webhooks` to verify
|
|
34
|
+
- Use `@andco/protocol/webhooks` to verify AndCo's Ed25519 webhook signatures and parse lifecycle events.
|
|
35
35
|
|
|
36
36
|
Schemas and helpers are runtime-neutral; portable crypto helpers use Web Crypto. The SDK wraps these contracts with sessions and operations.
|
|
37
37
|
|
package/dist/api-errors.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Why a subject's connection with
|
|
3
|
-
* `interaction_required` (409), on a read, a
|
|
2
|
+
* Why a subject's connection with AndCo needs the person back, sent as `code` next to
|
|
3
|
+
* `interaction_required` (409), on a read, a command to AndCo, and the release of an Intent (where
|
|
4
4
|
* `reason` carries it instead of `code`, and `intent_id` names the Intent). The Grant is intact in every
|
|
5
5
|
* case: once the person does what the code names, at `interaction_url`, the same request
|
|
6
6
|
* succeeds.
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const ANDCO_BANK_CONNECTION_ERROR_CODES: {
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
* typing their web
|
|
22
|
-
*
|
|
20
|
+
* AndCo ended the session AndCo operates the account with, and the person brings it back by
|
|
21
|
+
* typing their web AndPass. Happens when nobody could keep the session alive for seven days, or when
|
|
22
|
+
* AndCo's answer to a renewal was lost.
|
|
23
23
|
*/
|
|
24
24
|
readonly PIN_REQUIRED: "bank_connection_pin_required";
|
|
25
25
|
/**
|
|
26
|
-
* The account is no longer connected to the web: the person disconnected it, or
|
|
27
|
-
* the web's access. The person has to connect the account again, identity
|
|
26
|
+
* The account is no longer connected to the web: the person disconnected it, or AndCo revoked
|
|
27
|
+
* the web's access. The person has to connect the account again, identity verification included.
|
|
28
28
|
*/
|
|
29
29
|
readonly RECONNECT_REQUIRED: "bank_connection_reconnect_required";
|
|
30
30
|
/**
|
|
31
|
-
* The Organization's
|
|
32
|
-
* connect another
|
|
31
|
+
* The Organization's account representative can no longer act for it. The Organization has to
|
|
32
|
+
* connect another account representative, and then the same request succeeds.
|
|
33
33
|
*/
|
|
34
34
|
readonly REPRESENTATIVE_REPLACEMENT_REQUIRED: "bank_representative_replacement_required";
|
|
35
35
|
};
|
package/dist/api-errors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Why a subject's connection with
|
|
3
|
-
* `interaction_required` (409), on a read, a
|
|
2
|
+
* Why a subject's connection with AndCo needs the person back, sent as `code` next to
|
|
3
|
+
* `interaction_required` (409), on a read, a command to AndCo, and the release of an Intent (where
|
|
4
4
|
* `reason` carries it instead of `code`, and `intent_id` names the Intent). The Grant is intact in every
|
|
5
5
|
* case: once the person does what the code names, at `interaction_url`, the same request
|
|
6
6
|
* succeeds.
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
*/
|
|
18
18
|
export const ANDCO_BANK_CONNECTION_ERROR_CODES = {
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
* typing their web
|
|
22
|
-
*
|
|
20
|
+
* AndCo ended the session AndCo operates the account with, and the person brings it back by
|
|
21
|
+
* typing their web AndPass. Happens when nobody could keep the session alive for seven days, or when
|
|
22
|
+
* AndCo's answer to a renewal was lost.
|
|
23
23
|
*/
|
|
24
24
|
PIN_REQUIRED: "bank_connection_pin_required",
|
|
25
25
|
/**
|
|
26
|
-
* The account is no longer connected to the web: the person disconnected it, or
|
|
27
|
-
* the web's access. The person has to connect the account again, identity
|
|
26
|
+
* The account is no longer connected to the web: the person disconnected it, or AndCo revoked
|
|
27
|
+
* the web's access. The person has to connect the account again, identity verification included.
|
|
28
28
|
*/
|
|
29
29
|
RECONNECT_REQUIRED: "bank_connection_reconnect_required",
|
|
30
30
|
/**
|
|
31
|
-
* The Organization's
|
|
32
|
-
* connect another
|
|
31
|
+
* The Organization's account representative can no longer act for it. The Organization has to
|
|
32
|
+
* connect another account representative, and then the same request succeeds.
|
|
33
33
|
*/
|
|
34
34
|
REPRESENTATIVE_REPLACEMENT_REQUIRED: "bank_representative_replacement_required",
|
|
35
35
|
};
|
|
@@ -333,7 +333,7 @@ export declare const AndCoAuthorizationErrorSchema: v.ObjectSchema<{
|
|
|
333
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
|
|
336
|
+
/** Canonical consent state resolved by the Platform 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>;
|
|
@@ -67,8 +67,8 @@ const AndCoAuthorizationClientSchema = /* @__PURE__ */ v.object({
|
|
|
67
67
|
uri: v.string(),
|
|
68
68
|
logoUri: v.string(),
|
|
69
69
|
});
|
|
70
|
-
// `identity_validation` is the
|
|
71
|
-
// `validation: { required: true }`.
|
|
70
|
+
// `identity_validation` is the Verificació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
72
|
// native Host never receives it.
|
|
73
73
|
const OAuthPrerequisiteRequirementSchema = /* @__PURE__ */ v.picklist([
|
|
74
74
|
"phone",
|
package/dist/authorization.d.ts
CHANGED
|
@@ -103,7 +103,7 @@ export declare const ANDCO_MAX_ORGANIZATION_ID = 2147483647;
|
|
|
103
103
|
/**
|
|
104
104
|
* Composes Resource Server contributions without losing their audience association.
|
|
105
105
|
*
|
|
106
|
-
* Every detail,
|
|
106
|
+
* Every detail, AndCo's or a third party's, names whose resources it asks for in its own `subject`
|
|
107
107
|
* (`{ type: "profile" }`, `{ type: "organization", identifier? }`, or absent for the signed-in
|
|
108
108
|
* Profile). The plan binds each detail to its Resource Server through `locations` and refuses, with
|
|
109
109
|
* `not_implemented`, details that name different subjects: the Authorization Server answers the
|
package/dist/authorization.js
CHANGED
|
@@ -67,7 +67,7 @@ const PushedAuthorizationResponseSchema = /* @__PURE__ */ v.object({
|
|
|
67
67
|
/**
|
|
68
68
|
* Composes Resource Server contributions without losing their audience association.
|
|
69
69
|
*
|
|
70
|
-
* Every detail,
|
|
70
|
+
* Every detail, AndCo's or a third party's, names whose resources it asks for in its own `subject`
|
|
71
71
|
* (`{ type: "profile" }`, `{ type: "organization", identifier? }`, or absent for the signed-in
|
|
72
72
|
* Profile). The plan binds each detail to its Resource Server through `locations` and refuses, with
|
|
73
73
|
* `not_implemented`, details that name different subjects: the Authorization Server answers the
|
package/dist/consent.d.ts
CHANGED
|
@@ -41,12 +41,12 @@ export declare function ANDCO_CONSENT_INITIAL_SCOPES(consent: Extract<AndCoAutho
|
|
|
41
41
|
/**
|
|
42
42
|
* Groups a consent by Resource Server, in the order of the request's `resource` parameters: each one
|
|
43
43
|
* with its own scopes and, for a third party asked for details, its live decision. OpenID Connect
|
|
44
|
-
* scopes come through the
|
|
44
|
+
* scopes come through the AndCo API's policies but belong to the Identity Session, so the AndCo API's
|
|
45
45
|
* group owns none of them; they stay in `consent.scopes` for the identity section.
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
48
|
* const groups = ANDCO_CONSENT_RESOURCE_SERVER_GROUPS(consent);
|
|
49
|
-
* groups.map((group) => group.server.resourceServerName); // ["
|
|
49
|
+
* groups.map((group) => group.server.resourceServerName); // ["AndCo API", "Casa Norte Ecommerce"]
|
|
50
50
|
*/
|
|
51
51
|
export declare function ANDCO_CONSENT_RESOURCE_SERVER_GROUPS(consent: PreparedConsent): {
|
|
52
52
|
server: {
|
package/dist/consent.js
CHANGED
|
@@ -39,12 +39,12 @@ export function ANDCO_CONSENT_INITIAL_SCOPES(consent) {
|
|
|
39
39
|
/**
|
|
40
40
|
* Groups a consent by Resource Server, in the order of the request's `resource` parameters: each one
|
|
41
41
|
* with its own scopes and, for a third party asked for details, its live decision. OpenID Connect
|
|
42
|
-
* scopes come through the
|
|
42
|
+
* scopes come through the AndCo API's policies but belong to the Identity Session, so the AndCo API's
|
|
43
43
|
* group owns none of them; they stay in `consent.scopes` for the identity section.
|
|
44
44
|
*
|
|
45
45
|
* @example
|
|
46
46
|
* const groups = ANDCO_CONSENT_RESOURCE_SERVER_GROUPS(consent);
|
|
47
|
-
* groups.map((group) => group.server.resourceServerName); // ["
|
|
47
|
+
* groups.map((group) => group.server.resourceServerName); // ["AndCo API", "Casa Norte Ecommerce"]
|
|
48
48
|
*/
|
|
49
49
|
export function ANDCO_CONSENT_RESOURCE_SERVER_GROUPS(consent) {
|
|
50
50
|
return [...consent.resourceServers]
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { GrantedOrganizationSubject } from "./rar/subject.js";
|
|
2
2
|
/**
|
|
3
|
-
* Conditions
|
|
3
|
+
* Conditions AndCo's own client code detects, in the shape the AndCo API already uses for the codes
|
|
4
4
|
* it sends: lower snake_case, no prefix. Both vocabularies end up in the same `error.code` field, so
|
|
5
5
|
* an integrator should not have to remember which half of a failure produced the string in hand.
|
|
6
6
|
*
|
|
7
|
-
* The
|
|
7
|
+
* The API never reports most of these -- it cannot see a blocked popup or a browser without Web
|
|
8
8
|
* Crypto -- which is why they live apart from the codes the API answers, which its OpenAPI document
|
|
9
9
|
* declares, each with its status and data. The two it shares, `invalid_identifier` and
|
|
10
10
|
* `invalid_request`, are here for the times the SDK refuses an argument before sending it.
|
|
@@ -24,7 +24,7 @@ import type { GrantedOrganizationSubject } from "./rar/subject.js";
|
|
|
24
24
|
* return "Tu sesión expiró. Vuelve a ingresar.";
|
|
25
25
|
* default:
|
|
26
26
|
* // A code this build does not know about: report it, never swallow it.
|
|
27
|
-
* console.error("[messageFor] unhandled
|
|
27
|
+
* console.error("[messageFor] unhandled AndCo error code: %s", error.code);
|
|
28
28
|
* return "No pudimos completar la operación.";
|
|
29
29
|
* }
|
|
30
30
|
* }
|
|
@@ -46,7 +46,7 @@ export declare const ANDCO_ERROR_CODES: {
|
|
|
46
46
|
readonly INVALID_CONFIGURATION: "invalid_configuration";
|
|
47
47
|
/** The configured Authorization Server endpoint is not a usable URL. */
|
|
48
48
|
readonly INVALID_ENDPOINT_AUTH: "invalid_endpoint_auth";
|
|
49
|
-
/** The configured
|
|
49
|
+
/** The configured AndCo API endpoint is not a usable URL. */
|
|
50
50
|
readonly INVALID_ENDPOINT_API: "invalid_endpoint_api";
|
|
51
51
|
/** The configured button endpoint is not a usable URL. */
|
|
52
52
|
readonly INVALID_ENDPOINT_BUTTON: "invalid_endpoint_button";
|
|
@@ -56,7 +56,7 @@ export declare const ANDCO_ERROR_CODES: {
|
|
|
56
56
|
readonly INVALID_REDIRECT_TO: "invalid_redirect_to";
|
|
57
57
|
/** The requested authentication mode is not one the SDK offers. */
|
|
58
58
|
readonly INVALID_AUTH_MODE: "invalid_auth_mode";
|
|
59
|
-
/** At least one requested permission scope is not a scope
|
|
59
|
+
/** At least one requested permission scope is not a scope AndCo publishes. */
|
|
60
60
|
readonly INVALID_SCOPE: "invalid_scope";
|
|
61
61
|
/** The requested SDK protocol version is not one this build speaks. */
|
|
62
62
|
readonly INVALID_VERSION: "invalid_version";
|
|
@@ -105,7 +105,7 @@ export declare const ANDCO_ERROR_CODES: {
|
|
|
105
105
|
*/
|
|
106
106
|
readonly AUTHORIZATION_FACTORY_FAILED: "authorization_factory_failed";
|
|
107
107
|
/**
|
|
108
|
-
* The authorization needs a
|
|
108
|
+
* The authorization needs a digital account that is not open yet, because AndCo is still
|
|
109
109
|
* reviewing its opening. The Authorization Server ends the authorization with
|
|
110
110
|
* `error=access_denied&error_description=bank_account_pending_review`.
|
|
111
111
|
*
|
|
@@ -118,7 +118,7 @@ export declare const ANDCO_ERROR_CODES: {
|
|
|
118
118
|
* account. The Authorization Server ends it with
|
|
119
119
|
* `error=access_denied&error_description=authorization_expired`.
|
|
120
120
|
*
|
|
121
|
-
* Not a cancellation. Start a new authorization; the progress made on the
|
|
121
|
+
* Not a cancellation. Start a new authorization; the progress made on the AndCo side is kept.
|
|
122
122
|
*/
|
|
123
123
|
readonly AUTHORIZATION_EXPIRED: "authorization_expired";
|
|
124
124
|
/**
|
|
@@ -258,7 +258,7 @@ export declare function isAuthorizationEndedWithoutDecision(error: string | null
|
|
|
258
258
|
* What an authorization callback's `error` must look like for the SDK to report it as the error's
|
|
259
259
|
* code: ASCII letters, digits, `_`, `.` and `-`, 1 to 128 of them. Any other value (empty, a
|
|
260
260
|
* character outside the set, or longer) is `invalid_callback`, and its message does not repeat the
|
|
261
|
-
* value, which the URL's author controls. Every
|
|
261
|
+
* value, which the URL's author controls. Every AndCo SDK (JavaScript, Go, Python and Ruby) checks
|
|
262
262
|
* the callback's `error` against this same pattern; the shared cases are the `oauth_error_code`
|
|
263
263
|
* section of the conformance vectors.
|
|
264
264
|
*
|
|
@@ -269,7 +269,7 @@ export declare const OAUTH_ERROR_CODE_PATTERN = "^[A-Za-z0-9_.-]{1,128}$";
|
|
|
269
269
|
* The authorization callback's parameters that carry one value: each appears at most once and, when
|
|
270
270
|
* it appears, is not empty. A callback that repeats one or leaves it empty is `invalid_callback`,
|
|
271
271
|
* whatever else it carries, since two readers of the same URL could otherwise act on different
|
|
272
|
-
* values. Every
|
|
272
|
+
* values. Every AndCo SDK (JavaScript, Go, Python and Ruby) refuses such a callback the same way;
|
|
273
273
|
* the shared cases are the `oauth_callback_parameters` section of the conformance vectors.
|
|
274
274
|
*
|
|
275
275
|
* @see https://github.com/haulmer/andco-sdk-js/blob/main/docs/adr/0044-reject-a-repeated-or-empty-oauth-callback-parameter-in-every-sdk.md
|
|
@@ -296,7 +296,7 @@ export declare class ErrorExtendable extends Error {
|
|
|
296
296
|
static is<T extends ErrorExtendable>(error: unknown, errorClass: new (...args: any[]) => T): error is T;
|
|
297
297
|
}
|
|
298
298
|
/**
|
|
299
|
-
* The single error type every
|
|
299
|
+
* The single error type every AndCo operation reports.
|
|
300
300
|
*
|
|
301
301
|
* An integrator writes one `catch`-equivalent branch and compares one `code`, whether the failure
|
|
302
302
|
* came from authentication, an Intent, the resource API or the SDK itself. A failure the API answered
|
package/dist/errors.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Conditions
|
|
2
|
+
* Conditions AndCo's own client code detects, in the shape the AndCo API already uses for the codes
|
|
3
3
|
* it sends: lower snake_case, no prefix. Both vocabularies end up in the same `error.code` field, so
|
|
4
4
|
* an integrator should not have to remember which half of a failure produced the string in hand.
|
|
5
5
|
*
|
|
6
|
-
* The
|
|
6
|
+
* The API never reports most of these -- it cannot see a blocked popup or a browser without Web
|
|
7
7
|
* Crypto -- which is why they live apart from the codes the API answers, which its OpenAPI document
|
|
8
8
|
* declares, each with its status and data. The two it shares, `invalid_identifier` and
|
|
9
9
|
* `invalid_request`, are here for the times the SDK refuses an argument before sending it.
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* return "Tu sesión expiró. Vuelve a ingresar.";
|
|
24
24
|
* default:
|
|
25
25
|
* // A code this build does not know about: report it, never swallow it.
|
|
26
|
-
* console.error("[messageFor] unhandled
|
|
26
|
+
* console.error("[messageFor] unhandled AndCo error code: %s", error.code);
|
|
27
27
|
* return "No pudimos completar la operación.";
|
|
28
28
|
* }
|
|
29
29
|
* }
|
|
@@ -49,7 +49,7 @@ export const ANDCO_ERROR_CODES = {
|
|
|
49
49
|
INVALID_CONFIGURATION: "invalid_configuration",
|
|
50
50
|
/** The configured Authorization Server endpoint is not a usable URL. */
|
|
51
51
|
INVALID_ENDPOINT_AUTH: "invalid_endpoint_auth",
|
|
52
|
-
/** The configured
|
|
52
|
+
/** The configured AndCo API endpoint is not a usable URL. */
|
|
53
53
|
INVALID_ENDPOINT_API: "invalid_endpoint_api",
|
|
54
54
|
/** The configured button endpoint is not a usable URL. */
|
|
55
55
|
INVALID_ENDPOINT_BUTTON: "invalid_endpoint_button",
|
|
@@ -59,7 +59,7 @@ export const ANDCO_ERROR_CODES = {
|
|
|
59
59
|
INVALID_REDIRECT_TO: "invalid_redirect_to",
|
|
60
60
|
/** The requested authentication mode is not one the SDK offers. */
|
|
61
61
|
INVALID_AUTH_MODE: "invalid_auth_mode",
|
|
62
|
-
/** At least one requested permission scope is not a scope
|
|
62
|
+
/** At least one requested permission scope is not a scope AndCo publishes. */
|
|
63
63
|
INVALID_SCOPE: "invalid_scope",
|
|
64
64
|
/** The requested SDK protocol version is not one this build speaks. */
|
|
65
65
|
INVALID_VERSION: "invalid_version",
|
|
@@ -110,7 +110,7 @@ export const ANDCO_ERROR_CODES = {
|
|
|
110
110
|
*/
|
|
111
111
|
AUTHORIZATION_FACTORY_FAILED: "authorization_factory_failed",
|
|
112
112
|
/**
|
|
113
|
-
* The authorization needs a
|
|
113
|
+
* The authorization needs a digital account that is not open yet, because AndCo is still
|
|
114
114
|
* reviewing its opening. The Authorization Server ends the authorization with
|
|
115
115
|
* `error=access_denied&error_description=bank_account_pending_review`.
|
|
116
116
|
*
|
|
@@ -123,7 +123,7 @@ export const ANDCO_ERROR_CODES = {
|
|
|
123
123
|
* account. The Authorization Server ends it with
|
|
124
124
|
* `error=access_denied&error_description=authorization_expired`.
|
|
125
125
|
*
|
|
126
|
-
* Not a cancellation. Start a new authorization; the progress made on the
|
|
126
|
+
* Not a cancellation. Start a new authorization; the progress made on the AndCo side is kept.
|
|
127
127
|
*/
|
|
128
128
|
AUTHORIZATION_EXPIRED: "authorization_expired",
|
|
129
129
|
/**
|
|
@@ -294,7 +294,7 @@ export function isAuthorizationEndedWithoutDecision(error, description) {
|
|
|
294
294
|
* What an authorization callback's `error` must look like for the SDK to report it as the error's
|
|
295
295
|
* code: ASCII letters, digits, `_`, `.` and `-`, 1 to 128 of them. Any other value (empty, a
|
|
296
296
|
* character outside the set, or longer) is `invalid_callback`, and its message does not repeat the
|
|
297
|
-
* value, which the URL's author controls. Every
|
|
297
|
+
* value, which the URL's author controls. Every AndCo SDK (JavaScript, Go, Python and Ruby) checks
|
|
298
298
|
* the callback's `error` against this same pattern; the shared cases are the `oauth_error_code`
|
|
299
299
|
* section of the conformance vectors.
|
|
300
300
|
*
|
|
@@ -306,7 +306,7 @@ const OAUTH_ERROR_CODE = /* @__PURE__ */ new RegExp(OAUTH_ERROR_CODE_PATTERN);
|
|
|
306
306
|
* The authorization callback's parameters that carry one value: each appears at most once and, when
|
|
307
307
|
* it appears, is not empty. A callback that repeats one or leaves it empty is `invalid_callback`,
|
|
308
308
|
* whatever else it carries, since two readers of the same URL could otherwise act on different
|
|
309
|
-
* values. Every
|
|
309
|
+
* values. Every AndCo SDK (JavaScript, Go, Python and Ruby) refuses such a callback the same way;
|
|
310
310
|
* the shared cases are the `oauth_callback_parameters` section of the conformance vectors.
|
|
311
311
|
*
|
|
312
312
|
* @see https://github.com/haulmer/andco-sdk-js/blob/main/docs/adr/0044-reject-a-repeated-or-empty-oauth-callback-parameter-in-every-sdk.md
|
|
@@ -354,7 +354,7 @@ export class ErrorExtendable extends Error {
|
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
/**
|
|
357
|
-
* The single error type every
|
|
357
|
+
* The single error type every AndCo operation reports.
|
|
358
358
|
*
|
|
359
359
|
* An integrator writes one `catch`-equivalent branch and compares one `code`, whether the failure
|
|
360
360
|
* came from authentication, an Intent, the resource API or the SDK itself. A failure the API answered
|
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export * from "./release.js";
|
|
|
29
29
|
export * from "./scopes.js";
|
|
30
30
|
export * from "./service-grants.js";
|
|
31
31
|
export * from "./signing.js";
|
|
32
|
+
export * from "./transfer.js";
|
|
32
33
|
export * from "./urls.js";
|
|
33
34
|
export * from "./userinfo.js";
|
|
34
35
|
export * from "./utils.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qCAAqC,CAAC;AACpD,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,SAAS,EACT,kBAAkB,GACnB,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qCAAqC,CAAC;AACpD,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,SAAS,EACT,kBAAkB,GACnB,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -29,6 +29,7 @@ export * from "./release.js";
|
|
|
29
29
|
export * from "./scopes.js";
|
|
30
30
|
export * from "./service-grants.js";
|
|
31
31
|
export * from "./signing.js";
|
|
32
|
+
export * from "./transfer.js";
|
|
32
33
|
export * from "./urls.js";
|
|
33
34
|
export * from "./userinfo.js";
|
|
34
35
|
export * from "./utils.js";
|