@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,369 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2022 ByteDance Ltd. and/or its affiliates
|
|
3
|
-
// SPDX-License-Identifier: MIT
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.getFieldClass = exports.parseField = exports.parseFields = exports.Rollup = exports.Region = exports.Decimal = exports.Bigint = exports.RichText = exports.ExtractSingleRecord = exports.CompositeType = exports.BackLookup = exports.File = exports.ReferenceField = exports.AutoID = exports.Formula = exports.Lookup = exports.AvatarOrLogo = exports.Boolean = exports.MobileNumber = exports.Email = exports.Option = exports.DateTime = exports.Date = exports.Number = exports.Multilingual = exports.Text = void 0;
|
|
6
|
-
const fieldsUtil = require("./fields.util");
|
|
7
|
-
class MetadataField {
|
|
8
|
-
constructor(type, field) {
|
|
9
|
-
this.type = type;
|
|
10
|
-
this.apiName = field.api_name;
|
|
11
|
-
this.label = field.label;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
class KText extends MetadataField {
|
|
15
|
-
constructor(field) {
|
|
16
|
-
if (!field) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
super('text', field);
|
|
20
|
-
this.required = field.required;
|
|
21
|
-
this.unique = fieldsUtil.getUnique(field);
|
|
22
|
-
this.caseSensitive = fieldsUtil.getCaseSensitive(field);
|
|
23
|
-
this.multiline = fieldsUtil.getMultiline(field);
|
|
24
|
-
this.maxLength = fieldsUtil.getMaxLength(field);
|
|
25
|
-
this.validationRegex = fieldsUtil.getRegexpExpression(field);
|
|
26
|
-
this.errorMsg = fieldsUtil.getRegexpErrMsg(field);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.Text = KText;
|
|
30
|
-
class RichText extends MetadataField {
|
|
31
|
-
constructor(field) {
|
|
32
|
-
if (!field) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
super('richText', field);
|
|
36
|
-
this.maxLength = fieldsUtil.getMaxLength(field);
|
|
37
|
-
this.required = field.required;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.RichText = RichText;
|
|
41
|
-
class Multilingual extends MetadataField {
|
|
42
|
-
constructor(field) {
|
|
43
|
-
if (!field) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
super('multilingual', field);
|
|
47
|
-
this.required = field.required;
|
|
48
|
-
this.unique = fieldsUtil.getUnique(field);
|
|
49
|
-
this.caseSensitive = fieldsUtil.getCaseSensitive(field);
|
|
50
|
-
this.multiline = fieldsUtil.getMultiline(field);
|
|
51
|
-
this.maxLength = fieldsUtil.getMaxLength(field);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.Multilingual = Multilingual;
|
|
55
|
-
class Number extends MetadataField {
|
|
56
|
-
constructor(field) {
|
|
57
|
-
if (!field) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
super('number', field);
|
|
61
|
-
this.required = field.required;
|
|
62
|
-
this.unique = fieldsUtil.getUnique(field);
|
|
63
|
-
this.displayAsPercentage = fieldsUtil.getDisplayAsPercentage(field);
|
|
64
|
-
this.decimalPlacesNumber = fieldsUtil.getDecimalPlaces(field);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.Number = Number;
|
|
68
|
-
class Bigint extends MetadataField {
|
|
69
|
-
constructor(field) {
|
|
70
|
-
if (!field) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
super('bigint', field);
|
|
74
|
-
this.required = field.required;
|
|
75
|
-
this.unique = fieldsUtil.getUnique(field);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
exports.Bigint = Bigint;
|
|
79
|
-
class Decimal extends MetadataField {
|
|
80
|
-
constructor(field) {
|
|
81
|
-
if (!field) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
super('decimal', field);
|
|
85
|
-
this.required = field.required;
|
|
86
|
-
this.unique = fieldsUtil.getUnique(field);
|
|
87
|
-
this.displayAsPercentage = fieldsUtil.getDisplayAsPercentage(field);
|
|
88
|
-
this.decimalPlacesNumber = fieldsUtil.getDecimalPlaces(field);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.Decimal = Decimal;
|
|
92
|
-
class KDate extends MetadataField {
|
|
93
|
-
constructor(field) {
|
|
94
|
-
if (!field) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
super('date', field);
|
|
98
|
-
this.required = field.required;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
exports.Date = KDate;
|
|
102
|
-
class DateTime extends MetadataField {
|
|
103
|
-
constructor(field) {
|
|
104
|
-
if (!field) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
super('dateTime', field);
|
|
108
|
-
this.required = field.required;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
exports.DateTime = DateTime;
|
|
112
|
-
class Option extends MetadataField {
|
|
113
|
-
constructor(field) {
|
|
114
|
-
if (!field) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
super('option', field);
|
|
118
|
-
this.required = field.required;
|
|
119
|
-
this.multiple = fieldsUtil.getMultiple(field);
|
|
120
|
-
this.optionSource = fieldsUtil.getOptionSource(field);
|
|
121
|
-
this.globalOptionApiName = fieldsUtil.getGlobalOptionApiName(field);
|
|
122
|
-
this.optionList = fieldsUtil.getOptionList(field);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
exports.Option = Option;
|
|
126
|
-
class Email extends MetadataField {
|
|
127
|
-
constructor(field) {
|
|
128
|
-
if (!field) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
super('email', field);
|
|
132
|
-
this.required = field.required;
|
|
133
|
-
this.unique = fieldsUtil.getUnique(field);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
exports.Email = Email;
|
|
137
|
-
class MobileNumber extends MetadataField {
|
|
138
|
-
constructor(field) {
|
|
139
|
-
if (!field) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
super('mobileNumber', field);
|
|
143
|
-
this.required = field.required;
|
|
144
|
-
this.unique = fieldsUtil.getUnique(field);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
exports.MobileNumber = MobileNumber;
|
|
148
|
-
class Boolean extends MetadataField {
|
|
149
|
-
constructor(field) {
|
|
150
|
-
if (!field) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
super('boolean', field);
|
|
154
|
-
this.unique = fieldsUtil.getUnique(field);
|
|
155
|
-
this.descriptionWhenTrue = fieldsUtil.getDescriptionWhenTrue(field);
|
|
156
|
-
this.descriptionWhenFalse = fieldsUtil.getDescriptionWhenFalse(field);
|
|
157
|
-
this.defaultValue = fieldsUtil.getDefaultValue(field);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
exports.Boolean = Boolean;
|
|
161
|
-
class AvatarOrLogo extends MetadataField {
|
|
162
|
-
constructor(field) {
|
|
163
|
-
if (!field) {
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
super('avatarOrLogo', field);
|
|
167
|
-
this.displayStyle = fieldsUtil.getDisplayStyle(field);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
exports.AvatarOrLogo = AvatarOrLogo;
|
|
171
|
-
class Lookup extends MetadataField {
|
|
172
|
-
constructor(field) {
|
|
173
|
-
if (!field) {
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
super('lookup', field);
|
|
177
|
-
this.required = field.required;
|
|
178
|
-
this.multiple = fieldsUtil.getMultiple(field);
|
|
179
|
-
this.objectApiName = fieldsUtil.getLookupRefObjectApiName(field);
|
|
180
|
-
this.hierarchy = fieldsUtil.getLookupIsHierarchy(field);
|
|
181
|
-
this.displayStyle = fieldsUtil.getLookupDisplayStyle(field);
|
|
182
|
-
// TODO
|
|
183
|
-
this.sortConditions = fieldsUtil.getSettingsSort(field);
|
|
184
|
-
this.filter = [];
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
exports.Lookup = Lookup;
|
|
188
|
-
class Formula extends MetadataField {
|
|
189
|
-
constructor(field) {
|
|
190
|
-
if (!field) {
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
super('formula', field);
|
|
194
|
-
this.returnType = fieldsUtil.getReturnType(field);
|
|
195
|
-
// TODO 由于下游提供仍是 api ID 版本,因此禁用
|
|
196
|
-
this.formula = null; //fieldsUtil.getFormula(field);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
exports.Formula = Formula;
|
|
200
|
-
class AutoID extends MetadataField {
|
|
201
|
-
constructor(field) {
|
|
202
|
-
if (!field) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
super('autoId', field);
|
|
206
|
-
this.generateMethod = fieldsUtil.getGenerateMethod(field);
|
|
207
|
-
this.digitsNumber = fieldsUtil.getDigitsNumber(field);
|
|
208
|
-
this.prefix = fieldsUtil.getPrefix(field);
|
|
209
|
-
this.suffix = fieldsUtil.getSuffix(field);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
exports.AutoID = AutoID;
|
|
213
|
-
class ReferenceField extends MetadataField {
|
|
214
|
-
constructor(field) {
|
|
215
|
-
if (!field) {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
super('referenceField', field);
|
|
219
|
-
// TODO: check objectApiName to guideFieldApiName
|
|
220
|
-
this.guideFieldApiName = fieldsUtil.getReferenceObjectApiName(field);
|
|
221
|
-
this.fieldApiName = fieldsUtil.getReferenceFieldApiName(field);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
exports.ReferenceField = ReferenceField;
|
|
225
|
-
class Rollup extends MetadataField {
|
|
226
|
-
constructor(field) {
|
|
227
|
-
if (!field) {
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
super('rollup', field);
|
|
231
|
-
this.rollupType = fieldsUtil.getRollupType(field);
|
|
232
|
-
this.rollupObjectApiName = fieldsUtil.getRollupObjectApiName(field);
|
|
233
|
-
this.rollupFieldApiName = fieldsUtil.getRollupFieldApiName(field);
|
|
234
|
-
this.rollupLookupFieldApiName = fieldsUtil.getRollupLookupFieldApiName(field);
|
|
235
|
-
this.filter = fieldsUtil.getRollupFilter(field);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
exports.Rollup = Rollup;
|
|
239
|
-
class Region extends MetadataField {
|
|
240
|
-
constructor(field) {
|
|
241
|
-
if (!field) {
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
super('region', field);
|
|
245
|
-
this.required = field.required;
|
|
246
|
-
this.multiple = fieldsUtil.getSettingsMultiple(field);
|
|
247
|
-
this.optionLevel = fieldsUtil.getRegionOptionLevel(field);
|
|
248
|
-
this.strictLevel = fieldsUtil.getRegionStrictLeve(field);
|
|
249
|
-
this.filter = fieldsUtil.getRegionSettingsFilter(field);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
exports.Region = Region;
|
|
253
|
-
class File extends MetadataField {
|
|
254
|
-
constructor(field) {
|
|
255
|
-
if (!field) {
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
super('file', field);
|
|
259
|
-
this.required = field.required;
|
|
260
|
-
this.multiple = fieldsUtil.getFileMultiple(field);
|
|
261
|
-
this.fileTypes = fieldsUtil.getFileTypes(field);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
exports.File = File;
|
|
265
|
-
class BackLookup extends MetadataField {
|
|
266
|
-
// objectApiName: string; // TODO 由于下游提供仍是 api ID 版本,因此禁用
|
|
267
|
-
// fieldApiName: string; // 由于下游提供仍是 api ID 版本,因此禁用
|
|
268
|
-
constructor(field) {
|
|
269
|
-
if (!field) {
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
super('backLookup', field);
|
|
273
|
-
// TODO 由于下游提供仍是 api ID 版本,因此禁用
|
|
274
|
-
// this.objectApiName = fieldsUtil.getBackLookupObjectApiName(field);
|
|
275
|
-
// this.fieldApiName = fieldsUtil.getBackLookupFieldApiName(field); // TODO metadata返回值为空
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
exports.BackLookup = BackLookup;
|
|
279
|
-
class CompositeType extends MetadataField {
|
|
280
|
-
constructor(field) {
|
|
281
|
-
if (!field) {
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
super('compositeType', field);
|
|
285
|
-
this.required = field.required;
|
|
286
|
-
this.multiple = fieldsUtil.getSettingsMultiple(field);
|
|
287
|
-
this.compositeTypeApiName = fieldsUtil.getCompositeTypeApiName(field);
|
|
288
|
-
// TODO 字段类型转换
|
|
289
|
-
this.subFields = parseFields(fieldsUtil.getCompositeTypeSubFields(field));
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
exports.CompositeType = CompositeType;
|
|
293
|
-
class ExtractSingleRecord extends MetadataField {
|
|
294
|
-
constructor(field) {
|
|
295
|
-
if (!field) {
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
super('extractSingleRecord', field);
|
|
299
|
-
this.compositeTypeApiName = fieldsUtil.getCompositeTypeApiName(field);
|
|
300
|
-
// TODO 字段类型转换
|
|
301
|
-
this.subFields = parseFields(fieldsUtil.getCompositeTypeSubFields(field));
|
|
302
|
-
this.filter = fieldsUtil.getSettingsFilter(field);
|
|
303
|
-
this.sortConditions = fieldsUtil.getSettingsSort(field);
|
|
304
|
-
this.recordPosition = fieldsUtil.getRecordPosition(field);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
exports.ExtractSingleRecord = ExtractSingleRecord;
|
|
308
|
-
function getCompositeTypeClass(field) {
|
|
309
|
-
if (field && field.type && field.type.settings && field.type.settings.is_extract) {
|
|
310
|
-
return ExtractSingleRecord;
|
|
311
|
-
}
|
|
312
|
-
return CompositeType;
|
|
313
|
-
}
|
|
314
|
-
function parseFields(inputFields) {
|
|
315
|
-
if (!inputFields || !Array.isArray(inputFields)) {
|
|
316
|
-
return [];
|
|
317
|
-
}
|
|
318
|
-
let fields = [];
|
|
319
|
-
for (let field of inputFields) {
|
|
320
|
-
let FieldClass = getFieldClass(field);
|
|
321
|
-
if (!FieldClass) {
|
|
322
|
-
continue;
|
|
323
|
-
}
|
|
324
|
-
fields.push(new FieldClass(field));
|
|
325
|
-
}
|
|
326
|
-
return fields;
|
|
327
|
-
}
|
|
328
|
-
exports.parseFields = parseFields;
|
|
329
|
-
function parseField(field) {
|
|
330
|
-
let FieldClass = getFieldClass(field);
|
|
331
|
-
if (FieldClass) {
|
|
332
|
-
return new FieldClass(field);
|
|
333
|
-
}
|
|
334
|
-
return null;
|
|
335
|
-
}
|
|
336
|
-
exports.parseField = parseField;
|
|
337
|
-
function getFieldClass(field) {
|
|
338
|
-
if (field && field.type && field.type.name) {
|
|
339
|
-
if (field.type.name === 'compositeType') {
|
|
340
|
-
return getCompositeTypeClass(field);
|
|
341
|
-
}
|
|
342
|
-
return type2fieldType[field.type.name];
|
|
343
|
-
}
|
|
344
|
-
return null;
|
|
345
|
-
}
|
|
346
|
-
exports.getFieldClass = getFieldClass;
|
|
347
|
-
const type2fieldType = {
|
|
348
|
-
'text': KText,
|
|
349
|
-
'multilingual': Multilingual,
|
|
350
|
-
'float': Number,
|
|
351
|
-
'date': KDate,
|
|
352
|
-
'datetime': DateTime,
|
|
353
|
-
'enum': Option,
|
|
354
|
-
'email': Email,
|
|
355
|
-
'phone': MobileNumber,
|
|
356
|
-
'boolean': Boolean,
|
|
357
|
-
'avatar': AvatarOrLogo,
|
|
358
|
-
'lookup': Lookup,
|
|
359
|
-
'formula': Formula,
|
|
360
|
-
'auto_number': AutoID,
|
|
361
|
-
'reference_field': ReferenceField,
|
|
362
|
-
'attachment': File,
|
|
363
|
-
'back_lookup': BackLookup,
|
|
364
|
-
'richText': RichText,
|
|
365
|
-
'bigint': Bigint,
|
|
366
|
-
'decimal': Decimal,
|
|
367
|
-
'rollup': Rollup,
|
|
368
|
-
'region': Region,
|
|
369
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { CriterionType, FieldType, FilterType, RegionFilterType, SortConditionType, SubOptionType } from '../types/objects';
|
|
2
|
-
import { I18ns } from '../types/common';
|
|
3
|
-
import { FilterTypeV3, RegionFilterTypeV3, SubOptionTypeV3 } from '../types/objectsV3';
|
|
4
|
-
declare function getUnique(field: FieldType): boolean;
|
|
5
|
-
declare function getCaseSensitive(field: FieldType): boolean;
|
|
6
|
-
declare function getMultiline(field: FieldType): boolean;
|
|
7
|
-
declare function getMaxLength(field: FieldType): number;
|
|
8
|
-
declare function getRegexpExpression(field: FieldType): string;
|
|
9
|
-
declare function getRegexpErrMsg(field: FieldType): I18ns;
|
|
10
|
-
declare function getDisplayAsPercentage(field: FieldType): boolean;
|
|
11
|
-
declare function getDecimalPlaces(field: FieldType): number;
|
|
12
|
-
declare function getMultiple(field: FieldType): boolean;
|
|
13
|
-
declare function getOptionSource(field: FieldType): ('custom' | 'global');
|
|
14
|
-
declare function getGlobalOptionApiName(field: FieldType): string;
|
|
15
|
-
declare function getOptionList(field: FieldType): SubOptionType[];
|
|
16
|
-
declare function getOptionListV3(field: FieldType): SubOptionTypeV3[];
|
|
17
|
-
declare function getDescriptionWhenTrue(field: FieldType): I18ns;
|
|
18
|
-
declare function getDescriptionWhenFalse(field: FieldType): I18ns;
|
|
19
|
-
declare function getDefaultValue(field: FieldType): boolean;
|
|
20
|
-
declare function getDisplayStyle(field: FieldType): string;
|
|
21
|
-
declare function getLookupRefObjectApiName(field: FieldType): string;
|
|
22
|
-
declare function getLookupIsHierarchy(field: FieldType): boolean;
|
|
23
|
-
declare function getLookupDisplayStyle(field: FieldType): string;
|
|
24
|
-
declare function getReturnType(field: FieldType): string;
|
|
25
|
-
declare function getFormula(field: FieldType): I18ns;
|
|
26
|
-
declare function getGenerateMethod(field: FieldType): string;
|
|
27
|
-
declare function getDigitsNumber(field: FieldType): number;
|
|
28
|
-
declare function getPrefix(field: FieldType): string;
|
|
29
|
-
declare function getSuffix(field: FieldType): string;
|
|
30
|
-
declare function getReferenceObjectApiName(field: FieldType): string;
|
|
31
|
-
declare function getReferenceFieldApiName(field: FieldType): string;
|
|
32
|
-
declare function getFileMultiple(field: FieldType): boolean;
|
|
33
|
-
declare function getFileTypes(field: FieldType): string[];
|
|
34
|
-
declare function getBackLookupObjectApiName(field: FieldType): string;
|
|
35
|
-
declare function getBackLookupFieldApiName(field: FieldType): string;
|
|
36
|
-
declare function getSettingsMultiple(field: FieldType): boolean;
|
|
37
|
-
declare function getCompositeTypeApiName(field: FieldType): string;
|
|
38
|
-
declare function getCompositeTypeSubFields(field: FieldType): object[];
|
|
39
|
-
declare function getSettingsFilter(field: FieldType): FilterType[];
|
|
40
|
-
declare function getSettingsFilterV3(field: FieldType): FilterTypeV3[];
|
|
41
|
-
export declare function getRegionSettingsFilter(field: FieldType): RegionFilterType[];
|
|
42
|
-
export declare function getRegionSettingsFilterV3(field: FieldType): RegionFilterTypeV3[];
|
|
43
|
-
declare function getSettingsSort(field: FieldType): SortConditionType[];
|
|
44
|
-
declare function getRecordPosition(field: FieldType): number;
|
|
45
|
-
export declare function getRollupType(field: FieldType): string;
|
|
46
|
-
export declare function getRollupObjectApiName(field: FieldType): string;
|
|
47
|
-
export declare function getRollupFieldApiName(field: FieldType): string;
|
|
48
|
-
export declare function getRollupLookupFieldApiName(field: FieldType): string;
|
|
49
|
-
export declare function getRegionOptionLevel(field: FieldType): boolean;
|
|
50
|
-
export declare function getRegionStrictLeve(field: FieldType): number;
|
|
51
|
-
export declare function getRollupFilter(field: FieldType): CriterionType;
|
|
52
|
-
export { getUnique, getCaseSensitive, getMultiline, getMaxLength, getRegexpExpression, getRegexpErrMsg, getDisplayAsPercentage, getDecimalPlaces, getMultiple, getOptionSource, getGlobalOptionApiName, getOptionList, getDescriptionWhenTrue, getDescriptionWhenFalse, getDefaultValue, getDisplayStyle, getLookupRefObjectApiName, getLookupIsHierarchy, getLookupDisplayStyle, getReturnType, getFormula, getGenerateMethod, getDigitsNumber, getPrefix, getSuffix, getReferenceObjectApiName, getReferenceFieldApiName, getFileMultiple, getFileTypes, getBackLookupObjectApiName, getBackLookupFieldApiName, getSettingsMultiple, getCompositeTypeApiName, getCompositeTypeSubFields, getSettingsFilter, getSettingsSort, getRecordPosition, getOptionListV3, getSettingsFilterV3, };
|