diff --git a/package-lock.json b/package-lock.json index d3834425a..a3d9f7e8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -340,13 +340,10 @@ "dev": true }, "@types/uuid": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.4.tgz", - "integrity": "sha512-tPIgT0GUmdJQNSHxp0X2jnpQfBSTfGxUMc/2CXBU2mnyTFVYVa2ojpoQ74w0U2yn2vw3jnC640+77lkFFpdVDw==", - "dev": true, - "requires": { - "@types/node": "*" - } + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.0.tgz", + "integrity": "sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ==", + "dev": true }, "accepts": { "version": "1.3.5", @@ -1519,7 +1516,8 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true }, "interpret": { "version": "1.2.0", @@ -2284,6 +2282,14 @@ "uuid": "^3.3.2", "yargs": "^13.2.2", "yargs-parser": "^13.0.0" + }, + "dependencies": { + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + } } }, "oauth-sign": { @@ -2744,6 +2750,11 @@ "requires": { "mime-db": "~1.38.0" } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" } } }, @@ -3562,9 +3573,9 @@ "dev": true }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", + "integrity": "sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ==" }, "validate-npm-package-license": { "version": "3.0.4", diff --git a/package.json b/package.json index 2545f2532..8a4e53f43 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "request": ">=2.9.0", "sax": ">=0.6", "strip-bom": "^3.0.0", - "uuid": "^3.1.0", + "uuid": "^8.3.0", "xml-crypto": "^1.4.0" }, "repository": { @@ -52,7 +52,7 @@ "@types/node": "^11.11.0", "@types/request": "^2.48.1", "@types/sax": "^1.0.1", - "@types/uuid": "^3.4.4", + "@types/uuid": "^8.3.0", "body-parser": "^1.15.2", "colors": "^1.3.3", "coveralls": "^3.0.5", diff --git a/src/client.ts b/src/client.ts index 4d9d827e6..6cbf7ff04 100644 --- a/src/client.ts +++ b/src/client.ts @@ -11,7 +11,7 @@ import getStream = require('get-stream'); import { IncomingHttpHeaders } from 'http'; import * as _ from 'lodash'; import * as request from 'request'; -import { v4 as uuid4 } from 'uuid'; +import { v4 as uuidv4 } from 'uuid'; import { HttpClient, Request } from './http'; import { IHeaders, IOptions, ISecurity, SoapMethod } from './types'; import { findPrefix } from './utils'; @@ -443,7 +443,7 @@ export class Client extends EventEmitter { this.lastRequest = xml; this.lastEndpoint = location; - const eid: string = options.exchangeId || uuid4(); + const eid: string = options.exchangeId || uuidv4(); this.emit('message', message, eid); this.emit('request', xml, eid); diff --git a/src/http.ts b/src/http.ts index d6583e6e4..5607988f2 100644 --- a/src/http.ts +++ b/src/http.ts @@ -8,7 +8,7 @@ import * as httpNtlm from 'httpntlm'; import * as _ from 'lodash'; import * as req from 'request'; import * as url from 'url'; -import * as uuid from 'uuid/v4'; +import {v4 as uuidv4} from 'uuid'; import { IHeaders, IOptions } from './types'; const debug = debugBuilder('node-soap'); @@ -86,7 +86,7 @@ export class HttpClient { }; if (exoptions.forceMTOM || attachments.length > 0) { - const start = uuid(); + const start = uuidv4(); let action = null; if (headers['Content-Type'].indexOf('action') > -1) { for (const ct of headers['Content-Type'].split('; ')) { @@ -96,7 +96,7 @@ export class HttpClient { } } headers['Content-Type'] = - 'multipart/related; type="application/xop+xml"; start="<' + start + '>"; start-info="text/xml"; boundary=' + uuid(); + 'multipart/related; type="application/xop+xml"; start="<' + start + '>"; start-info="text/xml"; boundary=' + uuidv4(); if (action) { headers['Content-Type'] = headers['Content-Type'] + '; ' + action; } diff --git a/src/security/WSSecurityCert.ts b/src/security/WSSecurityCert.ts index d585ba028..f79c57d92 100644 --- a/src/security/WSSecurityCert.ts +++ b/src/security/WSSecurityCert.ts @@ -1,4 +1,4 @@ -import { v4 as uuid4 } from 'uuid'; +import { v4 as uuidv4 } from 'uuid'; import { SignedXml } from 'xml-crypto'; import { ISecurity } from '../types'; @@ -25,7 +25,7 @@ function insertStr(src: string, dst: string, pos: number): string { } function generateId(): string { - return uuid4().replace(/-/gm, ''); + return uuidv4().replace(/-/gm, ''); } const oasisBaseUri = 'http://docs.oasis-open.org/wss/2004/01';