@byted-apaas/server-sdk-node 0.0.1-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.
Files changed (163) hide show
  1. package/LICENSE +7 -0
  2. package/NOTICE +3 -0
  3. package/README.md +1 -0
  4. package/application/application.d.ts +27 -0
  5. package/application/application.js +2 -0
  6. package/application/application.ts +40 -0
  7. package/application/function/function.d.ts +14 -0
  8. package/application/function/function.js +21 -0
  9. package/application/function/function.ts +37 -0
  10. package/application/impl/common.d.ts +2 -0
  11. package/application/impl/common.js +50 -0
  12. package/application/impl/common.ts +50 -0
  13. package/application/impl/impl.d.ts +16 -0
  14. package/application/impl/impl.js +38 -0
  15. package/application/impl/impl.ts +48 -0
  16. package/constants/constants.d.ts +10 -0
  17. package/constants/constants.js +15 -0
  18. package/constants/constants.ts +15 -0
  19. package/context/context.d.ts +74 -0
  20. package/context/context.js +25 -0
  21. package/context/context.ts +130 -0
  22. package/context/db/db.d.ts +73 -0
  23. package/context/db/db.js +4 -0
  24. package/context/db/db.ts +80 -0
  25. package/context/db/impl/IObject.d.ts +251 -0
  26. package/context/db/impl/IObject.js +5 -0
  27. package/context/db/impl/IObject.ts +247 -0
  28. package/context/db/impl/db.d.ts +61 -0
  29. package/context/db/impl/db.js +86 -0
  30. package/context/db/impl/db.ts +95 -0
  31. package/context/db/impl/object.d.ts +92 -0
  32. package/context/db/impl/object.js +524 -0
  33. package/context/db/impl/object.ts +631 -0
  34. package/context/db/impl/oql/ioql.d.ts +6 -0
  35. package/context/db/impl/oql/ioql.js +4 -0
  36. package/context/db/impl/oql/ioql.ts +9 -0
  37. package/context/db/impl/oql/oql.d.ts +8 -0
  38. package/context/db/impl/oql/oql.js +21 -0
  39. package/context/db/impl/oql/oql.ts +25 -0
  40. package/context/db/impl/order.d.ts +9 -0
  41. package/context/db/impl/order.js +15 -0
  42. package/context/db/impl/order.ts +19 -0
  43. package/context/db/impl/propertiesStore.d.ts +8 -0
  44. package/context/db/impl/propertiesStore.js +29 -0
  45. package/context/db/impl/propertiesStore.ts +31 -0
  46. package/context/db/impl/queryBuilder.d.ts +29 -0
  47. package/context/db/impl/queryBuilder.js +78 -0
  48. package/context/db/impl/queryBuilder.ts +106 -0
  49. package/context/db/impl/transaction/index.d.ts +20 -0
  50. package/context/db/impl/transaction/index.js +277 -0
  51. package/context/db/impl/transaction/index.ts +340 -0
  52. package/context/db/impl/transaction/operation.d.ts +27 -0
  53. package/context/db/impl/transaction/operation.js +69 -0
  54. package/context/db/impl/transaction/operation.ts +72 -0
  55. package/context/db/impl/transaction.d.ts +67 -0
  56. package/context/db/impl/transaction.js +4 -0
  57. package/context/db/impl/transaction.ts +79 -0
  58. package/context/globalConfig/globalConfig.d.ts +7 -0
  59. package/context/globalConfig/globalConfig.js +16 -0
  60. package/context/globalConfig/globalConfig.ts +14 -0
  61. package/context/metadata/components/common.d.ts +6 -0
  62. package/context/metadata/components/common.js +17 -0
  63. package/context/metadata/components/common.ts +22 -0
  64. package/context/metadata/components/components.d.ts +12 -0
  65. package/context/metadata/components/components.js +19 -0
  66. package/context/metadata/components/components.ts +22 -0
  67. package/context/metadata/components/desktop/list.d.ts +16 -0
  68. package/context/metadata/components/desktop/list.js +402 -0
  69. package/context/metadata/components/desktop/list.ts +457 -0
  70. package/context/metadata/components/desktop/recordDetail.d.ts +11 -0
  71. package/context/metadata/components/desktop/recordDetail.js +53 -0
  72. package/context/metadata/components/desktop/recordDetail.ts +67 -0
  73. package/context/metadata/components/mobile/list.d.ts +24 -0
  74. package/context/metadata/components/mobile/list.js +145 -0
  75. package/context/metadata/components/mobile/list.ts +179 -0
  76. package/context/metadata/metadata.d.ts +61 -0
  77. package/context/metadata/metadata.js +103 -0
  78. package/context/metadata/metadata.ts +178 -0
  79. package/context/metadata/objects/fields.d.ts +130 -0
  80. package/context/metadata/objects/fields.js +334 -0
  81. package/context/metadata/objects/fields.ts +457 -0
  82. package/context/metadata/objects/fields.util.d.ts +40 -0
  83. package/context/metadata/objects/fields.util.js +319 -0
  84. package/context/metadata/objects/fields.util.ts +360 -0
  85. package/context/metadata/objects/objects.d.ts +11 -0
  86. package/context/metadata/objects/objects.js +20 -0
  87. package/context/metadata/objects/objects.ts +30 -0
  88. package/context/metadata/types/common.d.ts +6 -0
  89. package/context/metadata/types/common.js +9 -0
  90. package/context/metadata/types/common.ts +13 -0
  91. package/context/metadata/types/components.d.ts +90 -0
  92. package/context/metadata/types/components.js +4 -0
  93. package/context/metadata/types/components.ts +108 -0
  94. package/context/metadata/types/objects.d.ts +226 -0
  95. package/context/metadata/types/objects.js +4 -0
  96. package/context/metadata/types/objects.ts +254 -0
  97. package/context/msg/msg.d.ts +38 -0
  98. package/context/msg/msg.js +35 -0
  99. package/context/msg/msg.ts +52 -0
  100. package/context/resources/IResources.d.ts +66 -0
  101. package/context/resources/IResources.js +2 -0
  102. package/context/resources/IResources.ts +73 -0
  103. package/context/resources/impl/resources.d.ts +42 -0
  104. package/context/resources/impl/resources.js +150 -0
  105. package/context/resources/impl/resources.ts +173 -0
  106. package/context/tasks/tasks.d.ts +33 -0
  107. package/context/tasks/tasks.js +139 -0
  108. package/context/tasks/tasks.ts +159 -0
  109. package/data/index.d.ts +27 -0
  110. package/data/index.js +4 -0
  111. package/data/index.ts +30 -0
  112. package/hooks/api.d.ts +61 -0
  113. package/hooks/api.js +327 -0
  114. package/hooks/api.ts +341 -0
  115. package/hooks/hooks.d.ts +1 -0
  116. package/hooks/hooks.js +88 -0
  117. package/hooks/hooks.ts +100 -0
  118. package/kunlun/kunlun.d.ts +55 -0
  119. package/kunlun/kunlun.js +58 -0
  120. package/kunlun/kunlun.ts +72 -0
  121. package/kunlun/operator/IOperator.d.ts +158 -0
  122. package/kunlun/operator/IOperator.js +4 -0
  123. package/kunlun/operator/IOperator.ts +166 -0
  124. package/kunlun/operator/impl/expression.d.ts +47 -0
  125. package/kunlun/operator/impl/expression.js +56 -0
  126. package/kunlun/operator/impl/expression.ts +74 -0
  127. package/kunlun/operator/impl/logic.d.ts +50 -0
  128. package/kunlun/operator/impl/logic.js +509 -0
  129. package/kunlun/operator/impl/logic.ts +598 -0
  130. package/kunlun/operator/impl/logicV2.d.ts +58 -0
  131. package/kunlun/operator/impl/logicV2.js +200 -0
  132. package/kunlun/operator/impl/logicV2.ts +254 -0
  133. package/kunlun/operator/impl/operator.d.ts +179 -0
  134. package/kunlun/operator/impl/operator.js +222 -0
  135. package/kunlun/operator/impl/operator.ts +258 -0
  136. package/kunlun/operator/impl/operatorV2.d.ts +180 -0
  137. package/kunlun/operator/impl/operatorV2.js +216 -0
  138. package/kunlun/operator/impl/operatorV2.ts +249 -0
  139. package/lib/core.d.ts +4 -0
  140. package/lib/core.js +19 -0
  141. package/lib/core.ts +7 -0
  142. package/package.json +50 -0
  143. package/request/common.d.ts +13 -0
  144. package/request/common.js +87 -0
  145. package/request/common.ts +91 -0
  146. package/request/constants.d.ts +10 -0
  147. package/request/constants.js +25 -0
  148. package/request/constants.ts +25 -0
  149. package/request/faasinfra.d.ts +8 -0
  150. package/request/faasinfra.js +358 -0
  151. package/request/faasinfra.ts +393 -0
  152. package/request/innerapi.d.ts +67 -0
  153. package/request/innerapi.js +1412 -0
  154. package/request/innerapi.ts +1648 -0
  155. package/request/interface.d.ts +95 -0
  156. package/request/interface.js +41 -0
  157. package/request/interface.ts +169 -0
  158. package/request/openapi.d.ts +69 -0
  159. package/request/openapi.js +1014 -0
  160. package/request/openapi.ts +1223 -0
  161. package/types/types.d.ts +79 -0
  162. package/types/types.js +4 -0
  163. package/types/types.ts +108 -0
@@ -0,0 +1,457 @@
1
+ // Copyright 2022 ByteDance Ltd. and/or its affiliates
2
+ // SPDX-License-Identifier: MIT
3
+
4
+ import {
5
+ BaseFieldType,
6
+ FieldType, FilterType,
7
+ SortConditionType,
8
+ SubOptionType
9
+ } from "../types/objects";
10
+ import * as fieldsUtil from './fields.util'
11
+ import {I18ns} from "../types/common";
12
+ import {getSettingsSort} from "./fields.util";
13
+
14
+ class MetadataField {
15
+ type: string;
16
+ apiName: string;
17
+ label: I18ns;
18
+
19
+ constructor(type: string, field: FieldType) {
20
+ this.type = type;
21
+ this.apiName = field.api_name;
22
+ this.label = field.label;
23
+ }
24
+ }
25
+
26
+ class KText extends MetadataField {
27
+ required: boolean; // 默认值:false
28
+ unique: boolean; // 默认值:false
29
+ caseSensitive: boolean; // unique 为 false 时生效,默认值:true
30
+ multiline: boolean; // 默认值:false
31
+ maxLength: number; // 默认值:1000
32
+ validationRegex: string; // 正则校验的表达式
33
+ errorMsg: I18ns;
34
+
35
+ constructor(field: FieldType) {
36
+ if (!field) {
37
+ return;
38
+ }
39
+ super("text", field);
40
+
41
+ this.required = field["required"];
42
+ this.unique = fieldsUtil.getUnique(field);
43
+ this.caseSensitive = fieldsUtil.getCaseSensitive(field);
44
+ this.multiline = fieldsUtil.getMultiline(field);
45
+ this.maxLength = fieldsUtil.getMaxLength(field);
46
+ this.validationRegex = fieldsUtil.getRegexpExpression(field);
47
+ this.errorMsg = fieldsUtil.getRegexpErrMsg(field);
48
+ }
49
+ }
50
+
51
+ class RichText extends MetadataField {
52
+ maxLength: number;
53
+ required: boolean;
54
+
55
+ constructor(field: FieldType) {
56
+ if (!field) {
57
+ return;
58
+ }
59
+ super("richText", field);
60
+
61
+ this.maxLength = fieldsUtil.getMaxLength(field);
62
+ this.required = field.required;
63
+ }
64
+ }
65
+
66
+ class Multilingual extends MetadataField {
67
+ required: boolean; // 默认值:false
68
+ unique: boolean; // 默认值:false
69
+ caseSensitive: boolean; // unique 为 ture 时生效,默认值:true
70
+ multiline: boolean; // 默认值:false
71
+ maxLength: number; // 默认值:1000
72
+
73
+ constructor(field: FieldType) {
74
+ if (!field) {
75
+ return;
76
+ }
77
+ super("multilingual", field);
78
+
79
+ this.required = field.required;
80
+ this.unique = fieldsUtil.getUnique(field);
81
+ this.caseSensitive = fieldsUtil.getCaseSensitive(field);
82
+ this.multiline = fieldsUtil.getMultiline(field);
83
+ this.maxLength = fieldsUtil.getMaxLength(field);
84
+ }
85
+ }
86
+
87
+ class Number extends MetadataField {
88
+ required: boolean; // 默认值:false
89
+ unique: boolean; // 默认值:false
90
+ displayAsPercentage: boolean; // 默认值:false
91
+ decimalPlacesNumber: number;
92
+
93
+ constructor(field: FieldType) {
94
+ if (!field) {
95
+ return;
96
+ }
97
+ super("number", field);
98
+
99
+ this.required = field.required;
100
+ this.unique = fieldsUtil.getUnique(field);
101
+ this.displayAsPercentage = fieldsUtil.getDisplayAsPercentage(field);
102
+ this.decimalPlacesNumber = fieldsUtil.getDecimalPlaces(field);
103
+ }
104
+ }
105
+
106
+ class KDate extends MetadataField {
107
+ required: boolean; // 默认值:false
108
+ constructor(field: FieldType) {
109
+ if (!field) {
110
+ return;
111
+ }
112
+ super("date", field);
113
+ this.required = field.required;
114
+ }
115
+ }
116
+
117
+ class DateTime extends MetadataField {
118
+ required: boolean; // 默认值:false
119
+ constructor(field: FieldType) {
120
+ if (!field) {
121
+ return;
122
+ }
123
+ super("dateTime", field);
124
+ this.required = field.required;
125
+ }
126
+ }
127
+
128
+ class Option extends MetadataField {
129
+ required: boolean; // 默认值:false
130
+ multiple: boolean; // 默认值:false
131
+ optionSource: ("custom" | "global"); // 对应选项字段的「选项来源」属性(分为「自定义选项」和「使用全局选项), 默认值:"custom"
132
+ globalOptionApiName: string; // 关联全局选项的 apiName(创建字段时,设定 optionSource 为 "custom",则无需传入,且生成的元数据中不包含该属性)
133
+ optionList: SubOptionType[];
134
+
135
+ constructor(field: FieldType) {
136
+ if (!field) {
137
+ return;
138
+ }
139
+ super("option", field);
140
+ this.required = field.required;
141
+ this.multiple = fieldsUtil.getMultiple(field);
142
+ this.optionSource = fieldsUtil.getOptionSource(field);
143
+ this.globalOptionApiName = fieldsUtil.getGlobalOptionApiName(field);
144
+ this.optionList = fieldsUtil.getOptionList(field);
145
+ }
146
+ }
147
+
148
+ class Email extends MetadataField {
149
+ required: boolean; // 默认值:false
150
+ unique: boolean; // 默认值:false
151
+
152
+ constructor(field: FieldType) {
153
+ if (!field) {
154
+ return;
155
+ }
156
+ super("email", field);
157
+ this.required = field.required;
158
+ this.unique = fieldsUtil.getUnique(field);
159
+ }
160
+ }
161
+
162
+ class MobileNumber extends MetadataField {
163
+ required: boolean; // 默认值:false
164
+ unique: boolean; // 默认值:false
165
+
166
+ constructor(field: FieldType) {
167
+ if (!field) {
168
+ return;
169
+ }
170
+ super("mobileNumber", field);
171
+ this.required = field.required;
172
+ this.unique = fieldsUtil.getUnique(field);
173
+ }
174
+ }
175
+
176
+ class Boolean extends MetadataField {
177
+ descriptionWhenTrue: I18ns;
178
+ descriptionWhenFalse: I18ns;
179
+ defaultValue: boolean;
180
+ unique: boolean; // 文档没有
181
+
182
+ constructor(field: FieldType) {
183
+ if (!field) {
184
+ return;
185
+ }
186
+ super("boolean", field);
187
+ this.unique = fieldsUtil.getUnique(field);
188
+ this.descriptionWhenTrue = fieldsUtil.getDescriptionWhenTrue(field);
189
+ this.descriptionWhenFalse = fieldsUtil.getDescriptionWhenFalse(field);
190
+ this.defaultValue = fieldsUtil.getDefaultValue(field);
191
+ }
192
+ }
193
+
194
+ class AvatarOrLogo extends MetadataField {
195
+ displayStyle: ("square" | "round"); // 默认值:"square"
196
+ constructor(field: FieldType) {
197
+ if (!field) {
198
+ return;
199
+ }
200
+ super("avatarOrLogo", field);
201
+ this.displayStyle = fieldsUtil.getDisplayStyle(field) as any;
202
+ }
203
+ }
204
+
205
+ class Lookup extends MetadataField {
206
+ required: boolean; // 默认值:false
207
+ multiple: boolean; // 默认值:false,对应查找字段的「关联记录数」属性(分为「单条」和「多条」)
208
+ objectApiName: string; // 字段 look up 的对象
209
+ hierarchy: boolean; // 默认值:false,multiple 为 false 时生效
210
+ displayStyle: ("search" | "dropDown" | "tree"); // 默认值:"dropDown",对应查找字段的「关联记录展示方式」属性,仅当 hierarchy 为 true 时才可设置为 "tree"
211
+ sortConditions: SortConditionType[];
212
+ filter: FilterType[];
213
+
214
+ constructor(field: FieldType) {
215
+ if (!field) {
216
+ return;
217
+ }
218
+ super("lookup", field);
219
+ this.required = field.required;
220
+ this.multiple = fieldsUtil.getMultiple(field);
221
+ this.objectApiName = fieldsUtil.getLookupRefObjectApiName(field);
222
+ this.hierarchy = fieldsUtil.getLookupIsHierarchy(field);
223
+ this.displayStyle = fieldsUtil.getLookupDisplayStyle(field) as any;
224
+ // TODO
225
+ this.sortConditions = fieldsUtil.getSettingsSort(field);
226
+ this.filter = [];
227
+ }
228
+ }
229
+
230
+ class Formula extends MetadataField {
231
+ returnType: string; // 对应公式字段的「公式返回值类型」属性
232
+ formula: I18ns;
233
+
234
+ constructor(field: FieldType) {
235
+ if (!field) {
236
+ return;
237
+ }
238
+ super("formula", field);
239
+ this.returnType = fieldsUtil.getReturnType(field);
240
+ // TODO 由于下游提供仍是 api ID 版本,因此禁用
241
+ this.formula = null; //fieldsUtil.getFormula(field);
242
+ }
243
+ }
244
+
245
+ class AutoID extends MetadataField {
246
+ generateMethod: ("random" | "incremental"); // 默认值: "random"
247
+ digitsNumber: number;
248
+ prefix: string;
249
+ suffix: string;
250
+
251
+ constructor(field: FieldType) {
252
+ if (!field) {
253
+ return;
254
+ }
255
+ super("autoId", field);
256
+ this.generateMethod = fieldsUtil.getGenerateMethod(field) as any;
257
+ this.digitsNumber = fieldsUtil.getDigitsNumber(field);
258
+ this.prefix = fieldsUtil.getPrefix(field);
259
+ this.suffix = fieldsUtil.getSuffix(field);
260
+ }
261
+ }
262
+
263
+ class ReferenceField extends MetadataField {
264
+ guideFieldApiName: string;
265
+ fieldApiName: string;
266
+
267
+ constructor(field: FieldType) {
268
+ if (!field) {
269
+ return;
270
+ }
271
+ super("referenceField", field);
272
+ // TODO: check objectApiName to guideFieldApiName
273
+ this.guideFieldApiName = fieldsUtil.getReferenceObjectApiName(field);
274
+ this.fieldApiName = fieldsUtil.getReferenceFieldApiName(field);
275
+ }
276
+ }
277
+
278
+ class File extends MetadataField {
279
+ required: boolean; // 默认值: false
280
+ multiple: boolean; // 默认值: false
281
+ fileTypes: string[]; // 支持 "jpeg"|"jpg"|"png"|"gif"|"pdf"|"docx"|"doc"|"xlsx"|"xls"|"pptx"|"ppt"|"csv"|"txt"|"json"|"mp4"|"zip"|"rar",同时支持 "*.doc" 的描述方式,当为空数组,或 null、undefined 时,默认支持「全部类型」
282
+
283
+ constructor(field: FieldType) {
284
+ if (!field) {
285
+ return;
286
+ }
287
+ super("file", field);
288
+ this.required = field.required;
289
+ this.multiple = fieldsUtil.getFileMultiple(field);
290
+ this.fileTypes = fieldsUtil.getFileTypes(field);
291
+ }
292
+ }
293
+
294
+ class BackLookup extends MetadataField {
295
+ // objectApiName: string; // TODO 由于下游提供仍是 api ID 版本,因此禁用
296
+ // fieldApiName: string; // 由于下游提供仍是 api ID 版本,因此禁用
297
+
298
+ constructor(field: FieldType) {
299
+ if (!field) {
300
+ return;
301
+ }
302
+ super("backLookup", field);
303
+ // TODO 由于下游提供仍是 api ID 版本,因此禁用
304
+ // this.objectApiName = fieldsUtil.getBackLookupObjectApiName(field);
305
+ // this.fieldApiName = fieldsUtil.getBackLookupFieldApiName(field); // TODO metadata返回值为空
306
+ }
307
+ }
308
+
309
+ class CompositeType extends MetadataField {
310
+ compositeTypeApiName: string; // 关联组合类型的 apiName,「主子对象」需求调整后,将不存在该 key
311
+ subFields: BaseFieldType[]; // 组合类型中的子字段的元数据
312
+ required: boolean; // 默认值: false
313
+ multiple: boolean; // 默认值: false
314
+
315
+ constructor(field: FieldType) {
316
+ if (!field) {
317
+ return;
318
+ }
319
+ super("compositeType", field);
320
+ this.required = field.required;
321
+ this.multiple = fieldsUtil.getSettingsMultiple(field);
322
+ this.compositeTypeApiName = fieldsUtil.getCompositeTypeApiName(field);
323
+ // TODO 字段类型转换
324
+ this.subFields = parseFields(fieldsUtil.getCompositeTypeSubFields(field));
325
+ }
326
+ }
327
+
328
+ class ExtractSingleRecord extends MetadataField {
329
+ compositeTypeApiName: string; // 关联组合类型的 apiName,「主子对象」需求调整后,将调整为「子表单」类型字段的 apiName
330
+ subFields: BaseFieldType[]; // 组合类型中的子字段的元数据
331
+ filter: FilterType[];
332
+ sortConditions: SortConditionType[];
333
+ recordPosition: number; // 默认值: 1,对应多值取单值字段的「返回记录」(分为「第一条」、「最后一条」和「第 {{n}} 条」),取值为正整数时为相应位置的记录,取值为 -1 时为「最后一条」记录
334
+
335
+ constructor(field: FieldType) {
336
+ if (!field) {
337
+ return;
338
+ }
339
+ super("extractSingleRecord", field);
340
+ this.compositeTypeApiName = fieldsUtil.getCompositeTypeApiName(field);
341
+ // TODO 字段类型转换
342
+ this.subFields = parseFields(fieldsUtil.getCompositeTypeSubFields(field));
343
+ this.filter = fieldsUtil.getSettingsFilter(field);
344
+ this.sortConditions = fieldsUtil.getSettingsSort(field);
345
+ this.recordPosition = fieldsUtil.getRecordPosition(field);
346
+ }
347
+ }
348
+
349
+ function getCompositeTypeClass(field: FieldType): any {
350
+ if (field && field.type && field.type.settings && field.type.settings.is_extract) {
351
+ return ExtractSingleRecord;
352
+ }
353
+ return CompositeType;
354
+ }
355
+
356
+ function parseFields(inputFields: Record<string, any>): BaseFieldType[] {
357
+ if (!inputFields || !Array.isArray(inputFields)) {
358
+ return [];
359
+ }
360
+
361
+ let fields = [];
362
+ for (let field of inputFields) {
363
+ let FieldClass = getFieldClass(field);
364
+ if (!FieldClass) {
365
+ continue;
366
+ }
367
+
368
+ fields.push(new FieldClass(field));
369
+ }
370
+ return fields;
371
+ }
372
+
373
+ function parseField(field: FieldType): BaseFieldType {
374
+ let FieldClass = getFieldClass(field);
375
+ if (FieldClass) {
376
+ return new FieldClass(field);
377
+ }
378
+ return null;
379
+ }
380
+
381
+ function getFieldClass(field: FieldType): any {
382
+ if (field && field.type && field.type.name) {
383
+ if (field.type.name === "compositeType") {
384
+ return getCompositeTypeClass(field);
385
+ }
386
+ return type2fieldType[field.type.name];
387
+ }
388
+ return null;
389
+ }
390
+
391
+ const type2fieldType: Record<string, any> = {
392
+ "text": KText,
393
+ "multilingual": Multilingual,
394
+ "float": Number,
395
+ "date": KDate,
396
+ "datetime": DateTime,
397
+ "enum": Option,
398
+ "email": Email,
399
+ "phone": MobileNumber,
400
+ "boolean": Boolean,
401
+ "avatar": AvatarOrLogo,
402
+ "lookup": Lookup,
403
+ "formula": Formula,
404
+ "auto_number": AutoID,
405
+ "reference_field": ReferenceField,
406
+ "attachment": File,
407
+ "back_lookup": BackLookup,
408
+ "richText": RichText,
409
+ }
410
+
411
+ const fieldTypeMap: Record<string, string> = {
412
+ "text": "text",
413
+ "multilingual": "multilingual",
414
+ "number": "float",
415
+ "date": "date",
416
+ "dateTime": "datetime",
417
+ "option": "enum",
418
+ "email": "email",
419
+ "mobileNumber": "phone",
420
+ "boolean": "boolean",
421
+ "avatarOrLogo": "avatar",
422
+ "lookup": "lookup",
423
+ "formula": "formula",
424
+ "autoId": "auto_number",
425
+ "referenceField": "reference_field",
426
+ "file": "attachment",
427
+ "backLookup": "back_lookup",
428
+ "compositeType": "compositeType",
429
+ "extractSingleRecord": "compositeType",
430
+ "richText": "richText",
431
+ }
432
+
433
+ export {
434
+ KText as Text,
435
+ Multilingual,
436
+ Number,
437
+ KDate as Date,
438
+ DateTime,
439
+ Option,
440
+ Email,
441
+ MobileNumber,
442
+ Boolean,
443
+ AvatarOrLogo,
444
+ Lookup,
445
+ Formula,
446
+ AutoID,
447
+ ReferenceField,
448
+ File,
449
+ BackLookup,
450
+ CompositeType,
451
+ ExtractSingleRecord,
452
+ RichText,
453
+
454
+ parseFields,
455
+ parseField,
456
+ getFieldClass,
457
+ }
@@ -0,0 +1,40 @@
1
+ import { FieldType, FilterType, SortConditionType, SubOptionType } from "../types/objects";
2
+ import { I18ns } from "../types/common";
3
+ declare function getUnique(field: FieldType): boolean;
4
+ declare function getCaseSensitive(field: FieldType): boolean;
5
+ declare function getMultiline(field: FieldType): boolean;
6
+ declare function getMaxLength(field: FieldType): number;
7
+ declare function getRegexpExpression(field: FieldType): string;
8
+ declare function getRegexpErrMsg(field: FieldType): I18ns;
9
+ declare function getDisplayAsPercentage(field: FieldType): boolean;
10
+ declare function getDecimalPlaces(field: FieldType): number;
11
+ declare function getMultiple(field: FieldType): boolean;
12
+ declare function getOptionSource(field: FieldType): ("custom" | "global");
13
+ declare function getGlobalOptionApiName(field: FieldType): string;
14
+ declare function getOptionList(field: FieldType): SubOptionType[];
15
+ declare function getDescriptionWhenTrue(field: FieldType): I18ns;
16
+ declare function getDescriptionWhenFalse(field: FieldType): I18ns;
17
+ declare function getDefaultValue(field: FieldType): boolean;
18
+ declare function getDisplayStyle(field: FieldType): string;
19
+ declare function getLookupRefObjectApiName(field: FieldType): string;
20
+ declare function getLookupIsHierarchy(field: FieldType): boolean;
21
+ declare function getLookupDisplayStyle(field: FieldType): string;
22
+ declare function getReturnType(field: FieldType): string;
23
+ declare function getFormula(field: FieldType): I18ns;
24
+ declare function getGenerateMethod(field: FieldType): string;
25
+ declare function getDigitsNumber(field: FieldType): number;
26
+ declare function getPrefix(field: FieldType): string;
27
+ declare function getSuffix(field: FieldType): string;
28
+ declare function getReferenceObjectApiName(field: FieldType): string;
29
+ declare function getReferenceFieldApiName(field: FieldType): string;
30
+ declare function getFileMultiple(field: FieldType): boolean;
31
+ declare function getFileTypes(field: FieldType): string[];
32
+ declare function getBackLookupObjectApiName(field: FieldType): string;
33
+ declare function getBackLookupFieldApiName(field: FieldType): string;
34
+ declare function getSettingsMultiple(field: FieldType): boolean;
35
+ declare function getCompositeTypeApiName(field: FieldType): string;
36
+ declare function getCompositeTypeSubFields(field: FieldType): object[];
37
+ declare function getSettingsFilter(field: FieldType): FilterType[];
38
+ declare function getSettingsSort(field: FieldType): SortConditionType[];
39
+ declare function getRecordPosition(field: FieldType): number;
40
+ 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, };