@itentialopensource/adapter-winston_syslog 1.2.5 → 1.3.0
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/.eslintrc.js +1 -0
- package/AUTH.md +1 -1
- package/BROKER.md +4 -4
- package/CALLS.md +8 -8
- package/ENHANCE.md +3 -3
- package/PROPERTIES.md +24 -9
- package/README.md +24 -23
- package/SUMMARY.md +2 -2
- package/SYSTEMINFO.md +1 -1
- package/TAB1.md +2 -2
- package/TAB2.md +6 -2
- package/TROUBLESHOOT.md +10 -1
- package/UTILITIES.md +473 -0
- package/adapter.js +5 -5
- package/adapterBase.js +52 -16
- package/package.json +26 -30
- package/pronghorn.json +17 -15
- package/propertiesSchema.json +68 -7
- package/report/adapterInfo.json +7 -7
- package/report/updateReport1748551891579.json +120 -0
- package/sampleProperties.json +4 -0
- package/test/integration/adapterTestBasicGet.js +88 -54
- package/test/integration/adapterTestConnectivity.js +15 -16
- package/test/integration/adapterTestIntegration.js +1 -38
- package/test/unit/adapterBaseTestUnit.js +641 -39
- package/test/unit/adapterTestUnit.js +17 -54
- package/utils/adapterInfo.js +114 -164
- package/utils/argParser.js +44 -0
- package/utils/checkMigrate.js +77 -38
- package/utils/entitiesToDB.js +53 -42
- package/utils/logger.js +26 -0
- package/utils/modify.js +56 -55
- package/utils/mongoDbConnection.js +79 -0
- package/utils/mongoUtils.js +162 -0
- package/utils/taskMover.js +31 -32
- package/utils/tbScript.js +36 -172
- package/utils/tbUtils.js +84 -226
- package/utils/troubleshootingAdapter.js +68 -84
- package/utils/updateAdapterConfig.js +158 -0
- package/utils/addAuth.js +0 -94
- package/utils/artifactize.js +0 -146
- package/utils/basicGet.js +0 -50
- package/utils/packModificationScript.js +0 -35
- package/utils/patches2bundledDeps.js +0 -90
|
@@ -7,14 +7,11 @@ const assert = require('assert');
|
|
|
7
7
|
const https = require('https');
|
|
8
8
|
const mocha = require('mocha');
|
|
9
9
|
const ping = require('ping');
|
|
10
|
-
const
|
|
10
|
+
const dns = require('dns');
|
|
11
|
+
const { parseArgs } = require('../../utils/argParser');
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (val.indexOf('--HOST') === 0) {
|
|
15
|
-
[, host] = val.split('=');
|
|
16
|
-
}
|
|
17
|
-
});
|
|
13
|
+
const dnsPromises = dns.promises;
|
|
14
|
+
const { host } = parseArgs();
|
|
18
15
|
|
|
19
16
|
describe('[integration] Adapter Test', () => {
|
|
20
17
|
context(`Testing network connection on ${host}`, () => {
|
|
@@ -23,10 +20,10 @@ describe('[integration] Adapter Test', () => {
|
|
|
23
20
|
});
|
|
24
21
|
|
|
25
22
|
it('DNS resolve', (done) => {
|
|
26
|
-
|
|
27
|
-
.then((
|
|
23
|
+
dnsPromises.lookup(host, { all: true })
|
|
24
|
+
.then((result) => {
|
|
28
25
|
try {
|
|
29
|
-
assert.ok(
|
|
26
|
+
assert.ok(result.length > 0);
|
|
30
27
|
done();
|
|
31
28
|
} catch (error) {
|
|
32
29
|
done(error);
|
|
@@ -78,12 +75,13 @@ describe('[integration] Adapter Test', () => {
|
|
|
78
75
|
it('Support IPv4', (done) => {
|
|
79
76
|
const options = {
|
|
80
77
|
family: 4,
|
|
81
|
-
hints:
|
|
78
|
+
hints: dns.ADDRCONFIG
|
|
82
79
|
};
|
|
83
80
|
|
|
84
|
-
|
|
85
|
-
.then((
|
|
81
|
+
dnsPromises.lookup(host, options)
|
|
82
|
+
.then((result) => {
|
|
86
83
|
try {
|
|
84
|
+
const { address, family } = result;
|
|
87
85
|
assert.ok(address !== null && family === 4);
|
|
88
86
|
done();
|
|
89
87
|
} catch (error) {
|
|
@@ -98,12 +96,13 @@ describe('[integration] Adapter Test', () => {
|
|
|
98
96
|
it('Support IPv6', (done) => {
|
|
99
97
|
const options = {
|
|
100
98
|
family: 6,
|
|
101
|
-
hints:
|
|
99
|
+
hints: dns.ADDRCONFIG
|
|
102
100
|
};
|
|
103
101
|
|
|
104
|
-
|
|
105
|
-
.then((
|
|
102
|
+
dnsPromises.lookup(host, options)
|
|
103
|
+
.then((result) => {
|
|
106
104
|
try {
|
|
105
|
+
const { address, family } = result;
|
|
107
106
|
assert.ok(address !== null && family === 6);
|
|
108
107
|
done();
|
|
109
108
|
} catch (error) {
|
|
@@ -16,11 +16,11 @@ const winston = require('winston');
|
|
|
16
16
|
const { expect } = require('chai');
|
|
17
17
|
const { use } = require('chai');
|
|
18
18
|
const td = require('testdouble');
|
|
19
|
+
const log = require('../../utils/logger');
|
|
19
20
|
|
|
20
21
|
const anything = td.matchers.anything();
|
|
21
22
|
|
|
22
23
|
// stub and attemptTimeout are used throughout the code so set them here
|
|
23
|
-
let logLevel = 'none';
|
|
24
24
|
const isRapidFail = false;
|
|
25
25
|
const isSaveMockData = false;
|
|
26
26
|
|
|
@@ -71,43 +71,6 @@ global.pronghornProps = {
|
|
|
71
71
|
|
|
72
72
|
global.$HOME = `${__dirname}/../..`;
|
|
73
73
|
|
|
74
|
-
// set the log levels that Pronghorn uses, spam and trace are not defaulted in so without
|
|
75
|
-
// this you may error on log.trace calls.
|
|
76
|
-
const myCustomLevels = {
|
|
77
|
-
levels: {
|
|
78
|
-
spam: 6,
|
|
79
|
-
trace: 5,
|
|
80
|
-
debug: 4,
|
|
81
|
-
info: 3,
|
|
82
|
-
warn: 2,
|
|
83
|
-
error: 1,
|
|
84
|
-
none: 0
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// need to see if there is a log level passed in
|
|
89
|
-
process.argv.forEach((val) => {
|
|
90
|
-
// is there a log level defined to be passed in?
|
|
91
|
-
if (val.indexOf('--LOG') === 0) {
|
|
92
|
-
// get the desired log level
|
|
93
|
-
const inputVal = val.split('=')[1];
|
|
94
|
-
|
|
95
|
-
// validate the log level is supported, if so set it
|
|
96
|
-
if (Object.hasOwnProperty.call(myCustomLevels.levels, inputVal)) {
|
|
97
|
-
logLevel = inputVal;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
// need to set global logging
|
|
103
|
-
global.log = winston.createLogger({
|
|
104
|
-
level: logLevel,
|
|
105
|
-
levels: myCustomLevels.levels,
|
|
106
|
-
transports: [
|
|
107
|
-
new winston.transports.Console()
|
|
108
|
-
]
|
|
109
|
-
});
|
|
110
|
-
|
|
111
74
|
/**
|
|
112
75
|
* Runs the common asserts for test
|
|
113
76
|
*/
|