@etsoo/smarterp-core 1.1.52 → 1.1.54

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.
@@ -1,6 +1,7 @@
1
- import { BaseApi, IApi, IApp, StringIdResultPayload } from "@etsoo/appscript";
1
+ import { BaseApi, IApi, IApiPayload, IApp } from "@etsoo/appscript";
2
2
  import { SendEmailInputRQ } from "./rq/authCode/SendEmailRQ";
3
3
  import { SendSMSInputRQ } from "./rq/authCode/SendSMSRQ";
4
+ import { IActionResult } from "@etsoo/shared";
4
5
  /**
5
6
  * Auth Code API
6
7
  * 验证码接口
@@ -18,12 +19,24 @@ export declare class AuthCodeApi extends BaseApi {
18
19
  * @param payload Payload
19
20
  * @returns Result
20
21
  */
21
- sendEmail(rq: SendEmailInputRQ, payload?: StringIdResultPayload): Promise<import("@etsoo/shared").IdActionResult<string> | undefined>;
22
+ sendEmail(rq: SendEmailInputRQ, payload?: IApiPayload<IActionResult<{
23
+ id: string;
24
+ email: string;
25
+ }>>): Promise<IActionResult<{
26
+ id: string;
27
+ email: string;
28
+ }> | undefined>;
22
29
  /**
23
- * Send email
30
+ * Send SMS
24
31
  * @param rq Request data
25
32
  * @param payload Payload
26
33
  * @returns Result
27
34
  */
28
- sendSMS(rq: SendSMSInputRQ, payload?: StringIdResultPayload): Promise<import("@etsoo/shared").IdActionResult<string> | undefined>;
35
+ sendSMS(rq: SendSMSInputRQ, payload?: IApiPayload<IActionResult<{
36
+ id: string;
37
+ mobile: string;
38
+ }>>): Promise<IActionResult<{
39
+ id: string;
40
+ mobile: string;
41
+ }> | undefined>;
29
42
  }
@@ -32,7 +32,7 @@ class AuthCodeApi extends appscript_1.BaseApi {
32
32
  return this.api.put("AuthCode/SendEmail", data, payload);
33
33
  }
34
34
  /**
35
- * Send email
35
+ * Send SMS
36
36
  * @param rq Request data
37
37
  * @param payload Payload
38
38
  * @returns Result
@@ -79,7 +79,7 @@ export interface ICoreApp {
79
79
  * @param kind Kind
80
80
  * @returns Label
81
81
  */
82
- getDocumentKind(kind?: DocumentKind): string | undefined;
82
+ getDocumentKind(kind?: DocumentKind | string): string | undefined;
83
83
  /**
84
84
  * Get document kinds
85
85
  * 获取文档类型列表
@@ -212,7 +212,7 @@ export declare class CoreApp implements ICoreApp {
212
212
  * @param kind Kind
213
213
  * @returns Label
214
214
  */
215
- getDocumentKind(kind?: DocumentKind): string | undefined;
215
+ getDocumentKind(kind?: DocumentKind | string): string | undefined;
216
216
  /**
217
217
  * Get document kinds
218
218
  * 获取文档类型列表
@@ -131,7 +131,7 @@ class CoreApp {
131
131
  getDocumentKind(kind) {
132
132
  if (kind == null)
133
133
  return undefined;
134
- const key = DocumentKind_1.DocumentKind[kind];
134
+ const key = typeof kind === "string" ? kind : DocumentKind_1.DocumentKind[kind];
135
135
  return this.app.get("template" + key) ?? key;
136
136
  }
137
137
  /**
@@ -125,7 +125,7 @@
125
125
  "targetId": "Target id",
126
126
  "template": "Template",
127
127
  "templateCMSASSETCHECKALERT": "CMS asset check alert",
128
- "templateCMSASSETEXPIRYALERT": "CMS asset expiry alert",
128
+ "templateCMSASSETEXPIRYALERT": "CMS asset expiry reminder",
129
129
  "templateCMSCUSTOMERDATA": "CMS customer data",
130
130
  "templateCMSORDERDATA": "CMS order data",
131
131
  "templateCMSPODATA": "CMS PO data",
@@ -124,8 +124,8 @@
124
124
  "target": "目标",
125
125
  "targetId": "目标编号",
126
126
  "template": "模板",
127
- "templateCMSASSETCHECKALERT": "CMS资产检查警告",
128
- "templateCMSASSETEXPIRYALERT": "CMS资产过期警告",
127
+ "templateCMSASSETCHECKALERT": "CMS资产检查警报",
128
+ "templateCMSASSETEXPIRYALERT": "CMS资产过期提醒",
129
129
  "templateCMSCUSTOMERDATA": "CMS客户数据",
130
130
  "templateCMSORDERDATA": "CMS订单数据",
131
131
  "templateCMSPODATA": "CMS采购数据",
@@ -124,8 +124,8 @@
124
124
  "target": "目標",
125
125
  "targetId": "目標編號",
126
126
  "template": "模板",
127
- "templateCMSASSETCHECKALERT": "CMS資產檢查警告",
128
- "templateCMSASSETEXPIRYALERT": "CMS資產過期警告",
127
+ "templateCMSASSETCHECKALERT": "CMS資產檢查警报",
128
+ "templateCMSASSETEXPIRYALERT": "CMS資產過期提醒",
129
129
  "templateCMSCUSTOMERDATA": "CMS客戶數據",
130
130
  "templateCMSORDERDATA": "CMS訂單數據",
131
131
  "templateCMSPODATA": "CMS採購數據",
@@ -1,6 +1,7 @@
1
- import { BaseApi, IApi, IApp, StringIdResultPayload } from "@etsoo/appscript";
1
+ import { BaseApi, IApi, IApiPayload, IApp } from "@etsoo/appscript";
2
2
  import { SendEmailInputRQ } from "./rq/authCode/SendEmailRQ";
3
3
  import { SendSMSInputRQ } from "./rq/authCode/SendSMSRQ";
4
+ import { IActionResult } from "@etsoo/shared";
4
5
  /**
5
6
  * Auth Code API
6
7
  * 验证码接口
@@ -18,12 +19,24 @@ export declare class AuthCodeApi extends BaseApi {
18
19
  * @param payload Payload
19
20
  * @returns Result
20
21
  */
21
- sendEmail(rq: SendEmailInputRQ, payload?: StringIdResultPayload): Promise<import("@etsoo/shared").IdActionResult<string> | undefined>;
22
+ sendEmail(rq: SendEmailInputRQ, payload?: IApiPayload<IActionResult<{
23
+ id: string;
24
+ email: string;
25
+ }>>): Promise<IActionResult<{
26
+ id: string;
27
+ email: string;
28
+ }> | undefined>;
22
29
  /**
23
- * Send email
30
+ * Send SMS
24
31
  * @param rq Request data
25
32
  * @param payload Payload
26
33
  * @returns Result
27
34
  */
28
- sendSMS(rq: SendSMSInputRQ, payload?: StringIdResultPayload): Promise<import("@etsoo/shared").IdActionResult<string> | undefined>;
35
+ sendSMS(rq: SendSMSInputRQ, payload?: IApiPayload<IActionResult<{
36
+ id: string;
37
+ mobile: string;
38
+ }>>): Promise<IActionResult<{
39
+ id: string;
40
+ mobile: string;
41
+ }> | undefined>;
29
42
  }
@@ -29,7 +29,7 @@ export class AuthCodeApi extends BaseApi {
29
29
  return this.api.put("AuthCode/SendEmail", data, payload);
30
30
  }
31
31
  /**
32
- * Send email
32
+ * Send SMS
33
33
  * @param rq Request data
34
34
  * @param payload Payload
35
35
  * @returns Result
@@ -79,7 +79,7 @@ export interface ICoreApp {
79
79
  * @param kind Kind
80
80
  * @returns Label
81
81
  */
82
- getDocumentKind(kind?: DocumentKind): string | undefined;
82
+ getDocumentKind(kind?: DocumentKind | string): string | undefined;
83
83
  /**
84
84
  * Get document kinds
85
85
  * 获取文档类型列表
@@ -212,7 +212,7 @@ export declare class CoreApp implements ICoreApp {
212
212
  * @param kind Kind
213
213
  * @returns Label
214
214
  */
215
- getDocumentKind(kind?: DocumentKind): string | undefined;
215
+ getDocumentKind(kind?: DocumentKind | string): string | undefined;
216
216
  /**
217
217
  * Get document kinds
218
218
  * 获取文档类型列表
@@ -128,7 +128,7 @@ export class CoreApp {
128
128
  getDocumentKind(kind) {
129
129
  if (kind == null)
130
130
  return undefined;
131
- const key = DocumentKind[kind];
131
+ const key = typeof kind === "string" ? kind : DocumentKind[kind];
132
132
  return this.app.get("template" + key) ?? key;
133
133
  }
134
134
  /**
@@ -125,7 +125,7 @@
125
125
  "targetId": "Target id",
126
126
  "template": "Template",
127
127
  "templateCMSASSETCHECKALERT": "CMS asset check alert",
128
- "templateCMSASSETEXPIRYALERT": "CMS asset expiry alert",
128
+ "templateCMSASSETEXPIRYALERT": "CMS asset expiry reminder",
129
129
  "templateCMSCUSTOMERDATA": "CMS customer data",
130
130
  "templateCMSORDERDATA": "CMS order data",
131
131
  "templateCMSPODATA": "CMS PO data",
@@ -124,8 +124,8 @@
124
124
  "target": "目标",
125
125
  "targetId": "目标编号",
126
126
  "template": "模板",
127
- "templateCMSASSETCHECKALERT": "CMS资产检查警告",
128
- "templateCMSASSETEXPIRYALERT": "CMS资产过期警告",
127
+ "templateCMSASSETCHECKALERT": "CMS资产检查警报",
128
+ "templateCMSASSETEXPIRYALERT": "CMS资产过期提醒",
129
129
  "templateCMSCUSTOMERDATA": "CMS客户数据",
130
130
  "templateCMSORDERDATA": "CMS订单数据",
131
131
  "templateCMSPODATA": "CMS采购数据",
@@ -124,8 +124,8 @@
124
124
  "target": "目標",
125
125
  "targetId": "目標編號",
126
126
  "template": "模板",
127
- "templateCMSASSETCHECKALERT": "CMS資產檢查警告",
128
- "templateCMSASSETEXPIRYALERT": "CMS資產過期警告",
127
+ "templateCMSASSETCHECKALERT": "CMS資產檢查警报",
128
+ "templateCMSASSETEXPIRYALERT": "CMS資產過期提醒",
129
129
  "templateCMSCUSTOMERDATA": "CMS客戶數據",
130
130
  "templateCMSORDERDATA": "CMS訂單數據",
131
131
  "templateCMSPODATA": "CMS採購數據",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-core",
3
- "version": "1.1.52",
3
+ "version": "1.1.54",
4
4
  "description": "TypeScript APIs for SmartERP Core",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -57,7 +57,7 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@etsoo/appscript": "^1.6.65",
60
- "@etsoo/materialui": "^1.6.67",
60
+ "@etsoo/materialui": "^1.6.68",
61
61
  "@etsoo/react": "^1.8.90",
62
62
  "@etsoo/shared": "^1.2.84",
63
63
  "@etsoo/toolpad": "^1.0.49",
@@ -1,6 +1,7 @@
1
- import { BaseApi, IApi, IApp, StringIdResultPayload } from "@etsoo/appscript";
1
+ import { BaseApi, IApi, IApiPayload, IApp } from "@etsoo/appscript";
2
2
  import { SendEmailInputRQ, SendEmailRQ } from "./rq/authCode/SendEmailRQ";
3
3
  import { SendSMSInputRQ, SendSMSRQ } from "./rq/authCode/SendSMSRQ";
4
+ import { IActionResult } from "@etsoo/shared";
4
5
 
5
6
  /**
6
7
  * Auth Code API
@@ -22,7 +23,10 @@ export class AuthCodeApi extends BaseApi {
22
23
  * @param payload Payload
23
24
  * @returns Result
24
25
  */
25
- sendEmail(rq: SendEmailInputRQ, payload?: StringIdResultPayload) {
26
+ sendEmail(
27
+ rq: SendEmailInputRQ,
28
+ payload?: IApiPayload<IActionResult<{ id: string; email: string }>>
29
+ ) {
26
30
  const { deviceId, region } = this.app;
27
31
  const data: SendEmailRQ = {
28
32
  ...rq,
@@ -34,12 +38,15 @@ export class AuthCodeApi extends BaseApi {
34
38
  }
35
39
 
36
40
  /**
37
- * Send email
41
+ * Send SMS
38
42
  * @param rq Request data
39
43
  * @param payload Payload
40
44
  * @returns Result
41
45
  */
42
- sendSMS(rq: SendSMSInputRQ, payload?: StringIdResultPayload) {
46
+ sendSMS(
47
+ rq: SendSMSInputRQ,
48
+ payload?: IApiPayload<IActionResult<{ id: string; mobile: string }>>
49
+ ) {
43
50
  const { deviceId, region } = this.app;
44
51
  const data: SendSMSRQ = {
45
52
  ...rq,
package/src/CoreApp.ts CHANGED
@@ -93,7 +93,7 @@ export interface ICoreApp {
93
93
  * @param kind Kind
94
94
  * @returns Label
95
95
  */
96
- getDocumentKind(kind?: DocumentKind): string | undefined;
96
+ getDocumentKind(kind?: DocumentKind | string): string | undefined;
97
97
 
98
98
  /**
99
99
  * Get document kinds
@@ -279,10 +279,10 @@ export class CoreApp implements ICoreApp {
279
279
  * @param kind Kind
280
280
  * @returns Label
281
281
  */
282
- getDocumentKind(kind?: DocumentKind) {
282
+ getDocumentKind(kind?: DocumentKind | string) {
283
283
  if (kind == null) return undefined;
284
284
 
285
- const key = DocumentKind[kind];
285
+ const key = typeof kind === "string" ? kind : DocumentKind[kind];
286
286
  return this.app.get("template" + key) ?? key;
287
287
  }
288
288
 
package/src/i18n/en.json CHANGED
@@ -125,7 +125,7 @@
125
125
  "targetId": "Target id",
126
126
  "template": "Template",
127
127
  "templateCMSASSETCHECKALERT": "CMS asset check alert",
128
- "templateCMSASSETEXPIRYALERT": "CMS asset expiry alert",
128
+ "templateCMSASSETEXPIRYALERT": "CMS asset expiry reminder",
129
129
  "templateCMSCUSTOMERDATA": "CMS customer data",
130
130
  "templateCMSORDERDATA": "CMS order data",
131
131
  "templateCMSPODATA": "CMS PO data",
@@ -124,8 +124,8 @@
124
124
  "target": "目标",
125
125
  "targetId": "目标编号",
126
126
  "template": "模板",
127
- "templateCMSASSETCHECKALERT": "CMS资产检查警告",
128
- "templateCMSASSETEXPIRYALERT": "CMS资产过期警告",
127
+ "templateCMSASSETCHECKALERT": "CMS资产检查警报",
128
+ "templateCMSASSETEXPIRYALERT": "CMS资产过期提醒",
129
129
  "templateCMSCUSTOMERDATA": "CMS客户数据",
130
130
  "templateCMSORDERDATA": "CMS订单数据",
131
131
  "templateCMSPODATA": "CMS采购数据",
@@ -124,8 +124,8 @@
124
124
  "target": "目標",
125
125
  "targetId": "目標編號",
126
126
  "template": "模板",
127
- "templateCMSASSETCHECKALERT": "CMS資產檢查警告",
128
- "templateCMSASSETEXPIRYALERT": "CMS資產過期警告",
127
+ "templateCMSASSETCHECKALERT": "CMS資產檢查警报",
128
+ "templateCMSASSETEXPIRYALERT": "CMS資產過期提醒",
129
129
  "templateCMSCUSTOMERDATA": "CMS客戶數據",
130
130
  "templateCMSORDERDATA": "CMS訂單數據",
131
131
  "templateCMSPODATA": "CMS採購數據",