@iqauth/sdk 2.6.4 → 2.8.1
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 +173 -1
- package/dist/browser-session.d.mts +4 -4
- package/dist/browser-session.d.ts +4 -4
- package/dist/browser-session.js +212 -46
- package/dist/browser-session.mjs +3 -3
- package/dist/browser.d.mts +5 -5
- package/dist/browser.d.ts +5 -5
- package/dist/browser.js +293 -34
- package/dist/browser.mjs +5 -5
- package/dist/{chunk-BVV54LPI.mjs → chunk-25SSYDIP.mjs} +10 -4
- package/dist/{chunk-XAWYUPMO.mjs → chunk-4V7FKOTG.mjs} +242 -22
- package/dist/{chunk-6I6RM4MN.mjs → chunk-6PJRLRB4.mjs} +33 -3
- package/dist/{chunk-SL3KRS4W.mjs → chunk-CIJORODR.mjs} +23 -1
- package/dist/{chunk-LIZYFXH7.mjs → chunk-DFWHSDYQ.mjs} +1 -1
- package/dist/chunk-GLXSIGVS.mjs +66 -0
- package/dist/{chunk-DJIBN2N7.mjs → chunk-GN37E64I.mjs} +29 -7
- package/dist/{chunk-WQWBJSSS.mjs → chunk-HVHNYPDC.mjs} +6 -6
- package/dist/chunk-JRDVUWAL.mjs +46 -0
- package/dist/{chunk-UNYDG2L4.mjs → chunk-NUO2I65G.mjs} +56 -23
- package/dist/{chunk-5T7GHBX6.mjs → chunk-TLET552H.mjs} +36 -0
- package/dist/chunk-VYQ3ETCK.mjs +244 -0
- package/dist/{chunk-3JULWS6F.mjs → chunk-WCELYTJ3.mjs} +3 -3
- package/dist/chunk-WHT6WKTY.mjs +3180 -0
- package/dist/{chunk-MKKZULZR.mjs → chunk-WIFG74IK.mjs} +1 -1
- package/dist/chunk-WSH4SW7F.mjs +490 -0
- package/dist/{chunk-W3F4JYGP.mjs → chunk-ZLJPABB7.mjs} +139 -23
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.mjs +2 -2
- package/dist/{client-BNQe3AgF.d.ts → client-D8L-PaWr.d.mts} +59 -6
- package/dist/{client-kYlJFgPv.d.mts → client-DkPL0EPZ.d.ts} +59 -6
- package/dist/{doctor-YYNHNMLD.mjs → doctor-JAFXWU3X.mjs} +2 -2
- package/dist/errors-Jl1Jtm-6.d.mts +107 -0
- package/dist/errors-Jl1Jtm-6.d.ts +107 -0
- package/dist/{express-CHpfa7D_.d.ts → express-Budysq4h.d.ts} +2 -2
- package/dist/{express-B6_1vBYZ.d.mts → express-DDTA3qV1.d.mts} +2 -2
- package/dist/express.d.mts +7 -6
- package/dist/express.d.ts +7 -6
- package/dist/express.js +563 -85
- package/dist/express.mjs +73 -34
- package/dist/fastify.d.mts +10 -0
- package/dist/fastify.d.ts +10 -0
- package/dist/fastify.js +589 -65
- package/dist/fastify.mjs +101 -11
- package/dist/hono.d.mts +10 -0
- package/dist/hono.d.ts +10 -0
- package/dist/hono.js +566 -65
- package/dist/hono.mjs +78 -11
- package/dist/index-Cko-d5po.d.mts +1848 -0
- package/dist/index-RNqwEcmY.d.ts +1848 -0
- package/dist/index.d.mts +56 -8
- package/dist/index.d.ts +56 -8
- package/dist/index.js +694 -75
- package/dist/index.mjs +30 -10
- package/dist/{keys-NLWFAOEM.mjs → keys-6Y776TG2.mjs} +2 -2
- package/dist/locales.d.mts +1 -1
- package/dist/locales.d.ts +1 -1
- package/dist/locales.js +36 -0
- package/dist/locales.mjs +1 -1
- package/dist/mobile.d.mts +77 -7
- package/dist/mobile.d.ts +77 -7
- package/dist/mobile.js +307 -46
- package/dist/mobile.mjs +98 -3
- package/dist/next.d.mts +10 -1
- package/dist/next.d.ts +10 -1
- package/dist/next.js +596 -205
- package/dist/next.mjs +83 -10
- package/dist/{provisioningBridge-88xjOS2n.d.mts → provisioningBridge-BXPMZCLe.d.ts} +30 -2
- package/dist/{provisioningBridge-DnTfzdZK.d.ts → provisioningBridge-IEycmsgb.d.mts} +30 -2
- package/dist/{publishableKey-BaR0HoAH.d.ts → publishableKey-f2kq-rKw.d.mts} +1 -1
- package/dist/{publishableKey-BaR0HoAH.d.mts → publishableKey-f2kq-rKw.d.ts} +1 -1
- package/dist/react-permissions.d.mts +52 -0
- package/dist/react-permissions.d.ts +52 -0
- package/dist/react-permissions.js +239 -0
- package/dist/react-permissions.mjs +98 -0
- package/dist/react.d.mts +9 -1624
- package/dist/react.d.ts +9 -1624
- package/dist/react.js +882 -73
- package/dist/react.mjs +71 -2631
- package/dist/{reverify-4UEJXUS6.mjs → reverify-C64QXKJO.mjs} +2 -2
- package/dist/server/handlers.d.mts +200 -4
- package/dist/server/handlers.d.ts +200 -4
- package/dist/server/handlers.js +530 -16
- package/dist/server/handlers.mjs +14 -3
- package/dist/server.d.mts +171 -8
- package/dist/server.d.ts +171 -8
- package/dist/server.js +579 -61
- package/dist/server.mjs +99 -12
- package/dist/service.d.mts +4 -4
- package/dist/service.d.ts +4 -4
- package/dist/service.js +212 -46
- package/dist/service.mjs +3 -3
- package/dist/{signIn-CiIBTJIh.d.mts → signIn-CReqfXsh.d.mts} +95 -3
- package/dist/{signIn-OCr88Zf8.d.ts → signIn-Cfa1GTpO.d.ts} +95 -3
- package/dist/{signIn-4OKLDEIH.mjs → signIn-SHBW6Z4T.mjs} +1 -1
- package/dist/test.mjs +3 -3
- package/dist/{tokens-DCyzzn8L.d.mts → tokens-9F6ETrzk.d.ts} +9 -2
- package/dist/{tokens-aHiGFr_E.d.ts → tokens-B06VtvUi.d.mts} +9 -2
- package/dist/{types-DZAflmmq.d.mts → types-Bn8O-OEd.d.mts} +164 -11
- package/dist/{types-DZAflmmq.d.ts → types-Bn8O-OEd.d.ts} +164 -11
- package/dist/{types-6bNdxesb.d.ts → types-DnU2LhXR.d.mts} +7 -1
- package/dist/{types-6bNdxesb.d.mts → types-DnU2LhXR.d.ts} +7 -1
- package/dist/webhooks.d.mts +113 -17
- package/dist/webhooks.d.ts +113 -17
- package/dist/webhooks.js +179 -15
- package/dist/webhooks.mjs +7 -1
- package/dist/ws.d.mts +2 -2
- package/dist/ws.d.ts +2 -2
- package/dist/ws.js +80 -30
- package/dist/ws.mjs +4 -4
- package/docs/error-handling.md +101 -0
- package/docs/guides/effective-permissions.md +171 -0
- package/docs/guides/invitations.md +65 -0
- package/package.json +19 -4
- package/dist/chunk-6TDJJER7.mjs +0 -217
- package/dist/chunk-UKZLOHZG.mjs +0 -83
- package/dist/errors-CDdl24MP.d.mts +0 -52
- package/dist/errors-CDdl24MP.d.ts +0 -52
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SOURCE REFS:
|
|
3
|
+
* - Route file: src/lib/response.ts (error envelope: { success: false, error: { code, message } })
|
|
4
|
+
* - All route files for error code extraction
|
|
5
|
+
* - Verified claims: N/A (error module)
|
|
6
|
+
* - Last verified: Phase 0 Research Summary
|
|
7
|
+
*
|
|
8
|
+
* Task #127 (SDK 2.7.0): typed `IQAuthErrorCode` taxonomy.
|
|
9
|
+
* The SDK historically threw `IQAuthError` with arbitrary string codes,
|
|
10
|
+
* forcing every integrator to either string-match the message or memorize
|
|
11
|
+
* the full server code list. This module now ships a discriminated union of
|
|
12
|
+
* 10 normalized codes that callers can pattern-match exhaustively, and the
|
|
13
|
+
* `IQAuthError.code` field is typed as `IQAuthErrorCode | (string & {})` so
|
|
14
|
+
* existing throw sites that pass server-supplied strings (e.g.
|
|
15
|
+
* `"TOKEN_REVOKED"`, `"SESSION_EXPIRED_INACTIVITY"`) continue to compile and
|
|
16
|
+
* still pass through to consumers verbatim.
|
|
17
|
+
*
|
|
18
|
+
* Migration: existing `catch (e: Error)` keeps working unchanged. The new
|
|
19
|
+
* codes are additive — `e.code` may now equal one of the 10 lowercase
|
|
20
|
+
* tokens for SDK-originated errors (verify, JWKS fetch, config validation,
|
|
21
|
+
* network) while server-originated errors keep their existing UPPER_SNAKE
|
|
22
|
+
* codes (so framework adapters that switch on `TOKEN_EXPIRED` still work).
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Discriminated union of normalized SDK error codes. Use these for typed
|
|
26
|
+
* pattern-matching on errors thrown by SDK calls (`tokens.verify`, JWKS
|
|
27
|
+
* fetch, config validation, network failures).
|
|
28
|
+
*
|
|
29
|
+
* Server-originated errors (e.g. those rethrown from API responses or from
|
|
30
|
+
* the issuer) may still surface with their UPPER_SNAKE_CASE codes
|
|
31
|
+
* (`TOKEN_REVOKED`, `MFA_INVALID_CODE`, …) — `code` is widened to accept
|
|
32
|
+
* those alongside the typed taxonomy.
|
|
33
|
+
*/
|
|
34
|
+
type IQAuthErrorCode = "token_expired" | "token_invalid" | "jwks_unavailable" | "jwks_fetch_failed" | "rate_limited" | "network" | "config_invalid" | "app_not_found" | "permission_denied" | "unknown";
|
|
35
|
+
/**
|
|
36
|
+
* The 10 canonical typed codes, exposed as a runtime tuple for exhaustive
|
|
37
|
+
* `switch` checks and for SDK consumers that want to enumerate them.
|
|
38
|
+
*/
|
|
39
|
+
declare const IQ_AUTH_ERROR_CODES: readonly IQAuthErrorCode[];
|
|
40
|
+
declare class IQAuthError extends Error {
|
|
41
|
+
/**
|
|
42
|
+
* Normalized error code. Prefer matching against {@link IQAuthErrorCode}
|
|
43
|
+
* for SDK-originated errors. Server-originated errors may carry their
|
|
44
|
+
* UPPER_SNAKE server code (e.g. `"TOKEN_REVOKED"`).
|
|
45
|
+
*/
|
|
46
|
+
code: IQAuthErrorCode | (string & {});
|
|
47
|
+
status?: number;
|
|
48
|
+
/**
|
|
49
|
+
* The underlying error or response payload that triggered this throw.
|
|
50
|
+
* Aliased as `raw` for back-compat with SDK ≤2.6.x.
|
|
51
|
+
*/
|
|
52
|
+
cause?: unknown;
|
|
53
|
+
/** @deprecated alias for {@link cause}; kept for SDK ≤2.6.x compatibility. */
|
|
54
|
+
raw?: unknown;
|
|
55
|
+
constructor(code: IQAuthErrorCode | (string & {}), message: string, status?: number, cause?: unknown);
|
|
56
|
+
/**
|
|
57
|
+
* Type guard: true when `value` is an `IQAuthError`. Useful for adapters
|
|
58
|
+
* that round-trip errors through `unknown` (e.g. fastify's `setErrorHandler`).
|
|
59
|
+
*/
|
|
60
|
+
static isIQAuthError(value: unknown): value is IQAuthError;
|
|
61
|
+
/**
|
|
62
|
+
* Type-narrowed code check. Lets callers write
|
|
63
|
+
* `if (err.is("token_expired")) …` with full IntelliSense for the typed
|
|
64
|
+
* taxonomy without losing the ability to handle server codes via
|
|
65
|
+
* `err.code === "TOKEN_REVOKED"`.
|
|
66
|
+
*/
|
|
67
|
+
is(code: IQAuthErrorCode): boolean;
|
|
68
|
+
}
|
|
69
|
+
declare const ErrorCodes: {
|
|
70
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
71
|
+
readonly INVALID_CREDENTIALS: "INVALID_CREDENTIALS";
|
|
72
|
+
readonly ACCOUNT_INACTIVE: "ACCOUNT_INACTIVE";
|
|
73
|
+
readonly ACCOUNT_LOCKED: "ACCOUNT_LOCKED";
|
|
74
|
+
readonly INSUFFICIENT_PERMISSIONS: "INSUFFICIENT_PERMISSIONS";
|
|
75
|
+
readonly TOKEN_INVALID: "TOKEN_INVALID";
|
|
76
|
+
readonly TOKEN_EXPIRED: "TOKEN_EXPIRED";
|
|
77
|
+
readonly TOKEN_REVOKED: "TOKEN_REVOKED";
|
|
78
|
+
readonly USER_INACTIVE: "USER_INACTIVE";
|
|
79
|
+
readonly INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
80
|
+
readonly NOT_FOUND: "NOT_FOUND";
|
|
81
|
+
readonly SESSION_INVALID: "SESSION_INVALID";
|
|
82
|
+
readonly SESSION_EXPIRED: "SESSION_EXPIRED";
|
|
83
|
+
readonly REFRESH_TOKEN_REUSED: "REFRESH_TOKEN_REUSED";
|
|
84
|
+
readonly PASSWORD_EXPIRED: "PASSWORD_EXPIRED";
|
|
85
|
+
readonly PIN_EXPIRED: "PIN_EXPIRED";
|
|
86
|
+
readonly PASSWORD_POLICY_VIOLATION: "PASSWORD_POLICY_VIOLATION";
|
|
87
|
+
readonly MFA_INVALID_CODE: "MFA_INVALID_CODE";
|
|
88
|
+
readonly MFA_METHOD_UNAVAILABLE: "MFA_METHOD_UNAVAILABLE";
|
|
89
|
+
readonly MFA_RATE_LIMITED: "MFA_RATE_LIMITED";
|
|
90
|
+
readonly MFA_ENROLLMENT_REQUIRED: "MFA_ENROLLMENT_REQUIRED";
|
|
91
|
+
readonly API_KEY_REQUIRED: "API_KEY_REQUIRED";
|
|
92
|
+
readonly API_KEY_INVALID: "API_KEY_INVALID";
|
|
93
|
+
readonly AUTH_REQUIRED: "AUTH_REQUIRED";
|
|
94
|
+
readonly ALREADY_EXISTS: "ALREADY_EXISTS";
|
|
95
|
+
readonly FORBIDDEN: "FORBIDDEN";
|
|
96
|
+
readonly OAUTH_NOT_CONFIGURED: "OAUTH_NOT_CONFIGURED";
|
|
97
|
+
readonly UPLOAD_ERROR: "UPLOAD_ERROR";
|
|
98
|
+
readonly EMAIL_SERVICE_UNAVAILABLE: "EMAIL_SERVICE_UNAVAILABLE";
|
|
99
|
+
readonly INVALID_CODE: "INVALID_CODE";
|
|
100
|
+
readonly CODE_ALREADY_USED: "CODE_ALREADY_USED";
|
|
101
|
+
readonly CODE_EXPIRED: "CODE_EXPIRED";
|
|
102
|
+
readonly CODE_IP_MISMATCH: "CODE_IP_MISMATCH";
|
|
103
|
+
readonly UNKNOWN_PAYLOAD: "UNKNOWN_PAYLOAD";
|
|
104
|
+
};
|
|
105
|
+
type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
|
|
106
|
+
|
|
107
|
+
export { ErrorCodes as E, IQAuthError as I, IQ_AUTH_ERROR_CODES as a, type ErrorCode as b, type IQAuthErrorCode as c };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SOURCE REFS:
|
|
3
|
+
* - Route file: src/lib/response.ts (error envelope: { success: false, error: { code, message } })
|
|
4
|
+
* - All route files for error code extraction
|
|
5
|
+
* - Verified claims: N/A (error module)
|
|
6
|
+
* - Last verified: Phase 0 Research Summary
|
|
7
|
+
*
|
|
8
|
+
* Task #127 (SDK 2.7.0): typed `IQAuthErrorCode` taxonomy.
|
|
9
|
+
* The SDK historically threw `IQAuthError` with arbitrary string codes,
|
|
10
|
+
* forcing every integrator to either string-match the message or memorize
|
|
11
|
+
* the full server code list. This module now ships a discriminated union of
|
|
12
|
+
* 10 normalized codes that callers can pattern-match exhaustively, and the
|
|
13
|
+
* `IQAuthError.code` field is typed as `IQAuthErrorCode | (string & {})` so
|
|
14
|
+
* existing throw sites that pass server-supplied strings (e.g.
|
|
15
|
+
* `"TOKEN_REVOKED"`, `"SESSION_EXPIRED_INACTIVITY"`) continue to compile and
|
|
16
|
+
* still pass through to consumers verbatim.
|
|
17
|
+
*
|
|
18
|
+
* Migration: existing `catch (e: Error)` keeps working unchanged. The new
|
|
19
|
+
* codes are additive — `e.code` may now equal one of the 10 lowercase
|
|
20
|
+
* tokens for SDK-originated errors (verify, JWKS fetch, config validation,
|
|
21
|
+
* network) while server-originated errors keep their existing UPPER_SNAKE
|
|
22
|
+
* codes (so framework adapters that switch on `TOKEN_EXPIRED` still work).
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Discriminated union of normalized SDK error codes. Use these for typed
|
|
26
|
+
* pattern-matching on errors thrown by SDK calls (`tokens.verify`, JWKS
|
|
27
|
+
* fetch, config validation, network failures).
|
|
28
|
+
*
|
|
29
|
+
* Server-originated errors (e.g. those rethrown from API responses or from
|
|
30
|
+
* the issuer) may still surface with their UPPER_SNAKE_CASE codes
|
|
31
|
+
* (`TOKEN_REVOKED`, `MFA_INVALID_CODE`, …) — `code` is widened to accept
|
|
32
|
+
* those alongside the typed taxonomy.
|
|
33
|
+
*/
|
|
34
|
+
type IQAuthErrorCode = "token_expired" | "token_invalid" | "jwks_unavailable" | "jwks_fetch_failed" | "rate_limited" | "network" | "config_invalid" | "app_not_found" | "permission_denied" | "unknown";
|
|
35
|
+
/**
|
|
36
|
+
* The 10 canonical typed codes, exposed as a runtime tuple for exhaustive
|
|
37
|
+
* `switch` checks and for SDK consumers that want to enumerate them.
|
|
38
|
+
*/
|
|
39
|
+
declare const IQ_AUTH_ERROR_CODES: readonly IQAuthErrorCode[];
|
|
40
|
+
declare class IQAuthError extends Error {
|
|
41
|
+
/**
|
|
42
|
+
* Normalized error code. Prefer matching against {@link IQAuthErrorCode}
|
|
43
|
+
* for SDK-originated errors. Server-originated errors may carry their
|
|
44
|
+
* UPPER_SNAKE server code (e.g. `"TOKEN_REVOKED"`).
|
|
45
|
+
*/
|
|
46
|
+
code: IQAuthErrorCode | (string & {});
|
|
47
|
+
status?: number;
|
|
48
|
+
/**
|
|
49
|
+
* The underlying error or response payload that triggered this throw.
|
|
50
|
+
* Aliased as `raw` for back-compat with SDK ≤2.6.x.
|
|
51
|
+
*/
|
|
52
|
+
cause?: unknown;
|
|
53
|
+
/** @deprecated alias for {@link cause}; kept for SDK ≤2.6.x compatibility. */
|
|
54
|
+
raw?: unknown;
|
|
55
|
+
constructor(code: IQAuthErrorCode | (string & {}), message: string, status?: number, cause?: unknown);
|
|
56
|
+
/**
|
|
57
|
+
* Type guard: true when `value` is an `IQAuthError`. Useful for adapters
|
|
58
|
+
* that round-trip errors through `unknown` (e.g. fastify's `setErrorHandler`).
|
|
59
|
+
*/
|
|
60
|
+
static isIQAuthError(value: unknown): value is IQAuthError;
|
|
61
|
+
/**
|
|
62
|
+
* Type-narrowed code check. Lets callers write
|
|
63
|
+
* `if (err.is("token_expired")) …` with full IntelliSense for the typed
|
|
64
|
+
* taxonomy without losing the ability to handle server codes via
|
|
65
|
+
* `err.code === "TOKEN_REVOKED"`.
|
|
66
|
+
*/
|
|
67
|
+
is(code: IQAuthErrorCode): boolean;
|
|
68
|
+
}
|
|
69
|
+
declare const ErrorCodes: {
|
|
70
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
71
|
+
readonly INVALID_CREDENTIALS: "INVALID_CREDENTIALS";
|
|
72
|
+
readonly ACCOUNT_INACTIVE: "ACCOUNT_INACTIVE";
|
|
73
|
+
readonly ACCOUNT_LOCKED: "ACCOUNT_LOCKED";
|
|
74
|
+
readonly INSUFFICIENT_PERMISSIONS: "INSUFFICIENT_PERMISSIONS";
|
|
75
|
+
readonly TOKEN_INVALID: "TOKEN_INVALID";
|
|
76
|
+
readonly TOKEN_EXPIRED: "TOKEN_EXPIRED";
|
|
77
|
+
readonly TOKEN_REVOKED: "TOKEN_REVOKED";
|
|
78
|
+
readonly USER_INACTIVE: "USER_INACTIVE";
|
|
79
|
+
readonly INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
80
|
+
readonly NOT_FOUND: "NOT_FOUND";
|
|
81
|
+
readonly SESSION_INVALID: "SESSION_INVALID";
|
|
82
|
+
readonly SESSION_EXPIRED: "SESSION_EXPIRED";
|
|
83
|
+
readonly REFRESH_TOKEN_REUSED: "REFRESH_TOKEN_REUSED";
|
|
84
|
+
readonly PASSWORD_EXPIRED: "PASSWORD_EXPIRED";
|
|
85
|
+
readonly PIN_EXPIRED: "PIN_EXPIRED";
|
|
86
|
+
readonly PASSWORD_POLICY_VIOLATION: "PASSWORD_POLICY_VIOLATION";
|
|
87
|
+
readonly MFA_INVALID_CODE: "MFA_INVALID_CODE";
|
|
88
|
+
readonly MFA_METHOD_UNAVAILABLE: "MFA_METHOD_UNAVAILABLE";
|
|
89
|
+
readonly MFA_RATE_LIMITED: "MFA_RATE_LIMITED";
|
|
90
|
+
readonly MFA_ENROLLMENT_REQUIRED: "MFA_ENROLLMENT_REQUIRED";
|
|
91
|
+
readonly API_KEY_REQUIRED: "API_KEY_REQUIRED";
|
|
92
|
+
readonly API_KEY_INVALID: "API_KEY_INVALID";
|
|
93
|
+
readonly AUTH_REQUIRED: "AUTH_REQUIRED";
|
|
94
|
+
readonly ALREADY_EXISTS: "ALREADY_EXISTS";
|
|
95
|
+
readonly FORBIDDEN: "FORBIDDEN";
|
|
96
|
+
readonly OAUTH_NOT_CONFIGURED: "OAUTH_NOT_CONFIGURED";
|
|
97
|
+
readonly UPLOAD_ERROR: "UPLOAD_ERROR";
|
|
98
|
+
readonly EMAIL_SERVICE_UNAVAILABLE: "EMAIL_SERVICE_UNAVAILABLE";
|
|
99
|
+
readonly INVALID_CODE: "INVALID_CODE";
|
|
100
|
+
readonly CODE_ALREADY_USED: "CODE_ALREADY_USED";
|
|
101
|
+
readonly CODE_EXPIRED: "CODE_EXPIRED";
|
|
102
|
+
readonly CODE_IP_MISMATCH: "CODE_IP_MISMATCH";
|
|
103
|
+
readonly UNKNOWN_PAYLOAD: "UNKNOWN_PAYLOAD";
|
|
104
|
+
};
|
|
105
|
+
type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
|
|
106
|
+
|
|
107
|
+
export { ErrorCodes as E, IQAuthError as I, IQ_AUTH_ERROR_CODES as a, type ErrorCode as b, type IQAuthErrorCode as c };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IQAuthClient } from './client-
|
|
2
|
-
import { J as JwtClaims,
|
|
1
|
+
import { I as IQAuthClient } from './client-DkPL0EPZ.js';
|
|
2
|
+
import { J as JwtClaims, X as ExpressMiddlewareOptions, a as IQAuthRequestLike, b as IQAuthResponseLike, c as IQAuthNextFunction } from './types-Bn8O-OEd.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* SOURCE REFS:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IQAuthClient } from './client-
|
|
2
|
-
import { J as JwtClaims,
|
|
1
|
+
import { I as IQAuthClient } from './client-D8L-PaWr.mjs';
|
|
2
|
+
import { J as JwtClaims, X as ExpressMiddlewareOptions, a as IQAuthRequestLike, b as IQAuthResponseLike, c as IQAuthNextFunction } from './types-Bn8O-OEd.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* SOURCE REFS:
|
package/dist/express.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { I as IQAuthClient } from './client-
|
|
2
|
-
import { C as CookieAwareMiddlewareOptions } from './express-
|
|
3
|
-
export { i as iqAuthMiddleware } from './express-
|
|
1
|
+
import { I as IQAuthClient } from './client-D8L-PaWr.mjs';
|
|
2
|
+
import { C as CookieAwareMiddlewareOptions } from './express-DDTA3qV1.mjs';
|
|
3
|
+
export { i as iqAuthMiddleware } from './express-DDTA3qV1.mjs';
|
|
4
4
|
import { IQAuthHelperConfig } from './server/handlers.mjs';
|
|
5
|
-
import {
|
|
6
|
-
export { E as ErrorCodes, I as IQAuthError } from './errors-
|
|
7
|
-
import './tokens-
|
|
5
|
+
import { a as IQAuthRequestLike, b as IQAuthResponseLike, c as IQAuthNextFunction } from './types-Bn8O-OEd.mjs';
|
|
6
|
+
export { E as ErrorCodes, I as IQAuthError } from './errors-Jl1Jtm-6.mjs';
|
|
7
|
+
import './tokens-B06VtvUi.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @iqauth/sdk/express — drop-in Express adapter.
|
|
@@ -111,6 +111,7 @@ declare function iqAuth(options: IQAuthExpressOptions): {
|
|
|
111
111
|
middleware: (req: IQAuthRequestLike, res: IQAuthResponseLike, next: IQAuthNextFunction) => void | Promise<void>;
|
|
112
112
|
attachHelpers: (app: ExpressLikeApp | ExpressLikeRouter) => void;
|
|
113
113
|
client: IQAuthClient;
|
|
114
|
+
prewarm: () => Promise<void>;
|
|
114
115
|
};
|
|
115
116
|
|
|
116
117
|
export { CookieAwareMiddlewareOptions, type IQAuthExpressOptions, type InlineCallbackBrandedConfig, type InlineCallbackBrandedRenderArgs, type InlineCallbackConfig, iqAuth };
|
package/dist/express.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { I as IQAuthClient } from './client-
|
|
2
|
-
import { C as CookieAwareMiddlewareOptions } from './express-
|
|
3
|
-
export { i as iqAuthMiddleware } from './express-
|
|
1
|
+
import { I as IQAuthClient } from './client-DkPL0EPZ.js';
|
|
2
|
+
import { C as CookieAwareMiddlewareOptions } from './express-Budysq4h.js';
|
|
3
|
+
export { i as iqAuthMiddleware } from './express-Budysq4h.js';
|
|
4
4
|
import { IQAuthHelperConfig } from './server/handlers.js';
|
|
5
|
-
import {
|
|
6
|
-
export { E as ErrorCodes, I as IQAuthError } from './errors-
|
|
7
|
-
import './tokens-
|
|
5
|
+
import { a as IQAuthRequestLike, b as IQAuthResponseLike, c as IQAuthNextFunction } from './types-Bn8O-OEd.js';
|
|
6
|
+
export { E as ErrorCodes, I as IQAuthError } from './errors-Jl1Jtm-6.js';
|
|
7
|
+
import './tokens-9F6ETrzk.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @iqauth/sdk/express — drop-in Express adapter.
|
|
@@ -111,6 +111,7 @@ declare function iqAuth(options: IQAuthExpressOptions): {
|
|
|
111
111
|
middleware: (req: IQAuthRequestLike, res: IQAuthResponseLike, next: IQAuthNextFunction) => void | Promise<void>;
|
|
112
112
|
attachHelpers: (app: ExpressLikeApp | ExpressLikeRouter) => void;
|
|
113
113
|
client: IQAuthClient;
|
|
114
|
+
prewarm: () => Promise<void>;
|
|
114
115
|
};
|
|
115
116
|
|
|
116
117
|
export { CookieAwareMiddlewareOptions, type IQAuthExpressOptions, type InlineCallbackBrandedConfig, type InlineCallbackBrandedRenderArgs, type InlineCallbackConfig, iqAuth };
|