@etsoo/appscript 1.2.70 → 1.2.73

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.
@@ -28,7 +28,7 @@ jobs:
28
28
  # Setup .npmrc file to publish to npm
29
29
  - uses: actions/setup-node@v1
30
30
  with:
31
- node-version: '14.18'
31
+ node-version: '18.x'
32
32
  registry-url: 'https://registry.npmjs.org'
33
33
 
34
34
  # Named after Continuous Integration, installs dependencies directly from package-lock.json
@@ -8,7 +8,7 @@ import {
8
8
  } from '@etsoo/notificationbase';
9
9
  import { ApiAuthorizationScheme, createClient } from '@etsoo/restclient';
10
10
  import { DataTypes, DomUtils, Utils, WindowStorage } from '@etsoo/shared';
11
- import { BusinessUtils } from '../../src';
11
+ import { BusinessUtils, IUser } from '../../src';
12
12
  import { AddressUtils } from '../../src/address/AddressUtils';
13
13
  import { IAppSettings } from '../../src/app/AppSettings';
14
14
  import { CoreApp } from '../../src/app/CoreApp';
@@ -49,7 +49,12 @@ class NotificationContainerTest extends NotificationContainer<
49
49
  var container = new NotificationContainerTest((update) => {});
50
50
 
51
51
  // Arrange
52
- class CoreAppTest extends CoreApp<IAppSettings, {}, NotificationCallProps> {
52
+ class CoreAppTest extends CoreApp<
53
+ IUser,
54
+ IAppSettings,
55
+ {},
56
+ NotificationCallProps
57
+ > {
53
58
  /**
54
59
  * Constructor
55
60
  * @param settings Settings
@@ -7,7 +7,7 @@ import { IdLabelDto } from '../dto/IdLabelDto';
7
7
  import { InitCallDto } from '../dto/InitCallDto';
8
8
  import { IActionResult } from '../result/IActionResult';
9
9
  import { InitCallResult, InitCallResultData } from '../result/InitCallResult';
10
- import { IUserData } from '../state/User';
10
+ import { IUser } from '../state/User';
11
11
  import { IAppSettings } from './AppSettings';
12
12
  import { UserRole } from './UserRole';
13
13
  /**
@@ -56,7 +56,7 @@ export declare type IAppFields = {
56
56
  /**
57
57
  * Core application interface
58
58
  */
59
- export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallProps> {
59
+ export interface ICoreApp<U extends IUser, S extends IAppSettings, N, C extends NotificationCallProps> {
60
60
  /**
61
61
  * Settings
62
62
  */
@@ -112,7 +112,7 @@ export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallP
112
112
  /**
113
113
  * User data
114
114
  */
115
- userData?: IUserData;
115
+ userData?: U;
116
116
  /**
117
117
  * Search input element
118
118
  */
@@ -379,7 +379,7 @@ export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallP
379
379
  * @param refreshToken Refresh token
380
380
  * @param keep Keep login or not
381
381
  */
382
- userLogin(user: IUserData, refreshToken: string, keep?: boolean): void;
382
+ userLogin(user: U, refreshToken: string, keep?: boolean): void;
383
383
  /**
384
384
  * User logout
385
385
  * @param clearToken Clear refresh token or not
@@ -399,7 +399,7 @@ export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallP
399
399
  /**
400
400
  * Core application
401
401
  */
402
- export declare abstract class CoreApp<S extends IAppSettings, N, C extends NotificationCallProps> implements ICoreApp<S, N, C> {
402
+ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N, C extends NotificationCallProps> implements ICoreApp<U, S, N, C> {
403
403
  /**
404
404
  * Settings
405
405
  */
@@ -458,8 +458,8 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
458
458
  /**
459
459
  * User data
460
460
  */
461
- get userData(): IUserData | undefined;
462
- protected set userData(value: IUserData | undefined);
461
+ get userData(): U | undefined;
462
+ protected set userData(value: U | undefined);
463
463
  private ipDetectCallbacks?;
464
464
  /**
465
465
  * Search input element
@@ -822,7 +822,7 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
822
822
  * @param refreshToken Refresh token
823
823
  * @param keep Keep login or not
824
824
  */
825
- userLogin(user: IUserData, refreshToken: string, keep?: boolean): void;
825
+ userLogin(user: U, refreshToken: string, keep?: boolean): void;
826
826
  /**
827
827
  * User logout
828
828
  * @param clearToken Clear refresh token or not
@@ -36,6 +36,7 @@
36
36
  "description": "Description",
37
37
  "done": "Done",
38
38
  "download": "Download",
39
+ "dragIndicator": "Drag indicator",
39
40
  "edit": "Edit",
40
41
  "email": "Email",
41
42
  "emailAddresses": "Email addresses",
@@ -36,6 +36,7 @@
36
36
  "description": "描述",
37
37
  "done": "完成",
38
38
  "download": "下载",
39
+ "dragIndicator": "拖动指示",
39
40
  "edit": "修改",
40
41
  "email": "电子邮箱",
41
42
  "emailAddresses": "电子邮箱",
@@ -36,6 +36,7 @@
36
36
  "description": "描述",
37
37
  "done": "完成",
38
38
  "download": "下載",
39
+ "dragIndicator": "拖動指示",
39
40
  "edit": "修改",
40
41
  "email": "電子郵箱",
41
42
  "emailAddresses": "電子郵箱",
@@ -7,7 +7,7 @@ import { IdLabelDto } from '../dto/IdLabelDto';
7
7
  import { InitCallDto } from '../dto/InitCallDto';
8
8
  import { IActionResult } from '../result/IActionResult';
9
9
  import { InitCallResult, InitCallResultData } from '../result/InitCallResult';
10
- import { IUserData } from '../state/User';
10
+ import { IUser } from '../state/User';
11
11
  import { IAppSettings } from './AppSettings';
12
12
  import { UserRole } from './UserRole';
13
13
  /**
@@ -56,7 +56,7 @@ export declare type IAppFields = {
56
56
  /**
57
57
  * Core application interface
58
58
  */
59
- export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallProps> {
59
+ export interface ICoreApp<U extends IUser, S extends IAppSettings, N, C extends NotificationCallProps> {
60
60
  /**
61
61
  * Settings
62
62
  */
@@ -112,7 +112,7 @@ export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallP
112
112
  /**
113
113
  * User data
114
114
  */
115
- userData?: IUserData;
115
+ userData?: U;
116
116
  /**
117
117
  * Search input element
118
118
  */
@@ -379,7 +379,7 @@ export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallP
379
379
  * @param refreshToken Refresh token
380
380
  * @param keep Keep login or not
381
381
  */
382
- userLogin(user: IUserData, refreshToken: string, keep?: boolean): void;
382
+ userLogin(user: U, refreshToken: string, keep?: boolean): void;
383
383
  /**
384
384
  * User logout
385
385
  * @param clearToken Clear refresh token or not
@@ -399,7 +399,7 @@ export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallP
399
399
  /**
400
400
  * Core application
401
401
  */
402
- export declare abstract class CoreApp<S extends IAppSettings, N, C extends NotificationCallProps> implements ICoreApp<S, N, C> {
402
+ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N, C extends NotificationCallProps> implements ICoreApp<U, S, N, C> {
403
403
  /**
404
404
  * Settings
405
405
  */
@@ -458,8 +458,8 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
458
458
  /**
459
459
  * User data
460
460
  */
461
- get userData(): IUserData | undefined;
462
- protected set userData(value: IUserData | undefined);
461
+ get userData(): U | undefined;
462
+ protected set userData(value: U | undefined);
463
463
  private ipDetectCallbacks?;
464
464
  /**
465
465
  * Search input element
@@ -822,7 +822,7 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
822
822
  * @param refreshToken Refresh token
823
823
  * @param keep Keep login or not
824
824
  */
825
- userLogin(user: IUserData, refreshToken: string, keep?: boolean): void;
825
+ userLogin(user: U, refreshToken: string, keep?: boolean): void;
826
826
  /**
827
827
  * User logout
828
828
  * @param clearToken Clear refresh token or not
@@ -36,6 +36,7 @@
36
36
  "description": "Description",
37
37
  "done": "Done",
38
38
  "download": "Download",
39
+ "dragIndicator": "Drag indicator",
39
40
  "edit": "Edit",
40
41
  "email": "Email",
41
42
  "emailAddresses": "Email addresses",
@@ -36,6 +36,7 @@
36
36
  "description": "描述",
37
37
  "done": "完成",
38
38
  "download": "下载",
39
+ "dragIndicator": "拖动指示",
39
40
  "edit": "修改",
40
41
  "email": "电子邮箱",
41
42
  "emailAddresses": "电子邮箱",
@@ -36,6 +36,7 @@
36
36
  "description": "描述",
37
37
  "done": "完成",
38
38
  "download": "下載",
39
+ "dragIndicator": "拖動指示",
39
40
  "edit": "修改",
40
41
  "email": "電子郵箱",
41
42
  "emailAddresses": "電子郵箱",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.2.70",
3
+ "version": "1.2.73",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -52,9 +52,9 @@
52
52
  },
53
53
  "homepage": "https://github.com/ETSOO/AppScript#readme",
54
54
  "dependencies": {
55
- "@etsoo/notificationbase": "^1.1.4",
56
- "@etsoo/restclient": "^1.0.69",
57
- "@etsoo/shared": "^1.1.40",
55
+ "@etsoo/notificationbase": "^1.1.5",
56
+ "@etsoo/restclient": "^1.0.70",
57
+ "@etsoo/shared": "^1.1.41",
58
58
  "@types/crypto-js": "^4.1.1",
59
59
  "crypto-js": "^4.1.1"
60
60
  },
@@ -37,7 +37,7 @@ import { InitCallDto } from '../dto/InitCallDto';
37
37
  import { ActionResultError } from '../result/ActionResultError';
38
38
  import { IActionResult } from '../result/IActionResult';
39
39
  import { InitCallResult, InitCallResultData } from '../result/InitCallResult';
40
- import { IUserData } from '../state/User';
40
+ import { IUser, IUserData } from '../state/User';
41
41
  import { IAppSettings } from './AppSettings';
42
42
  import { UserRole } from './UserRole';
43
43
 
@@ -104,6 +104,7 @@ export type IAppFields = { [key in typeof appFields[number]]: string };
104
104
  * Core application interface
105
105
  */
106
106
  export interface ICoreApp<
107
+ U extends IUser,
107
108
  S extends IAppSettings,
108
109
  N,
109
110
  C extends NotificationCallProps
@@ -176,7 +177,7 @@ export interface ICoreApp<
176
177
  /**
177
178
  * User data
178
179
  */
179
- userData?: IUserData;
180
+ userData?: U;
180
181
 
181
182
  /**
182
183
  * Search input element
@@ -518,7 +519,7 @@ export interface ICoreApp<
518
519
  * @param refreshToken Refresh token
519
520
  * @param keep Keep login or not
520
521
  */
521
- userLogin(user: IUserData, refreshToken: string, keep?: boolean): void;
522
+ userLogin(user: U, refreshToken: string, keep?: boolean): void;
522
523
 
523
524
  /**
524
525
  * User logout
@@ -543,10 +544,11 @@ export interface ICoreApp<
543
544
  * Core application
544
545
  */
545
546
  export abstract class CoreApp<
547
+ U extends IUser,
546
548
  S extends IAppSettings,
547
549
  N,
548
550
  C extends NotificationCallProps
549
- > implements ICoreApp<S, N, C>
551
+ > implements ICoreApp<U, S, N, C>
550
552
  {
551
553
  /**
552
554
  * Settings
@@ -628,14 +630,14 @@ export abstract class CoreApp<
628
630
  this._ipData = value;
629
631
  }
630
632
 
631
- private _userData?: IUserData;
633
+ private _userData?: U;
632
634
  /**
633
635
  * User data
634
636
  */
635
637
  get userData() {
636
638
  return this._userData;
637
639
  }
638
- protected set userData(value: IUserData | undefined) {
640
+ protected set userData(value: U | undefined) {
639
641
  this._userData = value;
640
642
  }
641
643
 
@@ -1870,7 +1872,7 @@ export abstract class CoreApp<
1870
1872
  * @param refreshToken Refresh token
1871
1873
  * @param keep Keep login or not
1872
1874
  */
1873
- userLogin(user: IUserData, refreshToken: string, keep?: boolean) {
1875
+ userLogin(user: U, refreshToken: string, keep?: boolean) {
1874
1876
  this.userData = user;
1875
1877
 
1876
1878
  // Cache the encrypted serverside device id
@@ -36,6 +36,7 @@
36
36
  "description": "Description",
37
37
  "done": "Done",
38
38
  "download": "Download",
39
+ "dragIndicator": "Drag indicator",
39
40
  "edit": "Edit",
40
41
  "email": "Email",
41
42
  "emailAddresses": "Email addresses",
@@ -36,6 +36,7 @@
36
36
  "description": "描述",
37
37
  "done": "完成",
38
38
  "download": "下载",
39
+ "dragIndicator": "拖动指示",
39
40
  "edit": "修改",
40
41
  "email": "电子邮箱",
41
42
  "emailAddresses": "电子邮箱",
@@ -36,6 +36,7 @@
36
36
  "description": "描述",
37
37
  "done": "完成",
38
38
  "download": "下載",
39
+ "dragIndicator": "拖動指示",
39
40
  "edit": "修改",
40
41
  "email": "電子郵箱",
41
42
  "emailAddresses": "電子郵箱",