@etsoo/smarterp-core 1.0.83 → 1.0.85

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.
@@ -7,6 +7,7 @@ import { UserApi } from "./UserApi";
7
7
  import { AuthApi, IApp, IdentityType, IdentityTypeFlags, UserIdentifierType } from "@etsoo/appscript";
8
8
  import { AuthCodeApi } from "./AuthCodeApi";
9
9
  import { ListType } from "@etsoo/shared";
10
+ import { CoreApiService } from "./dto/org/CoreApiService";
10
11
  type AppData = {
11
12
  id: number;
12
13
  appId?: number;
@@ -46,6 +47,13 @@ export interface ICoreApp {
46
47
  * User API
47
48
  */
48
49
  readonly userApi: UserApi;
50
+ /**
51
+ * Get API service label
52
+ * 获取API服务标签
53
+ * @param service API service
54
+ * @returns Result
55
+ */
56
+ getApiService(service?: CoreApiService): string;
49
57
  /**
50
58
  * Get API services
51
59
  * 获取API服务列表
@@ -153,6 +161,13 @@ export declare class CoreApp implements ICoreApp {
153
161
  * @param api API
154
162
  */
155
163
  constructor(app: IApp, api: IApi);
164
+ /**
165
+ * Get API service label
166
+ * 获取API服务标签
167
+ * @param service API service
168
+ * @returns Result
169
+ */
170
+ getApiService(service?: CoreApiService): string;
156
171
  /**
157
172
  * Get API services
158
173
  * 获取API服务列表
@@ -83,6 +83,18 @@ class CoreApp {
83
83
  this.app = app;
84
84
  this.api = api;
85
85
  }
86
+ /**
87
+ * Get API service label
88
+ * 获取API服务标签
89
+ * @param service API service
90
+ * @returns Result
91
+ */
92
+ getApiService(service) {
93
+ if (service == null)
94
+ return "";
95
+ const key = shared_1.DataTypes.getEnumKey(CoreApiService_1.CoreApiService, service) ?? `${service}`;
96
+ return this.app.get(`apiService${key}`) ?? key;
97
+ }
86
98
  /**
87
99
  * Get API services
88
100
  * 获取API服务列表
@@ -7,6 +7,7 @@ import { UserApi } from "./UserApi";
7
7
  import { AuthApi, IApp, IdentityType, IdentityTypeFlags, UserIdentifierType } from "@etsoo/appscript";
8
8
  import { AuthCodeApi } from "./AuthCodeApi";
9
9
  import { ListType } from "@etsoo/shared";
10
+ import { CoreApiService } from "./dto/org/CoreApiService";
10
11
  type AppData = {
11
12
  id: number;
12
13
  appId?: number;
@@ -46,6 +47,13 @@ export interface ICoreApp {
46
47
  * User API
47
48
  */
48
49
  readonly userApi: UserApi;
50
+ /**
51
+ * Get API service label
52
+ * 获取API服务标签
53
+ * @param service API service
54
+ * @returns Result
55
+ */
56
+ getApiService(service?: CoreApiService): string;
49
57
  /**
50
58
  * Get API services
51
59
  * 获取API服务列表
@@ -153,6 +161,13 @@ export declare class CoreApp implements ICoreApp {
153
161
  * @param api API
154
162
  */
155
163
  constructor(app: IApp, api: IApi);
164
+ /**
165
+ * Get API service label
166
+ * 获取API服务标签
167
+ * @param service API service
168
+ * @returns Result
169
+ */
170
+ getApiService(service?: CoreApiService): string;
156
171
  /**
157
172
  * Get API services
158
173
  * 获取API服务列表
@@ -80,6 +80,18 @@ export class CoreApp {
80
80
  this.app = app;
81
81
  this.api = api;
82
82
  }
83
+ /**
84
+ * Get API service label
85
+ * 获取API服务标签
86
+ * @param service API service
87
+ * @returns Result
88
+ */
89
+ getApiService(service) {
90
+ if (service == null)
91
+ return "";
92
+ const key = DataTypes.getEnumKey(CoreApiService, service) ?? `${service}`;
93
+ return this.app.get(`apiService${key}`) ?? key;
94
+ }
83
95
  /**
84
96
  * Get API services
85
97
  * 获取API服务列表
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-core",
3
- "version": "1.0.83",
3
+ "version": "1.0.85",
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
  "@etsoo/materialui": "^1.5.63",
58
58
  "@etsoo/react": "^1.8.49",
59
59
  "@etsoo/shared": "^1.2.75",
60
- "@etsoo/toolpad": "^1.0.39",
60
+ "@etsoo/toolpad": "^1.0.40",
61
61
  "@mui/material": "^7.1.2",
62
62
  "react": "^18.3.1",
63
63
  "react-dom": "^18.3.1"
package/src/CoreApp.ts CHANGED
@@ -57,6 +57,14 @@ export interface ICoreApp {
57
57
  */
58
58
  readonly userApi: UserApi;
59
59
 
60
+ /**
61
+ * Get API service label
62
+ * 获取API服务标签
63
+ * @param service API service
64
+ * @returns Result
65
+ */
66
+ getApiService(service?: CoreApiService): string;
67
+
60
68
  /**
61
69
  * Get API services
62
70
  * 获取API服务列表
@@ -197,6 +205,19 @@ export class CoreApp implements ICoreApp {
197
205
  */
198
206
  constructor(public readonly app: IApp, public readonly api: IApi) {}
199
207
 
208
+ /**
209
+ * Get API service label
210
+ * 获取API服务标签
211
+ * @param service API service
212
+ * @returns Result
213
+ */
214
+ getApiService(service?: CoreApiService) {
215
+ if (service == null) return "";
216
+
217
+ const key = DataTypes.getEnumKey(CoreApiService, service) ?? `${service}`;
218
+ return this.app.get(`apiService${key}`) ?? key;
219
+ }
220
+
200
221
  /**
201
222
  * Get API services
202
223
  * 获取API服务列表