diff --git a/package.json b/package.json index 257c0fb..dba68ed 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "author": "Tim Koschuetzki ", "packageManager": "yarn@4.0.1", "engines": { - "node": ">= 14.16" + "node": ">= 14.17" }, "dependencies": { "debug": "^4.3.1", @@ -22,8 +22,7 @@ "into-stream": "^6.0.0", "is-stream": "^2.0.0", "p-map": "^4.0.0", - "tus-js-client": "^3.0.1", - "uuid": "^8.3.2" + "tus-js-client": "^3.0.1" }, "devDependencies": { "@babel/core": "^7.12.3", diff --git a/src/Transloadit.js b/src/Transloadit.js index 7820e9e..54a64d0 100644 --- a/src/Transloadit.js +++ b/src/Transloadit.js @@ -1,6 +1,6 @@ +const crypto = require('crypto') const got = require('got') const FormData = require('form-data') -const crypto = require('crypto') const fs = require('fs') const fsPromises = require('fs/promises') const debug = require('debug') @@ -8,7 +8,6 @@ const intoStream = require('into-stream') const isStream = require('is-stream') const assert = require('assert') const pMap = require('p-map') -const uuid = require('uuid') const InconsistentResponseError = require('./InconsistentResponseError') const PaginationStream = require('./PaginationStream') @@ -167,7 +166,7 @@ class TransloaditClient { if (assemblyId != null) { effectiveAssemblyId = assemblyId } else { - effectiveAssemblyId = uuid.v4().replace(/-/g, '') + effectiveAssemblyId = crypto.randomUUID().replace(/-/g, '') } const urlSuffix = `/assemblies/${effectiveAssemblyId}` diff --git a/test/integration/live-api.test.js b/test/integration/live-api.test.js index e013c0b..90c84b9 100644 --- a/test/integration/live-api.test.js +++ b/test/integration/live-api.test.js @@ -1,3 +1,4 @@ +const crypto = require('crypto') const querystring = require('querystring') const temp = require('temp') const fs = require('fs') @@ -5,7 +6,6 @@ const nodePath = require('path') const nodeStream = require('stream/promises') const got = require('got') const intoStream = require('into-stream') -const uuid = require('uuid') const debug = require('debug') const log = debug('transloadit:live-api') @@ -129,7 +129,7 @@ afterAll(async () => { }) async function createVirtualTestServer(handler) { - const id = uuid.v4() + const id = crypto.randomUUID() log('Adding virtual server handler', id) const url = `${testServer.url}/${id}` handlers.set(id, handler) @@ -296,7 +296,7 @@ describe('API integration', { timeout: 30000 }, () => { it('should allow setting an explicit assemblyId on createAssembly', async () => { const client = createClient() - const assemblyId = uuid.v4().replace(/-/g, '') + const assemblyId = crypto.randomUUID().replace(/-/g, '') const params = { assemblyId, waitForCompletion: true, diff --git a/yarn.lock b/yarn.lock index d61b92e..f0499c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5762,7 +5762,6 @@ __metadata: temp: "npm:^0.9.1" tsd: "npm:^0.25.0" tus-js-client: "npm:^3.0.1" - uuid: "npm:^8.3.2" vitest: "npm:^2.0.5" languageName: unknown linkType: soft @@ -6003,15 +6002,6 @@ __metadata: languageName: node linkType: hard -"uuid@npm:^8.3.2": - version: 8.3.2 - resolution: "uuid@npm:8.3.2" - bin: - uuid: dist/bin/uuid - checksum: bcbb807a917d374a49f475fae2e87fdca7da5e5530820ef53f65ba1d12131bd81a92ecf259cc7ce317cbe0f289e7d79fdfebcef9bfa3087c8c8a2fa304c9be54 - languageName: node - linkType: hard - "v8-compile-cache@npm:^2.0.3": version: 2.4.0 resolution: "v8-compile-cache@npm:2.4.0"