@etsoo/appscript 1.3.44 → 1.3.48

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 (65) hide show
  1. package/__tests__/app/CoreApp.ts +5 -5
  2. package/lib/cjs/address/AddressRegion.js +3 -3
  3. package/lib/cjs/app/CoreApp.js +3 -3
  4. package/lib/cjs/erp/AuthApi.d.ts +33 -0
  5. package/lib/cjs/erp/AuthApi.js +49 -0
  6. package/lib/cjs/erp/rq/LoginIdRQ.d.ts +17 -0
  7. package/lib/cjs/erp/rq/LoginIdRQ.js +2 -0
  8. package/lib/cjs/erp/rq/LoginRQ.d.ts +23 -0
  9. package/lib/cjs/erp/rq/LoginRQ.js +2 -0
  10. package/lib/cjs/erp/rq/ResetPasswordRQ.d.ts +22 -0
  11. package/lib/cjs/erp/rq/ResetPasswordRQ.js +2 -0
  12. package/lib/cjs/i18n/{zhCN.d.ts → en.d.ts} +2 -2
  13. package/lib/cjs/i18n/{enUS.js → en.js} +8 -8
  14. package/lib/cjs/i18n/{en-US.json → en.json} +0 -0
  15. package/lib/cjs/i18n/{zh-CN.json → zh-Hans.json} +0 -0
  16. package/lib/cjs/i18n/{zh-HK.json → zh-Hant.json} +0 -0
  17. package/lib/cjs/i18n/{zhHK.d.ts → zhHans.d.ts} +2 -2
  18. package/lib/cjs/i18n/{zhCN.js → zhHans.js} +8 -8
  19. package/lib/cjs/i18n/zhHant.d.ts +7 -0
  20. package/lib/cjs/i18n/{zhHK.js → zhHant.js} +8 -8
  21. package/lib/cjs/index.d.ts +7 -3
  22. package/lib/cjs/index.js +7 -3
  23. package/lib/mjs/address/AddressRegion.js +3 -3
  24. package/lib/mjs/app/CoreApp.js +3 -3
  25. package/lib/mjs/erp/AuthApi.d.ts +33 -0
  26. package/lib/mjs/erp/AuthApi.js +45 -0
  27. package/lib/mjs/erp/rq/LoginIdRQ.d.ts +17 -0
  28. package/lib/mjs/erp/rq/LoginIdRQ.js +1 -0
  29. package/lib/mjs/erp/rq/LoginRQ.d.ts +23 -0
  30. package/lib/mjs/erp/rq/LoginRQ.js +1 -0
  31. package/lib/mjs/erp/rq/ResetPasswordRQ.d.ts +22 -0
  32. package/lib/mjs/erp/rq/ResetPasswordRQ.js +1 -0
  33. package/lib/{cjs/i18n/enUS.d.ts → mjs/i18n/en.d.ts} +2 -2
  34. package/lib/mjs/i18n/en.js +12 -0
  35. package/lib/mjs/i18n/{en-US.json → en.json} +0 -0
  36. package/lib/mjs/i18n/{zh-CN.json → zh-Hans.json} +0 -0
  37. package/lib/mjs/i18n/{zh-HK.json → zh-Hant.json} +0 -0
  38. package/lib/mjs/i18n/{enUS.d.ts → zhHans.d.ts} +2 -2
  39. package/lib/mjs/i18n/zhHans.js +12 -0
  40. package/lib/mjs/i18n/zhHant.d.ts +7 -0
  41. package/lib/mjs/i18n/zhHant.js +12 -0
  42. package/lib/mjs/index.d.ts +7 -3
  43. package/lib/mjs/index.js +7 -3
  44. package/package.json +5 -5
  45. package/src/address/AddressRegion.ts +3 -3
  46. package/src/app/CoreApp.ts +5 -4
  47. package/src/erp/AuthApi.ts +58 -0
  48. package/src/erp/rq/LoginIdRQ.ts +19 -0
  49. package/src/erp/rq/LoginRQ.ts +27 -0
  50. package/src/erp/rq/ResetPasswordRQ.ts +26 -0
  51. package/src/i18n/{en-US.json → en.json} +0 -0
  52. package/src/i18n/en.ts +14 -0
  53. package/src/i18n/{zh-CN.json → zh-Hans.json} +0 -0
  54. package/src/i18n/{zh-HK.json → zh-Hant.json} +0 -0
  55. package/src/i18n/zhHans.ts +14 -0
  56. package/src/i18n/zhHant.ts +16 -0
  57. package/src/index.ts +7 -3
  58. package/lib/mjs/i18n/enUS.js +0 -12
  59. package/lib/mjs/i18n/zhCN.d.ts +0 -7
  60. package/lib/mjs/i18n/zhCN.js +0 -12
  61. package/lib/mjs/i18n/zhHK.d.ts +0 -7
  62. package/lib/mjs/i18n/zhHK.js +0 -12
  63. package/src/i18n/enUS.ts +0 -14
  64. package/src/i18n/zhCN.ts +0 -14
  65. package/src/i18n/zhHK.ts +0 -14
@@ -10,17 +10,17 @@ import { ApiAuthorizationScheme, createClient } from '@etsoo/restclient';
10
10
  import { DataTypes, DomUtils, Utils, WindowStorage } from '@etsoo/shared';
11
11
  import {
12
12
  AddressApi,
13
- enUS,
13
+ en,
14
14
  ExternalSettings,
15
15
  IUser,
16
16
  OrgApi,
17
17
  PublicApi,
18
- UserRole
18
+ UserRole,
19
+ zhHans
19
20
  } from '../../src';
20
21
  import { AddressUtils } from '../../src/address/AddressUtils';
21
22
  import { IAppSettings } from '../../src/app/AppSettings';
22
23
  import { CoreApp } from '../../src/app/CoreApp';
23
- import { zhCN } from '../../src/i18n/zhCN';
24
24
  import { InitCallResultData } from '../../src/result/InitCallResult';
25
25
 
26
26
  // Detected country or region
@@ -30,7 +30,7 @@ const { detectedCountry } = DomUtils;
30
30
  const { detectedCulture } = DomUtils;
31
31
 
32
32
  // Supported cultures
33
- const supportedCultures: DataTypes.CultureDefinition[] = [zhCN({}), enUS({})];
33
+ const supportedCultures: DataTypes.CultureDefinition[] = [zhHans({}), en({})];
34
34
 
35
35
  // Supported regions
36
36
  const supportedRegions = ['CN'];
@@ -112,7 +112,7 @@ class CoreAppTest extends CoreApp<
112
112
  currentCulture: DomUtils.getCulture(
113
113
  supportedCultures,
114
114
  detectedCulture
115
- )!
115
+ )![0]
116
116
  }),
117
117
  createClient(),
118
118
  container,
@@ -32,17 +32,17 @@ 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-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-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-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
  * 日本
@@ -534,9 +534,9 @@ class CoreApp {
534
534
  */
535
535
  checkLanguage(language) {
536
536
  if (language) {
537
- const item = this.settings.cultures.find((c) => { var _a; return c.name === language || ((_a = c.compatibleName) === null || _a === void 0 ? void 0 : _a.includes(language)); });
538
- if (item)
539
- return item.name;
537
+ const [cultrue, match] = shared_1.DomUtils.getCulture(this.settings.cultures, language);
538
+ if (cultrue != null && match != shared_1.DomUtils.CultureMatch.Default)
539
+ return cultrue.name;
540
540
  }
541
541
  // Default language
542
542
  return this.culture;
@@ -0,0 +1,33 @@
1
+ import { IApiPayload } from '@etsoo/restclient';
2
+ import { IActionResult } from '../result/IActionResult';
3
+ import { IUser } from '../state/User';
4
+ import { BaseApi } from './BaseApi';
5
+ import { ResultPayload } from './dto/ResultPayload';
6
+ import { LoginRQ } from './rq/LoginRQ';
7
+ import { ResetPasswordRQ } from './rq/ResetPasswordRQ';
8
+ /**
9
+ * Authentication API
10
+ */
11
+ export declare class AuthApi extends BaseApi {
12
+ /**
13
+ * Login
14
+ * @param rq Request data
15
+ * @param payload Payload
16
+ * @returns Result
17
+ */
18
+ protected loginBase<T extends IUser>(rq: LoginRQ, payload?: IApiPayload<IActionResult<T>>): Promise<[IActionResult<T> | undefined, string | null]>;
19
+ /**
20
+ * Login id check
21
+ * @param id Check id
22
+ * @param payload Payload
23
+ * @returns Result
24
+ */
25
+ loginId(id: string, payload?: ResultPayload): Promise<IActionResult<{}> | undefined>;
26
+ /**
27
+ * Reset password
28
+ * @param rq Request data
29
+ * @param payload Payload
30
+ * @returns Result
31
+ */
32
+ resetPassword(rq: ResetPasswordRQ, payload?: ResultPayload): Promise<IActionResult<{}> | undefined>;
33
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthApi = void 0;
4
+ const BaseApi_1 = require("./BaseApi");
5
+ /**
6
+ * Authentication API
7
+ */
8
+ class AuthApi extends BaseApi_1.BaseApi {
9
+ /**
10
+ * Login
11
+ * @param rq Request data
12
+ * @param payload Payload
13
+ * @returns Result
14
+ */
15
+ async loginBase(rq, payload) {
16
+ payload !== null && payload !== void 0 ? payload : (payload = {});
17
+ const result = await this.api.post('Auth/Login', rq, payload);
18
+ const refreshToken = (result === null || result === void 0 ? void 0 : result.ok)
19
+ ? this.app.getResponseToken(payload.response)
20
+ : null;
21
+ return [result, refreshToken];
22
+ }
23
+ /**
24
+ * Login id check
25
+ * @param id Check id
26
+ * @param payload Payload
27
+ * @returns Result
28
+ */
29
+ loginId(id, payload) {
30
+ const { deviceId, region } = this.app;
31
+ id = this.app.encrypt(id);
32
+ const rq = {
33
+ id,
34
+ deviceId,
35
+ region
36
+ };
37
+ return this.api.get('Auth/LoginId', rq, payload);
38
+ }
39
+ /**
40
+ * Reset password
41
+ * @param rq Request data
42
+ * @param payload Payload
43
+ * @returns Result
44
+ */
45
+ resetPassword(rq, payload) {
46
+ return this.api.put('Auth/ResetPassword', rq, payload);
47
+ }
48
+ }
49
+ exports.AuthApi = AuthApi;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Login id request data
3
+ */
4
+ export type LoginIdRQ = {
5
+ /**
6
+ * Device id
7
+ */
8
+ deviceId: string;
9
+ /**
10
+ * Username, Email or mobile
11
+ */
12
+ id: string;
13
+ /**
14
+ * Country or region
15
+ */
16
+ region: string;
17
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,23 @@
1
+ import { DataTypes } from '@etsoo/shared';
2
+ import { LoginIdRQ } from './LoginIdRQ';
3
+ /**
4
+ * Login request data
5
+ */
6
+ export type LoginRQ = LoginIdRQ & {
7
+ /**
8
+ * Password
9
+ */
10
+ pwd: string;
11
+ /**
12
+ * Organization
13
+ */
14
+ org?: number;
15
+ /**
16
+ * Time zone
17
+ */
18
+ timezone?: string;
19
+ /**
20
+ * Service id or uid
21
+ */
22
+ serviceId?: DataTypes.IdType;
23
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ export type ResetPasswordRQ = {
2
+ /**
3
+ * Email or mobile
4
+ */
5
+ id: string;
6
+ /**
7
+ * Verification code id
8
+ */
9
+ codeId: string;
10
+ /**
11
+ * Device id
12
+ */
13
+ deviceId: string;
14
+ /**
15
+ * New password
16
+ */
17
+ password: string;
18
+ /**
19
+ * Country or region
20
+ */
21
+ region: string;
22
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  import { DataTypes } from '@etsoo/shared';
2
2
  /**
3
- * Get zh-CN cultrue
3
+ * Get en neutral culture
4
4
  * @param localResources Local resources
5
5
  * @returns Full culture
6
6
  */
7
- export declare const zhCN: (localResources: {}) => DataTypes.CultureDefinition;
7
+ export declare const en: (localResources: object) => DataTypes.CultureDefinition;
@@ -3,17 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.enUS = void 0;
7
- const en_US_json_1 = __importDefault(require("./en-US.json"));
6
+ exports.en = void 0;
7
+ const en_json_1 = __importDefault(require("./en.json"));
8
8
  /**
9
- * Get en-US cultrue
9
+ * Get en neutral culture
10
10
  * @param localResources Local resources
11
11
  * @returns Full culture
12
12
  */
13
- const enUS = (localResources) => ({
14
- name: 'en-US',
13
+ const en = (localResources) => ({
14
+ name: 'en',
15
15
  label: 'English',
16
- resources: { ...en_US_json_1.default, ...localResources },
17
- compatibleName: ['en-CA', 'en-AU', 'en-NZ', 'en-GB', 'en-IE']
16
+ resources: { ...en_json_1.default, ...localResources },
17
+ compatibleNames: []
18
18
  });
19
- exports.enUS = enUS;
19
+ exports.en = en;
File without changes
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  import { DataTypes } from '@etsoo/shared';
2
2
  /**
3
- * Get zh-HK cultrue
3
+ * Get zh-Hans neutral cultrue
4
4
  * @param localResources Local resources
5
5
  * @returns Full culture
6
6
  */
7
- export declare const zhHK: (localResources: object) => DataTypes.CultureDefinition;
7
+ export declare const zhHans: (localResources: {}) => DataTypes.CultureDefinition;
@@ -3,17 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.zhCN = void 0;
7
- const zh_CN_json_1 = __importDefault(require("./zh-CN.json"));
6
+ exports.zhHans = void 0;
7
+ const zh_Hans_json_1 = __importDefault(require("./zh-Hans.json"));
8
8
  /**
9
- * Get zh-CN cultrue
9
+ * Get zh-Hans neutral cultrue
10
10
  * @param localResources Local resources
11
11
  * @returns Full culture
12
12
  */
13
- const zhCN = (localResources) => ({
14
- name: 'zh-CN',
13
+ const zhHans = (localResources) => ({
14
+ name: 'zh-Hans',
15
15
  label: '简体中文',
16
- resources: { ...zh_CN_json_1.default, ...localResources },
17
- compatibleName: ['zh-SG']
16
+ resources: { ...zh_Hans_json_1.default, ...localResources },
17
+ compatibleNames: ['zh-CN', 'zh-SG']
18
18
  });
19
- exports.zhCN = zhCN;
19
+ exports.zhHans = zhHans;
@@ -0,0 +1,7 @@
1
+ import { DataTypes } from '@etsoo/shared';
2
+ /**
3
+ * Get zh-Hant neutral cultrue
4
+ * @param localResources Local resources
5
+ * @returns Full culture
6
+ */
7
+ export declare const zhHant: (localResources: object) => DataTypes.CultureDefinition;
@@ -3,17 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.zhHK = void 0;
7
- const zh_HK_json_1 = __importDefault(require("./zh-HK.json"));
6
+ exports.zhHant = void 0;
7
+ const zh_Hant_json_1 = __importDefault(require("./zh-Hant.json"));
8
8
  /**
9
- * Get zh-HK cultrue
9
+ * Get zh-Hant neutral cultrue
10
10
  * @param localResources Local resources
11
11
  * @returns Full culture
12
12
  */
13
- const zhHK = (localResources) => ({
14
- name: 'zh-HK',
13
+ const zhHant = (localResources) => ({
14
+ name: 'zh-Hant',
15
15
  label: '繁體中文',
16
- resources: { ...zh_HK_json_1.default, ...localResources },
17
- compatibleName: ['zh-TW', 'zh-MO']
16
+ resources: { ...zh_Hant_json_1.default, ...localResources },
17
+ compatibleNames: ['zh-HK', 'zh-TW', 'zh-MO']
18
18
  });
19
- exports.zhHK = zhHK;
19
+ exports.zhHant = zhHant;
@@ -28,22 +28,26 @@ export * from './erp/dto/OrgQueryDto';
28
28
  export * from './erp/dto/OrgViewDto';
29
29
  export * from './erp/dto/PublicProductDto';
30
30
  export * from './erp/dto/ResultPayload';
31
+ export * from './erp/rq/LoginIdRQ';
32
+ export * from './erp/rq/LoginRQ';
31
33
  export * from './erp/rq/MemberListRQ';
32
34
  export * from './erp/rq/OrgListRQ';
33
35
  export * from './erp/rq/OrgQueryRQ';
34
36
  export * from './erp/rq/QueryRQ';
35
37
  export * from './erp/rq/RefreshTokenRQ';
36
38
  export * from './erp/rq/RegionsRQ';
39
+ export * from './erp/rq/ResetPasswordRQ';
37
40
  export * from './erp/rq/TiplistRQ';
38
41
  export * from './erp/AddressApi';
42
+ export * from './erp/AuthApi';
39
43
  export * from './erp/BaseApi';
40
44
  export * from './erp/EntityApi';
41
45
  export * from './erp/MemberApi';
42
46
  export * from './erp/OrgApi';
43
47
  export * from './erp/PublicApi';
44
- export * from './i18n/enUS';
45
- export * from './i18n/zhCN';
46
- export * from './i18n/zhHK';
48
+ export * from './i18n/en';
49
+ export * from './i18n/zhHans';
50
+ export * from './i18n/zhHant';
47
51
  export { ApiAuthorizationScheme, createClient } from '@etsoo/restclient';
48
52
  export type { IApi, IApiPayload } from '@etsoo/restclient';
49
53
  export * from './result/ActionResult';
package/lib/cjs/index.js CHANGED
@@ -52,24 +52,28 @@ __exportStar(require("./erp/dto/OrgViewDto"), exports);
52
52
  __exportStar(require("./erp/dto/PublicProductDto"), exports);
53
53
  __exportStar(require("./erp/dto/ResultPayload"), exports);
54
54
  // erp rq
55
+ __exportStar(require("./erp/rq/LoginIdRQ"), exports);
56
+ __exportStar(require("./erp/rq/LoginRQ"), exports);
55
57
  __exportStar(require("./erp/rq/MemberListRQ"), exports);
56
58
  __exportStar(require("./erp/rq/OrgListRQ"), exports);
57
59
  __exportStar(require("./erp/rq/OrgQueryRQ"), exports);
58
60
  __exportStar(require("./erp/rq/QueryRQ"), exports);
59
61
  __exportStar(require("./erp/rq/RefreshTokenRQ"), exports);
60
62
  __exportStar(require("./erp/rq/RegionsRQ"), exports);
63
+ __exportStar(require("./erp/rq/ResetPasswordRQ"), exports);
61
64
  __exportStar(require("./erp/rq/TiplistRQ"), exports);
62
65
  // erp api
63
66
  __exportStar(require("./erp/AddressApi"), exports);
67
+ __exportStar(require("./erp/AuthApi"), exports);
64
68
  __exportStar(require("./erp/BaseApi"), exports);
65
69
  __exportStar(require("./erp/EntityApi"), exports);
66
70
  __exportStar(require("./erp/MemberApi"), exports);
67
71
  __exportStar(require("./erp/OrgApi"), exports);
68
72
  __exportStar(require("./erp/PublicApi"), exports);
69
73
  // i18n
70
- __exportStar(require("./i18n/enUS"), exports);
71
- __exportStar(require("./i18n/zhCN"), exports);
72
- __exportStar(require("./i18n/zhHK"), exports);
74
+ __exportStar(require("./i18n/en"), exports);
75
+ __exportStar(require("./i18n/zhHans"), exports);
76
+ __exportStar(require("./i18n/zhHant"), exports);
73
77
  // @etsoo/restclient
74
78
  var restclient_1 = require("@etsoo/restclient");
75
79
  Object.defineProperty(exports, "ApiAuthorizationScheme", { enumerable: true, get: function () { return restclient_1.ApiAuthorizationScheme; } });
@@ -28,17 +28,17 @@ export class AddressRegion {
28
28
  /**
29
29
  * CN - China
30
30
  */
31
- AddressRegion.CN = new AddressRegion('CN', 'CHN', '156', AddressContinent.AS, '00', '+86', '0', 'CNY', ['zh-CN']);
31
+ AddressRegion.CN = new AddressRegion('CN', 'CHN', '156', AddressContinent.AS, '00', '+86', '0', 'CNY', ['zh-Hans-CN', 'zh-CN']);
32
32
  /**
33
33
  * HK - HK, China
34
34
  * 中国香港
35
35
  */
36
- AddressRegion.HK = new AddressRegion('HK', 'HKG', '344', AddressContinent.AS, '001', '+852', undefined, 'HKD', ['zh-HK', 'en-HK']);
36
+ AddressRegion.HK = new AddressRegion('HK', 'HKG', '344', AddressContinent.AS, '001', '+852', undefined, 'HKD', ['zh-Hant-HK', 'zh-HK', 'en-HK']);
37
37
  /**
38
38
  * SG - Singapore
39
39
  * 新加坡
40
40
  */
41
- AddressRegion.SG = new AddressRegion('SG', 'SGP', '702', AddressContinent.AS, '000', '+65', undefined, 'SGD', ['zh-SG', 'en-SG']);
41
+ AddressRegion.SG = new AddressRegion('SG', 'SGP', '702', AddressContinent.AS, '000', '+65', undefined, 'SGD', ['zh-Hans-SG', 'zh-SG', 'en-SG']);
42
42
  /**
43
43
  * JP - Japan
44
44
  * 日本
@@ -531,9 +531,9 @@ export class CoreApp {
531
531
  */
532
532
  checkLanguage(language) {
533
533
  if (language) {
534
- const item = this.settings.cultures.find((c) => { var _a; return c.name === language || ((_a = c.compatibleName) === null || _a === void 0 ? void 0 : _a.includes(language)); });
535
- if (item)
536
- return item.name;
534
+ const [cultrue, match] = DomUtils.getCulture(this.settings.cultures, language);
535
+ if (cultrue != null && match != DomUtils.CultureMatch.Default)
536
+ return cultrue.name;
537
537
  }
538
538
  // Default language
539
539
  return this.culture;
@@ -0,0 +1,33 @@
1
+ import { IApiPayload } from '@etsoo/restclient';
2
+ import { IActionResult } from '../result/IActionResult';
3
+ import { IUser } from '../state/User';
4
+ import { BaseApi } from './BaseApi';
5
+ import { ResultPayload } from './dto/ResultPayload';
6
+ import { LoginRQ } from './rq/LoginRQ';
7
+ import { ResetPasswordRQ } from './rq/ResetPasswordRQ';
8
+ /**
9
+ * Authentication API
10
+ */
11
+ export declare class AuthApi extends BaseApi {
12
+ /**
13
+ * Login
14
+ * @param rq Request data
15
+ * @param payload Payload
16
+ * @returns Result
17
+ */
18
+ protected loginBase<T extends IUser>(rq: LoginRQ, payload?: IApiPayload<IActionResult<T>>): Promise<[IActionResult<T> | undefined, string | null]>;
19
+ /**
20
+ * Login id check
21
+ * @param id Check id
22
+ * @param payload Payload
23
+ * @returns Result
24
+ */
25
+ loginId(id: string, payload?: ResultPayload): Promise<IActionResult<{}> | undefined>;
26
+ /**
27
+ * Reset password
28
+ * @param rq Request data
29
+ * @param payload Payload
30
+ * @returns Result
31
+ */
32
+ resetPassword(rq: ResetPasswordRQ, payload?: ResultPayload): Promise<IActionResult<{}> | undefined>;
33
+ }
@@ -0,0 +1,45 @@
1
+ import { BaseApi } from './BaseApi';
2
+ /**
3
+ * Authentication API
4
+ */
5
+ export class AuthApi extends BaseApi {
6
+ /**
7
+ * Login
8
+ * @param rq Request data
9
+ * @param payload Payload
10
+ * @returns Result
11
+ */
12
+ async loginBase(rq, payload) {
13
+ payload !== null && payload !== void 0 ? payload : (payload = {});
14
+ const result = await this.api.post('Auth/Login', rq, payload);
15
+ const refreshToken = (result === null || result === void 0 ? void 0 : result.ok)
16
+ ? this.app.getResponseToken(payload.response)
17
+ : null;
18
+ return [result, refreshToken];
19
+ }
20
+ /**
21
+ * Login id check
22
+ * @param id Check id
23
+ * @param payload Payload
24
+ * @returns Result
25
+ */
26
+ loginId(id, payload) {
27
+ const { deviceId, region } = this.app;
28
+ id = this.app.encrypt(id);
29
+ const rq = {
30
+ id,
31
+ deviceId,
32
+ region
33
+ };
34
+ return this.api.get('Auth/LoginId', rq, payload);
35
+ }
36
+ /**
37
+ * Reset password
38
+ * @param rq Request data
39
+ * @param payload Payload
40
+ * @returns Result
41
+ */
42
+ resetPassword(rq, payload) {
43
+ return this.api.put('Auth/ResetPassword', rq, payload);
44
+ }
45
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Login id request data
3
+ */
4
+ export type LoginIdRQ = {
5
+ /**
6
+ * Device id
7
+ */
8
+ deviceId: string;
9
+ /**
10
+ * Username, Email or mobile
11
+ */
12
+ id: string;
13
+ /**
14
+ * Country or region
15
+ */
16
+ region: string;
17
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { DataTypes } from '@etsoo/shared';
2
+ import { LoginIdRQ } from './LoginIdRQ';
3
+ /**
4
+ * Login request data
5
+ */
6
+ export type LoginRQ = LoginIdRQ & {
7
+ /**
8
+ * Password
9
+ */
10
+ pwd: string;
11
+ /**
12
+ * Organization
13
+ */
14
+ org?: number;
15
+ /**
16
+ * Time zone
17
+ */
18
+ timezone?: string;
19
+ /**
20
+ * Service id or uid
21
+ */
22
+ serviceId?: DataTypes.IdType;
23
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ export type ResetPasswordRQ = {
2
+ /**
3
+ * Email or mobile
4
+ */
5
+ id: string;
6
+ /**
7
+ * Verification code id
8
+ */
9
+ codeId: string;
10
+ /**
11
+ * Device id
12
+ */
13
+ deviceId: string;
14
+ /**
15
+ * New password
16
+ */
17
+ password: string;
18
+ /**
19
+ * Country or region
20
+ */
21
+ region: string;
22
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { DataTypes } from '@etsoo/shared';
2
2
  /**
3
- * Get en-US cultrue
3
+ * Get en neutral culture
4
4
  * @param localResources Local resources
5
5
  * @returns Full culture
6
6
  */
7
- export declare const enUS: (localResources: object) => DataTypes.CultureDefinition;
7
+ export declare const en: (localResources: object) => DataTypes.CultureDefinition;
@@ -0,0 +1,12 @@
1
+ import enUSResources from './en.json';
2
+ /**
3
+ * Get en neutral culture
4
+ * @param localResources Local resources
5
+ * @returns Full culture
6
+ */
7
+ export const en = (localResources) => ({
8
+ name: 'en',
9
+ label: 'English',
10
+ resources: { ...enUSResources, ...localResources },
11
+ compatibleNames: []
12
+ });
File without changes
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  import { DataTypes } from '@etsoo/shared';
2
2
  /**
3
- * Get en-US cultrue
3
+ * Get zh-Hans neutral cultrue
4
4
  * @param localResources Local resources
5
5
  * @returns Full culture
6
6
  */
7
- export declare const enUS: (localResources: object) => DataTypes.CultureDefinition;
7
+ export declare const zhHans: (localResources: {}) => DataTypes.CultureDefinition;
@@ -0,0 +1,12 @@
1
+ import zhCNResources from './zh-Hans.json';
2
+ /**
3
+ * Get zh-Hans neutral cultrue
4
+ * @param localResources Local resources
5
+ * @returns Full culture
6
+ */
7
+ export const zhHans = (localResources) => ({
8
+ name: 'zh-Hans',
9
+ label: '简体中文',
10
+ resources: { ...zhCNResources, ...localResources },
11
+ compatibleNames: ['zh-CN', 'zh-SG']
12
+ });
@@ -0,0 +1,7 @@
1
+ import { DataTypes } from '@etsoo/shared';
2
+ /**
3
+ * Get zh-Hant neutral cultrue
4
+ * @param localResources Local resources
5
+ * @returns Full culture
6
+ */
7
+ export declare const zhHant: (localResources: object) => DataTypes.CultureDefinition;
@@ -0,0 +1,12 @@
1
+ import zhHKResources from './zh-Hant.json';
2
+ /**
3
+ * Get zh-Hant neutral cultrue
4
+ * @param localResources Local resources
5
+ * @returns Full culture
6
+ */
7
+ export const zhHant = (localResources) => ({
8
+ name: 'zh-Hant',
9
+ label: '繁體中文',
10
+ resources: { ...zhHKResources, ...localResources },
11
+ compatibleNames: ['zh-HK', 'zh-TW', 'zh-MO']
12
+ });
@@ -28,22 +28,26 @@ export * from './erp/dto/OrgQueryDto';
28
28
  export * from './erp/dto/OrgViewDto';
29
29
  export * from './erp/dto/PublicProductDto';
30
30
  export * from './erp/dto/ResultPayload';
31
+ export * from './erp/rq/LoginIdRQ';
32
+ export * from './erp/rq/LoginRQ';
31
33
  export * from './erp/rq/MemberListRQ';
32
34
  export * from './erp/rq/OrgListRQ';
33
35
  export * from './erp/rq/OrgQueryRQ';
34
36
  export * from './erp/rq/QueryRQ';
35
37
  export * from './erp/rq/RefreshTokenRQ';
36
38
  export * from './erp/rq/RegionsRQ';
39
+ export * from './erp/rq/ResetPasswordRQ';
37
40
  export * from './erp/rq/TiplistRQ';
38
41
  export * from './erp/AddressApi';
42
+ export * from './erp/AuthApi';
39
43
  export * from './erp/BaseApi';
40
44
  export * from './erp/EntityApi';
41
45
  export * from './erp/MemberApi';
42
46
  export * from './erp/OrgApi';
43
47
  export * from './erp/PublicApi';
44
- export * from './i18n/enUS';
45
- export * from './i18n/zhCN';
46
- export * from './i18n/zhHK';
48
+ export * from './i18n/en';
49
+ export * from './i18n/zhHans';
50
+ export * from './i18n/zhHant';
47
51
  export { ApiAuthorizationScheme, createClient } from '@etsoo/restclient';
48
52
  export type { IApi, IApiPayload } from '@etsoo/restclient';
49
53
  export * from './result/ActionResult';
package/lib/mjs/index.js CHANGED
@@ -35,24 +35,28 @@ export * from './erp/dto/OrgViewDto';
35
35
  export * from './erp/dto/PublicProductDto';
36
36
  export * from './erp/dto/ResultPayload';
37
37
  // erp rq
38
+ export * from './erp/rq/LoginIdRQ';
39
+ export * from './erp/rq/LoginRQ';
38
40
  export * from './erp/rq/MemberListRQ';
39
41
  export * from './erp/rq/OrgListRQ';
40
42
  export * from './erp/rq/OrgQueryRQ';
41
43
  export * from './erp/rq/QueryRQ';
42
44
  export * from './erp/rq/RefreshTokenRQ';
43
45
  export * from './erp/rq/RegionsRQ';
46
+ export * from './erp/rq/ResetPasswordRQ';
44
47
  export * from './erp/rq/TiplistRQ';
45
48
  // erp api
46
49
  export * from './erp/AddressApi';
50
+ export * from './erp/AuthApi';
47
51
  export * from './erp/BaseApi';
48
52
  export * from './erp/EntityApi';
49
53
  export * from './erp/MemberApi';
50
54
  export * from './erp/OrgApi';
51
55
  export * from './erp/PublicApi';
52
56
  // i18n
53
- export * from './i18n/enUS';
54
- export * from './i18n/zhCN';
55
- export * from './i18n/zhHK';
57
+ export * from './i18n/en';
58
+ export * from './i18n/zhHans';
59
+ export * from './i18n/zhHant';
56
60
  // @etsoo/restclient
57
61
  export { ApiAuthorizationScheme, createClient } from '@etsoo/restclient';
58
62
  // result
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.3.44",
3
+ "version": "1.3.48",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -54,7 +54,7 @@
54
54
  "dependencies": {
55
55
  "@etsoo/notificationbase": "^1.1.18",
56
56
  "@etsoo/restclient": "^1.0.79",
57
- "@etsoo/shared": "^1.1.79",
57
+ "@etsoo/shared": "^1.1.81",
58
58
  "@types/crypto-js": "^4.1.1",
59
59
  "crypto-js": "^4.1.1"
60
60
  },
@@ -64,9 +64,9 @@
64
64
  "@babel/plugin-transform-runtime": "^7.19.6",
65
65
  "@babel/preset-env": "^7.20.2",
66
66
  "@babel/runtime-corejs3": "^7.20.6",
67
- "@types/jest": "^29.2.3",
68
- "@typescript-eslint/eslint-plugin": "^5.45.0",
69
- "@typescript-eslint/parser": "^5.45.0",
67
+ "@types/jest": "^29.2.4",
68
+ "@typescript-eslint/eslint-plugin": "^5.45.1",
69
+ "@typescript-eslint/parser": "^5.45.1",
70
70
  "eslint": "^8.29.0",
71
71
  "eslint-config-airbnb-base": "^15.0.0",
72
72
  "eslint-plugin-import": "^2.26.0",
@@ -100,7 +100,7 @@ export class AddressRegion implements IAddressRegion {
100
100
  '+86',
101
101
  '0',
102
102
  'CNY',
103
- ['zh-CN']
103
+ ['zh-Hans-CN', 'zh-CN']
104
104
  );
105
105
 
106
106
  /**
@@ -116,7 +116,7 @@ export class AddressRegion implements IAddressRegion {
116
116
  '+852',
117
117
  undefined,
118
118
  'HKD',
119
- ['zh-HK', 'en-HK']
119
+ ['zh-Hant-HK', 'zh-HK', 'en-HK']
120
120
  );
121
121
 
122
122
  /**
@@ -132,7 +132,7 @@ export class AddressRegion implements IAddressRegion {
132
132
  '+65',
133
133
  undefined,
134
134
  'SGD',
135
- ['zh-SG', 'en-SG']
135
+ ['zh-Hans-SG', 'zh-SG', 'en-SG']
136
136
  );
137
137
 
138
138
  /**
@@ -783,11 +783,12 @@ export abstract class CoreApp<
783
783
  */
784
784
  checkLanguage(language?: string) {
785
785
  if (language) {
786
- const item = this.settings.cultures.find(
787
- (c) =>
788
- c.name === language || c.compatibleName?.includes(language)
786
+ const [cultrue, match] = DomUtils.getCulture(
787
+ this.settings.cultures,
788
+ language
789
789
  );
790
- if (item) return item.name;
790
+ if (cultrue != null && match != DomUtils.CultureMatch.Default)
791
+ return cultrue.name;
791
792
  }
792
793
 
793
794
  // Default language
@@ -0,0 +1,58 @@
1
+ import { IApiPayload } from '@etsoo/restclient';
2
+ import { IActionResult } from '../result/IActionResult';
3
+ import { IUser } from '../state/User';
4
+ import { BaseApi } from './BaseApi';
5
+ import { ResultPayload } from './dto/ResultPayload';
6
+ import { LoginIdRQ } from './rq/LoginIdRQ';
7
+ import { LoginRQ } from './rq/LoginRQ';
8
+ import { ResetPasswordRQ } from './rq/ResetPasswordRQ';
9
+
10
+ /**
11
+ * Authentication API
12
+ */
13
+ export class AuthApi extends BaseApi {
14
+ /**
15
+ * Login
16
+ * @param rq Request data
17
+ * @param payload Payload
18
+ * @returns Result
19
+ */
20
+ protected async loginBase<T extends IUser>(
21
+ rq: LoginRQ,
22
+ payload?: IApiPayload<IActionResult<T>>
23
+ ): Promise<[IActionResult<T> | undefined, string | null]> {
24
+ payload ??= {};
25
+ const result = await this.api.post('Auth/Login', rq, payload);
26
+ const refreshToken = result?.ok
27
+ ? this.app.getResponseToken(payload.response)
28
+ : null;
29
+ return [result, refreshToken];
30
+ }
31
+
32
+ /**
33
+ * Login id check
34
+ * @param id Check id
35
+ * @param payload Payload
36
+ * @returns Result
37
+ */
38
+ loginId(id: string, payload?: ResultPayload) {
39
+ const { deviceId, region } = this.app;
40
+ id = this.app.encrypt(id);
41
+ const rq: LoginIdRQ = {
42
+ id,
43
+ deviceId,
44
+ region
45
+ };
46
+ return this.api.get('Auth/LoginId', rq, payload);
47
+ }
48
+
49
+ /**
50
+ * Reset password
51
+ * @param rq Request data
52
+ * @param payload Payload
53
+ * @returns Result
54
+ */
55
+ resetPassword(rq: ResetPasswordRQ, payload?: ResultPayload) {
56
+ return this.api.put('Auth/ResetPassword', rq, payload);
57
+ }
58
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Login id request data
3
+ */
4
+ export type LoginIdRQ = {
5
+ /**
6
+ * Device id
7
+ */
8
+ deviceId: string;
9
+
10
+ /**
11
+ * Username, Email or mobile
12
+ */
13
+ id: string;
14
+
15
+ /**
16
+ * Country or region
17
+ */
18
+ region: string;
19
+ };
@@ -0,0 +1,27 @@
1
+ import { DataTypes } from '@etsoo/shared';
2
+ import { LoginIdRQ } from './LoginIdRQ';
3
+
4
+ /**
5
+ * Login request data
6
+ */
7
+ export type LoginRQ = LoginIdRQ & {
8
+ /**
9
+ * Password
10
+ */
11
+ pwd: string;
12
+
13
+ /**
14
+ * Organization
15
+ */
16
+ org?: number;
17
+
18
+ /**
19
+ * Time zone
20
+ */
21
+ timezone?: string;
22
+
23
+ /**
24
+ * Service id or uid
25
+ */
26
+ serviceId?: DataTypes.IdType;
27
+ };
@@ -0,0 +1,26 @@
1
+ export type ResetPasswordRQ = {
2
+ /**
3
+ * Email or mobile
4
+ */
5
+ id: string;
6
+
7
+ /**
8
+ * Verification code id
9
+ */
10
+ codeId: string;
11
+
12
+ /**
13
+ * Device id
14
+ */
15
+ deviceId: string;
16
+
17
+ /**
18
+ * New password
19
+ */
20
+ password: string;
21
+
22
+ /**
23
+ * Country or region
24
+ */
25
+ region: string;
26
+ };
File without changes
package/src/i18n/en.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { DataTypes } from '@etsoo/shared';
2
+ import enUSResources from './en.json';
3
+
4
+ /**
5
+ * Get en neutral culture
6
+ * @param localResources Local resources
7
+ * @returns Full culture
8
+ */
9
+ export const en = (localResources: object): DataTypes.CultureDefinition => ({
10
+ name: 'en',
11
+ label: 'English',
12
+ resources: { ...enUSResources, ...localResources },
13
+ compatibleNames: []
14
+ });
File without changes
File without changes
@@ -0,0 +1,14 @@
1
+ import { DataTypes } from '@etsoo/shared';
2
+ import zhCNResources from './zh-Hans.json';
3
+
4
+ /**
5
+ * Get zh-Hans neutral cultrue
6
+ * @param localResources Local resources
7
+ * @returns Full culture
8
+ */
9
+ export const zhHans = (localResources: {}): DataTypes.CultureDefinition => ({
10
+ name: 'zh-Hans',
11
+ label: '简体中文',
12
+ resources: { ...zhCNResources, ...localResources },
13
+ compatibleNames: ['zh-CN', 'zh-SG']
14
+ });
@@ -0,0 +1,16 @@
1
+ import { DataTypes } from '@etsoo/shared';
2
+ import zhHKResources from './zh-Hant.json';
3
+
4
+ /**
5
+ * Get zh-Hant neutral cultrue
6
+ * @param localResources Local resources
7
+ * @returns Full culture
8
+ */
9
+ export const zhHant = (
10
+ localResources: object
11
+ ): DataTypes.CultureDefinition => ({
12
+ name: 'zh-Hant',
13
+ label: '繁體中文',
14
+ resources: { ...zhHKResources, ...localResources },
15
+ compatibleNames: ['zh-HK', 'zh-TW', 'zh-MO']
16
+ });
package/src/index.ts CHANGED
@@ -41,16 +41,20 @@ export * from './erp/dto/PublicProductDto';
41
41
  export * from './erp/dto/ResultPayload';
42
42
 
43
43
  // erp rq
44
+ export * from './erp/rq/LoginIdRQ';
45
+ export * from './erp/rq/LoginRQ';
44
46
  export * from './erp/rq/MemberListRQ';
45
47
  export * from './erp/rq/OrgListRQ';
46
48
  export * from './erp/rq/OrgQueryRQ';
47
49
  export * from './erp/rq/QueryRQ';
48
50
  export * from './erp/rq/RefreshTokenRQ';
49
51
  export * from './erp/rq/RegionsRQ';
52
+ export * from './erp/rq/ResetPasswordRQ';
50
53
  export * from './erp/rq/TiplistRQ';
51
54
 
52
55
  // erp api
53
56
  export * from './erp/AddressApi';
57
+ export * from './erp/AuthApi';
54
58
  export * from './erp/BaseApi';
55
59
  export * from './erp/EntityApi';
56
60
  export * from './erp/MemberApi';
@@ -58,9 +62,9 @@ export * from './erp/OrgApi';
58
62
  export * from './erp/PublicApi';
59
63
 
60
64
  // i18n
61
- export * from './i18n/enUS';
62
- export * from './i18n/zhCN';
63
- export * from './i18n/zhHK';
65
+ export * from './i18n/en';
66
+ export * from './i18n/zhHans';
67
+ export * from './i18n/zhHant';
64
68
 
65
69
  // @etsoo/restclient
66
70
  export { ApiAuthorizationScheme, createClient } from '@etsoo/restclient';
@@ -1,12 +0,0 @@
1
- import enUSResources from './en-US.json';
2
- /**
3
- * Get en-US cultrue
4
- * @param localResources Local resources
5
- * @returns Full culture
6
- */
7
- export const enUS = (localResources) => ({
8
- name: 'en-US',
9
- label: 'English',
10
- resources: { ...enUSResources, ...localResources },
11
- compatibleName: ['en-CA', 'en-AU', 'en-NZ', 'en-GB', 'en-IE']
12
- });
@@ -1,7 +0,0 @@
1
- import { DataTypes } from '@etsoo/shared';
2
- /**
3
- * Get zh-CN cultrue
4
- * @param localResources Local resources
5
- * @returns Full culture
6
- */
7
- export declare const zhCN: (localResources: {}) => DataTypes.CultureDefinition;
@@ -1,12 +0,0 @@
1
- import zhCNResources from './zh-CN.json';
2
- /**
3
- * Get zh-CN cultrue
4
- * @param localResources Local resources
5
- * @returns Full culture
6
- */
7
- export const zhCN = (localResources) => ({
8
- name: 'zh-CN',
9
- label: '简体中文',
10
- resources: { ...zhCNResources, ...localResources },
11
- compatibleName: ['zh-SG']
12
- });
@@ -1,7 +0,0 @@
1
- import { DataTypes } from '@etsoo/shared';
2
- /**
3
- * Get zh-HK cultrue
4
- * @param localResources Local resources
5
- * @returns Full culture
6
- */
7
- export declare const zhHK: (localResources: object) => DataTypes.CultureDefinition;
@@ -1,12 +0,0 @@
1
- import zhHKResources from './zh-HK.json';
2
- /**
3
- * Get zh-HK cultrue
4
- * @param localResources Local resources
5
- * @returns Full culture
6
- */
7
- export const zhHK = (localResources) => ({
8
- name: 'zh-HK',
9
- label: '繁體中文',
10
- resources: { ...zhHKResources, ...localResources },
11
- compatibleName: ['zh-TW', 'zh-MO']
12
- });
package/src/i18n/enUS.ts DELETED
@@ -1,14 +0,0 @@
1
- import { DataTypes } from '@etsoo/shared';
2
- import enUSResources from './en-US.json';
3
-
4
- /**
5
- * Get en-US cultrue
6
- * @param localResources Local resources
7
- * @returns Full culture
8
- */
9
- export const enUS = (localResources: object): DataTypes.CultureDefinition => ({
10
- name: 'en-US',
11
- label: 'English',
12
- resources: { ...enUSResources, ...localResources },
13
- compatibleName: ['en-CA', 'en-AU', 'en-NZ', 'en-GB', 'en-IE']
14
- });
package/src/i18n/zhCN.ts DELETED
@@ -1,14 +0,0 @@
1
- import { DataTypes } from '@etsoo/shared';
2
- import zhCNResources from './zh-CN.json';
3
-
4
- /**
5
- * Get zh-CN cultrue
6
- * @param localResources Local resources
7
- * @returns Full culture
8
- */
9
- export const zhCN = (localResources: {}): DataTypes.CultureDefinition => ({
10
- name: 'zh-CN',
11
- label: '简体中文',
12
- resources: { ...zhCNResources, ...localResources },
13
- compatibleName: ['zh-SG']
14
- });
package/src/i18n/zhHK.ts DELETED
@@ -1,14 +0,0 @@
1
- import { DataTypes } from '@etsoo/shared';
2
- import zhHKResources from './zh-HK.json';
3
-
4
- /**
5
- * Get zh-HK cultrue
6
- * @param localResources Local resources
7
- * @returns Full culture
8
- */
9
- export const zhHK = (localResources: object): DataTypes.CultureDefinition => ({
10
- name: 'zh-HK',
11
- label: '繁體中文',
12
- resources: { ...zhHKResources, ...localResources },
13
- compatibleName: ['zh-TW', 'zh-MO']
14
- });