@byted-apaas/server-sdk-node 1.1.23 → 1.1.24-beta.0
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/application/application.d.ts +33 -0
- package/application/application.js +2 -0
- package/application/function/function.d.ts +14 -0
- package/application/function/function.js +20 -0
- package/application/impl/common.d.ts +2 -0
- package/application/impl/common.js +52 -0
- package/application/impl/impl.d.ts +19 -0
- package/application/impl/impl.js +45 -0
- package/common/structs.d.ts +15 -0
- package/common/structs.js +21 -0
- package/constants/constants.d.ts +13 -0
- package/constants/constants.js +18 -0
- package/context/context.d.ts +44 -0
- package/context/context.js +25 -0
- package/context/db/db.d.ts +110 -0
- package/context/db/db.js +2 -0
- package/context/db/impl/IObject.d.ts +303 -0
- package/context/db/impl/IObject.js +5 -0
- package/context/db/impl/IObjectV3.d.ts +239 -0
- package/context/db/impl/IObjectV3.js +5 -0
- package/context/db/impl/db.d.ts +62 -0
- package/context/db/impl/db.js +84 -0
- package/context/db/impl/dbV3.d.ts +35 -0
- package/context/db/impl/dbV3.js +50 -0
- package/context/db/impl/object.d.ts +123 -0
- package/context/db/impl/object.js +1008 -0
- package/context/db/impl/oql/ioql.d.ts +14 -0
- package/context/db/impl/oql/ioql.js +4 -0
- package/context/db/impl/oql/oql.d.ts +14 -0
- package/context/db/impl/oql/oql.js +39 -0
- package/context/db/impl/order.d.ts +9 -0
- package/context/db/impl/order.js +15 -0
- package/context/db/impl/propertiesStore.d.ts +8 -0
- package/context/db/impl/propertiesStore.js +29 -0
- package/context/db/impl/queryBuilder.d.ts +33 -0
- package/context/db/impl/queryBuilder.js +72 -0
- package/context/db/impl/transaction/index.d.ts +25 -0
- package/context/db/impl/transaction/index.js +300 -0
- package/context/db/impl/transaction/operation.d.ts +27 -0
- package/context/db/impl/transaction/operation.js +69 -0
- package/context/db/impl/transaction.d.ts +70 -0
- package/context/db/impl/transaction.js +4 -0
- package/context/globalConfig/globalConfig.d.ts +7 -0
- package/context/globalConfig/globalConfig.js +16 -0
- package/context/integration/IIntegration.d.ts +30 -0
- package/context/integration/IIntegration.js +4 -0
- package/context/integration/impl/integration.d.ts +16 -0
- package/context/integration/impl/integration.js +62 -0
- package/context/metadata/components/common.d.ts +6 -0
- package/context/metadata/components/common.js +17 -0
- package/context/metadata/components/components.d.ts +12 -0
- package/context/metadata/components/components.js +19 -0
- package/context/metadata/components/desktop/list.d.ts +16 -0
- package/context/metadata/components/desktop/list.js +402 -0
- package/context/metadata/components/desktop/recordDetail.d.ts +11 -0
- package/context/metadata/components/desktop/recordDetail.js +53 -0
- package/context/metadata/components/mobile/list.d.ts +24 -0
- package/context/metadata/components/mobile/list.js +145 -0
- package/context/metadata/metadata.d.ts +63 -0
- package/context/metadata/metadata.js +125 -0
- package/context/metadata/objects/fields.d.ts +158 -0
- package/context/metadata/objects/fields.js +369 -0
- package/context/metadata/objects/fields.util.d.ts +52 -0
- package/context/metadata/objects/fields.util.js +420 -0
- package/context/metadata/objects/fieldsV3.d.ts +159 -0
- package/context/metadata/objects/fieldsV3.js +369 -0
- package/context/metadata/objects/objects.d.ts +11 -0
- package/context/metadata/objects/objects.js +20 -0
- package/context/metadata/types/common.d.ts +11 -0
- package/context/metadata/types/common.js +33 -0
- package/context/metadata/types/components.d.ts +90 -0
- package/context/metadata/types/components.js +4 -0
- package/context/metadata/types/objects.d.ts +246 -0
- package/context/metadata/types/objects.js +4 -0
- package/context/metadata/types/objectsV3.d.ts +128 -0
- package/context/metadata/types/objectsV3.js +4 -0
- package/context/msg/msg.d.ts +38 -0
- package/context/msg/msg.js +35 -0
- package/context/resources/IResources.d.ts +68 -0
- package/context/resources/IResources.js +2 -0
- package/context/resources/impl/resources.d.ts +42 -0
- package/context/resources/impl/resources.js +161 -0
- package/context/tasks/tasks.d.ts +33 -0
- package/context/tasks/tasks.js +139 -0
- package/data/index.d.ts +27 -0
- package/data/index.js +4 -0
- package/global/application/flow/flow.d.ts +99 -0
- package/global/application/flow/flow.js +8 -0
- package/global/application/flow/impl/flow.d.ts +20 -0
- package/global/application/flow/impl/flow.js +56 -0
- package/global/application/globalVar/globalVar.d.ts +7 -0
- package/global/application/globalVar/globalVar.js +2 -0
- package/global/global.d.ts +70 -0
- package/global/global.js +3 -0
- package/hooks/api.d.ts +65 -0
- package/hooks/api.js +347 -0
- package/hooks/hooks.d.ts +1 -0
- package/hooks/hooks.js +107 -0
- package/kunlun/kunlun.d.ts +55 -0
- package/kunlun/kunlun.js +58 -0
- package/kunlun/operator/IOperator.d.ts +158 -0
- package/kunlun/operator/IOperator.js +4 -0
- package/kunlun/operator/impl/expression.d.ts +75 -0
- package/kunlun/operator/impl/expression.js +96 -0
- package/kunlun/operator/impl/logic.d.ts +68 -0
- package/kunlun/operator/impl/logic.js +573 -0
- package/kunlun/operator/impl/logicV2.d.ts +59 -0
- package/kunlun/operator/impl/logicV2.js +197 -0
- package/kunlun/operator/impl/operator.d.ts +179 -0
- package/kunlun/operator/impl/operator.js +222 -0
- package/kunlun/operator/impl/operatorV2.d.ts +180 -0
- package/kunlun/operator/impl/operatorV2.js +216 -0
- package/lib/core.d.ts +4 -0
- package/lib/core.js +19 -0
- package/package.json +1 -1
- package/request/common.d.ts +13 -0
- package/request/common.js +88 -0
- package/request/constants.d.ts +12 -0
- package/request/constants.js +29 -0
- package/request/faasinfra.d.ts +8 -0
- package/request/faasinfra.js +146 -0
- package/request/interface.d.ts +121 -0
- package/request/interface.js +30 -0
- package/request/openapi.d.ts +84 -0
- package/request/openapi.js +1533 -0
- package/request/structs.d.ts +99 -0
- package/request/structs.js +15 -0
- package/types/types.d.ts +79 -0
- package/types/types.js +4 -0
- package/version/version.d.ts +2 -0
- package/version/version.js +8 -0
|
@@ -0,0 +1,369 @@
|
|
|
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.getFieldClassV3 = exports.parseFieldV3 = exports.parseFieldsV3 = exports.RollupV3 = exports.RegionV3 = exports.DecimalV3 = exports.BigintV3 = exports.RichTextV3 = exports.ExtractSingleRecordV3 = exports.CompositeTypeV3 = exports.BackLookupV3 = exports.FileV3 = exports.ReferenceFieldV3 = exports.AutoIDV3 = exports.FormulaV3 = exports.LookupV3 = exports.AvatarOrLogoV3 = exports.BooleanV3 = exports.MobileNumberV3 = exports.EmailV3 = exports.OptionV3 = exports.DateTimeV3 = exports.DateV3 = exports.NumberV3 = exports.MultilingualV3 = exports.TextV3 = void 0;
|
|
6
|
+
const fieldsUtil = require("./fields.util");
|
|
7
|
+
const common_1 = require("../types/common");
|
|
8
|
+
class MetadataFieldV3 {
|
|
9
|
+
constructor(type, field) {
|
|
10
|
+
this.type = type;
|
|
11
|
+
this.apiName = field.api_name;
|
|
12
|
+
this.label = (0, common_1.transI18nsToMultilingualV3)(field.label);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
class KTextV3 extends MetadataFieldV3 {
|
|
16
|
+
constructor(field) {
|
|
17
|
+
if (!field) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
super('text', field);
|
|
21
|
+
this.required = field.required;
|
|
22
|
+
this.unique = fieldsUtil.getUnique(field);
|
|
23
|
+
this.caseSensitive = fieldsUtil.getCaseSensitive(field);
|
|
24
|
+
this.multiline = fieldsUtil.getMultiline(field);
|
|
25
|
+
this.maxLength = fieldsUtil.getMaxLength(field);
|
|
26
|
+
this.validationRegex = fieldsUtil.getRegexpExpression(field);
|
|
27
|
+
this.errorMsg = (0, common_1.transI18nsToMultilingualV3)(fieldsUtil.getRegexpErrMsg(field));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.TextV3 = KTextV3;
|
|
31
|
+
class RichTextV3 extends MetadataFieldV3 {
|
|
32
|
+
constructor(field) {
|
|
33
|
+
if (!field) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
super('richText', field);
|
|
37
|
+
this.maxLength = fieldsUtil.getMaxLength(field);
|
|
38
|
+
this.required = field.required;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.RichTextV3 = RichTextV3;
|
|
42
|
+
class MultilingualV3 extends MetadataFieldV3 {
|
|
43
|
+
constructor(field) {
|
|
44
|
+
if (!field) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
super('multilingual', field);
|
|
48
|
+
this.required = field.required;
|
|
49
|
+
this.unique = fieldsUtil.getUnique(field);
|
|
50
|
+
this.caseSensitive = fieldsUtil.getCaseSensitive(field);
|
|
51
|
+
this.multiline = fieldsUtil.getMultiline(field);
|
|
52
|
+
this.maxLength = fieldsUtil.getMaxLength(field);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.MultilingualV3 = MultilingualV3;
|
|
56
|
+
class NumberV3 extends MetadataFieldV3 {
|
|
57
|
+
constructor(field) {
|
|
58
|
+
if (!field) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
super('number', field);
|
|
62
|
+
this.required = field.required;
|
|
63
|
+
this.unique = fieldsUtil.getUnique(field);
|
|
64
|
+
this.displayAsPercentage = fieldsUtil.getDisplayAsPercentage(field);
|
|
65
|
+
this.decimalPlacesNumber = fieldsUtil.getDecimalPlaces(field);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.NumberV3 = NumberV3;
|
|
69
|
+
class BigintV3 extends MetadataFieldV3 {
|
|
70
|
+
constructor(field) {
|
|
71
|
+
if (!field) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
super('bigint', field);
|
|
75
|
+
this.required = field.required;
|
|
76
|
+
this.unique = fieldsUtil.getUnique(field);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.BigintV3 = BigintV3;
|
|
80
|
+
class DecimalV3 extends MetadataFieldV3 {
|
|
81
|
+
constructor(field) {
|
|
82
|
+
if (!field) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
super('decimal', field);
|
|
86
|
+
this.required = field.required;
|
|
87
|
+
this.unique = fieldsUtil.getUnique(field);
|
|
88
|
+
this.displayAsPercentage = fieldsUtil.getDisplayAsPercentage(field);
|
|
89
|
+
this.decimalPlacesNumber = fieldsUtil.getDecimalPlaces(field);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.DecimalV3 = DecimalV3;
|
|
93
|
+
class KDateV3 extends MetadataFieldV3 {
|
|
94
|
+
constructor(field) {
|
|
95
|
+
if (!field) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
super('date', field);
|
|
99
|
+
this.required = field.required;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.DateV3 = KDateV3;
|
|
103
|
+
class DateTimeV3 extends MetadataFieldV3 {
|
|
104
|
+
constructor(field) {
|
|
105
|
+
if (!field) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
super('dateTime', field);
|
|
109
|
+
this.required = field.required;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.DateTimeV3 = DateTimeV3;
|
|
113
|
+
class OptionV3 extends MetadataFieldV3 {
|
|
114
|
+
constructor(field) {
|
|
115
|
+
if (!field) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
super('option', field);
|
|
119
|
+
this.required = field.required;
|
|
120
|
+
this.multiple = fieldsUtil.getMultiple(field);
|
|
121
|
+
this.optionSource = fieldsUtil.getOptionSource(field);
|
|
122
|
+
this.globalOptionApiName = fieldsUtil.getGlobalOptionApiName(field);
|
|
123
|
+
this.optionList = fieldsUtil.getOptionListV3(field);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
exports.OptionV3 = OptionV3;
|
|
127
|
+
class EmailV3 extends MetadataFieldV3 {
|
|
128
|
+
constructor(field) {
|
|
129
|
+
if (!field) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
super('email', field);
|
|
133
|
+
this.required = field.required;
|
|
134
|
+
this.unique = fieldsUtil.getUnique(field);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.EmailV3 = EmailV3;
|
|
138
|
+
class MobileNumberV3 extends MetadataFieldV3 {
|
|
139
|
+
constructor(field) {
|
|
140
|
+
if (!field) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
super('mobileNumber', field);
|
|
144
|
+
this.required = field.required;
|
|
145
|
+
this.unique = fieldsUtil.getUnique(field);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
exports.MobileNumberV3 = MobileNumberV3;
|
|
149
|
+
class BooleanV3 extends MetadataFieldV3 {
|
|
150
|
+
constructor(field) {
|
|
151
|
+
if (!field) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
super('boolean', field);
|
|
155
|
+
this.unique = fieldsUtil.getUnique(field);
|
|
156
|
+
this.descriptionWhenTrue = (0, common_1.transI18nsToMultilingualV3)(fieldsUtil.getDescriptionWhenTrue(field));
|
|
157
|
+
this.descriptionWhenFalse = (0, common_1.transI18nsToMultilingualV3)(fieldsUtil.getDescriptionWhenFalse(field));
|
|
158
|
+
this.defaultValue = fieldsUtil.getDefaultValue(field);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.BooleanV3 = BooleanV3;
|
|
162
|
+
class AvatarOrLogoV3 extends MetadataFieldV3 {
|
|
163
|
+
constructor(field) {
|
|
164
|
+
if (!field) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
super('avatarOrLogo', field);
|
|
168
|
+
this.displayStyle = fieldsUtil.getDisplayStyle(field);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
exports.AvatarOrLogoV3 = AvatarOrLogoV3;
|
|
172
|
+
class LookupV3 extends MetadataFieldV3 {
|
|
173
|
+
constructor(field) {
|
|
174
|
+
if (!field) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
super('lookup', field);
|
|
178
|
+
this.required = field.required;
|
|
179
|
+
this.multiple = fieldsUtil.getMultiple(field);
|
|
180
|
+
this.objectApiName = fieldsUtil.getLookupRefObjectApiName(field);
|
|
181
|
+
this.hierarchy = fieldsUtil.getLookupIsHierarchy(field);
|
|
182
|
+
this.displayStyle = fieldsUtil.getLookupDisplayStyle(field);
|
|
183
|
+
// TODO
|
|
184
|
+
this.sortConditions = fieldsUtil.getSettingsSort(field);
|
|
185
|
+
this.filter = [];
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
exports.LookupV3 = LookupV3;
|
|
189
|
+
class FormulaV3 extends MetadataFieldV3 {
|
|
190
|
+
constructor(field) {
|
|
191
|
+
if (!field) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
super('formula', field);
|
|
195
|
+
this.returnType = fieldsUtil.getReturnType(field);
|
|
196
|
+
this.formula = (0, common_1.transI18nsToMultilingualV3)(fieldsUtil.getFormula(field));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports.FormulaV3 = FormulaV3;
|
|
200
|
+
class AutoIDV3 extends MetadataFieldV3 {
|
|
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.AutoIDV3 = AutoIDV3;
|
|
213
|
+
class ReferenceFieldV3 extends MetadataFieldV3 {
|
|
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.ReferenceFieldV3 = ReferenceFieldV3;
|
|
225
|
+
class RollupV3 extends MetadataFieldV3 {
|
|
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.RollupV3 = RollupV3;
|
|
239
|
+
class RegionV3 extends MetadataFieldV3 {
|
|
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.getRegionSettingsFilterV3(field);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
exports.RegionV3 = RegionV3;
|
|
253
|
+
class FileV3 extends MetadataFieldV3 {
|
|
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.FileV3 = FileV3;
|
|
265
|
+
class BackLookupV3 extends MetadataFieldV3 {
|
|
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.BackLookupV3 = BackLookupV3;
|
|
279
|
+
class CompositeTypeV3 extends MetadataFieldV3 {
|
|
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 = parseFieldsV3(fieldsUtil.getCompositeTypeSubFields(field));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
exports.CompositeTypeV3 = CompositeTypeV3;
|
|
293
|
+
class ExtractSingleRecordV3 extends MetadataFieldV3 {
|
|
294
|
+
constructor(field) {
|
|
295
|
+
if (!field) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
super('extractSingleRecord', field);
|
|
299
|
+
this.compositeTypeApiName = fieldsUtil.getCompositeTypeApiName(field);
|
|
300
|
+
// TODO 字段类型转换
|
|
301
|
+
this.subFields = parseFieldsV3(fieldsUtil.getCompositeTypeSubFields(field));
|
|
302
|
+
this.filter = fieldsUtil.getSettingsFilterV3(field);
|
|
303
|
+
this.sortConditions = fieldsUtil.getSettingsSort(field);
|
|
304
|
+
this.recordPosition = fieldsUtil.getRecordPosition(field);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
exports.ExtractSingleRecordV3 = ExtractSingleRecordV3;
|
|
308
|
+
function getCompositeTypeClass(field) {
|
|
309
|
+
if (field && field.type && field.type.settings && field.type.settings.is_extract) {
|
|
310
|
+
return ExtractSingleRecordV3;
|
|
311
|
+
}
|
|
312
|
+
return CompositeTypeV3;
|
|
313
|
+
}
|
|
314
|
+
function parseFieldsV3(inputFields) {
|
|
315
|
+
if (!inputFields || !Array.isArray(inputFields)) {
|
|
316
|
+
return [];
|
|
317
|
+
}
|
|
318
|
+
let fields = [];
|
|
319
|
+
for (let field of inputFields) {
|
|
320
|
+
const fieldClass = getFieldClassV3(field);
|
|
321
|
+
if (!fieldClass) {
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
fields.push(new fieldClass(field));
|
|
325
|
+
}
|
|
326
|
+
return fields;
|
|
327
|
+
}
|
|
328
|
+
exports.parseFieldsV3 = parseFieldsV3;
|
|
329
|
+
function parseFieldV3(field) {
|
|
330
|
+
const fieldClass = getFieldClassV3(field);
|
|
331
|
+
if (fieldClass) {
|
|
332
|
+
return new fieldClass(field);
|
|
333
|
+
}
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
exports.parseFieldV3 = parseFieldV3;
|
|
337
|
+
function getFieldClassV3(field) {
|
|
338
|
+
if (field && field.type && field.type.name) {
|
|
339
|
+
if (field.type.name === 'compositeType') {
|
|
340
|
+
return getCompositeTypeClass(field);
|
|
341
|
+
}
|
|
342
|
+
return type2fieldTypeV3[field.type.name];
|
|
343
|
+
}
|
|
344
|
+
return null;
|
|
345
|
+
}
|
|
346
|
+
exports.getFieldClassV3 = getFieldClassV3;
|
|
347
|
+
const type2fieldTypeV3 = {
|
|
348
|
+
'text': KTextV3,
|
|
349
|
+
'multilingual': MultilingualV3,
|
|
350
|
+
'float': NumberV3,
|
|
351
|
+
'date': KDateV3,
|
|
352
|
+
'datetime': DateTimeV3,
|
|
353
|
+
'enum': OptionV3,
|
|
354
|
+
'email': EmailV3,
|
|
355
|
+
'phone': MobileNumberV3,
|
|
356
|
+
'boolean': BooleanV3,
|
|
357
|
+
'avatar': AvatarOrLogoV3,
|
|
358
|
+
'lookup': LookupV3,
|
|
359
|
+
'formula': FormulaV3,
|
|
360
|
+
'auto_number': AutoIDV3,
|
|
361
|
+
'reference_field': ReferenceFieldV3,
|
|
362
|
+
'attachment': FileV3,
|
|
363
|
+
'back_lookup': BackLookupV3,
|
|
364
|
+
'richText': RichTextV3,
|
|
365
|
+
'bigint': BigintV3,
|
|
366
|
+
'decimal': DecimalV3,
|
|
367
|
+
'rollup': RollupV3,
|
|
368
|
+
'region': RegionV3,
|
|
369
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { I18ns } from '../types/common';
|
|
2
|
+
declare class Objects {
|
|
3
|
+
label: I18ns;
|
|
4
|
+
apiName: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
searchSupplementaryInfo: any[];
|
|
7
|
+
searchableFields: any[];
|
|
8
|
+
fields: any[];
|
|
9
|
+
constructor(obj: Record<string, any>);
|
|
10
|
+
}
|
|
11
|
+
export { Objects as Object, };
|
|
@@ -0,0 +1,20 @@
|
|
|
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.Object = void 0;
|
|
6
|
+
const fields = require("./fields");
|
|
7
|
+
class Objects {
|
|
8
|
+
constructor(obj) {
|
|
9
|
+
if (!obj) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
this.label = obj.label;
|
|
13
|
+
this.apiName = obj.api_name;
|
|
14
|
+
this.displayName = '';
|
|
15
|
+
this.searchSupplementaryInfo = [];
|
|
16
|
+
this.searchableFields = [];
|
|
17
|
+
this.fields = fields.parseFields(obj.fields);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.Object = Objects;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type I18n = {
|
|
2
|
+
language_code: number;
|
|
3
|
+
text: string;
|
|
4
|
+
};
|
|
5
|
+
export type I18ns = I18n[];
|
|
6
|
+
export declare function isNullOrUndefined(param: any): boolean;
|
|
7
|
+
export declare function transI18nsToMultilingualV3(i18ns: I18ns): MultilingualTypeV3;
|
|
8
|
+
export interface MultilingualTypeV3 {
|
|
9
|
+
zh_CN: string;
|
|
10
|
+
en_US: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.transI18nsToMultilingualV3 = exports.isNullOrUndefined = void 0;
|
|
6
|
+
function isNullOrUndefined(param) {
|
|
7
|
+
return param === null || param === undefined;
|
|
8
|
+
}
|
|
9
|
+
exports.isNullOrUndefined = isNullOrUndefined;
|
|
10
|
+
function transI18nsToMultilingualV3(i18ns) {
|
|
11
|
+
if (i18ns === null || i18ns === undefined) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
let multilingual = { zh_CN: '', en_US: '' };
|
|
15
|
+
for (const i18n of i18ns) {
|
|
16
|
+
switch (i18n.language_code) {
|
|
17
|
+
case languageCode.zh_CN:
|
|
18
|
+
multilingual.zh_CN = i18n.text;
|
|
19
|
+
break;
|
|
20
|
+
case languageCode.en_US:
|
|
21
|
+
multilingual.en_US = i18n.text;
|
|
22
|
+
break;
|
|
23
|
+
default:
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return multilingual;
|
|
28
|
+
}
|
|
29
|
+
exports.transI18nsToMultilingualV3 = transI18nsToMultilingualV3;
|
|
30
|
+
const languageCode = {
|
|
31
|
+
zh_CN: 2052,
|
|
32
|
+
en_US: 1033,
|
|
33
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { I18ns } from './common';
|
|
2
|
+
export type SelectFieldType = {
|
|
3
|
+
fieldPath: {
|
|
4
|
+
objectApiName: string;
|
|
5
|
+
fieldApiName: string;
|
|
6
|
+
}[];
|
|
7
|
+
};
|
|
8
|
+
export type FieldApiType = {
|
|
9
|
+
type?: string;
|
|
10
|
+
fieldApiName: string;
|
|
11
|
+
alias?: I18ns;
|
|
12
|
+
concatText?: {
|
|
13
|
+
zh_CN?: Object[];
|
|
14
|
+
en_US?: Object[];
|
|
15
|
+
};
|
|
16
|
+
color?: string;
|
|
17
|
+
};
|
|
18
|
+
export type UIMetaFilterType = {
|
|
19
|
+
conditions: Object[];
|
|
20
|
+
logic: string;
|
|
21
|
+
};
|
|
22
|
+
export type UIMetaSortConditionsType = {
|
|
23
|
+
fieldApiName: string;
|
|
24
|
+
sort: string;
|
|
25
|
+
};
|
|
26
|
+
export type DeskListTitleField = {
|
|
27
|
+
fieldApiName: string;
|
|
28
|
+
};
|
|
29
|
+
export type DeskListSubtitleField = {
|
|
30
|
+
type?: ('field' | 'concatText');
|
|
31
|
+
fieldApiName: string;
|
|
32
|
+
alias: I18ns;
|
|
33
|
+
concatText?: {
|
|
34
|
+
zh_CN: ConcatTextType[];
|
|
35
|
+
en_US: ConcatTextType[];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export type DeskListDetailField = {
|
|
39
|
+
fieldApiName: string;
|
|
40
|
+
alias: I18ns;
|
|
41
|
+
};
|
|
42
|
+
export type UIMetaDesktopType = {
|
|
43
|
+
isCompositeType: boolean;
|
|
44
|
+
titleAreaText: I18ns;
|
|
45
|
+
objectApiName: string;
|
|
46
|
+
titleFields: FieldApiType[];
|
|
47
|
+
subtitleFields: FieldApiType[];
|
|
48
|
+
detailFields: FieldApiType[];
|
|
49
|
+
filter: UIMetaFilterType;
|
|
50
|
+
sortConditions: UIMetaSortConditionsType[];
|
|
51
|
+
};
|
|
52
|
+
export type UIMetaLangType = {
|
|
53
|
+
dataType: string;
|
|
54
|
+
fieldApiName: string;
|
|
55
|
+
text: string;
|
|
56
|
+
};
|
|
57
|
+
export type ConcatTextType = {
|
|
58
|
+
dataType: 'fieldApiName' | 'text';
|
|
59
|
+
fieldApiName: string;
|
|
60
|
+
text: string;
|
|
61
|
+
};
|
|
62
|
+
export type UIMetaMobileType = {
|
|
63
|
+
pageType?: ('app' | 'record_page');
|
|
64
|
+
pageApiName: string;
|
|
65
|
+
componentName: string;
|
|
66
|
+
titleAreaText: I18ns;
|
|
67
|
+
objectApiName: string;
|
|
68
|
+
listItems: MobileListItem;
|
|
69
|
+
filter: UIMetaFilterType;
|
|
70
|
+
sortConditions: UIMetaSortConditionsType[];
|
|
71
|
+
};
|
|
72
|
+
export type MobileListField = {
|
|
73
|
+
fieldApiName: string;
|
|
74
|
+
hiddenWhenEmpty?: boolean;
|
|
75
|
+
};
|
|
76
|
+
export type MobileListItem = {
|
|
77
|
+
avatar: {
|
|
78
|
+
active: boolean;
|
|
79
|
+
fieldApiName: string;
|
|
80
|
+
};
|
|
81
|
+
titleFields: {
|
|
82
|
+
fieldApiName: string;
|
|
83
|
+
}[];
|
|
84
|
+
tagFields: {
|
|
85
|
+
fieldApiName: string;
|
|
86
|
+
color: 'grey' | 'blue' | 'cyan' | 'green' | 'yellow' | 'orange' | 'red' | 'magenta' | 'purple' | 'blueMagenta';
|
|
87
|
+
}[];
|
|
88
|
+
subtitleFields: MobileListField[];
|
|
89
|
+
detailFields: MobileListField[];
|
|
90
|
+
};
|