@harkenapp/sdk-react-native 0.0.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/README.md +67 -0
  2. package/app.plugin.cjs +135 -0
  3. package/app.plugin.js +1 -0
  4. package/dist/api/client.d.ts +67 -0
  5. package/dist/api/client.d.ts.map +1 -0
  6. package/dist/api/client.js +163 -0
  7. package/dist/api/client.js.map +1 -0
  8. package/dist/api/errors.d.ts +46 -0
  9. package/dist/api/errors.d.ts.map +1 -0
  10. package/dist/api/errors.js +72 -0
  11. package/dist/api/errors.js.map +1 -0
  12. package/dist/api/index.d.ts +7 -0
  13. package/dist/api/index.d.ts.map +1 -0
  14. package/dist/api/index.js +20 -0
  15. package/dist/api/index.js.map +1 -0
  16. package/dist/api/retry.d.ts +29 -0
  17. package/dist/api/retry.d.ts.map +1 -0
  18. package/dist/api/retry.js +74 -0
  19. package/dist/api/retry.js.map +1 -0
  20. package/dist/attachments/FeedbackSheet.d.ts +88 -0
  21. package/dist/attachments/FeedbackSheet.d.ts.map +1 -0
  22. package/dist/attachments/FeedbackSheet.js +250 -0
  23. package/dist/attachments/FeedbackSheet.js.map +1 -0
  24. package/dist/attachments/index.d.ts +20 -0
  25. package/dist/attachments/index.d.ts.map +1 -0
  26. package/dist/attachments/index.js +40 -0
  27. package/dist/attachments/index.js.map +1 -0
  28. package/dist/components/AttachmentGrid.d.ts +94 -0
  29. package/dist/components/AttachmentGrid.d.ts.map +1 -0
  30. package/dist/components/AttachmentGrid.js +132 -0
  31. package/dist/components/AttachmentGrid.js.map +1 -0
  32. package/dist/components/AttachmentPicker.d.ts +98 -0
  33. package/dist/components/AttachmentPicker.d.ts.map +1 -0
  34. package/dist/components/AttachmentPicker.js +297 -0
  35. package/dist/components/AttachmentPicker.js.map +1 -0
  36. package/dist/components/AttachmentPreview.d.ts +78 -0
  37. package/dist/components/AttachmentPreview.d.ts.map +1 -0
  38. package/dist/components/AttachmentPreview.js +133 -0
  39. package/dist/components/AttachmentPreview.js.map +1 -0
  40. package/dist/components/CategorySelector.d.ts +77 -0
  41. package/dist/components/CategorySelector.d.ts.map +1 -0
  42. package/dist/components/CategorySelector.js +117 -0
  43. package/dist/components/CategorySelector.js.map +1 -0
  44. package/dist/components/FeedbackForm.d.ts +50 -0
  45. package/dist/components/FeedbackForm.d.ts.map +1 -0
  46. package/dist/components/FeedbackForm.js +141 -0
  47. package/dist/components/FeedbackForm.js.map +1 -0
  48. package/dist/components/FeedbackSheet.d.ts +75 -0
  49. package/dist/components/FeedbackSheet.d.ts.map +1 -0
  50. package/dist/components/FeedbackSheet.js +215 -0
  51. package/dist/components/FeedbackSheet.js.map +1 -0
  52. package/dist/components/ThemedButton.d.ts +23 -0
  53. package/dist/components/ThemedButton.d.ts.map +1 -0
  54. package/dist/components/ThemedButton.js +77 -0
  55. package/dist/components/ThemedButton.js.map +1 -0
  56. package/dist/components/ThemedText.d.ts +16 -0
  57. package/dist/components/ThemedText.d.ts.map +1 -0
  58. package/dist/components/ThemedText.js +44 -0
  59. package/dist/components/ThemedText.js.map +1 -0
  60. package/dist/components/ThemedTextInput.d.ts +13 -0
  61. package/dist/components/ThemedTextInput.d.ts.map +1 -0
  62. package/dist/components/ThemedTextInput.js +76 -0
  63. package/dist/components/ThemedTextInput.js.map +1 -0
  64. package/dist/components/UploadStatusOverlay.d.ts +82 -0
  65. package/dist/components/UploadStatusOverlay.d.ts.map +1 -0
  66. package/dist/components/UploadStatusOverlay.js +319 -0
  67. package/dist/components/UploadStatusOverlay.js.map +1 -0
  68. package/dist/components/index.d.ts +19 -0
  69. package/dist/components/index.d.ts.map +1 -0
  70. package/dist/components/index.js +28 -0
  71. package/dist/components/index.js.map +1 -0
  72. package/dist/context/HarkenContext.d.ts +62 -0
  73. package/dist/context/HarkenContext.d.ts.map +1 -0
  74. package/dist/context/HarkenContext.js +128 -0
  75. package/dist/context/HarkenContext.js.map +1 -0
  76. package/dist/context/index.d.ts +3 -0
  77. package/dist/context/index.d.ts.map +1 -0
  78. package/dist/context/index.js +7 -0
  79. package/dist/context/index.js.map +1 -0
  80. package/dist/domain/index.d.ts +3 -0
  81. package/dist/domain/index.d.ts.map +1 -0
  82. package/dist/domain/index.js +7 -0
  83. package/dist/domain/index.js.map +1 -0
  84. package/dist/domain/upload-queue.d.ts +116 -0
  85. package/dist/domain/upload-queue.d.ts.map +1 -0
  86. package/dist/domain/upload-queue.js +34 -0
  87. package/dist/domain/upload-queue.js.map +1 -0
  88. package/dist/hooks/index.d.ts +6 -0
  89. package/dist/hooks/index.d.ts.map +1 -0
  90. package/dist/hooks/index.js +16 -0
  91. package/dist/hooks/index.js.map +1 -0
  92. package/dist/hooks/useAnonymousId.d.ts +28 -0
  93. package/dist/hooks/useAnonymousId.d.ts.map +1 -0
  94. package/dist/hooks/useAnonymousId.js +59 -0
  95. package/dist/hooks/useAnonymousId.js.map +1 -0
  96. package/dist/hooks/useAttachmentPicker.d.ts +84 -0
  97. package/dist/hooks/useAttachmentPicker.d.ts.map +1 -0
  98. package/dist/hooks/useAttachmentPicker.js +181 -0
  99. package/dist/hooks/useAttachmentPicker.js.map +1 -0
  100. package/dist/hooks/useAttachmentStatus.d.ts +51 -0
  101. package/dist/hooks/useAttachmentStatus.d.ts.map +1 -0
  102. package/dist/hooks/useAttachmentStatus.js +69 -0
  103. package/dist/hooks/useAttachmentStatus.js.map +1 -0
  104. package/dist/hooks/useAttachmentUpload.d.ts +101 -0
  105. package/dist/hooks/useAttachmentUpload.d.ts.map +1 -0
  106. package/dist/hooks/useAttachmentUpload.js +293 -0
  107. package/dist/hooks/useAttachmentUpload.js.map +1 -0
  108. package/dist/hooks/useFeedback.d.ts +55 -0
  109. package/dist/hooks/useFeedback.d.ts.map +1 -0
  110. package/dist/hooks/useFeedback.js +96 -0
  111. package/dist/hooks/useFeedback.js.map +1 -0
  112. package/dist/hooks/useHarkenContext.d.ts +25 -0
  113. package/dist/hooks/useHarkenContext.d.ts.map +1 -0
  114. package/dist/hooks/useHarkenContext.js +35 -0
  115. package/dist/hooks/useHarkenContext.js.map +1 -0
  116. package/dist/hooks/useHarkenTheme.d.ts +26 -0
  117. package/dist/hooks/useHarkenTheme.d.ts.map +1 -0
  118. package/dist/hooks/useHarkenTheme.js +36 -0
  119. package/dist/hooks/useHarkenTheme.js.map +1 -0
  120. package/dist/index.d.ts +49 -0
  121. package/dist/index.d.ts.map +1 -0
  122. package/dist/index.js +91 -0
  123. package/dist/index.js.map +1 -0
  124. package/dist/services/index.d.ts +4 -0
  125. package/dist/services/index.d.ts.map +1 -0
  126. package/dist/services/index.js +9 -0
  127. package/dist/services/index.js.map +1 -0
  128. package/dist/services/uploadQueueService.d.ts +193 -0
  129. package/dist/services/uploadQueueService.d.ts.map +1 -0
  130. package/dist/services/uploadQueueService.js +623 -0
  131. package/dist/services/uploadQueueService.js.map +1 -0
  132. package/dist/services/uploadQueueStorage.d.ts +30 -0
  133. package/dist/services/uploadQueueStorage.d.ts.map +1 -0
  134. package/dist/services/uploadQueueStorage.js +77 -0
  135. package/dist/services/uploadQueueStorage.js.map +1 -0
  136. package/dist/storage/IdentityStore.d.ts +38 -0
  137. package/dist/storage/IdentityStore.d.ts.map +1 -0
  138. package/dist/storage/IdentityStore.js +83 -0
  139. package/dist/storage/IdentityStore.js.map +1 -0
  140. package/dist/storage/SecureStoreAdapter.d.ts +28 -0
  141. package/dist/storage/SecureStoreAdapter.d.ts.map +1 -0
  142. package/dist/storage/SecureStoreAdapter.js +52 -0
  143. package/dist/storage/SecureStoreAdapter.js.map +1 -0
  144. package/dist/storage/defaultStorage.d.ts +20 -0
  145. package/dist/storage/defaultStorage.d.ts.map +1 -0
  146. package/dist/storage/defaultStorage.js +131 -0
  147. package/dist/storage/defaultStorage.js.map +1 -0
  148. package/dist/storage/index.d.ts +6 -0
  149. package/dist/storage/index.d.ts.map +1 -0
  150. package/dist/storage/index.js +13 -0
  151. package/dist/storage/index.js.map +1 -0
  152. package/dist/storage/types.d.ts +32 -0
  153. package/dist/storage/types.d.ts.map +1 -0
  154. package/dist/storage/types.js +11 -0
  155. package/dist/storage/types.js.map +1 -0
  156. package/dist/theme/defaults.d.ts +43 -0
  157. package/dist/theme/defaults.d.ts.map +1 -0
  158. package/dist/theme/defaults.js +128 -0
  159. package/dist/theme/defaults.js.map +1 -0
  160. package/dist/theme/index.d.ts +3 -0
  161. package/dist/theme/index.d.ts.map +1 -0
  162. package/dist/theme/index.js +14 -0
  163. package/dist/theme/index.js.map +1 -0
  164. package/dist/theme/types.d.ts +136 -0
  165. package/dist/theme/types.d.ts.map +1 -0
  166. package/dist/theme/types.js +3 -0
  167. package/dist/theme/types.js.map +1 -0
  168. package/dist/types/config.d.ts +100 -0
  169. package/dist/types/config.d.ts.map +1 -0
  170. package/dist/types/config.js +3 -0
  171. package/dist/types/config.js.map +1 -0
  172. package/dist/types/index.d.ts +3 -0
  173. package/dist/types/index.d.ts.map +1 -0
  174. package/dist/types/index.js +3 -0
  175. package/dist/types/index.js.map +1 -0
  176. package/dist/types/openapi.d.ts +601 -0
  177. package/dist/types/openapi.d.ts.map +1 -0
  178. package/dist/types/openapi.js +7 -0
  179. package/dist/types/openapi.js.map +1 -0
  180. package/dist/utils/index.d.ts +2 -0
  181. package/dist/utils/index.d.ts.map +1 -0
  182. package/dist/utils/index.js +6 -0
  183. package/dist/utils/index.js.map +1 -0
  184. package/dist/utils/uuid.d.ts +10 -0
  185. package/dist/utils/uuid.d.ts.map +1 -0
  186. package/dist/utils/uuid.js +60 -0
  187. package/dist/utils/uuid.js.map +1 -0
  188. package/package.json +124 -0
  189. package/src/@types/expo-file-system-legacy.d.ts +13 -0
  190. package/src/api/client.ts +250 -0
  191. package/src/api/errors.ts +84 -0
  192. package/src/api/index.ts +15 -0
  193. package/src/api/retry.ts +99 -0
  194. package/src/attachments/FeedbackSheet.tsx +400 -0
  195. package/src/attachments/index.ts +70 -0
  196. package/src/components/AttachmentGrid.tsx +247 -0
  197. package/src/components/AttachmentPicker.tsx +391 -0
  198. package/src/components/AttachmentPreview.tsx +210 -0
  199. package/src/components/CategorySelector.tsx +174 -0
  200. package/src/components/FeedbackForm.tsx +216 -0
  201. package/src/components/FeedbackSheet.tsx +321 -0
  202. package/src/components/ThemedButton.tsx +127 -0
  203. package/src/components/ThemedText.tsx +65 -0
  204. package/src/components/ThemedTextInput.tsx +65 -0
  205. package/src/components/UploadStatusOverlay.tsx +440 -0
  206. package/src/components/index.ts +39 -0
  207. package/src/context/HarkenContext.tsx +129 -0
  208. package/src/context/index.ts +2 -0
  209. package/src/domain/index.ts +12 -0
  210. package/src/domain/upload-queue.ts +131 -0
  211. package/src/hooks/index.ts +10 -0
  212. package/src/hooks/useAnonymousId.ts +68 -0
  213. package/src/hooks/useAttachmentPicker.ts +243 -0
  214. package/src/hooks/useAttachmentStatus.ts +86 -0
  215. package/src/hooks/useAttachmentUpload.ts +370 -0
  216. package/src/hooks/useFeedback.ts +139 -0
  217. package/src/hooks/useHarkenContext.ts +35 -0
  218. package/src/hooks/useHarkenTheme.ts +36 -0
  219. package/src/index.ts +168 -0
  220. package/src/services/index.ts +11 -0
  221. package/src/services/uploadQueueService.ts +727 -0
  222. package/src/services/uploadQueueStorage.ts +78 -0
  223. package/src/storage/IdentityStore.ts +89 -0
  224. package/src/storage/SecureStoreAdapter.ts +59 -0
  225. package/src/storage/defaultStorage.ts +109 -0
  226. package/src/storage/index.ts +5 -0
  227. package/src/storage/types.ts +34 -0
  228. package/src/theme/defaults.ts +151 -0
  229. package/src/theme/index.ts +23 -0
  230. package/src/theme/types.ts +157 -0
  231. package/src/types/config.ts +112 -0
  232. package/src/types/index.ts +10 -0
  233. package/src/types/openapi.ts +601 -0
  234. package/src/utils/index.ts +1 -0
  235. package/src/utils/uuid.ts +77 -0
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ /**
3
+ * Persistent storage for the upload queue.
4
+ *
5
+ * Uses AsyncStorage to persist queue state across app restarts.
6
+ */
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.UploadQueueStorage = void 0;
12
+ const async_storage_1 = __importDefault(require("@react-native-async-storage/async-storage"));
13
+ const STORAGE_KEY = '@harkenapp/upload-queue';
14
+ const CURRENT_VERSION = 1;
15
+ /**
16
+ * Manages persistent storage of the upload queue.
17
+ */
18
+ class UploadQueueStorage {
19
+ /**
20
+ * Load queue items from persistent storage.
21
+ * Returns empty array if no queue exists or on error.
22
+ */
23
+ async loadQueue() {
24
+ try {
25
+ const raw = await async_storage_1.default.getItem(STORAGE_KEY);
26
+ if (!raw) {
27
+ return [];
28
+ }
29
+ const parsed = JSON.parse(raw);
30
+ // Handle version migrations
31
+ if (parsed.version !== CURRENT_VERSION) {
32
+ return this.migrateQueue(parsed);
33
+ }
34
+ return parsed.items;
35
+ }
36
+ catch (error) {
37
+ console.error('[UploadQueueStorage] Failed to load queue:', error);
38
+ return [];
39
+ }
40
+ }
41
+ /**
42
+ * Save queue items to persistent storage.
43
+ */
44
+ async saveQueue(items) {
45
+ try {
46
+ const data = {
47
+ version: CURRENT_VERSION,
48
+ items,
49
+ };
50
+ await async_storage_1.default.setItem(STORAGE_KEY, JSON.stringify(data));
51
+ }
52
+ catch (error) {
53
+ console.error('[UploadQueueStorage] Failed to save queue:', error);
54
+ }
55
+ }
56
+ /**
57
+ * Clear all persisted queue data.
58
+ */
59
+ async clearQueue() {
60
+ try {
61
+ await async_storage_1.default.removeItem(STORAGE_KEY);
62
+ }
63
+ catch (error) {
64
+ console.error('[UploadQueueStorage] Failed to clear queue:', error);
65
+ }
66
+ }
67
+ /**
68
+ * Migrate queue data from older versions.
69
+ * For now, unknown versions are reset to empty.
70
+ */
71
+ migrateQueue(data) {
72
+ console.warn(`[UploadQueueStorage] Unknown queue version ${data.version}, resetting`);
73
+ return [];
74
+ }
75
+ }
76
+ exports.UploadQueueStorage = UploadQueueStorage;
77
+ //# sourceMappingURL=uploadQueueStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploadQueueStorage.js","sourceRoot":"","sources":["../../src/services/uploadQueueStorage.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,8FAAqE;AAGrE,MAAM,WAAW,GAAG,yBAAyB,CAAC;AAC9C,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B;;GAEG;AACH,MAAa,kBAAkB;IAC7B;;;OAGG;IACH,KAAK,CAAC,SAAS;QACb,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,uBAAY,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YACpD,IAAI,CAAC,GAAG,EAAE,CAAC;gBACT,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAmB,CAAC;YAEjD,4BAA4B;YAC5B,IAAI,MAAM,CAAC,OAAO,KAAK,eAAe,EAAE,CAAC;gBACvC,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YACnC,CAAC;YAED,OAAO,MAAM,CAAC,KAAK,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,4CAA4C,EAAE,KAAK,CAAC,CAAC;YACnE,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,KAAkB;QAChC,IAAI,CAAC;YACH,MAAM,IAAI,GAAmB;gBAC3B,OAAO,EAAE,eAAe;gBACxB,KAAK;aACN,CAAC;YACF,MAAM,uBAAY,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QAChE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,4CAA4C,EAAE,KAAK,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU;QACd,IAAI,CAAC;YACH,MAAM,uBAAY,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,6CAA6C,EAAE,KAAK,CAAC,CAAC;QACtE,CAAC;IACH,CAAC;IAED;;;OAGG;IACK,YAAY,CAAC,IAAoB;QACvC,OAAO,CAAC,IAAI,CACV,8CAA8C,IAAI,CAAC,OAAO,aAAa,CACxE,CAAC;QACF,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AA9DD,gDA8DC"}
@@ -0,0 +1,38 @@
1
+ import type { SecureStorage } from './types';
2
+ /**
3
+ * Manages anonymous identity persistence.
4
+ *
5
+ * The identity store generates and persists a stable anonymous ID
6
+ * that uniquely identifies the app installation without collecting PII.
7
+ */
8
+ export declare class IdentityStore {
9
+ private storage;
10
+ private cachedAnonId;
11
+ private initPromise;
12
+ constructor(storage: SecureStorage);
13
+ /**
14
+ * Get the anonymous ID, creating one if it doesn't exist.
15
+ *
16
+ * This method is safe to call multiple times concurrently.
17
+ * The ID is cached after first retrieval/creation.
18
+ *
19
+ * @returns The stable anonymous ID for this installation
20
+ */
21
+ getAnonymousId(): Promise<string>;
22
+ /**
23
+ * Initialize the anonymous ID by loading from storage or generating a new one.
24
+ */
25
+ private initializeAnonymousId;
26
+ /**
27
+ * Clear the stored anonymous ID.
28
+ *
29
+ * After calling this, the next call to getAnonymousId will generate a new ID.
30
+ * Use this for "reset" functionality or testing.
31
+ */
32
+ clearAnonymousId(): Promise<void>;
33
+ /**
34
+ * Validate that a string is a valid UUID v4 format.
35
+ */
36
+ private isValidUUID;
37
+ }
38
+ //# sourceMappingURL=IdentityStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentityStore.d.ts","sourceRoot":"","sources":["../../src/storage/IdentityStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,WAAW,CAAgC;gBAEvC,OAAO,EAAE,aAAa;IAIlC;;;;;;;OAOG;IACG,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;IAcvC;;OAEG;YACW,qBAAqB;IAwBnC;;;;;OAKG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAMvC;;OAEG;IACH,OAAO,CAAC,WAAW;CAKpB"}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IdentityStore = void 0;
4
+ const types_1 = require("./types");
5
+ const utils_1 = require("../utils");
6
+ /**
7
+ * Manages anonymous identity persistence.
8
+ *
9
+ * The identity store generates and persists a stable anonymous ID
10
+ * that uniquely identifies the app installation without collecting PII.
11
+ */
12
+ class IdentityStore {
13
+ storage;
14
+ cachedAnonId = null;
15
+ initPromise = null;
16
+ constructor(storage) {
17
+ this.storage = storage;
18
+ }
19
+ /**
20
+ * Get the anonymous ID, creating one if it doesn't exist.
21
+ *
22
+ * This method is safe to call multiple times concurrently.
23
+ * The ID is cached after first retrieval/creation.
24
+ *
25
+ * @returns The stable anonymous ID for this installation
26
+ */
27
+ async getAnonymousId() {
28
+ // Return cached value if available
29
+ if (this.cachedAnonId) {
30
+ return this.cachedAnonId;
31
+ }
32
+ // Ensure only one initialization happens
33
+ if (!this.initPromise) {
34
+ this.initPromise = this.initializeAnonymousId();
35
+ }
36
+ return this.initPromise;
37
+ }
38
+ /**
39
+ * Initialize the anonymous ID by loading from storage or generating a new one.
40
+ */
41
+ async initializeAnonymousId() {
42
+ try {
43
+ // Try to load existing ID
44
+ const existingId = await this.storage.getItem(types_1.STORAGE_KEYS.ANON_ID);
45
+ if (existingId && this.isValidUUID(existingId)) {
46
+ this.cachedAnonId = existingId;
47
+ return existingId;
48
+ }
49
+ // Generate and persist a new ID
50
+ const newId = (0, utils_1.generateUUID)();
51
+ await this.storage.setItem(types_1.STORAGE_KEYS.ANON_ID, newId);
52
+ this.cachedAnonId = newId;
53
+ return newId;
54
+ }
55
+ catch {
56
+ // If storage fails, generate a transient ID
57
+ // This ensures the SDK still works even if storage is unavailable
58
+ const fallbackId = (0, utils_1.generateUUID)();
59
+ this.cachedAnonId = fallbackId;
60
+ return fallbackId;
61
+ }
62
+ }
63
+ /**
64
+ * Clear the stored anonymous ID.
65
+ *
66
+ * After calling this, the next call to getAnonymousId will generate a new ID.
67
+ * Use this for "reset" functionality or testing.
68
+ */
69
+ async clearAnonymousId() {
70
+ this.cachedAnonId = null;
71
+ this.initPromise = null;
72
+ await this.storage.deleteItem(types_1.STORAGE_KEYS.ANON_ID);
73
+ }
74
+ /**
75
+ * Validate that a string is a valid UUID v4 format.
76
+ */
77
+ isValidUUID(value) {
78
+ const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
79
+ return uuidRegex.test(value);
80
+ }
81
+ }
82
+ exports.IdentityStore = IdentityStore;
83
+ //# sourceMappingURL=IdentityStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentityStore.js","sourceRoot":"","sources":["../../src/storage/IdentityStore.ts"],"names":[],"mappings":";;;AACA,mCAAuC;AACvC,oCAAwC;AAExC;;;;;GAKG;AACH,MAAa,aAAa;IAChB,OAAO,CAAgB;IACvB,YAAY,GAAkB,IAAI,CAAC;IACnC,WAAW,GAA2B,IAAI,CAAC;IAEnD,YAAY,OAAsB;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,cAAc;QAClB,mCAAmC;QACnC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,YAAY,CAAC;QAC3B,CAAC;QAED,yCAAyC;QACzC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAClD,CAAC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,qBAAqB;QACjC,IAAI,CAAC;YACH,0BAA0B;YAC1B,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAY,CAAC,OAAO,CAAC,CAAC;YAEpE,IAAI,UAAU,IAAI,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC/C,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;gBAC/B,OAAO,UAAU,CAAC;YACpB,CAAC;YAED,gCAAgC;YAChC,MAAM,KAAK,GAAG,IAAA,oBAAY,GAAE,CAAC;YAC7B,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YACxD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;YAC1B,OAAO,KAAK,CAAC;QACf,CAAC;QAAC,MAAM,CAAC;YACP,4CAA4C;YAC5C,kEAAkE;YAClE,MAAM,UAAU,GAAG,IAAA,oBAAY,GAAE,CAAC;YAClC,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;YAC/B,OAAO,UAAU,CAAC;QACpB,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,gBAAgB;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,oBAAY,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACK,WAAW,CAAC,KAAa;QAC/B,MAAM,SAAS,GACb,wEAAwE,CAAC;QAC3E,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACF;AA9ED,sCA8EC"}
@@ -0,0 +1,28 @@
1
+ import type { SecureStorage } from './types';
2
+ /**
3
+ * Adapter for expo-secure-store.
4
+ *
5
+ * This adapter wraps expo-secure-store to implement the SecureStorage interface.
6
+ * It dynamically imports expo-secure-store to avoid bundling issues when not used.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * import { createSecureStoreAdapter } from '@harkenapp/sdk-react-native';
11
+ * import * as SecureStore from 'expo-secure-store';
12
+ *
13
+ * const storage = createSecureStoreAdapter(SecureStore);
14
+ * ```
15
+ */
16
+ export declare function createSecureStoreAdapter(secureStore: {
17
+ getItemAsync: (key: string) => Promise<string | null>;
18
+ setItemAsync: (key: string, value: string) => Promise<void>;
19
+ deleteItemAsync: (key: string) => Promise<void>;
20
+ }): SecureStorage;
21
+ /**
22
+ * In-memory storage for testing or when secure storage is unavailable.
23
+ * Values are not persisted across app restarts.
24
+ *
25
+ * @internal
26
+ */
27
+ export declare function createMemoryStorage(): SecureStorage;
28
+ //# sourceMappingURL=SecureStoreAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecureStoreAdapter.d.ts","sourceRoot":"","sources":["../../src/storage/SecureStoreAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE;IACpD,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACtD,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD,GAAG,aAAa,CAchB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAgBnD"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSecureStoreAdapter = createSecureStoreAdapter;
4
+ exports.createMemoryStorage = createMemoryStorage;
5
+ /**
6
+ * Adapter for expo-secure-store.
7
+ *
8
+ * This adapter wraps expo-secure-store to implement the SecureStorage interface.
9
+ * It dynamically imports expo-secure-store to avoid bundling issues when not used.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * import { createSecureStoreAdapter } from '@harkenapp/sdk-react-native';
14
+ * import * as SecureStore from 'expo-secure-store';
15
+ *
16
+ * const storage = createSecureStoreAdapter(SecureStore);
17
+ * ```
18
+ */
19
+ function createSecureStoreAdapter(secureStore) {
20
+ return {
21
+ async getItem(key) {
22
+ return secureStore.getItemAsync(key);
23
+ },
24
+ async setItem(key, value) {
25
+ await secureStore.setItemAsync(key, value);
26
+ },
27
+ async deleteItem(key) {
28
+ await secureStore.deleteItemAsync(key);
29
+ },
30
+ };
31
+ }
32
+ /**
33
+ * In-memory storage for testing or when secure storage is unavailable.
34
+ * Values are not persisted across app restarts.
35
+ *
36
+ * @internal
37
+ */
38
+ function createMemoryStorage() {
39
+ const storage = new Map();
40
+ return {
41
+ async getItem(key) {
42
+ return storage.get(key) ?? null;
43
+ },
44
+ async setItem(key, value) {
45
+ storage.set(key, value);
46
+ },
47
+ async deleteItem(key) {
48
+ storage.delete(key);
49
+ },
50
+ };
51
+ }
52
+ //# sourceMappingURL=SecureStoreAdapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecureStoreAdapter.js","sourceRoot":"","sources":["../../src/storage/SecureStoreAdapter.ts"],"names":[],"mappings":";;AAgBA,4DAkBC;AAQD,kDAgBC;AAxDD;;;;;;;;;;;;;GAaG;AACH,SAAgB,wBAAwB,CAAC,WAIxC;IACC,OAAO;QACL,KAAK,CAAC,OAAO,CAAC,GAAW;YACvB,OAAO,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QACvC,CAAC;QAED,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,KAAa;YACtC,MAAM,WAAW,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC;QAED,KAAK,CAAC,UAAU,CAAC,GAAW;YAC1B,MAAM,WAAW,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QACzC,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB;IACjC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE1C,OAAO;QACL,KAAK,CAAC,OAAO,CAAC,GAAW;YACvB,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;QAClC,CAAC;QAED,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,KAAa;YACtC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1B,CAAC;QAED,KAAK,CAAC,UAAU,CAAC,GAAW;YAC1B,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { SecureStorage } from './types';
2
+ /**
3
+ * Creates or returns the default storage implementation.
4
+ *
5
+ * Attempts to use expo-secure-store if available, falling back to
6
+ * in-memory storage if not installed or if loading fails.
7
+ *
8
+ * @internal
9
+ */
10
+ export declare function getDefaultStorage(): Promise<SecureStorage>;
11
+ /**
12
+ * Synchronously creates a storage implementation.
13
+ *
14
+ * Returns a lazy wrapper that will resolve to expo-secure-store if available,
15
+ * or memory storage if not. The actual storage is initialized on first use.
16
+ *
17
+ * @internal
18
+ */
19
+ export declare function createDefaultStorage(): SecureStorage;
20
+ //# sourceMappingURL=defaultStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultStorage.d.ts","sourceRoot":"","sources":["../../src/storage/defaultStorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAe7C;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,aAAa,CAAC,CAyChE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,IAAI,aAAa,CAkCpD"}
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.getDefaultStorage = getDefaultStorage;
37
+ exports.createDefaultStorage = createDefaultStorage;
38
+ const SecureStoreAdapter_1 = require("./SecureStoreAdapter");
39
+ /**
40
+ * Cached default storage instance.
41
+ * @internal
42
+ */
43
+ let defaultStorageInstance = null;
44
+ /**
45
+ * Whether we've already attempted to load expo-secure-store.
46
+ * @internal
47
+ */
48
+ let hasAttemptedLoad = false;
49
+ /**
50
+ * Creates or returns the default storage implementation.
51
+ *
52
+ * Attempts to use expo-secure-store if available, falling back to
53
+ * in-memory storage if not installed or if loading fails.
54
+ *
55
+ * @internal
56
+ */
57
+ async function getDefaultStorage() {
58
+ if (defaultStorageInstance) {
59
+ return defaultStorageInstance;
60
+ }
61
+ if (!hasAttemptedLoad) {
62
+ hasAttemptedLoad = true;
63
+ try {
64
+ // Dynamically import expo-secure-store
65
+ const SecureStore = await Promise.resolve().then(() => __importStar(require('expo-secure-store')));
66
+ defaultStorageInstance = {
67
+ async getItem(key) {
68
+ return SecureStore.getItemAsync(key);
69
+ },
70
+ async setItem(key, value) {
71
+ await SecureStore.setItemAsync(key, value);
72
+ },
73
+ async deleteItem(key) {
74
+ await SecureStore.deleteItemAsync(key);
75
+ },
76
+ };
77
+ return defaultStorageInstance;
78
+ }
79
+ catch {
80
+ // expo-secure-store not available, fall back to memory storage
81
+ console.warn('[Harken] expo-secure-store not available. Using in-memory storage. ' +
82
+ 'Anonymous IDs will not persist across app restarts. ' +
83
+ 'Install expo-secure-store for persistent storage.');
84
+ }
85
+ }
86
+ // Fall back to memory storage
87
+ if (!defaultStorageInstance) {
88
+ defaultStorageInstance = (0, SecureStoreAdapter_1.createMemoryStorage)();
89
+ }
90
+ return defaultStorageInstance;
91
+ }
92
+ /**
93
+ * Synchronously creates a storage implementation.
94
+ *
95
+ * Returns a lazy wrapper that will resolve to expo-secure-store if available,
96
+ * or memory storage if not. The actual storage is initialized on first use.
97
+ *
98
+ * @internal
99
+ */
100
+ function createDefaultStorage() {
101
+ // Return a lazy wrapper that initializes on first use
102
+ let resolvedStorage = null;
103
+ let initPromise = null;
104
+ const ensureInitialized = async () => {
105
+ if (resolvedStorage) {
106
+ return resolvedStorage;
107
+ }
108
+ if (!initPromise) {
109
+ initPromise = getDefaultStorage().then((storage) => {
110
+ resolvedStorage = storage;
111
+ return storage;
112
+ });
113
+ }
114
+ return initPromise;
115
+ };
116
+ return {
117
+ async getItem(key) {
118
+ const storage = await ensureInitialized();
119
+ return storage.getItem(key);
120
+ },
121
+ async setItem(key, value) {
122
+ const storage = await ensureInitialized();
123
+ await storage.setItem(key, value);
124
+ },
125
+ async deleteItem(key) {
126
+ const storage = await ensureInitialized();
127
+ await storage.deleteItem(key);
128
+ },
129
+ };
130
+ }
131
+ //# sourceMappingURL=defaultStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultStorage.js","sourceRoot":"","sources":["../../src/storage/defaultStorage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,8CAyCC;AAUD,oDAkCC;AA3GD,6DAA2D;AAE3D;;;GAGG;AACH,IAAI,sBAAsB,GAAyB,IAAI,CAAC;AAExD;;;GAGG;AACH,IAAI,gBAAgB,GAAG,KAAK,CAAC;AAE7B;;;;;;;GAOG;AACI,KAAK,UAAU,iBAAiB;IACrC,IAAI,sBAAsB,EAAE,CAAC;QAC3B,OAAO,sBAAsB,CAAC;IAChC,CAAC;IAED,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,gBAAgB,GAAG,IAAI,CAAC;QAExB,IAAI,CAAC;YACH,uCAAuC;YACvC,MAAM,WAAW,GAAG,wDAAa,mBAAmB,GAAC,CAAC;YAEtD,sBAAsB,GAAG;gBACvB,KAAK,CAAC,OAAO,CAAC,GAAW;oBACvB,OAAO,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;gBACvC,CAAC;gBACD,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,KAAa;oBACtC,MAAM,WAAW,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;gBAC7C,CAAC;gBACD,KAAK,CAAC,UAAU,CAAC,GAAW;oBAC1B,MAAM,WAAW,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;gBACzC,CAAC;aACF,CAAC;YAEF,OAAO,sBAAsB,CAAC;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,+DAA+D;YAC/D,OAAO,CAAC,IAAI,CACV,qEAAqE;gBACnE,sDAAsD;gBACtD,mDAAmD,CACtD,CAAC;QACJ,CAAC;IACH,CAAC;IAED,8BAA8B;IAC9B,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC5B,sBAAsB,GAAG,IAAA,wCAAmB,GAAE,CAAC;IACjD,CAAC;IAED,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,oBAAoB;IAClC,sDAAsD;IACtD,IAAI,eAAe,GAAyB,IAAI,CAAC;IACjD,IAAI,WAAW,GAAkC,IAAI,CAAC;IAEtD,MAAM,iBAAiB,GAAG,KAAK,IAA4B,EAAE;QAC3D,IAAI,eAAe,EAAE,CAAC;YACpB,OAAO,eAAe,CAAC;QACzB,CAAC;QAED,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,WAAW,GAAG,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;gBACjD,eAAe,GAAG,OAAO,CAAC;gBAC1B,OAAO,OAAO,CAAC;YACjB,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC;IAEF,OAAO;QACL,KAAK,CAAC,OAAO,CAAC,GAAW;YACvB,MAAM,OAAO,GAAG,MAAM,iBAAiB,EAAE,CAAC;YAC1C,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC9B,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,KAAa;YACtC,MAAM,OAAO,GAAG,MAAM,iBAAiB,EAAE,CAAC;YAC1C,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACpC,CAAC;QACD,KAAK,CAAC,UAAU,CAAC,GAAW;YAC1B,MAAM,OAAO,GAAG,MAAM,iBAAiB,EAAE,CAAC;YAC1C,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ export type { SecureStorage } from './types';
2
+ export { STORAGE_KEYS } from './types';
3
+ export { createSecureStoreAdapter, createMemoryStorage } from './SecureStoreAdapter';
4
+ export { createDefaultStorage } from './defaultStorage';
5
+ export { IdentityStore } from './IdentityStore';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IdentityStore = exports.createDefaultStorage = exports.createMemoryStorage = exports.createSecureStoreAdapter = exports.STORAGE_KEYS = void 0;
4
+ var types_1 = require("./types");
5
+ Object.defineProperty(exports, "STORAGE_KEYS", { enumerable: true, get: function () { return types_1.STORAGE_KEYS; } });
6
+ var SecureStoreAdapter_1 = require("./SecureStoreAdapter");
7
+ Object.defineProperty(exports, "createSecureStoreAdapter", { enumerable: true, get: function () { return SecureStoreAdapter_1.createSecureStoreAdapter; } });
8
+ Object.defineProperty(exports, "createMemoryStorage", { enumerable: true, get: function () { return SecureStoreAdapter_1.createMemoryStorage; } });
9
+ var defaultStorage_1 = require("./defaultStorage");
10
+ Object.defineProperty(exports, "createDefaultStorage", { enumerable: true, get: function () { return defaultStorage_1.createDefaultStorage; } });
11
+ var IdentityStore_1 = require("./IdentityStore");
12
+ Object.defineProperty(exports, "IdentityStore", { enumerable: true, get: function () { return IdentityStore_1.IdentityStore; } });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":";;;AACA,iCAAuC;AAA9B,qGAAA,YAAY,OAAA;AACrB,2DAAqF;AAA5E,8HAAA,wBAAwB,OAAA;AAAE,yHAAA,mBAAmB,OAAA;AACtD,mDAAwD;AAA/C,sHAAA,oBAAoB,OAAA;AAC7B,iDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Interface for secure key-value storage.
3
+ * Default implementation uses expo-secure-store.
4
+ * Can be replaced with custom implementations.
5
+ */
6
+ export interface SecureStorage {
7
+ /**
8
+ * Retrieve a value from secure storage.
9
+ * @param key - The key to retrieve
10
+ * @returns The stored value, or null if not found
11
+ */
12
+ getItem(key: string): Promise<string | null>;
13
+ /**
14
+ * Store a value in secure storage.
15
+ * @param key - The key to store under
16
+ * @param value - The value to store
17
+ */
18
+ setItem(key: string, value: string): Promise<void>;
19
+ /**
20
+ * Remove a value from secure storage.
21
+ * @param key - The key to remove
22
+ */
23
+ deleteItem(key: string): Promise<void>;
24
+ }
25
+ /**
26
+ * Storage keys used by the Harken SDK.
27
+ * @internal
28
+ */
29
+ export declare const STORAGE_KEYS: {
30
+ readonly ANON_ID: "harken_anon_id";
31
+ };
32
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/storage/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAE7C;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;OAGG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY;;CAEf,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STORAGE_KEYS = void 0;
4
+ /**
5
+ * Storage keys used by the Harken SDK.
6
+ * @internal
7
+ */
8
+ exports.STORAGE_KEYS = {
9
+ ANON_ID: 'harken_anon_id',
10
+ };
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/storage/types.ts"],"names":[],"mappings":";;;AA2BA;;;GAGG;AACU,QAAA,YAAY,GAAG;IAC1B,OAAO,EAAE,gBAAgB;CACjB,CAAC"}
@@ -0,0 +1,43 @@
1
+ import type { HarkenColors, HarkenTypography, HarkenSpacing, HarkenRadii, HarkenTheme } from './types';
2
+ /**
3
+ * Default light mode colors.
4
+ * Neutral, accessible palette with no hard-coded branding.
5
+ */
6
+ export declare const lightColors: HarkenColors;
7
+ /**
8
+ * Default dark mode colors.
9
+ * Inverted palette optimized for dark backgrounds.
10
+ */
11
+ export declare const darkColors: HarkenColors;
12
+ /**
13
+ * Default typography settings.
14
+ * Uses system font for maximum compatibility.
15
+ */
16
+ export declare const defaultTypography: HarkenTypography;
17
+ /**
18
+ * Default spacing scale.
19
+ * Based on a 4px grid system.
20
+ */
21
+ export declare const defaultSpacing: HarkenSpacing;
22
+ /**
23
+ * Default border radius values.
24
+ */
25
+ export declare const defaultRadii: HarkenRadii;
26
+ /**
27
+ * Complete default light theme.
28
+ */
29
+ export declare const lightTheme: HarkenTheme;
30
+ /**
31
+ * Complete default dark theme.
32
+ */
33
+ export declare const darkTheme: HarkenTheme;
34
+ /**
35
+ * Creates a theme by merging overrides with a base theme.
36
+ */
37
+ export declare function createTheme(baseTheme: HarkenTheme, overrides?: {
38
+ colors?: Partial<HarkenColors>;
39
+ typography?: Partial<HarkenTypography>;
40
+ spacing?: Partial<HarkenSpacing>;
41
+ radii?: Partial<HarkenRadii>;
42
+ }): HarkenTheme;
43
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/theme/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,WAAW,EACZ,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,YAoBzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,YAoBxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,gBAiB/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,aAO5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,WAO1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,WAKxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,WAKvB,CAAC;AAEF;;GAEG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,WAAW,EACtB,SAAS,CAAC,EAAE;IACV,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC9B,GACA,WAAW,CAWb"}