@etsoo/appscript 1.1.81 → 1.1.82
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 +12 -1
- package/lib/cjs/app/CoreApp.js +13 -1
- package/lib/mjs/app/CoreApp.d.ts +12 -1
- package/lib/mjs/app/CoreApp.js +13 -1
- package/package.json +1 -1
- package/src/app/CoreApp.ts +15 -4
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import { INotifier, NotificationAlign, NotificationCallProps, NotificationConten
|
|
|
2
2
|
import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
|
|
3
3
|
import { DataTypes, DateUtils } from '@etsoo/shared';
|
|
4
4
|
import { AddressRegion } from '../address/AddressRegion';
|
|
5
|
+
import { InitCallDto } from '../dto/InitCallDto';
|
|
5
6
|
import { IActionResult } from '../result/IActionResult';
|
|
6
|
-
import { InitCallResultData } from '../result/InitCallResult';
|
|
7
|
+
import { InitCallResult, InitCallResultData } from '../result/InitCallResult';
|
|
7
8
|
import { IUserData } from '../state/User';
|
|
8
9
|
import { IAppSettings } from './AppSettings';
|
|
9
10
|
import { UserRole } from './UserRole';
|
|
@@ -402,6 +403,10 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
|
|
|
402
403
|
* Device id field name
|
|
403
404
|
*/
|
|
404
405
|
protected deviceIdField: string;
|
|
406
|
+
/**
|
|
407
|
+
* Init call Api URL
|
|
408
|
+
*/
|
|
409
|
+
protected initCallApi: string;
|
|
405
410
|
/**
|
|
406
411
|
* Passphrase for encryption
|
|
407
412
|
*/
|
|
@@ -416,6 +421,12 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
|
|
|
416
421
|
*/
|
|
417
422
|
protected constructor(settings: S, api: IApi, notifier: INotifier<N, C>, name: string);
|
|
418
423
|
protected setApi(api: IApi): void;
|
|
424
|
+
/**
|
|
425
|
+
* Api init call
|
|
426
|
+
* @param data Data
|
|
427
|
+
* @returns Result
|
|
428
|
+
*/
|
|
429
|
+
protected apiInitCall(data: InitCallDto): Promise<InitCallResult | undefined>;
|
|
419
430
|
/**
|
|
420
431
|
* Init call
|
|
421
432
|
* @param callback Callback
|
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -39,6 +39,10 @@ class CoreApp {
|
|
|
39
39
|
* Device id field name
|
|
40
40
|
*/
|
|
41
41
|
this.deviceIdField = 'SmartERPDeviceId';
|
|
42
|
+
/**
|
|
43
|
+
* Init call Api URL
|
|
44
|
+
*/
|
|
45
|
+
this.initCallApi = 'Auth/WebInitCall';
|
|
42
46
|
/**
|
|
43
47
|
* Passphrase for encryption
|
|
44
48
|
*/
|
|
@@ -127,6 +131,14 @@ class CoreApp {
|
|
|
127
131
|
}
|
|
128
132
|
};
|
|
129
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Api init call
|
|
136
|
+
* @param data Data
|
|
137
|
+
* @returns Result
|
|
138
|
+
*/
|
|
139
|
+
async apiInitCall(data) {
|
|
140
|
+
return await this.api.put(this.initCallApi, data);
|
|
141
|
+
}
|
|
130
142
|
/**
|
|
131
143
|
* Init call
|
|
132
144
|
* @param callback Callback
|
|
@@ -138,7 +150,7 @@ class CoreApp {
|
|
|
138
150
|
timestamp: new Date().getTime(),
|
|
139
151
|
deviceId: this.deviceId === '' ? undefined : this.deviceId
|
|
140
152
|
};
|
|
141
|
-
const result = await this.
|
|
153
|
+
const result = await this.apiInitCall(data);
|
|
142
154
|
if (result == null) {
|
|
143
155
|
if (callback)
|
|
144
156
|
callback(false);
|
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import { INotifier, NotificationAlign, NotificationCallProps, NotificationConten
|
|
|
2
2
|
import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
|
|
3
3
|
import { DataTypes, DateUtils } from '@etsoo/shared';
|
|
4
4
|
import { AddressRegion } from '../address/AddressRegion';
|
|
5
|
+
import { InitCallDto } from '../dto/InitCallDto';
|
|
5
6
|
import { IActionResult } from '../result/IActionResult';
|
|
6
|
-
import { InitCallResultData } from '../result/InitCallResult';
|
|
7
|
+
import { InitCallResult, InitCallResultData } from '../result/InitCallResult';
|
|
7
8
|
import { IUserData } from '../state/User';
|
|
8
9
|
import { IAppSettings } from './AppSettings';
|
|
9
10
|
import { UserRole } from './UserRole';
|
|
@@ -402,6 +403,10 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
|
|
|
402
403
|
* Device id field name
|
|
403
404
|
*/
|
|
404
405
|
protected deviceIdField: string;
|
|
406
|
+
/**
|
|
407
|
+
* Init call Api URL
|
|
408
|
+
*/
|
|
409
|
+
protected initCallApi: string;
|
|
405
410
|
/**
|
|
406
411
|
* Passphrase for encryption
|
|
407
412
|
*/
|
|
@@ -416,6 +421,12 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
|
|
|
416
421
|
*/
|
|
417
422
|
protected constructor(settings: S, api: IApi, notifier: INotifier<N, C>, name: string);
|
|
418
423
|
protected setApi(api: IApi): void;
|
|
424
|
+
/**
|
|
425
|
+
* Api init call
|
|
426
|
+
* @param data Data
|
|
427
|
+
* @returns Result
|
|
428
|
+
*/
|
|
429
|
+
protected apiInitCall(data: InitCallDto): Promise<InitCallResult | undefined>;
|
|
419
430
|
/**
|
|
420
431
|
* Init call
|
|
421
432
|
* @param callback Callback
|
package/lib/mjs/app/CoreApp.js
CHANGED
|
@@ -36,6 +36,10 @@ export class CoreApp {
|
|
|
36
36
|
* Device id field name
|
|
37
37
|
*/
|
|
38
38
|
this.deviceIdField = 'SmartERPDeviceId';
|
|
39
|
+
/**
|
|
40
|
+
* Init call Api URL
|
|
41
|
+
*/
|
|
42
|
+
this.initCallApi = 'Auth/WebInitCall';
|
|
39
43
|
/**
|
|
40
44
|
* Passphrase for encryption
|
|
41
45
|
*/
|
|
@@ -124,6 +128,14 @@ export class CoreApp {
|
|
|
124
128
|
}
|
|
125
129
|
};
|
|
126
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Api init call
|
|
133
|
+
* @param data Data
|
|
134
|
+
* @returns Result
|
|
135
|
+
*/
|
|
136
|
+
async apiInitCall(data) {
|
|
137
|
+
return await this.api.put(this.initCallApi, data);
|
|
138
|
+
}
|
|
127
139
|
/**
|
|
128
140
|
* Init call
|
|
129
141
|
* @param callback Callback
|
|
@@ -135,7 +147,7 @@ export class CoreApp {
|
|
|
135
147
|
timestamp: new Date().getTime(),
|
|
136
148
|
deviceId: this.deviceId === '' ? undefined : this.deviceId
|
|
137
149
|
};
|
|
138
|
-
const result = await this.
|
|
150
|
+
const result = await this.apiInitCall(data);
|
|
139
151
|
if (result == null) {
|
|
140
152
|
if (callback)
|
|
141
153
|
callback(false);
|
package/package.json
CHANGED
package/src/app/CoreApp.ts
CHANGED
|
@@ -557,6 +557,11 @@ export abstract class CoreApp<
|
|
|
557
557
|
*/
|
|
558
558
|
protected deviceIdField: string = 'SmartERPDeviceId';
|
|
559
559
|
|
|
560
|
+
/**
|
|
561
|
+
* Init call Api URL
|
|
562
|
+
*/
|
|
563
|
+
protected initCallApi: string = 'Auth/WebInitCall';
|
|
564
|
+
|
|
560
565
|
/**
|
|
561
566
|
* Passphrase for encryption
|
|
562
567
|
*/
|
|
@@ -631,6 +636,15 @@ export abstract class CoreApp<
|
|
|
631
636
|
};
|
|
632
637
|
}
|
|
633
638
|
|
|
639
|
+
/**
|
|
640
|
+
* Api init call
|
|
641
|
+
* @param data Data
|
|
642
|
+
* @returns Result
|
|
643
|
+
*/
|
|
644
|
+
protected async apiInitCall(data: InitCallDto) {
|
|
645
|
+
return await this.api.put<InitCallResult>(this.initCallApi, data);
|
|
646
|
+
}
|
|
647
|
+
|
|
634
648
|
/**
|
|
635
649
|
* Init call
|
|
636
650
|
* @param callback Callback
|
|
@@ -641,10 +655,7 @@ export abstract class CoreApp<
|
|
|
641
655
|
timestamp: new Date().getTime(),
|
|
642
656
|
deviceId: this.deviceId === '' ? undefined : this.deviceId
|
|
643
657
|
};
|
|
644
|
-
const result = await this.
|
|
645
|
-
'Auth/WebInitCall',
|
|
646
|
-
data
|
|
647
|
-
);
|
|
658
|
+
const result = await this.apiInitCall(data);
|
|
648
659
|
if (result == null) {
|
|
649
660
|
if (callback) callback(false);
|
|
650
661
|
return;
|