@byted-apaas/server-sdk-node 1.1.23-beta.8 → 1.1.23
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/package.json +2 -2
- package/application/application.d.ts +0 -33
- package/application/application.js +0 -2
- package/application/function/function.d.ts +0 -14
- package/application/function/function.js +0 -20
- package/application/impl/common.d.ts +0 -2
- package/application/impl/common.js +0 -52
- package/application/impl/impl.d.ts +0 -19
- package/application/impl/impl.js +0 -45
- package/common/structs.d.ts +0 -15
- package/common/structs.js +0 -21
- package/constants/constants.d.ts +0 -13
- package/constants/constants.js +0 -18
- package/context/context.d.ts +0 -44
- package/context/context.js +0 -25
- package/context/db/db.d.ts +0 -110
- package/context/db/db.js +0 -2
- package/context/db/impl/IObject.d.ts +0 -303
- package/context/db/impl/IObject.js +0 -5
- package/context/db/impl/IObjectV3.d.ts +0 -239
- package/context/db/impl/IObjectV3.js +0 -5
- package/context/db/impl/db.d.ts +0 -62
- package/context/db/impl/db.js +0 -84
- package/context/db/impl/dbV3.d.ts +0 -35
- package/context/db/impl/dbV3.js +0 -50
- package/context/db/impl/object.d.ts +0 -123
- package/context/db/impl/object.js +0 -1008
- package/context/db/impl/oql/ioql.d.ts +0 -14
- package/context/db/impl/oql/ioql.js +0 -4
- package/context/db/impl/oql/oql.d.ts +0 -14
- package/context/db/impl/oql/oql.js +0 -39
- package/context/db/impl/order.d.ts +0 -9
- package/context/db/impl/order.js +0 -15
- package/context/db/impl/propertiesStore.d.ts +0 -8
- package/context/db/impl/propertiesStore.js +0 -29
- package/context/db/impl/queryBuilder.d.ts +0 -33
- package/context/db/impl/queryBuilder.js +0 -72
- package/context/db/impl/transaction/index.d.ts +0 -25
- package/context/db/impl/transaction/index.js +0 -300
- package/context/db/impl/transaction/operation.d.ts +0 -27
- package/context/db/impl/transaction/operation.js +0 -69
- package/context/db/impl/transaction.d.ts +0 -70
- package/context/db/impl/transaction.js +0 -4
- package/context/globalConfig/globalConfig.d.ts +0 -7
- package/context/globalConfig/globalConfig.js +0 -16
- package/context/integration/IIntegration.d.ts +0 -30
- package/context/integration/IIntegration.js +0 -4
- package/context/integration/impl/integration.d.ts +0 -16
- package/context/integration/impl/integration.js +0 -62
- package/context/metadata/components/common.d.ts +0 -6
- package/context/metadata/components/common.js +0 -17
- package/context/metadata/components/components.d.ts +0 -12
- package/context/metadata/components/components.js +0 -19
- package/context/metadata/components/desktop/list.d.ts +0 -16
- package/context/metadata/components/desktop/list.js +0 -402
- package/context/metadata/components/desktop/recordDetail.d.ts +0 -11
- package/context/metadata/components/desktop/recordDetail.js +0 -53
- package/context/metadata/components/mobile/list.d.ts +0 -24
- package/context/metadata/components/mobile/list.js +0 -145
- package/context/metadata/metadata.d.ts +0 -63
- package/context/metadata/metadata.js +0 -125
- package/context/metadata/objects/fields.d.ts +0 -158
- package/context/metadata/objects/fields.js +0 -369
- package/context/metadata/objects/fields.util.d.ts +0 -52
- package/context/metadata/objects/fields.util.js +0 -420
- package/context/metadata/objects/fieldsV3.d.ts +0 -159
- package/context/metadata/objects/fieldsV3.js +0 -369
- package/context/metadata/objects/objects.d.ts +0 -11
- package/context/metadata/objects/objects.js +0 -20
- package/context/metadata/types/common.d.ts +0 -11
- package/context/metadata/types/common.js +0 -33
- package/context/metadata/types/components.d.ts +0 -90
- package/context/metadata/types/components.js +0 -4
- package/context/metadata/types/objects.d.ts +0 -246
- package/context/metadata/types/objects.js +0 -4
- package/context/metadata/types/objectsV3.d.ts +0 -128
- package/context/metadata/types/objectsV3.js +0 -4
- package/context/msg/msg.d.ts +0 -38
- package/context/msg/msg.js +0 -35
- package/context/resources/IResources.d.ts +0 -68
- package/context/resources/IResources.js +0 -2
- package/context/resources/impl/resources.d.ts +0 -42
- package/context/resources/impl/resources.js +0 -161
- package/context/tasks/tasks.d.ts +0 -33
- package/context/tasks/tasks.js +0 -139
- package/data/index.d.ts +0 -27
- package/data/index.js +0 -4
- package/global/application/flow/flow.d.ts +0 -99
- package/global/application/flow/flow.js +0 -8
- package/global/application/flow/impl/flow.d.ts +0 -20
- package/global/application/flow/impl/flow.js +0 -56
- package/global/application/globalVar/globalVar.d.ts +0 -7
- package/global/application/globalVar/globalVar.js +0 -2
- package/global/global.d.ts +0 -70
- package/global/global.js +0 -3
- package/hooks/api.d.ts +0 -65
- package/hooks/api.js +0 -347
- package/hooks/hooks.d.ts +0 -1
- package/hooks/hooks.js +0 -107
- package/kunlun/kunlun.d.ts +0 -55
- package/kunlun/kunlun.js +0 -58
- package/kunlun/operator/IOperator.d.ts +0 -158
- package/kunlun/operator/IOperator.js +0 -4
- package/kunlun/operator/impl/expression.d.ts +0 -75
- package/kunlun/operator/impl/expression.js +0 -96
- package/kunlun/operator/impl/logic.d.ts +0 -68
- package/kunlun/operator/impl/logic.js +0 -573
- package/kunlun/operator/impl/logicV2.d.ts +0 -59
- package/kunlun/operator/impl/logicV2.js +0 -197
- package/kunlun/operator/impl/operator.d.ts +0 -179
- package/kunlun/operator/impl/operator.js +0 -222
- package/kunlun/operator/impl/operatorV2.d.ts +0 -180
- package/kunlun/operator/impl/operatorV2.js +0 -216
- package/lib/core.d.ts +0 -4
- package/lib/core.js +0 -19
- package/request/common.d.ts +0 -13
- package/request/common.js +0 -88
- package/request/constants.d.ts +0 -12
- package/request/constants.js +0 -29
- package/request/faasinfra.d.ts +0 -8
- package/request/faasinfra.js +0 -146
- package/request/interface.d.ts +0 -121
- package/request/interface.js +0 -30
- package/request/openapi.d.ts +0 -84
- package/request/openapi.js +0 -1529
- package/request/structs.d.ts +0 -99
- package/request/structs.js +0 -15
- package/types/types.d.ts +0 -79
- package/types/types.js +0 -4
- package/version/version.d.ts +0 -2
- package/version/version.js +0 -8
|
@@ -1,420 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSettingsFilterV3 = exports.getOptionListV3 = exports.getRecordPosition = exports.getSettingsSort = exports.getSettingsFilter = exports.getCompositeTypeSubFields = exports.getCompositeTypeApiName = exports.getSettingsMultiple = exports.getBackLookupFieldApiName = exports.getBackLookupObjectApiName = exports.getFileTypes = exports.getFileMultiple = exports.getReferenceFieldApiName = exports.getReferenceObjectApiName = exports.getSuffix = exports.getPrefix = exports.getDigitsNumber = exports.getGenerateMethod = exports.getFormula = exports.getReturnType = exports.getLookupDisplayStyle = exports.getLookupIsHierarchy = exports.getLookupRefObjectApiName = exports.getDisplayStyle = exports.getDefaultValue = exports.getDescriptionWhenFalse = exports.getDescriptionWhenTrue = exports.getOptionList = exports.getGlobalOptionApiName = exports.getOptionSource = exports.getMultiple = exports.getDecimalPlaces = exports.getDisplayAsPercentage = exports.getRegexpErrMsg = exports.getRegexpExpression = exports.getMaxLength = exports.getMultiline = exports.getCaseSensitive = exports.getUnique = exports.getRollupFilter = exports.getRegionStrictLeve = exports.getRegionOptionLevel = exports.getRollupLookupFieldApiName = exports.getRollupFieldApiName = exports.getRollupObjectApiName = exports.getRollupType = exports.getRegionSettingsFilterV3 = exports.getRegionSettingsFilter = void 0;
|
|
4
|
-
const common = require("@byted-apaas/server-common-node");
|
|
5
|
-
const common_1 = require("../types/common");
|
|
6
|
-
const commonConstants = common.constants;
|
|
7
|
-
const commonUtils = common.utils;
|
|
8
|
-
/*
|
|
9
|
-
UniqueEnumNone = 1
|
|
10
|
-
UniqueEnumMultilingualCaseSensitive = 2
|
|
11
|
-
UniqueEnumMultilingualCaseInsensitive = 3
|
|
12
|
-
UniqueEnumTextCaseSensitive = 4
|
|
13
|
-
UniqueEnumTextCaseInsensitive = 5
|
|
14
|
-
UniqueEnumUniqueEmail = 6
|
|
15
|
-
UniqueEnumUniquePhoneNumber = 7
|
|
16
|
-
UniqueEnumUniqueNumber = 8
|
|
17
|
-
UniqueEnumUniqueAutoNumberCaseSensitive = 9
|
|
18
|
-
UniqueEnumUniqueAutoNumberCaseInsensitive = 10
|
|
19
|
-
*/
|
|
20
|
-
function getUnique(field) {
|
|
21
|
-
if (field && !(0, common_1.isNullOrUndefined)(field.unique_type)) {
|
|
22
|
-
return field.unique_type > 1;
|
|
23
|
-
}
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
exports.getUnique = getUnique;
|
|
27
|
-
function getCaseSensitive(field) {
|
|
28
|
-
if (field && !(0, common_1.isNullOrUndefined)(field.unique_type)) {
|
|
29
|
-
return [2, 4, 9].includes(field.unique_type);
|
|
30
|
-
}
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
exports.getCaseSensitive = getCaseSensitive;
|
|
34
|
-
function getMultiline(field) {
|
|
35
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.multiline)) {
|
|
36
|
-
return field.type.settings.multiline;
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
exports.getMultiline = getMultiline;
|
|
41
|
-
function getMaxLength(field) {
|
|
42
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.max_length)) {
|
|
43
|
-
return field.type.settings.max_length;
|
|
44
|
-
}
|
|
45
|
-
return 255;
|
|
46
|
-
}
|
|
47
|
-
exports.getMaxLength = getMaxLength;
|
|
48
|
-
function getRegexpExpression(field) {
|
|
49
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.regexp_expression)) {
|
|
50
|
-
return field.type.settings.regexp_expression;
|
|
51
|
-
}
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
exports.getRegexpExpression = getRegexpExpression;
|
|
55
|
-
function getRegexpErrMsg(field) {
|
|
56
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.regexp_err_msg)) {
|
|
57
|
-
return field.type.settings.regexp_err_msg;
|
|
58
|
-
}
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
exports.getRegexpErrMsg = getRegexpErrMsg;
|
|
62
|
-
function getDisplayAsPercentage(field) {
|
|
63
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.display_as_percentage)) {
|
|
64
|
-
return field.type.settings.display_as_percentage;
|
|
65
|
-
}
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
exports.getDisplayAsPercentage = getDisplayAsPercentage;
|
|
69
|
-
function getDecimalPlaces(field) {
|
|
70
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.decimal_places)) {
|
|
71
|
-
return field.type.settings.decimal_places;
|
|
72
|
-
}
|
|
73
|
-
return 0;
|
|
74
|
-
}
|
|
75
|
-
exports.getDecimalPlaces = getDecimalPlaces;
|
|
76
|
-
function getMultiple(field) {
|
|
77
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.is_array)) {
|
|
78
|
-
return field.type.settings.is_array;
|
|
79
|
-
}
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
exports.getMultiple = getMultiple;
|
|
83
|
-
// 开发者感知 custom, global
|
|
84
|
-
// 底层存储 local, global
|
|
85
|
-
function getOptionSource(field) {
|
|
86
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.option_type)) {
|
|
87
|
-
if (field.type.settings.option_type === 'local') {
|
|
88
|
-
return 'custom';
|
|
89
|
-
}
|
|
90
|
-
else if (field.type.settings.option_type === 'global') {
|
|
91
|
-
return 'global';
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return 'custom';
|
|
95
|
-
}
|
|
96
|
-
exports.getOptionSource = getOptionSource;
|
|
97
|
-
function getGlobalOptionApiName(field) {
|
|
98
|
-
if (field && field.type && field.type.settings && field.type.settings.related_to_global_option && !(0, common_1.isNullOrUndefined)(field.type.settings.related_to_global_option.apiName)) {
|
|
99
|
-
return field.type.settings.related_to_global_option.apiName;
|
|
100
|
-
}
|
|
101
|
-
return '';
|
|
102
|
-
}
|
|
103
|
-
exports.getGlobalOptionApiName = getGlobalOptionApiName;
|
|
104
|
-
function getOptionList(field) {
|
|
105
|
-
if (!field || !field.type || !field.type.settings || !field.type.settings.options || !Array.isArray(field.type.settings.options)) {
|
|
106
|
-
return [];
|
|
107
|
-
}
|
|
108
|
-
let options = [];
|
|
109
|
-
for (let option of field.type.settings.options) {
|
|
110
|
-
options.push({
|
|
111
|
-
label: option.name,
|
|
112
|
-
apiName: option.api_name,
|
|
113
|
-
description: option.description,
|
|
114
|
-
color: commonUtils.getColorNameById(option.color_id),
|
|
115
|
-
active: Number(option.active) === 1,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
return options;
|
|
119
|
-
}
|
|
120
|
-
exports.getOptionList = getOptionList;
|
|
121
|
-
function getOptionListV3(field) {
|
|
122
|
-
if (!field || !field.type || !field.type.settings || !field.type.settings.options || !Array.isArray(field.type.settings.options)) {
|
|
123
|
-
return [];
|
|
124
|
-
}
|
|
125
|
-
let options = [];
|
|
126
|
-
for (let option of field.type.settings.options) {
|
|
127
|
-
options.push({
|
|
128
|
-
label: (0, common_1.transI18nsToMultilingualV3)(option.name),
|
|
129
|
-
apiName: option.api_name,
|
|
130
|
-
description: (0, common_1.transI18nsToMultilingualV3)(option.description),
|
|
131
|
-
color: commonUtils.getColorNameById(option.color_id),
|
|
132
|
-
active: Number(option.active) === 1,
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
return options;
|
|
136
|
-
}
|
|
137
|
-
exports.getOptionListV3 = getOptionListV3;
|
|
138
|
-
function getDescriptionWhenTrue(field) {
|
|
139
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.description_if_true)) {
|
|
140
|
-
return field.type.settings.description_if_true;
|
|
141
|
-
}
|
|
142
|
-
return [];
|
|
143
|
-
}
|
|
144
|
-
exports.getDescriptionWhenTrue = getDescriptionWhenTrue;
|
|
145
|
-
function getDescriptionWhenFalse(field) {
|
|
146
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.description_if_false)) {
|
|
147
|
-
return field.type.settings.description_if_false;
|
|
148
|
-
}
|
|
149
|
-
return [];
|
|
150
|
-
}
|
|
151
|
-
exports.getDescriptionWhenFalse = getDescriptionWhenFalse;
|
|
152
|
-
function getDefaultValue(field) {
|
|
153
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.default_value)) {
|
|
154
|
-
return field.type.settings.default_value;
|
|
155
|
-
}
|
|
156
|
-
return false;
|
|
157
|
-
}
|
|
158
|
-
exports.getDefaultValue = getDefaultValue;
|
|
159
|
-
function getDisplayStyle(field) {
|
|
160
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.display_style)) {
|
|
161
|
-
return field.type.settings.display_style;
|
|
162
|
-
}
|
|
163
|
-
return 'square';
|
|
164
|
-
}
|
|
165
|
-
exports.getDisplayStyle = getDisplayStyle;
|
|
166
|
-
function getLookupRefObjectApiName(field) {
|
|
167
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.referenced_object_api_name)) {
|
|
168
|
-
return field.type.settings.referenced_object_api_name;
|
|
169
|
-
}
|
|
170
|
-
return '';
|
|
171
|
-
}
|
|
172
|
-
exports.getLookupRefObjectApiName = getLookupRefObjectApiName;
|
|
173
|
-
function getLookupIsHierarchy(field) {
|
|
174
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.is_hierarchy)) {
|
|
175
|
-
return field.type.settings.is_hierarchy;
|
|
176
|
-
}
|
|
177
|
-
return false;
|
|
178
|
-
}
|
|
179
|
-
exports.getLookupIsHierarchy = getLookupIsHierarchy;
|
|
180
|
-
// 'search'|'dropDown'|'tree'
|
|
181
|
-
function getLookupDisplayStyle(field) {
|
|
182
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.display_style)) {
|
|
183
|
-
return field.type.settings.display_style;
|
|
184
|
-
}
|
|
185
|
-
return 'dropDown';
|
|
186
|
-
}
|
|
187
|
-
exports.getLookupDisplayStyle = getLookupDisplayStyle;
|
|
188
|
-
function getReturnType(field) {
|
|
189
|
-
// TODO: check returnType to return_type
|
|
190
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.return_type)) {
|
|
191
|
-
return field.type.settings.return_type;
|
|
192
|
-
}
|
|
193
|
-
return '';
|
|
194
|
-
}
|
|
195
|
-
exports.getReturnType = getReturnType;
|
|
196
|
-
function getFormula(field) {
|
|
197
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.formulas)) {
|
|
198
|
-
return field.type.settings.formulas;
|
|
199
|
-
}
|
|
200
|
-
return [];
|
|
201
|
-
}
|
|
202
|
-
exports.getFormula = getFormula;
|
|
203
|
-
// 'random'|'incremental'
|
|
204
|
-
function getGenerateMethod(field) {
|
|
205
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.generation_method)) {
|
|
206
|
-
return field.type.settings.generation_method;
|
|
207
|
-
}
|
|
208
|
-
return 'random';
|
|
209
|
-
}
|
|
210
|
-
exports.getGenerateMethod = getGenerateMethod;
|
|
211
|
-
function getDigitsNumber(field) {
|
|
212
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.digits)) {
|
|
213
|
-
return field.type.settings.digits;
|
|
214
|
-
}
|
|
215
|
-
return 6;
|
|
216
|
-
}
|
|
217
|
-
exports.getDigitsNumber = getDigitsNumber;
|
|
218
|
-
function getPrefix(field) {
|
|
219
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.prefix)) {
|
|
220
|
-
return field.type.settings.prefix;
|
|
221
|
-
}
|
|
222
|
-
return '';
|
|
223
|
-
}
|
|
224
|
-
exports.getPrefix = getPrefix;
|
|
225
|
-
function getSuffix(field) {
|
|
226
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.suffix)) {
|
|
227
|
-
return field.type.settings.suffix;
|
|
228
|
-
}
|
|
229
|
-
return '';
|
|
230
|
-
}
|
|
231
|
-
exports.getSuffix = getSuffix;
|
|
232
|
-
function getReferenceObjectApiName(field) {
|
|
233
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.target_referenced_object_api_name)) {
|
|
234
|
-
return field.type.settings.target_referenced_object_api_name;
|
|
235
|
-
}
|
|
236
|
-
return '';
|
|
237
|
-
}
|
|
238
|
-
exports.getReferenceObjectApiName = getReferenceObjectApiName;
|
|
239
|
-
function getReferenceFieldApiName(field) {
|
|
240
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.target_reference_field_api_name)) {
|
|
241
|
-
return field.type.settings.target_reference_field_api_name;
|
|
242
|
-
}
|
|
243
|
-
return '';
|
|
244
|
-
}
|
|
245
|
-
exports.getReferenceFieldApiName = getReferenceFieldApiName;
|
|
246
|
-
function getFileMultiple(field) {
|
|
247
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.multiple)) {
|
|
248
|
-
return field.type.settings.multiple;
|
|
249
|
-
}
|
|
250
|
-
return false;
|
|
251
|
-
}
|
|
252
|
-
exports.getFileMultiple = getFileMultiple;
|
|
253
|
-
function getFileTypes(field) {
|
|
254
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.mime_types)) {
|
|
255
|
-
return field.type.settings.mime_types;
|
|
256
|
-
}
|
|
257
|
-
return [];
|
|
258
|
-
}
|
|
259
|
-
exports.getFileTypes = getFileTypes;
|
|
260
|
-
function getBackLookupObjectApiName(field) {
|
|
261
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.related_to_object_api_name)) {
|
|
262
|
-
return field.type.settings.related_to_object_api_name;
|
|
263
|
-
}
|
|
264
|
-
return '';
|
|
265
|
-
}
|
|
266
|
-
exports.getBackLookupObjectApiName = getBackLookupObjectApiName;
|
|
267
|
-
function getBackLookupFieldApiName(field) {
|
|
268
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.related_to_field_api_name)) {
|
|
269
|
-
return field.type.settings.related_to_field_api_name;
|
|
270
|
-
}
|
|
271
|
-
return '';
|
|
272
|
-
}
|
|
273
|
-
exports.getBackLookupFieldApiName = getBackLookupFieldApiName;
|
|
274
|
-
function getSettingsMultiple(field) {
|
|
275
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.multiple)) {
|
|
276
|
-
return field.type.settings.multiple;
|
|
277
|
-
}
|
|
278
|
-
return false;
|
|
279
|
-
}
|
|
280
|
-
exports.getSettingsMultiple = getSettingsMultiple;
|
|
281
|
-
function getCompositeTypeApiName(field) {
|
|
282
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.related_to_api_name)) {
|
|
283
|
-
return field.type.settings.related_to_api_name;
|
|
284
|
-
}
|
|
285
|
-
return '';
|
|
286
|
-
}
|
|
287
|
-
exports.getCompositeTypeApiName = getCompositeTypeApiName;
|
|
288
|
-
function getCompositeTypeSubFields(field) {
|
|
289
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.related_to_fields)) {
|
|
290
|
-
return field.type.settings.related_to_fields;
|
|
291
|
-
}
|
|
292
|
-
return [];
|
|
293
|
-
}
|
|
294
|
-
exports.getCompositeTypeSubFields = getCompositeTypeSubFields;
|
|
295
|
-
// TODO 结构转换
|
|
296
|
-
function getSettingsFilter(field) {
|
|
297
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.filter)) {
|
|
298
|
-
return field.type.settings.filter;
|
|
299
|
-
}
|
|
300
|
-
return [];
|
|
301
|
-
}
|
|
302
|
-
exports.getSettingsFilter = getSettingsFilter;
|
|
303
|
-
function getSettingsFilterV3(field) {
|
|
304
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.filter)) {
|
|
305
|
-
return field.type.settings.filter;
|
|
306
|
-
}
|
|
307
|
-
return [];
|
|
308
|
-
}
|
|
309
|
-
exports.getSettingsFilterV3 = getSettingsFilterV3;
|
|
310
|
-
function getRegionSettingsFilter(field) {
|
|
311
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.filter)) {
|
|
312
|
-
return field.type.settings.filter;
|
|
313
|
-
}
|
|
314
|
-
return [];
|
|
315
|
-
}
|
|
316
|
-
exports.getRegionSettingsFilter = getRegionSettingsFilter;
|
|
317
|
-
function getRegionSettingsFilterV3(field) {
|
|
318
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.filter)) {
|
|
319
|
-
const res = field.type.settings.filter.map(s => {
|
|
320
|
-
let f = s;
|
|
321
|
-
const tmp = {
|
|
322
|
-
id: f.id,
|
|
323
|
-
label: f.label,
|
|
324
|
-
errorMessage: (0, common_1.transI18nsToMultilingualV3)(f.errorMessage),
|
|
325
|
-
recordFilter: f.recordFilter,
|
|
326
|
-
precondition: f.precondition,
|
|
327
|
-
};
|
|
328
|
-
return tmp;
|
|
329
|
-
});
|
|
330
|
-
return res;
|
|
331
|
-
}
|
|
332
|
-
return [];
|
|
333
|
-
}
|
|
334
|
-
exports.getRegionSettingsFilterV3 = getRegionSettingsFilterV3;
|
|
335
|
-
// TODO 结构转换
|
|
336
|
-
function getSettingsSort(field) {
|
|
337
|
-
let res = [];
|
|
338
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.sort)) {
|
|
339
|
-
for (const s of field.type.settings.sort) {
|
|
340
|
-
res.push(({
|
|
341
|
-
fieldApiName: s.field,
|
|
342
|
-
sort: s.direction,
|
|
343
|
-
}));
|
|
344
|
-
}
|
|
345
|
-
return res;
|
|
346
|
-
}
|
|
347
|
-
return [];
|
|
348
|
-
}
|
|
349
|
-
exports.getSettingsSort = getSettingsSort;
|
|
350
|
-
function getRecordPosition(field) {
|
|
351
|
-
let pos = 1;
|
|
352
|
-
if (field && field.type && field.type.settings && !(0, common_1.isNullOrUndefined)(field.type.settings.filter_record)) {
|
|
353
|
-
// first, last, specified
|
|
354
|
-
switch (field.type.settings.filter_record.type) {
|
|
355
|
-
case 'first':
|
|
356
|
-
pos = 1;
|
|
357
|
-
break;
|
|
358
|
-
case 'last':
|
|
359
|
-
pos = -1;
|
|
360
|
-
break;
|
|
361
|
-
case 'specified':
|
|
362
|
-
pos = field.type.settings.filter_record.index;
|
|
363
|
-
break;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
return pos;
|
|
367
|
-
}
|
|
368
|
-
exports.getRecordPosition = getRecordPosition;
|
|
369
|
-
function getRollupType(field) {
|
|
370
|
-
if (field && field.type && field.type.settings && field.type.settings.rollup_function_type) {
|
|
371
|
-
return field.type.settings.rollup_function_type;
|
|
372
|
-
}
|
|
373
|
-
return "";
|
|
374
|
-
}
|
|
375
|
-
exports.getRollupType = getRollupType;
|
|
376
|
-
function getRollupObjectApiName(field) {
|
|
377
|
-
if (field && field.type && field.type.settings && field.type.settings.rolluped_object && field.type.settings.rolluped_object.api_alias) {
|
|
378
|
-
return field.type.settings.rolluped_object.api_alias;
|
|
379
|
-
}
|
|
380
|
-
return "";
|
|
381
|
-
}
|
|
382
|
-
exports.getRollupObjectApiName = getRollupObjectApiName;
|
|
383
|
-
function getRollupFieldApiName(field) {
|
|
384
|
-
if (field && field.type && field.type.settings && field.type.settings.rolluped_field && field.type.settings.rolluped_field.api_alias) {
|
|
385
|
-
return field.type.settings.rolluped_field.api_alias;
|
|
386
|
-
}
|
|
387
|
-
return "";
|
|
388
|
-
}
|
|
389
|
-
exports.getRollupFieldApiName = getRollupFieldApiName;
|
|
390
|
-
function getRollupLookupFieldApiName(field) {
|
|
391
|
-
if (field && field.type && field.type.settings && field.type.settings.rolluped_lookup_field && field.type.settings.rolluped_lookup_field.api_alias) {
|
|
392
|
-
return field.type.settings.rolluped_lookup_field.api_alias;
|
|
393
|
-
}
|
|
394
|
-
return "";
|
|
395
|
-
}
|
|
396
|
-
exports.getRollupLookupFieldApiName = getRollupLookupFieldApiName;
|
|
397
|
-
function getRegionOptionLevel(field) {
|
|
398
|
-
if (field && field.type && field.type.settings && field.type.settings.hasLevelStrict) {
|
|
399
|
-
return field.type.settings.hasLevelStrict;
|
|
400
|
-
}
|
|
401
|
-
return undefined;
|
|
402
|
-
}
|
|
403
|
-
exports.getRegionOptionLevel = getRegionOptionLevel;
|
|
404
|
-
function getRegionStrictLeve(field) {
|
|
405
|
-
if (field && field.type && field.type.settings && field.type.settings.strictLevel) {
|
|
406
|
-
return field.type.settings.strictLevel;
|
|
407
|
-
}
|
|
408
|
-
return undefined;
|
|
409
|
-
}
|
|
410
|
-
exports.getRegionStrictLeve = getRegionStrictLeve;
|
|
411
|
-
function getRollupFilter(field) {
|
|
412
|
-
if (field && field.type && field.type.settings && field.type.settings.rollup_range_filter) {
|
|
413
|
-
return {
|
|
414
|
-
conditions: field.type.settings.rollup_range_filter.conditions,
|
|
415
|
-
logic: field.type.settings.rollup_range_filter.logic
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
return undefined;
|
|
419
|
-
}
|
|
420
|
-
exports.getRollupFilter = getRollupFilter;
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { BaseFieldType, CriterionType, FieldType, FilterType, SortConditionType } from '../types/objects';
|
|
2
|
-
import { MultilingualTypeV3 } from '../types/common';
|
|
3
|
-
import { FilterTypeV3, RegionFilterTypeV3, SubOptionTypeV3 } from '../types/objectsV3';
|
|
4
|
-
declare class MetadataFieldV3 {
|
|
5
|
-
type: string;
|
|
6
|
-
apiName: string;
|
|
7
|
-
label: MultilingualTypeV3;
|
|
8
|
-
constructor(type: string, field: FieldType);
|
|
9
|
-
}
|
|
10
|
-
declare class KTextV3 extends MetadataFieldV3 {
|
|
11
|
-
required: boolean;
|
|
12
|
-
unique: boolean;
|
|
13
|
-
caseSensitive: boolean;
|
|
14
|
-
multiline: boolean;
|
|
15
|
-
maxLength: number;
|
|
16
|
-
validationRegex: string;
|
|
17
|
-
errorMsg: MultilingualTypeV3;
|
|
18
|
-
constructor(field: FieldType);
|
|
19
|
-
}
|
|
20
|
-
declare class RichTextV3 extends MetadataFieldV3 {
|
|
21
|
-
maxLength: number;
|
|
22
|
-
required: boolean;
|
|
23
|
-
constructor(field: FieldType);
|
|
24
|
-
}
|
|
25
|
-
declare class MultilingualV3 extends MetadataFieldV3 {
|
|
26
|
-
required: boolean;
|
|
27
|
-
unique: boolean;
|
|
28
|
-
caseSensitive: boolean;
|
|
29
|
-
multiline: boolean;
|
|
30
|
-
maxLength: number;
|
|
31
|
-
constructor(field: FieldType);
|
|
32
|
-
}
|
|
33
|
-
declare class NumberV3 extends MetadataFieldV3 {
|
|
34
|
-
required: boolean;
|
|
35
|
-
unique: boolean;
|
|
36
|
-
displayAsPercentage: boolean;
|
|
37
|
-
decimalPlacesNumber: number;
|
|
38
|
-
constructor(field: FieldType);
|
|
39
|
-
}
|
|
40
|
-
declare class BigintV3 extends MetadataFieldV3 {
|
|
41
|
-
required: boolean;
|
|
42
|
-
unique: boolean;
|
|
43
|
-
constructor(field: FieldType);
|
|
44
|
-
}
|
|
45
|
-
declare class DecimalV3 extends MetadataFieldV3 {
|
|
46
|
-
required: boolean;
|
|
47
|
-
unique: boolean;
|
|
48
|
-
displayAsPercentage: boolean;
|
|
49
|
-
decimalPlacesNumber: number;
|
|
50
|
-
constructor(field: FieldType);
|
|
51
|
-
}
|
|
52
|
-
declare class KDateV3 extends MetadataFieldV3 {
|
|
53
|
-
required: boolean;
|
|
54
|
-
constructor(field: FieldType);
|
|
55
|
-
}
|
|
56
|
-
declare class DateTimeV3 extends MetadataFieldV3 {
|
|
57
|
-
required: boolean;
|
|
58
|
-
constructor(field: FieldType);
|
|
59
|
-
}
|
|
60
|
-
declare class OptionV3 extends MetadataFieldV3 {
|
|
61
|
-
required: boolean;
|
|
62
|
-
multiple: boolean;
|
|
63
|
-
optionSource: ('custom' | 'global');
|
|
64
|
-
globalOptionApiName: string;
|
|
65
|
-
optionList: SubOptionTypeV3[];
|
|
66
|
-
constructor(field: FieldType);
|
|
67
|
-
}
|
|
68
|
-
declare class EmailV3 extends MetadataFieldV3 {
|
|
69
|
-
required: boolean;
|
|
70
|
-
unique: boolean;
|
|
71
|
-
constructor(field: FieldType);
|
|
72
|
-
}
|
|
73
|
-
declare class MobileNumberV3 extends MetadataFieldV3 {
|
|
74
|
-
required: boolean;
|
|
75
|
-
unique: boolean;
|
|
76
|
-
constructor(field: FieldType);
|
|
77
|
-
}
|
|
78
|
-
declare class BooleanV3 extends MetadataFieldV3 {
|
|
79
|
-
descriptionWhenTrue: MultilingualTypeV3;
|
|
80
|
-
descriptionWhenFalse: MultilingualTypeV3;
|
|
81
|
-
defaultValue: boolean;
|
|
82
|
-
unique: boolean;
|
|
83
|
-
constructor(field: FieldType);
|
|
84
|
-
}
|
|
85
|
-
declare class AvatarOrLogoV3 extends MetadataFieldV3 {
|
|
86
|
-
displayStyle: ('square' | 'round');
|
|
87
|
-
constructor(field: FieldType);
|
|
88
|
-
}
|
|
89
|
-
declare class LookupV3 extends MetadataFieldV3 {
|
|
90
|
-
required: boolean;
|
|
91
|
-
multiple: boolean;
|
|
92
|
-
objectApiName: string;
|
|
93
|
-
hierarchy: boolean;
|
|
94
|
-
displayStyle: ('search' | 'dropDown' | 'tree');
|
|
95
|
-
sortConditions: SortConditionType[];
|
|
96
|
-
filter: FilterType[];
|
|
97
|
-
constructor(field: FieldType);
|
|
98
|
-
}
|
|
99
|
-
declare class FormulaV3 extends MetadataFieldV3 {
|
|
100
|
-
returnType: string;
|
|
101
|
-
formula: MultilingualTypeV3;
|
|
102
|
-
constructor(field: FieldType);
|
|
103
|
-
}
|
|
104
|
-
declare class AutoIDV3 extends MetadataFieldV3 {
|
|
105
|
-
generateMethod: ('random' | 'incremental');
|
|
106
|
-
digitsNumber: number;
|
|
107
|
-
prefix: string;
|
|
108
|
-
suffix: string;
|
|
109
|
-
constructor(field: FieldType);
|
|
110
|
-
}
|
|
111
|
-
declare class ReferenceFieldV3 extends MetadataFieldV3 {
|
|
112
|
-
guideFieldApiName: string;
|
|
113
|
-
fieldApiName: string;
|
|
114
|
-
constructor(field: FieldType);
|
|
115
|
-
}
|
|
116
|
-
declare class RollupV3 extends MetadataFieldV3 {
|
|
117
|
-
rollupType: string;
|
|
118
|
-
rollupObjectApiName: string;
|
|
119
|
-
rollupFieldApiName: string;
|
|
120
|
-
rollupLookupFieldApiName: string;
|
|
121
|
-
filter: CriterionType;
|
|
122
|
-
constructor(field: FieldType);
|
|
123
|
-
}
|
|
124
|
-
declare class RegionV3 extends MetadataFieldV3 {
|
|
125
|
-
required: boolean;
|
|
126
|
-
multiple: boolean;
|
|
127
|
-
optionLevel: boolean;
|
|
128
|
-
strictLevel: number;
|
|
129
|
-
filter: RegionFilterTypeV3[];
|
|
130
|
-
constructor(field: FieldType);
|
|
131
|
-
}
|
|
132
|
-
declare class FileV3 extends MetadataFieldV3 {
|
|
133
|
-
required: boolean;
|
|
134
|
-
multiple: boolean;
|
|
135
|
-
fileTypes: string[];
|
|
136
|
-
constructor(field: FieldType);
|
|
137
|
-
}
|
|
138
|
-
declare class BackLookupV3 extends MetadataFieldV3 {
|
|
139
|
-
constructor(field: FieldType);
|
|
140
|
-
}
|
|
141
|
-
declare class CompositeTypeV3 extends MetadataFieldV3 {
|
|
142
|
-
compositeTypeApiName: string;
|
|
143
|
-
subFields: BaseFieldType[];
|
|
144
|
-
required: boolean;
|
|
145
|
-
multiple: boolean;
|
|
146
|
-
constructor(field: FieldType);
|
|
147
|
-
}
|
|
148
|
-
declare class ExtractSingleRecordV3 extends MetadataFieldV3 {
|
|
149
|
-
compositeTypeApiName: string;
|
|
150
|
-
subFields: BaseFieldType[];
|
|
151
|
-
filter: FilterTypeV3[];
|
|
152
|
-
sortConditions: SortConditionType[];
|
|
153
|
-
recordPosition: number;
|
|
154
|
-
constructor(field: FieldType);
|
|
155
|
-
}
|
|
156
|
-
declare function parseFieldsV3(inputFields: Record<string, any>): BaseFieldType[];
|
|
157
|
-
declare function parseFieldV3(field: FieldType): BaseFieldType;
|
|
158
|
-
declare function getFieldClassV3(field: FieldType): any;
|
|
159
|
-
export { KTextV3 as TextV3, MultilingualV3, NumberV3, KDateV3 as DateV3, DateTimeV3, OptionV3, EmailV3, MobileNumberV3, BooleanV3, AvatarOrLogoV3, LookupV3, FormulaV3, AutoIDV3, ReferenceFieldV3, FileV3, BackLookupV3, CompositeTypeV3, ExtractSingleRecordV3, RichTextV3, BigintV3, DecimalV3, RegionV3, RollupV3, parseFieldsV3, parseFieldV3, getFieldClassV3, };
|