@umituz/react-native-storage 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-storage",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Domain-Driven Design storage system for React Native apps with type-safe AsyncStorage operations",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -53,4 +53,21 @@ export interface IStorageRepository {
53
53
  * Get multiple items at once
54
54
  */
55
55
  getMultiple(keys: string[]): Promise<StorageResult<Record<string, string | null>>>;
56
+
57
+ /**
58
+ * Get all keys from storage
59
+ */
60
+ getAllKeys(): Promise<StorageResult<string[]>>;
61
+
62
+ /**
63
+ * Get object from storage (alias for getItem for backward compatibility)
64
+ * @deprecated Use getItem instead
65
+ */
66
+ getObject<T>(key: string, defaultValue: T): Promise<StorageResult<T>>;
67
+
68
+ /**
69
+ * Set object in storage (alias for setItem for backward compatibility)
70
+ * @deprecated Use setItem instead
71
+ */
72
+ setObject<T>(key: string, value: T): Promise<StorageResult<T>>;
56
73
  }
@@ -15,6 +15,9 @@ export enum StorageKey {
15
15
  // Onboarding
16
16
  ONBOARDING_COMPLETED = '@onboarding_completed',
17
17
 
18
+ // Auth
19
+ AUTH_SHOW_REGISTER = '@auth_show_register',
20
+
18
21
  // Localization
19
22
  LANGUAGE = '@app_language',
20
23
 
@@ -143,6 +143,34 @@ export class AsyncStorageRepository implements IStorageRepository {
143
143
  return failure(new StorageReadError('MULTIPLE_KEYS', error));
144
144
  }
145
145
  }
146
+
147
+ /**
148
+ * Get all keys from storage
149
+ */
150
+ async getAllKeys(): Promise<StorageResult<string[]>> {
151
+ try {
152
+ const keys = await AsyncStorage.getAllKeys();
153
+ return success([...keys]);
154
+ } catch (error) {
155
+ return failure(new StorageReadError('ALL_KEYS', error));
156
+ }
157
+ }
158
+
159
+ /**
160
+ * Get object from storage (alias for getItem for backward compatibility)
161
+ * @deprecated Use getItem instead
162
+ */
163
+ async getObject<T>(key: string, defaultValue: T): Promise<StorageResult<T>> {
164
+ return this.getItem(key, defaultValue);
165
+ }
166
+
167
+ /**
168
+ * Set object in storage (alias for setItem for backward compatibility)
169
+ * @deprecated Use setItem instead
170
+ */
171
+ async setObject<T>(key: string, value: T): Promise<StorageResult<T>> {
172
+ return this.setItem(key, value);
173
+ }
146
174
  }
147
175
 
148
176
  /**