apaas-oapi-client 0.1.36 → 0.1.37
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/.vscode/settings.json +9 -0
- package/README.md +67 -5
- package/dist/field-schema-rules.d.ts +35 -0
- package/dist/field-types.d.ts +313 -0
- package/dist/index.d.ts +313 -19
- package/dist/index.js +832 -0
- package/package.json +4 -5
- package/src/FIELD_SCHEMA_RULES.md +81 -0
- package/src/field-schema-rules.ts +336 -0
- package/src/field-types.ts +867 -0
- package/src/index.ts +276 -1
package/README.md
CHANGED
|
@@ -11,11 +11,19 @@
|
|
|
11
11
|
|
|
12
12
|
## ✨ **功能特性**
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
### 数据操作
|
|
15
15
|
- ✅ records 查询(支持分页迭代)
|
|
16
|
-
- ✅ record
|
|
17
|
-
- ✅ record
|
|
18
|
-
|
|
16
|
+
- ✅ record 单条查询、单条更新、单条删除
|
|
17
|
+
- ✅ record 批量创建、批量更新、批量删除
|
|
18
|
+
|
|
19
|
+
### 对象结构管理(Schema)
|
|
20
|
+
- ✅ **创建数据对象**(批量)
|
|
21
|
+
- ✅ **更新数据对象**(批量,支持添加/修改/删除字段)
|
|
22
|
+
- ✅ **删除数据对象**(批量)
|
|
23
|
+
- ✅ **字段类型完整文档**(20+ 字段类型,含示例)
|
|
24
|
+
|
|
25
|
+
### 其他功能
|
|
26
|
+
- ✅ 获取 accessToken(自动刷新)
|
|
19
27
|
- ✅ **导出数据对象文档为 Markdown**
|
|
20
28
|
- ✅ 内置 Bottleneck 限流器
|
|
21
29
|
- ✅ 自定义日志等级
|
|
@@ -30,6 +38,60 @@ npm install apaas-oapi-client
|
|
|
30
38
|
|
|
31
39
|
---
|
|
32
40
|
|
|
41
|
+
## � **快速开始**
|
|
42
|
+
|
|
43
|
+
### 创建数据对象
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import { apaas } from 'apaas-oapi-client';
|
|
47
|
+
|
|
48
|
+
const client = new apaas.Client({
|
|
49
|
+
clientId: 'your_client_id',
|
|
50
|
+
clientSecret: 'your_client_secret',
|
|
51
|
+
namespace: 'your_namespace'
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
await client.init();
|
|
55
|
+
|
|
56
|
+
// 创建数据对象
|
|
57
|
+
await client.schema.create({
|
|
58
|
+
objects: [{
|
|
59
|
+
api_name: 'product',
|
|
60
|
+
label: { zh_cn: '产品', en_us: 'Product' },
|
|
61
|
+
settings: {
|
|
62
|
+
display_name: 'code',
|
|
63
|
+
allow_search_fields: ['_id', 'code']
|
|
64
|
+
},
|
|
65
|
+
fields: [
|
|
66
|
+
{
|
|
67
|
+
api_name: 'code',
|
|
68
|
+
label: { zh_cn: '编号', en_us: 'Code' },
|
|
69
|
+
type: { name: 'text', settings: { required: true } },
|
|
70
|
+
encrypt_type: 'none'
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}]
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// 更新对象:添加字段
|
|
77
|
+
await client.schema.update({
|
|
78
|
+
objects: [{
|
|
79
|
+
api_name: 'product',
|
|
80
|
+
fields: [{
|
|
81
|
+
operator: 'add', // 添加新字段
|
|
82
|
+
api_name: 'name',
|
|
83
|
+
label: { zh_cn: '名称', en_us: 'Name' },
|
|
84
|
+
type: { name: 'text', settings: { required: true } },
|
|
85
|
+
encrypt_type: 'none'
|
|
86
|
+
}]
|
|
87
|
+
}]
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
33
93
|
## 📖 **使用文档**
|
|
34
94
|
|
|
35
|
-
- 完整说明、初始化示例与 API 用法请查看 [UserManual.md](./UserManual.md)
|
|
95
|
+
- 完整说明、初始化示例与 API 用法请查看 [UserManual.md](./UserManual.md)
|
|
96
|
+
- Schema 管理完整示例请查看 [examples/schema-operations.ts](./examples/schema-operations.ts)
|
|
97
|
+
- **关联字段创建示例**(lookup/lookup_multi/referenceField/rollup)请查看 [examples/schema-reference-fields.ts](./examples/schema-reference-fields.ts)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical field rules for schema.create/schema.update.
|
|
3
|
+
* Verified in namespace `package_5dc5b7__c` on 2026-02-10.
|
|
4
|
+
*
|
|
5
|
+
* Notes:
|
|
6
|
+
* - `metadataType` is usually the type name returned by object.metadata.fields.
|
|
7
|
+
* - Some entries are rule extensions for practical schema usage (`text_multiline`, `lookup_multi`).
|
|
8
|
+
* - `schemaType` is the type name that should be sent to schema.create/update.
|
|
9
|
+
*/
|
|
10
|
+
export type MetadataFieldType = 'text' | 'text_multiline' | 'bigint' | 'number' | 'date' | 'datetime' | 'option' | 'boolean' | 'lookup' | 'lookup_multi' | 'referenceField' | 'file' | 'autoId' | 'richText' | 'mobileNumber' | 'avatarOrLogo' | 'email' | 'region' | 'decimal' | 'multilingual';
|
|
11
|
+
export type SchemaFieldType = 'text' | 'bigint' | 'float' | 'date' | 'datetime' | 'enum' | 'boolean' | 'lookup' | 'reference_field' | 'attachment' | 'auto_number' | 'richText' | 'phone' | 'avatar' | 'email' | 'region' | 'decimal' | 'multilingual';
|
|
12
|
+
export interface FieldCreateRule {
|
|
13
|
+
metadataType: MetadataFieldType;
|
|
14
|
+
schemaType: SchemaFieldType;
|
|
15
|
+
settingsExample: Record<string, unknown>;
|
|
16
|
+
dependsOn?: string[];
|
|
17
|
+
notes?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const SCHEMA_TYPE_BY_METADATA_TYPE: Record<MetadataFieldType, SchemaFieldType>;
|
|
20
|
+
export declare const OPTION_COLOR_LIST: readonly ["blue", "cyan", "green", "yellow", "orange", "red", "magenta", "purple", "blueMagenta", "grey"];
|
|
21
|
+
export declare const FIELD_SCHEMA_RULES: FieldCreateRule[];
|
|
22
|
+
export declare const SCHEMA_TYPE_MISMATCHES: Array<{
|
|
23
|
+
metadataType: MetadataFieldType;
|
|
24
|
+
schemaType: SchemaFieldType;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const BATCH_UPDATE_REQUIREMENTS: {
|
|
27
|
+
readonly add: "Use operator=add with full field definition.";
|
|
28
|
+
readonly replace: "Use operator=replace and include full `type` (name + settings). Label-only replace fails.";
|
|
29
|
+
readonly remove: "Use operator=remove with api_name only.";
|
|
30
|
+
readonly dependencyOrder: {
|
|
31
|
+
readonly add: readonly ["lookup/lookup_multi before reference_field"];
|
|
32
|
+
readonly remove: readonly ["reference_field before lookup/lookup_multi"];
|
|
33
|
+
};
|
|
34
|
+
readonly referenceFieldConstraint: "reference_field only works with single lookup (`multiple: false`).";
|
|
35
|
+
};
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* aPaaS 数据对象 Schema 管理完整规范
|
|
3
|
+
*
|
|
4
|
+
* 本文档包含:
|
|
5
|
+
* 1. Schema 接口规范(创建、更新对象)
|
|
6
|
+
* 2. 字段类型完整定义(20+ 字段类型)
|
|
7
|
+
* 3. 系统字段说明(6 个自动创建字段)
|
|
8
|
+
* 4. 最佳实践和注意事项
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* 多语文本结构
|
|
12
|
+
*/
|
|
13
|
+
export interface MultilingualText {
|
|
14
|
+
zh_cn: string;
|
|
15
|
+
en_us: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 对象设置
|
|
19
|
+
*/
|
|
20
|
+
export interface ObjectSettings {
|
|
21
|
+
/** 可搜索字段列表 - 注意:不要包含 _name,会报错 */
|
|
22
|
+
allow_search_fields?: string[];
|
|
23
|
+
/** 展示名称字段 - 注意:不要使用 _name,应使用自定义字段 */
|
|
24
|
+
display_name?: string;
|
|
25
|
+
/** 搜索布局字段列表 */
|
|
26
|
+
search_layout?: string[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 字段类型定义
|
|
30
|
+
*/
|
|
31
|
+
export interface FieldTypeDefinition {
|
|
32
|
+
/** 字段类型名称 */
|
|
33
|
+
name: string;
|
|
34
|
+
/** 字段类型设置(根据不同类型有不同的结构) */
|
|
35
|
+
settings?: any;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 加密类型枚举
|
|
39
|
+
*/
|
|
40
|
+
export type EncryptType = 'none' | 'rand' | 'fix' | 'ope';
|
|
41
|
+
/**
|
|
42
|
+
* 字段操作类型(用于 update 接口)
|
|
43
|
+
*/
|
|
44
|
+
export type FieldOperator = 'add' | 'replace' | 'remove';
|
|
45
|
+
/**
|
|
46
|
+
* 创建对象时的字段定义
|
|
47
|
+
*/
|
|
48
|
+
export interface CreateFieldDefinition {
|
|
49
|
+
/** 字段 API 名称(必填) */
|
|
50
|
+
api_name: string;
|
|
51
|
+
/** 字段标签(必填) */
|
|
52
|
+
label: MultilingualText;
|
|
53
|
+
/** 字段类型(必填) */
|
|
54
|
+
type: FieldTypeDefinition;
|
|
55
|
+
/** 加密类型(建议显式指定,默认 'none') */
|
|
56
|
+
encrypt_type?: EncryptType | null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 更新对象时的字段定义
|
|
60
|
+
*/
|
|
61
|
+
export interface UpdateFieldDefinition {
|
|
62
|
+
/** 操作类型(必填):add=添加字段, replace=修改字段, remove=删除字段 */
|
|
63
|
+
operator: FieldOperator;
|
|
64
|
+
/** 字段 API 名称(必填) */
|
|
65
|
+
api_name: string;
|
|
66
|
+
/** 字段标签(operator=add/replace 时需要) */
|
|
67
|
+
label?: MultilingualText;
|
|
68
|
+
/** 字段类型(operator=add/replace 时需要) */
|
|
69
|
+
type?: FieldTypeDefinition;
|
|
70
|
+
/** 加密类型(可选) */
|
|
71
|
+
encrypt_type?: EncryptType | null;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 创建对象的定义
|
|
75
|
+
*/
|
|
76
|
+
export interface CreateObjectDefinition {
|
|
77
|
+
/** 对象 API 名称(必填) */
|
|
78
|
+
api_name: string;
|
|
79
|
+
/** 对象标签(必填) */
|
|
80
|
+
label: MultilingualText;
|
|
81
|
+
/** 对象设置(可选) */
|
|
82
|
+
settings?: ObjectSettings;
|
|
83
|
+
/** 字段列表(必填,至少包含一个自定义字段) */
|
|
84
|
+
fields: CreateFieldDefinition[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 更新对象的定义
|
|
88
|
+
*/
|
|
89
|
+
export interface UpdateObjectDefinition {
|
|
90
|
+
/** 对象 API 名称(必填) */
|
|
91
|
+
api_name: string;
|
|
92
|
+
/** 对象标签(可选,不传则不修改) */
|
|
93
|
+
label?: MultilingualText;
|
|
94
|
+
/** 对象设置(可选,不传则不修改) */
|
|
95
|
+
settings?: ObjectSettings;
|
|
96
|
+
/** 字段列表(可选,不传则不修改字段) */
|
|
97
|
+
fields?: UpdateFieldDefinition[];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Schema 接口最佳实践和限制说明
|
|
101
|
+
*/
|
|
102
|
+
export declare const SCHEMA_GUIDELINES: {
|
|
103
|
+
/** 批量操作限制 */
|
|
104
|
+
readonly limits: {
|
|
105
|
+
readonly batch_size: 10;
|
|
106
|
+
};
|
|
107
|
+
/** 系统字段说明 */
|
|
108
|
+
readonly system_fields: {
|
|
109
|
+
readonly description: "系统字段会自动创建,不需要在 fields 数组中定义";
|
|
110
|
+
readonly fields: readonly ["_id", "_name", "_createdBy", "_createdAt", "_updatedBy", "_updatedAt"];
|
|
111
|
+
};
|
|
112
|
+
/** display_name 限制 */
|
|
113
|
+
readonly display_name: {
|
|
114
|
+
readonly restriction: "不能使用 _name 作为 display_name";
|
|
115
|
+
readonly reason: "系统会误认为是包含 NOW/TODAY 函数的公式";
|
|
116
|
+
readonly solution: "使用自定义字段(如 code、name 等)";
|
|
117
|
+
readonly example: "display_name: \"code\"";
|
|
118
|
+
};
|
|
119
|
+
/** allow_search_fields 限制 */
|
|
120
|
+
readonly allow_search_fields: {
|
|
121
|
+
readonly restriction: "不能包含 _name 字段";
|
|
122
|
+
readonly reason: "系统不允许在可搜索字段中使用包含公式的字段";
|
|
123
|
+
readonly solution: "只包含 _id 和其他自定义字段";
|
|
124
|
+
readonly example: "allow_search_fields: [\"_id\", \"code\", \"name\"]";
|
|
125
|
+
};
|
|
126
|
+
/** encrypt_type 说明 */
|
|
127
|
+
readonly encrypt_type: {
|
|
128
|
+
readonly required: true;
|
|
129
|
+
readonly description: "建议每个字段都显式指定 encrypt_type";
|
|
130
|
+
readonly options: {
|
|
131
|
+
readonly none: "不加密(默认)";
|
|
132
|
+
readonly rand: "非确定性加密";
|
|
133
|
+
readonly fix: "固定加密";
|
|
134
|
+
readonly ope: "保序加密";
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
/** operator 说明(用于 update) */
|
|
138
|
+
readonly operator: {
|
|
139
|
+
readonly required: true;
|
|
140
|
+
readonly description: "更新字段时必须指定操作类型";
|
|
141
|
+
readonly options: {
|
|
142
|
+
readonly add: {
|
|
143
|
+
readonly description: "添加新字段";
|
|
144
|
+
readonly required_fields: readonly ["api_name", "label", "type"];
|
|
145
|
+
};
|
|
146
|
+
readonly replace: {
|
|
147
|
+
readonly description: "修改现有字段";
|
|
148
|
+
readonly required_fields: readonly ["api_name"];
|
|
149
|
+
readonly note: "只传需要修改的属性";
|
|
150
|
+
};
|
|
151
|
+
readonly remove: {
|
|
152
|
+
readonly description: "删除字段";
|
|
153
|
+
readonly required_fields: readonly ["api_name"];
|
|
154
|
+
readonly note: "只需要 api_name";
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
/** 关联字段说明 */
|
|
159
|
+
readonly reference_fields: {
|
|
160
|
+
readonly description: "关联字段用于在对象之间建立关联关系";
|
|
161
|
+
readonly types: {
|
|
162
|
+
readonly lookup: {
|
|
163
|
+
readonly description: "关联对象(单值)- 关联另一个对象的单条记录";
|
|
164
|
+
readonly settings: {
|
|
165
|
+
readonly objectAPIName: "目标对象的 API 名称(必填)";
|
|
166
|
+
readonly required: "是否必填(可选)";
|
|
167
|
+
readonly displayStyle: "显示样式(可选)";
|
|
168
|
+
};
|
|
169
|
+
readonly example: "type: { name: \"lookup\", settings: { objectAPIName: \"supplier\" } }";
|
|
170
|
+
readonly write_format: "写入时只需要 _id:{ supplier: { _id: 123456 } }";
|
|
171
|
+
};
|
|
172
|
+
readonly lookup_multi: {
|
|
173
|
+
readonly description: "关联对象(多值)- 关联另一个对象的多条记录";
|
|
174
|
+
readonly settings: {
|
|
175
|
+
readonly objectAPIName: "目标对象的 API 名称(必填)";
|
|
176
|
+
readonly multiple: "true(多选)";
|
|
177
|
+
};
|
|
178
|
+
readonly limit: "最多可以关联 200 条记录";
|
|
179
|
+
readonly example: "type: { name: \"lookup_multi\", settings: { objectAPIName: \"category\", multiple: true } }";
|
|
180
|
+
readonly write_format: "写入时提供多个 _id:{ categories: [{ _id: 111 }, { _id: 222 }] }";
|
|
181
|
+
};
|
|
182
|
+
readonly referenceField: {
|
|
183
|
+
readonly description: "引用字段 - 引用关联对象中的字段值(系统自动维护,不可直接写入)";
|
|
184
|
+
readonly settings: {
|
|
185
|
+
readonly guideFieldAPIName: "引导字段(lookup 字段)";
|
|
186
|
+
readonly fieldAPIName: "引用的目标字段";
|
|
187
|
+
readonly referenceObjectApiName: "引用的对象";
|
|
188
|
+
};
|
|
189
|
+
readonly example: "type: { name: \"referenceField\", settings: { guideFieldAPIName: \"supplier\", fieldAPIName: \"name\", referenceObjectApiName: \"supplier\" } }";
|
|
190
|
+
readonly note: "系统根据 lookup 字段自动计算,不能直接写入数据";
|
|
191
|
+
};
|
|
192
|
+
readonly rollup: {
|
|
193
|
+
readonly description: "汇总字段 - 对关联对象的数据进行聚合计算(系统自动维护,不可直接写入)";
|
|
194
|
+
readonly settings: {
|
|
195
|
+
readonly objectAPIName: "被汇总的对象";
|
|
196
|
+
readonly lookupFieldAPIName: "关联字段(当前对象中的 lookup 字段)";
|
|
197
|
+
readonly fieldAPIName: "要汇总的字段";
|
|
198
|
+
readonly functionType: "汇总函数:sum/avg/count/max/min/countDistinct";
|
|
199
|
+
readonly rangeFilter: "过滤条件(可选)";
|
|
200
|
+
};
|
|
201
|
+
readonly example: "type: { name: \"rollup\", settings: { objectAPIName: \"order_item\", lookupFieldAPIName: \"order\", fieldAPIName: \"amount\", functionType: \"sum\" } }";
|
|
202
|
+
readonly note: "系统根据关联数据自动汇总,不能直接写入数据";
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
readonly prerequisites: {
|
|
206
|
+
readonly description: "创建关联字段的前置条件";
|
|
207
|
+
readonly rules: readonly ["目标对象必须已存在", "objectAPIName 必须准确(区分大小写)", "referenceField 和 rollup 依赖的 lookup 字段必须先创建", "删除 lookup 字段前,需要先删除依赖它的 referenceField 和 rollup 字段"];
|
|
208
|
+
};
|
|
209
|
+
readonly system_maintained: {
|
|
210
|
+
readonly description: "系统自动维护的字段不能直接写入数据";
|
|
211
|
+
readonly fields: readonly ["referenceField", "rollup", "formula"];
|
|
212
|
+
readonly reason: "这些字段的值由系统根据其他字段或公式自动计算";
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
/** 响应结构说明 */
|
|
216
|
+
readonly response: {
|
|
217
|
+
readonly structure: "双层响应结构";
|
|
218
|
+
readonly top_level: {
|
|
219
|
+
readonly code: "0 表示请求格式正确";
|
|
220
|
+
readonly msg: "success";
|
|
221
|
+
readonly data: "包含 items 数组";
|
|
222
|
+
};
|
|
223
|
+
readonly item_level: {
|
|
224
|
+
readonly description: "每个对象的实际创建/更新状态";
|
|
225
|
+
readonly location: "data.items[].status";
|
|
226
|
+
readonly check: "需要检查 status.code 判断是否真正成功";
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* 创建对象示例
|
|
232
|
+
*/
|
|
233
|
+
export declare const CREATE_OBJECT_EXAMPLE: CreateObjectDefinition;
|
|
234
|
+
/**
|
|
235
|
+
* 更新对象示例(添加字段)
|
|
236
|
+
*/
|
|
237
|
+
export declare const UPDATE_OBJECT_ADD_FIELD_EXAMPLE: UpdateObjectDefinition;
|
|
238
|
+
/**
|
|
239
|
+
* 更新对象示例(修改字段)
|
|
240
|
+
*/
|
|
241
|
+
export declare const UPDATE_OBJECT_REPLACE_FIELD_EXAMPLE: UpdateObjectDefinition;
|
|
242
|
+
/**
|
|
243
|
+
* 更新对象示例(删除字段)
|
|
244
|
+
*/
|
|
245
|
+
export declare const UPDATE_OBJECT_REMOVE_FIELD_EXAMPLE: UpdateObjectDefinition;
|
|
246
|
+
/**
|
|
247
|
+
* 更新对象示例(只修改标签和设置)
|
|
248
|
+
*/
|
|
249
|
+
export declare const UPDATE_OBJECT_SETTINGS_EXAMPLE: UpdateObjectDefinition;
|
|
250
|
+
/**
|
|
251
|
+
* 字段类型元数据接口
|
|
252
|
+
*/
|
|
253
|
+
export interface FieldTypeMetadata {
|
|
254
|
+
/** API 名称 */
|
|
255
|
+
api_name: string;
|
|
256
|
+
/** 字段类型中文名称 */
|
|
257
|
+
label: string;
|
|
258
|
+
/** 存储数据类型 */
|
|
259
|
+
storage_type: 'String' | 'Number' | 'Boolean' | 'Object' | 'Array';
|
|
260
|
+
/** 是否为系统字段 */
|
|
261
|
+
is_system: boolean;
|
|
262
|
+
/** 字段描述 */
|
|
263
|
+
description: string;
|
|
264
|
+
/** 存储示例 */
|
|
265
|
+
example: any;
|
|
266
|
+
/** 特殊说明 */
|
|
267
|
+
notes?: string;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* aPaaS 平台所有字段类型定义
|
|
271
|
+
*/
|
|
272
|
+
export declare const FIELD_TYPES: Record<string, FieldTypeMetadata>;
|
|
273
|
+
/**
|
|
274
|
+
* 系统默认字段列表(每个对象都会自动创建)
|
|
275
|
+
*/
|
|
276
|
+
export declare const SYSTEM_FIELDS: readonly ["_id", "_name", "_createdBy", "_createdAt", "_updatedBy", "_updatedAt"];
|
|
277
|
+
/**
|
|
278
|
+
* 获取系统字段
|
|
279
|
+
*/
|
|
280
|
+
export declare function getSystemFields(): FieldTypeMetadata[];
|
|
281
|
+
/**
|
|
282
|
+
* 获取自定义字段类型
|
|
283
|
+
*/
|
|
284
|
+
export declare function getCustomFieldTypes(): FieldTypeMetadata[];
|
|
285
|
+
/**
|
|
286
|
+
* 根据 API 名称获取字段类型信息
|
|
287
|
+
*/
|
|
288
|
+
export declare function getFieldType(apiName: string): FieldTypeMetadata | undefined;
|
|
289
|
+
/**
|
|
290
|
+
* 判断是否为系统字段
|
|
291
|
+
*/
|
|
292
|
+
export declare function isSystemField(apiName: string): boolean;
|
|
293
|
+
/**
|
|
294
|
+
* 语言代码常量
|
|
295
|
+
*/
|
|
296
|
+
export declare const LANGUAGE_CODES: {
|
|
297
|
+
readonly EN_US: 1033;
|
|
298
|
+
readonly ZH_CN: 2052;
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* 多语文本辅助函数:创建多语文本对象
|
|
302
|
+
*/
|
|
303
|
+
export declare function createMultilingualText(zhCn: string, enUs?: string): Array<{
|
|
304
|
+
language_code: number;
|
|
305
|
+
text: string;
|
|
306
|
+
}>;
|
|
307
|
+
/**
|
|
308
|
+
* 多语文本辅助函数:从多语文本对象中提取文本
|
|
309
|
+
*/
|
|
310
|
+
export declare function extractMultilingualText(multilingualText: Array<{
|
|
311
|
+
language_code: number;
|
|
312
|
+
text: string;
|
|
313
|
+
}>, languageCode?: number): string;
|