@etsoo/smarterp-core 1.0.47 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/OrgApi.ts +3 -2
- package/__tests__/PublicApi.ts +6 -0
- package/__tests__/UserApi.ts +1 -1
- package/lib/cjs/OrgApi.d.ts +16 -1
- package/lib/cjs/OrgApi.js +18 -0
- package/lib/cjs/PublicApi.d.ts +15 -1
- package/lib/cjs/PublicApi.js +29 -2
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/rq/org/SendProfileEmailRQ.d.ts +31 -0
- package/lib/cjs/rq/org/SendProfileEmailRQ.js +2 -0
- package/lib/mjs/OrgApi.d.ts +16 -1
- package/lib/mjs/OrgApi.js +18 -0
- package/lib/mjs/PublicApi.d.ts +15 -1
- package/lib/mjs/PublicApi.js +29 -2
- package/lib/mjs/index.d.ts +1 -0
- package/lib/mjs/index.js +1 -0
- package/lib/mjs/rq/org/SendProfileEmailRQ.d.ts +31 -0
- package/lib/mjs/rq/org/SendProfileEmailRQ.js +1 -0
- package/package.json +4 -4
- package/src/OrgApi.ts +26 -0
- package/src/PublicApi.ts +37 -2
- package/src/index.ts +1 -0
- package/src/rq/org/SendProfileEmailRQ.ts +35 -0
package/__tests__/OrgApi.ts
CHANGED
|
@@ -15,6 +15,7 @@ if (isLocalTest) {
|
|
|
15
15
|
|
|
16
16
|
const api = new OrgApi(app);
|
|
17
17
|
|
|
18
|
+
/*
|
|
18
19
|
test("Test for create, delete", async () => {
|
|
19
20
|
const guid = Utils.newGUID().slice(0, 20);
|
|
20
21
|
const random = Date.now() % 2 == 0;
|
|
@@ -55,6 +56,7 @@ if (isLocalTest) {
|
|
|
55
56
|
|
|
56
57
|
expect(deleteResult?.ok).toBeTruthy();
|
|
57
58
|
});
|
|
59
|
+
*/
|
|
58
60
|
|
|
59
61
|
test("Test for query zero return", async () => {
|
|
60
62
|
const result = await api.query({
|
|
@@ -82,8 +84,7 @@ if (isLocalTest) {
|
|
|
82
84
|
enabled: true,
|
|
83
85
|
excludedIds: [1, 2, 3],
|
|
84
86
|
queryPaging: {
|
|
85
|
-
|
|
86
|
-
batchSize: 5,
|
|
87
|
+
batchSize: 2,
|
|
87
88
|
orderBy: [{ field: "name" }, { field: "id", desc: true, unique: true }]
|
|
88
89
|
}
|
|
89
90
|
});
|
package/__tests__/PublicApi.ts
CHANGED
|
@@ -40,6 +40,12 @@ if (isLocalTest) {
|
|
|
40
40
|
expect(result?.startsWith("data:image/png;base64")).toBeTruthy();
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
+
test("Test for getCultures", async () => {
|
|
44
|
+
const result = await api.getCultures(["zh-CN", "en-US", "fr-FR"]);
|
|
45
|
+
expect(result).not.toBeNull();
|
|
46
|
+
expect(result?.length).toBe(3);
|
|
47
|
+
});
|
|
48
|
+
|
|
43
49
|
test("Test for getCurrencies all", async () => {
|
|
44
50
|
const result = await api.getCurrencies();
|
|
45
51
|
|
package/__tests__/UserApi.ts
CHANGED
package/lib/cjs/OrgApi.d.ts
CHANGED
|
@@ -6,13 +6,14 @@ import { OrgQueryDto } from "./dto/org/OrgQueryDto";
|
|
|
6
6
|
import { OrgReadDto } from "./dto/org/OrgReadDto";
|
|
7
7
|
import { OrgUpdateReadDto } from "./dto/org/OrgUpdateReadDto";
|
|
8
8
|
import { OrgListDto } from "./dto/org/OrgListDto";
|
|
9
|
-
import { AntiforgeryRequestToken, EntityApi, IApp, IdResultPayload, ResultPayload, StringIdResultPayload } from "@etsoo/appscript";
|
|
9
|
+
import { AntiforgeryRequestToken, CustomCulture, EntityApi, IApp, IdResultPayload, ResultPayload, StringIdResultPayload } from "@etsoo/appscript";
|
|
10
10
|
import { OrgListRQ } from "./rq/org/OrgListRQ";
|
|
11
11
|
import { OrgGetMyRQ } from "./rq/org/OrgGetMyRQ";
|
|
12
12
|
import { OrgGetMyData } from "./dto/org/OrgGetMyData";
|
|
13
13
|
import { OrgDownloadKind } from "./dto/org/OrgDownloadKind";
|
|
14
14
|
import { SendEmailMessage } from "./rq/org/SendEmailMessage";
|
|
15
15
|
import { SendSMSMessage } from "./rq/org/SendSMSMessage";
|
|
16
|
+
import { SendProfileEmailRQ } from "./rq/org/SendProfileEmailRQ";
|
|
16
17
|
/**
|
|
17
18
|
* Organization API
|
|
18
19
|
* 机构接口
|
|
@@ -53,6 +54,13 @@ export declare class OrgApi extends EntityApi {
|
|
|
53
54
|
* @returns Result
|
|
54
55
|
*/
|
|
55
56
|
formatHtmlContent(content: string, payload?: IApiPayload<string>): Promise<string | undefined>;
|
|
57
|
+
/**
|
|
58
|
+
* Get current organization's custom resources
|
|
59
|
+
* @param culture Culture
|
|
60
|
+
* @param payload Payload
|
|
61
|
+
* @returns Result
|
|
62
|
+
*/
|
|
63
|
+
getCustomResources(culture: string, payload?: IApiPayload<CustomCulture[]>): Promise<CustomCulture[] | undefined>;
|
|
56
64
|
/**
|
|
57
65
|
* Get user's latest accessed organizations
|
|
58
66
|
* @param rq Request data
|
|
@@ -111,6 +119,13 @@ export declare class OrgApi extends EntityApi {
|
|
|
111
119
|
* @returns Result
|
|
112
120
|
*/
|
|
113
121
|
sendSMS(message: SendSMSMessage, payload?: StringIdResultPayload): Promise<import("@etsoo/shared").IdActionResult<string> | undefined>;
|
|
122
|
+
/**
|
|
123
|
+
* Send profile email
|
|
124
|
+
* @param rq Request data
|
|
125
|
+
* @param payload Payload
|
|
126
|
+
* @returns Result
|
|
127
|
+
*/
|
|
128
|
+
sendProfileEmail(rq: SendProfileEmailRQ, payload?: ResultPayload): Promise<import("@etsoo/shared").IActionResult<{}> | undefined>;
|
|
114
129
|
/**
|
|
115
130
|
* Update
|
|
116
131
|
* @param rq Request data
|
package/lib/cjs/OrgApi.js
CHANGED
|
@@ -64,6 +64,15 @@ class OrgApi extends appscript_1.EntityApi {
|
|
|
64
64
|
formatHtmlContent(content, payload) {
|
|
65
65
|
return this.api.post(`${this.flag}/FormatHtmlContent`, content, payload);
|
|
66
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Get current organization's custom resources
|
|
69
|
+
* @param culture Culture
|
|
70
|
+
* @param payload Payload
|
|
71
|
+
* @returns Result
|
|
72
|
+
*/
|
|
73
|
+
getCustomResources(culture, payload) {
|
|
74
|
+
return this.api.get(`${this.flag}/GetCustomResources/${culture}`, undefined, payload);
|
|
75
|
+
}
|
|
67
76
|
/**
|
|
68
77
|
* Get user's latest accessed organizations
|
|
69
78
|
* @param rq Request data
|
|
@@ -138,6 +147,15 @@ class OrgApi extends appscript_1.EntityApi {
|
|
|
138
147
|
sendSMS(message, payload) {
|
|
139
148
|
return this.api.post(`${this.flag}/SendSMS`, message, payload);
|
|
140
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Send profile email
|
|
152
|
+
* @param rq Request data
|
|
153
|
+
* @param payload Payload
|
|
154
|
+
* @returns Result
|
|
155
|
+
*/
|
|
156
|
+
sendProfileEmail(rq, payload) {
|
|
157
|
+
return this.api.post(`${this.flag}/SendProfileEmail`, rq, payload);
|
|
158
|
+
}
|
|
141
159
|
/**
|
|
142
160
|
* Update
|
|
143
161
|
* @param rq Request data
|
package/lib/cjs/PublicApi.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { CurrencyItem } from "./dto/public/CurrencyItem";
|
|
|
6
6
|
import { RegionData } from "./dto/public/RegionData";
|
|
7
7
|
import { PlaceQueryRQ } from "./rq/public/PlaceQueryRQ";
|
|
8
8
|
import { PlaceCommon } from "./dto/public/PlaceCommon";
|
|
9
|
-
import { BaseApi, Currency, IApp, ProductUnit, ResultPayload } from "@etsoo/appscript";
|
|
9
|
+
import { BaseApi, CultureItem, Currency, CustomCulture, IApp, ProductUnit, ResultPayload } from "@etsoo/appscript";
|
|
10
10
|
import { MemberInvitationDto } from "./dto/public/MemberInvitationDto";
|
|
11
11
|
import { AcceptInvitationRQ } from "./rq/public/AcceptInvitationRQ";
|
|
12
12
|
import { ChinaPinData } from "./dto/public/ChinaPinData";
|
|
@@ -41,6 +41,13 @@ export declare class PublicApi extends BaseApi {
|
|
|
41
41
|
* @returns Label
|
|
42
42
|
*/
|
|
43
43
|
getCurrencyLabel(currency: Currency | string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Get cultures
|
|
46
|
+
* @param ids Culture ids to include and order by
|
|
47
|
+
* @param payload Payload
|
|
48
|
+
* @returns Result
|
|
49
|
+
*/
|
|
50
|
+
getCultures(ids: string[], payload?: IApiPayload<CultureItem[]>): Promise<CultureItem[] | undefined>;
|
|
44
51
|
/**
|
|
45
52
|
* Get currencies
|
|
46
53
|
* @param ids Currency ids to include and order by
|
|
@@ -48,6 +55,13 @@ export declare class PublicApi extends BaseApi {
|
|
|
48
55
|
* @returns Result
|
|
49
56
|
*/
|
|
50
57
|
getCurrencies(ids?: string[], payload?: IApiPayload<CurrencyItem[]>): Promise<CurrencyItem[] | undefined>;
|
|
58
|
+
/**
|
|
59
|
+
* Get custom resources
|
|
60
|
+
* @param culture Culture
|
|
61
|
+
* @param payload Payload
|
|
62
|
+
* @returns Result
|
|
63
|
+
*/
|
|
64
|
+
getCustomResources(culture: string, payload?: IApiPayload<CustomCulture[]>): Promise<CustomCulture[] | undefined>;
|
|
51
65
|
/**
|
|
52
66
|
* Get Pinyin
|
|
53
67
|
* @param rq Request data
|
package/lib/cjs/PublicApi.js
CHANGED
|
@@ -44,6 +44,18 @@ class PublicApi extends appscript_1.BaseApi {
|
|
|
44
44
|
const c = `currency${currency}`;
|
|
45
45
|
return this.app.get(c) ?? c;
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Get cultures
|
|
49
|
+
* @param ids Culture ids to include and order by
|
|
50
|
+
* @param payload Payload
|
|
51
|
+
* @returns Result
|
|
52
|
+
*/
|
|
53
|
+
getCultures(ids, payload) {
|
|
54
|
+
return this.api.post("Public/GetCultures", ids, {
|
|
55
|
+
...payload,
|
|
56
|
+
contentType: "application/json"
|
|
57
|
+
});
|
|
58
|
+
}
|
|
47
59
|
/**
|
|
48
60
|
* Get currencies
|
|
49
61
|
* @param ids Currency ids to include and order by
|
|
@@ -51,7 +63,19 @@ class PublicApi extends appscript_1.BaseApi {
|
|
|
51
63
|
* @returns Result
|
|
52
64
|
*/
|
|
53
65
|
getCurrencies(ids, payload) {
|
|
54
|
-
return this.api.post("Public/GetCurrencies", ids,
|
|
66
|
+
return this.api.post("Public/GetCurrencies", ids, {
|
|
67
|
+
...payload,
|
|
68
|
+
contentType: "application/json"
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get custom resources
|
|
73
|
+
* @param culture Culture
|
|
74
|
+
* @param payload Payload
|
|
75
|
+
* @returns Result
|
|
76
|
+
*/
|
|
77
|
+
getCustomResources(culture, payload) {
|
|
78
|
+
return this.api.get(`Public/GetCustomResources/${culture}`, undefined, payload);
|
|
55
79
|
}
|
|
56
80
|
/**
|
|
57
81
|
* Get Pinyin
|
|
@@ -69,7 +93,10 @@ class PublicApi extends appscript_1.BaseApi {
|
|
|
69
93
|
* @returns Result
|
|
70
94
|
*/
|
|
71
95
|
getRegions(ids, payload) {
|
|
72
|
-
return this.api.post("Public/GetRegions", ids,
|
|
96
|
+
return this.api.post("Public/GetRegions", ids, {
|
|
97
|
+
...payload,
|
|
98
|
+
contentType: "application/json"
|
|
99
|
+
});
|
|
73
100
|
}
|
|
74
101
|
/**
|
|
75
102
|
* Get product unit's label
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export * from "./rq/org/OrgListRQ";
|
|
|
49
49
|
export * from "./rq/org/OrgQueryRQ";
|
|
50
50
|
export * from "./rq/org/OrgUpdateRQ";
|
|
51
51
|
export * from "./rq/org/SendEmailMessage";
|
|
52
|
+
export * from "./rq/org/SendProfileEmailRQ";
|
|
52
53
|
export * from "./rq/org/SendSMSMessage";
|
|
53
54
|
export * from "./rq/public/AcceptInvitationRQ";
|
|
54
55
|
export * from "./rq/public/CreateBarcodeRQ";
|
package/lib/cjs/index.js
CHANGED
|
@@ -68,6 +68,7 @@ __exportStar(require("./rq/org/OrgListRQ"), exports);
|
|
|
68
68
|
__exportStar(require("./rq/org/OrgQueryRQ"), exports);
|
|
69
69
|
__exportStar(require("./rq/org/OrgUpdateRQ"), exports);
|
|
70
70
|
__exportStar(require("./rq/org/SendEmailMessage"), exports);
|
|
71
|
+
__exportStar(require("./rq/org/SendProfileEmailRQ"), exports);
|
|
71
72
|
__exportStar(require("./rq/org/SendSMSMessage"), exports);
|
|
72
73
|
__exportStar(require("./rq/public/AcceptInvitationRQ"), exports);
|
|
73
74
|
__exportStar(require("./rq/public/CreateBarcodeRQ"), exports);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Person profile send email request data
|
|
3
|
+
* 人员档案发送邮件请求数据
|
|
4
|
+
*/
|
|
5
|
+
export type SendProfileEmailRQ = {
|
|
6
|
+
/**
|
|
7
|
+
* Profile ID
|
|
8
|
+
* 档案 ID
|
|
9
|
+
*/
|
|
10
|
+
id: number;
|
|
11
|
+
/**
|
|
12
|
+
* Persons
|
|
13
|
+
* 人员编号数组
|
|
14
|
+
*/
|
|
15
|
+
persons: number[];
|
|
16
|
+
/**
|
|
17
|
+
* Message
|
|
18
|
+
* 留言
|
|
19
|
+
*/
|
|
20
|
+
message?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Include attachments or not
|
|
23
|
+
* 是否包含附件
|
|
24
|
+
*/
|
|
25
|
+
includeAttachments?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Include comments or not
|
|
28
|
+
* 是否包含评论
|
|
29
|
+
*/
|
|
30
|
+
includeComments?: boolean;
|
|
31
|
+
};
|
package/lib/mjs/OrgApi.d.ts
CHANGED
|
@@ -6,13 +6,14 @@ import { OrgQueryDto } from "./dto/org/OrgQueryDto";
|
|
|
6
6
|
import { OrgReadDto } from "./dto/org/OrgReadDto";
|
|
7
7
|
import { OrgUpdateReadDto } from "./dto/org/OrgUpdateReadDto";
|
|
8
8
|
import { OrgListDto } from "./dto/org/OrgListDto";
|
|
9
|
-
import { AntiforgeryRequestToken, EntityApi, IApp, IdResultPayload, ResultPayload, StringIdResultPayload } from "@etsoo/appscript";
|
|
9
|
+
import { AntiforgeryRequestToken, CustomCulture, EntityApi, IApp, IdResultPayload, ResultPayload, StringIdResultPayload } from "@etsoo/appscript";
|
|
10
10
|
import { OrgListRQ } from "./rq/org/OrgListRQ";
|
|
11
11
|
import { OrgGetMyRQ } from "./rq/org/OrgGetMyRQ";
|
|
12
12
|
import { OrgGetMyData } from "./dto/org/OrgGetMyData";
|
|
13
13
|
import { OrgDownloadKind } from "./dto/org/OrgDownloadKind";
|
|
14
14
|
import { SendEmailMessage } from "./rq/org/SendEmailMessage";
|
|
15
15
|
import { SendSMSMessage } from "./rq/org/SendSMSMessage";
|
|
16
|
+
import { SendProfileEmailRQ } from "./rq/org/SendProfileEmailRQ";
|
|
16
17
|
/**
|
|
17
18
|
* Organization API
|
|
18
19
|
* 机构接口
|
|
@@ -53,6 +54,13 @@ export declare class OrgApi extends EntityApi {
|
|
|
53
54
|
* @returns Result
|
|
54
55
|
*/
|
|
55
56
|
formatHtmlContent(content: string, payload?: IApiPayload<string>): Promise<string | undefined>;
|
|
57
|
+
/**
|
|
58
|
+
* Get current organization's custom resources
|
|
59
|
+
* @param culture Culture
|
|
60
|
+
* @param payload Payload
|
|
61
|
+
* @returns Result
|
|
62
|
+
*/
|
|
63
|
+
getCustomResources(culture: string, payload?: IApiPayload<CustomCulture[]>): Promise<CustomCulture[] | undefined>;
|
|
56
64
|
/**
|
|
57
65
|
* Get user's latest accessed organizations
|
|
58
66
|
* @param rq Request data
|
|
@@ -111,6 +119,13 @@ export declare class OrgApi extends EntityApi {
|
|
|
111
119
|
* @returns Result
|
|
112
120
|
*/
|
|
113
121
|
sendSMS(message: SendSMSMessage, payload?: StringIdResultPayload): Promise<import("@etsoo/shared").IdActionResult<string> | undefined>;
|
|
122
|
+
/**
|
|
123
|
+
* Send profile email
|
|
124
|
+
* @param rq Request data
|
|
125
|
+
* @param payload Payload
|
|
126
|
+
* @returns Result
|
|
127
|
+
*/
|
|
128
|
+
sendProfileEmail(rq: SendProfileEmailRQ, payload?: ResultPayload): Promise<import("@etsoo/shared").IActionResult<{}> | undefined>;
|
|
114
129
|
/**
|
|
115
130
|
* Update
|
|
116
131
|
* @param rq Request data
|
package/lib/mjs/OrgApi.js
CHANGED
|
@@ -61,6 +61,15 @@ export class OrgApi extends EntityApi {
|
|
|
61
61
|
formatHtmlContent(content, payload) {
|
|
62
62
|
return this.api.post(`${this.flag}/FormatHtmlContent`, content, payload);
|
|
63
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Get current organization's custom resources
|
|
66
|
+
* @param culture Culture
|
|
67
|
+
* @param payload Payload
|
|
68
|
+
* @returns Result
|
|
69
|
+
*/
|
|
70
|
+
getCustomResources(culture, payload) {
|
|
71
|
+
return this.api.get(`${this.flag}/GetCustomResources/${culture}`, undefined, payload);
|
|
72
|
+
}
|
|
64
73
|
/**
|
|
65
74
|
* Get user's latest accessed organizations
|
|
66
75
|
* @param rq Request data
|
|
@@ -135,6 +144,15 @@ export class OrgApi extends EntityApi {
|
|
|
135
144
|
sendSMS(message, payload) {
|
|
136
145
|
return this.api.post(`${this.flag}/SendSMS`, message, payload);
|
|
137
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Send profile email
|
|
149
|
+
* @param rq Request data
|
|
150
|
+
* @param payload Payload
|
|
151
|
+
* @returns Result
|
|
152
|
+
*/
|
|
153
|
+
sendProfileEmail(rq, payload) {
|
|
154
|
+
return this.api.post(`${this.flag}/SendProfileEmail`, rq, payload);
|
|
155
|
+
}
|
|
138
156
|
/**
|
|
139
157
|
* Update
|
|
140
158
|
* @param rq Request data
|
package/lib/mjs/PublicApi.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { CurrencyItem } from "./dto/public/CurrencyItem";
|
|
|
6
6
|
import { RegionData } from "./dto/public/RegionData";
|
|
7
7
|
import { PlaceQueryRQ } from "./rq/public/PlaceQueryRQ";
|
|
8
8
|
import { PlaceCommon } from "./dto/public/PlaceCommon";
|
|
9
|
-
import { BaseApi, Currency, IApp, ProductUnit, ResultPayload } from "@etsoo/appscript";
|
|
9
|
+
import { BaseApi, CultureItem, Currency, CustomCulture, IApp, ProductUnit, ResultPayload } from "@etsoo/appscript";
|
|
10
10
|
import { MemberInvitationDto } from "./dto/public/MemberInvitationDto";
|
|
11
11
|
import { AcceptInvitationRQ } from "./rq/public/AcceptInvitationRQ";
|
|
12
12
|
import { ChinaPinData } from "./dto/public/ChinaPinData";
|
|
@@ -41,6 +41,13 @@ export declare class PublicApi extends BaseApi {
|
|
|
41
41
|
* @returns Label
|
|
42
42
|
*/
|
|
43
43
|
getCurrencyLabel(currency: Currency | string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Get cultures
|
|
46
|
+
* @param ids Culture ids to include and order by
|
|
47
|
+
* @param payload Payload
|
|
48
|
+
* @returns Result
|
|
49
|
+
*/
|
|
50
|
+
getCultures(ids: string[], payload?: IApiPayload<CultureItem[]>): Promise<CultureItem[] | undefined>;
|
|
44
51
|
/**
|
|
45
52
|
* Get currencies
|
|
46
53
|
* @param ids Currency ids to include and order by
|
|
@@ -48,6 +55,13 @@ export declare class PublicApi extends BaseApi {
|
|
|
48
55
|
* @returns Result
|
|
49
56
|
*/
|
|
50
57
|
getCurrencies(ids?: string[], payload?: IApiPayload<CurrencyItem[]>): Promise<CurrencyItem[] | undefined>;
|
|
58
|
+
/**
|
|
59
|
+
* Get custom resources
|
|
60
|
+
* @param culture Culture
|
|
61
|
+
* @param payload Payload
|
|
62
|
+
* @returns Result
|
|
63
|
+
*/
|
|
64
|
+
getCustomResources(culture: string, payload?: IApiPayload<CustomCulture[]>): Promise<CustomCulture[] | undefined>;
|
|
51
65
|
/**
|
|
52
66
|
* Get Pinyin
|
|
53
67
|
* @param rq Request data
|
package/lib/mjs/PublicApi.js
CHANGED
|
@@ -41,6 +41,18 @@ export class PublicApi extends BaseApi {
|
|
|
41
41
|
const c = `currency${currency}`;
|
|
42
42
|
return this.app.get(c) ?? c;
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Get cultures
|
|
46
|
+
* @param ids Culture ids to include and order by
|
|
47
|
+
* @param payload Payload
|
|
48
|
+
* @returns Result
|
|
49
|
+
*/
|
|
50
|
+
getCultures(ids, payload) {
|
|
51
|
+
return this.api.post("Public/GetCultures", ids, {
|
|
52
|
+
...payload,
|
|
53
|
+
contentType: "application/json"
|
|
54
|
+
});
|
|
55
|
+
}
|
|
44
56
|
/**
|
|
45
57
|
* Get currencies
|
|
46
58
|
* @param ids Currency ids to include and order by
|
|
@@ -48,7 +60,19 @@ export class PublicApi extends BaseApi {
|
|
|
48
60
|
* @returns Result
|
|
49
61
|
*/
|
|
50
62
|
getCurrencies(ids, payload) {
|
|
51
|
-
return this.api.post("Public/GetCurrencies", ids,
|
|
63
|
+
return this.api.post("Public/GetCurrencies", ids, {
|
|
64
|
+
...payload,
|
|
65
|
+
contentType: "application/json"
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get custom resources
|
|
70
|
+
* @param culture Culture
|
|
71
|
+
* @param payload Payload
|
|
72
|
+
* @returns Result
|
|
73
|
+
*/
|
|
74
|
+
getCustomResources(culture, payload) {
|
|
75
|
+
return this.api.get(`Public/GetCustomResources/${culture}`, undefined, payload);
|
|
52
76
|
}
|
|
53
77
|
/**
|
|
54
78
|
* Get Pinyin
|
|
@@ -66,7 +90,10 @@ export class PublicApi extends BaseApi {
|
|
|
66
90
|
* @returns Result
|
|
67
91
|
*/
|
|
68
92
|
getRegions(ids, payload) {
|
|
69
|
-
return this.api.post("Public/GetRegions", ids,
|
|
93
|
+
return this.api.post("Public/GetRegions", ids, {
|
|
94
|
+
...payload,
|
|
95
|
+
contentType: "application/json"
|
|
96
|
+
});
|
|
70
97
|
}
|
|
71
98
|
/**
|
|
72
99
|
* Get product unit's label
|
package/lib/mjs/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export * from "./rq/org/OrgListRQ";
|
|
|
49
49
|
export * from "./rq/org/OrgQueryRQ";
|
|
50
50
|
export * from "./rq/org/OrgUpdateRQ";
|
|
51
51
|
export * from "./rq/org/SendEmailMessage";
|
|
52
|
+
export * from "./rq/org/SendProfileEmailRQ";
|
|
52
53
|
export * from "./rq/org/SendSMSMessage";
|
|
53
54
|
export * from "./rq/public/AcceptInvitationRQ";
|
|
54
55
|
export * from "./rq/public/CreateBarcodeRQ";
|
package/lib/mjs/index.js
CHANGED
|
@@ -52,6 +52,7 @@ export * from "./rq/org/OrgListRQ";
|
|
|
52
52
|
export * from "./rq/org/OrgQueryRQ";
|
|
53
53
|
export * from "./rq/org/OrgUpdateRQ";
|
|
54
54
|
export * from "./rq/org/SendEmailMessage";
|
|
55
|
+
export * from "./rq/org/SendProfileEmailRQ";
|
|
55
56
|
export * from "./rq/org/SendSMSMessage";
|
|
56
57
|
export * from "./rq/public/AcceptInvitationRQ";
|
|
57
58
|
export * from "./rq/public/CreateBarcodeRQ";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Person profile send email request data
|
|
3
|
+
* 人员档案发送邮件请求数据
|
|
4
|
+
*/
|
|
5
|
+
export type SendProfileEmailRQ = {
|
|
6
|
+
/**
|
|
7
|
+
* Profile ID
|
|
8
|
+
* 档案 ID
|
|
9
|
+
*/
|
|
10
|
+
id: number;
|
|
11
|
+
/**
|
|
12
|
+
* Persons
|
|
13
|
+
* 人员编号数组
|
|
14
|
+
*/
|
|
15
|
+
persons: number[];
|
|
16
|
+
/**
|
|
17
|
+
* Message
|
|
18
|
+
* 留言
|
|
19
|
+
*/
|
|
20
|
+
message?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Include attachments or not
|
|
23
|
+
* 是否包含附件
|
|
24
|
+
*/
|
|
25
|
+
includeAttachments?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Include comments or not
|
|
28
|
+
* 是否包含评论
|
|
29
|
+
*/
|
|
30
|
+
includeComments?: boolean;
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/smarterp-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.49",
|
|
4
4
|
"description": "TypeScript APIs for SmartERP Core",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"@vitejs/plugin-react": "^4.4.1",
|
|
51
51
|
"jsdom": "^26.1.0",
|
|
52
52
|
"typescript": "^5.8.3",
|
|
53
|
-
"vitest": "^3.1.
|
|
53
|
+
"vitest": "^3.1.2"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@etsoo/appscript": "^1.6.
|
|
57
|
-
"@etsoo/materialui": "^1.5.
|
|
56
|
+
"@etsoo/appscript": "^1.6.29",
|
|
57
|
+
"@etsoo/materialui": "^1.5.35",
|
|
58
58
|
"@etsoo/react": "^1.8.40",
|
|
59
59
|
"@etsoo/shared": "^1.2.69",
|
|
60
60
|
"@etsoo/toolpad": "^1.0.26",
|
package/src/OrgApi.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { OrgUpdateReadDto } from "./dto/org/OrgUpdateReadDto";
|
|
|
8
8
|
import { OrgListDto } from "./dto/org/OrgListDto";
|
|
9
9
|
import {
|
|
10
10
|
AntiforgeryRequestToken,
|
|
11
|
+
CustomCulture,
|
|
11
12
|
EntityApi,
|
|
12
13
|
IApp,
|
|
13
14
|
IdResultPayload,
|
|
@@ -21,6 +22,7 @@ import { OrgDownloadKind } from "./dto/org/OrgDownloadKind";
|
|
|
21
22
|
import { DataTypes } from "@etsoo/shared";
|
|
22
23
|
import { SendEmailMessage } from "./rq/org/SendEmailMessage";
|
|
23
24
|
import { SendSMSMessage } from "./rq/org/SendSMSMessage";
|
|
25
|
+
import { SendProfileEmailRQ } from "./rq/org/SendProfileEmailRQ";
|
|
24
26
|
|
|
25
27
|
/**
|
|
26
28
|
* Organization API
|
|
@@ -95,6 +97,20 @@ export class OrgApi extends EntityApi {
|
|
|
95
97
|
return this.api.post(`${this.flag}/FormatHtmlContent`, content, payload);
|
|
96
98
|
}
|
|
97
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Get current organization's custom resources
|
|
102
|
+
* @param culture Culture
|
|
103
|
+
* @param payload Payload
|
|
104
|
+
* @returns Result
|
|
105
|
+
*/
|
|
106
|
+
getCustomResources(culture: string, payload?: IApiPayload<CustomCulture[]>) {
|
|
107
|
+
return this.api.get(
|
|
108
|
+
`${this.flag}/GetCustomResources/${culture}`,
|
|
109
|
+
undefined,
|
|
110
|
+
payload
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
98
114
|
/**
|
|
99
115
|
* Get user's latest accessed organizations
|
|
100
116
|
* @param rq Request data
|
|
@@ -177,6 +193,16 @@ export class OrgApi extends EntityApi {
|
|
|
177
193
|
return this.api.post(`${this.flag}/SendSMS`, message, payload);
|
|
178
194
|
}
|
|
179
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Send profile email
|
|
198
|
+
* @param rq Request data
|
|
199
|
+
* @param payload Payload
|
|
200
|
+
* @returns Result
|
|
201
|
+
*/
|
|
202
|
+
sendProfileEmail(rq: SendProfileEmailRQ, payload?: ResultPayload) {
|
|
203
|
+
return this.api.post(`${this.flag}/SendProfileEmail`, rq, payload);
|
|
204
|
+
}
|
|
205
|
+
|
|
180
206
|
/**
|
|
181
207
|
* Update
|
|
182
208
|
* @param rq Request data
|
package/src/PublicApi.ts
CHANGED
|
@@ -8,7 +8,9 @@ import { PlaceQueryRQ } from "./rq/public/PlaceQueryRQ";
|
|
|
8
8
|
import { PlaceCommon } from "./dto/public/PlaceCommon";
|
|
9
9
|
import {
|
|
10
10
|
BaseApi,
|
|
11
|
+
CultureItem,
|
|
11
12
|
Currency,
|
|
13
|
+
CustomCulture,
|
|
12
14
|
IApp,
|
|
13
15
|
ProductUnit,
|
|
14
16
|
RepeatOption,
|
|
@@ -64,6 +66,19 @@ export class PublicApi extends BaseApi {
|
|
|
64
66
|
return this.app.get(c) ?? c;
|
|
65
67
|
}
|
|
66
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Get cultures
|
|
71
|
+
* @param ids Culture ids to include and order by
|
|
72
|
+
* @param payload Payload
|
|
73
|
+
* @returns Result
|
|
74
|
+
*/
|
|
75
|
+
getCultures(ids: string[], payload?: IApiPayload<CultureItem[]>) {
|
|
76
|
+
return this.api.post("Public/GetCultures", ids, {
|
|
77
|
+
...payload,
|
|
78
|
+
contentType: "application/json"
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
67
82
|
/**
|
|
68
83
|
* Get currencies
|
|
69
84
|
* @param ids Currency ids to include and order by
|
|
@@ -71,7 +86,24 @@ export class PublicApi extends BaseApi {
|
|
|
71
86
|
* @returns Result
|
|
72
87
|
*/
|
|
73
88
|
getCurrencies(ids?: string[], payload?: IApiPayload<CurrencyItem[]>) {
|
|
74
|
-
return this.api.post("Public/GetCurrencies", ids,
|
|
89
|
+
return this.api.post("Public/GetCurrencies", ids, {
|
|
90
|
+
...payload,
|
|
91
|
+
contentType: "application/json"
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Get custom resources
|
|
97
|
+
* @param culture Culture
|
|
98
|
+
* @param payload Payload
|
|
99
|
+
* @returns Result
|
|
100
|
+
*/
|
|
101
|
+
getCustomResources(culture: string, payload?: IApiPayload<CustomCulture[]>) {
|
|
102
|
+
return this.api.get(
|
|
103
|
+
`Public/GetCustomResources/${culture}`,
|
|
104
|
+
undefined,
|
|
105
|
+
payload
|
|
106
|
+
);
|
|
75
107
|
}
|
|
76
108
|
|
|
77
109
|
/**
|
|
@@ -91,7 +123,10 @@ export class PublicApi extends BaseApi {
|
|
|
91
123
|
* @returns Result
|
|
92
124
|
*/
|
|
93
125
|
getRegions(ids?: string[], payload?: IApiPayload<RegionData[]>) {
|
|
94
|
-
return this.api.post("Public/GetRegions", ids,
|
|
126
|
+
return this.api.post("Public/GetRegions", ids, {
|
|
127
|
+
...payload,
|
|
128
|
+
contentType: "application/json"
|
|
129
|
+
});
|
|
95
130
|
}
|
|
96
131
|
|
|
97
132
|
/**
|
package/src/index.ts
CHANGED
|
@@ -62,6 +62,7 @@ export * from "./rq/org/OrgListRQ";
|
|
|
62
62
|
export * from "./rq/org/OrgQueryRQ";
|
|
63
63
|
export * from "./rq/org/OrgUpdateRQ";
|
|
64
64
|
export * from "./rq/org/SendEmailMessage";
|
|
65
|
+
export * from "./rq/org/SendProfileEmailRQ";
|
|
65
66
|
export * from "./rq/org/SendSMSMessage";
|
|
66
67
|
|
|
67
68
|
export * from "./rq/public/AcceptInvitationRQ";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Person profile send email request data
|
|
3
|
+
* 人员档案发送邮件请求数据
|
|
4
|
+
*/
|
|
5
|
+
export type SendProfileEmailRQ = {
|
|
6
|
+
/**
|
|
7
|
+
* Profile ID
|
|
8
|
+
* 档案 ID
|
|
9
|
+
*/
|
|
10
|
+
id: number;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Persons
|
|
14
|
+
* 人员编号数组
|
|
15
|
+
*/
|
|
16
|
+
persons: number[];
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Message
|
|
20
|
+
* 留言
|
|
21
|
+
*/
|
|
22
|
+
message?: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Include attachments or not
|
|
26
|
+
* 是否包含附件
|
|
27
|
+
*/
|
|
28
|
+
includeAttachments?: boolean;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Include comments or not
|
|
32
|
+
* 是否包含评论
|
|
33
|
+
*/
|
|
34
|
+
includeComments?: boolean;
|
|
35
|
+
};
|