@gct-paas/api 0.1.4-dev.4 → 0.1.4-dev.5

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.
@@ -17,7 +17,7 @@ export interface getOperateTypesQuery {
17
17
  /**
18
18
  * 功能模块
19
19
  */
20
- module: string;
20
+ moduleType: string;
21
21
  }
22
22
  export interface AuditLogService {
23
23
  /**
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-empty-object-type */
2
2
  export interface AccountConfig {
3
3
  /**
4
- * 应用类型 枚举(钉钉 DINGDING,企微 QIYEWEIXIN,飞书 FEISHU)
4
+ * 应用类型 枚举 (钉钉 DINGDING,企微 QIYEWEIXIN,飞书 FEISHU,微软 MICROSOFT)
5
5
  *
6
6
  * @type string
7
7
  */
@@ -4178,6 +4178,12 @@ export interface DataTraceRequest {
4178
4178
  * @type string
4179
4179
  */
4180
4180
  module?: string;
4181
+ /**
4182
+ * 多个模块
4183
+ *
4184
+ * @type string[]
4185
+ */
4186
+ modules?: string[];
4181
4187
  /**
4182
4188
  * 操作类型
4183
4189
  *
@@ -5670,6 +5676,12 @@ export interface DocControlTaskTodoResponse {
5670
5676
  version?: string;
5671
5677
  }
5672
5678
  export interface DocOutlineBase {
5679
+ /**
5680
+ * 基础单据id(DHR ID)
5681
+ *
5682
+ * @type string
5683
+ */
5684
+ baseId?: string;
5673
5685
  /**
5674
5686
  *
5675
5687
  *
@@ -9480,6 +9492,12 @@ export interface FieldMeta {
9480
9492
  * @type string
9481
9493
  */
9482
9494
  bindInfo?: string;
9495
+ /**
9496
+ * 业务字段类型
9497
+ *
9498
+ * @type string
9499
+ */
9500
+ bizType?: string;
9483
9501
  /**
9484
9502
  *
9485
9503
  *
@@ -9702,6 +9720,12 @@ export interface FieldMetaDTO {
9702
9720
  * @type string
9703
9721
  */
9704
9722
  bindInfo?: string;
9723
+ /**
9724
+ * 业务字段类型
9725
+ *
9726
+ * @type string
9727
+ */
9728
+ bizType?: string;
9705
9729
  /**
9706
9730
  *
9707
9731
  *
@@ -10218,6 +10242,12 @@ export interface FieldMetaVO {
10218
10242
  * @type string
10219
10243
  */
10220
10244
  bindInfo?: string;
10245
+ /**
10246
+ * 业务字段类型
10247
+ *
10248
+ * @type string
10249
+ */
10250
+ bizType?: string;
10221
10251
  /**
10222
10252
  * 默认值
10223
10253
  *
@@ -10382,6 +10412,12 @@ export interface FileResourceResponse {
10382
10412
  url?: string;
10383
10413
  }
10384
10414
  export interface FileTaskDTO {
10415
+ /**
10416
+ * 是否包含半成品批次(当type为EDHR时使用,用于判断打印时是否需要打印半成品批次eDHR)
10417
+ *
10418
+ * @type boolean
10419
+ */
10420
+ includeSemi?: boolean;
10385
10421
  /**
10386
10422
  * 模板实例id
10387
10423
  *
@@ -17296,6 +17332,12 @@ export interface OnlineFormFieldMetaVO {
17296
17332
  * @type string
17297
17333
  */
17298
17334
  bindInfo?: string;
17335
+ /**
17336
+ * 业务字段类型
17337
+ *
17338
+ * @type string
17339
+ */
17340
+ bizType?: string;
17299
17341
  /**
17300
17342
  * 默认值
17301
17343
  *
@@ -18318,6 +18360,12 @@ export interface OnlineFormInstanceResponse {
18318
18360
  * @type string
18319
18361
  */
18320
18362
  designerJson?: string;
18363
+ /**
18364
+ *
18365
+ *
18366
+ * @type string
18367
+ */
18368
+ direction?: string;
18321
18369
  /**
18322
18370
  *
18323
18371
  *
@@ -18390,6 +18438,12 @@ export interface OnlineFormInstanceResponse {
18390
18438
  * @type string
18391
18439
  */
18392
18440
  formType?: string;
18441
+ /**
18442
+ *
18443
+ *
18444
+ * @type number
18445
+ */
18446
+ height?: number;
18393
18447
  /**
18394
18448
  * 主键ID
18395
18449
  *
@@ -18492,6 +18546,12 @@ export interface OnlineFormInstanceResponse {
18492
18546
  * @type string
18493
18547
  */
18494
18548
  operatorRange?: string;
18549
+ /**
18550
+ *
18551
+ *
18552
+ * @type string
18553
+ */
18554
+ paperSize?: string;
18495
18555
  /**
18496
18556
  * 实例参数(业务扩展属性)
18497
18557
  *
@@ -18630,6 +18690,12 @@ export interface OnlineFormInstanceResponse {
18630
18690
  * @type string
18631
18691
  */
18632
18692
  viewType?: string;
18693
+ /**
18694
+ *
18695
+ *
18696
+ * @type number
18697
+ */
18698
+ width?: number;
18633
18699
  }
18634
18700
  export interface OnlineFormInstanceTmplRelationResponse {
18635
18701
  /**
@@ -25978,6 +26044,24 @@ export interface ProcessPathResponse {
25978
26044
  * @type string
25979
26045
  */
25980
26046
  tmplId?: string;
26047
+ /**
26048
+ * 事务定义id
26049
+ *
26050
+ * @type string
26051
+ */
26052
+ txnDefinitionId?: string;
26053
+ /**
26054
+ * 事务实例id
26055
+ *
26056
+ * @type string
26057
+ */
26058
+ txnInstId?: string;
26059
+ /**
26060
+ * 事务实例状态
26061
+ *
26062
+ * @type string
26063
+ */
26064
+ txnInstStatus?: string;
25981
26065
  }
25982
26066
  export interface ProcessPathUserRequest {
25983
26067
  /**
@@ -35828,6 +35912,12 @@ export interface UserTenantDTO {
35828
35912
  * @type string
35829
35913
  */
35830
35914
  id?: string;
35915
+ /**
35916
+ * 是否最后登录租户,0:否 1:是
35917
+ *
35918
+ * @type number
35919
+ */
35920
+ latestLogin?: number;
35831
35921
  /**
35832
35922
  * 直属上级id
35833
35923
  *
@@ -5608,6 +5608,12 @@ export const apiConfig = [
5608
5608
  path: "login-log/userLoginLogPage",
5609
5609
  hasData: true
5610
5610
  },
5611
+ {
5612
+ mode: "get",
5613
+ method: "getLoginSettingGet",
5614
+ path: "login/setting/get",
5615
+ hasQuery: true
5616
+ },
5611
5617
  {
5612
5618
  mode: "get",
5613
5619
  method: "getLoginSsoOauth2Authorize",
@@ -28,6 +28,7 @@ import type {
28
28
  TenantUserSearchRequest,
29
29
  UserWithUserExtraDTO,
30
30
  UserIdsDTO,
31
+ ResponseEntity,
31
32
  RedirectView,
32
33
  DataSourceUpdateRequest,
33
34
  DatasourceExtDTO,
@@ -40,6 +41,7 @@ import type {
40
41
  AppEffectiveLicense,
41
42
  UserLoginLogPageRequest,
42
43
  UserLoginLogDTO,
44
+ ThirdPartyLoginConfig,
43
45
  ModelDTO,
44
46
  消息设置VO,
45
47
  SendEmailMessageRequest,
@@ -510,6 +512,12 @@ export interface getLicenseGetAppEffectiveLicenseQuery {
510
512
  */
511
513
  env: string;
512
514
  }
515
+ export interface getLoginSettingGetQuery {
516
+ /**
517
+ * code
518
+ */
519
+ code: string;
520
+ }
513
521
  export interface getLoginSsoOauth2AuthorizeQuery {
514
522
  /**
515
523
  * 授权码
@@ -1141,7 +1149,7 @@ export interface ApiService {
1141
1149
  postAppUserSaveList(
1142
1150
  query: postAppUserSaveListQuery,
1143
1151
  config?: Partial<AxiosRequestConfig>,
1144
- ): Promise<string>;
1152
+ ): Promise<ResponseEntity>;
1145
1153
  /**
1146
1154
  * 修改
1147
1155
  */
@@ -1261,6 +1269,13 @@ export interface ApiService {
1261
1269
  data: UserLoginLogPageRequest,
1262
1270
  config?: Partial<AxiosRequestConfig>,
1263
1271
  ): Promise<IPage<UserLoginLogDTO>>;
1272
+ /**
1273
+ * 重定向到微软登录页
1274
+ */
1275
+ getLoginSettingGet(
1276
+ query: getLoginSettingGetQuery,
1277
+ config?: Partial<AxiosRequestConfig>,
1278
+ ): Promise<ThirdPartyLoginConfig>;
1264
1279
  /**
1265
1280
  * 泛微OA认证地址
1266
1281
  */
@@ -7345,6 +7345,12 @@ export interface FileTaskResponse {
7345
7345
  * @type string
7346
7346
  */
7347
7347
  name?: string;
7348
+ /**
7349
+ *
7350
+ *
7351
+ * @type IObject
7352
+ */
7353
+ params?: IObject;
7348
7354
  /**
7349
7355
  * 关联数据id(edhr实模板ID)
7350
7356
  *
@@ -11016,6 +11022,12 @@ export interface OrgAddOrUpdateUserRequest {
11016
11022
  username?: string;
11017
11023
  }
11018
11024
  export interface OrgBaseInfo {
11025
+ /**
11026
+ *
11027
+ *
11028
+ * @type string
11029
+ */
11030
+ createTime?: string;
11019
11031
  /**
11020
11032
  *
11021
11033
  *
@@ -11046,6 +11058,12 @@ export interface OrgBaseInfo {
11046
11058
  * @type string
11047
11059
  */
11048
11060
  parentId?: string;
11061
+ /**
11062
+ *
11063
+ *
11064
+ * @type string
11065
+ */
11066
+ type?: string;
11049
11067
  }
11050
11068
  export interface OrgConfig {
11051
11069
  /**
@@ -14144,6 +14162,12 @@ export interface PnDataset {
14144
14162
  * @type number
14145
14163
  */
14146
14164
  deleted?: number;
14165
+ /**
14166
+ *
14167
+ *
14168
+ * @type string
14169
+ */
14170
+ designSql?: string;
14147
14171
  /**
14148
14172
  *
14149
14173
  *
@@ -14324,6 +14348,12 @@ export interface PnDatasetRequest {
14324
14348
  * @type string
14325
14349
  */
14326
14350
  databaseType?: string;
14351
+ /**
14352
+ * 设计的sql - 可包含注释
14353
+ *
14354
+ * @type string
14355
+ */
14356
+ designSql?: string;
14327
14357
  /**
14328
14358
  * 文件地址
14329
14359
  *
@@ -14422,6 +14452,12 @@ export interface PnDatasetResponse {
14422
14452
  * @type string
14423
14453
  */
14424
14454
  databaseType?: string;
14455
+ /**
14456
+ * 设计的sql - 可包含注释
14457
+ *
14458
+ * @type string
14459
+ */
14460
+ designSql?: string;
14425
14461
  /**
14426
14462
  * 完整的sql
14427
14463
  *
@@ -19866,6 +19902,12 @@ export interface UserBaseReq {
19866
19902
  * @type string
19867
19903
  */
19868
19904
  password?: string;
19905
+ /**
19906
+ *
19907
+ *
19908
+ * @type string
19909
+ */
19910
+ referer?: string;
19869
19911
  /**
19870
19912
  *
19871
19913
  *
@@ -20282,12 +20324,6 @@ export interface UserExtraResponse {
20282
20324
  * @type string
20283
20325
  */
20284
20326
  id?: string;
20285
- /**
20286
- * 是否最近登录租户
20287
- *
20288
- * @type number
20289
- */
20290
- latestLogin?: number;
20291
20327
  /**
20292
20328
  * 直属上级
20293
20329
  *
@@ -6,6 +6,13 @@ import type { AxiosInstance, AxiosRequestConfig } from 'axios';
6
6
  * @class HttpUtil
7
7
  */
8
8
  export declare class HttpUtil {
9
+ /**
10
+ * Axios 实例,供外部使用和挂载中间件
11
+ *
12
+ * @static
13
+ * @type {AxiosInstance}
14
+ */
15
+ static _instance: AxiosInstance;
9
16
  /**
10
17
  * 挂载中间件
11
18
  *
@@ -3,6 +3,13 @@ import { ContentTypeEnum } from "./http.enum.mjs";
3
3
  import { BackendError } from "./http.error.mjs";
4
4
  const instance = axios.create();
5
5
  export class HttpUtil {
6
+ /**
7
+ * Axios 实例,供外部使用和挂载中间件
8
+ *
9
+ * @static
10
+ * @type {AxiosInstance}
11
+ */
12
+ static _instance = instance;
6
13
  /**
7
14
  * 挂载中间件
8
15
  *
@@ -10,7 +17,7 @@ export class HttpUtil {
10
17
  * @param {(_axios: AxiosInstance) => void} fn 中间件函数
11
18
  */
12
19
  static use(fn) {
13
- fn(instance);
20
+ fn(this._instance);
14
21
  }
15
22
  /**
16
23
  * GET 请求方法
@@ -1,10 +1,12 @@
1
1
  import { apiConfig as aPaasConfig } from "../apaas/index.mjs";
2
2
  import { apiConfig as platformConfig } from "../platform/index.mjs";
3
3
  import { ApiManage } from "./api-manage.mjs";
4
+ import { installHttpUtil } from "./request.client.mjs";
4
5
  export const api = {
5
6
  apaas: new ApiManage("/gct-apaas/api", aPaasConfig),
6
7
  platform: new ApiManage("/gct-platform/api", platformConfig)
7
8
  };
9
+ installHttpUtil();
8
10
  export {
9
11
  ResultEnum,
10
12
  RequestEnum,
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 安装 HTTP 工具类,配置 android 原生适配器和拦截器
3
+ *
4
+ * @export
5
+ */
6
+ export declare function installHttpUtil(): void;
@@ -0,0 +1,35 @@
1
+ import { NativeHTTP } from "../utils/index.mjs";
2
+ import { HttpUtil } from "./http.util.mjs";
3
+ export function installHttpUtil() {
4
+ if (window.location.host !== "appassets.androidplatform.net") {
5
+ console.debug("\u5F53\u524D\u73AF\u5883\u975E Android\uFF0C\u5DF2\u8DF3\u8FC7 HTTP \u5DE5\u5177\u7C7B\u5B89\u88C5");
6
+ return;
7
+ }
8
+ const nativeAdapter = async (config) => {
9
+ const response = await NativeHTTP.request(config);
10
+ return response;
11
+ };
12
+ HttpUtil._instance.defaults.adapter = nativeAdapter;
13
+ const errorHandler = (error) => {
14
+ if (error?.response?.status === 401) {
15
+ console.log("\u767B\u5F55\u4FE1\u606F\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55");
16
+ } else {
17
+ console.log("\u7F51\u7EDC\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");
18
+ }
19
+ return Promise.reject(error);
20
+ };
21
+ HttpUtil._instance.interceptors.request.use((config) => {
22
+ config.headers["App-Tag"] = "__platform__";
23
+ return config;
24
+ }, errorHandler);
25
+ HttpUtil._instance.interceptors.response.use((response) => {
26
+ if (response.data.code === 200) {
27
+ return response.data.data;
28
+ }
29
+ const errorMessageMode = response.config?.errorMessageMode;
30
+ if (errorMessageMode !== "none") {
31
+ console.log(response.data.message);
32
+ }
33
+ return Promise.reject(response.data);
34
+ }, errorHandler);
35
+ }
@@ -1,3 +1,4 @@
1
+ export { NativeHTTP } from './native-http/native-http';
1
2
  /**
2
3
  * 拼接 URL 路径片段,处理多余的斜杠
3
4
  *
@@ -1,3 +1,4 @@
1
+ export { NativeHTTP } from "./native-http/native-http.mjs";
1
2
  import { cloneDeep, isEqual, mergeWith, unionWith } from "lodash-es";
2
3
  export function joinPath(...segments) {
3
4
  return segments.map((seg, i) => {
@@ -0,0 +1,6 @@
1
+ import type { InternalAxiosRequestConfig } from 'axios';
2
+ export declare const NativeHTTP: {
3
+ request(querydata: InternalAxiosRequestConfig): Promise<unknown>;
4
+ urlDecode(arg: string): Promise<string>;
5
+ urlDecodeSync(arg: string): string;
6
+ };
@@ -0,0 +1,63 @@
1
+ import dsBridge from "dsbridge";
2
+ import qs from "qs";
3
+ export const NativeHTTP = {
4
+ request(querydata) {
5
+ const { method, url, timeout, params, headers, data, baseURL } = querydata;
6
+ const pathparam = "?" + qs.stringify(params);
7
+ const allurl = (baseURL + url).replace(/([^:])\/\//g, "$1/") + pathparam;
8
+ console.info(allurl + ">>HTTP", querydata);
9
+ const startTime = performance.now();
10
+ return new Promise((resolve, reject) => {
11
+ dsBridge.call(
12
+ "HTTP." + method,
13
+ {
14
+ url: allurl,
15
+ timeout,
16
+ headers,
17
+ data: data && typeof data === "string" ? JSON.parse(data) : data
18
+ },
19
+ function(res) {
20
+ const nativeData = JSON.parse(res);
21
+ console.info(
22
+ allurl + `>>HTTP.response-\u8017\u65F6\uFF1A${performance.now() - startTime}`,
23
+ nativeData
24
+ );
25
+ if (nativeData.code === 0 && nativeData.http_code === 200) {
26
+ resolve({ ...nativeData, config: querydata });
27
+ } else {
28
+ const response = {
29
+ message: nativeData.message,
30
+ status: nativeData.http_code
31
+ };
32
+ reject({ response, config: querydata });
33
+ }
34
+ }
35
+ );
36
+ });
37
+ },
38
+ urlDecode(arg) {
39
+ return new Promise((resolve, reject) => {
40
+ return dsBridge.call("HTTP.urlDecode", arg, function(res) {
41
+ if (res) {
42
+ const data = JSON.parse(res);
43
+ if (data.code === 0) {
44
+ resolve(data.data);
45
+ return;
46
+ }
47
+ }
48
+ reject();
49
+ });
50
+ });
51
+ },
52
+ urlDecodeSync(arg) {
53
+ if (!arg) return "";
54
+ const res = dsBridge.call("HTTP.urlDecodeSync", arg);
55
+ if (res) {
56
+ const data = JSON.parse(res);
57
+ if (data.code === 0) {
58
+ return data.data;
59
+ }
60
+ }
61
+ return "";
62
+ }
63
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/api",
3
- "version": "0.1.4-dev.4",
3
+ "version": "0.1.4-dev.5",
4
4
  "description": "paas 平台底包",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -70,6 +70,7 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "axios": "^1.13.2",
73
+ "dsbridge": "^3.1.4",
73
74
  "lodash-es": "^4.17.23",
74
75
  "qs": "^6.14.1"
75
76
  },