@hcmai/sdk 0.21.9 → 0.21.11
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/dist/index.d.ts +1 -1
- package/dist/index.js +132 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3084,7 +3084,7 @@ interface SaveMetaResult {
|
|
|
3084
3084
|
declare function saveTenantMeta(http: AxiosInstance, path: string, content: string): Promise<SaveMetaResult>;
|
|
3085
3085
|
declare function deleteTenantMeta(http: AxiosInstance, path: string): Promise<SaveMetaResult>;
|
|
3086
3086
|
|
|
3087
|
-
declare const META_SCHEMA_SOURCE_COMMIT = "
|
|
3087
|
+
declare const META_SCHEMA_SOURCE_COMMIT = "9c205ad33da978414b101ce79b3f091a60779a34";
|
|
3088
3088
|
|
|
3089
3089
|
type MetaIssueSeverity = 'error' | 'warn';
|
|
3090
3090
|
interface MetaIssue {
|
package/dist/index.js
CHANGED
|
@@ -225,6 +225,8 @@ var CliError = class extends Error {
|
|
|
225
225
|
if (typeof serverCode === "string" && serverCode && serverCode !== this.code) {
|
|
226
226
|
parts.push(`[\u670D\u52A1\u7AEF\u9519\u8BEF\u7801: ${serverCode}]`);
|
|
227
227
|
}
|
|
228
|
+
const workspaceKey = this.context?.workspaceKey;
|
|
229
|
+
if (typeof workspaceKey === "string" && workspaceKey) parts.push(`[\u5DE5\u4F5C\u533A: ${workspaceKey}]`);
|
|
228
230
|
const field = this.context?.field;
|
|
229
231
|
if (typeof field === "string" && field) parts.push(`[\u5B57\u6BB5: ${field}]`);
|
|
230
232
|
const reasonCode = this.context?.reasonCode;
|
|
@@ -280,9 +282,10 @@ function fromAxiosError(err, profile) {
|
|
|
280
282
|
const respDetails = body?.details;
|
|
281
283
|
const respReason = nonBlankString(body?.reason);
|
|
282
284
|
const respNote = nonBlankString(body?.note);
|
|
283
|
-
const respNextStep = body?.next_step ?? body?.nextStep;
|
|
285
|
+
const respNextStep = nonBlankString(body?.next_step) ?? nonBlankString(body?.nextStep);
|
|
284
286
|
const respRetryable = body?.retryable;
|
|
285
|
-
const
|
|
287
|
+
const conflictDiagnosis = status === 409 ? diagnoseWorkspaceConflict(respCode) : void 0;
|
|
288
|
+
const localDiagnosis = respCode === REJECTED_BEFORE_ROUTING_CODE ? diagnoseRejectedBeforeRouting(err.config?.url, err.config?.baseURL) : conflictDiagnosis;
|
|
286
289
|
let code;
|
|
287
290
|
if (status === 401) code = "AUTH_FAILED" /* AUTH_FAILED */;
|
|
288
291
|
else if (status === 403) code = "SCOPE_FORBIDDEN" /* SCOPE_FORBIDDEN */;
|
|
@@ -304,7 +307,7 @@ function fromAxiosError(err, profile) {
|
|
|
304
307
|
...respDetails !== void 0 ? { details: respDetails } : {},
|
|
305
308
|
...respReason ? { reason: respReason } : {},
|
|
306
309
|
...respNote ? { note: respNote } : {},
|
|
307
|
-
...respNextStep ? { nextStep: respNextStep } : {},
|
|
310
|
+
...respNextStep || conflictDiagnosis ? { nextStep: respNextStep ?? conflictRecovery } : {},
|
|
308
311
|
...respRetryable !== void 0 ? { retryable: respRetryable } : {},
|
|
309
312
|
// 与后端的 nextStep 并存、不互相覆盖:一个是服务端的通用路标,一个是本地对症结论。
|
|
310
313
|
...localDiagnosis ? { localDiagnosis } : {}
|
|
@@ -314,6 +317,16 @@ function fromAxiosError(err, profile) {
|
|
|
314
317
|
cause: err
|
|
315
318
|
});
|
|
316
319
|
}
|
|
320
|
+
var conflictRecovery = "\u5148\u6838\u5BF9\u670D\u52A1\u7AEF\u8BE6\u60C5\u3002\u4EC5\u5728\u786E\u8BA4\u662F\u5176\u4ED6\u5199\u5165\u6216\u90E8\u7F72\u5360\u7528\u65F6\u7B49\u5F85\u540E\u56DE\u8BFB\u72B6\u6001\uFF1B\u5BA2\u6237\u7AEF\u5EFA\u8BAE\u95F4\u9694 30\u201360 \u79D2\uFF0C\u4E0D\u80FD\u4FDD\u8BC1\u5C4A\u65F6\u9501\u5DF2\u91CA\u653E\uFF0C\u670D\u52A1\u7AEF\u672A\u63D0\u4F9B\u7684\u6301\u6709\u8005\u53CA\u5269\u4F59\u65F6\u95F4\u4E0D\u80FD\u63A8\u65AD\u3002\u771F\u5B9E\u4FEE\u8BA2\u51B2\u7A81\u6216\u6587\u4EF6\u89C4\u8303\u5316\u8981\u6C42\u5E94\u6309\u8BE6\u60C5\u5904\u7406\uFF0C\u4FDD\u7559\u672C\u5730\u6539\u52A8\u3001\u8BFB\u53D6\u6700\u65B0\u5185\u5BB9\u5E76\u6BD4\u5BF9\u540E\u518D\u51B3\u5B9A\u662F\u5426\u91CD\u8BD5\u3002";
|
|
321
|
+
function diagnoseWorkspaceConflict(responseCode) {
|
|
322
|
+
if (responseCode === "WORKSPACE_REVISION_CONFLICT") {
|
|
323
|
+
return "\u5DE5\u4F5C\u533A\u5199\u5165\u88AB\u62D2\u7EDD\uFF1A\u53EF\u80FD\u662F\u79DF\u6237\u5185\u5176\u4ED6\u5199\u5165\u6216\u90E8\u7F72\u6B63\u5728\u5360\u7528\uFF0C\u4E5F\u53EF\u80FD\u662F\u57FA\u7EBF\u4FEE\u8BA2\u51B2\u7A81\u6216\u6587\u4EF6\u89C4\u8303\u5316\u8981\u6C42\uFF1B\u4EC5\u51ED\u9519\u8BEF\u7801\u65E0\u6CD5\u5224\u65AD\u53EF\u5426\u91CD\u8BD5\uFF0C\u4EE5\u670D\u52A1\u7AEF\u8BE6\u60C5\u4E3A\u51C6\u3002";
|
|
324
|
+
}
|
|
325
|
+
if (responseCode === "DEPLOY_IN_PROGRESS") {
|
|
326
|
+
return "\u79DF\u6237\u6269\u5C55\u6B63\u5728\u90E8\u7F72\u6216\u5F52\u6863\uFF0C\u5F53\u524D\u64CD\u4F5C\u88AB\u5E76\u53D1\u4FDD\u62A4\u62D2\u7EDD\uFF1B\u8BF7\u5148\u786E\u8BA4\u73B0\u6709\u90E8\u7F72\u72B6\u6001\u3002";
|
|
327
|
+
}
|
|
328
|
+
return void 0;
|
|
329
|
+
}
|
|
317
330
|
var CODE_LIKE = /^(?:[A-Z][A-Z0-9_]*|[a-z][a-z0-9]*(?:_[a-z0-9]+)+)$/;
|
|
318
331
|
function isRecord(value) {
|
|
319
332
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -7144,7 +7157,7 @@ async function deleteTenantMeta(http, path24) {
|
|
|
7144
7157
|
import yaml9 from "js-yaml";
|
|
7145
7158
|
|
|
7146
7159
|
// src/meta/generated/meta-schemas.ts
|
|
7147
|
-
var META_SCHEMA_SOURCE_COMMIT = "
|
|
7160
|
+
var META_SCHEMA_SOURCE_COMMIT = "9c205ad33da978414b101ce79b3f091a60779a34";
|
|
7148
7161
|
var META_SCHEMAS = {
|
|
7149
7162
|
list: {
|
|
7150
7163
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
@@ -7936,7 +7949,7 @@ var META_SCHEMAS = {
|
|
|
7936
7949
|
},
|
|
7937
7950
|
"type": {
|
|
7938
7951
|
"type": "string",
|
|
7939
|
-
"enum": ["api", "navigate"]
|
|
7952
|
+
"enum": ["api", "navigate", "dialog"]
|
|
7940
7953
|
},
|
|
7941
7954
|
"targetModel": {
|
|
7942
7955
|
"type": "string"
|
|
@@ -7978,6 +7991,46 @@ var META_SCHEMAS = {
|
|
|
7978
7991
|
},
|
|
7979
7992
|
"path": {
|
|
7980
7993
|
"type": "string"
|
|
7994
|
+
},
|
|
7995
|
+
"dialog": {
|
|
7996
|
+
"type": "object",
|
|
7997
|
+
"description": "type=dialog \u7684\u901A\u7528\u52A8\u4F5C\u5F39\u7A97\u914D\u7F6E\uFF0C\u6CBF\u7528\u5217\u8868 dialog \u5757\u3002",
|
|
7998
|
+
"properties": {
|
|
7999
|
+
"dialogType": {
|
|
8000
|
+
"type": "string",
|
|
8001
|
+
"enum": ["action", "custom"]
|
|
8002
|
+
},
|
|
8003
|
+
"targetModel": {
|
|
8004
|
+
"type": "string"
|
|
8005
|
+
},
|
|
8006
|
+
"targetAction": {
|
|
8007
|
+
"type": "string"
|
|
8008
|
+
},
|
|
8009
|
+
"actionTarget": {
|
|
8010
|
+
"type": "string",
|
|
8011
|
+
"enum": ["class", "object"]
|
|
8012
|
+
},
|
|
8013
|
+
"targetMethod": {
|
|
8014
|
+
"type": "string",
|
|
8015
|
+
"enum": ["GET", "POST", "PUT", "DELETE"]
|
|
8016
|
+
},
|
|
8017
|
+
"component": {
|
|
8018
|
+
"type": "string"
|
|
8019
|
+
},
|
|
8020
|
+
"title": {
|
|
8021
|
+
"type": "string"
|
|
8022
|
+
},
|
|
8023
|
+
"width": {
|
|
8024
|
+
"type": "string"
|
|
8025
|
+
},
|
|
8026
|
+
"form": {
|
|
8027
|
+
"type": "object"
|
|
8028
|
+
},
|
|
8029
|
+
"result": {
|
|
8030
|
+
"type": "object"
|
|
8031
|
+
}
|
|
8032
|
+
},
|
|
8033
|
+
"required": ["dialogType"]
|
|
7981
8034
|
}
|
|
7982
8035
|
},
|
|
7983
8036
|
"required": ["key", "label", "type"]
|
|
@@ -8626,6 +8679,23 @@ var META_SCHEMAS = {
|
|
|
8626
8679
|
},
|
|
8627
8680
|
"description": "\u5217\u8868\u5DE5\u5177\u680F\u914D\u7F6E;\u58F0\u660E TopBar \u5404\u5143\u7D20\u663E\u9690\u4E0E\u641C\u7D22\u5F62\u6001\u3002\u6574\u5757\u53CA\u5404\u5B57\u6BB5\u5747\u53EF\u9009,\u7F3A\u7701\u5168\u5F00+\u5173\u952E\u8BCD\u641C\u7D22",
|
|
8628
8681
|
"additionalProperties": false
|
|
8682
|
+
},
|
|
8683
|
+
"tree": {
|
|
8684
|
+
"type": "object",
|
|
8685
|
+
"properties": {
|
|
8686
|
+
"defaultExpandAll": {
|
|
8687
|
+
"type": "boolean",
|
|
8688
|
+
"description": "\u9ED8\u8BA4\u5C55\u5F00\u5168\u90E8\u5C42\u7EA7;\u7F3A\u7701 false"
|
|
8689
|
+
},
|
|
8690
|
+
"parentField": {
|
|
8691
|
+
"type": "string",
|
|
8692
|
+
"description": "\u5C42\u7EA7\u7236\u5B57\u6BB5(\u5982 parentId);\u8BE5\u5B57\u6BB5\u4E3A\u7A7A\u7684\u884C\u4F5C\u6839,\u5176\u4F59\u6309\u540C\u96C6\u5408\u5185\u7684\u7236\u884C\u6302\u6210\u5B50\u7EA7",
|
|
8693
|
+
"minLength": 1
|
|
8694
|
+
}
|
|
8695
|
+
},
|
|
8696
|
+
"description": "\u5217\u8868\u6811\u5F62\u5C55\u793A;\u6309 parentField \u628A\u5F53\u524D\u9875\u6570\u636E\u6E32\u67D3\u6210\u53EF\u9010\u7EA7\u5C55\u5F00\u7684\u6811\u8868\u3002\u7236\u5B50\u5173\u7CFB\u53EA\u4F5C\u7528\u5728\u6E32\u67D3\u5C42,\u7B5B\u9009/\u6392\u5E8F/\u5206\u9875/\u6743\u9650\u53E3\u5F84\u4E0D\u53D8",
|
|
8697
|
+
"additionalProperties": false,
|
|
8698
|
+
"required": ["parentField"]
|
|
8629
8699
|
}
|
|
8630
8700
|
}
|
|
8631
8701
|
},
|
|
@@ -8979,6 +9049,7 @@ var META_SCHEMAS = {
|
|
|
8979
9049
|
}
|
|
8980
9050
|
}
|
|
8981
9051
|
},
|
|
9052
|
+
"disabled": {},
|
|
8982
9053
|
"execution": {
|
|
8983
9054
|
"type": "object",
|
|
8984
9055
|
"properties": {
|
|
@@ -9223,6 +9294,29 @@ var META_SCHEMAS = {
|
|
|
9223
9294
|
"type": "string"
|
|
9224
9295
|
},
|
|
9225
9296
|
"defaultValue": {},
|
|
9297
|
+
"derive": {
|
|
9298
|
+
"type": "object",
|
|
9299
|
+
"properties": {
|
|
9300
|
+
"clearOnSourceEmpty": {
|
|
9301
|
+
"type": "boolean"
|
|
9302
|
+
},
|
|
9303
|
+
"createOnly": {
|
|
9304
|
+
"type": "boolean"
|
|
9305
|
+
},
|
|
9306
|
+
"field": {
|
|
9307
|
+
"type": "string"
|
|
9308
|
+
},
|
|
9309
|
+
"from": {
|
|
9310
|
+
"type": "string"
|
|
9311
|
+
},
|
|
9312
|
+
"model": {
|
|
9313
|
+
"type": "string"
|
|
9314
|
+
},
|
|
9315
|
+
"preserveManual": {
|
|
9316
|
+
"type": "boolean"
|
|
9317
|
+
}
|
|
9318
|
+
}
|
|
9319
|
+
},
|
|
9226
9320
|
"hidden": {
|
|
9227
9321
|
"type": "boolean"
|
|
9228
9322
|
},
|
|
@@ -10016,6 +10110,29 @@ var META_SCHEMAS = {
|
|
|
10016
10110
|
"type": "string"
|
|
10017
10111
|
},
|
|
10018
10112
|
"defaultValue": {},
|
|
10113
|
+
"derive": {
|
|
10114
|
+
"type": "object",
|
|
10115
|
+
"properties": {
|
|
10116
|
+
"clearOnSourceEmpty": {
|
|
10117
|
+
"type": "boolean"
|
|
10118
|
+
},
|
|
10119
|
+
"createOnly": {
|
|
10120
|
+
"type": "boolean"
|
|
10121
|
+
},
|
|
10122
|
+
"field": {
|
|
10123
|
+
"type": "string"
|
|
10124
|
+
},
|
|
10125
|
+
"from": {
|
|
10126
|
+
"type": "string"
|
|
10127
|
+
},
|
|
10128
|
+
"model": {
|
|
10129
|
+
"type": "string"
|
|
10130
|
+
},
|
|
10131
|
+
"preserveManual": {
|
|
10132
|
+
"type": "boolean"
|
|
10133
|
+
}
|
|
10134
|
+
}
|
|
10135
|
+
},
|
|
10019
10136
|
"hidden": {
|
|
10020
10137
|
"type": "boolean"
|
|
10021
10138
|
},
|
|
@@ -10029,7 +10146,7 @@ var META_SCHEMAS = {
|
|
|
10029
10146
|
"type": "array",
|
|
10030
10147
|
"items": {
|
|
10031
10148
|
"type": "string",
|
|
10032
|
-
"enum": ["EQUAL", "NOT_EQUAL", "GREATER_THAN", "LESS_THAN", "GREATER_THAN_OR_EQUAL", "LESS_THAN_OR_EQUAL", "LIKE", "NOT_LIKE", "CONTAINS", "STARTSWITH", "ENDSWITH", "IN", "NOT_IN", "IS_NULL", "IS_NOT_NULL", "ARRAY_CONTAINS", "BETWEEN", "ANNUAL_WITHIN", "CHILD_OF", "PARENT_OF", "ORG_SUBTREE_OF", "MANAGED_ORG_SCOPE"]
|
|
10149
|
+
"enum": ["EQUAL", "NOT_EQUAL", "GREATER_THAN", "LESS_THAN", "GREATER_THAN_OR_EQUAL", "LESS_THAN_OR_EQUAL", "LIKE", "NOT_LIKE", "CONTAINS", "STARTSWITH", "ENDSWITH", "IN", "NOT_IN", "IS_NULL", "IS_NOT_NULL", "ARRAY_CONTAINS", "BETWEEN", "ANNUAL_WITHIN", "CHILD_OF", "PARENT_OF", "ORG_SUBTREE_OF", "WF_ROLE", "MANAGED_ORG_SCOPE"]
|
|
10033
10150
|
}
|
|
10034
10151
|
},
|
|
10035
10152
|
"options": {
|
|
@@ -10690,6 +10807,10 @@ var META_SCHEMAS = {
|
|
|
10690
10807
|
},
|
|
10691
10808
|
"uniqueItems": true
|
|
10692
10809
|
},
|
|
10810
|
+
"searchPinyin": {
|
|
10811
|
+
"type": "string",
|
|
10812
|
+
"enum": ["NONE", "PERSON_NAME", "PLAIN"]
|
|
10813
|
+
},
|
|
10693
10814
|
"security": {
|
|
10694
10815
|
"type": "object",
|
|
10695
10816
|
"properties": {
|
|
@@ -10735,7 +10856,8 @@ var META_SCHEMAS = {
|
|
|
10735
10856
|
},
|
|
10736
10857
|
"type": {
|
|
10737
10858
|
"type": "string",
|
|
10738
|
-
"enum": ["uuid", "string", "boolean", "integer", "float", "date", "datetime", "time"]
|
|
10859
|
+
"enum": ["uuid", "string", "boolean", "integer", "float", "number", "date", "datetime", "time"],
|
|
10860
|
+
"description": "\u5B57\u6BB5\u7C7B\u578B\uFF1Bnumber \u4E3A\u7CBE\u786E\u5341\u8FDB\u5236\uFF0C\u4F7F\u7528\u5B57\u7B26\u4E32\u4F20\u8F93\uFF0C\u6574\u6570\u6700\u591A28\u4F4D\u3001\u5C0F\u6570\u6700\u591A10\u4F4D\uFF1Bfloat \u4E3A\u8FD1\u4F3C\u6D6E\u70B9\u6570"
|
|
10739
10861
|
},
|
|
10740
10862
|
"typeFallback": {
|
|
10741
10863
|
"type": "boolean"
|
|
@@ -11138,6 +11260,9 @@ var META_SCHEMAS = {
|
|
|
11138
11260
|
"model": {
|
|
11139
11261
|
"type": "string"
|
|
11140
11262
|
},
|
|
11263
|
+
"plugin": {
|
|
11264
|
+
"type": "string"
|
|
11265
|
+
},
|
|
11141
11266
|
"relation": {
|
|
11142
11267
|
"$ref": "#/$defs/RelationConfig",
|
|
11143
11268
|
"type": "object",
|