@stordata/vsphere-soapify 0.0.28 → 0.0.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/.gitlab-ci.yml +11 -4
- package/.nvmrc +1 -1
- package/lib/client.js +5 -8
- package/package.json +13 -13
- package/samples/index.js +5 -2
package/.gitlab-ci.yml
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
image: docker.stordata.fr/stordata/docker-node:
|
|
1
|
+
image: docker.stordata.fr/stordata/docker-node:18
|
|
2
2
|
|
|
3
3
|
stages:
|
|
4
|
-
-
|
|
4
|
+
- test
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
include:
|
|
7
|
+
- template: Jobs/SAST.gitlab-ci.yml
|
|
8
|
+
- template: Jobs/Dependency-Scanning.gitlab-ci.yml
|
|
9
|
+
|
|
10
|
+
variables:
|
|
11
|
+
SAST_EXCLUDED_PATHS: "*.spec.js, *.test.js"
|
|
12
|
+
|
|
13
|
+
test:
|
|
14
|
+
stage: test
|
|
8
15
|
tags:
|
|
9
16
|
- docker
|
|
10
17
|
script:
|
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
18.12.1
|
package/lib/client.js
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
const soap = require('soap'),
|
|
4
4
|
_ = require('lodash'),
|
|
5
5
|
Parser = require('./parser'),
|
|
6
|
-
request = require('./request'),
|
|
7
6
|
{ ServiceInstance, HostSystem, VirtualMachine, Datacenter, Datastore } = require('./sdk').managed,
|
|
8
7
|
{ PerfQuerySpec, PerfMetricId } = require('./sdk').data,
|
|
9
8
|
DEFAULT_FEATURES = require('./features');
|
|
10
9
|
|
|
11
10
|
module.exports = class Client {
|
|
11
|
+
|
|
12
12
|
/**
|
|
13
13
|
* Creates a new Client to access a vSphere server.
|
|
14
14
|
*
|
|
15
15
|
* @param {String} url The URL to the vSphere endpoint.
|
|
16
16
|
* Use the base URL only, the library manages the actual SDK endpoints automatically
|
|
17
|
-
* @param {Object} [
|
|
17
|
+
* @param {Object} [options] The client options, passed to the `soap` library directly
|
|
18
18
|
* @param {Object} [features] An optional list of feature flags to control advanced settings of the created Client
|
|
19
19
|
* @param {boolean} [features.alwaysUseMaxSampleInQuerySpec=false] Whether to force the use of `maxSample` in QuerySpec objects,
|
|
20
20
|
* even though this might form invalid calls. Use with caution !
|
|
@@ -22,9 +22,9 @@ module.exports = class Client {
|
|
|
22
22
|
*
|
|
23
23
|
* @constructor
|
|
24
24
|
*/
|
|
25
|
-
constructor(url,
|
|
25
|
+
constructor(url, options, features) {
|
|
26
26
|
this.url = url;
|
|
27
|
-
this.
|
|
27
|
+
this.options = options;
|
|
28
28
|
this.features = _.defaults(features, DEFAULT_FEATURES);
|
|
29
29
|
|
|
30
30
|
this.parser = new Parser(this);
|
|
@@ -43,10 +43,7 @@ module.exports = class Client {
|
|
|
43
43
|
getClient() {
|
|
44
44
|
const wsdl = `${__dirname}/wsdl/5.5/vimService.wsdl`;
|
|
45
45
|
|
|
46
|
-
return this._cache('client', () => soap.createClientAsync(wsdl, {
|
|
47
|
-
endpoint: this.url,
|
|
48
|
-
request: request(this.url, this.requestOptions)
|
|
49
|
-
}));
|
|
46
|
+
return this._cache('client', () => soap.createClientAsync(wsdl, { endpoint: this.url, ...this.options }));
|
|
50
47
|
}
|
|
51
48
|
|
|
52
49
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stordata/vsphere-soapify",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"description": "A NodeJS abstraction layer for the vSphere SOAP API",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"author": "Stordata <teamdenbas@stordata.fr>",
|
|
20
20
|
"license": "UNLICENCED",
|
|
21
21
|
"engines": {
|
|
22
|
-
"node": ">=
|
|
22
|
+
"node": ">= 18"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public",
|
|
@@ -29,26 +29,26 @@
|
|
|
29
29
|
"axios": "0.27.2",
|
|
30
30
|
"debug": "4.3.4",
|
|
31
31
|
"lodash": "4.17.21",
|
|
32
|
-
"soap": "0.
|
|
33
|
-
"tough-cookie": "4.1.
|
|
32
|
+
"soap": "1.0.0",
|
|
33
|
+
"tough-cookie": "4.1.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@stordata/eslint-config": "1.0.
|
|
37
|
-
"chai": "4.3.
|
|
36
|
+
"@stordata/eslint-config": "1.0.20230825210735",
|
|
37
|
+
"chai": "4.3.8",
|
|
38
38
|
"chai-datetime": "1.8.0",
|
|
39
|
-
"eslint": "8.
|
|
40
|
-
"eslint-plugin-import": "2.
|
|
39
|
+
"eslint": "8.48.0",
|
|
40
|
+
"eslint-plugin-import": "2.28.1",
|
|
41
41
|
"eslint-plugin-json": "3.1.0",
|
|
42
|
-
"eslint-plugin-no-only-tests": "3.
|
|
42
|
+
"eslint-plugin-no-only-tests": "3.1.0",
|
|
43
43
|
"eslint-plugin-node": "11.1.0",
|
|
44
|
-
"grunt": "1.
|
|
44
|
+
"grunt": "1.6.1",
|
|
45
45
|
"grunt-env": "1.0.1",
|
|
46
|
-
"grunt-eslint": "24.
|
|
46
|
+
"grunt-eslint": "24.3.0",
|
|
47
47
|
"grunt-release": "0.14.0",
|
|
48
48
|
"grunt-simple-mocha": "0.4.1",
|
|
49
49
|
"mockdate": "3.0.5",
|
|
50
|
-
"nock": "13.
|
|
51
|
-
"sinon": "
|
|
50
|
+
"nock": "13.3.3",
|
|
51
|
+
"sinon": "15.2.0",
|
|
52
52
|
"sinon-chai": "3.7.0"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/samples/index.js
CHANGED
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
const https = require('https'),
|
|
6
|
+
request = require('../lib/request'),
|
|
6
7
|
{ Client } = require('..'),
|
|
7
8
|
{ VSPHERE_URI, LOGIN, PASSWORD } = process.env;
|
|
8
9
|
|
|
9
10
|
module.exports = (sample) => {
|
|
10
11
|
const client = new Client(VSPHERE_URI, {
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
request: request(VSPHERE_URI, {
|
|
13
|
+
httpsAgent: new https.Agent({
|
|
14
|
+
rejectUnauthorized: false
|
|
15
|
+
})
|
|
13
16
|
})
|
|
14
17
|
});
|
|
15
18
|
|