@steedos/service-metadata-objects 3.0.0-beta.8 → 3.0.0-beta.80
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/lib/actionsHandler.js +45 -21
- package/lib/actionsHandler.js.map +1 -1
- package/lib/formula/core.js +35 -8
- package/lib/formula/core.js.map +1 -1
- package/lib/formula/formulaActionHandler.d.ts +1 -1
- package/lib/formula/formulaActionHandler.js +40 -23
- package/lib/formula/formulaActionHandler.js.map +1 -1
- package/lib/summary/summaryActionHandler.d.ts +2 -2
- package/lib/summary/summaryActionHandler.js +21 -11
- package/lib/summary/summaryActionHandler.js.map +1 -1
- package/package.json +5 -5
- package/src/actionsHandler.ts +335 -258
- package/src/formula/core.ts +44 -10
- package/src/formula/formulaActionHandler.ts +499 -379
- package/src/summary/summaryActionHandler.ts +279 -208
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { Register } from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Register } from "@steedos/metadata-registrar";
|
|
2
|
+
import {
|
|
3
|
+
SteedosFieldSummaryTypeConfig,
|
|
4
|
+
SteedosSummaryTypeValue,
|
|
5
|
+
SteedosSummaryDataTypeValue,
|
|
6
|
+
SupportedSummaryFieldTypes,
|
|
7
|
+
} from "./type";
|
|
8
|
+
import { isFormulaFieldQuotingObjectAndFields } from "../formula/core";
|
|
9
|
+
import _ = require("lodash");
|
|
10
|
+
const clone = require("clone");
|
|
6
11
|
|
|
7
|
-
export * from
|
|
12
|
+
export * from "./type";
|
|
8
13
|
|
|
9
14
|
// TODO
|
|
10
15
|
// const isCodeObject = (objectApiName) => {
|
|
@@ -12,228 +17,294 @@ export * from './type'
|
|
|
12
17
|
// }
|
|
13
18
|
|
|
14
19
|
export class SummaryActionHandler {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
broker: any = null;
|
|
21
|
+
constructor(broker) {
|
|
22
|
+
this.broker = broker;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async deleteAll(objectConfig) {
|
|
26
|
+
try {
|
|
27
|
+
if (!objectConfig) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// console.log(`deleteAll summary`, this.cacherKey(objectConfig.name, '*'))
|
|
31
|
+
// await this.broker.call('metadata.fuzzyDelete', {key: this.cacherKey(objectConfig.name, '*')}, {meta: {}})
|
|
32
|
+
await Register.fuzzyDelete(
|
|
33
|
+
this.broker,
|
|
34
|
+
this.cacherKey(objectConfig.name, "*"),
|
|
35
|
+
);
|
|
36
|
+
return true;
|
|
37
|
+
} catch (error) {
|
|
38
|
+
this.broker.logger.error(error);
|
|
18
39
|
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
19
42
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (dataType !== summaryConfig.data_type) {
|
|
70
|
-
throw new Error(`The data_type of the summary field '${field_name}' on the object '${object_name}' is incorrect, it should be '${dataType}' but is set to '${summaryConfig.data_type}'.`);
|
|
71
|
-
}
|
|
72
|
-
summaryConfig.data_type = dataType;
|
|
43
|
+
async getObjectConfig(objectApiName: string) {
|
|
44
|
+
const data = await this.broker.call("objects.get", {
|
|
45
|
+
objectApiName: objectApiName,
|
|
46
|
+
});
|
|
47
|
+
return data ? data.metadata : null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 校验summaryConfig合法性并设置其reference_to_field、data_type属性值
|
|
52
|
+
* 因为getObjectConfigs拿到的对象肯定不包括被禁用和假删除的对象,所以不需要额外判断相关状态
|
|
53
|
+
* @param summaryConfig
|
|
54
|
+
*/
|
|
55
|
+
async initSummaryConfig(
|
|
56
|
+
summaryConfig: SteedosFieldSummaryTypeConfig,
|
|
57
|
+
summaryObject?: any,
|
|
58
|
+
) {
|
|
59
|
+
const { summary_object, field_name, object_name } = summaryConfig;
|
|
60
|
+
if (!summaryObject) {
|
|
61
|
+
summaryObject = await this.getObjectConfig(summary_object);
|
|
62
|
+
if (!summaryObject) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const referenceToField = _.find(summaryObject.fields, (item) => {
|
|
67
|
+
return item.type === "master_detail" && item.reference_to === object_name;
|
|
68
|
+
});
|
|
69
|
+
if (!referenceToField) {
|
|
70
|
+
// throw new Error(`Can't fount a master_detail type field that reference_to the master object '${object_name}' on the summary_object '${summary_object}'.`);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
summaryConfig.reference_to_field = referenceToField.name;
|
|
74
|
+
summaryConfig.reference_to_field_reference_to =
|
|
75
|
+
referenceToField.reference_to_field;
|
|
76
|
+
if (!summaryConfig.data_type) {
|
|
77
|
+
throw new Error(
|
|
78
|
+
`Invalid field type summary '${field_name}' on the object '${object_name}', miss data_type property.`,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
const dataType = await this.getSummaryDataType(
|
|
82
|
+
summaryConfig,
|
|
83
|
+
summaryObject,
|
|
84
|
+
);
|
|
85
|
+
if (!dataType) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (dataType !== summaryConfig.data_type) {
|
|
89
|
+
throw new Error(
|
|
90
|
+
`The data_type of the summary field '${field_name}' on the object '${object_name}' is incorrect, it should be '${dataType}' but is set to '${summaryConfig.data_type}'.`,
|
|
91
|
+
);
|
|
73
92
|
}
|
|
93
|
+
summaryConfig.data_type = dataType;
|
|
94
|
+
}
|
|
74
95
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
96
|
+
async getSummaryDataType(
|
|
97
|
+
summaryConfig: SteedosFieldSummaryTypeConfig,
|
|
98
|
+
summaryObject: any,
|
|
99
|
+
) {
|
|
100
|
+
const {
|
|
101
|
+
summary_object,
|
|
102
|
+
summary_type,
|
|
103
|
+
summary_field,
|
|
104
|
+
field_name,
|
|
105
|
+
object_name,
|
|
106
|
+
} = summaryConfig;
|
|
107
|
+
let result: SteedosSummaryDataTypeValue;
|
|
108
|
+
let needSummaryField = true;
|
|
109
|
+
if (summary_type === SteedosSummaryTypeValue.COUNT) {
|
|
110
|
+
// 如果是COUNT类型,则忽然掉要聚合的字段
|
|
111
|
+
needSummaryField = false;
|
|
112
|
+
} else if (!summary_field) {
|
|
113
|
+
throw new Error(
|
|
114
|
+
`You have to set a summary_field property for the field '${field_name}' of the object '${object_name}' when the summary_type is not set to 'count'.`,
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
if (summary_field && needSummaryField) {
|
|
118
|
+
const field = summaryObject.fields[summary_field];
|
|
119
|
+
if (field) {
|
|
120
|
+
let fieldType = field.type;
|
|
121
|
+
if (fieldType === "formula") {
|
|
122
|
+
// 要聚合的是公式,则其数据类型为公式字段的数据类型
|
|
123
|
+
// 因公式字段可能再引用当前汇总字段,所以要判断下不允许互相引用
|
|
124
|
+
fieldType = field.data_type;
|
|
125
|
+
const isQuotingTwoWay = await isFormulaFieldQuotingObjectAndFields(
|
|
126
|
+
summary_object,
|
|
127
|
+
summary_field,
|
|
128
|
+
object_name,
|
|
129
|
+
[field_name],
|
|
130
|
+
);
|
|
131
|
+
if (isQuotingTwoWay) {
|
|
132
|
+
throw new Error(
|
|
133
|
+
`Do not refer to each other, the field '${field_name}' of the master object '${object_name}' is summarizing a formula type summary_field '${summary_field}' of the detail object '${summary_object}', but the formula type field of the detail object exactly quoting the field of the master object, which is not allowed.`,
|
|
134
|
+
);
|
|
135
|
+
}
|
|
85
136
|
}
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (fieldType === "formula") {
|
|
91
|
-
// 要聚合的是公式,则其数据类型为公式字段的数据类型
|
|
92
|
-
// 因公式字段可能再引用当前汇总字段,所以要判断下不允许互相引用
|
|
93
|
-
fieldType = field.data_type;
|
|
94
|
-
const isQuotingTwoWay = await isFormulaFieldQuotingObjectAndFields(summary_object, summary_field, object_name, [field_name]);
|
|
95
|
-
if (isQuotingTwoWay) {
|
|
96
|
-
throw new Error(`Do not refer to each other, the field '${field_name}' of the master object '${object_name}' is summarizing a formula type summary_field '${summary_field}' of the detail object '${summary_object}', but the formula type field of the detail object exactly quoting the field of the master object, which is not allowed.`);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
if (fieldType === "summary") {
|
|
100
|
-
// 要聚合的是汇总字段,则其数据类型为汇总字段的数据类型
|
|
101
|
-
// 因两个对象之前不可能互为子表关系,所以汇总字段不存在互为汇总聚合关系,不需要进一步判断它们是否互相引用
|
|
102
|
-
fieldType = field.data_type;
|
|
103
|
-
}
|
|
104
|
-
if (!this.isSummaryFieldTypeSupported(summary_type, fieldType)) {
|
|
105
|
-
throw new Error(`The summary data_type '${fieldType}' on the field '${field_name}' of the object '${object_name}' is not supported for the summary_type '${summary_type}' which only support these types: ${SupportedSummaryFieldTypes[summary_type]}.`);
|
|
106
|
-
}
|
|
107
|
-
result = <SteedosSummaryDataTypeValue>fieldType;
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
// throw new Error(`The summary_field '${summary_field}' is not a field of the summary_object '${summary_object}'.`);
|
|
111
|
-
return
|
|
112
|
-
}
|
|
137
|
+
if (fieldType === "summary") {
|
|
138
|
+
// 要聚合的是汇总字段,则其数据类型为汇总字段的数据类型
|
|
139
|
+
// 因两个对象之前不可能互为子表关系,所以汇总字段不存在互为汇总聚合关系,不需要进一步判断它们是否互相引用
|
|
140
|
+
fieldType = field.data_type;
|
|
113
141
|
}
|
|
114
|
-
|
|
115
|
-
|
|
142
|
+
if (!this.isSummaryFieldTypeSupported(summary_type, fieldType)) {
|
|
143
|
+
throw new Error(
|
|
144
|
+
`The summary data_type '${fieldType}' on the field '${field_name}' of the object '${object_name}' is not supported for the summary_type '${summary_type}' which only support these types: ${SupportedSummaryFieldTypes[summary_type]}.`,
|
|
145
|
+
);
|
|
116
146
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
147
|
+
result = <SteedosSummaryDataTypeValue>fieldType;
|
|
148
|
+
} else {
|
|
149
|
+
// throw new Error(`The summary_field '${summary_field}' is not a field of the summary_object '${summary_object}'.`);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
result = SteedosSummaryDataTypeValue.Number;
|
|
154
|
+
}
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
isSummaryFieldTypeSupported(summaryType: string, summaryFieldType: string) {
|
|
159
|
+
return !!(
|
|
160
|
+
SupportedSummaryFieldTypes[summaryType] &&
|
|
161
|
+
SupportedSummaryFieldTypes[summaryType].indexOf(summaryFieldType) > -1
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
async getObjectFieldSummaryConfig(fieldConfig: any, objectConfig: any) {
|
|
166
|
+
let summaryConfig: SteedosFieldSummaryTypeConfig = {
|
|
167
|
+
_id: `${objectConfig.name}.${fieldConfig.name}`,
|
|
168
|
+
object_name: objectConfig.name,
|
|
169
|
+
field_name: fieldConfig.name,
|
|
170
|
+
summary_object: fieldConfig.summary_object,
|
|
171
|
+
summary_type: <SteedosSummaryTypeValue>fieldConfig.summary_type,
|
|
172
|
+
data_type: fieldConfig.data_type,
|
|
173
|
+
summary_field: fieldConfig.summary_field,
|
|
174
|
+
summary_filters: fieldConfig.summary_filters,
|
|
175
|
+
reference_to_field: null,
|
|
176
|
+
};
|
|
177
|
+
await this.initSummaryConfig(summaryConfig);
|
|
178
|
+
|
|
179
|
+
return summaryConfig;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
async getObjectFieldsSummaryConfig(config: any, datasource: string) {
|
|
183
|
+
const configs = [];
|
|
184
|
+
for await (const field of _.values(config.fields)) {
|
|
185
|
+
if (field.type === "summary") {
|
|
186
|
+
if (datasource !== "meteor" && datasource !== "default") {
|
|
187
|
+
throw new Error(
|
|
188
|
+
`[${datasource}] The type of the field '${field.name}' on the object '${config.name}' can't be 'summary', because it is not in the default datasource.`,
|
|
189
|
+
);
|
|
157
190
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
await this.initSummaryConfig(summaryConfig, objectConfig)
|
|
169
|
-
fixedConfigs.push(summaryConfig);
|
|
170
|
-
}
|
|
191
|
+
try {
|
|
192
|
+
// 这里一定要加try catch,否则某个字段报错后,后续其他字段及其他对象就再也没有正常加载了
|
|
193
|
+
const fieldSummaryConfig = await this.getObjectFieldSummaryConfig(
|
|
194
|
+
clone(field),
|
|
195
|
+
config,
|
|
196
|
+
);
|
|
197
|
+
configs.push(fieldSummaryConfig);
|
|
198
|
+
} catch (error) {
|
|
199
|
+
this.broker.logger.error(error);
|
|
200
|
+
console.error(error);
|
|
171
201
|
}
|
|
172
|
-
|
|
202
|
+
}
|
|
173
203
|
}
|
|
174
204
|
|
|
205
|
+
return configs;
|
|
206
|
+
}
|
|
175
207
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
208
|
+
async getQuoteMineSummaryConfigs(objectConfig) {
|
|
209
|
+
const fixedConfigs = [];
|
|
210
|
+
//给引用了当前对象的汇总配置中,设置reference_to_field值并校验
|
|
211
|
+
const quoteMineSummaryConfigs = await this.filterSummaryConfig(
|
|
212
|
+
"*.*",
|
|
213
|
+
objectConfig.name,
|
|
214
|
+
);
|
|
215
|
+
for await (const summaryConfig of quoteMineSummaryConfigs) {
|
|
216
|
+
if (!summaryConfig.reference_to_field) {
|
|
217
|
+
await this.initSummaryConfig(summaryConfig, objectConfig);
|
|
218
|
+
fixedConfigs.push(summaryConfig);
|
|
219
|
+
}
|
|
183
220
|
}
|
|
221
|
+
return fixedConfigs;
|
|
222
|
+
}
|
|
184
223
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
const quoteMineSummaryConfigs = await this.getQuoteMineSummaryConfigs(config);
|
|
192
|
-
for await (const fieldSummary of quoteMineSummaryConfigs) {
|
|
193
|
-
// await this.broker.call('metadata.add', {key: this.cacherKey(fieldSummary._id, fieldSummary.summary_object), data: fieldSummary}, {meta: {}})
|
|
194
|
-
await Register.add(this.broker, {key: this.cacherKey(fieldSummary._id, fieldSummary.summary_object), data: fieldSummary}, {});
|
|
195
|
-
}
|
|
196
|
-
return true;
|
|
224
|
+
/* metadata 新增 */
|
|
225
|
+
//fieldApiFullName: ${objectApiName}.${fieldApiName}
|
|
226
|
+
cacherKey(fieldApiFullName: string, summaryObjectApiName?: string): string {
|
|
227
|
+
if (!summaryObjectApiName) {
|
|
228
|
+
summaryObjectApiName = "*";
|
|
197
229
|
}
|
|
230
|
+
return `$steedos.#summary.${fieldApiFullName}.${summaryObjectApiName}`;
|
|
231
|
+
}
|
|
198
232
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
233
|
+
async addSummaryMetadata(config: any, datasource: string) {
|
|
234
|
+
const fieldsSummaryConfig = await this.getObjectFieldsSummaryConfig(
|
|
235
|
+
config,
|
|
236
|
+
datasource,
|
|
237
|
+
);
|
|
238
|
+
for await (const fieldSummary of fieldsSummaryConfig) {
|
|
239
|
+
// await this.broker.call('metadata.add', {key: this.cacherKey(fieldSummary._id, fieldSummary.summary_object), data: fieldSummary}, {meta: {}})
|
|
240
|
+
await Register.add(
|
|
241
|
+
this.broker,
|
|
242
|
+
{
|
|
243
|
+
key: this.cacherKey(fieldSummary._id, fieldSummary.summary_object),
|
|
244
|
+
data: fieldSummary,
|
|
245
|
+
},
|
|
246
|
+
{},
|
|
247
|
+
);
|
|
207
248
|
}
|
|
249
|
+
const quoteMineSummaryConfigs =
|
|
250
|
+
await this.getQuoteMineSummaryConfigs(config);
|
|
251
|
+
for await (const fieldSummary of quoteMineSummaryConfigs) {
|
|
252
|
+
// await this.broker.call('metadata.add', {key: this.cacherKey(fieldSummary._id, fieldSummary.summary_object), data: fieldSummary}, {meta: {}})
|
|
253
|
+
await Register.add(
|
|
254
|
+
this.broker,
|
|
255
|
+
{
|
|
256
|
+
key: this.cacherKey(fieldSummary._id, fieldSummary.summary_object),
|
|
257
|
+
data: fieldSummary,
|
|
258
|
+
},
|
|
259
|
+
{},
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
return true;
|
|
263
|
+
}
|
|
208
264
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
265
|
+
async add(objectConfig) {
|
|
266
|
+
try {
|
|
267
|
+
await this.addSummaryMetadata(
|
|
268
|
+
objectConfig,
|
|
269
|
+
objectConfig.datasource || "default",
|
|
270
|
+
);
|
|
271
|
+
return true;
|
|
272
|
+
} catch (error) {
|
|
273
|
+
this.broker.logger.error(error);
|
|
218
274
|
}
|
|
275
|
+
return false;
|
|
276
|
+
}
|
|
219
277
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
278
|
+
async filterSummaryConfig(fieldApiFullName, summaryObjectApiName?) {
|
|
279
|
+
const key = this.cacherKey(fieldApiFullName, summaryObjectApiName);
|
|
280
|
+
const configs = [];
|
|
281
|
+
// const res = await this.broker.call('metadata.filter', {key: key}, {meta: {}})
|
|
282
|
+
const res = await Register.filter(this.broker, key);
|
|
283
|
+
_.forEach(res, (item) => {
|
|
284
|
+
configs.push(item.metadata);
|
|
285
|
+
});
|
|
286
|
+
return configs;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
async filter(ctx) {
|
|
290
|
+
let { objectApiName, fieldApiName } = ctx.params;
|
|
291
|
+
if (!objectApiName) {
|
|
292
|
+
objectApiName = "*";
|
|
230
293
|
}
|
|
294
|
+
if (!fieldApiName) {
|
|
295
|
+
fieldApiName = "*";
|
|
296
|
+
}
|
|
297
|
+
const configs = await this.filterSummaryConfig(
|
|
298
|
+
`${objectApiName}.${fieldApiName}`,
|
|
299
|
+
);
|
|
300
|
+
return configs;
|
|
301
|
+
}
|
|
231
302
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
303
|
+
async get(ctx) {
|
|
304
|
+
let { fieldApiFullName } = ctx.params;
|
|
305
|
+
const res = await this.filterSummaryConfig(fieldApiFullName);
|
|
306
|
+
if (res && res.length > 0) {
|
|
307
|
+
return res[0];
|
|
238
308
|
}
|
|
239
|
-
}
|
|
309
|
+
}
|
|
310
|
+
}
|