@iqauth/sdk 2.2.0 → 2.5.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 (96) hide show
  1. package/README.md +134 -0
  2. package/dist/browser-session.d.mts +3 -3
  3. package/dist/browser-session.d.ts +3 -3
  4. package/dist/browser-session.js +89 -68
  5. package/dist/browser-session.mjs +2 -1
  6. package/dist/browser.d.mts +64 -29
  7. package/dist/browser.d.ts +64 -29
  8. package/dist/browser.js +794 -39
  9. package/dist/browser.mjs +44 -4
  10. package/dist/bundle-LUKDQYVQ.mjs +374 -0
  11. package/dist/chunk-3JULWS6F.mjs +106 -0
  12. package/dist/chunk-5T7GHBX6.mjs +1165 -0
  13. package/dist/{chunk-M4J6BPK7.mjs → chunk-6TDJJER7.mjs} +12 -3
  14. package/dist/{chunk-QZB745C2.mjs → chunk-76W5TLQQ.mjs} +264 -211
  15. package/dist/{chunk-D72UL5HL.mjs → chunk-BVV54LPI.mjs} +36 -4
  16. package/dist/chunk-LIZYFXH7.mjs +90 -0
  17. package/dist/chunk-MKKZULZR.mjs +241 -0
  18. package/dist/chunk-SL3KRS4W.mjs +54 -0
  19. package/dist/chunk-TKZTCPEK.mjs +232 -0
  20. package/dist/chunk-UKZLOHZG.mjs +83 -0
  21. package/dist/chunk-UNYDG2L4.mjs +209 -0
  22. package/dist/{chunk-MDUHPQMM.mjs → chunk-W3F4JYGP.mjs} +8 -180
  23. package/dist/{chunk-QEJB7WEQ.mjs → chunk-WQWBJSSS.mjs} +1 -1
  24. package/dist/cli/index.js +144 -36
  25. package/dist/cli/index.mjs +1 -1
  26. package/dist/{client-DXbHb2ul.d.ts → client-BNQe3AgF.d.ts} +3 -67
  27. package/dist/{client-Dv4v92Mj.d.mts → client-kYlJFgPv.d.mts} +3 -67
  28. package/dist/doctor-YYNHNMLD.mjs +198 -0
  29. package/dist/{express-BZmF1llh.d.mts → express-B6_1vBYZ.d.mts} +23 -2
  30. package/dist/{express-B4o3P8vK.d.ts → express-CHpfa7D_.d.ts} +23 -2
  31. package/dist/express.d.mts +77 -6
  32. package/dist/express.d.ts +77 -6
  33. package/dist/express.js +336 -74
  34. package/dist/express.mjs +209 -8
  35. package/dist/fastify.js +103 -72
  36. package/dist/fastify.mjs +6 -4
  37. package/dist/hono.js +102 -72
  38. package/dist/hono.mjs +5 -4
  39. package/dist/index.d.mts +8 -4
  40. package/dist/index.d.ts +8 -4
  41. package/dist/index.js +590 -73
  42. package/dist/index.mjs +30 -8
  43. package/dist/locales.d.mts +53 -0
  44. package/dist/locales.d.ts +53 -0
  45. package/dist/locales.js +1202 -0
  46. package/dist/locales.mjs +29 -0
  47. package/dist/mobile.d.mts +3 -3
  48. package/dist/mobile.d.ts +3 -3
  49. package/dist/mobile.js +89 -68
  50. package/dist/mobile.mjs +2 -1
  51. package/dist/next.d.mts +10 -1
  52. package/dist/next.d.ts +10 -1
  53. package/dist/next.js +101 -1618
  54. package/dist/next.mjs +9 -9
  55. package/dist/provisioningBridge-88xjOS2n.d.mts +86 -0
  56. package/dist/provisioningBridge-DnTfzdZK.d.ts +86 -0
  57. package/dist/react.d.mts +1349 -10
  58. package/dist/react.d.ts +1349 -10
  59. package/dist/react.js +2998 -569
  60. package/dist/react.mjs +1518 -95
  61. package/dist/reverify-4UEJXUS6.mjs +16 -0
  62. package/dist/server/handlers.d.mts +12 -1
  63. package/dist/server/handlers.d.ts +12 -1
  64. package/dist/server/handlers.js +12 -3
  65. package/dist/server/handlers.mjs +2 -2
  66. package/dist/server.d.mts +5 -4
  67. package/dist/server.d.ts +5 -4
  68. package/dist/server.js +188 -73
  69. package/dist/server.mjs +13 -8
  70. package/dist/service.d.mts +3 -3
  71. package/dist/service.d.ts +3 -3
  72. package/dist/service.js +89 -68
  73. package/dist/service.mjs +2 -1
  74. package/dist/signIn-CCY4JE5G.mjs +15 -0
  75. package/dist/{signIn-D_kP3v-c.d.mts → signIn-CiIBTJIh.d.mts} +232 -4
  76. package/dist/{signIn-BVDTIA_t.d.ts → signIn-OCr88Zf8.d.ts} +232 -4
  77. package/dist/test.d.mts +86 -0
  78. package/dist/test.d.ts +86 -0
  79. package/dist/test.js +289 -0
  80. package/dist/test.mjs +9 -0
  81. package/dist/tokens-DCyzzn8L.d.mts +63 -0
  82. package/dist/tokens-aHiGFr_E.d.ts +63 -0
  83. package/dist/types-6bNdxesb.d.mts +196 -0
  84. package/dist/types-6bNdxesb.d.ts +196 -0
  85. package/dist/{types-Cxl3bQHt.d.ts → types-DZAflmmq.d.mts} +6 -0
  86. package/dist/{types-Cxl3bQHt.d.mts → types-DZAflmmq.d.ts} +6 -0
  87. package/dist/webhooks.d.mts +61 -0
  88. package/dist/webhooks.d.ts +61 -0
  89. package/dist/webhooks.js +119 -0
  90. package/dist/webhooks.mjs +11 -0
  91. package/dist/ws.d.mts +73 -0
  92. package/dist/ws.d.ts +73 -0
  93. package/dist/ws.js +397 -0
  94. package/dist/ws.mjs +12 -0
  95. package/package.json +24 -3
  96. package/dist/doctor-XCI77BQS.mjs +0 -90
package/dist/index.mjs CHANGED
@@ -1,22 +1,33 @@
1
+ import {
2
+ createProvisioningBridge
3
+ } from "./chunk-SL3KRS4W.mjs";
4
+ import {
5
+ createTestIssuer
6
+ } from "./chunk-MKKZULZR.mjs";
7
+ import {
8
+ WebhookSignatureError,
9
+ isValidWebhookSignature,
10
+ verifyWebhookSignature
11
+ } from "./chunk-UKZLOHZG.mjs";
12
+ import {
13
+ verifyWsUpgrade
14
+ } from "./chunk-3JULWS6F.mjs";
1
15
  import {
2
16
  iqAuthMiddleware
3
- } from "./chunk-D72UL5HL.mjs";
17
+ } from "./chunk-BVV54LPI.mjs";
4
18
  import {
5
19
  assertPublishableKey,
6
20
  encodePublishableKey,
7
21
  isPublishableKey,
8
22
  isSecretKey,
9
23
  parsePublishableKey
10
- } from "./chunk-QEJB7WEQ.mjs";
24
+ } from "./chunk-WQWBJSSS.mjs";
11
25
  import {
12
26
  ApiKeysModule,
13
27
  AppsModule,
14
28
  AuthModule,
15
29
  BrandingModule,
16
30
  ClientsModule,
17
- DEFAULT_CLOCK_TOLERANCE_SECONDS,
18
- DEFAULT_TOKEN_AUDIENCE,
19
- DEFAULT_TOKEN_ISSUER,
20
31
  EntitlementsModule,
21
32
  GdprModule,
22
33
  HierarchyModule,
@@ -34,11 +45,16 @@ import {
34
45
  SessionsModule,
35
46
  SourcesModule,
36
47
  TenantsModule,
37
- TokensModule,
38
48
  UsersModule,
39
49
  VendorsModule,
40
50
  WebhooksModule
41
- } from "./chunk-MDUHPQMM.mjs";
51
+ } from "./chunk-W3F4JYGP.mjs";
52
+ import {
53
+ DEFAULT_CLOCK_TOLERANCE_SECONDS,
54
+ DEFAULT_TOKEN_AUDIENCE,
55
+ DEFAULT_TOKEN_ISSUER,
56
+ TokensModule
57
+ } from "./chunk-UNYDG2L4.mjs";
42
58
  import {
43
59
  ErrorCodes,
44
60
  IQAuthError
@@ -75,11 +91,17 @@ export {
75
91
  TokensModule,
76
92
  UsersModule,
77
93
  VendorsModule,
94
+ WebhookSignatureError,
78
95
  WebhooksModule,
79
96
  assertPublishableKey,
97
+ createProvisioningBridge,
98
+ createTestIssuer,
80
99
  encodePublishableKey,
81
100
  iqAuthMiddleware,
82
101
  isPublishableKey,
83
102
  isSecretKey,
84
- parsePublishableKey
103
+ isValidWebhookSignature,
104
+ parsePublishableKey,
105
+ verifyWebhookSignature,
106
+ verifyWsUpgrade
85
107
  };
@@ -0,0 +1,53 @@
1
+ import { I as IQAuthLocaleBundle, a as IQAuthLocaleOverride, b as IQAuthLocaleKey } from './types-6bNdxesb.mjs';
2
+
3
+ declare const enUS: IQAuthLocaleBundle;
4
+
5
+ declare const frFR: IQAuthLocaleBundle;
6
+
7
+ declare const esES: IQAuthLocaleBundle;
8
+
9
+ declare const deDE: IQAuthLocaleBundle;
10
+
11
+ declare const jaJP: IQAuthLocaleBundle;
12
+
13
+ declare const ptBR: IQAuthLocaleBundle;
14
+
15
+ /**
16
+ * Public entry point for `@iqauth/sdk/locales`.
17
+ *
18
+ * Exports the strict bundle type, the default `enUS` bundle, the five other
19
+ * shipped locales, the `t()` resolver, and helpers for error-code mapping
20
+ * and Accept-Language negotiation.
21
+ */
22
+
23
+ /** Bundles indexed by their canonical BCP-47 tag. */
24
+ declare const builtInLocales: Record<string, IQAuthLocaleBundle>;
25
+ /**
26
+ * Default bundle used when a key is missing from a contributor-supplied
27
+ * partial override, or when no `localization` prop is passed at all.
28
+ */
29
+ declare const defaultBundle: IQAuthLocaleBundle;
30
+ /**
31
+ * Resolve a localized string from a bundle. Substitutes `{name}` placeholders
32
+ * with values from `vars`. If the key is missing from the bundle (which
33
+ * should never happen when contributors supply a fully typed bundle, but can
34
+ * happen with a `Partial<IQAuthLocaleBundle>` override), the default `enUS`
35
+ * value is used as a graceful fallback.
36
+ */
37
+ declare function t(bundle: IQAuthLocaleBundle | IQAuthLocaleOverride | undefined | null, key: IQAuthLocaleKey, vars?: Record<string, string | number>): string;
38
+ /**
39
+ * Merge a partial override on top of the default bundle so callers always
40
+ * receive a fully populated `IQAuthLocaleBundle`. Used internally by
41
+ * `<IQAuthProvider localization={...}>`.
42
+ */
43
+ declare function resolveBundle(override?: IQAuthLocaleBundle | IQAuthLocaleOverride | null): IQAuthLocaleBundle;
44
+ declare function localizeErrorCode(bundle: IQAuthLocaleBundle | IQAuthLocaleOverride | undefined | null, code: string | undefined | null, vars?: Record<string, string | number>): string;
45
+ /**
46
+ * Negotiate the best matching locale tag from a comma-separated
47
+ * `Accept-Language` header (or `navigator.language` value), preferring exact
48
+ * matches and falling back to the language subtag (e.g. `fr-CA` -> `fr-FR`).
49
+ * Returns `"en-US"` when no candidate matches a built-in locale.
50
+ */
51
+ declare function negotiateLocale(acceptLanguage: string | null | undefined, available?: string[]): string;
52
+
53
+ export { IQAuthLocaleBundle, IQAuthLocaleKey, IQAuthLocaleOverride, builtInLocales, deDE, defaultBundle, enUS, esES, frFR, jaJP, localizeErrorCode, negotiateLocale, ptBR, resolveBundle, t };
@@ -0,0 +1,53 @@
1
+ import { I as IQAuthLocaleBundle, a as IQAuthLocaleOverride, b as IQAuthLocaleKey } from './types-6bNdxesb.js';
2
+
3
+ declare const enUS: IQAuthLocaleBundle;
4
+
5
+ declare const frFR: IQAuthLocaleBundle;
6
+
7
+ declare const esES: IQAuthLocaleBundle;
8
+
9
+ declare const deDE: IQAuthLocaleBundle;
10
+
11
+ declare const jaJP: IQAuthLocaleBundle;
12
+
13
+ declare const ptBR: IQAuthLocaleBundle;
14
+
15
+ /**
16
+ * Public entry point for `@iqauth/sdk/locales`.
17
+ *
18
+ * Exports the strict bundle type, the default `enUS` bundle, the five other
19
+ * shipped locales, the `t()` resolver, and helpers for error-code mapping
20
+ * and Accept-Language negotiation.
21
+ */
22
+
23
+ /** Bundles indexed by their canonical BCP-47 tag. */
24
+ declare const builtInLocales: Record<string, IQAuthLocaleBundle>;
25
+ /**
26
+ * Default bundle used when a key is missing from a contributor-supplied
27
+ * partial override, or when no `localization` prop is passed at all.
28
+ */
29
+ declare const defaultBundle: IQAuthLocaleBundle;
30
+ /**
31
+ * Resolve a localized string from a bundle. Substitutes `{name}` placeholders
32
+ * with values from `vars`. If the key is missing from the bundle (which
33
+ * should never happen when contributors supply a fully typed bundle, but can
34
+ * happen with a `Partial<IQAuthLocaleBundle>` override), the default `enUS`
35
+ * value is used as a graceful fallback.
36
+ */
37
+ declare function t(bundle: IQAuthLocaleBundle | IQAuthLocaleOverride | undefined | null, key: IQAuthLocaleKey, vars?: Record<string, string | number>): string;
38
+ /**
39
+ * Merge a partial override on top of the default bundle so callers always
40
+ * receive a fully populated `IQAuthLocaleBundle`. Used internally by
41
+ * `<IQAuthProvider localization={...}>`.
42
+ */
43
+ declare function resolveBundle(override?: IQAuthLocaleBundle | IQAuthLocaleOverride | null): IQAuthLocaleBundle;
44
+ declare function localizeErrorCode(bundle: IQAuthLocaleBundle | IQAuthLocaleOverride | undefined | null, code: string | undefined | null, vars?: Record<string, string | number>): string;
45
+ /**
46
+ * Negotiate the best matching locale tag from a comma-separated
47
+ * `Accept-Language` header (or `navigator.language` value), preferring exact
48
+ * matches and falling back to the language subtag (e.g. `fr-CA` -> `fr-FR`).
49
+ * Returns `"en-US"` when no candidate matches a built-in locale.
50
+ */
51
+ declare function negotiateLocale(acceptLanguage: string | null | undefined, available?: string[]): string;
52
+
53
+ export { IQAuthLocaleBundle, IQAuthLocaleKey, IQAuthLocaleOverride, builtInLocales, deDE, defaultBundle, enUS, esES, frFR, jaJP, localizeErrorCode, negotiateLocale, ptBR, resolveBundle, t };