Skip to content

Commit e064930

Browse files
fix (#53)
* fix * f * f * remove dev
1 parent 9b8215a commit e064930

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.2.2 (September 22, 2025)
2+
* Removed `elasticio-node` library from deprecated action and trigger to fix the bug introduced in version 2.2.1.
3+
14
## 2.2.1 (September 19, 2025)
25
* Improved Error Handling Policy description
36
* Updated `component-commons-library` to version 4.0.0

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"title": "REST API V2",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"description": "A generic connector for accessing HTTP and REST APIs .",
55
"authClientTypes": [
66
"oauth2",

lib/utils.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
const { JsonataTransform } = require('@elastic.io/component-commons-library');
44
const request = require('request-promise');
5-
const { messages } = require('elasticio-node');
65
const xml2js = require('xml2js-es6-promise');
76
const uuidv1 = require('uuid').v1;
87

@@ -23,6 +22,11 @@ const methodsMap = {
2322
PUT: 'put',
2423
};
2524

25+
module.exports.messages = {
26+
newMessageWithBody: (body) => ({ body, headers: {} }),
27+
newEmptyMessage: () => ({ body: {}, headers: {} }),
28+
};
29+
2630
const bodyEncodings = {
2731
FORM_DATA: 'form-data',
2832
RAW: 'raw',
@@ -228,7 +232,7 @@ module.exports.processMethod = async function (msg, cfg) {
228232
// Walk through chain of promises: https://stackoverflow.com/questions/30445543/execute-native-js-promise-in-series
229233
// eslint-disable-next-line no-restricted-syntax
230234
for (const item of result.body) {
231-
const output = messages.newMessageWithBody({
235+
const output = module.exports.messages.newMessageWithBody({
232236
headers: result.headers,
233237
body: item,
234238
statusCode: result.statusCode,
@@ -239,7 +243,7 @@ module.exports.processMethod = async function (msg, cfg) {
239243
await emitter.emit('data', output);
240244
}
241245
} else {
242-
const output = messages.newMessageWithBody(result);
246+
const output = module.exports.messages.newMessageWithBody(result);
243247
output.attachments = msg.attachments;
244248
await emitter.emit('data', output);
245249
}
@@ -371,7 +375,7 @@ module.exports.processMethod = async function (msg, cfg) {
371375
errorMessage: e.message,
372376
errorStack: e.stack,
373377
};
374-
await emitter.emit('data', messages.newMessageWithBody(output));
378+
await emitter.emit('data', output);
375379
await rateLimit(emitter.logger, rateLimitDelay);
376380
await emitter.emit('end');
377381
} else {

test/httpRequestAction.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const sinon = require('sinon');
55
const { expect } = require('chai');
66
const nock = require('nock');
77
const fs = require('fs');
8-
const { messages } = require('elasticio-node');
98
const logger = require('@elastic.io/component-logger')();
109
const client = require('elasticio-rest-node')();
10+
const { messages } = require('../lib/utils');
1111

1212
const { stub } = sinon;
1313

0 commit comments

Comments
 (0)