@etsoo/appscript 1.4.23 → 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.
- package/lib/cjs/app/CoreApp.d.ts +4 -0
- package/lib/cjs/app/CoreApp.js +10 -2
- package/lib/cjs/app/IApp.d.ts +4 -0
- package/lib/mjs/app/CoreApp.d.ts +4 -0
- package/lib/mjs/app/CoreApp.js +10 -2
- package/lib/mjs/app/IApp.d.ts +4 -0
- package/package.json +4 -4
- package/src/app/CoreApp.ts +13 -2
- 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,18 @@ 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.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.
|
|
357
|
+
this.clearDeviceId();
|
|
350
358
|
this.resetKeys();
|
|
351
359
|
}
|
|
352
360
|
// Passphrase exists?
|
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,18 @@ 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.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.
|
|
331
|
+
this.clearDeviceId();
|
|
324
332
|
this.resetKeys();
|
|
325
333
|
}
|
|
326
334
|
// Passphrase exists?
|
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.24",
|
|
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,22 @@ 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.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.
|
|
520
|
+
this.clearDeviceId();
|
|
510
521
|
this.resetKeys();
|
|
511
522
|
}
|
|
512
523
|
|