@etsoo/appscript 1.4.40 → 1.4.42
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 +2 -0
- package/lib/cjs/app/CoreApp.d.ts +1 -1
- package/lib/cjs/app/IApp.d.ts +2 -1
- package/lib/cjs/erp/PublicApi.d.ts +7 -1
- package/lib/cjs/erp/PublicApi.js +8 -0
- package/lib/mjs/app/CoreApp.d.ts +1 -1
- package/lib/mjs/app/IApp.d.ts +2 -1
- package/lib/mjs/erp/PublicApi.d.ts +7 -1
- package/lib/mjs/erp/PublicApi.js +8 -0
- package/package.json +8 -8
- package/src/app/CoreApp.ts +2 -1
- package/src/app/IApp.ts +2 -1
- package/src/erp/PublicApi.ts +10 -1
package/__tests__/app/CoreApp.ts
CHANGED
|
@@ -349,5 +349,7 @@ test('Tests for publicApi', async () => {
|
|
|
349
349
|
const orgsQuery = await app.orgApi.query({ currentPage: 1, batchSize: 2 });
|
|
350
350
|
console.log(orgsQuery);
|
|
351
351
|
|
|
352
|
+
const cultures = await app.publicApi.supportedCultures();
|
|
353
|
+
expect(cultures?.some((culture) => culture.id === 'zh-Hans')).toBeTruthy();
|
|
352
354
|
*/
|
|
353
355
|
});
|
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
72
72
|
/**
|
|
73
73
|
* Currency, like USD for US dollar
|
|
74
74
|
*/
|
|
75
|
-
get currency():
|
|
75
|
+
get currency(): "AUD" | "CAD" | "CNY" | "EUR" | "GBP" | "HKD" | "JPY" | "NZD" | "SGD" | "USD";
|
|
76
76
|
private _region;
|
|
77
77
|
/**
|
|
78
78
|
* Country or region, like CN
|
package/lib/cjs/app/IApp.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { IUser } from '../state/User';
|
|
|
7
7
|
import { IAppSettings } from './AppSettings';
|
|
8
8
|
import { UserRole } from './UserRole';
|
|
9
9
|
import { EntityStatus } from '../business/EntityStatus';
|
|
10
|
+
import { Currency } from '../business/Currency';
|
|
10
11
|
/**
|
|
11
12
|
* Detect IP callback interface
|
|
12
13
|
*/
|
|
@@ -92,7 +93,7 @@ export interface IApp {
|
|
|
92
93
|
/**
|
|
93
94
|
* Currency, like USD for US dollar
|
|
94
95
|
*/
|
|
95
|
-
readonly currency:
|
|
96
|
+
readonly currency: Currency;
|
|
96
97
|
/**
|
|
97
98
|
* Device id
|
|
98
99
|
*/
|
|
@@ -34,7 +34,7 @@ export declare class PublicApi extends BaseApi {
|
|
|
34
34
|
baseUnits(): ListType1[];
|
|
35
35
|
/**
|
|
36
36
|
* Get currencies
|
|
37
|
-
* @param names Limited currency names for local data, undefined will try to retrive
|
|
37
|
+
* @param names Limited currency names for local data, undefined will try to retrive remotely
|
|
38
38
|
* @returns Result
|
|
39
39
|
*/
|
|
40
40
|
currencies(): Promise<CurrencyDto[] | undefined>;
|
|
@@ -114,6 +114,12 @@ export declare class PublicApi extends BaseApi {
|
|
|
114
114
|
* @returns Units
|
|
115
115
|
*/
|
|
116
116
|
repeatOptions(options?: string[], isJoined?: boolean): ListType[];
|
|
117
|
+
/**
|
|
118
|
+
* Get all supported cultures
|
|
119
|
+
* @param payload Payload
|
|
120
|
+
* @returns Result
|
|
121
|
+
*/
|
|
122
|
+
supportedCultures(payload?: IApiPayload<ListType1[]>): Promise<ListType1[] | undefined>;
|
|
117
123
|
/**
|
|
118
124
|
* Get all product units
|
|
119
125
|
* @returns Units
|
package/lib/cjs/erp/PublicApi.js
CHANGED
|
@@ -204,6 +204,14 @@ class PublicApi extends BaseApi_1.BaseApi {
|
|
|
204
204
|
options !== null && options !== void 0 ? options : (options = shared_1.DataTypes.getEnumKeys(RepeatOption_1.RepeatOption));
|
|
205
205
|
return this.units(options, isJoined);
|
|
206
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Get all supported cultures
|
|
209
|
+
* @param payload Payload
|
|
210
|
+
* @returns Result
|
|
211
|
+
*/
|
|
212
|
+
supportedCultures(payload) {
|
|
213
|
+
return this.api.get('Public/SupportedCultures', undefined, payload);
|
|
214
|
+
}
|
|
207
215
|
/**
|
|
208
216
|
*
|
|
209
217
|
* Get all product units
|
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
72
72
|
/**
|
|
73
73
|
* Currency, like USD for US dollar
|
|
74
74
|
*/
|
|
75
|
-
get currency():
|
|
75
|
+
get currency(): "AUD" | "CAD" | "CNY" | "EUR" | "GBP" | "HKD" | "JPY" | "NZD" | "SGD" | "USD";
|
|
76
76
|
private _region;
|
|
77
77
|
/**
|
|
78
78
|
* Country or region, like CN
|
package/lib/mjs/app/IApp.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { IUser } from '../state/User';
|
|
|
7
7
|
import { IAppSettings } from './AppSettings';
|
|
8
8
|
import { UserRole } from './UserRole';
|
|
9
9
|
import { EntityStatus } from '../business/EntityStatus';
|
|
10
|
+
import { Currency } from '../business/Currency';
|
|
10
11
|
/**
|
|
11
12
|
* Detect IP callback interface
|
|
12
13
|
*/
|
|
@@ -92,7 +93,7 @@ export interface IApp {
|
|
|
92
93
|
/**
|
|
93
94
|
* Currency, like USD for US dollar
|
|
94
95
|
*/
|
|
95
|
-
readonly currency:
|
|
96
|
+
readonly currency: Currency;
|
|
96
97
|
/**
|
|
97
98
|
* Device id
|
|
98
99
|
*/
|
|
@@ -34,7 +34,7 @@ export declare class PublicApi extends BaseApi {
|
|
|
34
34
|
baseUnits(): ListType1[];
|
|
35
35
|
/**
|
|
36
36
|
* Get currencies
|
|
37
|
-
* @param names Limited currency names for local data, undefined will try to retrive
|
|
37
|
+
* @param names Limited currency names for local data, undefined will try to retrive remotely
|
|
38
38
|
* @returns Result
|
|
39
39
|
*/
|
|
40
40
|
currencies(): Promise<CurrencyDto[] | undefined>;
|
|
@@ -114,6 +114,12 @@ export declare class PublicApi extends BaseApi {
|
|
|
114
114
|
* @returns Units
|
|
115
115
|
*/
|
|
116
116
|
repeatOptions(options?: string[], isJoined?: boolean): ListType[];
|
|
117
|
+
/**
|
|
118
|
+
* Get all supported cultures
|
|
119
|
+
* @param payload Payload
|
|
120
|
+
* @returns Result
|
|
121
|
+
*/
|
|
122
|
+
supportedCultures(payload?: IApiPayload<ListType1[]>): Promise<ListType1[] | undefined>;
|
|
117
123
|
/**
|
|
118
124
|
* Get all product units
|
|
119
125
|
* @returns Units
|
package/lib/mjs/erp/PublicApi.js
CHANGED
|
@@ -201,6 +201,14 @@ export class PublicApi extends BaseApi {
|
|
|
201
201
|
options !== null && options !== void 0 ? options : (options = DataTypes.getEnumKeys(RepeatOption));
|
|
202
202
|
return this.units(options, isJoined);
|
|
203
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Get all supported cultures
|
|
206
|
+
* @param payload Payload
|
|
207
|
+
* @returns Result
|
|
208
|
+
*/
|
|
209
|
+
supportedCultures(payload) {
|
|
210
|
+
return this.api.get('Public/SupportedCultures', undefined, payload);
|
|
211
|
+
}
|
|
204
212
|
/**
|
|
205
213
|
*
|
|
206
214
|
* Get all product units
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/appscript",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.42",
|
|
4
4
|
"description": "Applications shared TypeScript framework",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -54,16 +54,16 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@etsoo/notificationbase": "^1.1.28",
|
|
56
56
|
"@etsoo/restclient": "^1.0.89",
|
|
57
|
-
"@etsoo/shared": "^1.2.
|
|
57
|
+
"@etsoo/shared": "^1.2.12",
|
|
58
58
|
"crypto-js": "^4.1.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@babel/cli": "^7.22.
|
|
62
|
-
"@babel/core": "^7.22.
|
|
63
|
-
"@babel/plugin-transform-runtime": "^7.22.
|
|
64
|
-
"@babel/preset-env": "^7.22.
|
|
65
|
-
"@babel/runtime-corejs3": "^7.22.
|
|
66
|
-
"@types/crypto-js": "^4.1.
|
|
61
|
+
"@babel/cli": "^7.22.15",
|
|
62
|
+
"@babel/core": "^7.22.15",
|
|
63
|
+
"@babel/plugin-transform-runtime": "^7.22.15",
|
|
64
|
+
"@babel/preset-env": "^7.22.15",
|
|
65
|
+
"@babel/runtime-corejs3": "^7.22.15",
|
|
66
|
+
"@types/crypto-js": "^4.1.2",
|
|
67
67
|
"@types/jest": "^29.5.4",
|
|
68
68
|
"jest": "^29.6.4",
|
|
69
69
|
"jest-environment-jsdom": "^29.6.4",
|
package/src/app/CoreApp.ts
CHANGED
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
} from './IApp';
|
|
40
40
|
import { UserRole } from './UserRole';
|
|
41
41
|
import type CryptoJS from 'crypto-js';
|
|
42
|
+
import { Currency } from '../business/Currency';
|
|
42
43
|
|
|
43
44
|
type CJType = typeof CryptoJS;
|
|
44
45
|
let CJ: CJType;
|
|
@@ -126,7 +127,7 @@ export abstract class CoreApp<
|
|
|
126
127
|
return this._culture;
|
|
127
128
|
}
|
|
128
129
|
|
|
129
|
-
private _currency!:
|
|
130
|
+
private _currency!: Currency;
|
|
130
131
|
/**
|
|
131
132
|
* Currency, like USD for US dollar
|
|
132
133
|
*/
|
package/src/app/IApp.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { IUser } from '../state/User';
|
|
|
19
19
|
import { IAppSettings } from './AppSettings';
|
|
20
20
|
import { UserRole } from './UserRole';
|
|
21
21
|
import { EntityStatus } from '../business/EntityStatus';
|
|
22
|
+
import { Currency } from '../business/Currency';
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* Detect IP callback interface
|
|
@@ -129,7 +130,7 @@ export interface IApp {
|
|
|
129
130
|
/**
|
|
130
131
|
* Currency, like USD for US dollar
|
|
131
132
|
*/
|
|
132
|
-
readonly currency:
|
|
133
|
+
readonly currency: Currency;
|
|
133
134
|
|
|
134
135
|
/**
|
|
135
136
|
* Device id
|
package/src/erp/PublicApi.ts
CHANGED
|
@@ -52,7 +52,7 @@ export class PublicApi extends BaseApi {
|
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Get currencies
|
|
55
|
-
* @param names Limited currency names for local data, undefined will try to retrive
|
|
55
|
+
* @param names Limited currency names for local data, undefined will try to retrive remotely
|
|
56
56
|
* @returns Result
|
|
57
57
|
*/
|
|
58
58
|
currencies(): Promise<CurrencyDto[] | undefined>;
|
|
@@ -258,6 +258,15 @@ export class PublicApi extends BaseApi {
|
|
|
258
258
|
return this.units(options, isJoined);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
+
/**
|
|
262
|
+
* Get all supported cultures
|
|
263
|
+
* @param payload Payload
|
|
264
|
+
* @returns Result
|
|
265
|
+
*/
|
|
266
|
+
supportedCultures(payload?: IApiPayload<ListType1[]>) {
|
|
267
|
+
return this.api.get('Public/SupportedCultures', undefined, payload);
|
|
268
|
+
}
|
|
269
|
+
|
|
261
270
|
/**
|
|
262
271
|
* Get all product units
|
|
263
272
|
* @returns Units
|