@elastic.io/oih-standard-library
Advanced tools
Comparing version 1.0.1-dev.3 to 1.0.1-dev.4
@@ -56,2 +56,5 @@ interface GetInMetadataPropertiesParams { | ||
lookupObjects(objectType: any, criteria: any, msg: object, cfg: object): Promise<any>; | ||
wrapToMessageFetchAll(body: any): any; | ||
wrapToMessageEmitIndividually(body: any): any; | ||
wrapToMessageFetchPage(body: any): any; | ||
/** | ||
@@ -58,0 +61,0 @@ * Default implementation expects criteria to be present inside input message as `searchTerm` param. If you need other behaviour override this method. |
"use strict"; | ||
/* eslint-disable no-param-reassign */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -33,3 +34,3 @@ const constants_1 = require("../constants"); | ||
catch (e) { | ||
this.logger.error('Unexpected error while processing lookupObjectById call for message: %j, cfg: %j', msg, cfg, e); | ||
this.logger.error('Unexpected error while processing lookupObjects call for message: %j, cfg: %j', msg, cfg, e); | ||
throw e; | ||
@@ -56,3 +57,3 @@ } | ||
} | ||
await this.context.emit('data', messages.newMessageWithBody({ results })); | ||
await this.context.emit('data', this.wrapToMessageFetchAll({ results })); | ||
break; | ||
@@ -64,3 +65,3 @@ } | ||
for (const result of results) { | ||
await this.context.emit('data', messages.newMessageWithBody(result)); | ||
await this.context.emit('data', this.wrapToMessageEmitIndividually(result)); | ||
} | ||
@@ -79,3 +80,3 @@ break; | ||
for (const result of results) { | ||
await this.context.emit('data', messages.newMessageWithBody(result)); | ||
await this.context.emit('data', this.wrapToMessageFetchPage(result)); | ||
} | ||
@@ -88,2 +89,14 @@ break; | ||
} | ||
// @ts-ignore | ||
wrapToMessageFetchAll(body) { | ||
return messages.newMessageWithBody(body); | ||
} | ||
// @ts-ignore | ||
wrapToMessageEmitIndividually(body) { | ||
return messages.newMessageWithBody(body); | ||
} | ||
// @ts-ignore | ||
wrapToMessageFetchPage(body) { | ||
return messages.newMessageWithBody(body); | ||
} | ||
/** | ||
@@ -90,0 +103,0 @@ * Default implementation expects criteria to be present inside input message as `searchTerm` param. If you need other behaviour override this method. |
@@ -0,1 +1,3 @@ | ||
/* eslint-disable no-param-reassign */ | ||
import { | ||
@@ -103,3 +105,3 @@ OBJECT_TYPE, PAGE_SIZE, BEHAVIOUR, PAGE_NUMBER, MAX_RESULT_SIZE, NUM_SEARCH_TERMS, FETCH_ALL, EMIT_INDIVIDUALLY, FETCH_PAGE, ORDER, | ||
} catch (e) { | ||
this.logger.error('Unexpected error while processing lookupObjectById call for message: %j, cfg: %j', msg, cfg, e); | ||
this.logger.error('Unexpected error while processing lookupObjects call for message: %j, cfg: %j', msg, cfg, e); | ||
throw e; | ||
@@ -129,3 +131,3 @@ } | ||
} | ||
await this.context.emit('data', messages.newMessageWithBody({ results })); | ||
await this.context.emit('data', this.wrapToMessageFetchAll({ results })); | ||
break; | ||
@@ -137,3 +139,3 @@ } | ||
for (const result of results) { | ||
await this.context.emit('data', messages.newMessageWithBody(result)); | ||
await this.context.emit('data', this.wrapToMessageEmitIndividually(result)); | ||
} | ||
@@ -156,3 +158,3 @@ break; | ||
for (const result of results) { | ||
await this.context.emit('data', messages.newMessageWithBody(result)); | ||
await this.context.emit('data', this.wrapToMessageFetchPage(result)); | ||
} | ||
@@ -166,2 +168,18 @@ break; | ||
// @ts-ignore | ||
public wrapToMessageFetchAll(body) { | ||
return messages.newMessageWithBody(body); | ||
} | ||
// @ts-ignore | ||
public wrapToMessageEmitIndividually(body) { | ||
return messages.newMessageWithBody(body); | ||
} | ||
// @ts-ignore | ||
public wrapToMessageFetchPage(body) { | ||
return messages.newMessageWithBody(body); | ||
} | ||
/** | ||
@@ -168,0 +186,0 @@ * Default implementation expects criteria to be present inside input message as `searchTerm` param. If you need other behaviour override this method. |
{ | ||
"name": "@elastic.io/oih-standard-library", | ||
"version": "1.0.1-dev.3", | ||
"version": "1.0.1-dev.4", | ||
"description": "Library for OIH standards implementation", | ||
@@ -5,0 +5,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
198124
2990