@steedos/service-metadata-objects 2.2.40 → 2.2.43

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.
@@ -1,3 +1,4 @@
1
+ import { Register } from '@steedos/metadata-registrar';
1
2
  import { SteedosFieldSummaryTypeConfig, SteedosSummaryTypeValue, SteedosSummaryDataTypeValue, SupportedSummaryFieldTypes } from './type';
2
3
  import { isFormulaFieldQuotingObjectAndFields } from '../formula/core';
3
4
  import _ = require('lodash')
@@ -22,7 +23,8 @@ export class SummaryActionHandler {
22
23
  return;
23
24
  }
24
25
  // console.log(`deleteAll summary`, this.cacherKey(objectConfig.name, '*'))
25
- await this.broker.call('metadata.fuzzyDelete', {key: this.cacherKey(objectConfig.name, '*')}, {meta: {}})
26
+ // await this.broker.call('metadata.fuzzyDelete', {key: this.cacherKey(objectConfig.name, '*')}, {meta: {}})
27
+ await Register.fuzzyDelete(this.broker, this.cacherKey(objectConfig.name, '*'));
26
28
  return true
27
29
  } catch (error) {
28
30
  this.broker.logger.error(error);
@@ -182,11 +184,13 @@ export class SummaryActionHandler {
182
184
  async addSummaryMetadata(config: any, datasource: string){
183
185
  const fieldsSummaryConfig = await this.getObjectFieldsSummaryConfig(config, datasource);
184
186
  for await (const fieldSummary of fieldsSummaryConfig) {
185
- await this.broker.call('metadata.add', {key: this.cacherKey(fieldSummary._id, fieldSummary.summary_object), data: fieldSummary}, {meta: {}})
187
+ // await this.broker.call('metadata.add', {key: this.cacherKey(fieldSummary._id, fieldSummary.summary_object), data: fieldSummary}, {meta: {}})
188
+ await Register.add(this.broker, {key: this.cacherKey(fieldSummary._id, fieldSummary.summary_object), data: fieldSummary}, {});
186
189
  }
187
190
  const quoteMineSummaryConfigs = await this.getQuoteMineSummaryConfigs(config);
188
191
  for await (const fieldSummary of quoteMineSummaryConfigs) {
189
- await this.broker.call('metadata.add', {key: this.cacherKey(fieldSummary._id, fieldSummary.summary_object), data: fieldSummary}, {meta: {}})
192
+ // await this.broker.call('metadata.add', {key: this.cacherKey(fieldSummary._id, fieldSummary.summary_object), data: fieldSummary}, {meta: {}})
193
+ await Register.add(this.broker, {key: this.cacherKey(fieldSummary._id, fieldSummary.summary_object), data: fieldSummary}, {});
190
194
  }
191
195
  return true;
192
196
  }
@@ -204,7 +208,8 @@ export class SummaryActionHandler {
204
208
  async filterSummaryConfig(fieldApiFullName, summaryObjectApiName?){
205
209
  const key = this.cacherKey(fieldApiFullName, summaryObjectApiName)
206
210
  const configs = [];
207
- const res = await this.broker.call('metadata.filter', {key: key}, {meta: {}})
211
+ // const res = await this.broker.call('metadata.filter', {key: key}, {meta: {}})
212
+ const res = await Register.filter(this.broker, key)
208
213
  _.forEach(res, (item)=>{
209
214
  configs.push(item.metadata)
210
215
  })