Skip to content

Commit

Permalink
Upgrade uuid (#1124)
Browse files Browse the repository at this point in the history
The new version migrated to named exports and provided more utilities.

See changelog https://github.com/uuidjs/uuid/blob/master/CHANGELOG.md
  • Loading branch information
TrySound authored Sep 29, 2020
1 parent 2120a1a commit 4fc5b05
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 20 deletions.
33 changes: 22 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as debugBuilder from 'debug';
import * as httpNtlm from 'httpntlm';
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');
Expand Down Expand Up @@ -87,7 +87,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('; ')) {
Expand All @@ -97,7 +97,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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/security/WSSecurityCert.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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';
Expand Down

0 comments on commit 4fc5b05

Please sign in to comment.