@etsoo/appscript 1.4.22 → 1.4.24

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.
@@ -191,6 +191,10 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
191
191
  * @returns true means device is invalid
192
192
  */
193
193
  checkDeviceResult(result: IActionResult): boolean;
194
+ /**
195
+ * Clear device id
196
+ */
197
+ clearDeviceId(): void;
194
198
  /**
195
199
  * Init call
196
200
  * @param callback Callback
@@ -332,10 +332,18 @@ class CoreApp {
332
332
  * @returns true means device is invalid
333
333
  */
334
334
  checkDeviceResult(result) {
335
- if (result.type === 'NoValidData' && result.field === 'Device')
335
+ if (result.type === 'DataProcessingFailed' ||
336
+ (result.type === 'NoValidData' && result.field === 'Device'))
336
337
  return true;
337
338
  return false;
338
339
  }
340
+ /**
341
+ * Clear device id
342
+ */
343
+ clearDeviceId() {
344
+ this._deviceId = '';
345
+ this.storage.setData(this.fields.deviceId, undefined);
346
+ }
339
347
  /**
340
348
  * Init call
341
349
  * @param callback Callback
@@ -346,7 +354,7 @@ class CoreApp {
346
354
  var _a;
347
355
  // Reset keys
348
356
  if (resetKeys) {
349
- this._deviceId = '';
357
+ this.clearDeviceId();
350
358
  this.resetKeys();
351
359
  }
352
360
  // Passphrase exists?
@@ -189,6 +189,10 @@ export interface IApp {
189
189
  * Clear cached token
190
190
  */
191
191
  clearCacheToken(): void;
192
+ /**
193
+ * Clear device id
194
+ */
195
+ clearDeviceId(): void;
192
196
  /**
193
197
  * Decrypt message
194
198
  * @param messageEncrypted Encrypted message
@@ -50,7 +50,7 @@
50
50
  "dataPrivacyInternal": "All users",
51
51
  "dataPrivacyPrivate": "Creator only",
52
52
  "dataPrivacyPublic": "Full public",
53
- "default": "Default",
53
+ "defaultItem": "Default",
54
54
  "delete": "Delete",
55
55
  "deleteConfirm": "Are you sure you want to permanently delete this {0}?",
56
56
  "description": "Description",
@@ -50,7 +50,7 @@
50
50
  "dataPrivacyInternal": "所有用户",
51
51
  "dataPrivacyPrivate": "创建者私有",
52
52
  "dataPrivacyPublic": "完全公开",
53
- "default": "默认",
53
+ "defaultItem": "默认",
54
54
  "delete": "删除",
55
55
  "deleteConfirm": "确定要永久删除此{0}吗?",
56
56
  "description": "描述",
@@ -50,7 +50,7 @@
50
50
  "dataPrivacyInternal": "所有用户",
51
51
  "dataPrivacyPrivate": "創建者私有",
52
52
  "dataPrivacyPublic": "完全公開",
53
- "default": "默認",
53
+ "defaultItem": "默認",
54
54
  "delete": "刪除",
55
55
  "deleteConfirm": "確定要永久刪除此{0}嗎?",
56
56
  "description": "描述",
@@ -191,6 +191,10 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
191
191
  * @returns true means device is invalid
192
192
  */
193
193
  checkDeviceResult(result: IActionResult): boolean;
194
+ /**
195
+ * Clear device id
196
+ */
197
+ clearDeviceId(): void;
194
198
  /**
195
199
  * Init call
196
200
  * @param callback Callback
@@ -306,10 +306,18 @@ export class CoreApp {
306
306
  * @returns true means device is invalid
307
307
  */
308
308
  checkDeviceResult(result) {
309
- if (result.type === 'NoValidData' && result.field === 'Device')
309
+ if (result.type === 'DataProcessingFailed' ||
310
+ (result.type === 'NoValidData' && result.field === 'Device'))
310
311
  return true;
311
312
  return false;
312
313
  }
314
+ /**
315
+ * Clear device id
316
+ */
317
+ clearDeviceId() {
318
+ this._deviceId = '';
319
+ this.storage.setData(this.fields.deviceId, undefined);
320
+ }
313
321
  /**
314
322
  * Init call
315
323
  * @param callback Callback
@@ -320,7 +328,7 @@ export class CoreApp {
320
328
  var _a;
321
329
  // Reset keys
322
330
  if (resetKeys) {
323
- this._deviceId = '';
331
+ this.clearDeviceId();
324
332
  this.resetKeys();
325
333
  }
326
334
  // Passphrase exists?
@@ -189,6 +189,10 @@ export interface IApp {
189
189
  * Clear cached token
190
190
  */
191
191
  clearCacheToken(): void;
192
+ /**
193
+ * Clear device id
194
+ */
195
+ clearDeviceId(): void;
192
196
  /**
193
197
  * Decrypt message
194
198
  * @param messageEncrypted Encrypted message
@@ -50,7 +50,7 @@
50
50
  "dataPrivacyInternal": "All users",
51
51
  "dataPrivacyPrivate": "Creator only",
52
52
  "dataPrivacyPublic": "Full public",
53
- "default": "Default",
53
+ "defaultItem": "Default",
54
54
  "delete": "Delete",
55
55
  "deleteConfirm": "Are you sure you want to permanently delete this {0}?",
56
56
  "description": "Description",
@@ -50,7 +50,7 @@
50
50
  "dataPrivacyInternal": "所有用户",
51
51
  "dataPrivacyPrivate": "创建者私有",
52
52
  "dataPrivacyPublic": "完全公开",
53
- "default": "默认",
53
+ "defaultItem": "默认",
54
54
  "delete": "删除",
55
55
  "deleteConfirm": "确定要永久删除此{0}吗?",
56
56
  "description": "描述",
@@ -50,7 +50,7 @@
50
50
  "dataPrivacyInternal": "所有用户",
51
51
  "dataPrivacyPrivate": "創建者私有",
52
52
  "dataPrivacyPublic": "完全公開",
53
- "default": "默認",
53
+ "defaultItem": "默認",
54
54
  "delete": "刪除",
55
55
  "deleteConfirm": "確定要永久刪除此{0}嗎?",
56
56
  "description": "描述",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.4.22",
3
+ "version": "1.4.24",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -58,15 +58,15 @@
58
58
  "crypto-js": "^4.1.1"
59
59
  },
60
60
  "devDependencies": {
61
- "@babel/cli": "^7.22.5",
62
- "@babel/core": "^7.22.5",
63
- "@babel/plugin-transform-runtime": "^7.22.5",
64
- "@babel/preset-env": "^7.22.5",
65
- "@babel/runtime-corejs3": "^7.22.5",
61
+ "@babel/cli": "^7.22.6",
62
+ "@babel/core": "^7.22.8",
63
+ "@babel/plugin-transform-runtime": "^7.22.7",
64
+ "@babel/preset-env": "^7.22.7",
65
+ "@babel/runtime-corejs3": "^7.22.6",
66
66
  "@types/crypto-js": "^4.1.1",
67
67
  "@types/jest": "^29.5.2",
68
- "jest": "^29.5.0",
69
- "jest-environment-jsdom": "^29.5.0",
68
+ "jest": "^29.6.1",
69
+ "jest-environment-jsdom": "^29.6.1",
70
70
  "ts-jest": "^29.1.1",
71
71
  "typescript": "^5.1.6"
72
72
  }
@@ -492,11 +492,22 @@ export abstract class CoreApp<
492
492
  * @returns true means device is invalid
493
493
  */
494
494
  checkDeviceResult(result: IActionResult): boolean {
495
- if (result.type === 'NoValidData' && result.field === 'Device')
495
+ if (
496
+ result.type === 'DataProcessingFailed' ||
497
+ (result.type === 'NoValidData' && result.field === 'Device')
498
+ )
496
499
  return true;
497
500
  return false;
498
501
  }
499
502
 
503
+ /**
504
+ * Clear device id
505
+ */
506
+ clearDeviceId() {
507
+ this._deviceId = '';
508
+ this.storage.setData(this.fields.deviceId, undefined);
509
+ }
510
+
500
511
  /**
501
512
  * Init call
502
513
  * @param callback Callback
@@ -506,7 +517,7 @@ export abstract class CoreApp<
506
517
  async initCall(callback?: (result: boolean) => void, resetKeys?: boolean) {
507
518
  // Reset keys
508
519
  if (resetKeys) {
509
- this._deviceId = '';
520
+ this.clearDeviceId();
510
521
  this.resetKeys();
511
522
  }
512
523
 
package/src/app/IApp.ts CHANGED
@@ -253,6 +253,11 @@ export interface IApp {
253
253
  */
254
254
  clearCacheToken(): void;
255
255
 
256
+ /**
257
+ * Clear device id
258
+ */
259
+ clearDeviceId(): void;
260
+
256
261
  /**
257
262
  * Decrypt message
258
263
  * @param messageEncrypted Encrypted message
package/src/i18n/en.json CHANGED
@@ -50,7 +50,7 @@
50
50
  "dataPrivacyInternal": "All users",
51
51
  "dataPrivacyPrivate": "Creator only",
52
52
  "dataPrivacyPublic": "Full public",
53
- "default": "Default",
53
+ "defaultItem": "Default",
54
54
  "delete": "Delete",
55
55
  "deleteConfirm": "Are you sure you want to permanently delete this {0}?",
56
56
  "description": "Description",
@@ -50,7 +50,7 @@
50
50
  "dataPrivacyInternal": "所有用户",
51
51
  "dataPrivacyPrivate": "创建者私有",
52
52
  "dataPrivacyPublic": "完全公开",
53
- "default": "默认",
53
+ "defaultItem": "默认",
54
54
  "delete": "删除",
55
55
  "deleteConfirm": "确定要永久删除此{0}吗?",
56
56
  "description": "描述",
@@ -50,7 +50,7 @@
50
50
  "dataPrivacyInternal": "所有用户",
51
51
  "dataPrivacyPrivate": "創建者私有",
52
52
  "dataPrivacyPublic": "完全公開",
53
- "default": "默認",
53
+ "defaultItem": "默認",
54
54
  "delete": "刪除",
55
55
  "deleteConfirm": "確定要永久刪除此{0}嗎?",
56
56
  "description": "描述",