Skip to content

Commit b92eefc

Browse files
committed
refactor: replace deprecated guid dependency by uuid
1 parent 846e4a4 commit b92eefc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/GetEmbedInfo/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Cosmo Tech.
22
// Licensed under the MIT license.
33

4-
const guid = require('guid');
4+
const uuid = require('uuid');
55
const jwt = require('jsonwebtoken');
66
const jwksClient = require('jwks-rsa');
77
const { MSAL_CONFIG, GUID_PARAMETERS, REQUIRED_PARAMETERS, getConfigValue } = require('./config');
@@ -19,7 +19,7 @@ const sanitizeAndValidateConfig = () => {
1919

2020
for (const parameter of GUID_PARAMETERS) {
2121
const sanitizedValue = getConfigValue(parameter);
22-
if (sanitizedValue && !guid.isGuid(sanitizedValue))
22+
if (sanitizedValue && !uuid.validate(sanitizedValue))
2323
throw new ServiceAccountError(
2424
500,
2525
'Configuration error',
@@ -88,7 +88,7 @@ const validateQuery = async (req) => {
8888
);
8989

9090
for (const reportId of reportsIds) {
91-
if (!guid.isGuid(reportId))
91+
if (!uuid.validate(reportId))
9292
throw new ServiceAccountError(
9393
400,
9494
'Bad request',
@@ -98,7 +98,7 @@ const validateQuery = async (req) => {
9898

9999
// Check PowerBI workspace id parameter
100100
const workspaceId = req?.body?.workspaceId;
101-
if (workspaceId != null && !guid.isGuid(workspaceId))
101+
if (workspaceId != null && !uuid.validate(workspaceId))
102102
throw new ServiceAccountError(
103103
400,
104104
'Bad request',

0 commit comments

Comments
 (0)