@etsoo/appscript 1.6.12 → 1.6.13
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/__tests__/app/CoreApp.ts +7 -0
- package/lib/cjs/app/CoreApp.d.ts +4 -0
- package/lib/cjs/app/CoreApp.js +6 -0
- package/lib/cjs/app/IApp.d.ts +4 -0
- package/lib/mjs/app/CoreApp.d.ts +4 -0
- package/lib/mjs/app/CoreApp.js +6 -0
- package/lib/mjs/app/IApp.d.ts +4 -0
- package/package.json +5 -5
- package/src/app/CoreApp.ts +7 -0
- package/src/app/IApp.ts +5 -0
package/__tests__/app/CoreApp.ts
CHANGED
|
@@ -271,4 +271,11 @@ test("Tests for checkSesession", async () => {
|
|
|
271
271
|
expect(isSame).toBeTruthy();
|
|
272
272
|
return Promise.resolve();
|
|
273
273
|
});
|
|
274
|
+
|
|
275
|
+
app.clearSession();
|
|
276
|
+
|
|
277
|
+
await app.checkSession((isSame) => {
|
|
278
|
+
expect(isSame).toBeFalsy();
|
|
279
|
+
return Promise.resolve();
|
|
280
|
+
});
|
|
274
281
|
});
|
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -205,6 +205,10 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
205
205
|
* @param callback Callback
|
|
206
206
|
*/
|
|
207
207
|
checkSession(callback: (isSame: boolean) => Promise<void | false>): Promise<void>;
|
|
208
|
+
/**
|
|
209
|
+
* Clear user session
|
|
210
|
+
*/
|
|
211
|
+
clearSession(): void;
|
|
208
212
|
/**
|
|
209
213
|
* Create Auth API
|
|
210
214
|
* @param api Specify the API to use
|
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -306,6 +306,12 @@ class CoreApp {
|
|
|
306
306
|
this.storage.setData(sessionName, true);
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
+
/**
|
|
310
|
+
* Clear user session
|
|
311
|
+
*/
|
|
312
|
+
clearSession() {
|
|
313
|
+
this.storage.setData(this.addIdentifier("same-session"), undefined);
|
|
314
|
+
}
|
|
309
315
|
/**
|
|
310
316
|
* Create Auth API
|
|
311
317
|
* @param api Specify the API to use
|
package/lib/cjs/app/IApp.d.ts
CHANGED
|
@@ -283,6 +283,10 @@ export interface IApp {
|
|
|
283
283
|
* Clear device id
|
|
284
284
|
*/
|
|
285
285
|
clearDeviceId(): void;
|
|
286
|
+
/**
|
|
287
|
+
* Clear user session
|
|
288
|
+
*/
|
|
289
|
+
clearSession(): void;
|
|
286
290
|
/**
|
|
287
291
|
* Create API client, override to implement custom client creation by name
|
|
288
292
|
* @param name Client name
|
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -205,6 +205,10 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
205
205
|
* @param callback Callback
|
|
206
206
|
*/
|
|
207
207
|
checkSession(callback: (isSame: boolean) => Promise<void | false>): Promise<void>;
|
|
208
|
+
/**
|
|
209
|
+
* Clear user session
|
|
210
|
+
*/
|
|
211
|
+
clearSession(): void;
|
|
208
212
|
/**
|
|
209
213
|
* Create Auth API
|
|
210
214
|
* @param api Specify the API to use
|
package/lib/mjs/app/CoreApp.js
CHANGED
|
@@ -303,6 +303,12 @@ export class CoreApp {
|
|
|
303
303
|
this.storage.setData(sessionName, true);
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
+
/**
|
|
307
|
+
* Clear user session
|
|
308
|
+
*/
|
|
309
|
+
clearSession() {
|
|
310
|
+
this.storage.setData(this.addIdentifier("same-session"), undefined);
|
|
311
|
+
}
|
|
306
312
|
/**
|
|
307
313
|
* Create Auth API
|
|
308
314
|
* @param api Specify the API to use
|
package/lib/mjs/app/IApp.d.ts
CHANGED
|
@@ -283,6 +283,10 @@ export interface IApp {
|
|
|
283
283
|
* Clear device id
|
|
284
284
|
*/
|
|
285
285
|
clearDeviceId(): void;
|
|
286
|
+
/**
|
|
287
|
+
* Clear user session
|
|
288
|
+
*/
|
|
289
|
+
clearSession(): void;
|
|
286
290
|
/**
|
|
287
291
|
* Create API client, override to implement custom client creation by name
|
|
288
292
|
* @param name Client name
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/appscript",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.13",
|
|
4
4
|
"description": "Applications shared TypeScript framework",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/ETSOO/AppScript#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@etsoo/notificationbase": "^1.1.
|
|
39
|
-
"@etsoo/restclient": "^1.1.
|
|
40
|
-
"@etsoo/shared": "^1.2.
|
|
38
|
+
"@etsoo/notificationbase": "^1.1.59",
|
|
39
|
+
"@etsoo/restclient": "^1.1.24",
|
|
40
|
+
"@etsoo/shared": "^1.2.62",
|
|
41
41
|
"crypto-js": "^4.2.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -50,6 +50,6 @@
|
|
|
50
50
|
"@vitejs/plugin-react": "^4.3.4",
|
|
51
51
|
"jsdom": "^26.0.0",
|
|
52
52
|
"typescript": "^5.7.3",
|
|
53
|
-
"vitest": "^3.0.
|
|
53
|
+
"vitest": "^3.0.7"
|
|
54
54
|
}
|
|
55
55
|
}
|
package/src/app/CoreApp.ts
CHANGED
|
@@ -529,6 +529,13 @@ export abstract class CoreApp<
|
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
|
|
532
|
+
/**
|
|
533
|
+
* Clear user session
|
|
534
|
+
*/
|
|
535
|
+
clearSession() {
|
|
536
|
+
this.storage.setData(this.addIdentifier("same-session"), undefined);
|
|
537
|
+
}
|
|
538
|
+
|
|
532
539
|
/**
|
|
533
540
|
* Create Auth API
|
|
534
541
|
* @param api Specify the API to use
|
package/src/app/IApp.ts
CHANGED
|
@@ -370,6 +370,11 @@ export interface IApp {
|
|
|
370
370
|
*/
|
|
371
371
|
clearDeviceId(): void;
|
|
372
372
|
|
|
373
|
+
/**
|
|
374
|
+
* Clear user session
|
|
375
|
+
*/
|
|
376
|
+
clearSession(): void;
|
|
377
|
+
|
|
373
378
|
/**
|
|
374
379
|
* Create API client, override to implement custom client creation by name
|
|
375
380
|
* @param name Client name
|