firebase-tools 15.20.0 → 15.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/lib/appdistribution/yaml_helper.js +2 -2
  2. package/lib/apphosting/constants.js +2 -1
  3. package/lib/apphosting/localbuilds.js +4 -2
  4. package/lib/apphosting/secrets/index.js +77 -0
  5. package/lib/archiveDirectory.js +2 -2
  6. package/lib/auth.js +2 -3
  7. package/lib/bin/cli.js +26 -18
  8. package/lib/commands/apphosting-secrets-revokeaccess.js +56 -0
  9. package/lib/commands/apptesting.js +11 -2
  10. package/lib/commands/crashlytics-symbols-upload.js +2 -2
  11. package/lib/commands/index.js +1 -0
  12. package/lib/crashlytics/sourcemap.js +2 -3
  13. package/lib/database/import.js +2 -2
  14. package/lib/dataconnect/build.js +6 -6
  15. package/lib/deploy/apphosting/util.js +9 -1
  16. package/lib/deploy/functions/prepare.js +39 -3
  17. package/lib/deploy/functions/prepareFunctionsUpload.js +1 -2
  18. package/lib/deploy/functions/release/index.js +0 -5
  19. package/lib/emulator/auth/apiSpec.js +307 -33
  20. package/lib/emulator/auth/cloudFunctions.js +2 -2
  21. package/lib/emulator/auth/operations.js +99 -9
  22. package/lib/emulator/auth/state.js +27 -0
  23. package/lib/emulator/downloadableEmulatorInfo.json +31 -31
  24. package/lib/emulator/functionsEmulatorShell.js +4 -4
  25. package/lib/emulator/functionsRuntimeWorker.js +2 -2
  26. package/lib/emulator/pubsubEmulator.js +3 -3
  27. package/lib/emulator/storage/apis/firebase.js +2 -2
  28. package/lib/emulator/storage/cloudFunctions.js +2 -2
  29. package/lib/emulator/storage/metadata.js +1 -2
  30. package/lib/emulator/storage/persistence.js +2 -2
  31. package/lib/emulator/storage/upload.js +3 -3
  32. package/lib/env.js +20 -4
  33. package/lib/experiments.js +1 -2
  34. package/lib/frameworks/angular/index.js +3 -2
  35. package/lib/frameworks/angular/utils.js +100 -2
  36. package/lib/frameworks/astro/index.js +1 -1
  37. package/lib/frameworks/astro/utils.js +1 -1
  38. package/lib/functions/python.js +4 -4
  39. package/lib/hosting/cloudRunProxy.js +8 -0
  40. package/lib/index.js +2 -2
  41. package/lib/init/features/apphosting.js +8 -1
  42. package/lib/init/features/functions/python.js +32 -20
  43. package/lib/localFunction.js +4 -2
  44. package/lib/track.js +2 -2
  45. package/lib/tsconfig.compile.tsbuildinfo +1 -1
  46. package/lib/tsconfig.publish.tsbuildinfo +1 -1
  47. package/lib/utils.js +70 -0
  48. package/package.json +3 -7
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BuilderType = void 0;
3
+ exports.ANGULAR_22_DEFAULT_SERVER_ENTRY = exports.ANGULAR_22_RECOMMENDED_ALLOWED_HOSTS = exports.BuilderType = void 0;
4
4
  exports.getAllTargets = getAllTargets;
5
5
  exports.getContext = getContext;
6
6
  exports.getBrowserConfig = getBrowserConfig;
@@ -9,12 +9,19 @@ exports.getBuildConfig = getBuildConfig;
9
9
  exports.getAngularVersion = getAngularVersion;
10
10
  exports.tryToGetOptionsForTarget = tryToGetOptionsForTarget;
11
11
  exports.getBuilderType = getBuilderType;
12
+ exports.getAngular22SsrSecurityWarning = getAngular22SsrSecurityWarning;
13
+ exports.formatAngular22SsrSecurityWarning = formatAngular22SsrSecurityWarning;
14
+ exports.maybeWarnAngular22SsrSecurity = maybeWarnAngular22SsrSecurity;
15
+ exports.extractAngular22AllowedHostsFromBuildOptions = extractAngular22AllowedHostsFromBuildOptions;
16
+ exports.getAngular22ServerEntryPath = getAngular22ServerEntryPath;
12
17
  const utils_1 = require("../utils");
13
18
  const error_1 = require("../../error");
14
19
  const path_1 = require("path");
20
+ const promises_1 = require("fs/promises");
15
21
  const assert_1 = require("assert");
16
22
  const utils_2 = require("../../utils");
17
23
  const semver_1 = require("semver");
24
+ const clc = require("colorette");
18
25
  async function localesForTarget(dir, architectHost, target, workspaceProject) {
19
26
  const { targetStringFromTarget } = await (0, utils_1.relativeRequire)(dir, "@angular-devkit/architect");
20
27
  const targetOptions = await architectHost.getOptionsForTarget(target);
@@ -373,6 +380,7 @@ async function getContext(dir, targetOrConfiguration) {
373
380
  workspaceProject,
374
381
  serveOptimizedImages,
375
382
  ssr,
383
+ buildTargetOptions: buildTargetOptions || undefined,
376
384
  };
377
385
  }
378
386
  async function getBrowserConfig(sourceDir, configuration) {
@@ -460,7 +468,7 @@ async function getServerConfig(sourceDir, configuration) {
460
468
  }
461
469
  async function getBuildConfig(sourceDir, configuration) {
462
470
  const { targetStringFromTarget } = await (0, utils_1.relativeRequire)(sourceDir, "@angular-devkit/architect");
463
- const { buildTarget, browserTarget, baseHref, prerenderTarget, serverTarget, architectHost, workspaceProject, serveOptimizedImages, ssr, } = await getContext(sourceDir, configuration);
471
+ const { buildTarget, browserTarget, baseHref, prerenderTarget, serverTarget, architectHost, workspaceProject, serveOptimizedImages, ssr, buildTargetOptions, } = await getContext(sourceDir, configuration);
464
472
  const targets = (buildTarget
465
473
  ? [buildTarget]
466
474
  : prerenderTarget
@@ -477,6 +485,7 @@ async function getBuildConfig(sourceDir, configuration) {
477
485
  locales,
478
486
  serveOptimizedImages,
479
487
  ssr,
488
+ buildTargetOptions,
480
489
  };
481
490
  }
482
491
  function getAngularVersion(cwd) {
@@ -502,3 +511,92 @@ function getBuilderType(builder) {
502
511
  }
503
512
  return builderType;
504
513
  }
514
+ const ANGULAR_22_PUBLIC_HOST_PATTERNS = ["*.web.app", "*.firebaseapp.com"];
515
+ const ANGULAR_22_CLOUD_RUN_HOST_PATTERNS = ["*.a.run.app"];
516
+ exports.ANGULAR_22_RECOMMENDED_ALLOWED_HOSTS = [
517
+ ...ANGULAR_22_PUBLIC_HOST_PATTERNS,
518
+ ...ANGULAR_22_CLOUD_RUN_HOST_PATTERNS,
519
+ ];
520
+ function getAngular22SsrSecurityWarning(opts) {
521
+ if (!opts.ssr)
522
+ return undefined;
523
+ const declared = opts.buildOptionsAllowedHosts ?? [];
524
+ const serverHasAllowedHosts = !!opts.serverEntrySource && /\ballowedHosts\s*[:=]/.test(opts.serverEntrySource);
525
+ if (declared.includes("*") || (serverHasAllowedHosts && declared.length === 0)) {
526
+ return undefined;
527
+ }
528
+ const trustProxyHeadersEnabled = !!opts.serverEntrySource && /\btrustProxyHeaders\s*[:=]/.test(opts.serverEntrySource);
529
+ const requiredHostPatterns = trustProxyHeadersEnabled
530
+ ? ANGULAR_22_PUBLIC_HOST_PATTERNS
531
+ : ANGULAR_22_CLOUD_RUN_HOST_PATTERNS;
532
+ if (requiredHostPatterns.every((pattern) => declared.includes(pattern)))
533
+ return undefined;
534
+ const allowedHostsMissing = exports.ANGULAR_22_RECOMMENDED_ALLOWED_HOSTS.filter((pattern) => !declared.includes(pattern));
535
+ return { allowedHostsMissing, trustProxyHeadersEnabled };
536
+ }
537
+ function formatAngular22SsrSecurityWarning(warning) {
538
+ const sections = [
539
+ "Angular 22 enabled strict SSRF protection on its SSR engine. Without the matching security.allowedHosts entries, the SSR function will reject requests and return errors after deploy.",
540
+ [
541
+ "Add these hostnames to security.allowedHosts in angular.json:",
542
+ ` ${JSON.stringify(warning.allowedHostsMissing)}`,
543
+ `${clc.bold("Documentation")}: https://angular.dev/best-practices/security#configuring-allowed-hosts`,
544
+ ].join("\n"),
545
+ ];
546
+ if (!warning.trustProxyHeadersEnabled) {
547
+ sections.push([
548
+ "Alternatively, enable trustProxyHeaders so the engine validates the forwarded Hosting domain instead of the SSR function host. If you do, also add any custom domains you serve from to security.allowedHosts.",
549
+ `${clc.bold("Documentation")}: https://angular.dev/best-practices/security#configuring-trusted-proxy-headers`,
550
+ ].join("\n"));
551
+ }
552
+ const message = sections.join("\n\n");
553
+ return message
554
+ .split("\n")
555
+ .map((line, i) => (i === 0 ? line : " " + line))
556
+ .join("\n")
557
+ .concat("\n");
558
+ }
559
+ async function maybeWarnAngular22SsrSecurity(dir, opts) {
560
+ try {
561
+ const version = getAngularVersion(dir);
562
+ if (!version)
563
+ return;
564
+ const semver = (0, semver_1.coerce)(version);
565
+ if (!semver || semver.major < 22)
566
+ return;
567
+ if (!opts.ssr)
568
+ return;
569
+ const buildOptionsAllowedHosts = extractAngular22AllowedHostsFromBuildOptions(opts.buildTargetOptions);
570
+ const entryPath = getAngular22ServerEntryPath(opts.buildTargetOptions);
571
+ let serverEntrySource;
572
+ try {
573
+ serverEntrySource = await (0, promises_1.readFile)((0, path_1.join)(dir, entryPath), "utf8");
574
+ }
575
+ catch {
576
+ }
577
+ const warning = getAngular22SsrSecurityWarning({
578
+ ssr: opts.ssr,
579
+ buildOptionsAllowedHosts,
580
+ serverEntrySource,
581
+ });
582
+ if (!warning)
583
+ return;
584
+ (0, utils_2.logLabeledWarning)("Angular 22", formatAngular22SsrSecurityWarning(warning));
585
+ }
586
+ catch {
587
+ }
588
+ }
589
+ function extractAngular22AllowedHostsFromBuildOptions(options) {
590
+ const security = options?.security;
591
+ if (!security || !Array.isArray(security.allowedHosts))
592
+ return undefined;
593
+ return security.allowedHosts.filter((h) => typeof h === "string");
594
+ }
595
+ exports.ANGULAR_22_DEFAULT_SERVER_ENTRY = "src/server.ts";
596
+ function getAngular22ServerEntryPath(options) {
597
+ const ssr = options?.ssr;
598
+ if (ssr && typeof ssr !== "boolean" && typeof ssr.entry === "string") {
599
+ return ssr.entry;
600
+ }
601
+ return exports.ANGULAR_22_DEFAULT_SERVER_ENTRY;
602
+ }
@@ -50,7 +50,7 @@ async function ɵcodegenPublicDirectory(root, dest) {
50
50
  async function ɵcodegenFunctionsDirectory(sourceDir, destDir) {
51
51
  const { outDir } = await (0, utils_2.getConfig)(sourceDir);
52
52
  const packageJson = await (0, utils_1.readJSON)((0, path_1.join)(sourceDir, "package.json"));
53
- await (0, fs_extra_1.copy)((0, path_1.join)(sourceDir, outDir, "server"), (0, path_1.join)(destDir));
53
+ await (0, fs_extra_1.copy)((0, path_1.join)(sourceDir, outDir, "server"), (0, path_1.join)(destDir, "server"));
54
54
  return {
55
55
  packageJson,
56
56
  bootstrapScript: (0, utils_2.getBootstrapScript)(),
@@ -9,7 +9,7 @@ const semver_1 = require("semver");
9
9
  const url_1 = require("url");
10
10
  const { dynamicImport } = require(true && "../../dynamicImport");
11
11
  function getBootstrapScript() {
12
- return `const entry = import('./entry.mjs');\nexport const handle = async (req, res) => (await entry).handler(req, res)`;
12
+ return `const entry = import('./server/entry.mjs');\nexport const handle = async (req, res) => (await entry).handler(req, res)`;
13
13
  }
14
14
  async function getConfig(cwd) {
15
15
  const astroDirectory = (0, path_1.dirname)(require.resolve("astro/package.json", { paths: [cwd] }));
@@ -4,7 +4,7 @@ exports.DEFAULT_VENV_DIR = void 0;
4
4
  exports.virtualEnvCmd = virtualEnvCmd;
5
5
  exports.runWithVirtualEnv = runWithVirtualEnv;
6
6
  const path = require("path");
7
- const spawn = require("cross-spawn");
7
+ const cross_spawn_1 = require("cross-spawn");
8
8
  const logger_1 = require("../logger");
9
9
  const utils_1 = require("../utils");
10
10
  exports.DEFAULT_VENV_DIR = "venv";
@@ -13,17 +13,17 @@ function virtualEnvCmd(cwd, venvDir) {
13
13
  const venvActivate = `"${path.join(cwd, venvDir, ...activateScriptPath)}"`;
14
14
  return {
15
15
  command: utils_1.IS_WINDOWS ? venvActivate : ".",
16
- args: [utils_1.IS_WINDOWS ? "" : venvActivate],
16
+ args: utils_1.IS_WINDOWS ? [] : [venvActivate],
17
17
  };
18
18
  }
19
19
  function runWithVirtualEnv(commandAndArgs, cwd, envs, spawnOpts = {}, venvDir = exports.DEFAULT_VENV_DIR) {
20
20
  const { command, args } = virtualEnvCmd(cwd, venvDir);
21
21
  args.push("&&", ...commandAndArgs);
22
22
  logger_1.logger.debug(`Running command with virtualenv: command=${command}, args=${JSON.stringify(args)}`);
23
- return spawn(command, args, {
23
+ return (0, cross_spawn_1.spawn)(command, args, {
24
24
  shell: true,
25
25
  cwd,
26
- stdio: ["pipe", "pipe", "pipe", "pipe"],
26
+ stdio: "pipe",
27
27
  ...spawnOpts,
28
28
  env: envs,
29
29
  });
@@ -7,6 +7,9 @@ const proxy_1 = require("./proxy");
7
7
  const error_1 = require("../error");
8
8
  const logger_1 = require("../logger");
9
9
  const projectUtils_1 = require("../projectUtils");
10
+ const registry_1 = require("../emulator/registry");
11
+ const types_1 = require("../emulator/types");
12
+ const functionsEmulator_1 = require("../emulator/functionsEmulator");
10
13
  const cloudRunCache = {};
11
14
  const apiClient = new apiv2_1.Client({ urlPrefix: (0, api_1.cloudRunApiOrigin)(), apiVersion: "v1" });
12
15
  async function getCloudRunUrl(rewrite, projectId) {
@@ -44,6 +47,11 @@ function default_1(options) {
44
47
  }
45
48
  logger_1.logger.info(`[hosting] Cloud Run rewrite ${JSON.stringify(rewrite)} triggered`);
46
49
  const textIdentifier = `Cloud Run service "${rewrite.run.serviceId}" for region "${rewrite.run.region}"`;
50
+ if (options.targets?.includes("functions") && registry_1.EmulatorRegistry.isRunning(types_1.Emulators.FUNCTIONS)) {
51
+ const projectId = (0, projectUtils_1.needProjectId)(options);
52
+ const url = functionsEmulator_1.FunctionsEmulator.getHttpFunctionUrl(projectId, rewrite.run.serviceId, rewrite.run.region);
53
+ return (0, proxy_1.proxyRequestHandler)(url, `local ${textIdentifier}`);
54
+ }
47
55
  return getCloudRunUrl(rewrite, (0, projectUtils_1.needProjectId)(options))
48
56
  .then((url) => (0, proxy_1.proxyRequestHandler)(url, textIdentifier))
49
57
  .catch(proxy_1.errorRequestHandler);
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const program = require("commander");
3
3
  const clc = require("colorette");
4
- const leven = require("leven");
4
+ const utils_1 = require("./utils");
5
5
  const logger_1 = require("./logger");
6
6
  const command_1 = require("./command");
7
7
  const pkg = require("../package.json");
@@ -51,7 +51,7 @@ const client = {
51
51
  require("./commands").load(client);
52
52
  function suggestCommands(cmd, cmdList) {
53
53
  const suggestion = cmdList.find((c) => {
54
- return leven(c, cmd) < c.length * 0.4;
54
+ return (0, utils_1.stringDistance)(c, cmd) < c.length * 0.4;
55
55
  });
56
56
  if (suggestion) {
57
57
  logger_1.logger.error();
@@ -62,11 +62,18 @@ async function doSetup(setup, config, options) {
62
62
  backendConfig.rootDir = await (0, prompt_1.input)({
63
63
  default: "/",
64
64
  message: "Specify your app's root directory relative to your firebase.json directory",
65
+ validate: (input) => {
66
+ const absPath = path.join(config.projectDir, input);
67
+ if (!(0, fs_1.existsSync)(absPath)) {
68
+ return `Directory ${absPath} does not exist. Please enter a valid directory.`;
69
+ }
70
+ return true;
71
+ },
65
72
  });
66
73
  upsertAppHostingConfig(backendConfig, config);
67
74
  config.writeProjectFile("firebase.json", config.src);
68
75
  utils.logBullet("Writing default settings to " + clc.bold("apphosting.yaml") + "...");
69
- const absRootDir = path.join(process.cwd(), backendConfig.rootDir);
76
+ const absRootDir = path.join(config.projectDir, backendConfig.rootDir);
70
77
  if (!(0, fs_1.existsSync)(absRootDir)) {
71
78
  throw new error_1.FirebaseError(`Failed to write apphosting.yaml file because app root directory ${absRootDir} does not exist. Please try again with a valid directory.`);
72
79
  }
@@ -1,44 +1,56 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setup = setup;
4
- const spawn = require("cross-spawn");
4
+ const spawn_1 = require("../../spawn");
5
5
  const python_1 = require("../../../deploy/functions/runtimes/python");
6
6
  const python_2 = require("../../../functions/python");
7
7
  const prompt_1 = require("../../../prompt");
8
8
  const supported_1 = require("../../../deploy/functions/runtimes/supported");
9
9
  const templates_1 = require("../../../templates");
10
+ const error_1 = require("../../../error");
10
11
  const MAIN_TEMPLATE = (0, templates_1.readTemplateSync)("init/functions/python/main.py");
11
12
  const REQUIREMENTS_TEMPLATE = (0, templates_1.readTemplateSync)("init/functions/python/requirements.txt");
12
13
  const GITIGNORE_TEMPLATE = (0, templates_1.readTemplateSync)("init/functions/python/_gitignore");
14
+ function waitForProcess(p) {
15
+ return new Promise((resolve) => {
16
+ p.on("exit", resolve);
17
+ p.on("error", () => resolve(-1));
18
+ });
19
+ }
20
+ async function createVirtualEnv(pythonBinary, cwd) {
21
+ try {
22
+ await (0, spawn_1.wrapSpawn)(pythonBinary, ["-m", "venv", "venv"], cwd);
23
+ }
24
+ catch (err) {
25
+ throw new error_1.FirebaseError(`Failed to create virtual environment. Please make sure Python is installed and in your PATH.`);
26
+ }
27
+ }
28
+ async function installDependencies(pythonBinary, cwd) {
29
+ const upgradeProcess = (0, python_2.runWithVirtualEnv)([pythonBinary, "-m", "pip", "install", "--upgrade", "pip"], cwd, {}, { stdio: "inherit" });
30
+ const upgradeExitCode = await waitForProcess(upgradeProcess);
31
+ if (upgradeExitCode !== 0) {
32
+ throw new error_1.FirebaseError("Failed to upgrade pip inside virtual environment.");
33
+ }
34
+ const installProcess = (0, python_2.runWithVirtualEnv)([pythonBinary, "-m", "pip", "install", "-r", "requirements.txt"], cwd, {}, { stdio: "inherit" });
35
+ const installExitCode = await waitForProcess(installProcess);
36
+ if (installExitCode !== 0) {
37
+ throw new error_1.FirebaseError("Failed to install dependencies.");
38
+ }
39
+ }
13
40
  async function setup(setup, config) {
41
+ const sourceDir = config.path(setup.functions.source);
14
42
  await config.askWriteProjectFile(`${setup.functions.source}/requirements.txt`, REQUIREMENTS_TEMPLATE);
15
43
  await config.askWriteProjectFile(`${setup.functions.source}/.gitignore`, GITIGNORE_TEMPLATE);
16
44
  await config.askWriteProjectFile(`${setup.functions.source}/main.py`, MAIN_TEMPLATE);
17
45
  config.set("functions.runtime", (0, supported_1.latest)("python"));
18
46
  config.set("functions.ignore", ["venv", "__pycache__"]);
19
- const venvProcess = spawn((0, python_1.getPythonBinary)((0, supported_1.latest)("python")), ["-m", "venv", "venv"], {
20
- shell: true,
21
- cwd: config.path(setup.functions.source),
22
- stdio: ["pipe", "pipe", "pipe", "pipe"],
23
- });
24
- await new Promise((resolve, reject) => {
25
- venvProcess.on("exit", resolve);
26
- venvProcess.on("error", reject);
27
- });
47
+ const pythonBinary = (0, python_1.getPythonBinary)((0, supported_1.latest)("python"));
48
+ await createVirtualEnv(pythonBinary, sourceDir);
28
49
  const install = await (0, prompt_1.confirm)({
29
50
  message: "Do you want to install dependencies now?",
30
51
  default: true,
31
52
  });
32
53
  if (install) {
33
- const upgradeProcess = (0, python_2.runWithVirtualEnv)(["pip3", "install", "--upgrade", "pip"], config.path(setup.functions.source), {}, { stdio: ["inherit", "inherit", "inherit"] });
34
- await new Promise((resolve, reject) => {
35
- upgradeProcess.on("exit", resolve);
36
- upgradeProcess.on("error", reject);
37
- });
38
- const installProcess = (0, python_2.runWithVirtualEnv)([(0, python_1.getPythonBinary)((0, supported_1.latest)("python")), "-m", "pip", "install", "-r", "requirements.txt"], config.path(setup.functions.source), {}, { stdio: ["inherit", "inherit", "inherit"] });
39
- await new Promise((resolve, reject) => {
40
- installProcess.on("exit", resolve);
41
- installProcess.on("error", reject);
42
- });
54
+ await installDependencies(pythonBinary, sourceDir);
43
55
  }
44
56
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HTTPS_SENTINEL = void 0;
4
- const uuid = require("uuid");
4
+ const crypto_1 = require("crypto");
5
5
  const encodeFirestoreValue_1 = require("./firestore/encodeFirestoreValue");
6
6
  const utils = require("./utils");
7
7
  const apiv2_1 = require("./apiv2");
@@ -249,7 +249,9 @@ class LocalFunction {
249
249
  else if (this.isPubsubFunc(this.trigger.eventTrigger)) {
250
250
  dataPayload = data;
251
251
  if (this.trigger.platform === "gcfv2") {
252
- dataPayload = { message: { ...data, messageId: uuid.v4() } };
252
+ dataPayload = {
253
+ message: { ...data, messageId: (0, crypto_1.randomUUID)() },
254
+ };
253
255
  }
254
256
  this.controller.call(this.trigger, dataPayload || {}, opts);
255
257
  }
package/lib/track.js CHANGED
@@ -9,7 +9,7 @@ exports.emulatorSession = emulatorSession;
9
9
  exports.vscodeSession = vscodeSession;
10
10
  exports.cliSession = cliSession;
11
11
  const node_fetch_1 = require("node-fetch");
12
- const uuid_1 = require("uuid");
12
+ const crypto_1 = require("crypto");
13
13
  const auth_1 = require("./auth");
14
14
  const configstore_1 = require("./configstore");
15
15
  const logger_1 = require("./logger");
@@ -177,7 +177,7 @@ function session(propertyName) {
177
177
  if (!property.currentSession) {
178
178
  let clientId = configstore_1.configstore.get(property.clientIdKey);
179
179
  if (!clientId) {
180
- clientId = (0, uuid_1.v4)();
180
+ clientId = (0, crypto_1.randomUUID)();
181
181
  configstore_1.configstore.set(property.clientIdKey, clientId);
182
182
  }
183
183
  property.currentSession = {