@etsoo/smarterp-core 1.1.0 → 1.1.2

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.
@@ -11,6 +11,10 @@ on:
11
11
  # release:
12
12
  # types: [created]
13
13
 
14
+ permissions:
15
+ id-token: write # Required for OIDC
16
+ contents: read
17
+
14
18
  jobs:
15
19
  # Publish to NPM
16
20
  publish-npm:
@@ -52,9 +56,8 @@ jobs:
52
56
  - name: Publish if necessary
53
57
  id: publish
54
58
  if: ${{ steps.check.outputs.exists == '0' }} # package version doesn't yet exist, ship it!
55
- run: npm publish --access public
56
- env:
57
- NODE_AUTH_TOKEN: ${{ secrets.ETSOONpmToken }}
59
+ run: npm publish
60
+
58
61
  - name: Report publish status
59
62
  if: ${{ steps.check.outputs.exists == '1' }}
60
63
  run: 'echo "package version already exists on npm registry"'
@@ -101,6 +101,15 @@ if (isLocalTest) {
101
101
  expect(result[2].id).toBe("NZ");
102
102
  });
103
103
 
104
+ test("Test for parseName", async () => {
105
+ const result = await api.parseName({ name: "张三" });
106
+ expect(result).not.toBeNull();
107
+ expect(result?.familyName).toBe("张");
108
+ expect(result?.givenName).toBe("三");
109
+ expect(result?.latinFamilyName).toBe("Zhang");
110
+ expect(result?.latinGivenName).toBe("San");
111
+ });
112
+
104
113
  test("Test for CN queryPlace", async () => {
105
114
  const result = await api.queryPlace({
106
115
  query: "山东省青岛李沧清溪路88号玫瑰庭院10号楼二单元501室",
@@ -10,6 +10,8 @@ import { BaseApi, CultureItem, Currency, CustomCulture, IApp, ProductUnit, Resul
10
10
  import { MemberInvitationDto } from "./dto/public/MemberInvitationDto";
11
11
  import { AcceptInvitationRQ } from "./rq/public/AcceptInvitationRQ";
12
12
  import { ChinaPinData } from "./dto/public/ChinaPinData";
13
+ import { ParseNameRQ } from "./rq/public/ParseNameRQ";
14
+ import { NameData } from "./dto/public/NameData";
13
15
  /**
14
16
  * Public API
15
17
  * 公共接口
@@ -99,6 +101,13 @@ export declare class PublicApi extends BaseApi {
99
101
  * @returns Result
100
102
  */
101
103
  parseChinaPin(pin: string, payload?: IApiPayload<ChinaPinData>): Promise<ChinaPinData | undefined>;
104
+ /**
105
+ * Parse name
106
+ * @param rq Request data
107
+ * @param payload Payload
108
+ * @returns Result
109
+ */
110
+ parseName(rq: ParseNameRQ, payload?: IApiPayload<NameData>): Promise<NameData | undefined>;
102
111
  /**
103
112
  * Query place
104
113
  * @param rq Request data
@@ -139,6 +139,15 @@ class PublicApi extends appscript_1.BaseApi {
139
139
  parseChinaPin(pin, payload) {
140
140
  return this.api.get(`Public/ParseChinaPin/${pin}`, undefined, payload);
141
141
  }
142
+ /**
143
+ * Parse name
144
+ * @param rq Request data
145
+ * @param payload Payload
146
+ * @returns Result
147
+ */
148
+ parseName(rq, payload) {
149
+ return this.api.post("Public/ParseName", rq, payload);
150
+ }
142
151
  /**
143
152
  * Query place
144
153
  * @param rq Request data
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Name data
3
+ * 姓名数据
4
+ */
5
+ export type NameData = {
6
+ /**
7
+ * Family name
8
+ * 姓氏
9
+ */
10
+ familyName?: string;
11
+ /**
12
+ * Given name
13
+ * 名
14
+ */
15
+ givenName?: string;
16
+ /**
17
+ * Latin family name
18
+ * 拉丁姓(拼音)
19
+ */
20
+ latinFamilyName?: string;
21
+ /**
22
+ * Latin given name
23
+ * 拉丁名(拼音)
24
+ */
25
+ latinGivenName?: string;
26
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -26,6 +26,7 @@ export * from "./dto/public/AvatarState";
26
26
  export * from "./dto/public/ChinaPinData";
27
27
  export * from "./dto/public/CurrencyItem";
28
28
  export * from "./dto/public/MemberInvitationDto";
29
+ export * from "./dto/public/NameData";
29
30
  export * from "./dto/public/PlaceCommon";
30
31
  export * from "./dto/public/RegionData";
31
32
  export * from "./dto/user/AuditHistoryDto";
@@ -64,6 +65,7 @@ export * from "./rq/org/SendProfileEmailRQ";
64
65
  export * from "./rq/org/SendSMSMessage";
65
66
  export * from "./rq/public/AcceptInvitationRQ";
66
67
  export * from "./rq/public/CreateBarcodeRQ";
68
+ export * from "./rq/public/ParseNameRQ";
67
69
  export * from "./rq/public/PinyinRQ";
68
70
  export * from "./rq/public/PlaceQueryRQ";
69
71
  export * from "./rq/user/AuditHistoryRQ";
package/lib/cjs/index.js CHANGED
@@ -43,6 +43,7 @@ __exportStar(require("./dto/public/AvatarState"), exports);
43
43
  __exportStar(require("./dto/public/ChinaPinData"), exports);
44
44
  __exportStar(require("./dto/public/CurrencyItem"), exports);
45
45
  __exportStar(require("./dto/public/MemberInvitationDto"), exports);
46
+ __exportStar(require("./dto/public/NameData"), exports);
46
47
  __exportStar(require("./dto/public/PlaceCommon"), exports);
47
48
  __exportStar(require("./dto/public/RegionData"), exports);
48
49
  __exportStar(require("./dto/user/AuditHistoryDto"), exports);
@@ -83,6 +84,7 @@ __exportStar(require("./rq/org/SendProfileEmailRQ"), exports);
83
84
  __exportStar(require("./rq/org/SendSMSMessage"), exports);
84
85
  __exportStar(require("./rq/public/AcceptInvitationRQ"), exports);
85
86
  __exportStar(require("./rq/public/CreateBarcodeRQ"), exports);
87
+ __exportStar(require("./rq/public/ParseNameRQ"), exports);
86
88
  __exportStar(require("./rq/public/PinyinRQ"), exports);
87
89
  __exportStar(require("./rq/public/PlaceQueryRQ"), exports);
88
90
  __exportStar(require("./rq/user/AuditHistoryRQ"), exports);
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Parse name request data
3
+ * 解析名称请求数据
4
+ */
5
+ export type ParseNameRQ = {
6
+ /**
7
+ * Name
8
+ * 姓名
9
+ */
10
+ name: string;
11
+ /**
12
+ * Family name
13
+ * 姓
14
+ */
15
+ familyName?: string | null;
16
+ /**
17
+ * Given name
18
+ * 名
19
+ */
20
+ givenName?: string | null;
21
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -10,6 +10,8 @@ import { BaseApi, CultureItem, Currency, CustomCulture, IApp, ProductUnit, Resul
10
10
  import { MemberInvitationDto } from "./dto/public/MemberInvitationDto";
11
11
  import { AcceptInvitationRQ } from "./rq/public/AcceptInvitationRQ";
12
12
  import { ChinaPinData } from "./dto/public/ChinaPinData";
13
+ import { ParseNameRQ } from "./rq/public/ParseNameRQ";
14
+ import { NameData } from "./dto/public/NameData";
13
15
  /**
14
16
  * Public API
15
17
  * 公共接口
@@ -99,6 +101,13 @@ export declare class PublicApi extends BaseApi {
99
101
  * @returns Result
100
102
  */
101
103
  parseChinaPin(pin: string, payload?: IApiPayload<ChinaPinData>): Promise<ChinaPinData | undefined>;
104
+ /**
105
+ * Parse name
106
+ * @param rq Request data
107
+ * @param payload Payload
108
+ * @returns Result
109
+ */
110
+ parseName(rq: ParseNameRQ, payload?: IApiPayload<NameData>): Promise<NameData | undefined>;
102
111
  /**
103
112
  * Query place
104
113
  * @param rq Request data
@@ -136,6 +136,15 @@ export class PublicApi extends BaseApi {
136
136
  parseChinaPin(pin, payload) {
137
137
  return this.api.get(`Public/ParseChinaPin/${pin}`, undefined, payload);
138
138
  }
139
+ /**
140
+ * Parse name
141
+ * @param rq Request data
142
+ * @param payload Payload
143
+ * @returns Result
144
+ */
145
+ parseName(rq, payload) {
146
+ return this.api.post("Public/ParseName", rq, payload);
147
+ }
139
148
  /**
140
149
  * Query place
141
150
  * @param rq Request data
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Name data
3
+ * 姓名数据
4
+ */
5
+ export type NameData = {
6
+ /**
7
+ * Family name
8
+ * 姓氏
9
+ */
10
+ familyName?: string;
11
+ /**
12
+ * Given name
13
+ * 名
14
+ */
15
+ givenName?: string;
16
+ /**
17
+ * Latin family name
18
+ * 拉丁姓(拼音)
19
+ */
20
+ latinFamilyName?: string;
21
+ /**
22
+ * Latin given name
23
+ * 拉丁名(拼音)
24
+ */
25
+ latinGivenName?: string;
26
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -26,6 +26,7 @@ export * from "./dto/public/AvatarState";
26
26
  export * from "./dto/public/ChinaPinData";
27
27
  export * from "./dto/public/CurrencyItem";
28
28
  export * from "./dto/public/MemberInvitationDto";
29
+ export * from "./dto/public/NameData";
29
30
  export * from "./dto/public/PlaceCommon";
30
31
  export * from "./dto/public/RegionData";
31
32
  export * from "./dto/user/AuditHistoryDto";
@@ -64,6 +65,7 @@ export * from "./rq/org/SendProfileEmailRQ";
64
65
  export * from "./rq/org/SendSMSMessage";
65
66
  export * from "./rq/public/AcceptInvitationRQ";
66
67
  export * from "./rq/public/CreateBarcodeRQ";
68
+ export * from "./rq/public/ParseNameRQ";
67
69
  export * from "./rq/public/PinyinRQ";
68
70
  export * from "./rq/public/PlaceQueryRQ";
69
71
  export * from "./rq/user/AuditHistoryRQ";
package/lib/mjs/index.js CHANGED
@@ -27,6 +27,7 @@ export * from "./dto/public/AvatarState";
27
27
  export * from "./dto/public/ChinaPinData";
28
28
  export * from "./dto/public/CurrencyItem";
29
29
  export * from "./dto/public/MemberInvitationDto";
30
+ export * from "./dto/public/NameData";
30
31
  export * from "./dto/public/PlaceCommon";
31
32
  export * from "./dto/public/RegionData";
32
33
  export * from "./dto/user/AuditHistoryDto";
@@ -67,6 +68,7 @@ export * from "./rq/org/SendProfileEmailRQ";
67
68
  export * from "./rq/org/SendSMSMessage";
68
69
  export * from "./rq/public/AcceptInvitationRQ";
69
70
  export * from "./rq/public/CreateBarcodeRQ";
71
+ export * from "./rq/public/ParseNameRQ";
70
72
  export * from "./rq/public/PinyinRQ";
71
73
  export * from "./rq/public/PlaceQueryRQ";
72
74
  export * from "./rq/user/AuditHistoryRQ";
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Parse name request data
3
+ * 解析名称请求数据
4
+ */
5
+ export type ParseNameRQ = {
6
+ /**
7
+ * Name
8
+ * 姓名
9
+ */
10
+ name: string;
11
+ /**
12
+ * Family name
13
+ * 姓
14
+ */
15
+ familyName?: string | null;
16
+ /**
17
+ * Given name
18
+ * 名
19
+ */
20
+ givenName?: string | null;
21
+ };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-core",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "TypeScript APIs for SmartERP Core",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",
27
- "url": "git+https://github.com/ETSOO/etsoo-smarterp-core.git"
27
+ "url": "git+https://github.com/ETSOO/smarterp-core.git"
28
28
  },
29
29
  "keywords": [
30
30
  "TypeScript",
@@ -38,30 +38,30 @@
38
38
  ],
39
39
  "author": "ETSOO",
40
40
  "license": "MIT",
41
- "homepage": "https://github.com/ETSOO/etsoo-smarterp-core#readme",
41
+ "homepage": "https://github.com/ETSOO/smarterp-core#readme",
42
42
  "devDependencies": {
43
43
  "@babel/cli": "^7.28.3",
44
44
  "@babel/core": "^7.28.5",
45
45
  "@babel/plugin-transform-runtime": "^7.28.5",
46
46
  "@babel/preset-env": "^7.28.5",
47
47
  "@babel/runtime-corejs3": "^7.28.4",
48
- "@types/react": "^19.2.2",
49
- "@types/react-dom": "^19.2.2",
50
- "@vitejs/plugin-react": "^5.1.0",
51
- "jsdom": "^27.1.0",
48
+ "@types/react": "^19.2.7",
49
+ "@types/react-dom": "^19.2.3",
50
+ "@vitejs/plugin-react": "^5.1.2",
51
+ "jsdom": "^27.3.0",
52
52
  "typescript": "^5.9.3",
53
- "vitest": "^4.0.8"
53
+ "vitest": "^4.0.15"
54
54
  },
55
55
  "dependencies": {
56
- "@etsoo/appscript": "^1.6.47",
57
- "@etsoo/materialui": "^1.5.84",
58
- "@etsoo/react": "^1.8.62",
59
- "@etsoo/shared": "^1.2.79",
56
+ "@etsoo/appscript": "^1.6.49",
57
+ "@etsoo/materialui": "^1.5.90",
58
+ "@etsoo/react": "^1.8.64",
59
+ "@etsoo/shared": "^1.2.80",
60
60
  "@etsoo/toolpad": "^1.0.42",
61
- "@mui/material": "^7.3.5",
61
+ "@mui/material": "^7.3.6",
62
62
  "ajv": "^8.17.1",
63
63
  "ajv-formats": "^3.0.1",
64
- "react": "^19.2.0",
65
- "react-dom": "^19.2.0"
64
+ "react": "^19.2.1",
65
+ "react-dom": "^19.2.1"
66
66
  }
67
67
  }
package/src/PublicApi.ts CHANGED
@@ -19,6 +19,8 @@ import {
19
19
  import { MemberInvitationDto } from "./dto/public/MemberInvitationDto";
20
20
  import { AcceptInvitationRQ } from "./rq/public/AcceptInvitationRQ";
21
21
  import { ChinaPinData } from "./dto/public/ChinaPinData";
22
+ import { ParseNameRQ } from "./rq/public/ParseNameRQ";
23
+ import { NameData } from "./dto/public/NameData";
22
24
 
23
25
  const unitPrefix = "unit";
24
26
 
@@ -174,6 +176,16 @@ export class PublicApi extends BaseApi {
174
176
  return this.api.get(`Public/ParseChinaPin/${pin}`, undefined, payload);
175
177
  }
176
178
 
179
+ /**
180
+ * Parse name
181
+ * @param rq Request data
182
+ * @param payload Payload
183
+ * @returns Result
184
+ */
185
+ parseName(rq: ParseNameRQ, payload?: IApiPayload<NameData>) {
186
+ return this.api.post("Public/ParseName", rq, payload);
187
+ }
188
+
177
189
  /**
178
190
  * Query place
179
191
  * @param rq Request data
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Name data
3
+ * 姓名数据
4
+ */
5
+ export type NameData = {
6
+ /**
7
+ * Family name
8
+ * 姓氏
9
+ */
10
+ familyName?: string;
11
+
12
+ /**
13
+ * Given name
14
+ * 名
15
+ */
16
+ givenName?: string;
17
+
18
+ /**
19
+ * Latin family name
20
+ * 拉丁姓(拼音)
21
+ */
22
+ latinFamilyName?: string;
23
+
24
+ /**
25
+ * Latin given name
26
+ * 拉丁名(拼音)
27
+ */
28
+ latinGivenName?: string;
29
+ };
package/src/index.ts CHANGED
@@ -31,6 +31,7 @@ export * from "./dto/public/AvatarState";
31
31
  export * from "./dto/public/ChinaPinData";
32
32
  export * from "./dto/public/CurrencyItem";
33
33
  export * from "./dto/public/MemberInvitationDto";
34
+ export * from "./dto/public/NameData";
34
35
  export * from "./dto/public/PlaceCommon";
35
36
  export * from "./dto/public/RegionData";
36
37
 
@@ -78,6 +79,7 @@ export * from "./rq/org/SendSMSMessage";
78
79
 
79
80
  export * from "./rq/public/AcceptInvitationRQ";
80
81
  export * from "./rq/public/CreateBarcodeRQ";
82
+ export * from "./rq/public/ParseNameRQ";
81
83
  export * from "./rq/public/PinyinRQ";
82
84
  export * from "./rq/public/PlaceQueryRQ";
83
85
 
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Parse name request data
3
+ * 解析名称请求数据
4
+ */
5
+ export type ParseNameRQ = {
6
+ /**
7
+ * Name
8
+ * 姓名
9
+ */
10
+ name: string;
11
+
12
+ /**
13
+ * Family name
14
+ * 姓
15
+ */
16
+ familyName?: string | null;
17
+
18
+ /**
19
+ * Given name
20
+ * 名
21
+ */
22
+ givenName?: string | null;
23
+ };