@etsoo/appscript 1.4.23 → 1.4.25
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/lib/cjs/app/CoreApp.d.ts +4 -0
- package/lib/cjs/app/CoreApp.js +12 -3
- package/lib/cjs/app/IApp.d.ts +4 -0
- package/lib/mjs/app/CoreApp.d.ts +4 -0
- package/lib/mjs/app/CoreApp.js +12 -3
- package/lib/mjs/app/IApp.d.ts +4 -0
- package/package.json +4 -4
- package/src/app/CoreApp.ts +15 -3
- package/src/app/IApp.ts +5 -0
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -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
|
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -332,10 +332,19 @@ class CoreApp {
|
|
|
332
332
|
* @returns true means device is invalid
|
|
333
333
|
*/
|
|
334
334
|
checkDeviceResult(result) {
|
|
335
|
-
if (result.type === '
|
|
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.clear([this.fields.deviceId], false);
|
|
346
|
+
this.storage.clear([this.fields.deviceId], true);
|
|
347
|
+
}
|
|
339
348
|
/**
|
|
340
349
|
* Init call
|
|
341
350
|
* @param callback Callback
|
|
@@ -346,7 +355,7 @@ class CoreApp {
|
|
|
346
355
|
var _a;
|
|
347
356
|
// Reset keys
|
|
348
357
|
if (resetKeys) {
|
|
349
|
-
this.
|
|
358
|
+
this.clearDeviceId();
|
|
350
359
|
this.resetKeys();
|
|
351
360
|
}
|
|
352
361
|
// Passphrase exists?
|
|
@@ -394,7 +403,7 @@ class CoreApp {
|
|
|
394
403
|
if (callback)
|
|
395
404
|
callback(false);
|
|
396
405
|
// Clear device id
|
|
397
|
-
this.
|
|
406
|
+
this.clearDeviceId();
|
|
398
407
|
return;
|
|
399
408
|
}
|
|
400
409
|
const updateResult = await this.initCallUpdate(result.data, data.timestamp);
|
package/lib/cjs/app/IApp.d.ts
CHANGED
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -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
|
package/lib/mjs/app/CoreApp.js
CHANGED
|
@@ -306,10 +306,19 @@ export class CoreApp {
|
|
|
306
306
|
* @returns true means device is invalid
|
|
307
307
|
*/
|
|
308
308
|
checkDeviceResult(result) {
|
|
309
|
-
if (result.type === '
|
|
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.clear([this.fields.deviceId], false);
|
|
320
|
+
this.storage.clear([this.fields.deviceId], true);
|
|
321
|
+
}
|
|
313
322
|
/**
|
|
314
323
|
* Init call
|
|
315
324
|
* @param callback Callback
|
|
@@ -320,7 +329,7 @@ export class CoreApp {
|
|
|
320
329
|
var _a;
|
|
321
330
|
// Reset keys
|
|
322
331
|
if (resetKeys) {
|
|
323
|
-
this.
|
|
332
|
+
this.clearDeviceId();
|
|
324
333
|
this.resetKeys();
|
|
325
334
|
}
|
|
326
335
|
// Passphrase exists?
|
|
@@ -368,7 +377,7 @@ export class CoreApp {
|
|
|
368
377
|
if (callback)
|
|
369
378
|
callback(false);
|
|
370
379
|
// Clear device id
|
|
371
|
-
this.
|
|
380
|
+
this.clearDeviceId();
|
|
372
381
|
return;
|
|
373
382
|
}
|
|
374
383
|
const updateResult = await this.initCallUpdate(result.data, data.timestamp);
|
package/lib/mjs/app/IApp.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/appscript",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.25",
|
|
4
4
|
"description": "Applications shared TypeScript framework",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -59,14 +59,14 @@
|
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@babel/cli": "^7.22.6",
|
|
62
|
-
"@babel/core": "^7.22.
|
|
62
|
+
"@babel/core": "^7.22.8",
|
|
63
63
|
"@babel/plugin-transform-runtime": "^7.22.7",
|
|
64
64
|
"@babel/preset-env": "^7.22.7",
|
|
65
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.6.
|
|
69
|
-
"jest-environment-jsdom": "^29.6.
|
|
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
|
}
|
package/src/app/CoreApp.ts
CHANGED
|
@@ -492,11 +492,23 @@ export abstract class CoreApp<
|
|
|
492
492
|
* @returns true means device is invalid
|
|
493
493
|
*/
|
|
494
494
|
checkDeviceResult(result: IActionResult): boolean {
|
|
495
|
-
if (
|
|
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.clear([this.fields.deviceId], false);
|
|
509
|
+
this.storage.clear([this.fields.deviceId], true);
|
|
510
|
+
}
|
|
511
|
+
|
|
500
512
|
/**
|
|
501
513
|
* Init call
|
|
502
514
|
* @param callback Callback
|
|
@@ -506,7 +518,7 @@ export abstract class CoreApp<
|
|
|
506
518
|
async initCall(callback?: (result: boolean) => void, resetKeys?: boolean) {
|
|
507
519
|
// Reset keys
|
|
508
520
|
if (resetKeys) {
|
|
509
|
-
this.
|
|
521
|
+
this.clearDeviceId();
|
|
510
522
|
this.resetKeys();
|
|
511
523
|
}
|
|
512
524
|
|
|
@@ -565,7 +577,7 @@ export abstract class CoreApp<
|
|
|
565
577
|
if (callback) callback(false);
|
|
566
578
|
|
|
567
579
|
// Clear device id
|
|
568
|
-
this.
|
|
580
|
+
this.clearDeviceId();
|
|
569
581
|
|
|
570
582
|
return;
|
|
571
583
|
}
|