diff --git a/Dockerfile b/Dockerfile index dd387eb..1dacd9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # build environment -FROM node:18-bullseye-slim AS builder +FROM node:22-bullseye-slim AS builder # fix vulnerabilities -ARG NPM_TAG=9.6.4 +ARG NPM_TAG=11.0.0 RUN npm install -g npm@${NPM_TAG} # build it WORKDIR /build @@ -10,7 +10,7 @@ RUN npm ci RUN npm run build # run environment -FROM node:18.16.0-bullseye-slim +FROM node:22.12.0-bullseye-slim # fix vulnerabilities # note: trivy insists this to be on the same RUN line RUN apt-get -y update && apt-get -y upgrade @@ -34,7 +34,7 @@ ENTRYPOINT ["/usr/bin/dumb-init", "--"] # fix vulnerabilities RUN npm install -g npm@${NPM_TAG} # install dependancies -ENV NODE_ENV production +ENV NODE_ENV=production RUN npm ci --omit=dev USER node CMD ["sh", "-c", "node ./index.js --silent=${SILENT} --mime-type=${MIME_TYPE} --poll-interval=${POLL_INTERVAL} --follow=${FOLLOW}"] diff --git a/README.md b/README.md index 640d273..f265abb 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,12 @@ The tool can be run as a Docker container, using a pre-built container or after To create a Docker image, run the following command: ```bash -docker build --tag vsds/ldes-list-fragments . +docker build --tag vsds/ldes-list-fragments:latest . ``` To run the Docker image mapped and follow an LDES view, you can run it interactively, e.g.: ```bash -docker run --rm -it \ --e FOLLOW=https://gtfs.smartdataspace.dev-vlaanderen.be/connections/by-stop-and-time \ -vsds/ldes-list-fragments:latest +docker run --rm -it -e FOLLOW=hhttps://ldes.telraam-api.net/observations/by-page vsds/ldes-list-fragments:latest ``` > **Note**: this is a large data set so you may want to interrupt the container with `CTRL-C`. @@ -42,7 +40,6 @@ The tool takes the following command line arguments: You can run the tool providing the mandatory view URL (and one or more optional arguments) after building it, e.g.: ```bash -node dist/index.js --silent false --mime-type "text/turtle" --poll-interval 30000 \ ---follow https://gtfs.smartdataspace.dev-vlaanderen.be/connections/by-stop-and-time +node dist/index.js --silent false --mime-type "text/turtle" --poll-interval 30000 --follow https://ldes.telraam-api.net/observations/by-page ``` > **Note**: again, this is a large data set so you may want to interrupt the tool with `CTRL-C`. diff --git a/package-lock.json b/package-lock.json index 763ace7..6134bcd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,59 +9,67 @@ "version": "1.0.0", "license": "EUPL-1.2", "dependencies": { - "cache-control-parser": "^2.0.4", + "cache-control-parser": "^2.0.6", "minimist": "^1.2.8", - "n3": "^1.16.4", - "node-fetch": "^3.3.1", + "n3": "^1.23.1", + "node-fetch": "^3.3.2", "sorted-queue": "^0.3.5" }, "devDependencies": { - "@types/minimist": "^1.2.2", - "@types/n3": "^1.10.4", - "@types/node": "^18.15.11", - "@types/node-fetch": "^2.6.3", - "typescript": "^4.9.4" + "@types/minimist": "^1.2.5", + "@types/n3": "^1.21.1", + "@types/node": "^22.10.2", + "@types/node-fetch": "^2.6.12", + "typescript": "^5.7.2" } }, "node_modules/@rdfjs/types": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@rdfjs/types/-/types-1.1.0.tgz", - "integrity": "sha512-5zm8bN2/CC634dTcn/0AhTRLaQRjXDZs3QfcAsQKNturHT7XVWcKy/8p3P5gXl+YkZTAmy7T5M/LyiT/jbkENw==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@rdfjs/types/-/types-1.1.2.tgz", + "integrity": "sha512-wqpOJK1QCbmsGNtyzYnojPU8gRDPid2JO0Q0kMtb4j65xhCK880cnKAfEOwC+dX85VJcCByQx5zOwyyfCjDJsg==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/minimist": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", - "dev": true + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==", + "dev": true, + "license": "MIT" }, "node_modules/@types/n3": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/@types/n3/-/n3-1.10.4.tgz", - "integrity": "sha512-FfRTwcbXcScVHuAjIASveRWL6Fi6fPALl1Ge8tMESYLqU7R42LJvtdBpUi+f9YK0oQPqIN+zFFgMDFJfLMx0bg==", + "version": "1.21.1", + "resolved": "https://registry.npmjs.org/@types/n3/-/n3-1.21.1.tgz", + "integrity": "sha512-9KxFlFj3etnpdI2nyQEp/jHry5DHxWT22z9Nc/y/hdHe0CHVc9rKu+NacWKUyN06dDLDh7ZnjCzY8yBJ9lmzdw==", "dev": true, + "license": "MIT", "dependencies": { - "@types/node": "*", - "rdf-js": "^4.0.2" + "@rdfjs/types": "^1.1.0", + "@types/node": "*" } }, "node_modules/@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", - "dev": true + "version": "22.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz", + "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.20.0" + } }, "node_modules/@types/node-fetch": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.3.tgz", - "integrity": "sha512-ETTL1mOEdq/sxUtgtOhKjyB2Irra4cjxksvcMUR5Zr4n+PxVhsCD9WS46oPbHL3et9Zde7CNRr+WUNlcHvsX+w==", + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*", - "form-data": "^3.0.0" + "form-data": "^4.0.0" } }, "node_modules/abort-controller": { @@ -79,7 +87,8 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/base64-js": { "version": "1.5.1", @@ -124,15 +133,17 @@ } }, "node_modules/cache-control-parser": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/cache-control-parser/-/cache-control-parser-2.0.4.tgz", - "integrity": "sha512-/FyoH+1kaAHoJC86Yz+ix0+l4DCisx/+nNjZs4HRFQcyuUJv5O9TsEu9pXi4e56kV7veou6k3QMCl6LRGo0qdQ==" + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/cache-control-parser/-/cache-control-parser-2.0.6.tgz", + "integrity": "sha512-N4rxCk7V8NLfUVONXG0d7S4IyTQh3KEDW5k2I4CAcEUcMQCmVkfAMn37JSWfUQudiR883vDBy5XM5+TS2Xo7uQ==", + "license": "MIT" }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, + "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -153,6 +164,7 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -196,10 +208,11 @@ } }, "node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", "dev": true, + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -244,6 +257,7 @@ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -253,6 +267,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, + "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -269,10 +284,12 @@ } }, "node_modules/n3": { - "version": "1.16.4", - "resolved": "https://registry.npmjs.org/n3/-/n3-1.16.4.tgz", - "integrity": "sha512-jtC53efM5/q4BYC3qBnegn1MJDKXHH9PEd6gVDNpIicbgXS6gkANz4DdI0jt4aLvza1xSjCcni33riXWvfoEdw==", + "version": "1.23.1", + "resolved": "https://registry.npmjs.org/n3/-/n3-1.23.1.tgz", + "integrity": "sha512-3f0IYJo+6+lXypothmlwPzm3wJNffsxUwnfONeFv2QqWq7RjTvyCMtkRXDUXW6XrZoOzaQX8xTTSYNlGjXcGtw==", + "license": "MIT", "dependencies": { + "buffer": "^6.0.3", "queue-microtask": "^1.1.2", "readable-stream": "^4.0.0" }, @@ -299,9 +316,10 @@ } }, "node_modules/node-fetch": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", - "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "license": "MIT", "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", @@ -342,15 +360,6 @@ } ] }, - "node_modules/rdf-js": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/rdf-js/-/rdf-js-4.0.2.tgz", - "integrity": "sha512-ApvlFa/WsQh8LpPK/6hctQwG06Z9ztQQGWVtrcrf9L6+sejHNXLPOqL+w7q3hF+iL0C4sv3AX1PUtGkLNzyZ0Q==", - "dev": true, - "dependencies": { - "@rdfjs/types": "*" - } - }, "node_modules/readable-stream": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.2.0.tgz", @@ -371,18 +380,26 @@ "integrity": "sha512-Q/IP5o8NPMYjEjq6WA4ZH+RsUZNswblH4IN4CaIJ5j18LEY3ah2d6bjjS33Bvq7hOFVVFbwcXE2g5CQvkZeLZw==" }, "node_modules/typescript": { - "version": "4.9.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", - "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "dev": true, + "license": "MIT" + }, "node_modules/web-streams-polyfill": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", diff --git a/package.json b/package.json index 2fc797e..c592164 100644 --- a/package.json +++ b/package.json @@ -11,17 +11,17 @@ "author": "Ranko Orlic", "license": "EUPL-1.2", "dependencies": { - "cache-control-parser": "^2.0.4", + "cache-control-parser": "^2.0.6", "minimist": "^1.2.8", - "n3": "^1.16.4", - "node-fetch": "^3.3.1", + "n3": "^1.23.1", + "node-fetch": "^3.3.2", "sorted-queue": "^0.3.5" }, "devDependencies": { - "@types/minimist": "^1.2.2", - "@types/n3": "^1.10.4", - "@types/node": "^18.15.11", - "@types/node-fetch": "^2.6.3", - "typescript": "^4.9.4" + "@types/minimist": "^1.2.5", + "@types/n3": "^1.21.1", + "@types/node": "^22.10.2", + "@types/node-fetch": "^2.6.12", + "typescript": "^5.7.2" } }