@etsoo/appscript 1.5.64 → 1.5.66

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 (182) hide show
  1. package/.github/workflows/main.yml +6 -5
  2. package/__tests__/app/CoreApp.ts +141 -143
  3. package/__tests__/app/Culture.ts +23 -23
  4. package/__tests__/app/TestApp.ts +107 -105
  5. package/__tests__/business/BusinessUtils.ts +37 -37
  6. package/__tests__/result/ActionResult.ts +14 -14
  7. package/__tests__/tsconfig.json +16 -16
  8. package/lib/cjs/address/AddressAutocomplete.d.ts +1 -1
  9. package/lib/cjs/address/AddressPlace.d.ts +3 -3
  10. package/lib/cjs/address/AddressPlaceBase.d.ts +1 -1
  11. package/lib/cjs/address/AddressRegion.d.ts +2 -2
  12. package/lib/cjs/address/AddressRegion.js +12 -12
  13. package/lib/cjs/address/AddressUtils.d.ts +1 -1
  14. package/lib/cjs/api/AuthApi.d.ts +14 -14
  15. package/lib/cjs/api/AuthApi.js +17 -17
  16. package/lib/cjs/api/BaseApi.d.ts +1 -1
  17. package/lib/cjs/api/EntityApi.d.ts +8 -8
  18. package/lib/cjs/api/EntityApi.js +4 -4
  19. package/lib/cjs/api/dto/IdLabelDto.d.ts +1 -1
  20. package/lib/cjs/api/dto/IdLabelPrimaryDto.d.ts +1 -1
  21. package/lib/cjs/api/dto/ResultPayload.d.ts +2 -2
  22. package/lib/cjs/api/rq/AuthRequest.d.ts +1 -1
  23. package/lib/cjs/api/rq/LoginRQ.d.ts +2 -2
  24. package/lib/cjs/api/rq/MergeRQ.d.ts +1 -1
  25. package/lib/cjs/api/rq/QueryRQ.d.ts +2 -2
  26. package/lib/cjs/api/rq/StatusQueryRQ.d.ts +3 -3
  27. package/lib/cjs/api/rq/UpdateModel.d.ts +2 -2
  28. package/lib/cjs/api/rq/UpdateStatusRQ.d.ts +2 -2
  29. package/lib/cjs/app/AppSettings.d.ts +3 -3
  30. package/lib/cjs/bridges/FlutterHost.d.ts +2 -2
  31. package/lib/cjs/bridges/FlutterHost.js +11 -11
  32. package/lib/cjs/business/BusinessTax.js +6 -6
  33. package/lib/cjs/business/BusinessUtils.d.ts +2 -2
  34. package/lib/cjs/business/BusinessUtils.js +5 -5
  35. package/lib/cjs/business/Currency.d.ts +1 -1
  36. package/lib/cjs/business/Currency.js +10 -10
  37. package/lib/cjs/business/ProductUnit.d.ts +1 -1
  38. package/lib/cjs/business/ShoppingCart.d.ts +9 -9
  39. package/lib/cjs/business/ShoppingCart.js +11 -11
  40. package/lib/cjs/custom/CustomField.d.ts +1 -1
  41. package/lib/cjs/custom/CustomFieldData.d.ts +2 -2
  42. package/lib/cjs/i18n/Culture.d.ts +31 -0
  43. package/lib/cjs/i18n/Culture.js +51 -0
  44. package/lib/cjs/index.d.ts +1 -4
  45. package/lib/cjs/index.js +1 -4
  46. package/lib/cjs/result/ActionResult.d.ts +1 -1
  47. package/lib/cjs/result/ActionResultError.d.ts +1 -1
  48. package/lib/cjs/result/ActionResultError.js +3 -3
  49. package/lib/cjs/result/InitCallResult.d.ts +1 -1
  50. package/lib/cjs/state/Culture.d.ts +2 -2
  51. package/lib/cjs/state/User.d.ts +1 -1
  52. package/lib/mjs/address/AddressAutocomplete.d.ts +1 -1
  53. package/lib/mjs/address/AddressPlace.d.ts +3 -3
  54. package/lib/mjs/address/AddressPlaceBase.d.ts +1 -1
  55. package/lib/mjs/address/AddressRegion.d.ts +2 -2
  56. package/lib/mjs/address/AddressRegion.js +13 -13
  57. package/lib/mjs/address/AddressUtils.d.ts +1 -1
  58. package/lib/mjs/address/AddressUtils.js +1 -1
  59. package/lib/mjs/api/AuthApi.d.ts +14 -14
  60. package/lib/mjs/api/AuthApi.js +19 -19
  61. package/lib/mjs/api/BaseApi.d.ts +1 -1
  62. package/lib/mjs/api/EntityApi.d.ts +8 -8
  63. package/lib/mjs/api/EntityApi.js +5 -5
  64. package/lib/mjs/api/dto/IdLabelDto.d.ts +1 -1
  65. package/lib/mjs/api/dto/IdLabelPrimaryDto.d.ts +1 -1
  66. package/lib/mjs/api/dto/ResultPayload.d.ts +2 -2
  67. package/lib/mjs/api/rq/AuthRequest.d.ts +1 -1
  68. package/lib/mjs/api/rq/LoginRQ.d.ts +2 -2
  69. package/lib/mjs/api/rq/MergeRQ.d.ts +1 -1
  70. package/lib/mjs/api/rq/QueryRQ.d.ts +2 -2
  71. package/lib/mjs/api/rq/StatusQueryRQ.d.ts +3 -3
  72. package/lib/mjs/api/rq/UpdateModel.d.ts +2 -2
  73. package/lib/mjs/api/rq/UpdateStatusRQ.d.ts +2 -2
  74. package/lib/mjs/app/AppSettings.d.ts +3 -3
  75. package/lib/mjs/bridges/FlutterHost.d.ts +2 -2
  76. package/lib/mjs/bridges/FlutterHost.js +13 -13
  77. package/lib/mjs/business/BusinessTax.js +6 -6
  78. package/lib/mjs/business/BusinessUtils.d.ts +2 -2
  79. package/lib/mjs/business/BusinessUtils.js +5 -5
  80. package/lib/mjs/business/Currency.d.ts +1 -1
  81. package/lib/mjs/business/Currency.js +10 -10
  82. package/lib/mjs/business/ProductUnit.d.ts +1 -1
  83. package/lib/mjs/business/ProductUnit.js +1 -1
  84. package/lib/mjs/business/ShoppingCart.d.ts +9 -9
  85. package/lib/mjs/business/ShoppingCart.js +12 -12
  86. package/lib/mjs/custom/CustomField.d.ts +1 -1
  87. package/lib/mjs/custom/CustomFieldData.d.ts +2 -2
  88. package/lib/mjs/i18n/Culture.d.ts +31 -0
  89. package/lib/mjs/i18n/Culture.js +48 -0
  90. package/lib/mjs/index.d.ts +1 -4
  91. package/lib/mjs/index.js +1 -4
  92. package/lib/mjs/result/ActionResult.d.ts +1 -1
  93. package/lib/mjs/result/ActionResult.js +1 -1
  94. package/lib/mjs/result/ActionResultError.d.ts +1 -1
  95. package/lib/mjs/result/ActionResultError.js +3 -3
  96. package/lib/mjs/result/InitCallResult.d.ts +1 -1
  97. package/lib/mjs/state/Culture.d.ts +2 -2
  98. package/lib/mjs/state/User.d.ts +1 -1
  99. package/package.json +1 -1
  100. package/src/address/AddressAutocomplete.ts +16 -16
  101. package/src/address/AddressCity.ts +12 -12
  102. package/src/address/AddressContinent.ts +35 -35
  103. package/src/address/AddressDistrict.ts +12 -12
  104. package/src/address/AddressLocation.ts +8 -8
  105. package/src/address/AddressPlace.ts +23 -23
  106. package/src/address/AddressPlaceBase.ts +31 -31
  107. package/src/address/AddressRegion.ts +286 -286
  108. package/src/address/AddressState.ts +12 -12
  109. package/src/address/AddressUtils.ts +27 -27
  110. package/src/api/AuthApi.ts +194 -194
  111. package/src/api/BaseApi.ts +13 -13
  112. package/src/api/EntityApi.ts +181 -194
  113. package/src/api/dto/AntiforgeryRequestToken.ts +15 -15
  114. package/src/api/dto/ApiRefreshTokenDto.ts +16 -16
  115. package/src/api/dto/IdLabelDto.ts +3 -3
  116. package/src/api/dto/IdLabelPrimaryDto.ts +7 -7
  117. package/src/api/dto/InitCallDto.ts +12 -12
  118. package/src/api/dto/ResultPayload.ts +6 -6
  119. package/src/api/rq/ApiRefreshTokenRQ.ts +8 -8
  120. package/src/api/rq/AuthRequest.ts +40 -40
  121. package/src/api/rq/GetLogInUrlRQ.ts +8 -8
  122. package/src/api/rq/LoginIdRQ.ts +12 -12
  123. package/src/api/rq/LoginRQ.ts +18 -18
  124. package/src/api/rq/MergeRQ.ts +13 -13
  125. package/src/api/rq/QueryPagingData.ts +16 -16
  126. package/src/api/rq/QueryRQ.ts +22 -22
  127. package/src/api/rq/RefreshTokenRQ.ts +4 -4
  128. package/src/api/rq/ResetPasswordRQ.ts +20 -20
  129. package/src/api/rq/SignoutRQ.ts +8 -8
  130. package/src/api/rq/StatusQueryRQ.ts +11 -11
  131. package/src/api/rq/SwitchOrgRQ.ts +8 -8
  132. package/src/api/rq/TokenRQ.ts +4 -4
  133. package/src/api/rq/UpdateModel.ts +12 -12
  134. package/src/api/rq/UpdateStatusRQ.ts +10 -10
  135. package/src/app/AppSettings.ts +27 -27
  136. package/src/app/UserRole.ts +44 -44
  137. package/src/bridges/FlutterHost.ts +92 -97
  138. package/src/bridges/IBridgeHost.ts +49 -51
  139. package/src/business/ApiService.ts +25 -25
  140. package/src/business/BusinessTax.ts +63 -63
  141. package/src/business/BusinessUtils.ts +75 -75
  142. package/src/business/CultureItem.ts +43 -43
  143. package/src/business/Currency.ts +11 -11
  144. package/src/business/DataPrivacy.ts +35 -35
  145. package/src/business/EntityStatus.ts +44 -44
  146. package/src/business/ProductUnit.ts +58 -58
  147. package/src/business/RepeatOption.ts +50 -50
  148. package/src/business/ShoppingCart.ts +696 -706
  149. package/src/custom/CustomField.ts +20 -20
  150. package/src/custom/CustomFieldData.ts +43 -43
  151. package/src/def/ListItem.ts +12 -12
  152. package/src/i18n/Culture.ts +60 -0
  153. package/src/i18n/en.json +244 -244
  154. package/src/i18n/zh-Hans.json +244 -244
  155. package/src/i18n/zh-Hant.json +244 -244
  156. package/src/index.ts +1 -4
  157. package/src/result/ActionResult.ts +19 -19
  158. package/src/result/ActionResultError.ts +30 -30
  159. package/src/result/InitCallResult.ts +21 -21
  160. package/src/state/Culture.ts +3 -3
  161. package/src/state/State.ts +5 -5
  162. package/src/state/User.ts +92 -92
  163. package/lib/cjs/i18n/CultureUtils.d.ts +0 -13
  164. package/lib/cjs/i18n/CultureUtils.js +0 -32
  165. package/lib/cjs/i18n/en.d.ts +0 -6
  166. package/lib/cjs/i18n/en.js +0 -12
  167. package/lib/cjs/i18n/zhHans.d.ts +0 -6
  168. package/lib/cjs/i18n/zhHans.js +0 -12
  169. package/lib/cjs/i18n/zhHant.d.ts +0 -6
  170. package/lib/cjs/i18n/zhHant.js +0 -12
  171. package/lib/mjs/i18n/CultureUtils.d.ts +0 -13
  172. package/lib/mjs/i18n/CultureUtils.js +0 -29
  173. package/lib/mjs/i18n/en.d.ts +0 -6
  174. package/lib/mjs/i18n/en.js +0 -8
  175. package/lib/mjs/i18n/zhHans.d.ts +0 -6
  176. package/lib/mjs/i18n/zhHans.js +0 -8
  177. package/lib/mjs/i18n/zhHant.d.ts +0 -6
  178. package/lib/mjs/i18n/zhHant.js +0 -8
  179. package/src/i18n/CultureUtils.ts +0 -36
  180. package/src/i18n/en.ts +0 -10
  181. package/src/i18n/zhHans.ts +0 -10
  182. package/src/i18n/zhHant.ts +0 -10
@@ -1,23 +1,22 @@
1
1
  import {
2
- INotificaseBase,
3
- INotification,
4
- Notification,
5
- NotificationCallProps,
6
- NotificationContainer,
7
- NotificationRenderProps
8
- } from '@etsoo/notificationbase';
2
+ INotificaseBase,
3
+ INotification,
4
+ Notification,
5
+ NotificationCallProps,
6
+ NotificationContainer,
7
+ NotificationRenderProps
8
+ } from "@etsoo/notificationbase";
9
9
  import {
10
- AddressUtils,
11
- CoreApp,
12
- createClient,
13
- en,
14
- ExternalSettings,
15
- IAppSettings,
16
- InitCallResultData,
17
- IUser,
18
- zhHans
19
- } from '../../src';
20
- import { DataTypes, DomUtils, Utils, WindowStorage } from '@etsoo/shared';
10
+ AddressUtils,
11
+ CoreApp,
12
+ createClient,
13
+ Culture,
14
+ ExternalSettings,
15
+ IAppSettings,
16
+ InitCallResultData,
17
+ IUser
18
+ } from "../../src";
19
+ import { DataTypes, DomUtils, Utils, WindowStorage } from "@etsoo/shared";
21
20
 
22
21
  // Detected country or region
23
22
  const { detectedCountry } = DomUtils;
@@ -26,27 +25,30 @@ const { detectedCountry } = DomUtils;
26
25
  const { detectedCulture } = DomUtils;
27
26
 
28
27
  // Supported cultures
29
- const supportedCultures: DataTypes.CultureDefinition[] = [zhHans({}), en({})];
28
+ const supportedCultures: DataTypes.CultureDefinition[] = [
29
+ Culture.zhHans({}),
30
+ Culture.en({})
31
+ ];
30
32
 
31
33
  // Supported regions
32
- const supportedRegions = ['CN'];
34
+ const supportedRegions = ["CN"];
33
35
 
34
36
  // Class implementation for tests
35
37
  class NotificationTest extends Notification<any, NotificationCallProps> {
36
- render(props: NotificationRenderProps, className?: string, options?: any) {
37
- throw new Error('Method not implemented.');
38
- }
38
+ render(props: NotificationRenderProps, className?: string, options?: any) {
39
+ throw new Error("Method not implemented.");
40
+ }
39
41
  }
40
42
 
41
43
  class NotificationContainerTest extends NotificationContainer<
42
- any,
43
- NotificationCallProps
44
+ any,
45
+ NotificationCallProps
44
46
  > {
45
- protected addRaw(
46
- data: INotificaseBase<any, NotificationCallProps>
47
- ): INotification<any, NotificationCallProps> {
48
- return new NotificationTest(data.type, data.content);
49
- }
47
+ protected addRaw(
48
+ data: INotificaseBase<any, NotificationCallProps>
49
+ ): INotification<any, NotificationCallProps> {
50
+ return new NotificationTest(data.type, data.content);
51
+ }
50
52
  }
51
53
 
52
54
  // Container
@@ -54,83 +56,83 @@ var container = new NotificationContainerTest((update) => {});
54
56
 
55
57
  // Is local test (integration test)
56
58
  // Make sure your local environment is ready
57
- export const isLocalTest = process.env.NODE_ENV === 'local';
59
+ export const isLocalTest = process.env.NODE_ENV === "local";
58
60
 
59
61
  // Test application class
60
62
  export class TestApp extends CoreApp<
61
- IUser,
62
- IAppSettings,
63
- {},
64
- NotificationCallProps
63
+ IUser,
64
+ IAppSettings,
65
+ {},
66
+ NotificationCallProps
65
67
  > {
66
- /**
67
- * Constructor
68
- * @param settings Settings
69
- * @param name Application name
70
- */
71
- constructor() {
72
- super(
73
- ExternalSettings.format({
74
- /**
75
- * Endpoint of the API service
76
- */
77
- endpoint: 'http://{hostname}:9000/api/',
78
-
79
- endpoints: {
80
- core: {
81
- endpoint: 'https://{hostname}:9001/api/',
82
- webUrl: ''
83
- }
84
- },
85
-
86
- /**
87
- * App root url
88
- */
89
- homepage: '/cms',
90
-
91
- /**
92
- * Web url of the cloud
93
- */
94
- webUrl: 'https://localhost',
95
-
96
- // Detected culture
97
- detectedCulture,
98
-
99
- // Supported cultures
100
- cultures: supportedCultures,
101
-
102
- // Supported regions
103
- regions: supportedRegions,
104
-
105
- // Browser's time zone
106
- timeZone: Utils.getTimeZone(),
107
-
108
- // Current country or region
109
- currentRegion: AddressUtils.getRegion(
110
- supportedRegions,
111
- detectedCountry,
112
- detectedCulture
113
- ),
114
-
115
- // Current culture
116
- currentCulture: DomUtils.getCulture(
117
- supportedCultures,
118
- detectedCulture
119
- )![0]
120
- }),
121
- createClient(),
122
- container,
123
- new WindowStorage(),
124
- 'SmartERP'
125
- );
126
- }
127
-
128
- freshCountdownUI(callback?: () => PromiseLike<unknown>): void {
129
- throw new Error('Method not implemented.');
130
- }
131
-
132
- initCallUpdateLocal(data: InitCallResultData, timestamp: number) {
133
- this.initCallUpdate(data, timestamp);
134
- return this.passphrase;
135
- }
68
+ /**
69
+ * Constructor
70
+ * @param settings Settings
71
+ * @param name Application name
72
+ */
73
+ constructor() {
74
+ super(
75
+ ExternalSettings.format({
76
+ /**
77
+ * Endpoint of the API service
78
+ */
79
+ endpoint: "http://{hostname}:9000/api/",
80
+
81
+ endpoints: {
82
+ core: {
83
+ endpoint: "https://{hostname}:9001/api/",
84
+ webUrl: ""
85
+ }
86
+ },
87
+
88
+ /**
89
+ * App root url
90
+ */
91
+ homepage: "/cms",
92
+
93
+ /**
94
+ * Web url of the cloud
95
+ */
96
+ webUrl: "https://localhost",
97
+
98
+ // Detected culture
99
+ detectedCulture,
100
+
101
+ // Supported cultures
102
+ cultures: supportedCultures,
103
+
104
+ // Supported regions
105
+ regions: supportedRegions,
106
+
107
+ // Browser's time zone
108
+ timeZone: Utils.getTimeZone(),
109
+
110
+ // Current country or region
111
+ currentRegion: AddressUtils.getRegion(
112
+ supportedRegions,
113
+ detectedCountry,
114
+ detectedCulture
115
+ ),
116
+
117
+ // Current culture
118
+ currentCulture: DomUtils.getCulture(
119
+ supportedCultures,
120
+ detectedCulture
121
+ )![0]
122
+ }),
123
+ createClient(),
124
+ container,
125
+ new WindowStorage(),
126
+ "SmartERP"
127
+ );
128
+ }
129
+
130
+ freshCountdownUI(callback?: () => PromiseLike<unknown>): void {
131
+ throw new Error("Method not implemented.");
132
+ }
133
+
134
+ initCallUpdateLocal(data: InitCallResultData, timestamp: number) {
135
+ this.initCallUpdate(data, timestamp);
136
+ return this.passphrase;
137
+ }
136
138
  }
@@ -1,46 +1,46 @@
1
- import { ArrayUtils } from '@etsoo/shared';
2
- import { CultureGridItem } from '../../src';
3
- import { BusinessUtils } from '../../src/business/BusinessUtils';
1
+ import { ArrayUtils } from "@etsoo/shared";
2
+ import { CultureGridItem } from "../../src";
3
+ import { BusinessUtils } from "../../src/business/BusinessUtils";
4
4
 
5
5
  // Import the ArrayUtils
6
6
  ArrayUtils.differences([], []);
7
7
 
8
- test('Tests for BusinessUtils.formatAvatarTitle', () => {
9
- // Assert
10
- expect(BusinessUtils.formatAvatarTitle('Garry Xiao')).toBe('GX');
11
- expect(BusinessUtils.formatAvatarTitle('Etsoo')).toBe('ME');
12
- expect(BusinessUtils.formatAvatarTitle('Etsoo', 3, 'E')).toBe('E');
13
- expect(BusinessUtils.formatAvatarTitle('Etsoo', 5)).toBe('ETSOO');
8
+ test("Tests for BusinessUtils.formatAvatarTitle", () => {
9
+ // Assert
10
+ expect(BusinessUtils.formatAvatarTitle("Garry Xiao")).toBe("GX");
11
+ expect(BusinessUtils.formatAvatarTitle("Etsoo")).toBe("ME");
12
+ expect(BusinessUtils.formatAvatarTitle("Etsoo", 3, "E")).toBe("E");
13
+ expect(BusinessUtils.formatAvatarTitle("Etsoo", 5)).toBe("ETSOO");
14
14
  });
15
15
 
16
- test('Tests for BusinessUtils.formatCultues', () => {
17
- // Arrange
18
- const cultures = [
19
- {
20
- id: 'zh-Hans',
21
- label: '中文(简体), Chinese (Simplified)'
22
- },
23
- {
24
- id: 'en',
25
- label: '英语, English'
26
- },
27
- {
28
- id: 'de',
29
- label: '德语, German'
30
- },
31
- {
32
- id: 'zh-Hant',
33
- label: '中文(繁体), Chinese (Traditional)'
34
- }
35
- ];
36
- const data: { cultures: CultureGridItem[] } = {
37
- cultures: [{ id: 'zh-Hant', title: '繁体' }]
38
- };
16
+ test("Tests for BusinessUtils.formatCultues", () => {
17
+ // Arrange
18
+ const cultures = [
19
+ {
20
+ id: "zh-Hans",
21
+ label: "中文(简体), Chinese (Simplified)"
22
+ },
23
+ {
24
+ id: "en",
25
+ label: "英语, English"
26
+ },
27
+ {
28
+ id: "de",
29
+ label: "德语, German"
30
+ },
31
+ {
32
+ id: "zh-Hant",
33
+ label: "中文(繁体), Chinese (Traditional)"
34
+ }
35
+ ];
36
+ const data: { cultures: CultureGridItem[] } = {
37
+ cultures: [{ id: "zh-Hant", title: "繁体" }]
38
+ };
39
39
 
40
- // Act
41
- BusinessUtils.formatCultues(cultures, data);
40
+ // Act
41
+ BusinessUtils.formatCultues(cultures, data);
42
42
 
43
- // Assert
44
- expect(data.cultures[0].id).toBe('en');
45
- expect(data.cultures.slice(-1)[0].id).toBe('zh-Hant');
43
+ // Assert
44
+ expect(data.cultures[0].id).toBe("en");
45
+ expect(data.cultures.slice(-1)[0].id).toBe("zh-Hant");
46
46
  });
@@ -1,26 +1,26 @@
1
- import { ApiError } from '@etsoo/restclient';
2
- import { ActionResult, ActionResultError } from '../../src';
1
+ import { ApiError } from "@etsoo/restclient";
2
+ import { ActionResult, ActionResultError } from "../../src";
3
3
 
4
4
  // Arrange
5
- var message = 'Not Found';
5
+ var message = "Not Found";
6
6
  var status = 500;
7
7
  var error: ApiError = new ApiError(message, status);
8
8
 
9
9
  // Act
10
10
  var result = ActionResult.create(error);
11
11
 
12
- test('Tests for ActionResult.Create', () => {
13
- // Assert
14
- expect(result.type).toBe('ApiError');
15
- expect(result.title).toBe(message);
16
- expect(result.status).toBe(status);
12
+ test("Tests for ActionResult.Create", () => {
13
+ // Assert
14
+ expect(result.type).toBe("ApiError");
15
+ expect(result.title).toBe(message);
16
+ expect(result.status).toBe(status);
17
17
  });
18
18
 
19
- test('Tests for ActionResultError.format', () => {
20
- // Arrange & act
21
- var error = new ActionResultError(result);
19
+ test("Tests for ActionResultError.format", () => {
20
+ // Arrange & act
21
+ var error = new ActionResultError(result);
22
22
 
23
- // Assert
24
- expect(error.name).toBe('ActionResultError');
25
- expect(error.message).toBe(`${message} (${status}, ApiError)`);
23
+ // Assert
24
+ expect(error.name).toBe("ActionResultError");
25
+ expect(error.message).toBe(`${message} (${status}, ApiError)`);
26
26
  });
@@ -1,18 +1,18 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "ESNext",
5
- "moduleResolution": "Node10",
6
- "allowJs": false,
7
- "skipLibCheck": true,
8
- "esModuleInterop": true,
9
- "allowSyntheticDefaultImports": true,
10
- "strict": true,
11
- "forceConsistentCasingInFileNames": true,
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
14
- "noEmit": true,
15
- "declaration": true
16
- },
17
- "include": [".."]
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "moduleResolution": "Node10",
6
+ "allowJs": false,
7
+ "skipLibCheck": true,
8
+ "esModuleInterop": true,
9
+ "allowSyntheticDefaultImports": true,
10
+ "strict": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "noEmit": true,
15
+ "declaration": true
16
+ },
17
+ "include": [".."]
18
18
  }
@@ -1,4 +1,4 @@
1
- import { AddressPlaceBase } from './AddressPlaceBase';
1
+ import { AddressPlaceBase } from "./AddressPlaceBase";
2
2
  /**
3
3
  * Address autocomplete
4
4
  * 地点自动填充
@@ -1,10 +1,10 @@
1
- import { AddressLocation } from './AddressLocation';
2
- import { AddressPlaceBase } from './AddressPlaceBase';
1
+ import { AddressLocation } from "./AddressLocation";
2
+ import { AddressPlaceBase } from "./AddressPlaceBase";
3
3
  /**
4
4
  * Address place
5
5
  * 地点
6
6
  */
7
- export type AddressPlace = Omit<AddressPlaceBase, 'location'> & {
7
+ export type AddressPlace = Omit<AddressPlaceBase, "location"> & {
8
8
  /**
9
9
  * Place id
10
10
  * 地点编号
@@ -1,4 +1,4 @@
1
- import { AddressLocation } from './AddressLocation';
1
+ import { AddressLocation } from "./AddressLocation";
2
2
  /**
3
3
  * Address place base
4
4
  * 基础地点
@@ -1,5 +1,5 @@
1
- import { Currency } from '../business/Currency';
2
- import { AddressContinent, AddressContinentId } from './AddressContinent';
1
+ import { Currency } from "../business/Currency";
2
+ import { AddressContinent, AddressContinentId } from "./AddressContinent";
3
3
  /**
4
4
  * Address region in database
5
5
  */
@@ -32,62 +32,62 @@ exports.AddressRegion = AddressRegion;
32
32
  /**
33
33
  * CN - China
34
34
  */
35
- AddressRegion.CN = new AddressRegion('CN', 'CHN', '156', AddressContinent_1.AddressContinent.AS, '00', '+86', '0', 'CNY', ['zh-Hans-CN', 'zh-CN']);
35
+ AddressRegion.CN = new AddressRegion("CN", "CHN", "156", AddressContinent_1.AddressContinent.AS, "00", "+86", "0", "CNY", ["zh-Hans-CN", "zh-CN"]);
36
36
  /**
37
37
  * HK - HK, China
38
38
  * 中国香港
39
39
  */
40
- AddressRegion.HK = new AddressRegion('HK', 'HKG', '344', AddressContinent_1.AddressContinent.AS, '001', '+852', undefined, 'HKD', ['zh-Hant-HK', 'zh-HK', 'en-HK']);
40
+ AddressRegion.HK = new AddressRegion("HK", "HKG", "344", AddressContinent_1.AddressContinent.AS, "001", "+852", undefined, "HKD", ["zh-Hant-HK", "zh-HK", "en-HK"]);
41
41
  /**
42
42
  * SG - Singapore
43
43
  * 新加坡
44
44
  */
45
- AddressRegion.SG = new AddressRegion('SG', 'SGP', '702', AddressContinent_1.AddressContinent.AS, '000', '+65', undefined, 'SGD', ['zh-Hans-SG', 'zh-SG', 'en-SG']);
45
+ AddressRegion.SG = new AddressRegion("SG", "SGP", "702", AddressContinent_1.AddressContinent.AS, "000", "+65", undefined, "SGD", ["zh-Hans-SG", "zh-SG", "en-SG"]);
46
46
  /**
47
47
  * JP - Japan
48
48
  * 日本
49
49
  */
50
- AddressRegion.JP = new AddressRegion('JP', 'JPN', '392', AddressContinent_1.AddressContinent.AS, '010', '+81', '0', 'JPY', ['ja-JP']);
50
+ AddressRegion.JP = new AddressRegion("JP", "JPN", "392", AddressContinent_1.AddressContinent.AS, "010", "+81", "0", "JPY", ["ja-JP"]);
51
51
  /**
52
52
  * US - United States
53
53
  * 美国
54
54
  */
55
- AddressRegion.US = new AddressRegion('US', 'USA', '840', AddressContinent_1.AddressContinent.NA, '011', '+1', '1', 'USD', ['en-US']);
55
+ AddressRegion.US = new AddressRegion("US", "USA", "840", AddressContinent_1.AddressContinent.NA, "011", "+1", "1", "USD", ["en-US"]);
56
56
  /**
57
57
  * CA - Canada
58
58
  * 加拿大
59
59
  */
60
- AddressRegion.CA = new AddressRegion('CA', 'CAN', '124', AddressContinent_1.AddressContinent.NA, '011', '+1', '1', 'CAD', ['en-CA', 'fr-CA']);
60
+ AddressRegion.CA = new AddressRegion("CA", "CAN", "124", AddressContinent_1.AddressContinent.NA, "011", "+1", "1", "CAD", ["en-CA", "fr-CA"]);
61
61
  /**
62
62
  * AU - Australia
63
63
  * 澳大利亚
64
64
  */
65
- AddressRegion.AU = new AddressRegion('AU', 'AUS', '036', AddressContinent_1.AddressContinent.OC, '0011', '+61', '0', 'AUD', ['en-AU']);
65
+ AddressRegion.AU = new AddressRegion("AU", "AUS", "036", AddressContinent_1.AddressContinent.OC, "0011", "+61", "0", "AUD", ["en-AU"]);
66
66
  /**
67
67
  * NZ - New Zealand
68
68
  * 新西兰
69
69
  */
70
- AddressRegion.NZ = new AddressRegion('NZ', 'NZL', '554', AddressContinent_1.AddressContinent.OC, '00', '+64', '0', 'NZD', ['en-NZ', 'mi-NZ']);
70
+ AddressRegion.NZ = new AddressRegion("NZ", "NZL", "554", AddressContinent_1.AddressContinent.OC, "00", "+64", "0", "NZD", ["en-NZ", "mi-NZ"]);
71
71
  /**
72
72
  * GB - Great Britain
73
73
  * 英国
74
74
  */
75
- AddressRegion.GB = new AddressRegion('GB', 'GBR', '826', AddressContinent_1.AddressContinent.EU, '00', '+44', '0', 'GBP', ['en-GB']);
75
+ AddressRegion.GB = new AddressRegion("GB", "GBR", "826", AddressContinent_1.AddressContinent.EU, "00", "+44", "0", "GBP", ["en-GB"]);
76
76
  /**
77
77
  * IE - Ireland
78
78
  * 爱尔兰
79
79
  */
80
- AddressRegion.IE = new AddressRegion('IE', 'IRL', '372', AddressContinent_1.AddressContinent.EU, '00', '+353', '0', 'EUR', ['en-IE']);
80
+ AddressRegion.IE = new AddressRegion("IE", "IRL", "372", AddressContinent_1.AddressContinent.EU, "00", "+353", "0", "EUR", ["en-IE"]);
81
81
  /**
82
82
  * DE - Germany
83
83
  * 德国
84
84
  */
85
- AddressRegion.DE = new AddressRegion('DE', 'DEU', '276', AddressContinent_1.AddressContinent.EU, '00', '+49', '0', 'EUR', ['de-DE']);
85
+ AddressRegion.DE = new AddressRegion("DE", "DEU", "276", AddressContinent_1.AddressContinent.EU, "00", "+49", "0", "EUR", ["de-DE"]);
86
86
  /**
87
87
  * FR - France
88
88
  * 法国
89
89
  */
90
- AddressRegion.FR = new AddressRegion('FR', 'FRA', '250', AddressContinent_1.AddressContinent.EU, '00', '+33', '0', 'EUR', ['fr-FR']);
90
+ AddressRegion.FR = new AddressRegion("FR", "FRA", "250", AddressContinent_1.AddressContinent.EU, "00", "+33", "0", "EUR", ["fr-FR"]);
91
91
  /**
92
92
  * All countries and regions
93
93
  */
@@ -1,4 +1,4 @@
1
- import { AddressRegion } from './AddressRegion';
1
+ import { AddressRegion } from "./AddressRegion";
2
2
  /**
3
3
  * Address utils
4
4
  */
@@ -1,17 +1,17 @@
1
- import { IApiPayload } from '@etsoo/restclient';
2
- import { IUser } from '../state/User';
3
- import { BaseApi } from './BaseApi';
4
- import { ResultPayload } from './dto/ResultPayload';
5
- import { IActionResult } from '@etsoo/shared';
6
- import { RefreshTokenProps, RefreshTokenResult } from '../app/IApp';
7
- import { TokenRQ } from './rq/TokenRQ';
8
- import { ApiRefreshTokenDto } from './dto/ApiRefreshTokenDto';
9
- import { GetLogInUrlRQ } from './rq/GetLogInUrlRQ';
10
- import { LoginRQ } from './rq/LoginRQ';
11
- import { ResetPasswordRQ } from './rq/ResetPasswordRQ';
12
- import { SignoutRQ } from './rq/SignoutRQ';
13
- import { SwitchOrgRQ } from './rq/SwitchOrgRQ';
14
- import { AuthRequest } from './rq/AuthRequest';
1
+ import { IApiPayload } from "@etsoo/restclient";
2
+ import { IUser } from "../state/User";
3
+ import { BaseApi } from "./BaseApi";
4
+ import { ResultPayload } from "./dto/ResultPayload";
5
+ import { IActionResult } from "@etsoo/shared";
6
+ import { RefreshTokenProps, RefreshTokenResult } from "../app/IApp";
7
+ import { TokenRQ } from "./rq/TokenRQ";
8
+ import { ApiRefreshTokenDto } from "./dto/ApiRefreshTokenDto";
9
+ import { GetLogInUrlRQ } from "./rq/GetLogInUrlRQ";
10
+ import { LoginRQ } from "./rq/LoginRQ";
11
+ import { ResetPasswordRQ } from "./rq/ResetPasswordRQ";
12
+ import { SignoutRQ } from "./rq/SignoutRQ";
13
+ import { SwitchOrgRQ } from "./rq/SwitchOrgRQ";
14
+ import { AuthRequest } from "./rq/AuthRequest";
15
15
  /**
16
16
  * Authentication API
17
17
  */