@passflow/core 0.39.0 → 0.39.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1417,21 +1417,40 @@ export declare const TWO_FACTOR_SEND_LIMIT_ERROR_ID = "error.2fa.rate_limit_exce
1417
1417
  export declare const RECOVERY_CODES_STEP_UP_REQUIRED_ERROR_ID = "error.2fa.recovery_codes.step_up_required";
1418
1418
  /** Id of the 403 a profile save answers with when a change of email or phone number needs a proof. */
1419
1419
  export declare const ADDRESS_CHANGE_PROOF_REQUIRED_ERROR_ID = "error.user.address.change.proof.required";
1420
+ /**
1421
+ * What a refused login-code send answers beside the error: the challenge the sign-in goes on with
1422
+ * (the live code, if one was sent before), the method to suggest, and the methods to switch to. The
1423
+ * refused method is never among `alternative_methods`, which is absent when there are none.
1424
+ */
1425
+ export type TwoFactorSendRefusalChallenge = {
1426
+ challenge_id: string;
1427
+ suggested_method?: TwoFactorMethod;
1428
+ alternative_methods?: TwoFactorMethod[];
1429
+ };
1420
1430
  /**
1421
1431
  * No code was sent: the user's monthly text quota is spent (429). Use another method or try again
1422
1432
  * next month.
1423
1433
  */
1424
1434
  export declare class PassflowSmsQuotaExceededError extends PassflowError {
1435
+ /** The sign-in's challenge to go on with; undefined when the answer carried no `challenge_id`. */
1436
+ readonly challenge?: TwoFactorSendRefusalChallenge;
1425
1437
  constructor(error: PassflowResponseError['error'], options?: {
1426
1438
  cause?: unknown;
1439
+ challenge?: TwoFactorSendRefusalChallenge;
1427
1440
  });
1428
1441
  }
1429
- /** No code was sent: the app's send limit or the challenge budget is spent (429). */
1442
+ /**
1443
+ * No code was sent: the app's send limit or the challenge budget is spent (429). On `updateProfile`
1444
+ * it can also come from the proof check: too many wrong codes, not a spent send limit.
1445
+ */
1430
1446
  export declare class PassflowSendLimitError extends PassflowError {
1431
1447
  /** Seconds to wait, from `Retry-After`; undefined when the server sent none. */
1432
1448
  readonly retryAfter?: number;
1449
+ /** The sign-in's challenge to go on with; undefined when the answer carried no `challenge_id`. */
1450
+ readonly challenge?: TwoFactorSendRefusalChallenge;
1433
1451
  constructor(error: PassflowResponseError['error'], retryAfter?: number, options?: {
1434
1452
  cause?: unknown;
1453
+ challenge?: TwoFactorSendRefusalChallenge;
1435
1454
  });
1436
1455
  }
1437
1456
  /**
@@ -2870,6 +2889,11 @@ declare class AxiosClient {
2870
2889
  */
2871
2890
  readonly upgradeDomain: UpgradeDomain | null;
2872
2891
  constructor(config: PassflowConfig, storageManager?: StorageManager, deviceService?: DeviceService);
2892
+ /**
2893
+ * Settles a failed response: a retry, a replay after a step-up, or the rejection the caller gets.
2894
+ * The interceptor above takes the request data off a rejected `AxiosError` once this is done.
2895
+ */
2896
+ private onResponseError;
2873
2897
  /**
2874
2898
  * The `setSessionInvalid()` suppression predicate, keyed on the request that
2875
2899
  * failed and on the response that came back — never on "this response does not
package/dist/index.d.ts CHANGED
@@ -1417,21 +1417,40 @@ export declare const TWO_FACTOR_SEND_LIMIT_ERROR_ID = "error.2fa.rate_limit_exce
1417
1417
  export declare const RECOVERY_CODES_STEP_UP_REQUIRED_ERROR_ID = "error.2fa.recovery_codes.step_up_required";
1418
1418
  /** Id of the 403 a profile save answers with when a change of email or phone number needs a proof. */
1419
1419
  export declare const ADDRESS_CHANGE_PROOF_REQUIRED_ERROR_ID = "error.user.address.change.proof.required";
1420
+ /**
1421
+ * What a refused login-code send answers beside the error: the challenge the sign-in goes on with
1422
+ * (the live code, if one was sent before), the method to suggest, and the methods to switch to. The
1423
+ * refused method is never among `alternative_methods`, which is absent when there are none.
1424
+ */
1425
+ export type TwoFactorSendRefusalChallenge = {
1426
+ challenge_id: string;
1427
+ suggested_method?: TwoFactorMethod;
1428
+ alternative_methods?: TwoFactorMethod[];
1429
+ };
1420
1430
  /**
1421
1431
  * No code was sent: the user's monthly text quota is spent (429). Use another method or try again
1422
1432
  * next month.
1423
1433
  */
1424
1434
  export declare class PassflowSmsQuotaExceededError extends PassflowError {
1435
+ /** The sign-in's challenge to go on with; undefined when the answer carried no `challenge_id`. */
1436
+ readonly challenge?: TwoFactorSendRefusalChallenge;
1425
1437
  constructor(error: PassflowResponseError['error'], options?: {
1426
1438
  cause?: unknown;
1439
+ challenge?: TwoFactorSendRefusalChallenge;
1427
1440
  });
1428
1441
  }
1429
- /** No code was sent: the app's send limit or the challenge budget is spent (429). */
1442
+ /**
1443
+ * No code was sent: the app's send limit or the challenge budget is spent (429). On `updateProfile`
1444
+ * it can also come from the proof check: too many wrong codes, not a spent send limit.
1445
+ */
1430
1446
  export declare class PassflowSendLimitError extends PassflowError {
1431
1447
  /** Seconds to wait, from `Retry-After`; undefined when the server sent none. */
1432
1448
  readonly retryAfter?: number;
1449
+ /** The sign-in's challenge to go on with; undefined when the answer carried no `challenge_id`. */
1450
+ readonly challenge?: TwoFactorSendRefusalChallenge;
1433
1451
  constructor(error: PassflowResponseError['error'], retryAfter?: number, options?: {
1434
1452
  cause?: unknown;
1453
+ challenge?: TwoFactorSendRefusalChallenge;
1435
1454
  });
1436
1455
  }
1437
1456
  /**
@@ -2870,6 +2889,11 @@ declare class AxiosClient {
2870
2889
  */
2871
2890
  readonly upgradeDomain: UpgradeDomain | null;
2872
2891
  constructor(config: PassflowConfig, storageManager?: StorageManager, deviceService?: DeviceService);
2892
+ /**
2893
+ * Settles a failed response: a retry, a replay after a step-up, or the rejection the caller gets.
2894
+ * The interceptor above takes the request data off a rejected `AxiosError` once this is done.
2895
+ */
2896
+ private onResponseError;
2873
2897
  /**
2874
2898
  * The `setSessionInvalid()` suppression predicate, keyed on the request that
2875
2899
  * failed and on the response that came back — never on "this response does not