@etsoo/appscript 1.3.6 → 1.3.8

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.
Files changed (112) hide show
  1. package/README.md +2 -14
  2. package/__tests__/app/CoreApp.ts +14 -14
  3. package/lib/cjs/address/AddressUtils.d.ts +0 -20
  4. package/lib/cjs/address/AddressUtils.js +0 -60
  5. package/lib/cjs/app/CoreApp.d.ts +11 -1
  6. package/lib/cjs/app/CoreApp.js +18 -2
  7. package/lib/cjs/app/IApp.d.ts +6 -0
  8. package/lib/cjs/erp/AddressApi.d.ts +13 -9
  9. package/lib/cjs/erp/AddressApi.js +23 -25
  10. package/lib/cjs/erp/BaseApi.d.ts +5 -3
  11. package/lib/cjs/erp/BaseApi.js +3 -1
  12. package/lib/cjs/erp/EntityApi.d.ts +78 -0
  13. package/lib/cjs/erp/EntityApi.js +91 -0
  14. package/lib/cjs/erp/OrgApi.d.ts +32 -5
  15. package/lib/cjs/erp/OrgApi.js +30 -12
  16. package/lib/cjs/erp/PublicApi.js +5 -5
  17. package/lib/cjs/{dto → erp/dto}/IdLabelDto.d.ts +0 -0
  18. package/lib/cjs/{dto → erp/dto}/IdLabelDto.js +0 -0
  19. package/lib/cjs/{dto → erp/dto}/IdLabelPrimaryDto.d.ts +0 -0
  20. package/lib/cjs/{dto → erp/dto}/IdLabelPrimaryDto.js +0 -0
  21. package/lib/cjs/{dto → erp/dto}/InitCallDto.d.ts +0 -0
  22. package/lib/cjs/{dto → erp/dto}/InitCallDto.js +0 -0
  23. package/lib/cjs/erp/dto/OrgQueryDto.d.ts +21 -0
  24. package/lib/cjs/{rq/LoginIdRQ.js → erp/dto/OrgQueryDto.js} +0 -0
  25. package/lib/cjs/erp/rq/OrgListRQ.d.ts +10 -0
  26. package/lib/cjs/{rq/LoginRQ.js → erp/rq/OrgListRQ.js} +0 -0
  27. package/lib/cjs/erp/rq/OrgQueryRQ.d.ts +14 -0
  28. package/lib/cjs/{rq/QueryRQ.js → erp/rq/OrgQueryRQ.js} +0 -0
  29. package/lib/cjs/erp/rq/OrgRQ.d.ts +25 -0
  30. package/lib/cjs/{rq/TiplistRQ.js → erp/rq/OrgRQ.js} +0 -0
  31. package/lib/cjs/{rq → erp/rq}/QueryRQ.d.ts +0 -0
  32. package/lib/cjs/erp/rq/QueryRQ.js +2 -0
  33. package/lib/cjs/erp/rq/RefreshTokenRQ.d.ts +29 -0
  34. package/lib/cjs/erp/rq/RefreshTokenRQ.js +2 -0
  35. package/lib/cjs/{rq → erp/rq}/TiplistRQ.d.ts +0 -0
  36. package/lib/cjs/erp/rq/TiplistRQ.js +2 -0
  37. package/lib/cjs/i18n/en-US.json +20 -0
  38. package/lib/cjs/i18n/zh-CN.json +20 -0
  39. package/lib/cjs/i18n/zh-HK.json +20 -0
  40. package/lib/cjs/index.d.ts +7 -7
  41. package/lib/cjs/index.js +10 -10
  42. package/lib/mjs/address/AddressUtils.d.ts +0 -20
  43. package/lib/mjs/address/AddressUtils.js +0 -37
  44. package/lib/mjs/app/CoreApp.d.ts +11 -1
  45. package/lib/mjs/app/CoreApp.js +18 -2
  46. package/lib/mjs/app/IApp.d.ts +6 -0
  47. package/lib/mjs/erp/AddressApi.d.ts +13 -9
  48. package/lib/mjs/erp/AddressApi.js +23 -25
  49. package/lib/mjs/erp/BaseApi.d.ts +5 -3
  50. package/lib/mjs/erp/BaseApi.js +3 -1
  51. package/lib/mjs/erp/EntityApi.d.ts +78 -0
  52. package/lib/mjs/erp/EntityApi.js +87 -0
  53. package/lib/mjs/erp/OrgApi.d.ts +32 -5
  54. package/lib/mjs/erp/OrgApi.js +30 -12
  55. package/lib/mjs/erp/PublicApi.js +5 -5
  56. package/lib/mjs/{dto → erp/dto}/IdLabelDto.d.ts +0 -0
  57. package/lib/mjs/{dto → erp/dto}/IdLabelDto.js +0 -0
  58. package/lib/mjs/{dto → erp/dto}/IdLabelPrimaryDto.d.ts +0 -0
  59. package/lib/mjs/{dto → erp/dto}/IdLabelPrimaryDto.js +0 -0
  60. package/lib/mjs/{dto → erp/dto}/InitCallDto.d.ts +0 -0
  61. package/lib/mjs/{dto → erp/dto}/InitCallDto.js +0 -0
  62. package/lib/mjs/erp/dto/OrgQueryDto.d.ts +21 -0
  63. package/lib/mjs/{rq/LoginIdRQ.js → erp/dto/OrgQueryDto.js} +0 -0
  64. package/lib/mjs/erp/rq/OrgListRQ.d.ts +10 -0
  65. package/lib/mjs/{rq/LoginRQ.js → erp/rq/OrgListRQ.js} +0 -0
  66. package/lib/mjs/erp/rq/OrgQueryRQ.d.ts +14 -0
  67. package/lib/mjs/{rq/QueryRQ.js → erp/rq/OrgQueryRQ.js} +0 -0
  68. package/lib/mjs/erp/rq/OrgRQ.d.ts +25 -0
  69. package/lib/mjs/{rq/TiplistRQ.js → erp/rq/OrgRQ.js} +0 -0
  70. package/lib/mjs/{rq → erp/rq}/QueryRQ.d.ts +0 -0
  71. package/lib/mjs/erp/rq/QueryRQ.js +1 -0
  72. package/lib/mjs/erp/rq/RefreshTokenRQ.d.ts +29 -0
  73. package/lib/mjs/erp/rq/RefreshTokenRQ.js +1 -0
  74. package/lib/mjs/{rq → erp/rq}/TiplistRQ.d.ts +0 -0
  75. package/lib/mjs/erp/rq/TiplistRQ.js +1 -0
  76. package/lib/mjs/i18n/en-US.json +20 -0
  77. package/lib/mjs/i18n/zh-CN.json +20 -0
  78. package/lib/mjs/i18n/zh-HK.json +20 -0
  79. package/lib/mjs/index.d.ts +7 -7
  80. package/lib/mjs/index.js +10 -10
  81. package/package.json +4 -4
  82. package/src/address/AddressUtils.ts +0 -45
  83. package/src/app/CoreApp.ts +21 -2
  84. package/src/app/IApp.ts +7 -0
  85. package/src/erp/AddressApi.ts +19 -22
  86. package/src/erp/BaseApi.ts +3 -2
  87. package/src/erp/EntityApi.ts +142 -0
  88. package/src/erp/OrgApi.ts +66 -19
  89. package/src/erp/PublicApi.ts +5 -7
  90. package/src/{dto → erp/dto}/IdLabelDto.ts +0 -0
  91. package/src/{dto → erp/dto}/IdLabelPrimaryDto.ts +0 -0
  92. package/src/{dto → erp/dto}/InitCallDto.ts +0 -0
  93. package/src/erp/dto/OrgQueryDto.ts +24 -0
  94. package/src/erp/rq/OrgListRQ.ts +11 -0
  95. package/src/erp/rq/OrgQueryRQ.ts +16 -0
  96. package/src/erp/rq/OrgRQ.ts +29 -0
  97. package/src/{rq → erp/rq}/QueryRQ.ts +0 -0
  98. package/src/erp/rq/RefreshTokenRQ.ts +34 -0
  99. package/src/{rq → erp/rq}/TiplistRQ.ts +0 -0
  100. package/src/i18n/en-US.json +20 -0
  101. package/src/i18n/zh-CN.json +20 -0
  102. package/src/i18n/zh-HK.json +20 -0
  103. package/src/index.ts +11 -12
  104. package/lib/cjs/rq/LoginIdRQ.d.ts +0 -17
  105. package/lib/cjs/rq/LoginRQ.d.ts +0 -22
  106. package/lib/mjs/rq/LoginIdRQ.d.ts +0 -17
  107. package/lib/mjs/rq/LoginRQ.d.ts +0 -22
  108. package/src/i18n/address.en-US.json +0 -21
  109. package/src/i18n/address.zh-CN.json +0 -21
  110. package/src/i18n/address.zh-HK.json +0 -21
  111. package/src/rq/LoginIdRQ.ts +0 -19
  112. package/src/rq/LoginRQ.ts +0 -26
@@ -1,20 +1,47 @@
1
- import { ListType } from '@etsoo/shared';
2
- import { BaseApi } from './BaseApi';
1
+ import { IApiPayload } from '@etsoo/restclient';
2
+ import { DataTypes, ListType } from '@etsoo/shared';
3
+ import { IApp } from '../app/IApp';
4
+ import { IdActionResult } from '../result/IActionResult';
5
+ import { OrgQueryDto } from './dto/OrgQueryDto';
6
+ import { EntityApi } from './EntityApi';
7
+ import { OrgListRQ } from './rq/OrgListRQ';
8
+ import { OrgQueryRQ } from './rq/OrgQueryRQ';
9
+ import { OrgRQ } from './rq/OrgRQ';
3
10
  /**
4
11
  * Organization API
5
12
  */
6
- export declare class OrgApi extends BaseApi {
13
+ export declare class OrgApi extends EntityApi {
14
+ /**
15
+ * Constructor
16
+ * @param app Application
17
+ */
18
+ constructor(app: IApp);
7
19
  /**
8
20
  * Get organization list
9
- * @param items Max items
21
+ * @param items Max items or request data
10
22
  * @param serviceId Service id
11
23
  * @returns Result
12
24
  */
13
25
  list(items?: number, serviceId?: number): Promise<ListType[] | undefined>;
26
+ list(rq: OrgListRQ): Promise<ListType[] | undefined>;
27
+ /**
28
+ * Query
29
+ * @param rq Request data
30
+ * @param payload Payload
31
+ * @returns Result
32
+ */
33
+ query(rq: OrgQueryRQ, payload?: IApiPayload<OrgQueryDto[], any>): Promise<OrgQueryDto[] | undefined>;
14
34
  /**
15
35
  * Switch organization
16
36
  * @param id Organization id
17
37
  * @param serviceId Service id
18
38
  */
19
- switch(id: number, serviceId?: number): Promise<boolean | undefined>;
39
+ switch(id: number, serviceId?: number, payload?: IApiPayload<boolean, any>): Promise<boolean | undefined>;
40
+ /**
41
+ * Update
42
+ * @param data Modal data
43
+ * @param payload Payload
44
+ * @returns Result
45
+ */
46
+ update(data: DataTypes.AddOrEditType<OrgRQ, true>, payload?: IApiPayload<IdActionResult, any>): Promise<IdActionResult<number> | undefined>;
20
47
  }
@@ -1,37 +1,55 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrgApi = void 0;
4
- const BaseApi_1 = require("./BaseApi");
4
+ const EntityApi_1 = require("./EntityApi");
5
5
  /**
6
6
  * Organization API
7
7
  */
8
- class OrgApi extends BaseApi_1.BaseApi {
8
+ class OrgApi extends EntityApi_1.EntityApi {
9
9
  /**
10
- * Get organization list
11
- * @param items Max items
12
- * @param serviceId Service id
10
+ * Constructor
11
+ * @param app Application
12
+ */
13
+ constructor(app) {
14
+ super('Organization', app);
15
+ }
16
+ list(items, serviceId, payload) {
17
+ payload !== null && payload !== void 0 ? payload : (payload = { defaultValue: [], showLoading: false });
18
+ const rq = typeof items === 'object' ? items : { items, serviceId };
19
+ return this.listBase(rq, payload);
20
+ }
21
+ /**
22
+ * Query
23
+ * @param rq Request data
24
+ * @param payload Payload
13
25
  * @returns Result
14
26
  */
15
- list(items, serviceId) {
16
- return this.app.api.post('Organization/List', {
17
- items,
18
- serviceId
19
- }, { defaultValue: [], showLoading: false });
27
+ query(rq, payload) {
28
+ return this.queryBase(rq, payload);
20
29
  }
21
30
  /**
22
31
  * Switch organization
23
32
  * @param id Organization id
24
33
  * @param serviceId Service id
25
34
  */
26
- async switch(id, serviceId) {
35
+ async switch(id, serviceId, payload) {
27
36
  const result = await this.app.api.put('Organization/Switch', {
28
37
  id,
29
38
  serviceId,
30
39
  deviceId: this.app.deviceId
31
- });
40
+ }, payload);
32
41
  if (result)
33
42
  return await this.app.refreshToken();
34
43
  return result;
35
44
  }
45
+ /**
46
+ * Update
47
+ * @param data Modal data
48
+ * @param payload Payload
49
+ * @returns Result
50
+ */
51
+ update(data, payload) {
52
+ return super.updateBase(data, payload);
53
+ }
36
54
  }
37
55
  exports.OrgApi = OrgApi;
@@ -16,7 +16,7 @@ class PublicApi extends BaseApi_1.BaseApi {
16
16
  */
17
17
  async currencies(currencyNames) {
18
18
  if (currencyNames == null)
19
- return (await this.app.api.get('Public/GetCurrencies'));
19
+ return (await this.api.get('Public/GetCurrencies'));
20
20
  else
21
21
  return currencyNames.map((name) => {
22
22
  var _a;
@@ -32,7 +32,7 @@ class PublicApi extends BaseApi_1.BaseApi {
32
32
  * @returns Result
33
33
  */
34
34
  exchangeRate(currency) {
35
- return this.app.api.get(`Public/ExchangeRate/${currency}`);
35
+ return this.api.get(`Public/ExchangeRate/${currency}`);
36
36
  }
37
37
  /**
38
38
  * Get exchange rate history
@@ -41,7 +41,7 @@ class PublicApi extends BaseApi_1.BaseApi {
41
41
  * @returns Result
42
42
  */
43
43
  exchangeRateHistory(currencies, months) {
44
- return this.app.api.post('Public/ExchangeRateHistory', { currencies, months }, { defaultValue: [] });
44
+ return this.api.post('Public/ExchangeRateHistory', { currencies, months }, { defaultValue: [] });
45
45
  }
46
46
  /**
47
47
  * Get product unit's label
@@ -74,7 +74,7 @@ class PublicApi extends BaseApi_1.BaseApi {
74
74
  * @param host Host URL
75
75
  */
76
76
  mobileQRCode(id, host) {
77
- return this.app.api.post('Public/MobileQRCode', { id, host });
77
+ return this.api.post('Public/MobileQRCode', { id, host });
78
78
  }
79
79
  /**
80
80
  * Get public and valid product data
@@ -84,7 +84,7 @@ class PublicApi extends BaseApi_1.BaseApi {
84
84
  */
85
85
  product(id, culture) {
86
86
  culture = this.app.checkLanguage(culture);
87
- return this.app.api.post(`Public/Product/${id}/${culture}`);
87
+ return this.api.post(`Public/Product/${id}/${culture}`);
88
88
  }
89
89
  /**
90
90
  *
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Organization query data
3
+ */
4
+ export declare type OrgQueryDto = {
5
+ /**
6
+ * Id
7
+ */
8
+ id: number;
9
+ /**
10
+ * Brand, like ETSOO
11
+ */
12
+ brand?: string;
13
+ /**
14
+ * Name, like ETSOO NZ LIMITED
15
+ */
16
+ name: string;
17
+ /**
18
+ * Creation
19
+ */
20
+ creation: string | Date;
21
+ };
@@ -0,0 +1,10 @@
1
+ import { TiplistRQ } from './TiplistRQ';
2
+ /**
3
+ * Organization list request data
4
+ */
5
+ export declare type OrgListRQ = TiplistRQ & {
6
+ /**
7
+ * Service id
8
+ */
9
+ serviceId?: number;
10
+ };
File without changes
@@ -0,0 +1,14 @@
1
+ import { QueryRQ } from './QueryRQ';
2
+ /**
3
+ * Organization query request data
4
+ */
5
+ export declare type OrgQueryRQ = QueryRQ & {
6
+ /**
7
+ * Name
8
+ */
9
+ name?: string;
10
+ /**
11
+ * Parent organization id
12
+ */
13
+ parentId?: number;
14
+ };
File without changes
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Organization add/edit request data
3
+ */
4
+ export declare type OrgRQ = {
5
+ /**
6
+ * Region id
7
+ */
8
+ regionId: string;
9
+ /**
10
+ * Name
11
+ */
12
+ name: string;
13
+ /**
14
+ * Identifier
15
+ */
16
+ identifier: string;
17
+ /**
18
+ * Brand
19
+ */
20
+ brand?: string;
21
+ /**
22
+ * Trade as
23
+ */
24
+ tradeAs?: string;
25
+ };
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Refresh token request data
3
+ */
4
+ export declare type RefreshTokenRQ = {
5
+ /**
6
+ * Device id
7
+ */
8
+ deviceId: string;
9
+ /**
10
+ * Login password
11
+ */
12
+ pwd?: string;
13
+ /**
14
+ * Service device id
15
+ */
16
+ serviceDeviceId?: string;
17
+ /**
18
+ * Service id
19
+ */
20
+ serviceId?: number;
21
+ /**
22
+ * Service Uid
23
+ */
24
+ serviceUid?: string;
25
+ /**
26
+ * Time zone
27
+ */
28
+ timezone?: string;
29
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -15,6 +15,13 @@
15
15
  "confirm": "Confirm",
16
16
  "confirmAction": "Are you sure you want to {0}?",
17
17
  "completeTip": "{0} completed",
18
+ "continentAF": "Africa",
19
+ "continentAN": "Antarctica",
20
+ "continentAS": "Asia",
21
+ "continentEU": "Europe",
22
+ "continentNA": "North America",
23
+ "continentOC": "Oceania",
24
+ "continentSA": "South America",
18
25
  "copy": "Copy",
19
26
  "creation": "Creation",
20
27
  "currentPassword": "Current password",
@@ -106,6 +113,19 @@
106
113
  "refresh": "Refresh",
107
114
  "refreshing": "Refreshing",
108
115
  "releaseToRefresh": "Release to refresh",
116
+ "region": "Country or region",
117
+ "regionAU": "Australia",
118
+ "regionCA": "Canada",
119
+ "regionCN": "Mainland China",
120
+ "regionDE": "Germany",
121
+ "regionFR": "France",
122
+ "regionGB": "United Kingdom",
123
+ "regionHK": "Hong Kong, China",
124
+ "regionIE": "Ireland",
125
+ "regionJP": "Japan",
126
+ "regionNZ": "New Zealand",
127
+ "regionSG": "Singapore",
128
+ "regionUS": "United States",
109
129
  "reloginTip": "Please enter your password, resubmit the data after successful login",
110
130
  "remove": "Remove",
111
131
  "renew": "Renew",
@@ -15,6 +15,13 @@
15
15
  "confirm": "确认",
16
16
  "confirmAction": "确定要{0}吗?",
17
17
  "completeTip": "已完成 {0}",
18
+ "continentAF": "非洲",
19
+ "continentAN": "南极洲",
20
+ "continentAS": "亚洲",
21
+ "continentEU": "欧洲",
22
+ "continentNA": "北美洲",
23
+ "continentOC": "大洋洲",
24
+ "continentSA": "南美洲",
18
25
  "copy": "复制",
19
26
  "creation": "登记时间",
20
27
  "currentPassword": "当前密码",
@@ -105,6 +112,19 @@
105
112
  "record": "记录",
106
113
  "refresh": "刷新",
107
114
  "refreshing": "正在刷新",
115
+ "region": "国家或地区",
116
+ "regionAU": "澳大利亚",
117
+ "regionCA": "加拿大",
118
+ "regionCN": "中国大陆",
119
+ "regionDE": "德国",
120
+ "regionFR": "法国",
121
+ "regionGB": "英国",
122
+ "regionHK": "中国香港",
123
+ "regionIE": "爱尔兰",
124
+ "regionJP": "日本",
125
+ "regionNZ": "新西兰",
126
+ "regionSG": "新加坡",
127
+ "regionUS": "美国",
108
128
  "releaseToRefresh": "释放刷新",
109
129
  "reloginTip": "请输入您的登录密码,登录成功后请重新提交数据",
110
130
  "remove": "移除",
@@ -15,6 +15,13 @@
15
15
  "confirm": "確認",
16
16
  "confirmAction": "確定要{0}嗎?",
17
17
  "completeTip": "已完成 {0}",
18
+ "continentAF": "非洲",
19
+ "continentAN": "南極洲",
20
+ "continentAS": "亞洲",
21
+ "continentEU": "歐洲",
22
+ "continentNA": "北美洲",
23
+ "continentOC": "大洋洲",
24
+ "continentSA": "南美洲",
18
25
  "copy": "複製",
19
26
  "creation": "登記時間",
20
27
  "currentPassword": "當前密碼",
@@ -105,6 +112,19 @@
105
112
  "record": "記錄",
106
113
  "refresh": "刷新",
107
114
  "refreshing": "正在刷新",
115
+ "region": "國家或地區",
116
+ "regionAU": "澳大利亞",
117
+ "regionCA": "加拿大",
118
+ "regionCN": "中國大陸",
119
+ "regionDE": "德國",
120
+ "regionFR": "法國",
121
+ "regionGB": "英國",
122
+ "regionHK": "中國香港",
123
+ "regionIE": "愛爾蘭",
124
+ "regionJP": "日本",
125
+ "regionNZ": "新西蘭",
126
+ "regionSG": "新加坡",
127
+ "regionUS": "美國",
108
128
  "releaseToRefresh": "釋放刷新",
109
129
  "reloginTip": "請輸入您的登錄密碼,登錄成功後請重新提交數據",
110
130
  "remove": "移除",
@@ -16,15 +16,19 @@ export * from './business/EntityStatus';
16
16
  export * from './business/ProductUnit';
17
17
  export * from './business/RepeatOption';
18
18
  export * from './def/ListItem';
19
- export * from './dto/IdLabelDto';
20
- export * from './dto/IdLabelPrimaryDto';
21
- export * from './dto/InitCallDto';
22
19
  export * from './erp/dto/CurrencyDto';
23
20
  export * from './erp/dto/ExchangeRateDto';
24
21
  export * from './erp/dto/ExchangeRateHistoryDto';
22
+ export * from './erp/dto/IdLabelDto';
23
+ export * from './erp/dto/IdLabelPrimaryDto';
24
+ export * from './erp/dto/InitCallDto';
25
25
  export * from './erp/dto/PublicProductDto';
26
+ export * from './erp/rq/QueryRQ';
27
+ export * from './erp/rq/RefreshTokenRQ';
28
+ export * from './erp/rq/TiplistRQ';
26
29
  export * from './erp/AddressApi';
27
30
  export * from './erp/BaseApi';
31
+ export * from './erp/EntityApi';
28
32
  export * from './erp/OrgApi';
29
33
  export * from './erp/PublicApi';
30
34
  export * from './i18n/enUS';
@@ -36,10 +40,6 @@ export * from './result/ActionResult';
36
40
  export * from './result/ActionResultError';
37
41
  export * from './result/IActionResult';
38
42
  export * from './result/InitCallResult';
39
- export * from './rq/LoginIdRQ';
40
- export * from './rq/LoginRQ';
41
- export * from './rq/QueryRQ';
42
- export * from './rq/TiplistRQ';
43
43
  export * from './state/Culture';
44
44
  export * from './state/State';
45
45
  export * from './state/User';
package/lib/cjs/index.js CHANGED
@@ -38,17 +38,22 @@ __exportStar(require("./business/ProductUnit"), exports);
38
38
  __exportStar(require("./business/RepeatOption"), exports);
39
39
  // def
40
40
  __exportStar(require("./def/ListItem"), exports);
41
- // dto
42
- __exportStar(require("./dto/IdLabelDto"), exports);
43
- __exportStar(require("./dto/IdLabelPrimaryDto"), exports);
44
- __exportStar(require("./dto/InitCallDto"), exports);
45
- // erp
41
+ // erp dto
46
42
  __exportStar(require("./erp/dto/CurrencyDto"), exports);
47
43
  __exportStar(require("./erp/dto/ExchangeRateDto"), exports);
48
44
  __exportStar(require("./erp/dto/ExchangeRateHistoryDto"), exports);
45
+ __exportStar(require("./erp/dto/IdLabelDto"), exports);
46
+ __exportStar(require("./erp/dto/IdLabelPrimaryDto"), exports);
47
+ __exportStar(require("./erp/dto/InitCallDto"), exports);
49
48
  __exportStar(require("./erp/dto/PublicProductDto"), exports);
49
+ // erp rq
50
+ __exportStar(require("./erp/rq/QueryRQ"), exports);
51
+ __exportStar(require("./erp/rq/RefreshTokenRQ"), exports);
52
+ __exportStar(require("./erp/rq/TiplistRQ"), exports);
53
+ // erp api
50
54
  __exportStar(require("./erp/AddressApi"), exports);
51
55
  __exportStar(require("./erp/BaseApi"), exports);
56
+ __exportStar(require("./erp/EntityApi"), exports);
52
57
  __exportStar(require("./erp/OrgApi"), exports);
53
58
  __exportStar(require("./erp/PublicApi"), exports);
54
59
  // i18n
@@ -64,11 +69,6 @@ __exportStar(require("./result/ActionResult"), exports);
64
69
  __exportStar(require("./result/ActionResultError"), exports);
65
70
  __exportStar(require("./result/IActionResult"), exports);
66
71
  __exportStar(require("./result/InitCallResult"), exports);
67
- // rq
68
- __exportStar(require("./rq/LoginIdRQ"), exports);
69
- __exportStar(require("./rq/LoginRQ"), exports);
70
- __exportStar(require("./rq/QueryRQ"), exports);
71
- __exportStar(require("./rq/TiplistRQ"), exports);
72
72
  // state
73
73
  __exportStar(require("./state/Culture"), exports);
74
74
  __exportStar(require("./state/State"), exports);
@@ -1,15 +1,8 @@
1
- import { DataTypes } from '@etsoo/shared';
2
1
  import { AddressRegion } from './AddressRegion';
3
2
  /**
4
3
  * Address utils
5
4
  */
6
5
  export declare namespace AddressUtils {
7
- /**
8
- * Get address labels
9
- * @param language Language
10
- * @returns Result
11
- */
12
- function getLabels(language: string): Promise<DataTypes.StringRecord>;
13
6
  /**
14
7
  * Get region from regions and detected region and language
15
8
  * @param regions Supported regions
@@ -17,17 +10,4 @@ export declare namespace AddressUtils {
17
10
  * @param detectedLanguage Detected language
18
11
  */
19
12
  function getRegion(regions: string[], detectedRegion?: string | null, detectedLanguage?: string | null): AddressRegion;
20
- /**
21
- * Get region label
22
- * @param id Region id
23
- * @param labels Labels
24
- * @returns Label
25
- */
26
- function getRegionLabel(id: string, labels: DataTypes.StringRecord): string;
27
- /**
28
- * Update region label
29
- * @param region Region
30
- * @param culture Culture
31
- */
32
- function updateRegionLabel(region: AddressRegion, culture: string): Promise<void>;
33
13
  }
@@ -1,25 +1,9 @@
1
1
  import { AddressRegion } from './AddressRegion';
2
- const languageLabels = {};
3
2
  /**
4
3
  * Address utils
5
4
  */
6
5
  export var AddressUtils;
7
6
  (function (AddressUtils) {
8
- /**
9
- * Get address labels
10
- * @param language Language
11
- * @returns Result
12
- */
13
- async function getLabels(language) {
14
- let labels = languageLabels[language];
15
- if (labels == null) {
16
- labels = await import(`./../i18n/address.${language}.json`);
17
- // Cache
18
- languageLabels[language] = labels;
19
- }
20
- return labels;
21
- }
22
- AddressUtils.getLabels = getLabels;
23
7
  /**
24
8
  * Get region from regions and detected region and language
25
9
  * @param regions Supported regions
@@ -45,25 +29,4 @@ export var AddressUtils;
45
29
  return AddressRegion.getById(regions[0]);
46
30
  }
47
31
  AddressUtils.getRegion = getRegion;
48
- /**
49
- * Get region label
50
- * @param id Region id
51
- * @param labels Labels
52
- * @returns Label
53
- */
54
- function getRegionLabel(id, labels) {
55
- var _a;
56
- return (_a = labels['region' + id]) !== null && _a !== void 0 ? _a : id;
57
- }
58
- AddressUtils.getRegionLabel = getRegionLabel;
59
- /**
60
- * Update region label
61
- * @param region Region
62
- * @param culture Culture
63
- */
64
- async function updateRegionLabel(region, culture) {
65
- const labels = await AddressUtils.getLabels(culture);
66
- region.label = getRegionLabel(region.id, labels);
67
- }
68
- AddressUtils.updateRegionLabel = updateRegionLabel;
69
32
  })(AddressUtils || (AddressUtils = {}));
@@ -2,7 +2,7 @@ import { INotifier, NotificationAlign, NotificationCallProps, NotificationConten
2
2
  import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
3
3
  import { DataTypes, DateUtils, IStorage, ListType, ListType1 } from '@etsoo/shared';
4
4
  import { AddressRegion } from '../address/AddressRegion';
5
- import { InitCallDto } from '../dto/InitCallDto';
5
+ import { InitCallDto } from '../erp/dto/InitCallDto';
6
6
  import { IActionResult } from '../result/IActionResult';
7
7
  import { InitCallResult, InitCallResultData } from '../result/InitCallResult';
8
8
  import { IUser } from '../state/User';
@@ -216,6 +216,10 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
216
216
  * @param culture New culture definition
217
217
  */
218
218
  changeCulture(culture: DataTypes.CultureDefinition): void;
219
+ /**
220
+ * Update current region label
221
+ */
222
+ protected updateRegionLabel(): void;
219
223
  /**
220
224
  * Check language is supported or not, return a valid language when supported
221
225
  * @param language Language
@@ -360,6 +364,12 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
360
364
  * @returns List
361
365
  */
362
366
  protected getEnumStrList<E extends DataTypes.EnumBase = DataTypes.EnumBase>(em: E, prefix: string, filter?: (id: E[keyof E], key: keyof E & string) => E[keyof E] | undefined): ListType1[];
367
+ /**
368
+ * Get region label
369
+ * @param id Region id
370
+ * @returns Label
371
+ */
372
+ getRegionLabel(id: string): string;
363
373
  /**
364
374
  * Get all regions
365
375
  * @returns Regions
@@ -3,7 +3,6 @@ import { ApiDataError } from '@etsoo/restclient';
3
3
  import { DataTypes, DateUtils, DomUtils, NumberUtils, Utils } from '@etsoo/shared';
4
4
  import { AES, algo, enc, HmacSHA512, lib, mode, pad, PBKDF2, SHA3 } from 'crypto-js';
5
5
  import { AddressRegion } from '../address/AddressRegion';
6
- import { AddressUtils } from '../address/AddressUtils';
7
6
  import { BridgeUtils } from '../bridges/BridgeUtils';
8
7
  import { EntityStatus } from '../business/EntityStatus';
9
8
  import { ActionResultError } from '../result/ActionResultError';
@@ -484,8 +483,8 @@ export class CoreApp {
484
483
  this._currency = regionItem.currency;
485
484
  this._region = regionId;
486
485
  // Hold the current country or region
487
- AddressUtils.updateRegionLabel(regionItem, this._culture);
488
486
  this.settings.currentRegion = regionItem;
487
+ this.updateRegionLabel();
489
488
  }
490
489
  /**
491
490
  * Change culture
@@ -506,6 +505,14 @@ export class CoreApp {
506
505
  this._culture = name;
507
506
  // Hold the current resources
508
507
  this.settings.currentCulture = culture;
508
+ this.updateRegionLabel();
509
+ }
510
+ /**
511
+ * Update current region label
512
+ */
513
+ updateRegionLabel() {
514
+ const region = this.settings.currentRegion;
515
+ region.label = this.getRegionLabel(region.id);
509
516
  }
510
517
  /**
511
518
  * Check language is supported or not, return a valid language when supported
@@ -893,6 +900,15 @@ export class CoreApp {
893
900
  }
894
901
  return list;
895
902
  }
903
+ /**
904
+ * Get region label
905
+ * @param id Region id
906
+ * @returns Label
907
+ */
908
+ getRegionLabel(id) {
909
+ var _a;
910
+ return (_a = this.get('region' + id)) !== null && _a !== void 0 ? _a : id;
911
+ }
896
912
  /**
897
913
  * Get all regions
898
914
  * @returns Regions