@unvired/react-native-wrapper-sdk 0.0.21 → 0.0.22

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 (42) hide show
  1. package/dist/UnviredWrapper.d.ts +22 -25
  2. package/dist/UnviredWrapper.d.ts.map +1 -1
  3. package/dist/UnviredWrapper.js +48 -32
  4. package/dist/lib/AuthBuilder.d.ts.map +1 -0
  5. package/package.json +6 -11
  6. package/src/UnviredWrapper.ts +52 -34
  7. package/dist/lib/auth/AuthBuilder.d.ts.map +0 -1
  8. package/dist/lib/auth/AuthService.d.ts +0 -27
  9. package/dist/lib/auth/AuthService.d.ts.map +0 -1
  10. package/dist/lib/auth/AuthService.js +0 -46
  11. package/dist/lib/database/DatabaseService.d.ts +0 -43
  12. package/dist/lib/database/DatabaseService.d.ts.map +0 -1
  13. package/dist/lib/database/DatabaseService.js +0 -34
  14. package/dist/lib/file/FileService.d.ts +0 -95
  15. package/dist/lib/file/FileService.d.ts.map +0 -1
  16. package/dist/lib/file/FileService.js +0 -152
  17. package/dist/lib/logger/LoggerService.d.ts +0 -45
  18. package/dist/lib/logger/LoggerService.d.ts.map +0 -1
  19. package/dist/lib/logger/LoggerService.js +0 -65
  20. package/dist/lib/notification/NotificationService.d.ts +0 -28
  21. package/dist/lib/notification/NotificationService.d.ts.map +0 -1
  22. package/dist/lib/notification/NotificationService.js +0 -47
  23. package/dist/lib/settings/SettingsService.d.ts +0 -44
  24. package/dist/lib/settings/SettingsService.d.ts.map +0 -1
  25. package/dist/lib/settings/SettingsService.js +0 -120
  26. package/dist/lib/storage/StorageService.d.ts +0 -13
  27. package/dist/lib/storage/StorageService.d.ts.map +0 -1
  28. package/dist/lib/storage/StorageService.js +0 -19
  29. package/dist/lib/sync/SyncService.d.ts +0 -96
  30. package/dist/lib/sync/SyncService.d.ts.map +0 -1
  31. package/dist/lib/sync/SyncService.js +0 -139
  32. package/src/lib/auth/AuthService.ts +0 -45
  33. package/src/lib/database/DatabaseService.ts +0 -53
  34. package/src/lib/file/FileService.ts +0 -186
  35. package/src/lib/logger/LoggerService.ts +0 -70
  36. package/src/lib/notification/NotificationService.ts +0 -45
  37. package/src/lib/settings/SettingsService.ts +0 -150
  38. package/src/lib/storage/StorageService.ts +0 -27
  39. package/src/lib/sync/SyncService.ts +0 -160
  40. /package/dist/lib/{auth/AuthBuilder.d.ts → AuthBuilder.d.ts} +0 -0
  41. /package/dist/lib/{auth/AuthBuilder.js → AuthBuilder.js} +0 -0
  42. /package/src/lib/{auth/AuthBuilder.ts → AuthBuilder.ts} +0 -0
@@ -1,27 +0,0 @@
1
- import { PlatformManager } from '@unvired/unvired-ts-core-sdk';
2
-
3
- export interface IStorageAdapter {
4
- getItem(key: string): void;
5
- setItem(key: string, value: string): void;
6
- removeItem(key: string): void;
7
- clear(): void;
8
- }
9
-
10
- export class StorageService {
11
-
12
- getItem(key: string): void {
13
- PlatformManager.getInstance().getPlatformAdapter().getStorageAdapter().getItem(key);
14
- }
15
-
16
- setItem(key: string, value: string): void {
17
- PlatformManager.getInstance().getPlatformAdapter().getStorageAdapter().setItem(key, value);
18
- }
19
-
20
- removeItem(key: string): void {
21
- PlatformManager.getInstance().getPlatformAdapter().getStorageAdapter().removeItem(key);
22
- }
23
-
24
- clear(): void {
25
- PlatformManager.getInstance().getPlatformAdapter().getStorageAdapter().clear();
26
- }
27
- }
@@ -1,160 +0,0 @@
1
- import {
2
- SyncEngine,
3
- SettingsHelper,
4
- NotificationListenerHelper,
5
- OutboxService,
6
- OutBoxHelper
7
- } from '@unvired/unvired-ts-core-sdk';
8
-
9
- /**
10
- * Service for handling Synchronization with Unvired Server
11
- */
12
- export class SyncService {
13
-
14
- /**
15
- * Submit data to UMP server in sync mode (Foreground)
16
- * @param reqType Request Type (RQST/PULL/PUSH/QUERY/REQ)
17
- * @param header Header Data Structure
18
- * @param customData Custom data string (optional)
19
- * @param paFunction Process Agent Function Name
20
- * @param autoSave Whether to auto-save data in DB
21
- */
22
- async syncForeground(reqType: any, header: any, customData: string = "", paFunction: string, autoSave: boolean): Promise<any> {
23
- return SyncEngine.syncForeground(reqType, header, customData, paFunction, autoSave);
24
- }
25
-
26
- /**
27
- * Submit data to UMP server in async mode (Background)
28
- * @param reqType Request Type
29
- * @param header Header Data Structure
30
- * @param customData Custom data string (optional)
31
- * @param paFunction Process Agent Function Name
32
- * @param beName Business Entity Name
33
- */
34
- async syncBackground(reqType: any, header: any, customData: string = "", paFunction: string, beName: string): Promise<any> {
35
- return SyncEngine.syncBackground(reqType, header, customData, paFunction, beName);
36
- }
37
-
38
- /**
39
- * Sends request for initial data download
40
- * @param functions List of functions to execute
41
- */
42
- async sendInitialDataDownloadRequest(functions: any[] = []): Promise<void> {
43
- return SettingsHelper.requestInitialDataDownload(functions);
44
- }
45
-
46
- /**
47
- * Gets synchronization state
48
- * @param callback Callback to receive state updates
49
- */
50
- getSynchronizationState(callback: (state: string) => void): void {
51
- NotificationListenerHelper.synchronizationStateListener = callback;
52
- // Initial state
53
- callback("idle");
54
- }
55
-
56
- /**
57
- * Starts Inbox Handler
58
- */
59
- startInboxHandler(): void {
60
- // Correct usage of SyncEngine as per SDK definition
61
- SyncEngine.startInboxHandler();
62
- }
63
-
64
- /**
65
- * Starts Data Sender (Outbox Handler)
66
- */
67
- startDataSender(): void {
68
- OutboxService.getInstance().start();
69
- }
70
-
71
- /**
72
- * Request for downloading messages from server
73
- */
74
- getMessages(): void {
75
- SyncEngine.getMessages();
76
- }
77
-
78
- /**
79
- * Register for Data Sender notifications
80
- * @param callback Callback function
81
- */
82
- registerDataSenderListener(callback: (data: any) => void): void {
83
- NotificationListenerHelper.dataSenderListener = callback;
84
- }
85
-
86
- /**
87
- * Unregister Data Sender notifications
88
- */
89
- unRegisterDataSenderListener(): void {
90
- NotificationListenerHelper.dataSenderListener = null;
91
- }
92
-
93
- /**
94
- * Register for Sync Items count updates
95
- * @param callback Callback function
96
- */
97
- registerSyncItemsCountListener(callback: (count: any) => void): void {
98
- NotificationListenerHelper.syncItemsCountListener = callback;
99
- }
100
-
101
- /**
102
- * Check if a BE is in the Outbox queue
103
- * @param beLid BE Header LID
104
- */
105
- async isInOutBox(beLid: string): Promise<boolean> {
106
- return SettingsHelper.isInOutBoxQueue(beLid);
107
- }
108
-
109
- /**
110
- * Check if a BE is in Sent Items
111
- * @param beLid BE Header LID
112
- */
113
- async isInSentItem(beLid: string): Promise<boolean> {
114
- return SettingsHelper.isInSentItems(beLid);
115
- }
116
-
117
- /**
118
- * Get count of items in Outbox
119
- */
120
- async outBoxItemCount(): Promise<number> {
121
- return SettingsHelper.getOutboxCount();
122
- }
123
-
124
- /**
125
- * Get count of items in Sent Items
126
- */
127
- async sentItemCount(): Promise<number> {
128
- return SettingsHelper.getSentItemsCount();
129
- }
130
-
131
- /**
132
- * Get count of items in Inbox
133
- */
134
- async inBoxItemCount(): Promise<number> {
135
- return SettingsHelper.getInboxCount();
136
- }
137
-
138
- /**
139
- * Delete an entry from Outbox
140
- * @param beLid BE Header LID
141
- */
142
- async deleteOutBoxEntry(beLid: string): Promise<any> {
143
- return SyncEngine.removeOutObjectBasedOnLid(beLid);
144
- }
145
-
146
- /**
147
- * Lock Data Sender for a specific BE
148
- * @param beLid BE LID
149
- */
150
- async lockDataSender(beLid: string): Promise<any> {
151
- return SyncEngine.lockDataSender(beLid);
152
- }
153
-
154
- /**
155
- * Unlock Data Sender
156
- */
157
- async unlockDataSender(): Promise<any> {
158
- return SyncEngine.unlockDataSender();
159
- }
160
- }
File without changes