@byted-apaas/server-sdk-node 1.1.23-beta.9 → 1.1.23
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/package.json +2 -2
- package/application/application.d.ts +0 -33
- package/application/application.js +0 -2
- package/application/function/function.d.ts +0 -14
- package/application/function/function.js +0 -20
- package/application/impl/common.d.ts +0 -2
- package/application/impl/common.js +0 -52
- package/application/impl/impl.d.ts +0 -19
- package/application/impl/impl.js +0 -45
- package/common/structs.d.ts +0 -15
- package/common/structs.js +0 -21
- package/constants/constants.d.ts +0 -13
- package/constants/constants.js +0 -18
- package/context/context.d.ts +0 -44
- package/context/context.js +0 -25
- package/context/db/db.d.ts +0 -110
- package/context/db/db.js +0 -2
- package/context/db/impl/IObject.d.ts +0 -303
- package/context/db/impl/IObject.js +0 -5
- package/context/db/impl/IObjectV3.d.ts +0 -239
- package/context/db/impl/IObjectV3.js +0 -5
- package/context/db/impl/db.d.ts +0 -62
- package/context/db/impl/db.js +0 -84
- package/context/db/impl/dbV3.d.ts +0 -35
- package/context/db/impl/dbV3.js +0 -50
- package/context/db/impl/object.d.ts +0 -123
- package/context/db/impl/object.js +0 -1008
- package/context/db/impl/oql/ioql.d.ts +0 -14
- package/context/db/impl/oql/ioql.js +0 -4
- package/context/db/impl/oql/oql.d.ts +0 -14
- package/context/db/impl/oql/oql.js +0 -39
- package/context/db/impl/order.d.ts +0 -9
- package/context/db/impl/order.js +0 -15
- package/context/db/impl/propertiesStore.d.ts +0 -8
- package/context/db/impl/propertiesStore.js +0 -29
- package/context/db/impl/queryBuilder.d.ts +0 -33
- package/context/db/impl/queryBuilder.js +0 -72
- package/context/db/impl/transaction/index.d.ts +0 -25
- package/context/db/impl/transaction/index.js +0 -300
- package/context/db/impl/transaction/operation.d.ts +0 -27
- package/context/db/impl/transaction/operation.js +0 -69
- package/context/db/impl/transaction.d.ts +0 -70
- package/context/db/impl/transaction.js +0 -4
- package/context/globalConfig/globalConfig.d.ts +0 -7
- package/context/globalConfig/globalConfig.js +0 -16
- package/context/integration/IIntegration.d.ts +0 -30
- package/context/integration/IIntegration.js +0 -4
- package/context/integration/impl/integration.d.ts +0 -16
- package/context/integration/impl/integration.js +0 -62
- package/context/metadata/components/common.d.ts +0 -6
- package/context/metadata/components/common.js +0 -17
- package/context/metadata/components/components.d.ts +0 -12
- package/context/metadata/components/components.js +0 -19
- package/context/metadata/components/desktop/list.d.ts +0 -16
- package/context/metadata/components/desktop/list.js +0 -402
- package/context/metadata/components/desktop/recordDetail.d.ts +0 -11
- package/context/metadata/components/desktop/recordDetail.js +0 -53
- package/context/metadata/components/mobile/list.d.ts +0 -24
- package/context/metadata/components/mobile/list.js +0 -145
- package/context/metadata/metadata.d.ts +0 -63
- package/context/metadata/metadata.js +0 -125
- package/context/metadata/objects/fields.d.ts +0 -158
- package/context/metadata/objects/fields.js +0 -369
- package/context/metadata/objects/fields.util.d.ts +0 -52
- package/context/metadata/objects/fields.util.js +0 -420
- package/context/metadata/objects/fieldsV3.d.ts +0 -159
- package/context/metadata/objects/fieldsV3.js +0 -369
- package/context/metadata/objects/objects.d.ts +0 -11
- package/context/metadata/objects/objects.js +0 -20
- package/context/metadata/types/common.d.ts +0 -11
- package/context/metadata/types/common.js +0 -33
- package/context/metadata/types/components.d.ts +0 -90
- package/context/metadata/types/components.js +0 -4
- package/context/metadata/types/objects.d.ts +0 -246
- package/context/metadata/types/objects.js +0 -4
- package/context/metadata/types/objectsV3.d.ts +0 -128
- package/context/metadata/types/objectsV3.js +0 -4
- package/context/msg/msg.d.ts +0 -38
- package/context/msg/msg.js +0 -35
- package/context/resources/IResources.d.ts +0 -68
- package/context/resources/IResources.js +0 -2
- package/context/resources/impl/resources.d.ts +0 -42
- package/context/resources/impl/resources.js +0 -161
- package/context/tasks/tasks.d.ts +0 -33
- package/context/tasks/tasks.js +0 -139
- package/data/index.d.ts +0 -27
- package/data/index.js +0 -4
- package/global/application/flow/flow.d.ts +0 -99
- package/global/application/flow/flow.js +0 -8
- package/global/application/flow/impl/flow.d.ts +0 -20
- package/global/application/flow/impl/flow.js +0 -56
- package/global/application/globalVar/globalVar.d.ts +0 -7
- package/global/application/globalVar/globalVar.js +0 -2
- package/global/global.d.ts +0 -70
- package/global/global.js +0 -3
- package/hooks/api.d.ts +0 -65
- package/hooks/api.js +0 -347
- package/hooks/hooks.d.ts +0 -1
- package/hooks/hooks.js +0 -107
- package/kunlun/kunlun.d.ts +0 -55
- package/kunlun/kunlun.js +0 -58
- package/kunlun/operator/IOperator.d.ts +0 -158
- package/kunlun/operator/IOperator.js +0 -4
- package/kunlun/operator/impl/expression.d.ts +0 -75
- package/kunlun/operator/impl/expression.js +0 -96
- package/kunlun/operator/impl/logic.d.ts +0 -68
- package/kunlun/operator/impl/logic.js +0 -573
- package/kunlun/operator/impl/logicV2.d.ts +0 -59
- package/kunlun/operator/impl/logicV2.js +0 -197
- package/kunlun/operator/impl/operator.d.ts +0 -179
- package/kunlun/operator/impl/operator.js +0 -222
- package/kunlun/operator/impl/operatorV2.d.ts +0 -180
- package/kunlun/operator/impl/operatorV2.js +0 -216
- package/lib/core.d.ts +0 -4
- package/lib/core.js +0 -19
- package/request/common.d.ts +0 -13
- package/request/common.js +0 -88
- package/request/constants.d.ts +0 -12
- package/request/constants.js +0 -29
- package/request/faasinfra.d.ts +0 -8
- package/request/faasinfra.js +0 -146
- package/request/interface.d.ts +0 -121
- package/request/interface.js +0 -30
- package/request/openapi.d.ts +0 -84
- package/request/openapi.js +0 -1529
- package/request/structs.d.ts +0 -99
- package/request/structs.js +0 -15
- package/types/types.d.ts +0 -79
- package/types/types.js +0 -4
- package/version/version.d.ts +0 -2
- package/version/version.js +0 -8
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Component } from '../common';
|
|
2
|
-
import { SelectFieldType } from '../../types/components';
|
|
3
|
-
import { I18ns } from '../../types/common';
|
|
4
|
-
declare class RecordDetail extends Component {
|
|
5
|
-
titleAreaText: I18ns;
|
|
6
|
-
objectApiName: string;
|
|
7
|
-
selectedFields: SelectFieldType[];
|
|
8
|
-
constructor(params: Record<string, any>);
|
|
9
|
-
static parse(input: Record<string, any>): RecordDetail;
|
|
10
|
-
}
|
|
11
|
-
export { RecordDetail, };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2022 ByteDance Ltd. and/or its affiliates
|
|
3
|
-
// SPDX-License-Identifier: MIT
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.RecordDetail = void 0;
|
|
6
|
-
const common_1 = require("../common");
|
|
7
|
-
/*
|
|
8
|
-
titleAreaText: i18n;
|
|
9
|
-
objectApiName: string;
|
|
10
|
-
selectedFields: [{
|
|
11
|
-
fieldPath: [{
|
|
12
|
-
objectApiName: string;
|
|
13
|
-
fieldApiName: string;
|
|
14
|
-
}, ...];
|
|
15
|
-
},...]
|
|
16
|
-
*/
|
|
17
|
-
class RecordDetail extends common_1.Component {
|
|
18
|
-
constructor(params) {
|
|
19
|
-
super(common_1.componentTypes.desktopRecordDetail);
|
|
20
|
-
// TODO check
|
|
21
|
-
this.titleAreaText = params.titleAreaText;
|
|
22
|
-
this.objectApiName = params.objectApiName;
|
|
23
|
-
this.selectedFields = params.selectedFields;
|
|
24
|
-
}
|
|
25
|
-
static parse(input) {
|
|
26
|
-
return new RecordDetail({
|
|
27
|
-
titleAreaText: input.titleLabel,
|
|
28
|
-
objectApiName: input.objectApiName,
|
|
29
|
-
selectedFields: getSelectedFields(input),
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.RecordDetail = RecordDetail;
|
|
34
|
-
function getSelectedFields(input) {
|
|
35
|
-
if (!input || !input.selectedFields || !Array.isArray(input.selectedFields)) {
|
|
36
|
-
return [];
|
|
37
|
-
}
|
|
38
|
-
let selectedFields = [];
|
|
39
|
-
for (let selectedField of input.selectedFields) {
|
|
40
|
-
if (!selectedField || !selectedField.picker || !selectedField.picker.fieldPath) {
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
43
|
-
let fieldPath = [];
|
|
44
|
-
for (let field of selectedField.picker.fieldPath) {
|
|
45
|
-
fieldPath.push({
|
|
46
|
-
objectApiName: field.objectApiName,
|
|
47
|
-
fieldApiName: field.fieldApiName,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
selectedFields.push({ fieldPath: fieldPath });
|
|
51
|
-
}
|
|
52
|
-
return selectedFields;
|
|
53
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { MobileListItem, UIMetaFilterType, UIMetaMobileType } from '../../types/components';
|
|
2
|
-
import { I18ns } from '../../types/common';
|
|
3
|
-
import { Component } from '../common';
|
|
4
|
-
declare class List extends Component {
|
|
5
|
-
titleAreaText: I18ns;
|
|
6
|
-
objectApiName: string;
|
|
7
|
-
listItems: MobileListItem;
|
|
8
|
-
filter: UIMetaFilterType;
|
|
9
|
-
sortConditions: object[];
|
|
10
|
-
pageApiName: string;
|
|
11
|
-
componentName: string;
|
|
12
|
-
pageType: ('app' | 'record_page');
|
|
13
|
-
needPublish: boolean;
|
|
14
|
-
constructor(params: UIMetaMobileType);
|
|
15
|
-
static parse(input: Record<string, any>): List;
|
|
16
|
-
getReqParam(): Record<string, any>;
|
|
17
|
-
getTableColumn(): {
|
|
18
|
-
apiName: string;
|
|
19
|
-
}[];
|
|
20
|
-
getDescribeFilter(): {
|
|
21
|
-
filter: string;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export { List, };
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2022 ByteDance Ltd. and/or its affiliates
|
|
3
|
-
// SPDX-License-Identifier: MIT
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.List = void 0;
|
|
6
|
-
const common_1 = require("../../types/common");
|
|
7
|
-
const common_2 = require("../common");
|
|
8
|
-
/*
|
|
9
|
-
titleAreaText: i18n;
|
|
10
|
-
objectApiName: string;
|
|
11
|
-
listItems: {
|
|
12
|
-
avatar: {
|
|
13
|
-
active: boolean;
|
|
14
|
-
fieldApiName: string;
|
|
15
|
-
},
|
|
16
|
-
titleFields: [{
|
|
17
|
-
fieldApiName: string;
|
|
18
|
-
},...]
|
|
19
|
-
tagFields: [{
|
|
20
|
-
fieldApiName: string;
|
|
21
|
-
color: 'grey'|'blue'|'cyan'|'green'|'yellow'|'orange'|'red'|'magenta'|'purple'|'blueMagenta';
|
|
22
|
-
},...]
|
|
23
|
-
subtitleFields: [{
|
|
24
|
-
fieldApiName: string;
|
|
25
|
-
hiddenWhenEmpty: boolean;
|
|
26
|
-
},...],
|
|
27
|
-
detailFields: [{
|
|
28
|
-
fieldApiName: string;
|
|
29
|
-
hiddenWhenEmpty: boolean;
|
|
30
|
-
},...]
|
|
31
|
-
};
|
|
32
|
-
filter: {
|
|
33
|
-
conditions: object[];
|
|
34
|
-
logic: string;
|
|
35
|
-
};
|
|
36
|
-
sortConditions: object[];
|
|
37
|
-
*/
|
|
38
|
-
class List extends common_2.Component {
|
|
39
|
-
constructor(params) {
|
|
40
|
-
super(common_2.componentTypes.mobileList);
|
|
41
|
-
// TODO prd缺少
|
|
42
|
-
this.pageApiName = params.pageApiName;
|
|
43
|
-
this.componentName = params.componentName;
|
|
44
|
-
this.pageType = params.pageType; // app | record_page
|
|
45
|
-
this.needPublish = true;
|
|
46
|
-
// TODO check params
|
|
47
|
-
this.titleAreaText = params.titleAreaText;
|
|
48
|
-
this.objectApiName = params.objectApiName;
|
|
49
|
-
this.listItems = params.listItems;
|
|
50
|
-
this.filter = params.filter;
|
|
51
|
-
this.sortConditions = params.sortConditions;
|
|
52
|
-
}
|
|
53
|
-
static parse(input) {
|
|
54
|
-
return {
|
|
55
|
-
pageApiName: input.appApiName,
|
|
56
|
-
componentName: input.componentName,
|
|
57
|
-
titleAreaText: [],
|
|
58
|
-
objectApiName: input.objectApiName,
|
|
59
|
-
listItems: {
|
|
60
|
-
avatar: {},
|
|
61
|
-
titleFields: [],
|
|
62
|
-
tagFields: [],
|
|
63
|
-
subtitleFields: [],
|
|
64
|
-
detailFields: getDetailFields(input),
|
|
65
|
-
},
|
|
66
|
-
filter: getFilter(input),
|
|
67
|
-
sortConditions: [], // TODO 下游缺少
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
getReqParam() {
|
|
71
|
-
let reqParam = {
|
|
72
|
-
appApiName: this.pageApiName,
|
|
73
|
-
componentName: this.componentName,
|
|
74
|
-
objectApiName: this.objectApiName,
|
|
75
|
-
tableColumn: this.getTableColumn(),
|
|
76
|
-
describeFilter: this.getDescribeFilter(),
|
|
77
|
-
pageType: this.pageType,
|
|
78
|
-
needPublish: this.needPublish,
|
|
79
|
-
};
|
|
80
|
-
if (this.getDescribeFilter()) {
|
|
81
|
-
reqParam.describeFilter = this.getDescribeFilter();
|
|
82
|
-
}
|
|
83
|
-
if (this.pageType) {
|
|
84
|
-
reqParam.pageType = this.pageType;
|
|
85
|
-
}
|
|
86
|
-
if (this.needPublish) {
|
|
87
|
-
reqParam.needPublish = this.needPublish;
|
|
88
|
-
}
|
|
89
|
-
return reqParam;
|
|
90
|
-
}
|
|
91
|
-
getTableColumn() {
|
|
92
|
-
if (!this.listItems || !this.listItems.detailFields || !Array.isArray(this.listItems.detailFields)) {
|
|
93
|
-
return [];
|
|
94
|
-
}
|
|
95
|
-
let values = [];
|
|
96
|
-
for (let detailField of this.listItems.detailFields) {
|
|
97
|
-
if (!detailField || !detailField.fieldApiName) {
|
|
98
|
-
continue;
|
|
99
|
-
}
|
|
100
|
-
values.push({ apiName: detailField.fieldApiName });
|
|
101
|
-
}
|
|
102
|
-
return values;
|
|
103
|
-
}
|
|
104
|
-
getDescribeFilter() {
|
|
105
|
-
if ((0, common_1.isNullOrUndefined)(this.filter)) {
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
try {
|
|
109
|
-
return { filter: JSON.stringify(this.filter) };
|
|
110
|
-
}
|
|
111
|
-
catch (e) {
|
|
112
|
-
// TODO 抛出业务错误
|
|
113
|
-
return null;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
exports.List = List;
|
|
118
|
-
function getDetailFields(input) {
|
|
119
|
-
if (!input || !input.tableColumn || !Array.isArray(input.tableColumn)) {
|
|
120
|
-
return [];
|
|
121
|
-
}
|
|
122
|
-
let values = [];
|
|
123
|
-
for (let col of input.tableColumn) {
|
|
124
|
-
if (!col || !col.apiName) {
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
values.push({ fieldApiName: col.apiName });
|
|
128
|
-
}
|
|
129
|
-
return values;
|
|
130
|
-
}
|
|
131
|
-
function getFilter(input) {
|
|
132
|
-
if (!input || !input.describeFilter || (0, common_1.isNullOrUndefined)(input.describeFilter.filter)) {
|
|
133
|
-
return {};
|
|
134
|
-
}
|
|
135
|
-
try {
|
|
136
|
-
let inputFilter = JSON.parse(input.describeFilter.filter);
|
|
137
|
-
return {
|
|
138
|
-
conditions: inputFilter.conditions,
|
|
139
|
-
logic: inputFilter.logic,
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
catch (err) {
|
|
143
|
-
return {};
|
|
144
|
-
}
|
|
145
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { BaseFieldType } from './types/objects';
|
|
2
|
-
import { RecordDetail } from './components/desktop/recordDetail';
|
|
3
|
-
import { List as DesktopList } from './components/desktop/list';
|
|
4
|
-
import { List as MobileList } from './components/mobile/list';
|
|
5
|
-
interface IMetaData<mt> {
|
|
6
|
-
/**
|
|
7
|
-
* 操作指定对象的元数据信息
|
|
8
|
-
* @param objectApiName 指定对象的 ApiName
|
|
9
|
-
* @example
|
|
10
|
-
* ```
|
|
11
|
-
* application.metadata.object('test').getFields()
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
object<T extends keyof mt>(objectApiName: T): IKObject<mt[T]>;
|
|
15
|
-
}
|
|
16
|
-
interface IKObject<T> {
|
|
17
|
-
/**
|
|
18
|
-
* 读取对象的字段列表
|
|
19
|
-
*/
|
|
20
|
-
getFields(): Promise<BaseFieldType[]>;
|
|
21
|
-
/**
|
|
22
|
-
* 读取某字段的元数据信息
|
|
23
|
-
* @param fieldApiName 字段的 ApiName
|
|
24
|
-
*/
|
|
25
|
-
getField<K extends keyof T>(fieldApiName: K): Promise<BaseFieldType>;
|
|
26
|
-
}
|
|
27
|
-
interface IPage {
|
|
28
|
-
getRecordDetail(componentName: string): Promise<RecordDetail>;
|
|
29
|
-
getList(componentName: string): Promise<DesktopList>;
|
|
30
|
-
getId(): Promise<number>;
|
|
31
|
-
getMobileList(componentName: string): Promise<MobileList>;
|
|
32
|
-
updateMobileList(componentName: string, params: any): Promise<void>;
|
|
33
|
-
}
|
|
34
|
-
declare class MetaData<mt> implements IMetaData<mt> {
|
|
35
|
-
constructor(ctx: any);
|
|
36
|
-
object<T>(objectApiName: keyof mt): IKObject<T>;
|
|
37
|
-
page(apiName: string, objectApiName: string, type: string): Page;
|
|
38
|
-
}
|
|
39
|
-
declare function metadata<mt>(ctx: any): IMetaData<mt>;
|
|
40
|
-
declare class MetaDataV3<mt> implements IMetaData<mt> {
|
|
41
|
-
constructor(ctx: any);
|
|
42
|
-
object<T>(objectApiName: keyof mt): IKObject<T>;
|
|
43
|
-
}
|
|
44
|
-
declare function metadataV3<mt>(ctx: any): IMetaData<mt>;
|
|
45
|
-
declare class Page implements IPage {
|
|
46
|
-
pageApiName: string;
|
|
47
|
-
objectApiName: string;
|
|
48
|
-
type: 'app' | 'record_page';
|
|
49
|
-
/**
|
|
50
|
-
*
|
|
51
|
-
* @param pageApiName: 页面apiName
|
|
52
|
-
* @param objectApiName:对象apiName
|
|
53
|
-
* @param type:app 或 record_page
|
|
54
|
-
*/
|
|
55
|
-
constructor(pageApiName: string, objectApiName: string, type: string);
|
|
56
|
-
getRecordDetail(componentName: string): Promise<RecordDetail>;
|
|
57
|
-
getList(componentName: string): Promise<DesktopList>;
|
|
58
|
-
getId(): Promise<number>;
|
|
59
|
-
getMobileList(componentName: string): Promise<MobileList>;
|
|
60
|
-
updateMobileList(componentName: string, params: any): Promise<void>;
|
|
61
|
-
}
|
|
62
|
-
declare function metaType(): any;
|
|
63
|
-
export { IMetaData, IKObject, IPage, MetaData, metadata, metaType, MetaDataV3, metadataV3, };
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2022 ByteDance Ltd. and/or its affiliates
|
|
3
|
-
// SPDX-License-Identifier: MIT
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.metadataV3 = exports.MetaDataV3 = exports.metaType = exports.metadata = exports.MetaData = void 0;
|
|
6
|
-
const components = require("./components/components");
|
|
7
|
-
const common = require("@byted-apaas/server-common-node");
|
|
8
|
-
const fields = require("./objects/fields");
|
|
9
|
-
const fieldsV3 = require("./objects/fieldsV3");
|
|
10
|
-
const Request = require("../../request/interface");
|
|
11
|
-
const commonExceptions = common.exceptions;
|
|
12
|
-
// interface ---------------------------------------------------------------------------------------
|
|
13
|
-
class MetaData {
|
|
14
|
-
constructor(ctx) {
|
|
15
|
-
}
|
|
16
|
-
object(objectApiName) {
|
|
17
|
-
if (!objectApiName) {
|
|
18
|
-
throw new commonExceptions.InvalidParamError('objectApiName is empty');
|
|
19
|
-
}
|
|
20
|
-
return new KObject(objectApiName);
|
|
21
|
-
}
|
|
22
|
-
page(apiName, objectApiName, type) {
|
|
23
|
-
if (!apiName) {
|
|
24
|
-
throw new commonExceptions.InvalidParamError('apiName is empty');
|
|
25
|
-
}
|
|
26
|
-
if (!objectApiName) {
|
|
27
|
-
throw new commonExceptions.InvalidParamError('objectApiName is empty');
|
|
28
|
-
}
|
|
29
|
-
if (!type) {
|
|
30
|
-
throw new commonExceptions.InvalidParamError('type is empty');
|
|
31
|
-
}
|
|
32
|
-
return new Page(apiName, objectApiName, type);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.MetaData = MetaData;
|
|
36
|
-
function metadata(ctx) {
|
|
37
|
-
return new MetaData(ctx);
|
|
38
|
-
}
|
|
39
|
-
exports.metadata = metadata;
|
|
40
|
-
class MetaDataV3 {
|
|
41
|
-
constructor(ctx) {
|
|
42
|
-
}
|
|
43
|
-
object(objectApiName) {
|
|
44
|
-
if (!objectApiName) {
|
|
45
|
-
throw new commonExceptions.InvalidParamError('objectApiName is empty');
|
|
46
|
-
}
|
|
47
|
-
const appCtx = {
|
|
48
|
-
dataVersion: 'v3',
|
|
49
|
-
};
|
|
50
|
-
return new KObject(objectApiName, appCtx);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.MetaDataV3 = MetaDataV3;
|
|
54
|
-
function metadataV3(ctx) {
|
|
55
|
-
return new MetaDataV3(ctx);
|
|
56
|
-
}
|
|
57
|
-
exports.metadataV3 = metadataV3;
|
|
58
|
-
class KObject {
|
|
59
|
-
constructor(objectApiName, appCtx) {
|
|
60
|
-
this.objectApiName = objectApiName;
|
|
61
|
-
this.appCtx = appCtx;
|
|
62
|
-
}
|
|
63
|
-
async getFields() {
|
|
64
|
-
let res = await Request.GetInstance().getFields(this.objectApiName);
|
|
65
|
-
if (this.appCtx && this.appCtx.dataVersion === 'v3') {
|
|
66
|
-
return fieldsV3.parseFieldsV3(res);
|
|
67
|
-
}
|
|
68
|
-
return fields.parseFields(res);
|
|
69
|
-
}
|
|
70
|
-
async getField(fieldApiName) {
|
|
71
|
-
let res = await Request.GetInstance().getField(this.objectApiName, fieldApiName);
|
|
72
|
-
if (this.appCtx && this.appCtx.dataVersion === 'v3') {
|
|
73
|
-
return fieldsV3.parseFieldV3(res);
|
|
74
|
-
}
|
|
75
|
-
return fields.parseField(res);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
class Page {
|
|
79
|
-
/**
|
|
80
|
-
*
|
|
81
|
-
* @param pageApiName: 页面apiName
|
|
82
|
-
* @param objectApiName:对象apiName
|
|
83
|
-
* @param type:app 或 record_page
|
|
84
|
-
*/
|
|
85
|
-
constructor(pageApiName, objectApiName, type) {
|
|
86
|
-
this.pageApiName = pageApiName;
|
|
87
|
-
this.objectApiName = objectApiName;
|
|
88
|
-
this.type = type;
|
|
89
|
-
}
|
|
90
|
-
async getRecordDetail(componentName) {
|
|
91
|
-
// return await openapi.getDesktopRecordDetail(this.ctx, this.pageApiName, componentName, this.objectApiName, this.type);
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
async getList(componentName) {
|
|
95
|
-
// return await openapi.getDesktopList(this.ctx, this.pageApiName, componentName, this.objectApiName, this.type);
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
async getId() {
|
|
99
|
-
// return await openapi.getIdByApiName(this.ctx, this.objectApiName, this.pageApiName, 'RecordPage');
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
async getMobileList(componentName) {
|
|
103
|
-
// return await openapi.getMobileList(this.ctx, this.pageApiName, componentName, this.objectApiName, this.type) as any;
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
async updateMobileList(componentName, params) {
|
|
107
|
-
// params.pageApiName = this.pageApiName;
|
|
108
|
-
// params.objectApiName = this.objectApiName;
|
|
109
|
-
// params.componentName = componentName;
|
|
110
|
-
// params.pageType = this.type;
|
|
111
|
-
// return await openapi.updateMobileList(this.ctx, params);
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
function metaType() {
|
|
116
|
-
return {
|
|
117
|
-
pageComponent: {
|
|
118
|
-
desktop: {},
|
|
119
|
-
mobile: {
|
|
120
|
-
List: components.mobile.List,
|
|
121
|
-
},
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
exports.metaType = metaType;
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { BaseFieldType, CriterionType, FieldType, FilterType, RegionFilterType, SortConditionType, SubOptionType } from '../types/objects';
|
|
2
|
-
import { I18ns } from '../types/common';
|
|
3
|
-
declare class MetadataField {
|
|
4
|
-
type: string;
|
|
5
|
-
apiName: string;
|
|
6
|
-
label: I18ns;
|
|
7
|
-
constructor(type: string, field: FieldType);
|
|
8
|
-
}
|
|
9
|
-
declare class KText extends MetadataField {
|
|
10
|
-
required: boolean;
|
|
11
|
-
unique: boolean;
|
|
12
|
-
caseSensitive: boolean;
|
|
13
|
-
multiline: boolean;
|
|
14
|
-
maxLength: number;
|
|
15
|
-
validationRegex: string;
|
|
16
|
-
errorMsg: I18ns;
|
|
17
|
-
constructor(field: FieldType);
|
|
18
|
-
}
|
|
19
|
-
declare class RichText extends MetadataField {
|
|
20
|
-
maxLength: number;
|
|
21
|
-
required: boolean;
|
|
22
|
-
constructor(field: FieldType);
|
|
23
|
-
}
|
|
24
|
-
declare class Multilingual extends MetadataField {
|
|
25
|
-
required: boolean;
|
|
26
|
-
unique: boolean;
|
|
27
|
-
caseSensitive: boolean;
|
|
28
|
-
multiline: boolean;
|
|
29
|
-
maxLength: number;
|
|
30
|
-
constructor(field: FieldType);
|
|
31
|
-
}
|
|
32
|
-
declare class Number extends MetadataField {
|
|
33
|
-
required: boolean;
|
|
34
|
-
unique: boolean;
|
|
35
|
-
displayAsPercentage: boolean;
|
|
36
|
-
decimalPlacesNumber: number;
|
|
37
|
-
constructor(field: FieldType);
|
|
38
|
-
}
|
|
39
|
-
declare class Bigint extends MetadataField {
|
|
40
|
-
required: boolean;
|
|
41
|
-
unique: boolean;
|
|
42
|
-
constructor(field: FieldType);
|
|
43
|
-
}
|
|
44
|
-
declare class Decimal extends MetadataField {
|
|
45
|
-
required: boolean;
|
|
46
|
-
unique: boolean;
|
|
47
|
-
displayAsPercentage: boolean;
|
|
48
|
-
decimalPlacesNumber: number;
|
|
49
|
-
constructor(field: FieldType);
|
|
50
|
-
}
|
|
51
|
-
declare class KDate extends MetadataField {
|
|
52
|
-
required: boolean;
|
|
53
|
-
constructor(field: FieldType);
|
|
54
|
-
}
|
|
55
|
-
declare class DateTime extends MetadataField {
|
|
56
|
-
required: boolean;
|
|
57
|
-
constructor(field: FieldType);
|
|
58
|
-
}
|
|
59
|
-
declare class Option extends MetadataField {
|
|
60
|
-
required: boolean;
|
|
61
|
-
multiple: boolean;
|
|
62
|
-
optionSource: ('custom' | 'global');
|
|
63
|
-
globalOptionApiName: string;
|
|
64
|
-
optionList: SubOptionType[];
|
|
65
|
-
constructor(field: FieldType);
|
|
66
|
-
}
|
|
67
|
-
declare class Email extends MetadataField {
|
|
68
|
-
required: boolean;
|
|
69
|
-
unique: boolean;
|
|
70
|
-
constructor(field: FieldType);
|
|
71
|
-
}
|
|
72
|
-
declare class MobileNumber extends MetadataField {
|
|
73
|
-
required: boolean;
|
|
74
|
-
unique: boolean;
|
|
75
|
-
constructor(field: FieldType);
|
|
76
|
-
}
|
|
77
|
-
declare class Boolean extends MetadataField {
|
|
78
|
-
descriptionWhenTrue: I18ns;
|
|
79
|
-
descriptionWhenFalse: I18ns;
|
|
80
|
-
defaultValue: boolean;
|
|
81
|
-
unique: boolean;
|
|
82
|
-
constructor(field: FieldType);
|
|
83
|
-
}
|
|
84
|
-
declare class AvatarOrLogo extends MetadataField {
|
|
85
|
-
displayStyle: ('square' | 'round');
|
|
86
|
-
constructor(field: FieldType);
|
|
87
|
-
}
|
|
88
|
-
declare class Lookup extends MetadataField {
|
|
89
|
-
required: boolean;
|
|
90
|
-
multiple: boolean;
|
|
91
|
-
objectApiName: string;
|
|
92
|
-
hierarchy: boolean;
|
|
93
|
-
displayStyle: ('search' | 'dropDown' | 'tree');
|
|
94
|
-
sortConditions: SortConditionType[];
|
|
95
|
-
filter: FilterType[];
|
|
96
|
-
constructor(field: FieldType);
|
|
97
|
-
}
|
|
98
|
-
declare class Formula extends MetadataField {
|
|
99
|
-
returnType: string;
|
|
100
|
-
formula: I18ns;
|
|
101
|
-
constructor(field: FieldType);
|
|
102
|
-
}
|
|
103
|
-
declare class AutoID extends MetadataField {
|
|
104
|
-
generateMethod: ('random' | 'incremental');
|
|
105
|
-
digitsNumber: number;
|
|
106
|
-
prefix: string;
|
|
107
|
-
suffix: string;
|
|
108
|
-
constructor(field: FieldType);
|
|
109
|
-
}
|
|
110
|
-
declare class ReferenceField extends MetadataField {
|
|
111
|
-
guideFieldApiName: string;
|
|
112
|
-
fieldApiName: string;
|
|
113
|
-
constructor(field: FieldType);
|
|
114
|
-
}
|
|
115
|
-
declare class Rollup extends MetadataField {
|
|
116
|
-
rollupType: string;
|
|
117
|
-
rollupObjectApiName: string;
|
|
118
|
-
rollupFieldApiName: string;
|
|
119
|
-
rollupLookupFieldApiName: string;
|
|
120
|
-
filter: CriterionType;
|
|
121
|
-
constructor(field: FieldType);
|
|
122
|
-
}
|
|
123
|
-
declare class Region extends MetadataField {
|
|
124
|
-
required: boolean;
|
|
125
|
-
multiple: boolean;
|
|
126
|
-
optionLevel: boolean;
|
|
127
|
-
strictLevel: number;
|
|
128
|
-
filter: RegionFilterType[];
|
|
129
|
-
constructor(field: FieldType);
|
|
130
|
-
}
|
|
131
|
-
declare class File extends MetadataField {
|
|
132
|
-
required: boolean;
|
|
133
|
-
multiple: boolean;
|
|
134
|
-
fileTypes: string[];
|
|
135
|
-
constructor(field: FieldType);
|
|
136
|
-
}
|
|
137
|
-
declare class BackLookup extends MetadataField {
|
|
138
|
-
constructor(field: FieldType);
|
|
139
|
-
}
|
|
140
|
-
declare class CompositeType extends MetadataField {
|
|
141
|
-
compositeTypeApiName: string;
|
|
142
|
-
subFields: BaseFieldType[];
|
|
143
|
-
required: boolean;
|
|
144
|
-
multiple: boolean;
|
|
145
|
-
constructor(field: FieldType);
|
|
146
|
-
}
|
|
147
|
-
declare class ExtractSingleRecord extends MetadataField {
|
|
148
|
-
compositeTypeApiName: string;
|
|
149
|
-
subFields: BaseFieldType[];
|
|
150
|
-
filter: FilterType[];
|
|
151
|
-
sortConditions: SortConditionType[];
|
|
152
|
-
recordPosition: number;
|
|
153
|
-
constructor(field: FieldType);
|
|
154
|
-
}
|
|
155
|
-
declare function parseFields(inputFields: Record<string, any>): BaseFieldType[];
|
|
156
|
-
declare function parseField(field: FieldType): BaseFieldType;
|
|
157
|
-
declare function getFieldClass(field: FieldType): any;
|
|
158
|
-
export { KText as Text, Multilingual, Number, KDate as Date, DateTime, Option, Email, MobileNumber, Boolean, AvatarOrLogo, Lookup, Formula, AutoID, ReferenceField, File, BackLookup, CompositeType, ExtractSingleRecord, RichText, Bigint, Decimal, Region, Rollup, parseFields, parseField, getFieldClass, };
|