From 93f06b6c0f9add08c7fcd169d7e40a1a0f575b33 Mon Sep 17 00:00:00 2001 From: SiFalorSum Date: Mon, 16 Dec 2024 10:36:44 +0100 Subject: [PATCH 1/3] dependency updates --- package-lock.json | 160 ++++++++++++++------------- package.json | 8 +- packages/administration/package.json | 2 +- packages/sender/package.json | 2 +- 4 files changed, 87 insertions(+), 85 deletions(-) diff --git a/package-lock.json b/package-lock.json index a4f6ab3..bf7b8c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,11 +10,11 @@ "packages/*" ], "devDependencies": { - "@cloudflare/workers-types": "^4.20240821.1", - "@types/jest": "^29.5.12", + "@cloudflare/workers-types": "^4.20241205.0", + "@types/jest": "^29.5.14", "@types/ua-parser-js": "^0.7.39", - "@typescript-eslint/eslint-plugin": "8.3.0", - "@typescript-eslint/parser": "8.3.0", + "@typescript-eslint/eslint-plugin": "8.18.0", + "@typescript-eslint/parser": "8.18.0", "eslint": "^8.57.0", "eslint-plugin-prettierx": "github:utily/eslint-plugin-prettierx#utily-20231004", "eslint-plugin-simple-import-sort": "^12.1.1", @@ -696,9 +696,9 @@ } }, "node_modules/@cloudflare/workers-types": { - "version": "4.20240821.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20240821.1.tgz", - "integrity": "sha512-icAkbnAqgVl6ef9lgLTom8na+kj2RBw2ViPAQ586hbdj0xZcnrjK7P46Eu08OU9D/lNDgN2sKU/sxhe2iK/gIg==" + "version": "4.20241205.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20241205.0.tgz", + "integrity": "sha512-pj1VKRHT/ScQbHOIMFODZaNAlJHQHdBSZXNIdr9ebJzwBff9Qz8VdqhbhggV7f+aUEh8WSbrsPIo4a+WtgjUvw==" }, "node_modules/@cogneco/mend": { "version": "1.7.15", @@ -1633,9 +1633,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.12", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", - "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -1703,16 +1703,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.3.0.tgz", - "integrity": "sha512-FLAIn63G5KH+adZosDYiutqkOkYEx0nvcwNNfJAf+c7Ae/H35qWwTYvPZUKFj5AS+WfHG/WJJfWnDnyNUlp8UA==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.0.tgz", + "integrity": "sha512-NR2yS7qUqCL7AIxdJUQf2MKKNDVNaig/dEB0GBLU7D+ZdHgK1NoH/3wsgO3OnPVipn51tG3MAwaODEGil70WEw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.3.0", - "@typescript-eslint/type-utils": "8.3.0", - "@typescript-eslint/utils": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0", + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/type-utils": "8.18.0", + "@typescript-eslint/utils": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1727,24 +1727,20 @@ }, "peerDependencies": { "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.3.0.tgz", - "integrity": "sha512-h53RhVyLu6AtpUzVCYLPhZGL5jzTD9fZL+SYf/+hYOx2bDkyQXztXSc4tbvKYHzfMXExMLiL9CWqJmVz6+78IQ==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.0.tgz", + "integrity": "sha512-hgUZ3kTEpVzKaK3uNibExUYm6SKKOmTU2BOxBSvOYwtJEPdVQ70kZJpPjstlnhCHcuc2WGfSbpKlb/69ttyN5Q==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.3.0", - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/typescript-estree": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0", + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/typescript-estree": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0", "debug": "^4.3.4" }, "engines": { @@ -1755,22 +1751,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.3.0.tgz", - "integrity": "sha512-mz2X8WcN2nVu5Hodku+IR8GgCOl4C0G/Z1ruaWN4dgec64kDBabuXyPAr+/RgJtumv8EEkqIzf3X2U5DUKB2eg==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.0.tgz", + "integrity": "sha512-PNGcHop0jkK2WVYGotk/hxj+UFLhXtGPiGtiaWgVBVP1jhMoMCHlTyJA+hEj4rszoSdLTK3fN4oOatrL0Cp+Xw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0" + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1781,13 +1773,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.3.0.tgz", - "integrity": "sha512-wrV6qh//nLbfXZQoj32EXKmwHf4b7L+xXLrP3FZ0GOUU72gSvLjeWUl5J5Ue5IwRxIV1TfF73j/eaBapxx99Lg==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.0.tgz", + "integrity": "sha512-er224jRepVAVLnMF2Q7MZJCq5CsdH2oqjP4dT7K6ij09Kyd+R21r7UVJrF0buMVdZS5QRhDzpvzAxHxabQadow==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.3.0", - "@typescript-eslint/utils": "8.3.0", + "@typescript-eslint/typescript-estree": "8.18.0", + "@typescript-eslint/utils": "8.18.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1798,16 +1790,15 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/types": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.3.0.tgz", - "integrity": "sha512-y6sSEeK+facMaAyixM36dQ5NVXTnKWunfD1Ft4xraYqxP0lC0POJmIaL/mw72CUMqjY9qfyVfXafMeaUj0noWw==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.0.tgz", + "integrity": "sha512-FNYxgyTCAnFwTrzpBGq+zrnoTO4x0c1CKYY5MuUTzpScqmY5fmsh2o3+57lqdI3NZucBDCzDgdEbIaNfAjAHQA==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1818,13 +1809,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.3.0.tgz", - "integrity": "sha512-Mq7FTHl0R36EmWlCJWojIC1qn/ZWo2YiWYc1XVtasJ7FIgjo0MVv9rZWXEE7IK2CGrtwe1dVOxWwqXUdNgfRCA==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.0.tgz", + "integrity": "sha512-rqQgFRu6yPkauz+ms3nQpohwejS8bvgbPyIDq13cgEDbkXt4LH4OkDMT0/fN1RUtzG8e8AKJyDBoocuQh8qNeg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0", + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1839,10 +1830,8 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { @@ -1870,15 +1859,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.3.0.tgz", - "integrity": "sha512-F77WwqxIi/qGkIGOGXNBLV7nykwfjLsdauRB/DOFPdv6LTF3BHHkBpq81/b5iMPSF055oO2BiivDJV4ChvNtXA==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.0.tgz", + "integrity": "sha512-p6GLdY383i7h5b0Qrfbix3Vc3+J2k6QWw6UMUeY5JGfm3C5LbZ4QIZzJNoNOfgyRe0uuYKjvVOsO/jD4SJO+xg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.3.0", - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/typescript-estree": "8.3.0" + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/typescript-estree": "8.18.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1888,17 +1877,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.3.0.tgz", - "integrity": "sha512-RmZwrTbQ9QveF15m/Cl28n0LXD6ea2CjkhH5rQ55ewz3H24w+AMCJHPVYaZ8/0HoG8Z3cLLFFycRXxeO2tz9FA==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.0.tgz", + "integrity": "sha512-pCh/qEA8Lb1wVIqNvBke8UaRjJ6wrAWkJO5yyIbs8Yx6TNGYyfNjOo61tLv+WwLvoLPp4BQ8B7AHKijl8NGUfw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.18.0", + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1908,6 +1898,18 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -2560,9 +2562,9 @@ } }, "node_modules/cloudly-storage": { - "version": "0.10.15", - "resolved": "https://registry.npmjs.org/cloudly-storage/-/cloudly-storage-0.10.15.tgz", - "integrity": "sha512-tpJr2uGakb3lsskK0Gl8A/LucNnLru0ubBQMw4Sk4WOwH6ZD1C+IKbRaXWWHiTwR65Q2rd7hxB9wTSy5bBrWvw==", + "version": "0.10.16", + "resolved": "https://registry.npmjs.org/cloudly-storage/-/cloudly-storage-0.10.16.tgz", + "integrity": "sha512-HpgpjPxC2w29mNArB9z6FHkknTDURUAiYlXn/XvV1CFfSJOVDLPuXPiUG4qsy9dIZRETEJwd0dBoUroEUdreZA==", "dependencies": { "cloudly-http": "^0.1.7", "cloudly-router": "^0.1.1", @@ -7447,7 +7449,7 @@ "cloudly-analytics-common": "^0.3.33", "cloudly-http": "^0.1.7", "cloudly-router": "^0.1.1", - "cloudly-storage": "^0.10.15", + "cloudly-storage": "^0.10.16", "gracely": "^2.0.8", "isly": "^0.1.20", "isoly": "^2.3.11", @@ -7471,7 +7473,7 @@ "dependencies": { "cloudly-analytics-common": "^0.3.33", "cloudly-http": "^0.1.7", - "cloudly-storage": "^0.10.15", + "cloudly-storage": "^0.10.16", "gracely": "^2.0.8" } }, diff --git a/package.json b/package.json index b99758f..24cc97d 100644 --- a/package.json +++ b/package.json @@ -51,11 +51,11 @@ "start": "npm --prefix test-worker run start" }, "devDependencies": { - "@cloudflare/workers-types": "^4.20240821.1", - "@types/jest": "^29.5.12", + "@cloudflare/workers-types": "^4.20241205.0", + "@types/jest": "^29.5.14", "@types/ua-parser-js": "^0.7.39", - "@typescript-eslint/eslint-plugin": "8.3.0", - "@typescript-eslint/parser": "8.3.0", + "@typescript-eslint/eslint-plugin": "8.18.0", + "@typescript-eslint/parser": "8.18.0", "eslint": "^8.57.0", "eslint-plugin-prettierx": "github:utily/eslint-plugin-prettierx#utily-20231004", "eslint-plugin-simple-import-sort": "^12.1.1", diff --git a/packages/administration/package.json b/packages/administration/package.json index 5871f35..49ad79b 100644 --- a/packages/administration/package.json +++ b/packages/administration/package.json @@ -12,7 +12,7 @@ "cloudly-analytics-common": "^0.3.33", "cloudly-http": "^0.1.7", "cloudly-router": "^0.1.1", - "cloudly-storage": "^0.10.15", + "cloudly-storage": "^0.10.16", "gracely": "^2.0.8", "isly": "^0.1.20", "isoly": "^2.3.11", diff --git a/packages/sender/package.json b/packages/sender/package.json index 23ee74a..9657d5e 100644 --- a/packages/sender/package.json +++ b/packages/sender/package.json @@ -9,7 +9,7 @@ "dependencies": { "cloudly-analytics-common": "^0.3.33", "cloudly-http": "^0.1.7", - "cloudly-storage": "^0.10.15", + "cloudly-storage": "^0.10.16", "gracely": "^2.0.8" } } From 456d790964eeb3caa8b4c58695a3ef25f39490da Mon Sep 17 00:00:00 2001 From: SiFalorSum Date: Mon, 16 Dec 2024 10:38:02 +0100 Subject: [PATCH 2/3] fetch bigquery statistics --- packages/administration/Listener/Base.ts | 6 +++--- packages/administration/Listener/BigQuery/index.ts | 7 +++++-- .../ListenerConfigurationClient/TypescriptApi.ts | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/administration/Listener/Base.ts b/packages/administration/Listener/Base.ts index 08c05f8..0779b01 100644 --- a/packages/administration/Listener/Base.ts +++ b/packages/administration/Listener/Base.ts @@ -23,8 +23,8 @@ export abstract class BaseListener { * Returns status of the listener. * Override `getStatus` instead to add details. */ - async getStatus() { - const result: BaseListener.StatusResult = await this.addStatusDetails({ ok: true }) + async getStatus(statistics?: boolean) { + const result: BaseListener.StatusResult = await this.addStatusDetails({ ok: true }, (statistics = false)) // TODO: Get statistics from bucket. return result } @@ -34,7 +34,7 @@ export abstract class BaseListener { * This is a stub, made to be overridden. * Override this to add details. */ - async addStatusDetails(result: BaseListener.StatusResult): Promise { + async addStatusDetails(result: BaseListener.StatusResult, statistics?: boolean): Promise { return result } diff --git a/packages/administration/Listener/BigQuery/index.ts b/packages/administration/Listener/BigQuery/index.ts index ca9d49f..8c3464d 100644 --- a/packages/administration/Listener/BigQuery/index.ts +++ b/packages/administration/Listener/BigQuery/index.ts @@ -25,9 +25,12 @@ export namespace BigQuery { return { ...bigQueryConfiguration, privateKey, errorHandler, logger } } export class Implementation extends BaseListener { - async addStatusDetails(result: BaseListener.StatusResult): Promise { + async addStatusDetails( + result: BaseListener.StatusResult, + statistics?: boolean + ): Promise { const bigQueryApi = new BigQueryApi(this.configuration) - ;(result.details ??= {}).table = await bigQueryApi.getTable() + ;(result.details ??= {}).table = await bigQueryApi.getTable(statistics ? "STORAGE_STATS" : undefined) return result } getConfiguration() { diff --git a/packages/administration/storageClient/ListenerConfigurationClient/TypescriptApi.ts b/packages/administration/storageClient/ListenerConfigurationClient/TypescriptApi.ts index 90f67f2..9d959f1 100644 --- a/packages/administration/storageClient/ListenerConfigurationClient/TypescriptApi.ts +++ b/packages/administration/storageClient/ListenerConfigurationClient/TypescriptApi.ts @@ -31,7 +31,7 @@ export class TypescriptApi extends Base { return result } - async fetch(name: string): Promise { + async fetch(name: string, statistics?: boolean): Promise { let result: FetchResult | undefined const listenerConfiguration = await this.getListenerConfiguration(name) if (!listenerConfiguration) { @@ -40,7 +40,7 @@ export class TypescriptApi extends Base { const listener = Listener.create(listenerConfiguration) result = { configuration: listener.getConfiguration(), - status: await listener.getStatus(), + status: await listener.getStatus(statistics), readonly: true, } } From d01e25f34021c2702439c1ab55c2d02803f485e7 Mon Sep 17 00:00:00 2001 From: SiFalorSum Date: Mon, 16 Dec 2024 10:43:17 +0100 Subject: [PATCH 3/3] fix vulnerability --- package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index bf7b8c2..c6a4487 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "requires": true, "packages": { "": { + "name": "cloudly-analytics", "license": "MIT", "workspaces": [ "packages/*" @@ -5132,9 +5133,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "dev": true, "funding": [ {