@stordata/vsphere-soapify 0.0.27 → 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 CHANGED
@@ -1,10 +1,17 @@
1
- image: docker.stordata.fr/stordata/docker-node:16
1
+ image: docker.stordata.fr/stordata/docker-node:18
2
2
 
3
3
  stages:
4
- - build
4
+ - test
5
5
 
6
- build:
7
- stage: build
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
- 16.13.0
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} [requestOptions] Options given to request. See https://github.com/request/request#requestoptions-callback
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, requestOptions, features) {
25
+ constructor(url, options, features) {
26
26
  this.url = url;
27
- this.requestOptions = requestOptions;
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
  /**