diff --git a/package.json b/package.json index f375c597e6..db2d7c2c1d 100644 --- a/package.json +++ b/package.json @@ -222,8 +222,7 @@ "google-auth-library": "^10.6.1", "jsonwebtoken": "^9.0.0", "jwks-rsa": "^3.1.0", - "node-forge": "^1.4.0", - "uuid": "^11.0.2" + "node-forge": "^1.4.0" }, "optionalDependencies": { "@google-cloud/firestore": "^7.11.0", @@ -249,7 +248,6 @@ "@types/request-promise": "^4.1.41", "@types/sinon": "^17.0.2", "@types/sinon-chai": "^3.0.0", - "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^8.56.0", "@typescript-eslint/parser": "^8.56.0", "bcrypt": "^6.0.0", diff --git a/src/eventarc/eventarc-utils.ts b/src/eventarc/eventarc-utils.ts index 3737e5a906..bf1f4dc893 100644 --- a/src/eventarc/eventarc-utils.ts +++ b/src/eventarc/eventarc-utils.ts @@ -17,8 +17,9 @@ import { PrefixedFirebaseError } from '../utils/error'; import { CloudEvent } from './cloudevent'; -import { v4 as uuid } from 'uuid'; import * as validator from '../utils/validator'; +// TODO: remove import in next major (v14) +import * as crypto from 'crypto'; // List of CloudEvent properties that are handled "by hand" and should be skipped by // automatic attribute copy. @@ -50,7 +51,7 @@ export function toCloudEventProtoFormat(ce: CloudEvent): any { } const out: Record = { '@type': 'type.googleapis.com/io.cloudevents.v1.CloudEvent', - 'id': ce.id ?? uuid(), + 'id': ce.id ?? crypto.randomUUID(), 'type': ce.type, 'specVersion': ce.specversion ?? '1.0', 'source': source diff --git a/test/unit/remote-config/condition-evaluator.spec.ts b/test/unit/remote-config/condition-evaluator.spec.ts index 764d1b76ef..7576d22586 100644 --- a/test/unit/remote-config/condition-evaluator.spec.ts +++ b/test/unit/remote-config/condition-evaluator.spec.ts @@ -26,7 +26,6 @@ import { NamedCondition, OneOfCondition, } from '../../../src/remote-config/remote-config-api'; -import { v4 as uuidv4 } from 'uuid'; import { clone } from 'lodash'; import * as crypto from 'crypto'; @@ -907,7 +906,7 @@ describe('ConditionEvaluator', () => { ...clone(condition), seed: 'seed' }; - const context = { randomizationId: uuidv4() } + const context = { randomizationId: crypto.randomUUID() } if (conditionEvaluator.evaluateConditions([{ name: 'is_enabled', condition: { percent: clonedCondition }