@byted-apaas/server-sdk-node 0.0.2-beta.1
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.md +0 -0
- package/README.md +1 -0
- package/application/application.d.ts +27 -0
- package/application/application.js +3 -0
- package/application/application.js.map +1 -0
- package/application/application.ts +40 -0
- package/application/function/function.d.ts +14 -0
- package/application/function/function.js +22 -0
- package/application/function/function.js.map +1 -0
- package/application/function/function.ts +37 -0
- package/application/impl/common.d.ts +2 -0
- package/application/impl/common.js +51 -0
- package/application/impl/common.js.map +1 -0
- package/application/impl/common.ts +50 -0
- package/application/impl/impl.d.ts +16 -0
- package/application/impl/impl.js +39 -0
- package/application/impl/impl.js.map +1 -0
- package/application/impl/impl.ts +48 -0
- package/constants/constants.d.ts +10 -0
- package/constants/constants.js +14 -0
- package/constants/constants.js.map +1 -0
- package/constants/constants.ts +12 -0
- package/context/context.d.ts +74 -0
- package/context/context.js +24 -0
- package/context/context.js.map +1 -0
- package/context/context.ts +127 -0
- package/context/db/db.d.ts +73 -0
- package/context/db/db.js +3 -0
- package/context/db/db.js.map +1 -0
- package/context/db/db.ts +77 -0
- package/context/db/impl/IObject.d.ts +251 -0
- package/context/db/impl/IObject.js +4 -0
- package/context/db/impl/IObject.js.map +1 -0
- package/context/db/impl/IObject.ts +244 -0
- package/context/db/impl/db.d.ts +61 -0
- package/context/db/impl/db.js +87 -0
- package/context/db/impl/db.js.map +1 -0
- package/context/db/impl/db.ts +95 -0
- package/context/db/impl/object.d.ts +92 -0
- package/context/db/impl/object.js +523 -0
- package/context/db/impl/object.js.map +1 -0
- package/context/db/impl/object.ts +628 -0
- package/context/db/impl/oql/ioql.d.ts +6 -0
- package/context/db/impl/oql/ioql.js +3 -0
- package/context/db/impl/oql/ioql.js.map +1 -0
- package/context/db/impl/oql/ioql.ts +6 -0
- package/context/db/impl/oql/oql.d.ts +8 -0
- package/context/db/impl/oql/oql.js +20 -0
- package/context/db/impl/oql/oql.js.map +1 -0
- package/context/db/impl/oql/oql.ts +22 -0
- package/context/db/impl/order.d.ts +9 -0
- package/context/db/impl/order.js +14 -0
- package/context/db/impl/order.js.map +1 -0
- package/context/db/impl/order.ts +16 -0
- package/context/db/impl/propertiesStore.d.ts +8 -0
- package/context/db/impl/propertiesStore.js +28 -0
- package/context/db/impl/propertiesStore.js.map +1 -0
- package/context/db/impl/propertiesStore.ts +28 -0
- package/context/db/impl/queryBuilder.d.ts +29 -0
- package/context/db/impl/queryBuilder.js +77 -0
- package/context/db/impl/queryBuilder.js.map +1 -0
- package/context/db/impl/queryBuilder.ts +103 -0
- package/context/db/impl/transaction/index.d.ts +20 -0
- package/context/db/impl/transaction/index.js +276 -0
- package/context/db/impl/transaction/index.js.map +1 -0
- package/context/db/impl/transaction/index.ts +337 -0
- package/context/db/impl/transaction/operation.d.ts +27 -0
- package/context/db/impl/transaction/operation.js +70 -0
- package/context/db/impl/transaction/operation.js.map +1 -0
- package/context/db/impl/transaction/operation.ts +72 -0
- package/context/db/impl/transaction.d.ts +67 -0
- package/context/db/impl/transaction.js +3 -0
- package/context/db/impl/transaction.js.map +1 -0
- package/context/db/impl/transaction.ts +76 -0
- package/context/globalConfig/globalConfig.d.ts +7 -0
- package/context/globalConfig/globalConfig.js +15 -0
- package/context/globalConfig/globalConfig.js.map +1 -0
- package/context/globalConfig/globalConfig.ts +11 -0
- package/context/metadata/components/common.d.ts +6 -0
- package/context/metadata/components/common.js +16 -0
- package/context/metadata/components/common.js.map +1 -0
- package/context/metadata/components/common.ts +19 -0
- package/context/metadata/components/components.d.ts +12 -0
- package/context/metadata/components/components.js +18 -0
- package/context/metadata/components/components.js.map +1 -0
- package/context/metadata/components/components.ts +19 -0
- package/context/metadata/components/desktop/list.d.ts +16 -0
- package/context/metadata/components/desktop/list.js +403 -0
- package/context/metadata/components/desktop/list.js.map +1 -0
- package/context/metadata/components/desktop/list.ts +457 -0
- package/context/metadata/components/desktop/recordDetail.d.ts +11 -0
- package/context/metadata/components/desktop/recordDetail.js +52 -0
- package/context/metadata/components/desktop/recordDetail.js.map +1 -0
- package/context/metadata/components/desktop/recordDetail.ts +64 -0
- package/context/metadata/components/mobile/list.d.ts +24 -0
- package/context/metadata/components/mobile/list.js +144 -0
- package/context/metadata/components/mobile/list.js.map +1 -0
- package/context/metadata/components/mobile/list.ts +176 -0
- package/context/metadata/metadata.d.ts +61 -0
- package/context/metadata/metadata.js +102 -0
- package/context/metadata/metadata.js.map +1 -0
- package/context/metadata/metadata.ts +175 -0
- package/context/metadata/objects/fields.d.ts +130 -0
- package/context/metadata/objects/fields.js +333 -0
- package/context/metadata/objects/fields.js.map +1 -0
- package/context/metadata/objects/fields.ts +454 -0
- package/context/metadata/objects/fields.util.d.ts +40 -0
- package/context/metadata/objects/fields.util.js +320 -0
- package/context/metadata/objects/fields.util.js.map +1 -0
- package/context/metadata/objects/fields.util.ts +360 -0
- package/context/metadata/objects/objects.d.ts +11 -0
- package/context/metadata/objects/objects.js +19 -0
- package/context/metadata/objects/objects.js.map +1 -0
- package/context/metadata/objects/objects.ts +27 -0
- package/context/metadata/types/common.d.ts +6 -0
- package/context/metadata/types/common.js +8 -0
- package/context/metadata/types/common.js.map +1 -0
- package/context/metadata/types/common.ts +10 -0
- package/context/metadata/types/components.d.ts +90 -0
- package/context/metadata/types/components.js +3 -0
- package/context/metadata/types/components.js.map +1 -0
- package/context/metadata/types/components.ts +105 -0
- package/context/metadata/types/objects.d.ts +226 -0
- package/context/metadata/types/objects.js +3 -0
- package/context/metadata/types/objects.js.map +1 -0
- package/context/metadata/types/objects.ts +251 -0
- package/context/msg/msg.d.ts +38 -0
- package/context/msg/msg.js +34 -0
- package/context/msg/msg.js.map +1 -0
- package/context/msg/msg.ts +49 -0
- package/context/resources/IResources.d.ts +66 -0
- package/context/resources/IResources.js +3 -0
- package/context/resources/IResources.js.map +1 -0
- package/context/resources/IResources.ts +73 -0
- package/context/resources/impl/resources.d.ts +42 -0
- package/context/resources/impl/resources.js +149 -0
- package/context/resources/impl/resources.js.map +1 -0
- package/context/resources/impl/resources.ts +170 -0
- package/context/tasks/tasks.d.ts +33 -0
- package/context/tasks/tasks.js +140 -0
- package/context/tasks/tasks.js.map +1 -0
- package/context/tasks/tasks.ts +159 -0
- package/data/index.d.ts +27 -0
- package/data/index.js +5 -0
- package/data/index.js.map +1 -0
- package/data/index.ts +30 -0
- package/hooks/api.d.ts +61 -0
- package/hooks/api.js +328 -0
- package/hooks/api.js.map +1 -0
- package/hooks/api.ts +341 -0
- package/hooks/hooks.d.ts +1 -0
- package/hooks/hooks.js +89 -0
- package/hooks/hooks.js.map +1 -0
- package/hooks/hooks.ts +100 -0
- package/kunlun/kunlun.d.ts +55 -0
- package/kunlun/kunlun.js +57 -0
- package/kunlun/kunlun.js.map +1 -0
- package/kunlun/kunlun.ts +69 -0
- package/kunlun/operator/IOperator.d.ts +158 -0
- package/kunlun/operator/IOperator.js +3 -0
- package/kunlun/operator/IOperator.js.map +1 -0
- package/kunlun/operator/IOperator.ts +163 -0
- package/kunlun/operator/impl/expression.d.ts +47 -0
- package/kunlun/operator/impl/expression.js +55 -0
- package/kunlun/operator/impl/expression.js.map +1 -0
- package/kunlun/operator/impl/expression.ts +71 -0
- package/kunlun/operator/impl/logic.d.ts +50 -0
- package/kunlun/operator/impl/logic.js +508 -0
- package/kunlun/operator/impl/logic.js.map +1 -0
- package/kunlun/operator/impl/logic.ts +595 -0
- package/kunlun/operator/impl/logicV2.d.ts +58 -0
- package/kunlun/operator/impl/logicV2.js +201 -0
- package/kunlun/operator/impl/logicV2.js.map +1 -0
- package/kunlun/operator/impl/logicV2.ts +254 -0
- package/kunlun/operator/impl/operator.d.ts +179 -0
- package/kunlun/operator/impl/operator.js +221 -0
- package/kunlun/operator/impl/operator.js.map +1 -0
- package/kunlun/operator/impl/operator.ts +255 -0
- package/kunlun/operator/impl/operatorV2.d.ts +180 -0
- package/kunlun/operator/impl/operatorV2.js +217 -0
- package/kunlun/operator/impl/operatorV2.js.map +1 -0
- package/kunlun/operator/impl/operatorV2.ts +249 -0
- package/lib/core.d.ts +4 -0
- package/lib/core.js +18 -0
- package/lib/core.js.map +1 -0
- package/lib/core.ts +4 -0
- package/package.json +50 -0
- package/request/common.d.ts +13 -0
- package/request/common.js +88 -0
- package/request/common.js.map +1 -0
- package/request/common.ts +91 -0
- package/request/constants.d.ts +10 -0
- package/request/constants.js +26 -0
- package/request/constants.js.map +1 -0
- package/request/constants.ts +25 -0
- package/request/faasinfra.d.ts +8 -0
- package/request/faasinfra.js +359 -0
- package/request/faasinfra.js.map +1 -0
- package/request/faasinfra.ts +393 -0
- package/request/innerapi.d.ts +67 -0
- package/request/innerapi.js +1411 -0
- package/request/innerapi.js.map +1 -0
- package/request/innerapi.ts +1645 -0
- package/request/interface.d.ts +95 -0
- package/request/interface.js +40 -0
- package/request/interface.js.map +1 -0
- package/request/interface.ts +166 -0
- package/request/openapi.d.ts +69 -0
- package/request/openapi.js +1013 -0
- package/request/openapi.js.map +1 -0
- package/request/openapi.ts +1220 -0
- package/types/types.d.ts +79 -0
- package/types/types.js +3 -0
- package/types/types.js.map +1 -0
- package/types/types.ts +105 -0
|
@@ -0,0 +1,360 @@
|
|
|
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
|
+
}
|
|
@@ -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,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Object = void 0;
|
|
4
|
+
const fields = require("./fields");
|
|
5
|
+
class Objects {
|
|
6
|
+
constructor(obj) {
|
|
7
|
+
if (!obj) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
this.label = obj.label;
|
|
11
|
+
this.apiName = obj.api_name;
|
|
12
|
+
this.displayName = "";
|
|
13
|
+
this.searchSupplementaryInfo = [];
|
|
14
|
+
this.searchableFields = [];
|
|
15
|
+
this.fields = fields.parseFields(obj.fields);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.Object = Objects;
|
|
19
|
+
//# sourceMappingURL=objects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNullOrUndefined = void 0;
|
|
4
|
+
function isNullOrUndefined(param) {
|
|
5
|
+
return param === null || param === undefined;
|
|
6
|
+
}
|
|
7
|
+
exports.isNullOrUndefined = isNullOrUndefined;
|
|
8
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { I18ns } from "./common";
|
|
2
|
+
export declare type SelectFieldType = {
|
|
3
|
+
fieldPath: {
|
|
4
|
+
objectApiName: string;
|
|
5
|
+
fieldApiName: string;
|
|
6
|
+
}[];
|
|
7
|
+
};
|
|
8
|
+
export declare 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 declare type UIMetaFilterType = {
|
|
19
|
+
conditions: Object[];
|
|
20
|
+
logic: string;
|
|
21
|
+
};
|
|
22
|
+
export declare type UIMetaSortConditionsType = {
|
|
23
|
+
fieldApiName: string;
|
|
24
|
+
sort: string;
|
|
25
|
+
};
|
|
26
|
+
export declare type DeskListTitleField = {
|
|
27
|
+
fieldApiName: string;
|
|
28
|
+
};
|
|
29
|
+
export declare 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 declare type DeskListDetailField = {
|
|
39
|
+
fieldApiName: string;
|
|
40
|
+
alias: I18ns;
|
|
41
|
+
};
|
|
42
|
+
export declare 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 declare type UIMetaLangType = {
|
|
53
|
+
dataType: string;
|
|
54
|
+
fieldApiName: string;
|
|
55
|
+
text: string;
|
|
56
|
+
};
|
|
57
|
+
export declare type ConcatTextType = {
|
|
58
|
+
dataType: "fieldApiName" | "text";
|
|
59
|
+
fieldApiName: string;
|
|
60
|
+
text: string;
|
|
61
|
+
};
|
|
62
|
+
export declare 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 declare type MobileListField = {
|
|
73
|
+
fieldApiName: string;
|
|
74
|
+
hiddenWhenEmpty?: boolean;
|
|
75
|
+
};
|
|
76
|
+
export declare 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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["components.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
}
|