elasticio-sailor-nodejs 2.6.28-dev3 → 2.6.29

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/.nsprc CHANGED
@@ -0,0 +1,6 @@
1
+ {
2
+ "GHSA-wc69-rhjr-hc9g": {
3
+ "active": true,
4
+ "notes": "Bunyan library set only new Date to momentjs as parameter"
5
+ }
6
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "editor.rulers": [
3
+ {
4
+ "column": 120
5
+ }
6
+ ]
7
+ }
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 2.6.29 (July 14, 2022)
2
+
3
+ * Enabled keep-alive for global HTTPS agent ([#6359](https://github.com/elasticio/elasticio/issues/6359))
4
+
5
+ ## 2.6.28 (June 21, 2022)
6
+
7
+ * Fix: "sailor-nodejs ignores errors from maester during lightweight message upload" [#6233](https://github.com/elasticio/elasticio/issues/6233))
8
+
1
9
  ## 2.6.27 (March 10, 2022)
2
10
 
3
11
  * Added npm audit to CI and fixed all dependencies
package/lib/sailor.js CHANGED
@@ -367,7 +367,6 @@ class Sailor {
367
367
  if (settings.EMIT_LIGHTWEIGHT_MESSAGE) {
368
368
  logger.trace('Outgoing lightweight is enabled, going to check size.');
369
369
  const bodyBuf = Buffer.from(JSON.stringify(body), 'utf-8');
370
- logger.info('bodyBuf type:', { type: typeof bodyBuf });
371
370
  const passthroughBufs = Object.keys(passthrough).map(stepId => ({
372
371
  stepId,
373
372
  body: Buffer.from(JSON.stringify(passthrough[stepId].body), 'utf-8'),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "elasticio-sailor-nodejs",
3
3
  "description": "The official elastic.io library for bootstrapping and executing for Node.js connectors",
4
- "version": "2.6.28-dev3",
4
+ "version": "2.6.29",
5
5
  "main": "run.js",
6
6
  "scripts": {
7
7
  "audit": "better-npm-audit audit --level high --production",
package/run.js CHANGED
@@ -7,16 +7,21 @@ const settings = require('./lib/settings.js');
7
7
  const { IPC } = require('./lib/ipc.js');
8
8
  const Q = require('q');
9
9
  const http = require('http');
10
+ const https = require('https');
10
11
 
11
12
  let sailor;
12
13
  let sailorInit;
13
14
  let disconnectRequired;
14
15
 
15
- // miserable try to workaround issue described in https://github.com/elasticio/elasticio/issues/4874
16
- const { Agent } = http;
17
- http.globalAgent = new Agent({
18
- keepAlive: true
19
- });
16
+ function prepareSandbox() {
17
+ // enable keep alive by default to handle issues like https://github.com/elasticio/elasticio/issues/4874
18
+ http.globalAgent = new http.Agent({
19
+ keepAlive: true
20
+ });
21
+ https.globalAgent = new https.Agent({
22
+ keepAlive: true
23
+ });
24
+ }
20
25
 
21
26
  async function putOutToSea(settings, ipc) {
22
27
  ipc.send('init:started');
@@ -88,6 +93,7 @@ async function gracefulShutdown() {
88
93
  }
89
94
 
90
95
  async function run(settings, ipc) {
96
+ prepareSandbox();
91
97
  try {
92
98
  await putOutToSea(settings, ipc);
93
99
  logger.info('Fully initialized and waiting for messages');