diff --git a/.github/workflows/build-mobile.yml b/.github/workflows/build-mobile.yml
index 24e0859d5..3da7cbe10 100644
--- a/.github/workflows/build-mobile.yml
+++ b/.github/workflows/build-mobile.yml
@@ -45,7 +45,7 @@ jobs:
uses: subosito/flutter-action@v2
with:
channel: "stable"
- flutter-version: "3.16.9"
+ flutter-version: "3.19.3"
cache: true
- name: Create the Keystore
diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml
index 000dbe2dd..9d50f6f8f 100644
--- a/.github/workflows/prepare-release.yml
+++ b/.github/workflows/prepare-release.yml
@@ -4,16 +4,16 @@ on:
workflow_dispatch:
inputs:
serverBump:
- description: "Bump server version"
+ description: 'Bump server version'
required: true
- default: "false"
+ default: 'false'
type: choice
options:
- - "false"
+ - 'false'
- minor
- patch
mobileBump:
- description: "Bump mobile build number"
+ description: 'Bump mobile build number'
required: false
type: boolean
@@ -46,8 +46,8 @@ jobs:
with:
author_name: Alex The Bot
author_email: alex.tran1502@gmail.com
- default_author: user_info
- message: "Version ${{ env.IMMICH_VERSION }}"
+ default_author: user_info
+ message: 'Version ${{ env.IMMICH_VERSION }}'
tag: ${{ env.IMMICH_VERSION }}
push: true
@@ -85,4 +85,5 @@ jobs:
docker/example.env
docker/hwaccel.ml.yml
docker/hwaccel.transcoding.yml
+ docker/prometheus.yml
*.apk
diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml
index c2b633c4b..1fb9cb55f 100644
--- a/.github/workflows/static_analysis.yml
+++ b/.github/workflows/static_analysis.yml
@@ -23,7 +23,7 @@ jobs:
uses: subosito/flutter-action@v2
with:
channel: "stable"
- flutter-version: "3.16.9"
+ flutter-version: "3.19.3"
- name: Install dependencies
run: dart pub get
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 1d57b3a84..6a5df111d 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -329,14 +329,14 @@ jobs:
- name: Generate new migrations
continue-on-error: true
- run: npm run typeorm:migrations:generate ./src/infra/migrations/TestMigration
+ run: npm run typeorm:migrations:generate ./src/migrations/TestMigration
- name: Find file changes
uses: tj-actions/verify-changed-files@v19
id: verify-changed-files
with:
files: |
- server/src/infra/migrations/
+ server/src/migrations/
- name: Verify migration files have not changed
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
@@ -354,7 +354,7 @@ jobs:
id: verify-changed-sql-files
with:
files: |
- server/src/infra/sql
+ server/src/queries
- name: Verify SQL files have not changed
if: steps.verify-changed-sql-files.outputs.files_changed == 'true'
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 000000000..3267c6713
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,34 @@
+{
+ "editor.formatOnSave": true,
+ "[javascript][typescript][css]": {
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
+ "editor.tabSize": 2,
+ "editor.formatOnSave": true
+ },
+ "[svelte]": {
+ "editor.defaultFormatter": "svelte.svelte-vscode",
+ "editor.tabSize": 2
+ },
+ "svelte.enable-ts-plugin": true,
+ "eslint.validate": [
+ "javascript",
+ "svelte"
+ ],
+ "typescript.preferences.importModuleSpecifier": "non-relative",
+ "[dart]": {
+ "editor.formatOnSave": true,
+ "editor.selectionHighlight": false,
+ "editor.suggest.snippetsPreventQuickSuggestions": false,
+ "editor.suggestSelection": "first",
+ "editor.tabCompletion": "onlySnippets",
+ "editor.wordBasedSuggestions": "off",
+ "editor.defaultFormatter": "Dart-Code.dart-code"
+ },
+ "cSpell.words": [
+ "immich"
+ ],
+ "explorer.fileNesting.enabled": true,
+ "explorer.fileNesting.patterns": {
+ "*.ts": "${capture}.spec.ts,${capture}.mock.ts"
+ }
+}
\ No newline at end of file
diff --git a/README.md b/README.md
index 255013501..cc84d81c5 100644
--- a/README.md
+++ b/README.md
@@ -18,17 +18,17 @@
- Català
- Español
- Français
- Italiano
- 日本語
- 한국어
- Deutsch
- Nederlands
- Türkçe
- 中文
- Русский
+ Català
+ Español
+ Français
+ Italiano
+ 日本語
+ 한국어
+ Deutsch
+ Nederlands
+ Türkçe
+ 中文
+ Русский
## Disclaimer
@@ -131,6 +131,10 @@ If you feel like this is the right cause and the app is something you are seeing
## Star History
-
-
+
+
+
+
+
+
diff --git a/cli/Dockerfile b/cli/Dockerfile
index cb0383a00..6195d8d82 100644
--- a/cli/Dockerfile
+++ b/cli/Dockerfile
@@ -1,4 +1,4 @@
-FROM node:20-alpine3.19@sha256:c0a3badbd8a0a760de903e00cedbca94588e609299820557e72cba2a53dbaa2c as core
+FROM node:20-alpine3.19@sha256:ef3f47741e161900ddd07addcaca7e76534a9205e4cd73b2ed091ba339004a75 as core
WORKDIR /usr/src/open-api/typescript-sdk
COPY open-api/typescript-sdk/package*.json open-api/typescript-sdk/tsconfig*.json ./
diff --git a/cli/package-lock.json b/cli/package-lock.json
index 69be80132..6edc44424 100644
--- a/cli/package-lock.json
+++ b/cli/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@immich/cli",
- "version": "2.1.0",
+ "version": "2.2.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@immich/cli",
- "version": "2.1.0",
+ "version": "2.2.0",
"license": "GNU Affero General Public License version 3",
"dependencies": {
"lodash-es": "^4.17.21"
@@ -47,7 +47,7 @@
},
"../open-api/typescript-sdk": {
"name": "@immich/sdk",
- "version": "1.98.2",
+ "version": "1.100.0",
"dev": true,
"license": "GNU Affero General Public License version 3",
"dependencies": {
@@ -300,9 +300,9 @@
"dev": true
},
"node_modules/@esbuild/aix-ppc64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz",
- "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz",
+ "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==",
"cpu": [
"ppc64"
],
@@ -316,9 +316,9 @@
}
},
"node_modules/@esbuild/android-arm": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz",
- "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz",
+ "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==",
"cpu": [
"arm"
],
@@ -332,9 +332,9 @@
}
},
"node_modules/@esbuild/android-arm64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz",
- "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz",
+ "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==",
"cpu": [
"arm64"
],
@@ -348,9 +348,9 @@
}
},
"node_modules/@esbuild/android-x64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz",
- "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz",
+ "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==",
"cpu": [
"x64"
],
@@ -364,9 +364,9 @@
}
},
"node_modules/@esbuild/darwin-arm64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz",
- "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz",
+ "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==",
"cpu": [
"arm64"
],
@@ -380,9 +380,9 @@
}
},
"node_modules/@esbuild/darwin-x64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz",
- "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz",
+ "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==",
"cpu": [
"x64"
],
@@ -396,9 +396,9 @@
}
},
"node_modules/@esbuild/freebsd-arm64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz",
- "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz",
+ "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==",
"cpu": [
"arm64"
],
@@ -412,9 +412,9 @@
}
},
"node_modules/@esbuild/freebsd-x64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz",
- "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz",
+ "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==",
"cpu": [
"x64"
],
@@ -428,9 +428,9 @@
}
},
"node_modules/@esbuild/linux-arm": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz",
- "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz",
+ "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==",
"cpu": [
"arm"
],
@@ -444,9 +444,9 @@
}
},
"node_modules/@esbuild/linux-arm64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz",
- "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz",
+ "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==",
"cpu": [
"arm64"
],
@@ -460,9 +460,9 @@
}
},
"node_modules/@esbuild/linux-ia32": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz",
- "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz",
+ "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==",
"cpu": [
"ia32"
],
@@ -476,9 +476,9 @@
}
},
"node_modules/@esbuild/linux-loong64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz",
- "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz",
+ "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==",
"cpu": [
"loong64"
],
@@ -492,9 +492,9 @@
}
},
"node_modules/@esbuild/linux-mips64el": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz",
- "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz",
+ "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==",
"cpu": [
"mips64el"
],
@@ -508,9 +508,9 @@
}
},
"node_modules/@esbuild/linux-ppc64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz",
- "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz",
+ "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==",
"cpu": [
"ppc64"
],
@@ -524,9 +524,9 @@
}
},
"node_modules/@esbuild/linux-riscv64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz",
- "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz",
+ "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==",
"cpu": [
"riscv64"
],
@@ -540,9 +540,9 @@
}
},
"node_modules/@esbuild/linux-s390x": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz",
- "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz",
+ "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==",
"cpu": [
"s390x"
],
@@ -556,9 +556,9 @@
}
},
"node_modules/@esbuild/linux-x64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz",
- "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz",
+ "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==",
"cpu": [
"x64"
],
@@ -572,9 +572,9 @@
}
},
"node_modules/@esbuild/netbsd-x64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz",
- "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz",
+ "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==",
"cpu": [
"x64"
],
@@ -588,9 +588,9 @@
}
},
"node_modules/@esbuild/openbsd-x64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz",
- "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz",
+ "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==",
"cpu": [
"x64"
],
@@ -604,9 +604,9 @@
}
},
"node_modules/@esbuild/sunos-x64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz",
- "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz",
+ "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==",
"cpu": [
"x64"
],
@@ -620,9 +620,9 @@
}
},
"node_modules/@esbuild/win32-arm64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz",
- "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz",
+ "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==",
"cpu": [
"arm64"
],
@@ -636,9 +636,9 @@
}
},
"node_modules/@esbuild/win32-ia32": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz",
- "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz",
+ "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==",
"cpu": [
"ia32"
],
@@ -652,9 +652,9 @@
}
},
"node_modules/@esbuild/win32-x64": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz",
- "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz",
+ "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==",
"cpu": [
"x64"
],
@@ -1230,9 +1230,9 @@
}
},
"node_modules/@types/node": {
- "version": "20.11.27",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.27.tgz",
- "integrity": "sha512-qyUZfMnCg1KEz57r7pzFtSGt49f6RPkPBis3Vo4PbS7roQEDn22hiHzl/Lo1q4i4hDEgBJmBF/NTNg2XR0HbFg==",
+ "version": "20.11.30",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz",
+ "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==",
"dev": true,
"dependencies": {
"undici-types": "~5.26.4"
@@ -1251,16 +1251,16 @@
"dev": true
},
"node_modules/@typescript-eslint/eslint-plugin": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.2.0.tgz",
- "integrity": "sha512-mdekAHOqS9UjlmyF/LSs6AIEvfceV749GFxoBAjwAv0nkevfKHWQFDMcBZWUiIC5ft6ePWivXoS36aKQ0Cy3sw==",
+ "version": "7.4.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.4.0.tgz",
+ "integrity": "sha512-yHMQ/oFaM7HZdVrVm/M2WHaNPgyuJH4WelkSVEWSSsir34kxW2kDJCxlXRhhGWEsMN0WAW/vLpKfKVcm8k+MPw==",
"dev": true,
"dependencies": {
"@eslint-community/regexpp": "^4.5.1",
- "@typescript-eslint/scope-manager": "7.2.0",
- "@typescript-eslint/type-utils": "7.2.0",
- "@typescript-eslint/utils": "7.2.0",
- "@typescript-eslint/visitor-keys": "7.2.0",
+ "@typescript-eslint/scope-manager": "7.4.0",
+ "@typescript-eslint/type-utils": "7.4.0",
+ "@typescript-eslint/utils": "7.4.0",
+ "@typescript-eslint/visitor-keys": "7.4.0",
"debug": "^4.3.4",
"graphemer": "^1.4.0",
"ignore": "^5.2.4",
@@ -1269,7 +1269,7 @@
"ts-api-utils": "^1.0.1"
},
"engines": {
- "node": "^16.0.0 || >=18.0.0"
+ "node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@@ -1286,19 +1286,19 @@
}
},
"node_modules/@typescript-eslint/parser": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.2.0.tgz",
- "integrity": "sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==",
+ "version": "7.4.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.4.0.tgz",
+ "integrity": "sha512-ZvKHxHLusweEUVwrGRXXUVzFgnWhigo4JurEj0dGF1tbcGh6buL+ejDdjxOQxv6ytcY1uhun1p2sm8iWStlgLQ==",
"dev": true,
"dependencies": {
- "@typescript-eslint/scope-manager": "7.2.0",
- "@typescript-eslint/types": "7.2.0",
- "@typescript-eslint/typescript-estree": "7.2.0",
- "@typescript-eslint/visitor-keys": "7.2.0",
+ "@typescript-eslint/scope-manager": "7.4.0",
+ "@typescript-eslint/types": "7.4.0",
+ "@typescript-eslint/typescript-estree": "7.4.0",
+ "@typescript-eslint/visitor-keys": "7.4.0",
"debug": "^4.3.4"
},
"engines": {
- "node": "^16.0.0 || >=18.0.0"
+ "node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@@ -1314,16 +1314,16 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.2.0.tgz",
- "integrity": "sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==",
+ "version": "7.4.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.4.0.tgz",
+ "integrity": "sha512-68VqENG5HK27ypafqLVs8qO+RkNc7TezCduYrx8YJpXq2QGZ30vmNZGJJJC48+MVn4G2dCV8m5ZTVnzRexTVtw==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "7.2.0",
- "@typescript-eslint/visitor-keys": "7.2.0"
+ "@typescript-eslint/types": "7.4.0",
+ "@typescript-eslint/visitor-keys": "7.4.0"
},
"engines": {
- "node": "^16.0.0 || >=18.0.0"
+ "node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@@ -1331,18 +1331,18 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.2.0.tgz",
- "integrity": "sha512-xHi51adBHo9O9330J8GQYQwrKBqbIPJGZZVQTHHmy200hvkLZFWJIFtAG/7IYTWUyun6DE6w5InDReePJYJlJA==",
+ "version": "7.4.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.4.0.tgz",
+ "integrity": "sha512-247ETeHgr9WTRMqHbbQdzwzhuyaJ8dPTuyuUEMANqzMRB1rj/9qFIuIXK7l0FX9i9FXbHeBQl/4uz6mYuCE7Aw==",
"dev": true,
"dependencies": {
- "@typescript-eslint/typescript-estree": "7.2.0",
- "@typescript-eslint/utils": "7.2.0",
+ "@typescript-eslint/typescript-estree": "7.4.0",
+ "@typescript-eslint/utils": "7.4.0",
"debug": "^4.3.4",
"ts-api-utils": "^1.0.1"
},
"engines": {
- "node": "^16.0.0 || >=18.0.0"
+ "node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@@ -1358,12 +1358,12 @@
}
},
"node_modules/@typescript-eslint/types": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.2.0.tgz",
- "integrity": "sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==",
+ "version": "7.4.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.4.0.tgz",
+ "integrity": "sha512-mjQopsbffzJskos5B4HmbsadSJQWaRK0UxqQ7GuNA9Ga4bEKeiO6b2DnB6cM6bpc8lemaPseh0H9B/wyg+J7rw==",
"dev": true,
"engines": {
- "node": "^16.0.0 || >=18.0.0"
+ "node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@@ -1371,13 +1371,13 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.2.0.tgz",
- "integrity": "sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==",
+ "version": "7.4.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.4.0.tgz",
+ "integrity": "sha512-A99j5AYoME/UBQ1ucEbbMEmGkN7SE0BvZFreSnTd1luq7yulcHdyGamZKizU7canpGDWGJ+Q6ZA9SyQobipePg==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "7.2.0",
- "@typescript-eslint/visitor-keys": "7.2.0",
+ "@typescript-eslint/types": "7.4.0",
+ "@typescript-eslint/visitor-keys": "7.4.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@@ -1386,7 +1386,7 @@
"ts-api-utils": "^1.0.1"
},
"engines": {
- "node": "^16.0.0 || >=18.0.0"
+ "node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@@ -1399,21 +1399,21 @@
}
},
"node_modules/@typescript-eslint/utils": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.2.0.tgz",
- "integrity": "sha512-YfHpnMAGb1Eekpm3XRK8hcMwGLGsnT6L+7b2XyRv6ouDuJU1tZir1GS2i0+VXRatMwSI1/UfcyPe53ADkU+IuA==",
+ "version": "7.4.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.4.0.tgz",
+ "integrity": "sha512-NQt9QLM4Tt8qrlBVY9lkMYzfYtNz8/6qwZg8pI3cMGlPnj6mOpRxxAm7BMJN9K0AiY+1BwJ5lVC650YJqYOuNg==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0",
- "@typescript-eslint/scope-manager": "7.2.0",
- "@typescript-eslint/types": "7.2.0",
- "@typescript-eslint/typescript-estree": "7.2.0",
+ "@typescript-eslint/scope-manager": "7.4.0",
+ "@typescript-eslint/types": "7.4.0",
+ "@typescript-eslint/typescript-estree": "7.4.0",
"semver": "^7.5.4"
},
"engines": {
- "node": "^16.0.0 || >=18.0.0"
+ "node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@@ -1424,16 +1424,16 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.2.0.tgz",
- "integrity": "sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==",
+ "version": "7.4.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.4.0.tgz",
+ "integrity": "sha512-0zkC7YM0iX5Y41homUUeW1CHtZR01K3ybjM1l6QczoMuay0XKtrb93kv95AxUGwdjGr64nNqnOCwmEl616N8CA==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "7.2.0",
+ "@typescript-eslint/types": "7.4.0",
"eslint-visitor-keys": "^3.4.1"
},
"engines": {
- "node": "^16.0.0 || >=18.0.0"
+ "node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@@ -1447,9 +1447,9 @@
"dev": true
},
"node_modules/@vitest/coverage-v8": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.3.1.tgz",
- "integrity": "sha512-UuBnkSJUNE9rdHjDCPyJ4fYuMkoMtnghes1XohYa4At0MS3OQSAo97FrbwSLRshYsXThMZy1+ybD/byK5llyIg==",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.4.0.tgz",
+ "integrity": "sha512-4hDGyH1SvKpgZnIByr9LhGgCEuF9DKM34IBLCC/fVfy24Z3+PZ+Ii9hsVBsHvY1umM1aGPEjceRkzxCfcQ10wg==",
"dev": true,
"dependencies": {
"@ampproject/remapping": "^2.2.1",
@@ -1457,12 +1457,13 @@
"debug": "^4.3.4",
"istanbul-lib-coverage": "^3.2.2",
"istanbul-lib-report": "^3.0.1",
- "istanbul-lib-source-maps": "^4.0.1",
+ "istanbul-lib-source-maps": "^5.0.4",
"istanbul-reports": "^3.1.6",
"magic-string": "^0.30.5",
"magicast": "^0.3.3",
"picocolors": "^1.0.0",
"std-env": "^3.5.0",
+ "strip-literal": "^2.0.0",
"test-exclude": "^6.0.0",
"v8-to-istanbul": "^9.2.0"
},
@@ -1470,17 +1471,17 @@
"url": "https://opencollective.com/vitest"
},
"peerDependencies": {
- "vitest": "1.3.1"
+ "vitest": "1.4.0"
}
},
"node_modules/@vitest/expect": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.3.1.tgz",
- "integrity": "sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.4.0.tgz",
+ "integrity": "sha512-Jths0sWCJZ8BxjKe+p+eKsoqev1/T8lYcrjavEaz8auEJ4jAVY0GwW3JKmdVU4mmNPLPHixh4GNXP7GFtAiDHA==",
"dev": true,
"dependencies": {
- "@vitest/spy": "1.3.1",
- "@vitest/utils": "1.3.1",
+ "@vitest/spy": "1.4.0",
+ "@vitest/utils": "1.4.0",
"chai": "^4.3.10"
},
"funding": {
@@ -1488,12 +1489,12 @@
}
},
"node_modules/@vitest/runner": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.3.1.tgz",
- "integrity": "sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.4.0.tgz",
+ "integrity": "sha512-EDYVSmesqlQ4RD2VvWo3hQgTJ7ZrFQ2VSJdfiJiArkCerDAGeyF1i6dHkmySqk573jLp6d/cfqCN+7wUB5tLgg==",
"dev": true,
"dependencies": {
- "@vitest/utils": "1.3.1",
+ "@vitest/utils": "1.4.0",
"p-limit": "^5.0.0",
"pathe": "^1.1.1"
},
@@ -1529,9 +1530,9 @@
}
},
"node_modules/@vitest/snapshot": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.3.1.tgz",
- "integrity": "sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.4.0.tgz",
+ "integrity": "sha512-saAFnt5pPIA5qDGxOHxJ/XxhMFKkUSBJmVt5VgDsAqPTX6JP326r5C/c9UuCMPoXNzuudTPsYDZCoJ5ilpqG2A==",
"dev": true,
"dependencies": {
"magic-string": "^0.30.5",
@@ -1543,9 +1544,9 @@
}
},
"node_modules/@vitest/spy": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.1.tgz",
- "integrity": "sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.4.0.tgz",
+ "integrity": "sha512-Ywau/Qs1DzM/8Uc+yA77CwSegizMlcgTJuYGAi0jujOteJOUf1ujunHThYo243KG9nAyWT3L9ifPYZ5+As/+6Q==",
"dev": true,
"dependencies": {
"tinyspy": "^2.2.0"
@@ -1555,9 +1556,9 @@
}
},
"node_modules/@vitest/utils": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.3.1.tgz",
- "integrity": "sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.4.0.tgz",
+ "integrity": "sha512-mx3Yd1/6e2Vt/PUC98DcqTirtfxUyAZ32uK82r8rZzbtBeBo+nqgnjx/LvqQdWsrvNtm14VmurNgcf4nqY5gJg==",
"dev": true,
"dependencies": {
"diff-sequences": "^29.6.3",
@@ -2037,9 +2038,9 @@
}
},
"node_modules/esbuild": {
- "version": "0.19.12",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz",
- "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==",
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz",
+ "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==",
"dev": true,
"hasInstallScript": true,
"bin": {
@@ -2049,29 +2050,29 @@
"node": ">=12"
},
"optionalDependencies": {
- "@esbuild/aix-ppc64": "0.19.12",
- "@esbuild/android-arm": "0.19.12",
- "@esbuild/android-arm64": "0.19.12",
- "@esbuild/android-x64": "0.19.12",
- "@esbuild/darwin-arm64": "0.19.12",
- "@esbuild/darwin-x64": "0.19.12",
- "@esbuild/freebsd-arm64": "0.19.12",
- "@esbuild/freebsd-x64": "0.19.12",
- "@esbuild/linux-arm": "0.19.12",
- "@esbuild/linux-arm64": "0.19.12",
- "@esbuild/linux-ia32": "0.19.12",
- "@esbuild/linux-loong64": "0.19.12",
- "@esbuild/linux-mips64el": "0.19.12",
- "@esbuild/linux-ppc64": "0.19.12",
- "@esbuild/linux-riscv64": "0.19.12",
- "@esbuild/linux-s390x": "0.19.12",
- "@esbuild/linux-x64": "0.19.12",
- "@esbuild/netbsd-x64": "0.19.12",
- "@esbuild/openbsd-x64": "0.19.12",
- "@esbuild/sunos-x64": "0.19.12",
- "@esbuild/win32-arm64": "0.19.12",
- "@esbuild/win32-ia32": "0.19.12",
- "@esbuild/win32-x64": "0.19.12"
+ "@esbuild/aix-ppc64": "0.20.2",
+ "@esbuild/android-arm": "0.20.2",
+ "@esbuild/android-arm64": "0.20.2",
+ "@esbuild/android-x64": "0.20.2",
+ "@esbuild/darwin-arm64": "0.20.2",
+ "@esbuild/darwin-x64": "0.20.2",
+ "@esbuild/freebsd-arm64": "0.20.2",
+ "@esbuild/freebsd-x64": "0.20.2",
+ "@esbuild/linux-arm": "0.20.2",
+ "@esbuild/linux-arm64": "0.20.2",
+ "@esbuild/linux-ia32": "0.20.2",
+ "@esbuild/linux-loong64": "0.20.2",
+ "@esbuild/linux-mips64el": "0.20.2",
+ "@esbuild/linux-ppc64": "0.20.2",
+ "@esbuild/linux-riscv64": "0.20.2",
+ "@esbuild/linux-s390x": "0.20.2",
+ "@esbuild/linux-x64": "0.20.2",
+ "@esbuild/netbsd-x64": "0.20.2",
+ "@esbuild/openbsd-x64": "0.20.2",
+ "@esbuild/sunos-x64": "0.20.2",
+ "@esbuild/win32-arm64": "0.20.2",
+ "@esbuild/win32-ia32": "0.20.2",
+ "@esbuild/win32-x64": "0.20.2"
}
},
"node_modules/escalade": {
@@ -2858,14 +2859,14 @@
}
},
"node_modules/istanbul-lib-source-maps": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz",
- "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==",
+ "version": "5.0.4",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.4.tgz",
+ "integrity": "sha512-wHOoEsNJTVltaJp8eVkm8w+GVkVNHT2YDYo53YdzQEL2gWm1hBX5cGFR9hQJtuGLebidVX7et3+dmDZrmclduw==",
"dev": true,
"dependencies": {
+ "@jridgewell/trace-mapping": "^0.3.23",
"debug": "^4.1.1",
- "istanbul-lib-coverage": "^3.0.0",
- "source-map": "^0.6.1"
+ "istanbul-lib-coverage": "^3.0.0"
},
"engines": {
"node": ">=10"
@@ -3488,9 +3489,9 @@
}
},
"node_modules/postcss": {
- "version": "8.4.35",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz",
- "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==",
+ "version": "8.4.38",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz",
+ "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==",
"dev": true,
"funding": [
{
@@ -3509,7 +3510,7 @@
"dependencies": {
"nanoid": "^3.3.7",
"picocolors": "^1.0.0",
- "source-map-js": "^1.0.2"
+ "source-map-js": "^1.2.0"
},
"engines": {
"node": "^10 || ^12 || >=14"
@@ -3987,19 +3988,10 @@
"node": ">=8"
}
},
- "node_modules/source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/source-map-js": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
- "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
+ "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
"dev": true,
"engines": {
"node": ">=0.10.0"
@@ -4376,9 +4368,9 @@
}
},
"node_modules/typescript": {
- "version": "5.4.2",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz",
- "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==",
+ "version": "5.4.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz",
+ "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@@ -4464,14 +4456,14 @@
}
},
"node_modules/vite": {
- "version": "5.1.6",
- "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.6.tgz",
- "integrity": "sha512-yYIAZs9nVfRJ/AiOLCA91zzhjsHUgMjB+EigzFb6W2XTLO8JixBCKCjvhKZaye+NKYHCrkv3Oh50dH9EdLU2RA==",
+ "version": "5.2.6",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.6.tgz",
+ "integrity": "sha512-FPtnxFlSIKYjZ2eosBQamz4CbyrTizbZ3hnGJlh/wMtCrlp1Hah6AzBLjGI5I2urTfNnpovpHdrL6YRuBOPnCA==",
"dev": true,
"dependencies": {
- "esbuild": "^0.19.3",
- "postcss": "^8.4.35",
- "rollup": "^4.2.0"
+ "esbuild": "^0.20.1",
+ "postcss": "^8.4.36",
+ "rollup": "^4.13.0"
},
"bin": {
"vite": "bin/vite.js"
@@ -4519,9 +4511,9 @@
}
},
"node_modules/vite-node": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.3.1.tgz",
- "integrity": "sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.4.0.tgz",
+ "integrity": "sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==",
"dev": true,
"dependencies": {
"cac": "^6.7.14",
@@ -4560,16 +4552,16 @@
}
},
"node_modules/vitest": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.3.1.tgz",
- "integrity": "sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.4.0.tgz",
+ "integrity": "sha512-gujzn0g7fmwf83/WzrDTnncZt2UiXP41mHuFYFrdwaLRVQ6JYQEiME2IfEjU3vcFL3VKa75XhI3lFgn+hfVsQw==",
"dev": true,
"dependencies": {
- "@vitest/expect": "1.3.1",
- "@vitest/runner": "1.3.1",
- "@vitest/snapshot": "1.3.1",
- "@vitest/spy": "1.3.1",
- "@vitest/utils": "1.3.1",
+ "@vitest/expect": "1.4.0",
+ "@vitest/runner": "1.4.0",
+ "@vitest/snapshot": "1.4.0",
+ "@vitest/spy": "1.4.0",
+ "@vitest/utils": "1.4.0",
"acorn-walk": "^8.3.2",
"chai": "^4.3.10",
"debug": "^4.3.4",
@@ -4583,7 +4575,7 @@
"tinybench": "^2.5.1",
"tinypool": "^0.8.2",
"vite": "^5.0.0",
- "vite-node": "1.3.1",
+ "vite-node": "1.4.0",
"why-is-node-running": "^2.2.2"
},
"bin": {
@@ -4598,8 +4590,8 @@
"peerDependencies": {
"@edge-runtime/vm": "*",
"@types/node": "^18.0.0 || >=20.0.0",
- "@vitest/browser": "1.3.1",
- "@vitest/ui": "1.3.1",
+ "@vitest/browser": "1.4.0",
+ "@vitest/ui": "1.4.0",
"happy-dom": "*",
"jsdom": "*"
},
diff --git a/cli/package.json b/cli/package.json
index 45c60569e..d33de8918 100644
--- a/cli/package.json
+++ b/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@immich/cli",
- "version": "2.1.0",
+ "version": "2.2.0",
"description": "Command Line Interface (CLI) for Immich",
"type": "module",
"exports": "./dist/index.js",
diff --git a/cli/src/commands/asset.ts b/cli/src/commands/asset.ts
index b6c159c9b..aa45ce547 100644
--- a/cli/src/commands/asset.ts
+++ b/cli/src/commands/asset.ts
@@ -1,5 +1,7 @@
import {
+ Action,
AssetBulkUploadCheckResult,
+ AssetFileUploadResponseDto,
addAssetsToAlbum,
checkBulkUpload,
createAlbum,
@@ -8,445 +10,320 @@ import {
getSupportedMediaTypes,
} from '@immich/sdk';
import byteSize from 'byte-size';
-import cliProgress from 'cli-progress';
-import { chunk, zip } from 'lodash-es';
-import { createHash } from 'node:crypto';
-import fs, { createReadStream } from 'node:fs';
-import { access, constants, stat, unlink } from 'node:fs/promises';
+import { Presets, SingleBar } from 'cli-progress';
+import { chunk } from 'lodash-es';
+import { Stats, createReadStream } from 'node:fs';
+import { stat, unlink } from 'node:fs/promises';
import os from 'node:os';
-import { basename } from 'node:path';
-import { CrawlService } from 'src/services/crawl.service';
-import { BaseOptions, authenticate } from 'src/utils';
+import path, { basename } from 'node:path';
+import { BaseOptions, authenticate, crawl, sha1 } from 'src/utils';
-const zipDefined = zip as (a: T[], b: U[]) => [T, U][];
+const s = (count: number) => (count === 1 ? '' : 's');
-enum CheckResponseStatus {
- ACCEPT = 'accept',
- REJECT = 'reject',
- DUPLICATE = 'duplicate',
-}
+// TODO figure out why `id` is missing
+type AssetBulkUploadCheckResults = Array;
+type Asset = { id: string; filepath: string };
-class Asset {
- readonly path: string;
-
- id?: string;
- deviceAssetId?: string;
- fileCreatedAt?: Date;
- fileModifiedAt?: Date;
- sidecarPath?: string;
- fileSize?: number;
+interface UploadOptionsDto {
+ recursive?: boolean;
+ exclusionPatterns?: string[];
+ dryRun?: boolean;
+ skipHash?: boolean;
+ delete?: boolean;
+ album?: boolean;
albumName?: string;
+ includeHidden?: boolean;
+ concurrency: number;
+}
- constructor(path: string) {
- this.path = path;
+class UploadFile extends File {
+ constructor(
+ private filepath: string,
+ private _size: number,
+ ) {
+ super([], basename(filepath));
}
- async prepare() {
- const stats = await stat(this.path);
- this.deviceAssetId = `${basename(this.path)}-${stats.size}`.replaceAll(/\s+/g, '');
- this.fileCreatedAt = stats.mtime;
- this.fileModifiedAt = stats.mtime;
- this.fileSize = stats.size;
- this.albumName = this.extractAlbumName();
+ get size() {
+ return this._size;
}
- async getUploadFormData(): Promise {
- if (!this.deviceAssetId) {
- throw new Error('Device asset id not set');
- }
- if (!this.fileCreatedAt) {
- throw new Error('File created at not set');
- }
- if (!this.fileModifiedAt) {
- throw new Error('File modified at not set');
- }
-
- // TODO: doesn't xmp replace the file extension? Will need investigation
- const sideCarPath = `${this.path}.xmp`;
- let sidecarData: Blob | undefined = undefined;
- try {
- await access(sideCarPath, constants.R_OK);
- sidecarData = new File([await fs.openAsBlob(sideCarPath)], basename(sideCarPath));
- } catch {}
-
- const data: any = {
- assetData: new File([await fs.openAsBlob(this.path)], basename(this.path)),
- deviceAssetId: this.deviceAssetId,
- deviceId: 'CLI',
- fileCreatedAt: this.fileCreatedAt.toISOString(),
- fileModifiedAt: this.fileModifiedAt.toISOString(),
- isFavorite: String(false),
- };
- const formData = new FormData();
-
- for (const property in data) {
- formData.append(property, data[property]);
- }
-
- if (sidecarData) {
- formData.append('sidecarData', sidecarData);
- }
-
- return formData;
- }
-
- async delete(): Promise {
- return unlink(this.path);
- }
-
- public async hash(): Promise {
- const sha1 = (filePath: string) => {
- const hash = createHash('sha1');
- return new Promise((resolve, reject) => {
- const rs = createReadStream(filePath);
- rs.on('error', reject);
- rs.on('data', (chunk) => hash.update(chunk));
- rs.on('end', () => resolve(hash.digest('hex')));
- });
- };
-
- return await sha1(this.path);
- }
-
- private extractAlbumName(): string | undefined {
- return os.platform() === 'win32' ? this.path.split('\\').at(-2) : this.path.split('/').at(-2);
+ stream() {
+ return createReadStream(this.filepath) as any;
}
}
-class UploadOptionsDto {
- recursive? = false;
- exclusionPatterns?: string[] = [];
- dryRun? = false;
- skipHash? = false;
- delete? = false;
- album? = false;
- albumName? = '';
- includeHidden? = false;
- concurrency? = 4;
-}
+export const upload = async (paths: string[], baseOptions: BaseOptions, options: UploadOptionsDto) => {
+ await authenticate(baseOptions);
-export const upload = (paths: string[], baseOptions: BaseOptions, uploadOptions: UploadOptionsDto) =>
- new UploadCommand().run(paths, baseOptions, uploadOptions);
+ const files = await scan(paths, options);
+ if (files.length === 0) {
+ console.log('No files found, exiting');
+ return;
+ }
-// TODO refactor this
-class UploadCommand {
- public async run(paths: string[], baseOptions: BaseOptions, options: UploadOptionsDto): Promise {
- await authenticate(baseOptions);
+ const { newFiles, duplicates } = await checkForDuplicates(files, options);
- console.log('Crawling for assets...');
- const files = await this.getFiles(paths, options);
+ const newAssets = await uploadFiles(newFiles, options);
+ await updateAlbums([...newAssets, ...duplicates], options);
+ await deleteFiles(newFiles, options);
+};
- if (files.length === 0) {
- console.log('No assets found, exiting');
- return;
+const scan = async (pathsToCrawl: string[], options: UploadOptionsDto) => {
+ const { image, video } = await getSupportedMediaTypes();
+
+ console.log('Crawling for assets...');
+ const files = await crawl({
+ pathsToCrawl,
+ recursive: options.recursive,
+ exclusionPatterns: options.exclusionPatterns,
+ includeHidden: options.includeHidden,
+ extensions: [...image, ...video],
+ });
+
+ return files;
+};
+
+const checkForDuplicates = async (files: string[], { concurrency }: UploadOptionsDto) => {
+ const progressBar = new SingleBar(
+ { format: 'Checking files | {bar} | {percentage}% | ETA: {eta}s | {value}/{total} assets' },
+ Presets.shades_classic,
+ );
+
+ progressBar.start(files.length, 0);
+
+ const newFiles: string[] = [];
+ const duplicates: Asset[] = [];
+
+ try {
+ // TODO refactor into a queue
+ for (const items of chunk(files, concurrency)) {
+ const dto = await Promise.all(items.map(async (filepath) => ({ id: filepath, checksum: await sha1(filepath) })));
+ const { results } = await checkBulkUpload({ assetBulkUploadCheckDto: { assets: dto } });
+
+ for (const { id: filepath, assetId, action } of results as AssetBulkUploadCheckResults) {
+ if (action === Action.Accept) {
+ newFiles.push(filepath);
+ } else {
+ // rejects are always duplicates
+ duplicates.push({ id: assetId as string, filepath });
+ }
+ progressBar.increment();
+ }
}
+ } finally {
+ progressBar.stop();
+ }
- const assetsToCheck = files.map((path) => new Asset(path));
+ console.log(`Found ${newFiles.length} new files and ${duplicates.length} duplicate${s(duplicates.length)}`);
- const { newAssets, duplicateAssets } = await this.checkAssets(assetsToCheck, options.concurrency ?? 4);
+ return { newFiles, duplicates };
+};
- const totalSizeUploaded = await this.upload(newAssets, options);
- const messageStart = options.dryRun ? 'Would have' : 'Successfully';
- if (newAssets.length === 0) {
- console.log('All assets were already uploaded, nothing to do.');
- } else {
- console.log(
- `${messageStart} uploaded ${newAssets.length} asset${newAssets.length === 1 ? '' : 's'} (${byteSize(totalSizeUploaded)})`,
+const uploadFiles = async (files: string[], { dryRun, concurrency }: UploadOptionsDto): Promise => {
+ if (files.length === 0) {
+ console.log('All assets were already uploaded, nothing to do.');
+ return [];
+ }
+
+ // Compute total size first
+ let totalSize = 0;
+ const statsMap = new Map();
+ for (const filepath of files) {
+ const stats = await stat(filepath);
+ statsMap.set(filepath, stats);
+ totalSize += stats.size;
+ }
+
+ if (dryRun) {
+ console.log(`Would have uploaded ${files.length} asset${s(files.length)} (${byteSize(totalSize)})`);
+ return [];
+ }
+
+ const uploadProgress = new SingleBar(
+ { format: 'Uploading assets | {bar} | {percentage}% | ETA: {eta_formatted} | {value_formatted}/{total_formatted}' },
+ Presets.shades_classic,
+ );
+ uploadProgress.start(totalSize, 0);
+ uploadProgress.update({ value_formatted: 0, total_formatted: byteSize(totalSize) });
+
+ let totalSizeUploaded = 0;
+ const newAssets: Asset[] = [];
+ try {
+ for (const items of chunk(files, concurrency)) {
+ await Promise.all(
+ items.map(async (filepath) => {
+ const stats = statsMap.get(filepath) as Stats;
+ const response = await uploadFile(filepath, stats);
+ totalSizeUploaded += stats.size ?? 0;
+ uploadProgress.update(totalSizeUploaded, { value_formatted: byteSize(totalSizeUploaded) });
+ newAssets.push({ id: response.id, filepath });
+ return response;
+ }),
);
}
+ } finally {
+ uploadProgress.stop();
+ }
- if (options.album || options.albumName) {
- const { createdAlbumCount, updatedAssetCount } = await this.updateAlbums(
- [...newAssets, ...duplicateAssets],
- options,
+ console.log(`Successfully uploaded ${newAssets.length} asset${s(newAssets.length)} (${byteSize(totalSizeUploaded)})`);
+ return newAssets;
+};
+
+const uploadFile = async (input: string, stats: Stats): Promise => {
+ const { baseUrl, headers } = defaults;
+
+ const assetPath = path.parse(input);
+ const noExtension = path.join(assetPath.dir, assetPath.name);
+
+ const sidecarsFiles = await Promise.all(
+ // XMP sidecars can come in two filename formats. For a photo named photo.ext, the filenames are photo.ext.xmp and photo.xmp
+ [`${noExtension}.xmp`, `${input}.xmp`].map(async (sidecarPath) => {
+ try {
+ const stats = await stat(sidecarPath);
+ return new UploadFile(sidecarPath, stats.size);
+ } catch {
+ return false;
+ }
+ }),
+ );
+
+ const sidecarData = sidecarsFiles.find((file): file is UploadFile => file !== false);
+
+ const formData = new FormData();
+ formData.append('deviceAssetId', `${basename(input)}-${stats.size}`.replaceAll(/\s+/g, ''));
+ formData.append('deviceId', 'CLI');
+ formData.append('fileCreatedAt', stats.mtime.toISOString());
+ formData.append('fileModifiedAt', stats.mtime.toISOString());
+ formData.append('fileSize', String(stats.size));
+ formData.append('isFavorite', 'false');
+ formData.append('assetData', new UploadFile(input, stats.size));
+
+ if (sidecarData) {
+ formData.append('sidecarData', sidecarData);
+ }
+
+ const response = await fetch(`${baseUrl}/asset/upload`, {
+ method: 'post',
+ redirect: 'error',
+ headers: headers as Record,
+ body: formData,
+ });
+ if (response.status !== 200 && response.status !== 201) {
+ throw new Error(await response.text());
+ }
+
+ return response.json();
+};
+
+const deleteFiles = async (files: string[], options: UploadOptionsDto): Promise => {
+ if (!options.delete) {
+ return;
+ }
+
+ if (options.dryRun) {
+ console.log(`Would now have deleted assets, but skipped due to dry run`);
+ return;
+ }
+
+ console.log('Deleting assets that have been uploaded...');
+
+ const deletionProgress = new SingleBar(
+ { format: 'Deleting local assets | {bar} | {percentage}% | ETA: {eta}s | {value}/{total} assets' },
+ Presets.shades_classic,
+ );
+ deletionProgress.start(files.length, 0);
+
+ try {
+ for (const assetBatch of chunk(files, options.concurrency)) {
+ await Promise.all(assetBatch.map((input: string) => unlink(input)));
+ deletionProgress.update(assetBatch.length);
+ }
+ } finally {
+ deletionProgress.stop();
+ }
+};
+
+const updateAlbums = async (assets: Asset[], options: UploadOptionsDto) => {
+ if (!options.album && !options.albumName) {
+ return;
+ }
+ const { dryRun, concurrency } = options;
+
+ const albums = await getAllAlbums({});
+ const existingAlbums = new Map(albums.map((album) => [album.albumName, album.id]));
+ const newAlbums: Set = new Set();
+ for (const { filepath } of assets) {
+ const albumName = getAlbumName(filepath, options);
+ if (albumName && !existingAlbums.has(albumName)) {
+ newAlbums.add(albumName);
+ }
+ }
+
+ if (dryRun) {
+ // TODO print asset counts for new albums
+ console.log(`Would have created ${newAlbums.size} new album${s(newAlbums.size)}`);
+ console.log(`Would have updated ${assets.length} asset${s(assets.length)}`);
+ return;
+ }
+
+ const progressBar = new SingleBar(
+ { format: 'Creating albums | {bar} | {percentage}% | ETA: {eta}s | {value}/{total} albums' },
+ Presets.shades_classic,
+ );
+ progressBar.start(newAlbums.size, 0);
+
+ try {
+ for (const albumNames of chunk([...newAlbums], concurrency)) {
+ const items = await Promise.all(
+ albumNames.map((albumName: string) => createAlbum({ createAlbumDto: { albumName } })),
);
- console.log(`${messageStart} created ${createdAlbumCount} new album${createdAlbumCount === 1 ? '' : 's'}`);
- console.log(`${messageStart} updated ${updatedAssetCount} asset${updatedAssetCount === 1 ? '' : 's'}`);
- }
-
- if (!options.delete) {
- return;
- }
-
- if (options.dryRun) {
- console.log(`Would now have deleted assets, but skipped due to dry run`);
- return;
- }
-
- console.log('Deleting assets that have been uploaded...');
-
- await this.deleteAssets(newAssets, options);
- }
-
- public async checkAssets(
- assetsToCheck: Asset[],
- concurrency: number,
- ): Promise<{ newAssets: Asset[]; duplicateAssets: Asset[]; rejectedAssets: Asset[] }> {
- for (const assets of chunk(assetsToCheck, concurrency)) {
- await Promise.all(assets.map((asset: Asset) => asset.prepare()));
- }
-
- const checkProgress = new cliProgress.SingleBar(
- { format: 'Checking assets | {bar} | {percentage}% | ETA: {eta}s | {value}/{total} assets' },
- cliProgress.Presets.shades_classic,
- );
- checkProgress.start(assetsToCheck.length, 0);
-
- const newAssets = [];
- const duplicateAssets = [];
- const rejectedAssets = [];
- try {
- for (const assets of chunk(assetsToCheck, concurrency)) {
- const checkedAssets = await this.getStatus(assets);
- for (const checked of checkedAssets) {
- if (checked.status === CheckResponseStatus.ACCEPT) {
- newAssets.push(checked.asset);
- } else if (checked.status === CheckResponseStatus.DUPLICATE) {
- duplicateAssets.push(checked.asset);
- } else {
- rejectedAssets.push(checked.asset);
- }
- checkProgress.increment();
- }
+ for (const { id, albumName } of items) {
+ existingAlbums.set(albumName, id);
}
- } finally {
- checkProgress.stop();
+ progressBar.increment(albumNames.length);
}
-
- return { newAssets, duplicateAssets, rejectedAssets };
+ } finally {
+ progressBar.stop();
}
- public async upload(assetsToUpload: Asset[], options: UploadOptionsDto): Promise {
- let totalSize = 0;
+ console.log(`Successfully created ${newAlbums.size} new album${s(newAlbums.size)}`);
+ console.log(`Successfully updated ${assets.length} asset${s(assets.length)}`);
- // Compute total size first
- for (const asset of assetsToUpload) {
- totalSize += asset.fileSize ?? 0;
+ const albumToAssets = new Map();
+ for (const asset of assets) {
+ const albumName = getAlbumName(asset.filepath, options);
+ if (!albumName) {
+ continue;
}
-
- if (options.dryRun) {
- return totalSize;
- }
-
- const uploadProgress = new cliProgress.SingleBar(
- {
- format: 'Uploading assets | {bar} | {percentage}% | ETA: {eta_formatted} | {value_formatted}/{total_formatted}',
- },
- cliProgress.Presets.shades_classic,
- );
- uploadProgress.start(totalSize, 0);
- uploadProgress.update({ value_formatted: 0, total_formatted: byteSize(totalSize) });
-
- let totalSizeUploaded = 0;
- try {
- for (const assets of chunk(assetsToUpload, options.concurrency)) {
- const ids = await this.uploadAssets(assets);
- for (const [asset, id] of zipDefined(assets, ids)) {
- asset.id = id;
- if (asset.fileSize) {
- totalSizeUploaded += asset.fileSize ?? 0;
- } else {
- console.log(`Could not determine file size for ${asset.path}`);
- }
- }
- uploadProgress.update(totalSizeUploaded, { value_formatted: byteSize(totalSizeUploaded) });
+ const albumId = existingAlbums.get(albumName);
+ if (albumId) {
+ if (!albumToAssets.has(albumId)) {
+ albumToAssets.set(albumId, []);
}
- } finally {
- uploadProgress.stop();
+ albumToAssets.get(albumId)?.push(asset.id);
}
-
- return totalSizeUploaded;
}
- public async getFiles(paths: string[], options: UploadOptionsDto): Promise {
- const inputFiles: string[] = [];
- for (const pathArgument of paths) {
- const fileStat = await fs.promises.lstat(pathArgument);
- if (fileStat.isFile()) {
- inputFiles.push(pathArgument);
+ const albumUpdateProgress = new SingleBar(
+ { format: 'Adding assets to albums | {bar} | {percentage}% | ETA: {eta}s | {value}/{total} assets' },
+ Presets.shades_classic,
+ );
+ albumUpdateProgress.start(assets.length, 0);
+
+ try {
+ for (const [albumId, assets] of albumToAssets.entries()) {
+ for (const assetBatch of chunk(assets, Math.min(1000 * concurrency, 65_000))) {
+ await addAssetsToAlbum({ id: albumId, bulkIdsDto: { ids: assetBatch } });
+ albumUpdateProgress.increment(assetBatch.length);
}
}
-
- const files: string[] = await this.crawl(paths, options);
- files.push(...inputFiles);
- return files;
+ } finally {
+ albumUpdateProgress.stop();
}
+};
- public async getAlbums(): Promise