@byted-apaas/server-sdk-node 0.0.2-beta.2 → 0.0.2-beta.3
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/LICENSE +7 -0
- package/NOTICE +3 -0
- package/application/application.js +0 -1
- package/application/function/function.js +0 -1
- package/application/impl/common.js +0 -1
- package/application/impl/impl.js +2 -2
- package/constants/constants.js +2 -1
- package/context/context.js +2 -1
- package/context/db/db.js +2 -1
- package/context/db/impl/IObject.js +2 -1
- package/context/db/impl/db.js +0 -1
- package/context/db/impl/object.js +2 -1
- package/context/db/impl/oql/ioql.js +2 -1
- package/context/db/impl/oql/oql.js +2 -1
- package/context/db/impl/order.js +2 -1
- package/context/db/impl/propertiesStore.js +2 -1
- package/context/db/impl/queryBuilder.js +2 -1
- package/context/db/impl/transaction/index.js +2 -1
- package/context/db/impl/transaction/operation.js +0 -1
- package/context/db/impl/transaction.js +2 -1
- package/context/globalConfig/globalConfig.js +2 -1
- package/context/metadata/components/common.js +2 -1
- package/context/metadata/components/components.js +2 -1
- package/context/metadata/components/desktop/list.js +0 -1
- package/context/metadata/components/desktop/recordDetail.js +2 -1
- package/context/metadata/components/mobile/list.js +2 -1
- package/context/metadata/metadata.js +2 -1
- package/context/metadata/objects/fields.js +2 -1
- package/context/metadata/objects/fields.util.js +0 -1
- package/context/metadata/objects/objects.js +2 -1
- package/context/metadata/types/common.js +2 -1
- package/context/metadata/types/components.js +2 -1
- package/context/metadata/types/objects.js +2 -1
- package/context/msg/msg.js +2 -1
- package/context/resources/IResources.js +0 -1
- package/context/resources/impl/resources.js +2 -1
- package/context/tasks/tasks.js +0 -1
- package/data/index.js +0 -1
- package/hooks/api.js +0 -1
- package/hooks/hooks.js +0 -1
- package/kunlun/kunlun.js +2 -1
- package/kunlun/operator/IOperator.js +2 -1
- package/kunlun/operator/impl/expression.js +2 -1
- package/kunlun/operator/impl/logic.js +2 -1
- package/kunlun/operator/impl/logicV2.js +0 -1
- package/kunlun/operator/impl/operator.js +2 -1
- package/kunlun/operator/impl/operatorV2.js +0 -1
- package/lib/core.js +2 -1
- package/package.json +3 -14
- package/request/common.js +0 -1
- package/request/constants.js +0 -1
- package/request/faasinfra.js +0 -1
- package/request/innerapi.js +2 -1
- package/request/interface.js +2 -1
- package/request/openapi.js +2 -1
- package/types/types.js +2 -1
- package/LICENSE.md +0 -0
- package/application/application.js.map +0 -1
- package/application/application.ts +0 -40
- package/application/function/function.js.map +0 -1
- package/application/function/function.ts +0 -37
- package/application/impl/common.js.map +0 -1
- package/application/impl/common.ts +0 -50
- package/application/impl/impl.js.map +0 -1
- package/application/impl/impl.ts +0 -48
- package/constants/constants.js.map +0 -1
- package/constants/constants.ts +0 -12
- package/context/context.js.map +0 -1
- package/context/context.ts +0 -127
- package/context/db/db.js.map +0 -1
- package/context/db/db.ts +0 -77
- package/context/db/impl/IObject.js.map +0 -1
- package/context/db/impl/IObject.ts +0 -244
- package/context/db/impl/db.js.map +0 -1
- package/context/db/impl/db.ts +0 -95
- package/context/db/impl/object.js.map +0 -1
- package/context/db/impl/object.ts +0 -628
- package/context/db/impl/oql/ioql.js.map +0 -1
- package/context/db/impl/oql/ioql.ts +0 -6
- package/context/db/impl/oql/oql.js.map +0 -1
- package/context/db/impl/oql/oql.ts +0 -22
- package/context/db/impl/order.js.map +0 -1
- package/context/db/impl/order.ts +0 -16
- package/context/db/impl/propertiesStore.js.map +0 -1
- package/context/db/impl/propertiesStore.ts +0 -28
- package/context/db/impl/queryBuilder.js.map +0 -1
- package/context/db/impl/queryBuilder.ts +0 -103
- package/context/db/impl/transaction/index.js.map +0 -1
- package/context/db/impl/transaction/index.ts +0 -337
- package/context/db/impl/transaction/operation.js.map +0 -1
- package/context/db/impl/transaction/operation.ts +0 -72
- package/context/db/impl/transaction.js.map +0 -1
- package/context/db/impl/transaction.ts +0 -76
- package/context/globalConfig/globalConfig.js.map +0 -1
- package/context/globalConfig/globalConfig.ts +0 -11
- package/context/metadata/components/common.js.map +0 -1
- package/context/metadata/components/common.ts +0 -19
- package/context/metadata/components/components.js.map +0 -1
- package/context/metadata/components/components.ts +0 -19
- package/context/metadata/components/desktop/list.js.map +0 -1
- package/context/metadata/components/desktop/list.ts +0 -457
- package/context/metadata/components/desktop/recordDetail.js.map +0 -1
- package/context/metadata/components/desktop/recordDetail.ts +0 -64
- package/context/metadata/components/mobile/list.js.map +0 -1
- package/context/metadata/components/mobile/list.ts +0 -176
- package/context/metadata/metadata.js.map +0 -1
- package/context/metadata/metadata.ts +0 -175
- package/context/metadata/objects/fields.js.map +0 -1
- package/context/metadata/objects/fields.ts +0 -454
- package/context/metadata/objects/fields.util.js.map +0 -1
- package/context/metadata/objects/fields.util.ts +0 -360
- package/context/metadata/objects/objects.js.map +0 -1
- package/context/metadata/objects/objects.ts +0 -27
- package/context/metadata/types/common.js.map +0 -1
- package/context/metadata/types/common.ts +0 -10
- package/context/metadata/types/components.js.map +0 -1
- package/context/metadata/types/components.ts +0 -105
- package/context/metadata/types/objects.js.map +0 -1
- package/context/metadata/types/objects.ts +0 -251
- package/context/msg/msg.js.map +0 -1
- package/context/msg/msg.ts +0 -49
- package/context/resources/IResources.js.map +0 -1
- package/context/resources/IResources.ts +0 -73
- package/context/resources/impl/resources.js.map +0 -1
- package/context/resources/impl/resources.ts +0 -170
- package/context/tasks/tasks.js.map +0 -1
- package/context/tasks/tasks.ts +0 -159
- package/data/index.js.map +0 -1
- package/data/index.ts +0 -30
- package/hooks/api.js.map +0 -1
- package/hooks/api.ts +0 -341
- package/hooks/hooks.js.map +0 -1
- package/hooks/hooks.ts +0 -100
- package/kunlun/kunlun.js.map +0 -1
- package/kunlun/kunlun.ts +0 -69
- package/kunlun/operator/IOperator.js.map +0 -1
- package/kunlun/operator/IOperator.ts +0 -163
- package/kunlun/operator/impl/expression.js.map +0 -1
- package/kunlun/operator/impl/expression.ts +0 -71
- package/kunlun/operator/impl/logic.js.map +0 -1
- package/kunlun/operator/impl/logic.ts +0 -595
- package/kunlun/operator/impl/logicV2.js.map +0 -1
- package/kunlun/operator/impl/logicV2.ts +0 -254
- package/kunlun/operator/impl/operator.js.map +0 -1
- package/kunlun/operator/impl/operator.ts +0 -255
- package/kunlun/operator/impl/operatorV2.js.map +0 -1
- package/kunlun/operator/impl/operatorV2.ts +0 -249
- package/lib/core.js.map +0 -1
- package/lib/core.ts +0 -4
- package/request/common.js.map +0 -1
- package/request/common.ts +0 -91
- package/request/constants.js.map +0 -1
- package/request/constants.ts +0 -25
- package/request/faasinfra.js.map +0 -1
- package/request/faasinfra.ts +0 -393
- package/request/innerapi.js.map +0 -1
- package/request/innerapi.ts +0 -1645
- package/request/interface.js.map +0 -1
- package/request/interface.ts +0 -166
- package/request/openapi.js.map +0 -1
- package/request/openapi.ts +0 -1220
- package/types/types.js.map +0 -1
- package/types/types.ts +0 -105
|
@@ -1,360 +0,0 @@
|
|
|
1
|
-
import * as common from '@byted-apaas/server-common-node'
|
|
2
|
-
import {FieldType, FilterType, SortConditionType, SubOptionType} from "../types/objects";
|
|
3
|
-
import {I18ns, isNullOrUndefined} from "../types/common";
|
|
4
|
-
|
|
5
|
-
const commonConstants = common.constants;
|
|
6
|
-
const commonUtils = common.utils;
|
|
7
|
-
|
|
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
|
-
|
|
21
|
-
function getUnique(field: FieldType): boolean {
|
|
22
|
-
if (field && !isNullOrUndefined(field.unique_type)) {
|
|
23
|
-
return field.unique_type > 1;
|
|
24
|
-
}
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function getCaseSensitive(field: FieldType): boolean {
|
|
29
|
-
if (field && !isNullOrUndefined(field.unique_type)) {
|
|
30
|
-
return [2, 4, 9].includes(field.unique_type);
|
|
31
|
-
}
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function getMultiline(field: FieldType): boolean {
|
|
36
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.multiline)) {
|
|
37
|
-
return field.type.settings.multiline;
|
|
38
|
-
}
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function getMaxLength(field: FieldType): number {
|
|
43
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.max_length)) {
|
|
44
|
-
return field.type.settings.max_length;
|
|
45
|
-
}
|
|
46
|
-
return 255;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function getRegexpExpression(field: FieldType): string {
|
|
50
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.regexp_expression)) {
|
|
51
|
-
return field.type.settings.regexp_expression;
|
|
52
|
-
}
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function getRegexpErrMsg(field: FieldType): I18ns {
|
|
57
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.regexp_err_msg)) {
|
|
58
|
-
return field.type.settings.regexp_err_msg;
|
|
59
|
-
}
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function getDisplayAsPercentage(field: FieldType) {
|
|
64
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.display_as_percentage)) {
|
|
65
|
-
return field.type.settings.display_as_percentage;
|
|
66
|
-
}
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function getDecimalPlaces(field: FieldType) {
|
|
71
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.decimal_places)) {
|
|
72
|
-
return field.type.settings.decimal_places;
|
|
73
|
-
}
|
|
74
|
-
return 0;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function getMultiple(field: FieldType): boolean {
|
|
78
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.is_array)) {
|
|
79
|
-
return field.type.settings.is_array;
|
|
80
|
-
}
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// 开发者感知 custom, global
|
|
85
|
-
// 底层存储 local, global
|
|
86
|
-
function getOptionSource(field: FieldType): ("custom" | "global") {
|
|
87
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.option_type)) {
|
|
88
|
-
if (field.type.settings.option_type === 'local') {
|
|
89
|
-
return "custom";
|
|
90
|
-
} else if (field.type.settings.option_type === 'global') {
|
|
91
|
-
return "global";
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return "custom";
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function getGlobalOptionApiName(field: FieldType): string {
|
|
98
|
-
if (field && field.type && field.type.settings && field.type.settings.related_to_global_option && !isNullOrUndefined(field.type.settings.related_to_global_option.apiName)) {
|
|
99
|
-
return field.type.settings.related_to_global_option.apiName;
|
|
100
|
-
}
|
|
101
|
-
return "";
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function getOptionList(field: FieldType): SubOptionType[] {
|
|
105
|
-
if (!field || !field.type || !field.type.settings || !field.type.settings.options || !Array.isArray(field.type.settings.options)) {
|
|
106
|
-
return [];
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
let options: SubOptionType[] = [];
|
|
110
|
-
for (let option of field.type.settings.options) {
|
|
111
|
-
options.push({
|
|
112
|
-
label: option.name,
|
|
113
|
-
apiName: option.api_name,
|
|
114
|
-
description: option.description,
|
|
115
|
-
color: commonUtils.getColorNameById(option.color_id) as any,
|
|
116
|
-
active: !!option.active,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return options;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function getDescriptionWhenTrue(field: FieldType): I18ns {
|
|
124
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.description_if_true)) {
|
|
125
|
-
return field.type.settings.description_if_true;
|
|
126
|
-
}
|
|
127
|
-
return [];
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function getDescriptionWhenFalse(field: FieldType): I18ns {
|
|
131
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.description_if_false)) {
|
|
132
|
-
return field.type.settings.description_if_false;
|
|
133
|
-
}
|
|
134
|
-
return [];
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function getDefaultValue(field: FieldType): boolean {
|
|
138
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.default_value)) {
|
|
139
|
-
return field.type.settings.default_value;
|
|
140
|
-
}
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function getDisplayStyle(field: FieldType): string {
|
|
145
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.display_style)) {
|
|
146
|
-
return field.type.settings.display_style;
|
|
147
|
-
}
|
|
148
|
-
return "square";
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
function getLookupRefObjectApiName(field: FieldType): string {
|
|
152
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.referenced_object_api_name)) {
|
|
153
|
-
return field.type.settings.referenced_object_api_name;
|
|
154
|
-
}
|
|
155
|
-
return "";
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function getLookupIsHierarchy(field: FieldType): boolean {
|
|
159
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.is_hierarchy)) {
|
|
160
|
-
return field.type.settings.is_hierarchy;
|
|
161
|
-
}
|
|
162
|
-
return false;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// "search"|"dropDown"|"tree"
|
|
166
|
-
function getLookupDisplayStyle(field: FieldType): string {
|
|
167
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.display_style)) {
|
|
168
|
-
return field.type.settings.display_style;
|
|
169
|
-
}
|
|
170
|
-
return "dropDown";
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function getReturnType(field: FieldType): string {
|
|
174
|
-
// TODO: check returnType to return_type
|
|
175
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.return_type)) {
|
|
176
|
-
return field.type.settings.return_type;
|
|
177
|
-
}
|
|
178
|
-
return "";
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function getFormula(field: FieldType): I18ns {
|
|
182
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.formulas)) {
|
|
183
|
-
return field.type.settings.formulas;
|
|
184
|
-
}
|
|
185
|
-
return [];
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// "random"|"incremental"
|
|
189
|
-
function getGenerateMethod(field: FieldType): string {
|
|
190
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.generation_method)) {
|
|
191
|
-
return field.type.settings.generation_method;
|
|
192
|
-
}
|
|
193
|
-
return "random";
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function getDigitsNumber(field: FieldType): number {
|
|
197
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.digits)) {
|
|
198
|
-
return field.type.settings.digits;
|
|
199
|
-
}
|
|
200
|
-
return 6;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function getPrefix(field: FieldType): string {
|
|
204
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.prefix)) {
|
|
205
|
-
return field.type.settings.prefix;
|
|
206
|
-
}
|
|
207
|
-
return "";
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
function getSuffix(field: FieldType): string {
|
|
211
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.suffix)) {
|
|
212
|
-
return field.type.settings.suffix;
|
|
213
|
-
}
|
|
214
|
-
return "";
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function getReferenceObjectApiName(field: FieldType): string {
|
|
218
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.target_referenced_object_api_name)) {
|
|
219
|
-
return field.type.settings.target_referenced_object_api_name;
|
|
220
|
-
}
|
|
221
|
-
return "";
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
function getReferenceFieldApiName(field: FieldType): string {
|
|
225
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.target_reference_field_api_name)) {
|
|
226
|
-
return field.type.settings.target_reference_field_api_name;
|
|
227
|
-
}
|
|
228
|
-
return "";
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
function getFileMultiple(field: FieldType): boolean {
|
|
232
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.multiple)) {
|
|
233
|
-
return field.type.settings.multiple;
|
|
234
|
-
}
|
|
235
|
-
return false;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
function getFileTypes(field: FieldType): string[] {
|
|
239
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.mime_types)) {
|
|
240
|
-
return field.type.settings.mime_types;
|
|
241
|
-
}
|
|
242
|
-
return [];
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
function getBackLookupObjectApiName(field: FieldType): string {
|
|
246
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.related_to_object_api_name)) {
|
|
247
|
-
return field.type.settings.related_to_object_api_name;
|
|
248
|
-
}
|
|
249
|
-
return "";
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
function getBackLookupFieldApiName(field: FieldType): string {
|
|
253
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.related_to_field_api_name)) {
|
|
254
|
-
return field.type.settings.related_to_field_api_name;
|
|
255
|
-
}
|
|
256
|
-
return "";
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
function getSettingsMultiple(field: FieldType): boolean {
|
|
260
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.multiple)) {
|
|
261
|
-
return field.type.settings.multiple;
|
|
262
|
-
}
|
|
263
|
-
return false;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
function getCompositeTypeApiName(field: FieldType): string {
|
|
267
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.related_to_api_name)) {
|
|
268
|
-
return field.type.settings.related_to_api_name;
|
|
269
|
-
}
|
|
270
|
-
return "";
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
function getCompositeTypeSubFields(field: FieldType): object[] {
|
|
274
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.related_to_fields)) {
|
|
275
|
-
return field.type.settings.related_to_fields;
|
|
276
|
-
}
|
|
277
|
-
return [];
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
// TODO 结构转换
|
|
281
|
-
function getSettingsFilter(field: FieldType): FilterType[] {
|
|
282
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.filter)) {
|
|
283
|
-
return field.type.settings.filter;
|
|
284
|
-
}
|
|
285
|
-
return [];
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
// TODO 结构转换
|
|
289
|
-
function getSettingsSort(field: FieldType): SortConditionType[] {
|
|
290
|
-
let res: SortConditionType[] = [];
|
|
291
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.sort)) {
|
|
292
|
-
for (const s of field.type.settings.sort) {
|
|
293
|
-
res.push(({
|
|
294
|
-
fieldApiName: s.field,
|
|
295
|
-
sort: s.direction,
|
|
296
|
-
}))
|
|
297
|
-
}
|
|
298
|
-
return res;
|
|
299
|
-
}
|
|
300
|
-
return [];
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
function getRecordPosition(field: FieldType): number {
|
|
304
|
-
let pos: number = 1;
|
|
305
|
-
if (field && field.type && field.type.settings && !isNullOrUndefined(field.type.settings.filter_record)) {
|
|
306
|
-
// first, last, specified
|
|
307
|
-
switch (field.type.settings.filter_record.type) {
|
|
308
|
-
case "first":
|
|
309
|
-
pos = 1;
|
|
310
|
-
break;
|
|
311
|
-
case "last":
|
|
312
|
-
pos = -1;
|
|
313
|
-
break;
|
|
314
|
-
case "specified":
|
|
315
|
-
pos = field.type.settings.filter_record.index;
|
|
316
|
-
break;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
return pos;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
export {
|
|
323
|
-
getUnique,
|
|
324
|
-
getCaseSensitive,
|
|
325
|
-
getMultiline,
|
|
326
|
-
getMaxLength,
|
|
327
|
-
getRegexpExpression,
|
|
328
|
-
getRegexpErrMsg,
|
|
329
|
-
getDisplayAsPercentage,
|
|
330
|
-
getDecimalPlaces,
|
|
331
|
-
getMultiple,
|
|
332
|
-
getOptionSource,
|
|
333
|
-
getGlobalOptionApiName,
|
|
334
|
-
getOptionList,
|
|
335
|
-
getDescriptionWhenTrue,
|
|
336
|
-
getDescriptionWhenFalse,
|
|
337
|
-
getDefaultValue,
|
|
338
|
-
getDisplayStyle,
|
|
339
|
-
getLookupRefObjectApiName,
|
|
340
|
-
getLookupIsHierarchy,
|
|
341
|
-
getLookupDisplayStyle,
|
|
342
|
-
getReturnType,
|
|
343
|
-
getFormula,
|
|
344
|
-
getGenerateMethod,
|
|
345
|
-
getDigitsNumber,
|
|
346
|
-
getPrefix,
|
|
347
|
-
getSuffix,
|
|
348
|
-
getReferenceObjectApiName,
|
|
349
|
-
getReferenceFieldApiName,
|
|
350
|
-
getFileMultiple,
|
|
351
|
-
getFileTypes,
|
|
352
|
-
getBackLookupObjectApiName,
|
|
353
|
-
getBackLookupFieldApiName,
|
|
354
|
-
getSettingsMultiple,
|
|
355
|
-
getCompositeTypeApiName,
|
|
356
|
-
getCompositeTypeSubFields,
|
|
357
|
-
getSettingsFilter,
|
|
358
|
-
getSettingsSort,
|
|
359
|
-
getRecordPosition,
|
|
360
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objects.js","sourceRoot":"","sources":["objects.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAGlC,MAAM,OAAO;IAQT,YAAY,GAAwB;QAChC,IAAI,CAAC,GAAG,EAAE;YACN,OAAO;SACV;QACD,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,QAAQ,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,uBAAuB,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;CACJ;AAGc,yBAAM"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as fields from './fields'
|
|
2
|
-
import {I18ns} from "../types/common";
|
|
3
|
-
|
|
4
|
-
class Objects {
|
|
5
|
-
label: I18ns;
|
|
6
|
-
apiName: string;
|
|
7
|
-
displayName: string;
|
|
8
|
-
searchSupplementaryInfo: any[];
|
|
9
|
-
searchableFields: any[];
|
|
10
|
-
fields: any[];
|
|
11
|
-
|
|
12
|
-
constructor(obj: Record<string, any>) {
|
|
13
|
-
if (!obj) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
this.label = obj.label;
|
|
17
|
-
this.apiName = obj.api_name;
|
|
18
|
-
this.displayName = "";
|
|
19
|
-
this.searchSupplementaryInfo = [];
|
|
20
|
-
this.searchableFields = [];
|
|
21
|
-
this.fields = fields.parseFields(obj.fields);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
Objects as Object,
|
|
27
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["common.ts"],"names":[],"mappings":";;;AAOA,SAAgB,iBAAiB,CAAC,KAAU;IACxC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AACjD,CAAC;AAFD,8CAEC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["components.ts"],"names":[],"mappings":""}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import {I18ns} from "./common";
|
|
2
|
-
|
|
3
|
-
export type SelectFieldType = {
|
|
4
|
-
fieldPath: {
|
|
5
|
-
objectApiName: string,
|
|
6
|
-
fieldApiName: string,
|
|
7
|
-
}[]
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type FieldApiType = {
|
|
11
|
-
type?: string,
|
|
12
|
-
fieldApiName: string,
|
|
13
|
-
alias?: I18ns,
|
|
14
|
-
concatText?: {
|
|
15
|
-
zh_CN?: Object[],
|
|
16
|
-
en_US?: Object[],
|
|
17
|
-
},
|
|
18
|
-
color?: string,
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export type UIMetaFilterType = {
|
|
22
|
-
conditions: Object[],
|
|
23
|
-
logic: string,
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type UIMetaSortConditionsType = {
|
|
27
|
-
fieldApiName: string,
|
|
28
|
-
sort: string
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// desktop
|
|
32
|
-
export type DeskListTitleField = {
|
|
33
|
-
fieldApiName: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export type DeskListSubtitleField = {
|
|
37
|
-
type?: ("field" | "concatText"),
|
|
38
|
-
fieldApiName: string;
|
|
39
|
-
alias: I18ns;
|
|
40
|
-
concatText?: {
|
|
41
|
-
zh_CN: ConcatTextType[],
|
|
42
|
-
en_US: ConcatTextType[]
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export type DeskListDetailField = {
|
|
47
|
-
fieldApiName: string;
|
|
48
|
-
alias: I18ns;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export type UIMetaDesktopType = {
|
|
52
|
-
isCompositeType: boolean,
|
|
53
|
-
titleAreaText: I18ns,
|
|
54
|
-
objectApiName: string,
|
|
55
|
-
titleFields: FieldApiType[],
|
|
56
|
-
subtitleFields: FieldApiType[],
|
|
57
|
-
detailFields: FieldApiType[],
|
|
58
|
-
filter: UIMetaFilterType,
|
|
59
|
-
sortConditions: UIMetaSortConditionsType[],
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export type UIMetaLangType = {
|
|
63
|
-
dataType: string,
|
|
64
|
-
fieldApiName: string,
|
|
65
|
-
text: string,
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export type ConcatTextType = {
|
|
69
|
-
dataType: "fieldApiName" | "text"
|
|
70
|
-
fieldApiName: string;
|
|
71
|
-
text: string;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// mobile
|
|
75
|
-
export type UIMetaMobileType = {
|
|
76
|
-
pageType?: ("app" | "record_page")
|
|
77
|
-
pageApiName: string,
|
|
78
|
-
componentName: string,
|
|
79
|
-
titleAreaText: I18ns,
|
|
80
|
-
objectApiName: string,
|
|
81
|
-
listItems: MobileListItem,
|
|
82
|
-
filter: UIMetaFilterType,
|
|
83
|
-
sortConditions: UIMetaSortConditionsType[],
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export type MobileListField = {
|
|
87
|
-
fieldApiName: string;
|
|
88
|
-
hiddenWhenEmpty?: boolean;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export type MobileListItem = {
|
|
92
|
-
avatar: {
|
|
93
|
-
active: boolean;
|
|
94
|
-
fieldApiName: string;
|
|
95
|
-
},
|
|
96
|
-
titleFields: {
|
|
97
|
-
fieldApiName: string;
|
|
98
|
-
}[],
|
|
99
|
-
tagFields: {
|
|
100
|
-
fieldApiName: string;
|
|
101
|
-
color: "grey" | "blue" | "cyan" | "green" | "yellow" | "orange" | "red" | "magenta" | "purple" | "blueMagenta";
|
|
102
|
-
}[],
|
|
103
|
-
subtitleFields: MobileListField[],
|
|
104
|
-
detailFields: MobileListField[],
|
|
105
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objects.js","sourceRoot":"","sources":["objects.ts"],"names":[],"mappings":""}
|