cordova-plugin-unvired-universal-sdk 1.0.5 → 1.0.8

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 (76) hide show
  1. package/package.json +1 -1
  2. package/plugin.xml +1 -13
  3. package/www/kernel.js +38345 -1239
  4. package/aar/README.md +0 -3
  5. package/aar/Unvired_Kernel_Android.aar +0 -0
  6. package/aar/Unvired_Kernel_HTML5_Android.aar +0 -0
  7. package/src/android/build.gradle +0 -35
  8. package/src/android/xml/provider_paths.xml +0 -21
  9. package/src/browser/UnviredPluginProxy.js +0 -2430
  10. package/src/browser/bootstrap.min.js +0 -17
  11. package/src/browser/codemirror.js +0 -9755
  12. package/src/browser/jquery-3.2.1.js +0 -10253
  13. package/src/browser/sql-wasm.wasm +0 -0
  14. package/src/browser/sql.js +0 -203
  15. package/src/browser/src_index_worker_js.unvired-db-worker.js +0 -231
  16. package/src/browser/unvired-db-worker.js +0 -166
  17. package/src/browser/vendors-node_modules_comlink_dist_esm_comlink_mjs.unvired-db-worker.js +0 -22
  18. package/src/ios/AttachmentPlugin.h +0 -21
  19. package/src/ios/AttachmentPlugin.m +0 -180
  20. package/src/ios/DataStructureHelper.h +0 -28
  21. package/src/ios/DataStructureHelper.m +0 -188
  22. package/src/ios/IOSAuthPlugin.h +0 -14
  23. package/src/ios/IOSAuthPlugin.m +0 -13
  24. package/src/ios/IOSDatabasePlugin.h +0 -28
  25. package/src/ios/IOSDatabasePlugin.m +0 -253
  26. package/src/ios/IOSFWSettingsPlugin.h +0 -65
  27. package/src/ios/IOSFWSettingsPlugin.m +0 -363
  28. package/src/ios/IOSLoggerPlugin.h +0 -34
  29. package/src/ios/IOSLoggerPlugin.m +0 -198
  30. package/src/ios/IOSLoginPlugin.h +0 -29
  31. package/src/ios/IOSLoginPlugin.m +0 -480
  32. package/src/ios/IOSProxyPlugin.h +0 -21
  33. package/src/ios/IOSProxyPlugin.m +0 -172
  34. package/src/ios/IOSSyncEnginePlugin.h +0 -54
  35. package/src/ios/IOSSyncEnginePlugin.m +0 -847
  36. package/src/ios/PluginConstants.h +0 -195
  37. package/src/ios/PluginHelper.h +0 -29
  38. package/src/ios/PluginHelper.m +0 -74
  39. package/src/ios/SyncHTML5Response.h +0 -50
  40. package/src/ios/SyncHTML5Response.m +0 -68
  41. package/www/applicationMeta/applicationMetadataParser.ts +0 -285
  42. package/www/applicationMeta/fieldConstants.ts +0 -92
  43. package/www/attachment/attachmentHelper.ts +0 -326
  44. package/www/attachment/attachmentQHelper.ts +0 -158
  45. package/www/attachment/attachmentService.ts +0 -259
  46. package/www/authenticationService.ts +0 -751
  47. package/www/database/appDatabaseManager.ts +0 -54
  48. package/www/database/databaseManager.ts +0 -616
  49. package/www/helper/dbCreateTablesManager.ts +0 -354
  50. package/www/helper/frameworkHelper.ts +0 -127
  51. package/www/helper/frameworkSettingsManager.ts +0 -287
  52. package/www/helper/getMessageTimerManager.ts +0 -81
  53. package/www/helper/httpConnection.ts +0 -1051
  54. package/www/helper/logger.ts +0 -312
  55. package/www/helper/notificationListnerHelper.ts +0 -56
  56. package/www/helper/passcodeGenerator.ts +0 -61
  57. package/www/helper/reconciler.ts +0 -1062
  58. package/www/helper/serverResponseHandler.ts +0 -677
  59. package/www/helper/serviceConstants.ts +0 -254
  60. package/www/helper/settingsHelper.ts +0 -386
  61. package/www/helper/status.ts +0 -83
  62. package/www/helper/syncInputDataManager.ts +0 -205
  63. package/www/helper/unviredAccount.ts +0 -104
  64. package/www/helper/unviredAccountManager.ts +0 -120
  65. package/www/helper/urlService.ts +0 -43
  66. package/www/helper/userSettingsManager.ts +0 -172
  67. package/www/helper/utils.ts +0 -110
  68. package/www/inbox/downloadMessageService.ts +0 -270
  69. package/www/inbox/inboxHelper.ts +0 -132
  70. package/www/inbox/inboxService.ts +0 -223
  71. package/www/outbox/outboxAttachmentManager.ts +0 -152
  72. package/www/outbox/outboxHelper.ts +0 -67
  73. package/www/outbox/outboxService.ts +0 -519
  74. package/www/subtract.ts +0 -5
  75. package/www/sum.ts +0 -4
  76. package/www/syncEngine.ts +0 -687
@@ -1,285 +0,0 @@
1
- import { ObjectStatus, SyncStatus } from '../helper/utils';
2
- import FrameworkHelper from '../helper/frameworkHelper';
3
- import * as FieldConstants from './fieldConstants';
4
-
5
- export interface ApplicationMeta {
6
- lid: string;
7
- timestamp: number;
8
- objectStatus: number;
9
- syncStatus: number;
10
- appClassName: string;
11
- appId: string;
12
- appName: string;
13
- description: string;
14
- version: string;
15
- installationDate: string;
16
- }
17
-
18
- export interface BusinessEntityMeta {
19
- lid: string;
20
- timestamp: number;
21
- objectStatus: number;
22
- syncStatus: number;
23
- appName: string;
24
- beName: string;
25
- description: string;
26
- addFunction: string;
27
- modifyFunction: string;
28
- deleteFunction: string;
29
- notification: string;
30
- attachments: string;
31
- conflictRules: string;
32
- save: string;
33
- }
34
-
35
- export interface StructureMeta {
36
- lid: string;
37
- timestamp: number;
38
- objectStatus: number;
39
- syncStatus: number;
40
- structureName: string;
41
- description: string;
42
- className: string;
43
- isHeader: string;
44
- appName: string;
45
- beName: string;
46
- }
47
-
48
- export interface FieldMeta {
49
- lid: string;
50
- timestamp: number;
51
- objectStatus: number;
52
- syncStatus: number;
53
- appName: string;
54
- beName: string;
55
- structureName: string;
56
- fieldName: string;
57
- description: string;
58
- length: string;
59
- mandatory: string;
60
- sqlType: string;
61
- isGid: string;
62
- }
63
-
64
- export interface IndexMeta {
65
- indexName: string;
66
- structureName: string;
67
- fieldName: string[];
68
- }
69
-
70
- export default class ApplicationMetaParser {
71
- private applicationMeta!: ApplicationMeta;
72
- private businessEntityMetas: BusinessEntityMeta[] = [];
73
- private structureMetas: StructureMeta[] = [];
74
- private fieldMetas: FieldMeta[] = [];
75
- private indexMetas: IndexMeta[] = [];
76
- private metadataJSON: string = "";
77
-
78
- applicationName: string = "";
79
- applicationVersion: string = "";
80
- applicationNamespace: string = "";
81
-
82
- private static readonly _instance: ApplicationMetaParser = new ApplicationMetaParser();
83
-
84
- private constructor() {}
85
-
86
- public static get instance(): ApplicationMetaParser {
87
- return this._instance;
88
- }
89
-
90
- public async init(jsonString: string): Promise<void> {
91
- this.applicationName = "";
92
- this.businessEntityMetas = [];
93
- this.structureMetas = [];
94
- this.fieldMetas = [];
95
- this.indexMetas = [];
96
- this.metadataJSON = jsonString;
97
-
98
- await this.parse();
99
- }
100
-
101
- public getApplicationMeta(): ApplicationMeta {
102
- return this.applicationMeta;
103
- }
104
-
105
- public getBusinessEntityMetas(): BusinessEntityMeta[] {
106
- return this.businessEntityMetas;
107
- }
108
-
109
- public getStructureMetas(): StructureMeta[] {
110
- return this.structureMetas;
111
- }
112
-
113
- public getFieldMetas(): FieldMeta[] {
114
- return this.fieldMetas;
115
- }
116
-
117
- public getIndexMetas(): IndexMeta[] {
118
- return this.indexMetas;
119
- }
120
-
121
- public parseAppInfo(jsonString: string) {
122
- const jsonData:any = JSON.parse(jsonString);
123
- if (!jsonData) {
124
- return;
125
- }
126
- this.applicationName = jsonData[FieldConstants.ApplicationNameAttribute];
127
- this.applicationVersion = jsonData[FieldConstants.ApplicationVersionAttribute];
128
- this.applicationMeta = jsonData[FieldConstants.ApplicationNamespaceAttribute];
129
- }
130
-
131
- private async parse(): Promise<void> {
132
- const jsonData:any = JSON.parse(this.metadataJSON);
133
- if (!jsonData) {
134
- return;
135
- }
136
- this.applicationName = jsonData[FieldConstants.ApplicationNameAttribute];
137
- this.applicationVersion = jsonData[FieldConstants.ApplicationVersionAttribute];
138
- this.applicationMeta = jsonData[FieldConstants.ApplicationNamespaceAttribute];
139
-
140
- // Parse Application Meta
141
- const applicationDescription = jsonData[FieldConstants.ApplicationDescriptionAttribute] || "";
142
- const applicationClassName = jsonData[FieldConstants.ApplicationClassNameAttribute] || "";
143
- const currentDate = new Date();
144
- const formatter = new Intl.DateTimeFormat('en-US', {
145
- month: 'long',
146
- day: 'numeric',
147
- year: 'numeric',
148
- hour: 'numeric',
149
- minute: '2-digit',
150
- second: '2-digit',
151
- });
152
-
153
- this.applicationMeta = {
154
- lid: FrameworkHelper.getUUID(),
155
- timestamp: currentDate.getTime(),
156
- objectStatus: ObjectStatus.global,
157
- syncStatus: SyncStatus.none,
158
- appClassName: applicationClassName,
159
- appId: "",
160
- appName: this.applicationName,
161
- description: applicationDescription,
162
- version: this.applicationVersion,
163
- installationDate: formatter.format(currentDate),
164
- };
165
-
166
- const jsonDataKeys = Object.keys(jsonData);
167
- for (const key of jsonDataKeys) {
168
- const value = jsonData[key];
169
-
170
- if (key !== FieldConstants.ApplicationNameAttribute && key !== FieldConstants.ApplicationDescriptionAttribute && key !== FieldConstants.ApplicationVersionAttribute) {
171
- const beName = key;
172
- if (key === FieldConstants.IndexNode) {
173
- // Parse Index Meta
174
- for (const index of value as any[]) {
175
- const name = index[FieldConstants.IndexName];
176
- const structureName = index[FieldConstants.IndexTableName];
177
- const fieldNames = index[FieldConstants.IndexFields] as string[];
178
- const indexMeta: IndexMeta = {
179
- indexName: name,
180
- structureName: structureName,
181
- fieldName: fieldNames,
182
- };
183
- this.indexMetas.push(indexMeta);
184
- }
185
- } else if (!Array.isArray(value)) {
186
- // Parse Business Entity Meta
187
- const beDesc = value[FieldConstants.BeDescriptionAttribute] || "";
188
- const saveAttributeValue = value[FieldConstants.BeSaveAttribute] ?? false;
189
- const saveAttribute = saveAttributeValue ? "true" : "false";
190
-
191
- const conflictRule = value[FieldConstants.BeOnConflictAttribute] || FieldConstants.ConflictModeServerWins;
192
-
193
- const isAttachmentRequired = value[FieldConstants.BeAttachmentsAttribute] ?? false;
194
-
195
- const businessEntityMeta: BusinessEntityMeta = {
196
- lid: FrameworkHelper.getUUID(),
197
- timestamp: new Date().getTime(),
198
- objectStatus: ObjectStatus.global,
199
- syncStatus: SyncStatus.none,
200
- appName: this.applicationName,
201
- beName: beName,
202
- description: beDesc,
203
- addFunction: "",
204
- modifyFunction: "",
205
- deleteFunction: "",
206
- notification: "",
207
- attachments: isAttachmentRequired ? "1" : "0",
208
- conflictRules: conflictRule,
209
- save: saveAttribute,
210
- };
211
- this.businessEntityMetas.push(businessEntityMeta);
212
-
213
- // Parse Structure Meta
214
- const beJSON = value;
215
- const beJSONKeys = Object.keys(beJSON);
216
- for (const key2 of beJSONKeys) {
217
- const value2 = beJSON[key2];
218
- if (key2 !== FieldConstants.BeDescriptionAttribute &&
219
- key2 !== FieldConstants.BeSaveAttribute &&
220
- key2 !== FieldConstants.BeOnConflictAttribute &&
221
- key2 !== FieldConstants.BeAttachmentsAttribute) {
222
- const structureName = key2;
223
-
224
- if (!Array.isArray(value2)) {
225
- const structureDesc = value2[FieldConstants.BeItemDescriptionAttribute] || "";
226
- const className = value2[FieldConstants.BeItemClassNameAttribute];
227
- const isHeader = value2[FieldConstants.BeItemIsHeader] ?? false;
228
-
229
- const structureMeta: StructureMeta = {
230
- lid: FrameworkHelper.getUUID(),
231
- timestamp: new Date().getTime(),
232
- objectStatus: ObjectStatus.global,
233
- syncStatus: SyncStatus.none,
234
- structureName: structureName,
235
- description: structureDesc,
236
- className: className,
237
- isHeader: isHeader ? "1" : "0",
238
- appName: this.applicationName,
239
- beName: beName,
240
- };
241
-
242
- this.structureMetas.push(structureMeta);
243
-
244
- // Parse Field Meta
245
- const fields = value2[FieldConstants.BeJsonFieldNode] as any[];
246
- for (const field of fields) {
247
- const name = field[FieldConstants.BeJsonFieldNameNode];
248
- const description = field[FieldConstants.BeJsonFieldDescription] || "";
249
- const fieldType = field[FieldConstants.BeJsonFieldSqlType];
250
- const isGID = field[FieldConstants.BeJsonFieldIsGid] ?? false;
251
- const isMandatory = field[FieldConstants.BeJsonFieldMandatory] ?? false;
252
-
253
- let length = 0;
254
- try {
255
- length = parseInt(field[FieldConstants.BeJsonFieldLength] || "", 10);
256
- } catch (e) {}
257
-
258
- const fieldMeta: FieldMeta = {
259
- lid: FrameworkHelper.getUUID(),
260
- timestamp: new Date().getTime(),
261
- objectStatus: ObjectStatus.global,
262
- syncStatus: SyncStatus.none,
263
- appName: this.applicationName,
264
- beName: beName,
265
- structureName: structureName,
266
- fieldName: name,
267
- description: description,
268
- length: length.toString(),
269
- mandatory: isMandatory ? "1" : "0",
270
- sqlType: fieldType,
271
- isGid: isGID ? "1" : "0",
272
- };
273
- this.fieldMetas.push(fieldMeta);
274
- }
275
- }
276
- }
277
- }
278
- }
279
- }
280
- }
281
- }
282
- }
283
-
284
-
285
-
@@ -1,92 +0,0 @@
1
- export const FieldLid: string = "LID";
2
- export const FieldFid: string = "FID";
3
- export const FieldConflict: string = "HAS_CONFLICT";
4
- export const FieldTimestamp: string = "TIMESTAMP";
5
- export const FieldSyncStatus: string = "SYNC_STATUS";
6
- export const FieldObjectStatus: string = "OBJECT_STATUS";
7
- export const FieldTableName: string = "TABLE_NAME";
8
- // This field is added to cummulate the highest InfoMessage category
9
- // Priority: FAILUE > FAILURE_N_PROCESS > WARNING > INFO > SUCCESS
10
- export const FieldInfoMsgCat: string = "INFO_MSG_CAT";
11
-
12
- export const FieldTypeLid: string = "Text";
13
- export const FieldTypeFid: string = "Text";
14
- export const FieldTypeConflict: string = "Text";
15
- export const FieldTypeTimestamp: string = "Integer";
16
- export const FieldTypeSyncStatus: string = "Integer";
17
- export const FieldTypeObjectStatus: string = "Integer";
18
- export const FieldTypeInfoMsgCat: string = "Text";
19
-
20
- export const FieldInfoMessageCategory: string = "category";
21
- export const FieldInfoMessageMessage: string = "message";
22
-
23
- export const InfoMessageFailure: string = "FAILURE";
24
- export const InfoMessageFailureAndProcess: string = "FAILURE_N_PROCESS";
25
- export const InfoMessageMsgWithheld: string = "MSG_WITHHELD";
26
- export const InfoMessageWarning: string = "WARNING";
27
- export const InfoMessageInfo: string = "INFO";
28
- export const InfoMessageSuccess: string = "SUCCESS";
29
-
30
- export const driftNoElement: string = "No element"; // Returned as an exception message from drift when no row is present in the table
31
-
32
- export const InfoMessageError: string = "FAILURE";
33
-
34
- // export const yes: string = "YES";
35
-
36
- export const messageServiceType: string = "message_service_type";
37
-
38
-
39
- // Application Metadata Parser Constants
40
-
41
- export const ApplicationNameAttribute = "name";
42
- export const ApplicationDescriptionAttribute = "description";
43
- export const ApplicationVersionAttribute = "version";
44
- export const ApplicationNamespaceAttribute = "namespace";
45
- export const ApplicationClassNameAttribute = "applicationClassName";
46
-
47
- // Meta Data
48
- export const BeMetaData = "MetaData";
49
- export const BeMetaDataDeleteAttribute = "delete";
50
-
51
- // Business Entity
52
- export const BeNode = "BusinessEntity";
53
- export const Be = "BE";
54
-
55
- export const BeDescriptionAttribute = "description";
56
- export const BeAttachmentsAttribute = "attachments";
57
- export const BeNameAttribute = "name";
58
- export const BeFieldTextAttribute = "value";
59
- export const BeVersionAttribute = "version";
60
- export const BeAddFunctionAttribute = "addFunction";
61
- export const BeModifyFunctionAttribute = "modifyFunction";
62
- export const BeDeleteFunctionAttribute = "deleteFunction";
63
- export const BeNotificationAttribute = "notification";
64
- export const BeOnConflictAttribute = "onConflict";
65
- export const BeSaveAttribute = "save";
66
-
67
- export const BeActionAttribute = "action";
68
-
69
- export const ConflictModeServerWins = "SERVER_WINS";
70
- export const ConflictModeDeviceWins = "DEVICE_WINS";
71
- export const ConflictModeAppHandled = "APP_HANDLED";
72
-
73
- export const BeItemIndex = "index";
74
- export const BeItemDescriptionAttribute = "description";
75
- export const BeItemNameAttribute = "name";
76
- export const BeItemClassNameAttribute = "className";
77
- export const BeItemActionAttribute = "action";
78
- export const BeItemIsHeader = "header";
79
- export const BeItemIsAttachment = "attachment";
80
-
81
- export const BeJsonFieldNode = "field";
82
- export const BeJsonFieldNameNode = "name";
83
- export const BeJsonFieldIsGid = "isGid";
84
- export const BeJsonFieldLength = "length";
85
- export const BeJsonFieldMandatory = "mandatory";
86
- export const BeJsonFieldSqlType = "sqlType";
87
- export const BeJsonFieldDescription = "description";
88
-
89
- export const IndexNode = "Index";
90
- export const IndexName = "name";
91
- export const IndexFields = "Fields";
92
- export const IndexTableName = "tableName";