diff --git a/packages/api/src/controllers/api-token.js b/packages/api/src/controllers/api-token.js index 189b233180..1ee47a05ad 100644 --- a/packages/api/src/controllers/api-token.js +++ b/packages/api/src/controllers/api-token.js @@ -1,5 +1,5 @@ import Router from "express/lib/router"; -import uuid from "uuid/v4"; +import { v4 as uuid } from "uuid"; import sql from "sql-template-strings"; import { makeNextHREF, parseOrder, parseFilters } from "./helpers"; diff --git a/packages/api/src/controllers/api-token.test.js b/packages/api/src/controllers/api-token.test.js index fbbbd8f77d..f70e4c5ad5 100644 --- a/packages/api/src/controllers/api-token.test.js +++ b/packages/api/src/controllers/api-token.test.js @@ -1,6 +1,6 @@ import serverPromise from "../test-server"; import { TestClient, clearDatabase } from "../test-helpers"; -import uuid from "uuid/v4"; +import { v4 as uuid } from "uuid"; let server; let mockUser; diff --git a/packages/api/src/controllers/object-store.test.js b/packages/api/src/controllers/object-store.test.js index e73cb2b9b5..d834c20071 100644 --- a/packages/api/src/controllers/object-store.test.js +++ b/packages/api/src/controllers/object-store.test.js @@ -1,6 +1,6 @@ import serverPromise from "../test-server"; import { TestClient, clearDatabase } from "../test-helpers"; -import uuid from "uuid/v4"; +import { v4 as uuid } from "uuid"; // includes auth file tests diff --git a/packages/api/src/controllers/region.test.js b/packages/api/src/controllers/region.test.js index 46a780d0ad..625c8e42db 100644 --- a/packages/api/src/controllers/region.test.js +++ b/packages/api/src/controllers/region.test.js @@ -1,6 +1,6 @@ import serverPromise from "../test-server"; import { TestClient, clearDatabase } from "../test-helpers"; -import uuid from "uuid/v4"; +import { v4 as uuid } from "uuid"; import hash from "../hash"; let server; diff --git a/packages/api/src/controllers/webhook.ts b/packages/api/src/controllers/webhook.ts index 7adfc7c299..f5bccae4f5 100644 --- a/packages/api/src/controllers/webhook.ts +++ b/packages/api/src/controllers/webhook.ts @@ -3,7 +3,7 @@ import { authorizer } from "../middleware"; import { validatePost } from "../middleware"; import Router from "express/lib/router"; import logger from "../logger"; -import uuid from "uuid/v4"; +import { v4 as uuid } from "uuid"; import { makeNextHREF, parseFilters, parseOrder, FieldsMap } from "./helpers"; import { db } from "../store"; import sql from "sql-template-strings"; diff --git a/packages/api/src/store/cdn-usage-table.ts b/packages/api/src/store/cdn-usage-table.ts index 23b49564ad..98b825a0a9 100644 --- a/packages/api/src/store/cdn-usage-table.ts +++ b/packages/api/src/store/cdn-usage-table.ts @@ -1,6 +1,6 @@ import { DB } from "./db"; import logger from "../logger"; -import uuid from "uuid/v4"; +import { v4 as uuid } from "uuid"; import { CdnDataRow } from "../schema/types"; @@ -67,7 +67,7 @@ export class CdnUsageTable { await client.query( `INSERT INTO ${name} VALUES (to_timestamp($1), $2, $3, $4, $5, $6, $7, $8, $9, $10) ON CONFLICT (date, region, playback_id) - DO UPDATE SET + DO UPDATE SET unique_client_ips = ${name}.unique_client_ips + EXCLUDED.unique_client_ips, total_filesize = ${name}.total_filesize + EXCLUDED.total_filesize, total_cs_bytes = ${name}.total_cs_bytes + EXCLUDED.total_cs_bytes, @@ -91,7 +91,7 @@ export class CdnUsageTable { await client.query( `INSERT INTO cdn_usage_last VALUES ($1, $2) ON CONFLICT ((data ->> 'region'::text) ) - DO UPDATE SET + DO UPDATE SET data = EXCLUDED.data `, [newId, JSON.stringify({ region, fileName })] diff --git a/packages/api/src/store/db.test.ts b/packages/api/src/store/db.test.ts index 2ad91dbaec..c4b1725bb7 100644 --- a/packages/api/src/store/db.test.ts +++ b/packages/api/src/store/db.test.ts @@ -1,4 +1,4 @@ -import uuid from "uuid/v4"; +import { v4 as uuid } from "uuid"; import { DB } from "./db"; import Table from "./table"; import { Pool } from "pg";