@clerk/expo 2.19.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 (173) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +74 -0
  3. package/dist/cache/MemoryTokenCache.d.ts +3 -0
  4. package/dist/cache/MemoryTokenCache.d.ts.map +1 -0
  5. package/dist/cache/MemoryTokenCache.js +44 -0
  6. package/dist/cache/MemoryTokenCache.js.map +1 -0
  7. package/dist/cache/ResourceCache.d.ts +6 -0
  8. package/dist/cache/ResourceCache.d.ts.map +1 -0
  9. package/dist/cache/ResourceCache.js +84 -0
  10. package/dist/cache/ResourceCache.js.map +1 -0
  11. package/dist/cache/dummy-data/client-resource.d.ts +3 -0
  12. package/dist/cache/dummy-data/client-resource.d.ts.map +1 -0
  13. package/dist/cache/dummy-data/client-resource.js +157 -0
  14. package/dist/cache/dummy-data/client-resource.js.map +1 -0
  15. package/dist/cache/dummy-data/environment-resource.d.ts +3 -0
  16. package/dist/cache/dummy-data/environment-resource.d.ts.map +1 -0
  17. package/dist/cache/dummy-data/environment-resource.js +260 -0
  18. package/dist/cache/dummy-data/environment-resource.js.map +1 -0
  19. package/dist/cache/dummy-data/index.d.ts +3 -0
  20. package/dist/cache/dummy-data/index.d.ts.map +1 -0
  21. package/dist/cache/dummy-data/index.js +32 -0
  22. package/dist/cache/dummy-data/index.js.map +1 -0
  23. package/dist/cache/index.d.ts +5 -0
  24. package/dist/cache/index.d.ts.map +1 -0
  25. package/dist/cache/index.js +44 -0
  26. package/dist/cache/index.js.map +1 -0
  27. package/dist/cache/types.d.ts +18 -0
  28. package/dist/cache/types.d.ts.map +1 -0
  29. package/dist/cache/types.js +17 -0
  30. package/dist/cache/types.js.map +1 -0
  31. package/dist/components/controlComponents.d.ts +2 -0
  32. package/dist/components/controlComponents.d.ts.map +1 -0
  33. package/dist/components/controlComponents.js +37 -0
  34. package/dist/components/controlComponents.js.map +1 -0
  35. package/dist/components/index.d.ts +2 -0
  36. package/dist/components/index.d.ts.map +1 -0
  37. package/dist/components/index.js +23 -0
  38. package/dist/components/index.js.map +1 -0
  39. package/dist/errorThrower.d.ts +3 -0
  40. package/dist/errorThrower.d.ts.map +1 -0
  41. package/dist/errorThrower.js +30 -0
  42. package/dist/errorThrower.js.map +1 -0
  43. package/dist/experimental.d.ts +2 -0
  44. package/dist/experimental.d.ts.map +1 -0
  45. package/dist/experimental.js +17 -0
  46. package/dist/experimental.js.map +1 -0
  47. package/dist/global.d.js +2 -0
  48. package/dist/global.d.js.map +1 -0
  49. package/dist/hooks/index.d.ts +6 -0
  50. package/dist/hooks/index.d.ts.map +1 -0
  51. package/dist/hooks/index.js +56 -0
  52. package/dist/hooks/index.js.map +1 -0
  53. package/dist/hooks/useAuth.d.ts +3 -0
  54. package/dist/hooks/useAuth.d.ts.map +1 -0
  55. package/dist/hooks/useAuth.js +50 -0
  56. package/dist/hooks/useAuth.js.map +1 -0
  57. package/dist/hooks/useOAuth.d.ts +25 -0
  58. package/dist/hooks/useOAuth.d.ts.map +1 -0
  59. package/dist/hooks/useOAuth.js +104 -0
  60. package/dist/hooks/useOAuth.js.map +1 -0
  61. package/dist/hooks/useSSO.d.ts +23 -0
  62. package/dist/hooks/useSSO.d.ts.map +1 -0
  63. package/dist/hooks/useSSO.js +105 -0
  64. package/dist/hooks/useSSO.js.map +1 -0
  65. package/dist/hooks/useSignInWithApple.d.ts +50 -0
  66. package/dist/hooks/useSignInWithApple.d.ts.map +1 -0
  67. package/dist/hooks/useSignInWithApple.ios.d.ts +51 -0
  68. package/dist/hooks/useSignInWithApple.ios.d.ts.map +1 -0
  69. package/dist/hooks/useSignInWithApple.ios.js +117 -0
  70. package/dist/hooks/useSignInWithApple.ios.js.map +1 -0
  71. package/dist/hooks/useSignInWithApple.js +39 -0
  72. package/dist/hooks/useSignInWithApple.js.map +1 -0
  73. package/dist/index.d.ts +11 -0
  74. package/dist/index.d.ts.map +1 -0
  75. package/dist/index.js +52 -0
  76. package/dist/index.js.map +1 -0
  77. package/dist/legacy.d.ts +2 -0
  78. package/dist/legacy.d.ts.map +1 -0
  79. package/dist/legacy.js +31 -0
  80. package/dist/legacy.js.map +1 -0
  81. package/dist/local-credentials/index.d.ts +2 -0
  82. package/dist/local-credentials/index.d.ts.map +1 -0
  83. package/dist/local-credentials/index.js +29 -0
  84. package/dist/local-credentials/index.js.map +1 -0
  85. package/dist/local-credentials/useLocalCredentials/index.d.ts +2 -0
  86. package/dist/local-credentials/useLocalCredentials/index.d.ts.map +1 -0
  87. package/dist/local-credentials/useLocalCredentials/index.js +29 -0
  88. package/dist/local-credentials/useLocalCredentials/index.js.map +1 -0
  89. package/dist/local-credentials/useLocalCredentials/shared.d.ts +24 -0
  90. package/dist/local-credentials/useLocalCredentials/shared.d.ts.map +1 -0
  91. package/dist/local-credentials/useLocalCredentials/shared.js +37 -0
  92. package/dist/local-credentials/useLocalCredentials/shared.js.map +1 -0
  93. package/dist/local-credentials/useLocalCredentials/useLocalCredentials.d.ts +7 -0
  94. package/dist/local-credentials/useLocalCredentials/useLocalCredentials.d.ts.map +1 -0
  95. package/dist/local-credentials/useLocalCredentials/useLocalCredentials.js +195 -0
  96. package/dist/local-credentials/useLocalCredentials/useLocalCredentials.js.map +1 -0
  97. package/dist/local-credentials/useLocalCredentials/useLocalCredentials.web.d.ts +3 -0
  98. package/dist/local-credentials/useLocalCredentials/useLocalCredentials.web.d.ts.map +1 -0
  99. package/dist/local-credentials/useLocalCredentials/useLocalCredentials.web.js +32 -0
  100. package/dist/local-credentials/useLocalCredentials/useLocalCredentials.web.js.map +1 -0
  101. package/dist/passkeys/index.d.ts +3 -0
  102. package/dist/passkeys/index.d.ts.map +1 -0
  103. package/dist/passkeys/index.js +29 -0
  104. package/dist/passkeys/index.js.map +1 -0
  105. package/dist/polyfills/base64Polyfill.d.ts +2 -0
  106. package/dist/polyfills/base64Polyfill.d.ts.map +1 -0
  107. package/dist/polyfills/base64Polyfill.js +10 -0
  108. package/dist/polyfills/base64Polyfill.js.map +1 -0
  109. package/dist/polyfills/index.d.ts +3 -0
  110. package/dist/polyfills/index.d.ts.map +1 -0
  111. package/dist/polyfills/index.js +4 -0
  112. package/dist/polyfills/index.js.map +1 -0
  113. package/dist/provider/ClerkProvider.d.ts +32 -0
  114. package/dist/provider/ClerkProvider.d.ts.map +1 -0
  115. package/dist/provider/ClerkProvider.js +85 -0
  116. package/dist/provider/ClerkProvider.js.map +1 -0
  117. package/dist/provider/singleton/createClerkInstance.d.ts +9 -0
  118. package/dist/provider/singleton/createClerkInstance.d.ts.map +1 -0
  119. package/dist/provider/singleton/createClerkInstance.js +167 -0
  120. package/dist/provider/singleton/createClerkInstance.js.map +1 -0
  121. package/dist/provider/singleton/index.d.ts +2 -0
  122. package/dist/provider/singleton/index.d.ts.map +1 -0
  123. package/dist/provider/singleton/index.js +23 -0
  124. package/dist/provider/singleton/index.js.map +1 -0
  125. package/dist/provider/singleton/singleton.d.ts +25 -0
  126. package/dist/provider/singleton/singleton.d.ts.map +1 -0
  127. package/dist/provider/singleton/singleton.js +34 -0
  128. package/dist/provider/singleton/singleton.js.map +1 -0
  129. package/dist/provider/singleton/singleton.web.d.ts +11 -0
  130. package/dist/provider/singleton/singleton.web.d.ts.map +1 -0
  131. package/dist/provider/singleton/singleton.web.js +36 -0
  132. package/dist/provider/singleton/singleton.web.js.map +1 -0
  133. package/dist/provider/singleton/types.d.ts +26 -0
  134. package/dist/provider/singleton/types.d.ts.map +1 -0
  135. package/dist/provider/singleton/types.js +17 -0
  136. package/dist/provider/singleton/types.js.map +1 -0
  137. package/dist/resource-cache/index.d.ts +2 -0
  138. package/dist/resource-cache/index.d.ts.map +1 -0
  139. package/dist/resource-cache/index.js +29 -0
  140. package/dist/resource-cache/index.js.map +1 -0
  141. package/dist/resource-cache/resource-cache.d.ts +17 -0
  142. package/dist/resource-cache/resource-cache.d.ts.map +1 -0
  143. package/dist/resource-cache/resource-cache.js +154 -0
  144. package/dist/resource-cache/resource-cache.js.map +1 -0
  145. package/dist/secure-store/index.d.ts +6 -0
  146. package/dist/secure-store/index.d.ts.map +1 -0
  147. package/dist/secure-store/index.js +30 -0
  148. package/dist/secure-store/index.js.map +1 -0
  149. package/dist/token-cache/index.d.ts +16 -0
  150. package/dist/token-cache/index.d.ts.map +1 -0
  151. package/dist/token-cache/index.js +66 -0
  152. package/dist/token-cache/index.js.map +1 -0
  153. package/dist/utils/errors.d.ts +2 -0
  154. package/dist/utils/errors.d.ts.map +1 -0
  155. package/dist/utils/errors.js +30 -0
  156. package/dist/utils/errors.js.map +1 -0
  157. package/dist/utils/index.d.ts +3 -0
  158. package/dist/utils/index.d.ts.map +1 -0
  159. package/dist/utils/index.js +25 -0
  160. package/dist/utils/index.js.map +1 -0
  161. package/dist/utils/runtime.d.ts +10 -0
  162. package/dist/utils/runtime.d.ts.map +1 -0
  163. package/dist/utils/runtime.js +47 -0
  164. package/dist/utils/runtime.js.map +1 -0
  165. package/dist/web/index.d.ts +3 -0
  166. package/dist/web/index.d.ts.map +1 -0
  167. package/dist/web/index.js +25 -0
  168. package/dist/web/index.js.map +1 -0
  169. package/dist/web/uiComponents.d.ts +18 -0
  170. package/dist/web/uiComponents.d.ts.map +1 -0
  171. package/dist/web/uiComponents.js +88 -0
  172. package/dist/web/uiComponents.js.map +1 -0
  173. package/package.json +138 -0
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
17
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/provider/singleton/types.ts"],"sourcesContent":["import type {\n CredentialReturn,\n PublicKeyCredentialCreationOptionsWithoutExtensions,\n PublicKeyCredentialRequestOptionsWithoutExtensions,\n PublicKeyCredentialWithAuthenticatorAssertionResponse,\n PublicKeyCredentialWithAuthenticatorAttestationResponse,\n} from '@clerk/shared/types';\n\nimport type { TokenCache } from '../../cache/types';\n\nexport interface IStorage {\n set: (key: string, value: string) => Promise<void>;\n get: (key: string) => Promise<string | null>;\n}\n\nexport type BuildClerkOptions = {\n publishableKey?: string;\n tokenCache?: TokenCache;\n /**\n * Note: Passkey support in Expo is currently in a limited rollout phase.\n * If you're interested in using this feature, please contact us for early access or additional details.\n *\n * @experimental This API is experimental and may change at any moment.\n */\n __experimental_passkeys?: {\n get: ({\n publicKeyOptions,\n }: {\n publicKeyOptions: PublicKeyCredentialRequestOptionsWithoutExtensions;\n }) => Promise<CredentialReturn<PublicKeyCredentialWithAuthenticatorAssertionResponse>>;\n create: (\n publicKeyCredential: PublicKeyCredentialCreationOptionsWithoutExtensions,\n ) => Promise<CredentialReturn<PublicKeyCredentialWithAuthenticatorAttestationResponse>>;\n isSupported: () => boolean;\n isAutoFillSupported: () => Promise<boolean>;\n };\n __experimental_resourceCache?: () => IStorage;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,2 @@
1
+ export { createResourceCacheStore as resourceCache } from './resource-cache';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resource-cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var resource_cache_exports = {};
20
+ __export(resource_cache_exports, {
21
+ resourceCache: () => import_resource_cache.createResourceCacheStore
22
+ });
23
+ module.exports = __toCommonJS(resource_cache_exports);
24
+ var import_resource_cache = require("./resource-cache");
25
+ // Annotate the CommonJS export names for ESM import in node:
26
+ 0 && (module.exports = {
27
+ resourceCache
28
+ });
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/resource-cache/index.ts"],"sourcesContent":["export { createResourceCacheStore as resourceCache } from './resource-cache';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA0D;","names":[]}
@@ -0,0 +1,17 @@
1
+ import type { IStorage } from '../provider/singleton/types';
2
+ /**
3
+ * Creates a store based on expo-secure-store, that handles the 2048 size limit on values.
4
+ *
5
+ * The store uses a queue to manage multiple save requests and two slots (A and B) to store the key-value pairs.
6
+ * The function alternates between the two slots to save the key-value pairs and splits the value into chunks to save them.
7
+ * The two slots are used to handle corrupted data or incomplete saves.
8
+ *
9
+ * The keys used are the following:
10
+ * - key-latest -> 'A'/'B'
11
+ * - key-{A/B}-metadata -> Metadata
12
+ * - key-{A/B}-chunk-{i} -> data chunk
13
+ * - key-{A/B}-complete -> 'true'/'false'
14
+ *
15
+ **/
16
+ export declare const createResourceCacheStore: () => IStorage;
17
+ //# sourceMappingURL=resource-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-cache.d.ts","sourceRoot":"","sources":["../../src/resource-cache/resource-cache.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAa5D;;;;;;;;;;;;;IAaI;AACJ,eAAO,MAAM,wBAAwB,QAAO,QAkI3C,CAAC"}
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var resource_cache_exports = {};
30
+ __export(resource_cache_exports, {
31
+ createResourceCacheStore: () => createResourceCacheStore
32
+ });
33
+ module.exports = __toCommonJS(resource_cache_exports);
34
+ var SecureStore = __toESM(require("expo-secure-store"));
35
+ const CLERK_DEFAULT_CHUNK_SIZE = 1024;
36
+ const createResourceCacheStore = () => {
37
+ let queue = [];
38
+ let isProcessing = false;
39
+ const secureStoreOpts = {
40
+ /**
41
+ * The data in the keychain item cannot be accessed after a restart until the
42
+ * device has been unlocked once by the user.
43
+ *
44
+ * This may be useful if you need to access the item when the phone is locked.
45
+ */
46
+ keychainAccessible: SecureStore.AFTER_FIRST_UNLOCK
47
+ };
48
+ const setItem = (key, value) => SecureStore.setItemAsync(key, value, secureStoreOpts);
49
+ const getItem = (key) => SecureStore.getItemAsync(key, secureStoreOpts);
50
+ const deleteItem = (key) => SecureStore.deleteItemAsync(key, secureStoreOpts);
51
+ const set = (key, value) => {
52
+ queue.push({ key, value });
53
+ void processQueue();
54
+ return Promise.resolve();
55
+ };
56
+ const processQueue = async () => {
57
+ if (isProcessing || queue.length === 0) {
58
+ return;
59
+ }
60
+ isProcessing = true;
61
+ const item = queue.pop();
62
+ if (!item) {
63
+ isProcessing = false;
64
+ return;
65
+ }
66
+ queue = [];
67
+ try {
68
+ const latestKey = `${item.key}-latest`;
69
+ const latestSlot = await getItem(latestKey) || "A";
70
+ const targetSlot = latestSlot === "A" ? "B" : "A";
71
+ await performSet(item.key, item.value, targetSlot);
72
+ await setItem(latestKey, targetSlot);
73
+ isProcessing = false;
74
+ } catch (err) {
75
+ isProcessing = false;
76
+ throw err;
77
+ } finally {
78
+ void processQueue();
79
+ }
80
+ };
81
+ const performSet = async (key, value, slot) => {
82
+ const slotKey = `${key}-${slot}`;
83
+ const chunks = splitIntoChunks(value);
84
+ const metadataKey = `${slotKey}-metadata`;
85
+ await setItem(`${slotKey}-complete`, "false");
86
+ for (let i = 0; i < chunks.length; i++) {
87
+ const chunkKey = `${slotKey}-chunk-${i}`;
88
+ await setItem(chunkKey, chunks[i]);
89
+ }
90
+ const oldMetadataString = await getItem(metadataKey);
91
+ if (oldMetadataString) {
92
+ const oldMetadata = JSON.parse(oldMetadataString);
93
+ for (let i = chunks.length; i < oldMetadata.totalChunks; i++) {
94
+ const chunkKey = `${slotKey}-chunk-${i}`;
95
+ await deleteItem(chunkKey);
96
+ }
97
+ }
98
+ const metadata = { totalChunks: chunks.length };
99
+ await setItem(metadataKey, JSON.stringify(metadata));
100
+ await setItem(`${slotKey}-complete`, "true");
101
+ };
102
+ const get = async (key) => {
103
+ const latestKey = `${key}-latest`;
104
+ const latestSlot = await getItem(latestKey) || "A";
105
+ const latestValue = await getSlot(`${key}-${latestSlot}`);
106
+ if (latestValue !== null) {
107
+ return latestValue;
108
+ }
109
+ const fallbackSlot = latestSlot === "A" ? "B" : "A";
110
+ return await getSlot(`${key}-${fallbackSlot}`);
111
+ };
112
+ const getSlot = async (slotKey) => {
113
+ const metadataKey = `${slotKey}-metadata`;
114
+ const isComplete = await getItem(`${slotKey}-complete`);
115
+ if (isComplete !== "true") {
116
+ return null;
117
+ }
118
+ const metadataString = await getItem(metadataKey);
119
+ if (!metadataString) {
120
+ return null;
121
+ }
122
+ const metadata = JSON.parse(metadataString);
123
+ if (!metadata) {
124
+ return null;
125
+ }
126
+ const chunks = [];
127
+ for (let i = 0; i < metadata.totalChunks; i++) {
128
+ const chunkKey = `${slotKey}-chunk-${i}`;
129
+ const chunk = await getItem(chunkKey);
130
+ if (!chunk) {
131
+ return null;
132
+ }
133
+ chunks.push(chunk);
134
+ }
135
+ return chunks.join("");
136
+ };
137
+ return {
138
+ set,
139
+ get
140
+ };
141
+ };
142
+ const splitIntoChunks = (value, chunkSize = CLERK_DEFAULT_CHUNK_SIZE) => {
143
+ const characters = Array.from(value);
144
+ const chunks = [];
145
+ for (let i = 0; i < characters.length; i += chunkSize) {
146
+ chunks.push(characters.slice(i, i + chunkSize).join(""));
147
+ }
148
+ return chunks;
149
+ };
150
+ // Annotate the CommonJS export names for ESM import in node:
151
+ 0 && (module.exports = {
152
+ createResourceCacheStore
153
+ });
154
+ //# sourceMappingURL=resource-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/resource-cache/resource-cache.ts"],"sourcesContent":["import * as SecureStore from 'expo-secure-store';\n\nimport type { IStorage } from '../provider/singleton/types';\n\nconst CLERK_DEFAULT_CHUNK_SIZE = 1024;\n\ntype KeyValuePair = {\n key: string;\n value: string;\n};\n\ntype Metadata = {\n totalChunks: number;\n};\n\n/**\n * Creates a store based on expo-secure-store, that handles the 2048 size limit on values.\n *\n * The store uses a queue to manage multiple save requests and two slots (A and B) to store the key-value pairs.\n * The function alternates between the two slots to save the key-value pairs and splits the value into chunks to save them.\n * The two slots are used to handle corrupted data or incomplete saves.\n *\n * The keys used are the following:\n * - key-latest -> 'A'/'B'\n * - key-{A/B}-metadata -> Metadata\n * - key-{A/B}-chunk-{i} -> data chunk\n * - key-{A/B}-complete -> 'true'/'false'\n *\n **/\nexport const createResourceCacheStore = (): IStorage => {\n let queue: KeyValuePair[] = [];\n let isProcessing = false;\n\n const secureStoreOpts: SecureStore.SecureStoreOptions = {\n /**\n * The data in the keychain item cannot be accessed after a restart until the\n * device has been unlocked once by the user.\n *\n * This may be useful if you need to access the item when the phone is locked.\n */\n keychainAccessible: SecureStore.AFTER_FIRST_UNLOCK,\n };\n const setItem = (key: string, value: string) => SecureStore.setItemAsync(key, value, secureStoreOpts);\n const getItem = (key: string) => SecureStore.getItemAsync(key, secureStoreOpts);\n const deleteItem = (key: string) => SecureStore.deleteItemAsync(key, secureStoreOpts);\n\n const set = (key: string, value: string): Promise<void> => {\n queue.push({ key, value });\n void processQueue();\n return Promise.resolve();\n };\n\n const processQueue = async (): Promise<void> => {\n if (isProcessing || queue.length === 0) {\n return;\n }\n\n isProcessing = true;\n const item = queue.pop();\n if (!item) {\n isProcessing = false;\n return;\n }\n queue = [];\n\n try {\n const latestKey = `${item.key}-latest`;\n const latestSlot = (await getItem(latestKey)) || 'A';\n const targetSlot = latestSlot === 'A' ? 'B' : 'A';\n\n await performSet(item.key, item.value, targetSlot);\n await setItem(latestKey, targetSlot);\n isProcessing = false;\n } catch (err) {\n isProcessing = false;\n throw err;\n } finally {\n void processQueue();\n }\n };\n\n const performSet = async (key: string, value: string, slot: string): Promise<void> => {\n const slotKey = `${key}-${slot}`;\n const chunks = splitIntoChunks(value);\n const metadataKey = `${slotKey}-metadata`;\n\n // before saving new chunks, mark the slot as incomplete\n await setItem(`${slotKey}-complete`, 'false');\n\n // save the chunks\n for (let i = 0; i < chunks.length; i++) {\n const chunkKey = `${slotKey}-chunk-${i}`;\n await setItem(chunkKey, chunks[i]);\n }\n\n // delete any extra chunks from previous saved value\n const oldMetadataString = await getItem(metadataKey);\n if (oldMetadataString) {\n const oldMetadata: Metadata = JSON.parse(oldMetadataString);\n for (let i = chunks.length; i < oldMetadata.totalChunks; i++) {\n const chunkKey = `${slotKey}-chunk-${i}`;\n await deleteItem(chunkKey);\n }\n }\n\n // save metadata\n const metadata: Metadata = { totalChunks: chunks.length };\n await setItem(metadataKey, JSON.stringify(metadata));\n\n // mark the slot as complete\n await setItem(`${slotKey}-complete`, 'true');\n };\n\n const get = async (key: string): Promise<string | null> => {\n const latestKey = `${key}-latest`;\n const latestSlot = (await getItem(latestKey)) || 'A';\n\n const latestValue = await getSlot(`${key}-${latestSlot}`);\n if (latestValue !== null) {\n return latestValue;\n }\n\n const fallbackSlot = latestSlot === 'A' ? 'B' : 'A';\n return await getSlot(`${key}-${fallbackSlot}`);\n };\n\n const getSlot = async (slotKey: string): Promise<string | null> => {\n const metadataKey = `${slotKey}-metadata`;\n const isComplete = await getItem(`${slotKey}-complete`);\n if (isComplete !== 'true') {\n return null;\n }\n\n const metadataString = await getItem(metadataKey);\n if (!metadataString) {\n return null;\n }\n const metadata: Metadata = JSON.parse(metadataString);\n if (!metadata) {\n return null;\n }\n\n const chunks = [];\n for (let i = 0; i < metadata.totalChunks; i++) {\n const chunkKey = `${slotKey}-chunk-${i}`;\n const chunk = await getItem(chunkKey);\n if (!chunk) {\n return null;\n }\n chunks.push(chunk);\n }\n\n return chunks.join('');\n };\n\n return {\n set,\n get,\n };\n};\n\nconst splitIntoChunks = (value: string, chunkSize = CLERK_DEFAULT_CHUNK_SIZE): string[] => {\n // Array.from is used to handle unicode characters correctly\n const characters = Array.from(value);\n\n const chunks: string[] = [];\n for (let i = 0; i < characters.length; i += chunkSize) {\n chunks.push(characters.slice(i, i + chunkSize).join(''));\n }\n return chunks;\n};\n"],"mappings":"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","names":[]}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @deprecated Use `resourceCache` from `@clerk/expo/resource-cache` instead.
3
+ */
4
+ declare const secureStore: () => import("../provider/singleton/types").IStorage;
5
+ export { secureStore };
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/secure-store/index.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,QAAA,MAAM,WAAW,sDAAgB,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var secure_store_exports = {};
20
+ __export(secure_store_exports, {
21
+ secureStore: () => secureStore
22
+ });
23
+ module.exports = __toCommonJS(secure_store_exports);
24
+ var import_resource_cache = require("../resource-cache");
25
+ const secureStore = import_resource_cache.resourceCache;
26
+ // Annotate the CommonJS export names for ESM import in node:
27
+ 0 && (module.exports = {
28
+ secureStore
29
+ });
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/secure-store/index.ts"],"sourcesContent":["import { resourceCache } from '../resource-cache';\n\n/**\n * @deprecated Use `resourceCache` from `@clerk/expo/resource-cache` instead.\n */\nconst secureStore = resourceCache;\n\nexport { secureStore };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA8B;AAK9B,MAAM,cAAc;","names":[]}
@@ -0,0 +1,16 @@
1
+ import type { TokenCache } from '../cache';
2
+ /**
3
+ * Secure token cache implementation for Expo apps.
4
+ *
5
+ * Clerk stores the active user's session token in memory by default. In Expo apps, the
6
+ * recommended way to store sensitive data, such as tokens, is by using `expo-secure-store`
7
+ * which encrypts the data before storing it.
8
+ *
9
+ * To implement your own token cache, create an object that implements the `TokenCache` interface:
10
+ * - `getToken(key: string): Promise<string | null>`
11
+ * - `saveToken(key: string, token: string): Promise<void>`
12
+ *
13
+ * @type {TokenCache | undefined} Object with `getToken` and `saveToken` methods, undefined on web
14
+ */
15
+ export declare const tokenCache: TokenCache | undefined;
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/token-cache/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAiC3C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,wBAA8C,CAAC"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var token_cache_exports = {};
30
+ __export(token_cache_exports, {
31
+ tokenCache: () => tokenCache
32
+ });
33
+ module.exports = __toCommonJS(token_cache_exports);
34
+ var SecureStore = __toESM(require("expo-secure-store"));
35
+ var import_utils = require("../utils");
36
+ const createTokenCache = () => {
37
+ const secureStoreOpts = {
38
+ /**
39
+ * The data in the keychain item cannot be accessed after a restart until the
40
+ * device has been unlocked once by the user.
41
+ *
42
+ * This may be useful if you need to access the item when the phone is locked.
43
+ */
44
+ keychainAccessible: SecureStore.AFTER_FIRST_UNLOCK
45
+ };
46
+ return {
47
+ getToken: async (key) => {
48
+ try {
49
+ const item = await SecureStore.getItemAsync(key, secureStoreOpts);
50
+ return item;
51
+ } catch {
52
+ await SecureStore.deleteItemAsync(key, secureStoreOpts);
53
+ return null;
54
+ }
55
+ },
56
+ saveToken: (key, token) => {
57
+ return SecureStore.setItemAsync(key, token, secureStoreOpts);
58
+ }
59
+ };
60
+ };
61
+ const tokenCache = (0, import_utils.isNative)() ? createTokenCache() : void 0;
62
+ // Annotate the CommonJS export names for ESM import in node:
63
+ 0 && (module.exports = {
64
+ tokenCache
65
+ });
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/token-cache/index.ts"],"sourcesContent":["import * as SecureStore from 'expo-secure-store';\n\nimport type { TokenCache } from '../cache';\nimport { isNative } from '../utils';\n\n/**\n * Create a token cache using Expo's SecureStore\n */\nconst createTokenCache = (): TokenCache => {\n const secureStoreOpts: SecureStore.SecureStoreOptions = {\n /**\n * The data in the keychain item cannot be accessed after a restart until the\n * device has been unlocked once by the user.\n *\n * This may be useful if you need to access the item when the phone is locked.\n */\n keychainAccessible: SecureStore.AFTER_FIRST_UNLOCK,\n };\n\n return {\n getToken: async (key: string) => {\n try {\n const item = await SecureStore.getItemAsync(key, secureStoreOpts);\n return item;\n } catch {\n await SecureStore.deleteItemAsync(key, secureStoreOpts);\n return null;\n }\n },\n saveToken: (key: string, token: string) => {\n return SecureStore.setItemAsync(key, token, secureStoreOpts);\n },\n };\n};\n\n/**\n * Secure token cache implementation for Expo apps.\n *\n * Clerk stores the active user's session token in memory by default. In Expo apps, the\n * recommended way to store sensitive data, such as tokens, is by using `expo-secure-store`\n * which encrypts the data before storing it.\n *\n * To implement your own token cache, create an object that implements the `TokenCache` interface:\n * - `getToken(key: string): Promise<string | null>`\n * - `saveToken(key: string, token: string): Promise<void>`\n *\n * @type {TokenCache | undefined} Object with `getToken` and `saveToken` methods, undefined on web\n */\nexport const tokenCache = isNative() ? createTokenCache() : undefined;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;AAG7B,mBAAyB;AAKzB,MAAM,mBAAmB,MAAkB;AACzC,QAAM,kBAAkD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOtD,oBAAoB,YAAY;AAAA,EAClC;AAEA,SAAO;AAAA,IACL,UAAU,OAAO,QAAgB;AAC/B,UAAI;AACF,cAAM,OAAO,MAAM,YAAY,aAAa,KAAK,eAAe;AAChE,eAAO;AAAA,MACT,QAAQ;AACN,cAAM,YAAY,gBAAgB,KAAK,eAAe;AACtD,eAAO;AAAA,MACT;AAAA,IACF;AAAA,IACA,WAAW,CAAC,KAAa,UAAkB;AACzC,aAAO,YAAY,aAAa,KAAK,OAAO,eAAe;AAAA,IAC7D;AAAA,EACF;AACF;AAeO,MAAM,iBAAa,uBAAS,IAAI,iBAAiB,IAAI;","names":[]}
@@ -0,0 +1,2 @@
1
+ export declare const errorThrower: import("@clerk/shared/error-Bc5uNJC6").v;
2
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,0CAAmD,CAAC"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var errors_exports = {};
20
+ __export(errors_exports, {
21
+ errorThrower: () => errorThrower
22
+ });
23
+ module.exports = __toCommonJS(errors_exports);
24
+ var import_error = require("@clerk/shared/error");
25
+ const errorThrower = (0, import_error.buildErrorThrower)({ packageName: "@clerk/expo" });
26
+ // Annotate the CommonJS export names for ESM import in node:
27
+ 0 && (module.exports = {
28
+ errorThrower
29
+ });
30
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/errors.ts"],"sourcesContent":["import { buildErrorThrower } from '@clerk/shared/error';\n\nexport const errorThrower = buildErrorThrower({ packageName: PACKAGE_NAME });\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkC;AAE3B,MAAM,mBAAe,gCAAkB,EAAE,aAAa,cAAa,CAAC;","names":[]}
@@ -0,0 +1,3 @@
1
+ export * from './errors';
2
+ export * from './runtime';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var utils_exports = {};
17
+ module.exports = __toCommonJS(utils_exports);
18
+ __reExport(utils_exports, require("./errors"), module.exports);
19
+ __reExport(utils_exports, require("./runtime"), module.exports);
20
+ // Annotate the CommonJS export names for ESM import in node:
21
+ 0 && (module.exports = {
22
+ ...require("./errors"),
23
+ ...require("./runtime")
24
+ });
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './errors';\nexport * from './runtime';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,qBAAd;AACA,0BAAc,sBADd;","names":[]}
@@ -0,0 +1,10 @@
1
+ export declare function isWeb(): boolean;
2
+ export declare function isNative(): boolean;
3
+ export declare function isHermes(): boolean;
4
+ export declare function reactNativeVersion(): {
5
+ major: number;
6
+ minor: number;
7
+ patch: number;
8
+ prerelease?: string | null | undefined;
9
+ };
10
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/utils/runtime.ts"],"names":[],"mappings":"AAEA,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB,QAAQ,YAGvB;AAED,wBAAgB,kBAAkB;;;;;EAEjC"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var runtime_exports = {};
20
+ __export(runtime_exports, {
21
+ isHermes: () => isHermes,
22
+ isNative: () => isNative,
23
+ isWeb: () => isWeb,
24
+ reactNativeVersion: () => reactNativeVersion
25
+ });
26
+ module.exports = __toCommonJS(runtime_exports);
27
+ var import_react_native = require("react-native");
28
+ function isWeb() {
29
+ return import_react_native.Platform.OS === "web";
30
+ }
31
+ function isNative() {
32
+ return !isWeb();
33
+ }
34
+ function isHermes() {
35
+ return !!global.HermesInternal;
36
+ }
37
+ function reactNativeVersion() {
38
+ return import_react_native.Platform.constants.reactNativeVersion;
39
+ }
40
+ // Annotate the CommonJS export names for ESM import in node:
41
+ 0 && (module.exports = {
42
+ isHermes,
43
+ isNative,
44
+ isWeb,
45
+ reactNativeVersion
46
+ });
47
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/runtime.ts"],"sourcesContent":["import { Platform } from 'react-native';\n\nexport function isWeb(): boolean {\n return Platform.OS === 'web';\n}\n\nexport function isNative(): boolean {\n return !isWeb();\n}\n\nexport function isHermes() {\n //@ts-expect-error HermesInternal is added only added by the Hermes JS Engine\n return !!global.HermesInternal;\n}\n\nexport function reactNativeVersion() {\n return Platform.constants.reactNativeVersion;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAyB;AAElB,SAAS,QAAiB;AAC/B,SAAO,6BAAS,OAAO;AACzB;AAEO,SAAS,WAAoB;AAClC,SAAO,CAAC,MAAM;AAChB;AAEO,SAAS,WAAW;AAEzB,SAAO,CAAC,CAAC,OAAO;AAClB;AAEO,SAAS,qBAAqB;AACnC,SAAO,6BAAS,UAAU;AAC5B;","names":[]}
@@ -0,0 +1,3 @@
1
+ export * from '../components';
2
+ export * from './uiComponents';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var web_exports = {};
17
+ module.exports = __toCommonJS(web_exports);
18
+ __reExport(web_exports, require("../components"), module.exports);
19
+ __reExport(web_exports, require("./uiComponents"), module.exports);
20
+ // Annotate the CommonJS export names for ESM import in node:
21
+ 0 && (module.exports = {
22
+ ...require("../components"),
23
+ ...require("./uiComponents")
24
+ });
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/web/index.ts"],"sourcesContent":["export * from '../components';\nexport * from './uiComponents';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,0BAAd;AACA,wBAAc,2BADd;","names":[]}
@@ -0,0 +1,18 @@
1
+ import { CreateOrganization as BaseCreateOrganization, GoogleOneTap as BaseGoogleOneTap, OrganizationList as BaseOrganizationList, OrganizationProfile as BaseOrganizationProfile, OrganizationSwitcher as BaseOrganizationSwitcher, PricingTable as BasePricingTable, SignIn as BaseSignIn, SignInButton as BaseSignInButton, SignInWithMetamaskButton as BaseSignInWithMetamaskButton, SignOutButton as BaseSignOutButton, SignUp as BaseSignUp, SignUpButton as BaseSignUpButton, UserAvatar as BaseUserAvatar, UserButton as BaseUserButton, UserProfile as BaseUserProfile, Waitlist as BaseWaitlist } from '@clerk/react';
2
+ export declare const SignIn: typeof BaseSignIn;
3
+ export declare const SignUp: typeof BaseSignUp;
4
+ export declare const UserAvatar: typeof BaseUserAvatar;
5
+ export declare const UserButton: typeof BaseUserButton;
6
+ export declare const UserProfile: typeof BaseUserProfile;
7
+ export declare const OrganizationProfile: typeof BaseOrganizationProfile;
8
+ export declare const OrganizationSwitcher: typeof BaseOrganizationSwitcher;
9
+ export declare const OrganizationList: typeof BaseOrganizationList;
10
+ export declare const CreateOrganization: typeof BaseCreateOrganization;
11
+ export declare const SignInButton: typeof BaseSignInButton;
12
+ export declare const SignUpButton: typeof BaseSignUpButton;
13
+ export declare const SignOutButton: typeof BaseSignOutButton;
14
+ export declare const SignInWithMetamaskButton: typeof BaseSignInWithMetamaskButton;
15
+ export declare const GoogleOneTap: typeof BaseGoogleOneTap;
16
+ export declare const Waitlist: typeof BaseWaitlist;
17
+ export declare const PricingTable: typeof BasePricingTable;
18
+ //# sourceMappingURL=uiComponents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uiComponents.d.ts","sourceRoot":"","sources":["../../src/web/uiComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,IAAI,sBAAsB,EAC5C,YAAY,IAAI,gBAAgB,EAChC,gBAAgB,IAAI,oBAAoB,EACxC,mBAAmB,IAAI,uBAAuB,EAC9C,oBAAoB,IAAI,wBAAwB,EAChD,YAAY,IAAI,gBAAgB,EAChC,MAAM,IAAI,UAAU,EACpB,YAAY,IAAI,gBAAgB,EAChC,wBAAwB,IAAI,4BAA4B,EACxD,aAAa,IAAI,iBAAiB,EAClC,MAAM,IAAI,UAAU,EACpB,YAAY,IAAI,gBAAgB,EAChC,UAAU,IAAI,cAAc,EAC5B,UAAU,IAAI,cAAc,EAC5B,WAAW,IAAI,eAAe,EAC9B,QAAQ,IAAI,YAAY,EACzB,MAAM,cAAc,CAAC;AAoBtB,eAAO,MAAM,MAAM,EAAE,OAAO,UAAsC,CAAC;AACnE,eAAO,MAAM,MAAM,EAAE,OAAO,UAAsC,CAAC;AAEnE,eAAO,MAAM,UAAU,EAAE,OAAO,cAA8C,CAAC;AAC/E,eAAO,MAAM,UAAU,EAAE,OAAO,cAA8C,CAAC;AAC/E,eAAO,MAAM,WAAW,EAAE,OAAO,eAAgD,CAAC;AAElF,eAAO,MAAM,mBAAmB,EAAE,OAAO,uBAAgE,CAAC;AAC1G,eAAO,MAAM,oBAAoB,EAAE,OAAO,wBAAkE,CAAC;AAC7G,eAAO,MAAM,gBAAgB,EAAE,OAAO,oBAA0D,CAAC;AACjG,eAAO,MAAM,kBAAkB,EAAE,OAAO,sBAA8D,CAAC;AAEvG,eAAO,MAAM,YAAY,EAAE,OAAO,gBAAkD,CAAC;AACrF,eAAO,MAAM,YAAY,EAAE,OAAO,gBAAkD,CAAC;AACrF,eAAO,MAAM,aAAa,EAAE,OAAO,iBAAoD,CAAC;AACxF,eAAO,MAAM,wBAAwB,EAAE,OAAO,4BACD,CAAC;AAC9C,eAAO,MAAM,YAAY,EAAE,OAAO,gBAAkD,CAAC;AACrF,eAAO,MAAM,QAAQ,EAAE,OAAO,YAA0C,CAAC;AACzE,eAAO,MAAM,YAAY,EAAE,OAAO,gBAAkD,CAAC"}