From 1e41ffb35a9f1c1a8a7757657869219279018e52 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 7 May 2026 00:57:24 +0100 Subject: [PATCH 1/2] chore: remove `uuid` dependency --- package.json | 4 +--- src/eventarc/eventarc-utils.ts | 3 +-- test/unit/remote-config/condition-evaluator.spec.ts | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) 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..4ae3f0b324 100644 --- a/src/eventarc/eventarc-utils.ts +++ b/src/eventarc/eventarc-utils.ts @@ -17,7 +17,6 @@ import { PrefixedFirebaseError } from '../utils/error'; import { CloudEvent } from './cloudevent'; -import { v4 as uuid } from 'uuid'; import * as validator from '../utils/validator'; // List of CloudEvent properties that are handled "by hand" and should be skipped by @@ -50,7 +49,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 } From 66adf067b6e11ce8ae126c5f62dd1308145448a1 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 7 May 2026 01:06:42 +0100 Subject: [PATCH 2/2] fix: add import --- src/eventarc/eventarc-utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/eventarc/eventarc-utils.ts b/src/eventarc/eventarc-utils.ts index 4ae3f0b324..bf1f4dc893 100644 --- a/src/eventarc/eventarc-utils.ts +++ b/src/eventarc/eventarc-utils.ts @@ -18,6 +18,8 @@ import { PrefixedFirebaseError } from '../utils/error'; import { CloudEvent } from './cloudevent'; 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.