diff --git a/package.json b/package.json index 1dce53c..5f165c9 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,6 @@ "@commitlint/cli": "^17.4.4", "@commitlint/config-conventional": "^17.4.4", "@fastify/middie": "^8.1.0", - "@japa/api-client": "^1.4.4", "@japa/assert": "^1.4.1", "@japa/expect-type": "^1.0.3", "@japa/run-failed-tests": "^1.1.1", @@ -95,6 +94,7 @@ "typescript": "^4.9.5" }, "dependencies": { + "@paralleldrive/cuid2": "^2.2.0", "@poppinss/macroable": "^1.0.0-2", "@poppinss/matchit": "^3.1.2", "@poppinss/middleware": "^3.1.0", @@ -103,7 +103,6 @@ "accepts": "^1.3.8", "content-disposition": "^0.5.4", "cookie": "^0.5.0", - "cuid": "^3.0.0", "destroy": "^1.2.0", "encodeurl": "^1.0.2", "etag": "^1.8.1", diff --git a/src/request.ts b/src/request.ts index 4bf04ca..eb6b128 100644 --- a/src/request.ts +++ b/src/request.ts @@ -7,7 +7,6 @@ * file that was distributed with this source code. */ -import cuid from 'cuid' import fresh from 'fresh' import typeIs from 'type-is' import accepts from 'accepts' @@ -17,6 +16,7 @@ import proxyaddr from 'proxy-addr' import { safeEqual } from '@poppinss/utils' import Macroable from '@poppinss/macroable' import lodash from '@poppinss/utils/lodash' +import { createId } from '@paralleldrive/cuid2' import { parse, UrlWithStringQuery } from 'node:url' import type { Encryption } from '@adonisjs/encryption' import { ServerResponse, IncomingMessage, IncomingHttpHeaders } from 'node:http' @@ -154,7 +154,7 @@ export class Request extends Macroable { id(): string | undefined { let requestId = this.header('x-request-id') if (!requestId && this.#config.generateRequestId) { - requestId = cuid() + requestId = createId() this.request.headers['x-request-id'] = requestId }