@iqauth/sdk 2.6.3 → 2.7.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.
Files changed (112) hide show
  1. package/README.md +173 -1
  2. package/dist/browser-session.d.mts +4 -4
  3. package/dist/browser-session.d.ts +4 -4
  4. package/dist/browser-session.js +181 -41
  5. package/dist/browser-session.mjs +3 -3
  6. package/dist/browser.d.mts +5 -5
  7. package/dist/browser.d.ts +5 -5
  8. package/dist/browser.js +271 -32
  9. package/dist/browser.mjs +10 -8
  10. package/dist/{chunk-6I6RM4MN.mjs → chunk-6PJRLRB4.mjs} +33 -3
  11. package/dist/chunk-C2ZTBOAC.mjs +36 -0
  12. package/dist/{chunk-LIZYFXH7.mjs → chunk-DFWHSDYQ.mjs} +1 -1
  13. package/dist/chunk-GLXSIGVS.mjs +66 -0
  14. package/dist/{chunk-TKZTCPEK.mjs → chunk-GN37E64I.mjs} +32 -40
  15. package/dist/{chunk-WQWBJSSS.mjs → chunk-HVHNYPDC.mjs} +6 -6
  16. package/dist/{chunk-W3F4JYGP.mjs → chunk-JXQI62A7.mjs} +108 -18
  17. package/dist/{chunk-UNYDG2L4.mjs → chunk-NUO2I65G.mjs} +56 -23
  18. package/dist/chunk-PMAFENVI.mjs +229 -0
  19. package/dist/chunk-RR2MGPTK.mjs +2724 -0
  20. package/dist/{chunk-76W5TLQQ.mjs → chunk-RTJAIBXY.mjs} +220 -20
  21. package/dist/{chunk-6TDJJER7.mjs → chunk-RUJXRTEW.mjs} +164 -5
  22. package/dist/{chunk-3JULWS6F.mjs → chunk-WCELYTJ3.mjs} +3 -3
  23. package/dist/{chunk-MKKZULZR.mjs → chunk-WIFG74IK.mjs} +1 -1
  24. package/dist/{chunk-BVV54LPI.mjs → chunk-YVALAG3B.mjs} +10 -4
  25. package/dist/cli/index.js +2 -2
  26. package/dist/cli/index.mjs +2 -2
  27. package/dist/{client-kYlJFgPv.d.mts → client-BGFnBpfc.d.mts} +47 -4
  28. package/dist/{client-BNQe3AgF.d.ts → client-CDQ21LvW.d.ts} +47 -4
  29. package/dist/{doctor-YYNHNMLD.mjs → doctor-JAFXWU3X.mjs} +2 -2
  30. package/dist/errors-Jl1Jtm-6.d.mts +107 -0
  31. package/dist/errors-Jl1Jtm-6.d.ts +107 -0
  32. package/dist/{express-B6_1vBYZ.d.mts → express-CVNQEkOr.d.mts} +2 -2
  33. package/dist/{express-CHpfa7D_.d.ts → express-Piv2WhWM.d.ts} +2 -2
  34. package/dist/express.d.mts +7 -6
  35. package/dist/express.d.ts +7 -6
  36. package/dist/express.js +349 -52
  37. package/dist/express.mjs +39 -12
  38. package/dist/fastify.d.mts +2 -0
  39. package/dist/fastify.d.ts +2 -0
  40. package/dist/fastify.js +332 -52
  41. package/dist/fastify.mjs +23 -8
  42. package/dist/hono.d.mts +2 -0
  43. package/dist/hono.d.ts +2 -0
  44. package/dist/hono.js +329 -52
  45. package/dist/hono.mjs +20 -8
  46. package/dist/index-5KSZEnDe.d.ts +1626 -0
  47. package/dist/index-CKoZHAoc.d.mts +1626 -0
  48. package/dist/index.d.mts +56 -8
  49. package/dist/index.d.ts +56 -8
  50. package/dist/index.js +565 -69
  51. package/dist/index.mjs +29 -9
  52. package/dist/{keys-NLWFAOEM.mjs → keys-6Y776TG2.mjs} +2 -2
  53. package/dist/locales.d.mts +1 -1
  54. package/dist/locales.d.ts +1 -1
  55. package/dist/mobile.d.mts +77 -7
  56. package/dist/mobile.d.ts +77 -7
  57. package/dist/mobile.js +276 -41
  58. package/dist/mobile.mjs +98 -3
  59. package/dist/next.d.mts +2 -1
  60. package/dist/next.d.ts +2 -1
  61. package/dist/next.js +391 -201
  62. package/dist/next.mjs +22 -7
  63. package/dist/pkce-7WKV4OIN.mjs +11 -0
  64. package/dist/{provisioningBridge-DnTfzdZK.d.ts → provisioningBridge-CGpMRie4.d.ts} +1 -1
  65. package/dist/{provisioningBridge-88xjOS2n.d.mts → provisioningBridge-M5G47LWO.d.mts} +1 -1
  66. package/dist/{publishableKey-BaR0HoAH.d.ts → publishableKey-f2kq-rKw.d.mts} +1 -1
  67. package/dist/{publishableKey-BaR0HoAH.d.mts → publishableKey-f2kq-rKw.d.ts} +1 -1
  68. package/dist/react-permissions.d.mts +52 -0
  69. package/dist/react-permissions.d.ts +52 -0
  70. package/dist/react-permissions.js +239 -0
  71. package/dist/react-permissions.mjs +97 -0
  72. package/dist/react.d.mts +9 -1624
  73. package/dist/react.d.ts +9 -1624
  74. package/dist/react.js +343 -36
  75. package/dist/react.mjs +59 -2611
  76. package/dist/{reverify-4UEJXUS6.mjs → reverify-C64QXKJO.mjs} +2 -2
  77. package/dist/server/handlers.d.mts +148 -3
  78. package/dist/server/handlers.d.ts +148 -3
  79. package/dist/server/handlers.js +410 -11
  80. package/dist/server/handlers.mjs +12 -3
  81. package/dist/server.d.mts +151 -8
  82. package/dist/server.d.ts +151 -8
  83. package/dist/server.js +406 -50
  84. package/dist/server.mjs +93 -11
  85. package/dist/service.d.mts +4 -4
  86. package/dist/service.d.ts +4 -4
  87. package/dist/service.js +181 -41
  88. package/dist/service.mjs +3 -3
  89. package/dist/{signIn-CiIBTJIh.d.mts → signIn-BLFnz8SV.d.ts} +78 -3
  90. package/dist/{signIn-CCY4JE5G.mjs → signIn-SHBW6Z4T.mjs} +2 -1
  91. package/dist/{signIn-OCr88Zf8.d.ts → signIn-T-CZ6t6r.d.mts} +78 -3
  92. package/dist/test.mjs +3 -3
  93. package/dist/{tokens-DCyzzn8L.d.mts → tokens-Bqhmqq_R.d.ts} +9 -2
  94. package/dist/{tokens-aHiGFr_E.d.ts → tokens-CITeoG6P.d.mts} +9 -2
  95. package/dist/{types-6bNdxesb.d.ts → types-BdQ2lqfT.d.mts} +1 -1
  96. package/dist/{types-6bNdxesb.d.mts → types-BdQ2lqfT.d.ts} +1 -1
  97. package/dist/{types-DZAflmmq.d.mts → types-XOV9XPVi.d.mts} +99 -10
  98. package/dist/{types-DZAflmmq.d.ts → types-XOV9XPVi.d.ts} +99 -10
  99. package/dist/webhooks.d.mts +100 -17
  100. package/dist/webhooks.d.ts +100 -17
  101. package/dist/webhooks.js +164 -15
  102. package/dist/webhooks.mjs +7 -1
  103. package/dist/ws.d.mts +2 -2
  104. package/dist/ws.d.ts +2 -2
  105. package/dist/ws.js +80 -30
  106. package/dist/ws.mjs +4 -4
  107. package/docs/error-handling.md +101 -0
  108. package/docs/guides/effective-permissions.md +171 -0
  109. package/package.json +13 -3
  110. package/dist/chunk-UKZLOHZG.mjs +0 -83
  111. package/dist/errors-CDdl24MP.d.mts +0 -52
  112. package/dist/errors-CDdl24MP.d.ts +0 -52
@@ -1,21 +1,27 @@
1
1
  import {
2
2
  assertPublishableKey
3
- } from "./chunk-WQWBJSSS.mjs";
3
+ } from "./chunk-HVHNYPDC.mjs";
4
4
  import {
5
5
  IQAuthClient
6
- } from "./chunk-W3F4JYGP.mjs";
6
+ } from "./chunk-JXQI62A7.mjs";
7
7
  import {
8
8
  IQAuthError
9
- } from "./chunk-6I6RM4MN.mjs";
9
+ } from "./chunk-6PJRLRB4.mjs";
10
10
 
11
11
  // src/middleware/express.ts
12
12
  var KNOWN_AUTH_ERROR_CODES = /* @__PURE__ */ new Set([
13
+ // Legacy UPPER_SNAKE codes (server-originated and SDK ≤2.6.x throws).
13
14
  "TOKEN_INVALID",
14
15
  "TOKEN_EXPIRED",
15
16
  "TOKEN_REVOKED",
16
17
  "SESSION_EXPIRED",
17
18
  "SESSION_INVALID",
18
- "AUTH_REQUIRED"
19
+ "AUTH_REQUIRED",
20
+ // Task #127 — typed `IQAuthErrorCode` taxonomy thrown by `tokens.verify`.
21
+ // Mapped to 401 here so framework consumers don't have to learn the new
22
+ // codes to keep their auth-failure handling working.
23
+ "token_invalid",
24
+ "token_expired"
19
25
  ]);
20
26
  var DEFAULT_ACCESS_COOKIE = "iqauth_at";
21
27
  var DEFAULT_REFRESH_COOKIE = "iqauth_rt";
package/dist/cli/index.js CHANGED
@@ -538,10 +538,10 @@ async function getCtx(flags) {
538
538
  const env = await loadEnv(flags.get("env-file") || ".env");
539
539
  const baseUrl = flags.get("base-url") || env.IQAUTH_ISSUER;
540
540
  const token = flags.get("token") || env.IQAUTH_ADMIN_TOKEN || env.IQAUTH_SECRET_KEY;
541
- const app = flags.get("app") || env.IQAUTH_APP_ID || env.IQAUTH_APP_KEY;
541
+ const app = flags.get("app") || env.IQAUTH_APP_ID;
542
542
  if (!baseUrl) throw new Error("Missing --base-url (or IQAUTH_ISSUER in env).");
543
543
  if (!token) throw new Error("Missing --token (or IQAUTH_ADMIN_TOKEN / IQAUTH_SECRET_KEY in env).");
544
- if (!app) throw new Error("Missing --app <appId|appKey> (or IQAUTH_APP_ID in env).");
544
+ if (!app) throw new Error("Missing --app <appId> (or IQAUTH_APP_ID in env). The `IQAUTH_APP_KEY` env-var fallback has been removed (Task #130) \u2014 pass --app explicitly.");
545
545
  return { baseUrl, token, app };
546
546
  }
547
547
  async function runKeys(argv) {
@@ -17,12 +17,12 @@ async function run() {
17
17
  return;
18
18
  }
19
19
  case "doctor": {
20
- const { runDoctor } = await import("../doctor-YYNHNMLD.mjs");
20
+ const { runDoctor } = await import("../doctor-JAFXWU3X.mjs");
21
21
  await runDoctor(rest);
22
22
  return;
23
23
  }
24
24
  case "keys": {
25
- const { runKeys } = await import("../keys-NLWFAOEM.mjs");
25
+ const { runKeys } = await import("../keys-6Y776TG2.mjs");
26
26
  await runKeys(rest);
27
27
  return;
28
28
  }
@@ -1,5 +1,5 @@
1
- import { I as IQAuthEnvironment, T as TokenPair, W as IQAuthRetryConfig, L as LoginResult, a$ as SignupRequest, D as MfaVerifyResult, d as SessionUser, h as Session, U as UserProfile, H as ProvisionUserRequest, K as ProvisionUserResponse, G as UserPermissions, J as JwtClaims, O as OidcDiscovery, t as JwksResponse, u as OidcTokenResponse, b0 as HostedClientContext, i as TenantInfo, C as CreateTenantRequest, j as UpdateTenantRequest, P as PromoteToVendorRequest, k as PromoteToVendorResult, a7 as TenantUser, l as InviteTenantUserRequest, m as InviteTenantUserResult, n as TenantUserRoleUpdate, M as MigrateUserRequest, E as PasswordPolicy, F as MfaPolicy, B as BrandingConfig, _ as AppInfo, $ as PermissionNodeInfo, Z as AppManifest, a0 as AppSyncResult, a1 as Role, a2 as CreateRoleRequest, a3 as UpdateRoleRequest, a4 as AssignRoleRequest, a5 as UserRoleAssignment, a8 as PermissionGroup, a9 as GroupPermission, aa as AddGroupPermissionRequest, ab as InheritanceRelation, a6 as UserGroupAssignment, ac as UserPermissionOverride, ad as AddUserOverrideRequest, ae as EffectivePermission, af as PermissionCheckResult, ah as CreateApiKeyRequest, ai as CreateApiKeyResult, ag as ApiKeyInfo, aj as ApiKeyIntrospection, al as CreateInviteRequest, ak as Invitation, am as InviteValidation, an as AcceptInviteRequest, ap as CreateWebhookRequest, aq as CreateWebhookResult, ao as WebhookEndpoint, ar as WebhookDelivery, as as WebhookTestResult, at as Entitlement, au as GrantEntitlementRequest, av as Vendor, aw as CreateVendorRequest, ax as UpdateVendorRequest, az as CreateSourceRequest, ay as Source, aA as UpdateSourceRequest, aC as CreateClientRequest, aB as Client, aD as UpdateClientRequest, aE as HierarchyVendor, aH as HierarchyLink, aL as MembershipWithDetails, aJ as CreateMembershipRequest, aI as Membership, aK as UpdateMembershipRequest, aM as AvailableScopesTree, aQ as ScopeSwitchResult, aR as GdprExportData, aS as PinStatus, aU as MfaAvailableMethods, aV as TotpEnrollResult, aW as TotpVerifyResult, aX as SmsEnrollResult, y as MfaEnrollment, aY as EmailEnrollResult, aZ as BackupCodesResult, a_ as BackupCodeCountResult, o as UpdateBrandingRequest, q as UploadAssetRequest, p as BrandingAsset, r as BrandingDomainMapping, a as IQAuthClientConfig, c as IQAuthBrowserSessionClientConfig, b as IQAuthTokenClientConfig } from './types-DZAflmmq.mjs';
2
- import { T as TokensModule } from './tokens-DCyzzn8L.mjs';
1
+ import { d as IQAuthEnvironment, T as TokenPair, Y as IQAuthRetryConfig, L as LoginResult, b1 as SignupRequest, K as MfaVerifyResult, S as SessionUser, m as Session, U as UserProfile, V as ProvisionUserRequest, W as ProvisionUserResponse, R as UserPermissions, J as JwtClaims, O as OidcDiscovery, y as JwksResponse, z as OidcTokenResponse, b2 as HostedClientContext, n as TenantInfo, C as CreateTenantRequest, o as UpdateTenantRequest, P as PromoteToVendorRequest, p as PromoteToVendorResult, a9 as TenantUser, q as InviteTenantUserRequest, r as InviteTenantUserResult, s as TenantUserRoleUpdate, M as MigrateUserRequest, N as PasswordPolicy, Q as MfaPolicy, B as BrandingConfig, a0 as AppInfo, a1 as PermissionNodeInfo, $ as AppManifest, a2 as AppSyncResult, a3 as Role, a4 as CreateRoleRequest, a5 as UpdateRoleRequest, a6 as AssignRoleRequest, a7 as UserRoleAssignment, aa as PermissionGroup, ab as GroupPermission, ac as AddGroupPermissionRequest, ad as InheritanceRelation, a8 as UserGroupAssignment, ae as UserPermissionOverride, af as AddUserOverrideRequest, ag as EffectivePermission, ah as PermissionCheckResult, aj as CreateApiKeyRequest, ak as CreateApiKeyResult, ai as ApiKeyInfo, al as ApiKeyIntrospection, an as CreateInviteRequest, am as Invitation, ao as InviteValidation, ap as AcceptInviteRequest, ar as CreateWebhookRequest, as as CreateWebhookResult, aq as WebhookEndpoint, at as WebhookDelivery, au as WebhookTestResult, av as Entitlement, aw as GrantEntitlementRequest, ax as Vendor, ay as CreateVendorRequest, az as UpdateVendorRequest, aB as CreateSourceRequest, aA as Source, aC as UpdateSourceRequest, aE as CreateClientRequest, aD as Client, aF as UpdateClientRequest, aG as HierarchyVendor, aJ as HierarchyLink, aN as MembershipWithDetails, aL as CreateMembershipRequest, aK as Membership, aM as UpdateMembershipRequest, aO as AvailableScopesTree, aS as ScopeSwitchResult, aT as GdprExportData, aU as PinStatus, aW as MfaAvailableMethods, aX as TotpEnrollResult, aY as TotpVerifyResult, aZ as SmsEnrollResult, G as MfaEnrollment, a_ as EmailEnrollResult, a$ as BackupCodesResult, b0 as BackupCodeCountResult, t as UpdateBrandingRequest, v as UploadAssetRequest, u as BrandingAsset, w as BrandingDomainMapping, e as IQAuthClientConfig, I as IQAuthBrowserSessionClientConfig, f as IQAuthTokenClientConfig } from './types-XOV9XPVi.mjs';
2
+ import { T as TokensModule } from './tokens-CITeoG6P.mjs';
3
3
 
4
4
  /**
5
5
  * SOURCE REFS:
@@ -18,6 +18,13 @@ interface HttpClientConfig {
18
18
  getApiKey: () => string | undefined;
19
19
  setTokens: (tokens: TokenPair) => void;
20
20
  autoRefresh: boolean;
21
+ /**
22
+ * When false, the per-request "expiring soon" proactive refresh is skipped.
23
+ * Reactive refresh on a TOKEN_EXPIRED response still fires when `autoRefresh` is true.
24
+ * Used by the mobile client's `'app-state'` mode where the AppState listener
25
+ * drives proactive refresh instead.
26
+ */
27
+ proactiveRefresh?: boolean;
21
28
  onTokenRefresh?: (tokens: TokenPair) => void;
22
29
  sessionHeaderName?: string;
23
30
  sessionHeaderValue?: string;
@@ -594,11 +601,33 @@ declare class PermissionGroupsModule {
594
601
  removeUserOverride(tenantId: string, userId: string, overrideId: string): Promise<{
595
602
  message: string;
596
603
  }>;
604
+ /**
605
+ * Task #130 — `appKey` is REQUIRED. The legacy `product` query alias is no
606
+ * longer accepted at the SDK boundary; pass it as `appKey` instead. The
607
+ * server still accepts `product=` from raw HTTP callers during the
608
+ * deprecation window, but the SDK will not silently translate it.
609
+ */
597
610
  getEffectivePermissions(tenantId: string, userId: string, params: {
598
- product?: string;
599
- appKey?: string;
611
+ appKey: string;
600
612
  }): Promise<EffectivePermission[]>;
601
613
  checkPermission(tenantId: string, userId: string, appKey: string, nodeKey: string): Promise<PermissionCheckResult>;
614
+ /**
615
+ * Task #130 — every entry in `checks` must include a non-empty `appKey`
616
+ * AND `nodeKey`. The SDK validates the whole batch before sending so a
617
+ * single misconfigured entry can't slip through and silently report
618
+ * `allowed: false` from the server's per-entry validation branch.
619
+ */
620
+ batchCheckPermissions(tenantId: string, userId: string, checks: Array<{
621
+ appKey: string;
622
+ nodeKey: string;
623
+ }>): Promise<{
624
+ results: Array<{
625
+ appKey: string;
626
+ nodeKey: string;
627
+ allowed: boolean;
628
+ error?: string;
629
+ }>;
630
+ }>;
602
631
  }
603
632
 
604
633
  declare class ApiKeysModule {
@@ -835,11 +864,25 @@ declare class IQAuthClient {
835
864
  constructor(config: IQAuthClientConfig);
836
865
  static forBrowserSession(config: Omit<IQAuthBrowserSessionClientConfig, "environment">): IQAuthClient;
837
866
  static forServer(config: IQAuthTokenClientConfig): IQAuthClient;
867
+ /**
868
+ * Construct a mobile-environment client. NOTE: this constructor does NOT
869
+ * subscribe to React Native's `AppState` even when `autoRefresh: 'app-state'`
870
+ * is passed — it only disables the per-request proactive refresh. Use
871
+ * `createMobileClient` from `@iqauth/sdk/mobile` if you want the full
872
+ * AppState-driven refresh behavior (recommended for Expo / React Native).
873
+ */
838
874
  static forMobile(config: IQAuthTokenClientConfig): IQAuthClient;
839
875
  static forService(config: IQAuthTokenClientConfig): IQAuthClient;
840
876
  setTokens(tokens: TokenPair): void;
841
877
  getAccessToken(): string | undefined;
842
878
  getRefreshToken(): string | undefined;
879
+ /**
880
+ * Task #126: Eagerly fetch JWKS + OIDC discovery so the first verify() /
881
+ * refresh round-trip on the request hot path doesn't pay the discovery
882
+ * fetch latency. Safe to call repeatedly. Errors are swallowed; callers
883
+ * may fire-and-forget. Called automatically by `iqAuth({...}).attachHelpers()`.
884
+ */
885
+ prewarm(): Promise<void>;
843
886
  private getCurrentClaims;
844
887
  private static resolveEnvironment;
845
888
  }
@@ -1,5 +1,5 @@
1
- import { I as IQAuthEnvironment, T as TokenPair, W as IQAuthRetryConfig, L as LoginResult, a$ as SignupRequest, D as MfaVerifyResult, d as SessionUser, h as Session, U as UserProfile, H as ProvisionUserRequest, K as ProvisionUserResponse, G as UserPermissions, J as JwtClaims, O as OidcDiscovery, t as JwksResponse, u as OidcTokenResponse, b0 as HostedClientContext, i as TenantInfo, C as CreateTenantRequest, j as UpdateTenantRequest, P as PromoteToVendorRequest, k as PromoteToVendorResult, a7 as TenantUser, l as InviteTenantUserRequest, m as InviteTenantUserResult, n as TenantUserRoleUpdate, M as MigrateUserRequest, E as PasswordPolicy, F as MfaPolicy, B as BrandingConfig, _ as AppInfo, $ as PermissionNodeInfo, Z as AppManifest, a0 as AppSyncResult, a1 as Role, a2 as CreateRoleRequest, a3 as UpdateRoleRequest, a4 as AssignRoleRequest, a5 as UserRoleAssignment, a8 as PermissionGroup, a9 as GroupPermission, aa as AddGroupPermissionRequest, ab as InheritanceRelation, a6 as UserGroupAssignment, ac as UserPermissionOverride, ad as AddUserOverrideRequest, ae as EffectivePermission, af as PermissionCheckResult, ah as CreateApiKeyRequest, ai as CreateApiKeyResult, ag as ApiKeyInfo, aj as ApiKeyIntrospection, al as CreateInviteRequest, ak as Invitation, am as InviteValidation, an as AcceptInviteRequest, ap as CreateWebhookRequest, aq as CreateWebhookResult, ao as WebhookEndpoint, ar as WebhookDelivery, as as WebhookTestResult, at as Entitlement, au as GrantEntitlementRequest, av as Vendor, aw as CreateVendorRequest, ax as UpdateVendorRequest, az as CreateSourceRequest, ay as Source, aA as UpdateSourceRequest, aC as CreateClientRequest, aB as Client, aD as UpdateClientRequest, aE as HierarchyVendor, aH as HierarchyLink, aL as MembershipWithDetails, aJ as CreateMembershipRequest, aI as Membership, aK as UpdateMembershipRequest, aM as AvailableScopesTree, aQ as ScopeSwitchResult, aR as GdprExportData, aS as PinStatus, aU as MfaAvailableMethods, aV as TotpEnrollResult, aW as TotpVerifyResult, aX as SmsEnrollResult, y as MfaEnrollment, aY as EmailEnrollResult, aZ as BackupCodesResult, a_ as BackupCodeCountResult, o as UpdateBrandingRequest, q as UploadAssetRequest, p as BrandingAsset, r as BrandingDomainMapping, a as IQAuthClientConfig, c as IQAuthBrowserSessionClientConfig, b as IQAuthTokenClientConfig } from './types-DZAflmmq.js';
2
- import { T as TokensModule } from './tokens-aHiGFr_E.js';
1
+ import { d as IQAuthEnvironment, T as TokenPair, Y as IQAuthRetryConfig, L as LoginResult, b1 as SignupRequest, K as MfaVerifyResult, S as SessionUser, m as Session, U as UserProfile, V as ProvisionUserRequest, W as ProvisionUserResponse, R as UserPermissions, J as JwtClaims, O as OidcDiscovery, y as JwksResponse, z as OidcTokenResponse, b2 as HostedClientContext, n as TenantInfo, C as CreateTenantRequest, o as UpdateTenantRequest, P as PromoteToVendorRequest, p as PromoteToVendorResult, a9 as TenantUser, q as InviteTenantUserRequest, r as InviteTenantUserResult, s as TenantUserRoleUpdate, M as MigrateUserRequest, N as PasswordPolicy, Q as MfaPolicy, B as BrandingConfig, a0 as AppInfo, a1 as PermissionNodeInfo, $ as AppManifest, a2 as AppSyncResult, a3 as Role, a4 as CreateRoleRequest, a5 as UpdateRoleRequest, a6 as AssignRoleRequest, a7 as UserRoleAssignment, aa as PermissionGroup, ab as GroupPermission, ac as AddGroupPermissionRequest, ad as InheritanceRelation, a8 as UserGroupAssignment, ae as UserPermissionOverride, af as AddUserOverrideRequest, ag as EffectivePermission, ah as PermissionCheckResult, aj as CreateApiKeyRequest, ak as CreateApiKeyResult, ai as ApiKeyInfo, al as ApiKeyIntrospection, an as CreateInviteRequest, am as Invitation, ao as InviteValidation, ap as AcceptInviteRequest, ar as CreateWebhookRequest, as as CreateWebhookResult, aq as WebhookEndpoint, at as WebhookDelivery, au as WebhookTestResult, av as Entitlement, aw as GrantEntitlementRequest, ax as Vendor, ay as CreateVendorRequest, az as UpdateVendorRequest, aB as CreateSourceRequest, aA as Source, aC as UpdateSourceRequest, aE as CreateClientRequest, aD as Client, aF as UpdateClientRequest, aG as HierarchyVendor, aJ as HierarchyLink, aN as MembershipWithDetails, aL as CreateMembershipRequest, aK as Membership, aM as UpdateMembershipRequest, aO as AvailableScopesTree, aS as ScopeSwitchResult, aT as GdprExportData, aU as PinStatus, aW as MfaAvailableMethods, aX as TotpEnrollResult, aY as TotpVerifyResult, aZ as SmsEnrollResult, G as MfaEnrollment, a_ as EmailEnrollResult, a$ as BackupCodesResult, b0 as BackupCodeCountResult, t as UpdateBrandingRequest, v as UploadAssetRequest, u as BrandingAsset, w as BrandingDomainMapping, e as IQAuthClientConfig, I as IQAuthBrowserSessionClientConfig, f as IQAuthTokenClientConfig } from './types-XOV9XPVi.js';
2
+ import { T as TokensModule } from './tokens-Bqhmqq_R.js';
3
3
 
4
4
  /**
5
5
  * SOURCE REFS:
@@ -18,6 +18,13 @@ interface HttpClientConfig {
18
18
  getApiKey: () => string | undefined;
19
19
  setTokens: (tokens: TokenPair) => void;
20
20
  autoRefresh: boolean;
21
+ /**
22
+ * When false, the per-request "expiring soon" proactive refresh is skipped.
23
+ * Reactive refresh on a TOKEN_EXPIRED response still fires when `autoRefresh` is true.
24
+ * Used by the mobile client's `'app-state'` mode where the AppState listener
25
+ * drives proactive refresh instead.
26
+ */
27
+ proactiveRefresh?: boolean;
21
28
  onTokenRefresh?: (tokens: TokenPair) => void;
22
29
  sessionHeaderName?: string;
23
30
  sessionHeaderValue?: string;
@@ -594,11 +601,33 @@ declare class PermissionGroupsModule {
594
601
  removeUserOverride(tenantId: string, userId: string, overrideId: string): Promise<{
595
602
  message: string;
596
603
  }>;
604
+ /**
605
+ * Task #130 — `appKey` is REQUIRED. The legacy `product` query alias is no
606
+ * longer accepted at the SDK boundary; pass it as `appKey` instead. The
607
+ * server still accepts `product=` from raw HTTP callers during the
608
+ * deprecation window, but the SDK will not silently translate it.
609
+ */
597
610
  getEffectivePermissions(tenantId: string, userId: string, params: {
598
- product?: string;
599
- appKey?: string;
611
+ appKey: string;
600
612
  }): Promise<EffectivePermission[]>;
601
613
  checkPermission(tenantId: string, userId: string, appKey: string, nodeKey: string): Promise<PermissionCheckResult>;
614
+ /**
615
+ * Task #130 — every entry in `checks` must include a non-empty `appKey`
616
+ * AND `nodeKey`. The SDK validates the whole batch before sending so a
617
+ * single misconfigured entry can't slip through and silently report
618
+ * `allowed: false` from the server's per-entry validation branch.
619
+ */
620
+ batchCheckPermissions(tenantId: string, userId: string, checks: Array<{
621
+ appKey: string;
622
+ nodeKey: string;
623
+ }>): Promise<{
624
+ results: Array<{
625
+ appKey: string;
626
+ nodeKey: string;
627
+ allowed: boolean;
628
+ error?: string;
629
+ }>;
630
+ }>;
602
631
  }
603
632
 
604
633
  declare class ApiKeysModule {
@@ -835,11 +864,25 @@ declare class IQAuthClient {
835
864
  constructor(config: IQAuthClientConfig);
836
865
  static forBrowserSession(config: Omit<IQAuthBrowserSessionClientConfig, "environment">): IQAuthClient;
837
866
  static forServer(config: IQAuthTokenClientConfig): IQAuthClient;
867
+ /**
868
+ * Construct a mobile-environment client. NOTE: this constructor does NOT
869
+ * subscribe to React Native's `AppState` even when `autoRefresh: 'app-state'`
870
+ * is passed — it only disables the per-request proactive refresh. Use
871
+ * `createMobileClient` from `@iqauth/sdk/mobile` if you want the full
872
+ * AppState-driven refresh behavior (recommended for Expo / React Native).
873
+ */
838
874
  static forMobile(config: IQAuthTokenClientConfig): IQAuthClient;
839
875
  static forService(config: IQAuthTokenClientConfig): IQAuthClient;
840
876
  setTokens(tokens: TokenPair): void;
841
877
  getAccessToken(): string | undefined;
842
878
  getRefreshToken(): string | undefined;
879
+ /**
880
+ * Task #126: Eagerly fetch JWKS + OIDC discovery so the first verify() /
881
+ * refresh round-trip on the request hot path doesn't pay the discovery
882
+ * fetch latency. Safe to call repeatedly. Errors are swallowed; callers
883
+ * may fire-and-forget. Called automatically by `iqAuth({...}).attachHelpers()`.
884
+ */
885
+ prewarm(): Promise<void>;
843
886
  private getCurrentClaims;
844
887
  private static resolveEnvironment;
845
888
  }
@@ -5,8 +5,8 @@ import {
5
5
  } from "./chunk-X3K3WOBR.mjs";
6
6
  import {
7
7
  parsePublishableKey
8
- } from "./chunk-WQWBJSSS.mjs";
9
- import "./chunk-6I6RM4MN.mjs";
8
+ } from "./chunk-HVHNYPDC.mjs";
9
+ import "./chunk-6PJRLRB4.mjs";
10
10
  import "./chunk-Y6FXYEAI.mjs";
11
11
 
12
12
  // src/cli/doctor.ts
@@ -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-kYlJFgPv.mjs';
2
- import { J as JwtClaims, N as ExpressMiddlewareOptions, Q as IQAuthRequestLike, R as IQAuthResponseLike, V as IQAuthNextFunction } from './types-DZAflmmq.mjs';
1
+ import { I as IQAuthClient } from './client-BGFnBpfc.mjs';
2
+ import { J as JwtClaims, X as ExpressMiddlewareOptions, a as IQAuthRequestLike, b as IQAuthResponseLike, c as IQAuthNextFunction } from './types-XOV9XPVi.mjs';
3
3
 
4
4
  /**
5
5
  * SOURCE REFS:
@@ -1,5 +1,5 @@
1
- import { I as IQAuthClient } from './client-BNQe3AgF.js';
2
- import { J as JwtClaims, N as ExpressMiddlewareOptions, Q as IQAuthRequestLike, R as IQAuthResponseLike, V as IQAuthNextFunction } from './types-DZAflmmq.js';
1
+ import { I as IQAuthClient } from './client-CDQ21LvW.js';
2
+ import { J as JwtClaims, X as ExpressMiddlewareOptions, a as IQAuthRequestLike, b as IQAuthResponseLike, c as IQAuthNextFunction } from './types-XOV9XPVi.js';
3
3
 
4
4
  /**
5
5
  * SOURCE REFS:
@@ -1,10 +1,10 @@
1
- import { I as IQAuthClient } from './client-kYlJFgPv.mjs';
2
- import { C as CookieAwareMiddlewareOptions } from './express-B6_1vBYZ.mjs';
3
- export { i as iqAuthMiddleware } from './express-B6_1vBYZ.mjs';
1
+ import { I as IQAuthClient } from './client-BGFnBpfc.mjs';
2
+ import { C as CookieAwareMiddlewareOptions } from './express-CVNQEkOr.mjs';
3
+ export { i as iqAuthMiddleware } from './express-CVNQEkOr.mjs';
4
4
  import { IQAuthHelperConfig } from './server/handlers.mjs';
5
- import { Q as IQAuthRequestLike, R as IQAuthResponseLike, V as IQAuthNextFunction } from './types-DZAflmmq.mjs';
6
- export { E as ErrorCodes, I as IQAuthError } from './errors-CDdl24MP.mjs';
7
- import './tokens-DCyzzn8L.mjs';
5
+ import { a as IQAuthRequestLike, b as IQAuthResponseLike, c as IQAuthNextFunction } from './types-XOV9XPVi.mjs';
6
+ export { E as ErrorCodes, I as IQAuthError } from './errors-Jl1Jtm-6.mjs';
7
+ import './tokens-CITeoG6P.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-BNQe3AgF.js';
2
- import { C as CookieAwareMiddlewareOptions } from './express-CHpfa7D_.js';
3
- export { i as iqAuthMiddleware } from './express-CHpfa7D_.js';
1
+ import { I as IQAuthClient } from './client-CDQ21LvW.js';
2
+ import { C as CookieAwareMiddlewareOptions } from './express-Piv2WhWM.js';
3
+ export { i as iqAuthMiddleware } from './express-Piv2WhWM.js';
4
4
  import { IQAuthHelperConfig } from './server/handlers.js';
5
- import { Q as IQAuthRequestLike, R as IQAuthResponseLike, V as IQAuthNextFunction } from './types-DZAflmmq.js';
6
- export { E as ErrorCodes, I as IQAuthError } from './errors-CDdl24MP.js';
7
- import './tokens-aHiGFr_E.js';
5
+ import { a as IQAuthRequestLike, b as IQAuthResponseLike, c as IQAuthNextFunction } from './types-XOV9XPVi.js';
6
+ export { E as ErrorCodes, I as IQAuthError } from './errors-Jl1Jtm-6.js';
7
+ import './tokens-Bqhmqq_R.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 };