diff --git a/AGENTS.md b/AGENTS.md index 5c69fea..d0699f3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,7 +21,7 @@ This is a **Go CLI tool** for managing an Immich photo server. It enables bulk o - Respect required vs. optional parameters as defined in the spec. - Use the `x-immich-history` field to prefer stable (`"state": "Stable"`) endpoints over beta ones. - **Never use deprecated endpoints.** An endpoint is deprecated if it has `"deprecated": true` at the operation level OR if `"Deprecated"` appears in its `tags` array. Use the `replacementId` in `x-immich-history` to find the replacement. - - **One documented exception**: `updateAsset` (`PUT /assets/{id}`) is deprecated upstream with a self-referential `replacementId` (i.e. no real replacement exists) — it is the only Immich API that can set an asset's capture date. It is used deliberately and narrowly by `assets update` and `client-workflow fix-album-dates`. Do not use the bulk `updateAssets` variant or extend this exception to any other deprecated endpoint without the same "no alternative exists" verification. + - `updateAsset` / `updateAssets` (`PUT /assets/{id}`, `PUT /assets`) were deprecated in v3.3 but are **not deprecated since v3.4** (history: "Updated", PATCH added; PUT dropped in v5). They are regular endpoints again; `updateAsset` sets capture dates and time zones (`assets update`, `fix-album-dates`, `date-from-ocr`, `tz-set`). - Authentication: the spec defines three security schemes — `bearer` (Authorization header), `cookie`, and `api_key` (x-api-key header). Prefer `api_key` for CLI usage. - **When the OpenAPI spec's description, enum, or parameter documentation is unclear, ambiguous, or seemingly incomplete**, cross-check the upstream Immich server source directly (DTOs under `immich-app/immich`'s `server/src/dtos/` on GitHub, e.g. `asset-media.dto.ts` for `AssetMediaSize`) to confirm the actual accepted values, defaults, and behavior before implementing. The spec is generated from these DTOs, so they are the ultimate source of truth when the generated description is terse or missing context (e.g. `x-immich-history` deprecation notes on individual enum values, not just whole operations). - **When a spec parameter or field is a closed set of possible values (a `schema.enum`, e.g. `AssetMediaSize`, `AssetTypeEnum`, `JobName`), never pass a raw/unchecked user-supplied string straight into the generated type.** Implement an explicit guard (e.g. a small `resolveX`/`validateX` helper, or the generated type's own `Valid()` method where its accepted set matches exactly what this operation allows) that rejects any value outside that closed set, with an error message listing the valid options. Then reflect those exact options in the command's CLI help/`Usage` text (and in `README.md`) — the set the CLI advertises and the set it actually accepts must always match. Do not rely on the upstream API to reject invalid values at request time; some invalid values are only individually deprecated for one specific operation (not invalid across the whole enum — see `AssetMediaSize`'s `original`, valid on `download-original`-style endpoints but deprecated specifically on `GET /assets/{id}/thumbnail`), so a single generated `Valid()` check is not always sufficient — validate against the subset that specific operation actually supports. diff --git a/README.md b/README.md index 8d66a66..5604e72 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ | Albums and sharing | Create, rename, delete, and manage album assets; add users to matching albums in bulk; merge albums; download or mirror an album locally | `albums --help`, `cw add-users-to-album-with-pattern`, `cw merge-album`, `cw download-album` | | Find and organize | Search by filename, type, camera, location, date, status, OCR, or description; emit pipeable asset IDs; manage tags and tag assignments | `search metadata --help`, `tags --help` | | Repair and replace | Replace an asset while preserving its Immich metadata; locate missing thumbnails; repair malformed JPEG/TIFF files; remove Google Takeout JSON sidecars | `cw replace-asset`, `cw find-no-thumbhash`, `cw repair-assets` | -| Date and duplicate assistance | Check and correct assets that do not fit date-named albums; set capture years from years printed in scanned photos (OCR); find visually similar library assets for a local image | `cw fix-album-dates`, `cw date-from-ocr`, `cw find-similar` | +| Date and duplicate assistance | Check and correct assets that do not fit date-named albums; set capture years from years printed in scanned photos (OCR); find visually similar library assets for a local image; audit time zones and give assets without one an IANA zone's offset | `cw fix-album-dates`, `cw date-from-ocr`, `cw find-similar`, `cw tz-audit`, `cw tz-set` | | Watch folders | Watch local folders and upload new files, or download matching assets as they appear | `cw watch-upload`, `cw watch-download` | | Server workflows and users | List, inspect, and read logs for Immich server-side workflows; look up users and the authenticated account | `immich-workflow --help`, `users --help` | | Automation | Preview changes with `--dry-run`, bypass prompts with `--yes`, pass IDs through files or stdin, use JSON/IDs-only output, and retrieve agent instructions from the binary | `immich-admin return-agent-skill` | @@ -64,10 +64,10 @@ Release binaries are named `immich-admin__[.exe]` without a version nu -**29 of 253 endpoints implemented** (24 deprecated and 2 internal endpoints omitted per project policy). +**30 of 275 endpoints implemented** (10 deprecated and 2 internal endpoints omitted per project policy).
-API keys (0/6) +API keys (0/7) | Impl | Method | Path | Operation | State | |:----:|--------|------|-----------|-------| @@ -76,6 +76,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu | | GET | `/api-keys/me` | `getMyApiKey` | Stable | | | DELETE | `/api-keys/{id}` | `deleteApiKey` | Stable | | | GET | `/api-keys/{id}` | `getApiKey` | Stable | +| | PUT | `/api-keys/{id}` | `updateApiKey` | Stable | | | POST | `/api-keys/{id}/rotate` | `rotateApiKey` | – |
@@ -126,12 +127,13 @@ Release binaries are named `immich-admin__[.exe]` without a version nu
-Assets (8/24) +Assets (9/26) | Impl | Method | Path | Operation | State | |:----:|--------|------|-----------|-------| | ✅ | DELETE | `/assets` | `deleteAssets` | Stable | | ✅ | POST | `/assets` | `uploadAsset` | Stable | +| | PUT | `/assets` | `updateAssets` | Stable | | ✅ | POST | `/assets/bulk-upload-check` | `checkBulkUpload` | Stable | | ✅ | PUT | `/assets/copy` | `copyAsset` | Stable | | | POST | `/assets/jobs` | `runAssetJobs` | Stable | @@ -139,6 +141,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu | | PUT | `/assets/metadata` | `updateBulkAssetMetadata` | Beta | | | GET | `/assets/statistics` | `getAssetStatistics` | Stable | | ✅ | GET | `/assets/{id}` | `getAssetInfo` | Stable | +| ✅ | PUT | `/assets/{id}` | `updateAsset` | Stable | | | DELETE | `/assets/{id}/edits` | `removeAssetEdits` | Beta | | | GET | `/assets/{id}/edits` | `getAssetEdits` | Beta | | | PUT | `/assets/{id}/edits` | `editAsset` | Beta | @@ -295,7 +298,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu
-Libraries (0/7) +Libraries (0/8) | Impl | Method | Path | Operation | State | |:----:|--------|------|-----------|-------| @@ -303,6 +306,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu | | POST | `/libraries` | `createLibrary` | Stable | | | DELETE | `/libraries/{id}` | `deleteLibrary` | Stable | | | GET | `/libraries/{id}` | `getLibrary` | Stable | +| | PUT | `/libraries/{id}` | `updateLibrary` | Stable | | | POST | `/libraries/{id}/scan` | `scanLibrary` | Stable | | | GET | `/libraries/{id}/statistics` | `getLibraryStatistics` | Stable | | | POST | `/libraries/{id}/validate` | `validate` | Stable | @@ -337,7 +341,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu
-Memories (0/7) +Memories (0/8) | Impl | Method | Path | Operation | State | |:----:|--------|------|-----------|-------| @@ -346,6 +350,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu | | GET | `/memories/statistics` | `memoriesStatistics` | Stable | | | DELETE | `/memories/{id}` | `deleteMemory` | Stable | | | GET | `/memories/{id}` | `getMemory` | Stable | +| | PUT | `/memories/{id}` | `updateMemory` | Stable | | | DELETE | `/memories/{id}/assets` | `removeMemoryAssets` | Stable | | | PUT | `/memories/{id}/assets` | `addMemoryAssets` | Stable | @@ -389,7 +394,23 @@ Release binaries are named `immich-admin__[.exe]` without a version nu
-People (0/13) +Passkeys (0/8) + +| Impl | Method | Path | Operation | State | +|:----:|--------|------|-----------|-------| +| | GET | `/passkeys` | `searchPasskeys` | Alpha | +| | POST | `/passkeys/authentication/finish` | `finishAuthentication` | Alpha | +| | POST | `/passkeys/authentication/start` | `startAuthentication` | Alpha | +| | POST | `/passkeys/registration/finish` | `finishRegistration` | Alpha | +| | POST | `/passkeys/registration/start` | `startRegistration` | Alpha | +| | DELETE | `/passkeys/{id}` | `deletePasskey` | Alpha | +| | GET | `/passkeys/{id}` | `getPasskey` | Alpha | +| | PATCH | `/passkeys/{id}` | `updatePasskey` | Alpha | + +
+ +
+People (0/14) | Impl | Method | Path | Operation | State | |:----:|--------|------|-----------|-------| @@ -403,6 +424,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu | | PUT | `/people/users` | `upsertPeopleUsers` | Beta | | | DELETE | `/people/{id}` | `deletePerson` | Stable | | | GET | `/people/{id}` | `getPerson` | Stable | +| | PUT | `/people/{id}` | `updatePerson` | Stable | | | PUT | `/people/{id}/reassign` | `reassignFaces` | Stable | | | GET | `/people/{id}/statistics` | `getPersonStatistics` | Stable | | | GET | `/people/{id}/thumbnail` | `getPersonThumbnail` | Stable | @@ -472,7 +494,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu
-Sessions (0/5) +Sessions (0/6) | Impl | Method | Path | Operation | State | |:----:|--------|------|-----------|-------| @@ -480,6 +502,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu | | GET | `/sessions` | `getSessions` | Stable | | | POST | `/sessions` | `createSession` | Stable | | | DELETE | `/sessions/{id}` | `deleteSession` | Stable | +| | PUT | `/sessions/{id}` | `updateSession` | Stable | | | POST | `/sessions/{id}/lock` | `lockSession` | Stable |
@@ -502,7 +525,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu
-Stacks (0/6) +Stacks (0/7) | Impl | Method | Path | Operation | State | |:----:|--------|------|-----------|-------| @@ -511,6 +534,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu | | POST | `/stacks` | `createStack` | Stable | | | DELETE | `/stacks/{id}` | `deleteStack` | Stable | | | GET | `/stacks/{id}` | `getStack` | Stable | +| | PUT | `/stacks/{id}` | `updateStack` | Stable | | | DELETE | `/stacks/{id}/assets/{assetId}` | `removeAssetFromStack` | Stable |
@@ -549,7 +573,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu
-Tags (6/8) +Tags (6/9) | Impl | Method | Path | Operation | State | |:----:|--------|------|-----------|-------| @@ -559,6 +583,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu | ✅ | PUT | `/tags/assets` | `bulkTagAssets` | Stable | | ✅ | DELETE | `/tags/{id}` | `deleteTag` | Stable | | ✅ | GET | `/tags/{id}` | `getTagById` | Stable | +| | PUT | `/tags/{id}` | `updateTag` | Stable | | | DELETE | `/tags/{id}/assets` | `untagAssets` | Stable | | ✅ | PUT | `/tags/{id}/assets` | `tagAssets` | Stable | @@ -576,12 +601,13 @@ Release binaries are named `immich-admin__[.exe]` without a version nu
-Users (3/14) +Users (3/16) | Impl | Method | Path | Operation | State | |:----:|--------|------|-----------|-------| | ✅ | GET | `/users` | `searchUsers` | Stable | | ✅ | GET | `/users/me` | `getMyUser` | Stable | +| | PUT | `/users/me` | `updateMyUser` | Stable | | | GET | `/users/me/calendar-heatmap` | `getMyCalendarHeatmap` | Stable | | | DELETE | `/users/me/license` | `deleteUserLicense` | Stable | | | GET | `/users/me/license` | `getUserLicense` | Stable | @@ -590,6 +616,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu | | GET | `/users/me/onboarding` | `getUserOnboarding` | Stable | | | PUT | `/users/me/onboarding` | `setUserOnboarding` | Stable | | | GET | `/users/me/preferences` | `getMyPreferences` | Stable | +| | PUT | `/users/me/preferences` | `updateMyPreferences` | Stable | | | DELETE | `/users/profile-image` | `deleteProfileImage` | Stable | | | POST | `/users/profile-image` | `createProfileImage` | Stable | | ✅ | GET | `/users/{id}` | `getUser` | Stable | @@ -598,7 +625,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu
-Users (admin) (0/9) +Users (admin) (0/11) | Impl | Method | Path | Operation | State | |:----:|--------|------|-----------|-------| @@ -606,8 +633,10 @@ Release binaries are named `immich-admin__[.exe]` without a version nu | | POST | `/admin/users` | `createUserAdmin` | Stable | | | DELETE | `/admin/users/{id}` | `deleteUserAdmin` | Stable | | | GET | `/admin/users/{id}` | `getUserAdmin` | Stable | +| | PUT | `/admin/users/{id}` | `updateUserAdmin` | Stable | | | GET | `/admin/users/{id}/calendar-heatmap` | `getUserCalendarHeatmapAdmin` | Stable | | | GET | `/admin/users/{id}/preferences` | `getUserPreferencesAdmin` | Stable | +| | PUT | `/admin/users/{id}/preferences` | `updateUserPreferencesAdmin` | Stable | | | POST | `/admin/users/{id}/restore` | `restoreUserAdmin` | Stable | | | GET | `/admin/users/{id}/sessions` | `getUserSessionsAdmin` | Stable | | | GET | `/admin/users/{id}/statistics` | `getUserStatisticsAdmin` | Stable | @@ -625,7 +654,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu
-Workflows (3/7) +Workflows (3/8) | Impl | Method | Path | Operation | State | |:----:|--------|------|-----------|-------| @@ -634,6 +663,7 @@ Release binaries are named `immich-admin__[.exe]` without a version nu | | GET | `/workflows/triggers` | `getWorkflowTriggers` | – | | | DELETE | `/workflows/{id}` | `deleteWorkflow` | – | | ✅ | GET | `/workflows/{id}` | `getWorkflow` | – | +| | PUT | `/workflows/{id}` | `updateWorkflow` | – | | ✅ | GET | `/workflows/{id}/logs` | `getWorkflowLogs` | – | | | GET | `/workflows/{id}/share` | `getWorkflowForShare` | – | diff --git a/api/download.ps1 b/api/download.ps1 index b29960d..4f89911 100644 --- a/api/download.ps1 +++ b/api/download.ps1 @@ -1,4 +1,4 @@ -$version = "v3.3.5" +$version = "v3.4.2" $url = "https://raw.githubusercontent.com/immich-app/immich/refs/tags/$version/open-api/immich-openapi-specs.json" $outFile = Join-Path -Path $PSScriptRoot -ChildPath "immich-openapi-specs.json" Invoke-WebRequest -Uri $url -OutFile $outFile diff --git a/api/immich-openapi-specs.json b/api/immich-openapi-specs.json index 52e3820..46b8915 100644 --- a/api/immich-openapi-specs.json +++ b/api/immich-openapi-specs.json @@ -1237,6 +1237,7 @@ "state": "Stable" } ], + "x-immich-permission": "notification.create", "x-immich-state": "Stable" } }, @@ -1306,6 +1307,7 @@ "state": "Stable" } ], + "x-immich-permission": "notification.create", "x-immich-state": "Stable" } }, @@ -1366,6 +1368,7 @@ "state": "Stable" } ], + "x-immich-permission": "notification.create", "x-immich-state": "Stable" } }, @@ -1635,7 +1638,6 @@ "x-immich-state": "Stable" }, "put": { - "deprecated": true, "description": "Update an existing user.", "operationId": "updateUserAdmin", "parameters": [ @@ -1685,8 +1687,7 @@ ], "summary": "Update a user", "tags": [ - "Users (admin)", - "Deprecated" + "Users (admin)" ], "x-immich-admin-only": true, "x-immich-history": [ @@ -1703,13 +1704,13 @@ "state": "Stable" }, { - "version": "v3", - "state": "Deprecated", - "replacementId": "updateUserAdmin" + "version": "v3.0.0", + "state": "Updated", + "description": "This endpoint now also supports PATCH, in addition to PUT. PATCH will become the default in v4, and then PUT will be dropped in v5. Please migrate accordingly." } ], "x-immich-permission": "adminUser.update", - "x-immich-state": "Deprecated" + "x-immich-state": "Stable" } }, "/admin/users/{id}/calendar-heatmap": { @@ -1865,7 +1866,6 @@ "x-immich-state": "Stable" }, "put": { - "deprecated": true, "description": "Update the preferences of a specific user.", "operationId": "updateUserPreferencesAdmin", "parameters": [ @@ -1915,8 +1915,7 @@ ], "summary": "Update user preferences", "tags": [ - "Users (admin)", - "Deprecated" + "Users (admin)" ], "x-immich-admin-only": true, "x-immich-history": [ @@ -1933,13 +1932,13 @@ "state": "Stable" }, { - "version": "v3", - "state": "Deprecated", - "replacementId": "updateUserPreferencesAdmin" + "version": "v3.0.0", + "state": "Updated", + "description": "This endpoint now also supports PATCH, in addition to PUT. PATCH will become the default in v4, and then PUT will be dropped in v5. Please migrate accordingly." } ], "x-immich-permission": "adminUser.update", - "x-immich-state": "Deprecated" + "x-immich-state": "Stable" } }, "/admin/users/{id}/restore": { @@ -3337,7 +3336,6 @@ "x-immich-state": "Stable" }, "put": { - "deprecated": true, "description": "Updates the name and permissions of an API key by its ID. The current user must own this API key.", "operationId": "updateApiKey", "parameters": [ @@ -3387,8 +3385,7 @@ ], "summary": "Update an API key", "tags": [ - "API keys", - "Deprecated" + "API keys" ], "x-immich-history": [ { @@ -3404,13 +3401,13 @@ "state": "Stable" }, { - "version": "v3", - "state": "Deprecated", - "replacementId": "updateApiKey" + "version": "v3.0.0", + "state": "Updated", + "description": "This endpoint now also supports PATCH, in addition to PUT. PATCH will become the default in v4, and then PUT will be dropped in v5. Please migrate accordingly." } ], "x-immich-permission": "apiKey.update", - "x-immich-state": "Deprecated" + "x-immich-state": "Stable" } }, "/api-keys/{id}/rotate": { @@ -3873,7 +3870,6 @@ "x-immich-state": "Stable" }, "put": { - "deprecated": true, "description": "Updates multiple assets at the same time.", "operationId": "updateAssets", "parameters": [], @@ -3905,8 +3901,7 @@ ], "summary": "Update assets", "tags": [ - "Assets", - "Deprecated" + "Assets" ], "x-immich-history": [ { @@ -3922,13 +3917,13 @@ "state": "Stable" }, { - "version": "v3", - "state": "Deprecated", - "replacementId": "updateAssets" + "version": "v3.0.0", + "state": "Updated", + "description": "This endpoint now also supports PATCH, in addition to PUT. PATCH will become the default in v4, and then PUT will be dropped in v5. Please migrate accordingly." } ], "x-immich-permission": "asset.update", - "x-immich-state": "Deprecated" + "x-immich-state": "Stable" } }, "/assets/bulk-upload-check": { @@ -4357,7 +4352,6 @@ "x-immich-state": "Stable" }, "put": { - "deprecated": true, "description": "Update information of a specific asset.", "operationId": "updateAsset", "parameters": [ @@ -4407,8 +4401,7 @@ ], "summary": "Update an asset", "tags": [ - "Assets", - "Deprecated" + "Assets" ], "x-immich-history": [ { @@ -4424,13 +4417,13 @@ "state": "Stable" }, { - "version": "v3", - "state": "Deprecated", - "replacementId": "updateAsset" + "version": "v3.0.0", + "state": "Updated", + "description": "This endpoint now also supports PATCH, in addition to PUT. PATCH will become the default in v4, and then PUT will be dropped in v5. Please migrate accordingly." } ], "x-immich-permission": "asset.update", - "x-immich-state": "Deprecated" + "x-immich-state": "Stable" } }, "/assets/{id}/edits": { @@ -6340,7 +6333,7 @@ "state": "Added" } ], - "x-immich-permission": "clusterGroup.read" + "x-immich-permission": "clusterGroup.admin" } }, "/cluster-groups/{id}/requests": { @@ -7639,7 +7632,6 @@ "x-immich-state": "Stable" }, "put": { - "deprecated": true, "description": "Update an existing external library.", "operationId": "updateLibrary", "parameters": [ @@ -7689,8 +7681,7 @@ ], "summary": "Update a library", "tags": [ - "Libraries", - "Deprecated" + "Libraries" ], "x-immich-admin-only": true, "x-immich-history": [ @@ -7707,13 +7698,13 @@ "state": "Stable" }, { - "version": "v3", - "state": "Deprecated", - "replacementId": "updateLibrary" + "version": "v3.0.0", + "state": "Updated", + "description": "This endpoint now also supports PATCH, in addition to PUT. PATCH will become the default in v4, and then PUT will be dropped in v5. Please migrate accordingly." } ], "x-immich-permission": "library.update", - "x-immich-state": "Deprecated" + "x-immich-state": "Stable" } }, "/libraries/{id}/scan": { @@ -8544,7 +8535,6 @@ "x-immich-state": "Stable" }, "put": { - "deprecated": true, "description": "Update an existing memory by its ID.", "operationId": "updateMemory", "parameters": [ @@ -8594,8 +8584,7 @@ ], "summary": "Update a memory", "tags": [ - "Memories", - "Deprecated" + "Memories" ], "x-immich-history": [ { @@ -8611,13 +8600,13 @@ "state": "Stable" }, { - "version": "v3", - "state": "Deprecated", - "replacementId": "updateMemory" + "version": "v3.0.0", + "state": "Updated", + "description": "This endpoint now also supports PATCH, in addition to PUT. PATCH will become the default in v4, and then PUT will be dropped in v5. Please migrate accordingly." } ], "x-immich-permission": "memory.update", - "x-immich-state": "Deprecated" + "x-immich-state": "Stable" } }, "/memories/{id}/assets": { @@ -9708,6 +9697,415 @@ "x-immich-state": "Stable" } }, + "/passkeys": { + "get": { + "description": "Search the passkeys of the current user.", + "operationId": "searchPasskeys", + "parameters": [ + { + "name": "id", + "required": false, + "in": "query", + "description": "Filter by passkey ID", + "schema": { + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/PasskeyResponseDto" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "bearer": [] + }, + { + "cookie": [] + }, + { + "api_key": [] + } + ], + "summary": "Search passkeys", + "tags": [ + "Passkeys" + ], + "x-immich-history": [ + { + "version": "v4.0.0", + "state": "Added" + }, + { + "version": "v4.0.0", + "state": "Alpha" + } + ], + "x-immich-permission": "passkey.read", + "x-immich-state": "Alpha" + } + }, + "/passkeys/authentication/finish": { + "post": { + "description": "Verify the response from the authenticator and receive a session token.", + "operationId": "finishAuthentication", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PasskeyAuthenticationFinishDto" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginResponseDto" + } + } + }, + "description": "" + } + }, + "summary": "Finish passkey authentication", + "tags": [ + "Passkeys" + ], + "x-immich-history": [ + { + "version": "v4.0.0", + "state": "Added" + }, + { + "version": "v4.0.0", + "state": "Alpha" + } + ], + "x-immich-state": "Alpha" + } + }, + "/passkeys/authentication/start": { + "post": { + "description": "Generate the options used by the browser to sign in with a passkey.", + "operationId": "startAuthentication", + "parameters": [], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PasskeyAuthenticationOptionsDto" + } + } + }, + "description": "" + } + }, + "summary": "Start passkey authentication", + "tags": [ + "Passkeys" + ], + "x-immich-history": [ + { + "version": "v4.0.0", + "state": "Added" + }, + { + "version": "v4.0.0", + "state": "Alpha" + } + ], + "x-immich-state": "Alpha" + } + }, + "/passkeys/registration/finish": { + "post": { + "description": "Verify the response from the authenticator and save the new passkey for the current user.", + "operationId": "finishRegistration", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PasskeyRegistrationFinishDto" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PasskeyResponseDto" + } + } + }, + "description": "" + } + }, + "security": [ + { + "bearer": [] + }, + { + "cookie": [] + }, + { + "api_key": [] + } + ], + "summary": "Finish passkey registration", + "tags": [ + "Passkeys" + ], + "x-immich-history": [ + { + "version": "v4.0.0", + "state": "Added" + }, + { + "version": "v4.0.0", + "state": "Alpha" + } + ], + "x-immich-state": "Alpha" + } + }, + "/passkeys/registration/start": { + "post": { + "description": "Generate the options used by the browser to create a new passkey for the current user.", + "operationId": "startRegistration", + "parameters": [], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PasskeyRegistrationOptionsDto" + } + } + }, + "description": "" + } + }, + "security": [ + { + "bearer": [] + }, + { + "cookie": [] + }, + { + "api_key": [] + } + ], + "summary": "Start passkey registration", + "tags": [ + "Passkeys" + ], + "x-immich-history": [ + { + "version": "v4.0.0", + "state": "Added" + }, + { + "version": "v4.0.0", + "state": "Alpha" + } + ], + "x-immich-state": "Alpha" + } + }, + "/passkeys/{id}": { + "delete": { + "description": "Delete a passkey by its ID. The current user must own this passkey.", + "operationId": "deletePasskey", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "" + } + }, + "security": [ + { + "bearer": [] + }, + { + "cookie": [] + }, + { + "api_key": [] + } + ], + "summary": "Delete a passkey", + "tags": [ + "Passkeys" + ], + "x-immich-history": [ + { + "version": "v4.0.0", + "state": "Added" + }, + { + "version": "v4.0.0", + "state": "Alpha" + } + ], + "x-immich-permission": "passkey.delete", + "x-immich-state": "Alpha" + }, + "get": { + "description": "Retrieve a passkey by its ID. The current user must own this passkey.", + "operationId": "getPasskey", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PasskeyResponseDto" + } + } + }, + "description": "" + } + }, + "security": [ + { + "bearer": [] + }, + { + "cookie": [] + }, + { + "api_key": [] + } + ], + "summary": "Retrieve a passkey", + "tags": [ + "Passkeys" + ], + "x-immich-history": [ + { + "version": "v4.0.0", + "state": "Added" + }, + { + "version": "v4.0.0", + "state": "Alpha" + } + ], + "x-immich-permission": "passkey.read", + "x-immich-state": "Alpha" + }, + "patch": { + "description": "Update the name of a passkey by its ID. The current user must own this passkey.", + "operationId": "updatePasskey", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PasskeyUpdateDto" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PasskeyResponseDto" + } + } + }, + "description": "" + } + }, + "security": [ + { + "bearer": [] + }, + { + "cookie": [] + }, + { + "api_key": [] + } + ], + "summary": "Update a passkey", + "tags": [ + "Passkeys" + ], + "x-immich-history": [ + { + "version": "v4.0.0", + "state": "Added" + }, + { + "version": "v4.0.0", + "state": "Alpha" + } + ], + "x-immich-permission": "passkey.update", + "x-immich-state": "Alpha" + } + }, "/people": { "delete": { "description": "Bulk delete a list of people at once.", @@ -10406,7 +10804,6 @@ "x-immich-state": "Stable" }, "put": { - "deprecated": true, "description": "Update an individual person.", "operationId": "updatePerson", "parameters": [ @@ -10456,8 +10853,7 @@ ], "summary": "Update person", "tags": [ - "People", - "Deprecated" + "People" ], "x-immich-history": [ { @@ -10473,13 +10869,13 @@ "state": "Stable" }, { - "version": "v3", - "state": "Deprecated", - "replacementId": "updatePerson" + "version": "v3.0.0", + "state": "Updated", + "description": "This endpoint now also supports PATCH, in addition to PUT. PATCH will become the default in v4, and then PUT will be dropped in v5. Please migrate accordingly." } ], "x-immich-permission": "person.update", - "x-immich-state": "Deprecated" + "x-immich-state": "Stable" } }, "/people/{id}/merge": { @@ -13782,7 +14178,6 @@ "x-immich-state": "Stable" }, "put": { - "deprecated": true, "description": "Update a specific session identified by id.", "operationId": "updateSession", "parameters": [ @@ -13832,8 +14227,7 @@ ], "summary": "Update a session", "tags": [ - "Sessions", - "Deprecated" + "Sessions" ], "x-immich-history": [ { @@ -13849,13 +14243,13 @@ "state": "Stable" }, { - "version": "v3", - "state": "Deprecated", - "replacementId": "updateSession" + "version": "v3.0.0", + "state": "Updated", + "description": "This endpoint now also supports PATCH, in addition to PUT. PATCH will become the default in v4, and then PUT will be dropped in v5. Please migrate accordingly." } ], "x-immich-permission": "session.update", - "x-immich-state": "Deprecated" + "x-immich-state": "Stable" } }, "/sessions/{id}/lock": { @@ -14805,7 +15199,6 @@ "x-immich-state": "Stable" }, "put": { - "deprecated": true, "description": "Update an existing stack by its ID.", "operationId": "updateStack", "parameters": [ @@ -14855,8 +15248,7 @@ ], "summary": "Update a stack", "tags": [ - "Stacks", - "Deprecated" + "Stacks" ], "x-immich-history": [ { @@ -14872,13 +15264,13 @@ "state": "Stable" }, { - "version": "v3", - "state": "Deprecated", - "replacementId": "updateStack" + "version": "v3.0.0", + "state": "Updated", + "description": "This endpoint now also supports PATCH, in addition to PUT. PATCH will become the default in v4, and then PUT will be dropped in v5. Please migrate accordingly." } ], "x-immich-permission": "stack.update", - "x-immich-state": "Deprecated" + "x-immich-state": "Stable" } }, "/stacks/{id}/assets/{assetId}": { @@ -15936,7 +16328,6 @@ "x-immich-state": "Stable" }, "put": { - "deprecated": true, "description": "Update an existing tag identified by its ID.", "operationId": "updateTag", "parameters": [ @@ -15986,8 +16377,7 @@ ], "summary": "Update a tag", "tags": [ - "Tags", - "Deprecated" + "Tags" ], "x-immich-history": [ { @@ -16003,13 +16393,13 @@ "state": "Stable" }, { - "version": "v3", - "state": "Deprecated", - "replacementId": "updateTag" + "version": "v3.0.0", + "state": "Updated", + "description": "This endpoint now also supports PATCH, in addition to PUT. PATCH will become the default in v4, and then PUT will be dropped in v5. Please migrate accordingly." } ], "x-immich-permission": "tag.update", - "x-immich-state": "Deprecated" + "x-immich-state": "Stable" } }, "/tags/{id}/assets": { @@ -16812,7 +17202,6 @@ "x-immich-state": "Stable" }, "put": { - "deprecated": true, "description": "Update the current user making the API request.", "operationId": "updateMyUser", "parameters": [], @@ -16851,8 +17240,7 @@ ], "summary": "Update current user", "tags": [ - "Users", - "Deprecated" + "Users" ], "x-immich-history": [ { @@ -16868,13 +17256,13 @@ "state": "Stable" }, { - "version": "v3", - "state": "Deprecated", - "replacementId": "updateMyUser" + "version": "v3.0.0", + "state": "Updated", + "description": "This endpoint now also supports PATCH, in addition to PUT. PATCH will become the default in v4, and then PUT will be dropped in v5. Please migrate accordingly." } ], "x-immich-permission": "user.update", - "x-immich-state": "Deprecated" + "x-immich-state": "Stable" } }, "/users/me/calendar-heatmap": { @@ -17305,7 +17693,6 @@ "x-immich-state": "Stable" }, "put": { - "deprecated": true, "description": "Update the preferences of the current user.", "operationId": "updateMyPreferences", "parameters": [], @@ -17344,8 +17731,7 @@ ], "summary": "Update my preferences", "tags": [ - "Users", - "Deprecated" + "Users" ], "x-immich-history": [ { @@ -17361,13 +17747,13 @@ "state": "Stable" }, { - "version": "v3", - "state": "Deprecated", - "replacementId": "updateMyPreferences" + "version": "v3.0.0", + "state": "Updated", + "description": "This endpoint now also supports PATCH, in addition to PUT. PATCH will become the default in v4, and then PUT will be dropped in v5. Please migrate accordingly." } ], "x-immich-permission": "userPreference.update", - "x-immich-state": "Deprecated" + "x-immich-state": "Stable" } }, "/users/profile-image": { @@ -17998,7 +18384,6 @@ "x-immich-permission": "workflow.read" }, "put": { - "deprecated": true, "description": "Update the information of a specific workflow by its ID. This endpoint can be used to update the workflow name, description, trigger type, filters and actions order, etc.", "operationId": "updateWorkflow", "parameters": [ @@ -18048,8 +18433,7 @@ ], "summary": "Update a workflow", "tags": [ - "Workflows", - "Deprecated" + "Workflows" ], "x-immich-history": [ { @@ -18057,13 +18441,12 @@ "state": "Added" }, { - "version": "v3", - "state": "Deprecated", - "replacementId": "updateWorkflow" + "version": "v3.0.0", + "state": "Updated", + "description": "This endpoint now also supports PATCH, in addition to PUT. PATCH will become the default in v4, and then PUT will be dropped in v5. Please migrate accordingly." } ], - "x-immich-permission": "workflow.update", - "x-immich-state": "Deprecated" + "x-immich-permission": "workflow.update" } }, "/workflows/{id}/logs": { @@ -18211,7 +18594,7 @@ "info": { "title": "Immich", "description": "Immich API", - "version": "3.3.5", + "version": "3.4.2", "contact": {} }, "tags": [ @@ -18315,6 +18698,10 @@ "name": "Partners", "description": "A partner is a link with another user that allows sharing of assets between two users." }, + { + "name": "Passkeys", + "description": "A passkey is a WebAuthn credential that can be used to login without a password." + }, { "name": "People", "description": "A person is a collection of faces, which can be favorited and named. A person can also be merged into another person. People are automatically created via the face recognition job." @@ -18524,6 +18911,10 @@ }, "AdminConfigBackupsDto": { "properties": { + "beta": { + "description": "Whether the backups feature is enabled", + "type": "boolean" + }, "database": { "$ref": "#/components/schemas/AdminConfigDatabaseBackupDto" } @@ -18619,6 +19010,9 @@ "oauth": { "$ref": "#/components/schemas/AdminConfigOAuthDto" }, + "passkey": { + "$ref": "#/components/schemas/AdminConfigPasskeyDto" + }, "passwordLogin": { "$ref": "#/components/schemas/AdminConfigPasswordLoginDto" }, @@ -18659,6 +19053,7 @@ "nightlyTasks", "notifications", "oauth", + "passkey", "passwordLogin", "reverseGeocoding", "server", @@ -19521,6 +19916,34 @@ ], "type": "object" }, + "AdminConfigPasskeyDto": { + "properties": { + "additionalDomains": { + "description": "Additional domains", + "items": { + "format": "uri", + "type": "string" + }, + "type": "array" + }, + "domain": { + "description": "Passkey domain", + "format": "uri", + "nullable": true, + "type": "string" + }, + "enabled": { + "description": "Enabled", + "type": "boolean" + } + }, + "required": [ + "additionalDomains", + "domain", + "enabled" + ], + "type": "object" + }, "AdminConfigPasswordLoginDto": { "properties": { "enabled": { @@ -22685,6 +23108,7 @@ "description": "Image format", "enum": [ "jpeg", + "jxl", "webp" ], "type": "string" @@ -22790,6 +23214,7 @@ "AssetGenerateThumbnailsQueueAll", "AssetGenerateThumbnails", "AuditTableCleanup", + "AuthChallengeCleanup", "DatabaseBackup", "FacialRecognitionQueueAll", "FacialRecognition", @@ -23080,7 +23505,8 @@ "start", "end", "select_database_restore", - "restore_database" + "restore_database", + "rollback" ], "type": "string" }, @@ -23158,6 +23584,10 @@ "error": { "type": "string" }, + "futoBackupsJobId": { + "description": "FUTO Backups job ID", + "type": "string" + }, "progress": { "maximum": 9007199254740991, "minimum": -9007199254740991, @@ -24918,6 +25348,127 @@ ], "type": "object" }, + "PasskeyAuthenticationFinishDto": { + "properties": { + "response": { + "additionalProperties": {}, + "description": "Response returned by @simplewebauthn/browser's `startAuthentication()`", + "properties": { + "id": { + "description": "Credential ID", + "format": "base64url", + "pattern": "^[A-Za-z0-9_-]*$", + "type": "string" + }, + "response": { + "additionalProperties": {}, + "properties": { + "userHandle": { + "description": "User handle", + "format": "base64url", + "pattern": "^[A-Za-z0-9_-]*$", + "type": "string" + } + }, + "type": "object" + } + }, + "required": [ + "id", + "response" + ], + "type": "object" + } + }, + "required": [ + "response" + ], + "type": "object" + }, + "PasskeyAuthenticationOptionsDto": { + "additionalProperties": {}, + "description": "Response returned by @simplewebauthn/server's `generateAuthenticationOptions`", + "type": "object" + }, + "PasskeyRegistrationFinishDto": { + "properties": { + "name": { + "description": "Passkey name", + "type": "string" + }, + "response": { + "description": "Response returned by @simplewebauthn/browser's `startAuthentication()`" + } + }, + "required": [ + "response" + ], + "type": "object" + }, + "PasskeyRegistrationOptionsDto": { + "additionalProperties": {}, + "description": "Response returned by @simplewebauthn/server's `generateRegistrationOptions`", + "type": "object" + }, + "PasskeyResponseDto": { + "properties": { + "createdAt": { + "description": "Creation date", + "example": "2024-01-01T00:00:00.000Z", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$", + "type": "string" + }, + "id": { + "description": "Passkey ID", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", + "type": "string" + }, + "name": { + "description": "Passkey name", + "nullable": true, + "type": "string" + }, + "updatedAt": { + "description": "Last update date", + "example": "2024-01-01T00:00:00.000Z", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$", + "type": "string" + }, + "usedAt": { + "description": "Last used date", + "example": "2024-01-01T00:00:00.000Z", + "format": "date-time", + "nullable": true, + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$", + "type": "string" + } + }, + "required": [ + "createdAt", + "id", + "name", + "updatedAt", + "usedAt" + ], + "type": "object" + }, + "PasskeyUpdateDto": { + "properties": { + "name": { + "description": "Passkey name", + "minLength": 1, + "nullable": true, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, "PeopleDeleteDto": { "properties": { "ids": { @@ -25240,6 +25791,7 @@ "backup.delete", "clusterGroup.read", "clusterGroup.leave", + "clusterGroup.admin", "clusterGroupRequest.create", "clusterGroupRequest.read", "clusterGroupRequest.delete", @@ -25280,6 +25832,9 @@ "partner.read", "partner.update", "partner.delete", + "passkey.read", + "passkey.update", + "passkey.delete", "person.create", "person.read", "person.update", @@ -25954,24 +26509,79 @@ "PublicConfigDto": { "description": "Configuration properties that are visible to everyone", "properties": { + "ffmpeg": { + "$ref": "#/components/schemas/PublicConfigFFmpegDto" + }, + "map": { + "$ref": "#/components/schemas/PublicConfigMapDto" + }, "oauth": { "$ref": "#/components/schemas/PublicConfigOAuthDto" }, + "passkey": { + "$ref": "#/components/schemas/PublicConfigPasskeyDto" + }, "passwordLogin": { "$ref": "#/components/schemas/PublicConfigPasswordLoginDto" }, "server": { "$ref": "#/components/schemas/PublicConfigServerDto" - }, - "theme": { - "$ref": "#/components/schemas/PublicConfigThemeDto" } }, "required": [ + "ffmpeg", + "map", "oauth", + "passkey", "passwordLogin", - "server", - "theme" + "server" + ], + "type": "object" + }, + "PublicConfigFFmpegDto": { + "properties": { + "realtime": { + "$ref": "#/components/schemas/PublicConfigFFmpegRealtimeDto" + } + }, + "required": [ + "realtime" + ], + "type": "object" + }, + "PublicConfigFFmpegRealtimeDto": { + "properties": { + "enabled": { + "description": "Enable real-time HLS transcoding (alpha)", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "type": "object" + }, + "PublicConfigMapDto": { + "properties": { + "darkStyle": { + "description": "Dark map style URL", + "format": "uri", + "type": "string" + }, + "enabled": { + "description": "Enabled", + "type": "boolean" + }, + "lightStyle": { + "description": "Light map style URL", + "format": "uri", + "type": "string" + } + }, + "required": [ + "darkStyle", + "enabled", + "lightStyle" ], "type": "object" }, @@ -25997,7 +26607,7 @@ ], "type": "object" }, - "PublicConfigPasswordLoginDto": { + "PublicConfigPasskeyDto": { "properties": { "enabled": { "description": "Enabled", @@ -26009,27 +26619,27 @@ ], "type": "object" }, - "PublicConfigServerDto": { + "PublicConfigPasswordLoginDto": { "properties": { - "loginPageMessage": { - "description": "Login page message", - "type": "string" + "enabled": { + "description": "Enabled", + "type": "boolean" } }, "required": [ - "loginPageMessage" + "enabled" ], "type": "object" }, - "PublicConfigThemeDto": { + "PublicConfigServerDto": { "properties": { - "customCss": { - "description": "Custom CSS for theming", + "loginPageMessage": { + "description": "Login page message", "type": "string" } }, "required": [ - "customCss" + "loginPageMessage" ], "type": "object" }, @@ -26239,7 +26849,23 @@ "description": "Number of paused jobs", "maximum": 9007199254740991, "minimum": -9007199254740991, - "type": "integer" + "type": "integer", + "x-immich-history": [ + { + "version": "v2.0.0", + "state": "Added" + }, + { + "version": "v4.0.0", + "state": "Updated", + "description": "A paused queue will now also shows its job as `waiting`" + }, + { + "version": "v4.0.0", + "state": "Deprecated" + } + ], + "x-immich-state": "Deprecated" }, "waiting": { "description": "Number of waiting jobs", @@ -27819,8 +28445,24 @@ ], "type": "object" }, + "ServerFeatureLevel": { + "description": "Server feature level", + "enum": [ + 1, + 2 + ], + "type": "integer", + "x-enum-varnames": [ + "FeatureLevel", + "Passkeys" + ] + }, "ServerFeaturesDto": { "properties": { + "backups": { + "description": "Whether the backups feature is enabled", + "type": "boolean" + }, "configFile": { "description": "Whether config file is available", "type": "boolean" @@ -27887,6 +28529,7 @@ } }, "required": [ + "backups", "configFile", "duplicateDetection", "email", @@ -28077,6 +28720,18 @@ }, "ServerVersionResponseDto": { "properties": { + "featureLevel": { + "description": "Highest feature level supported by the server, which increments independently of the release version", + "maximum": 9007199254740991, + "minimum": 0, + "type": "integer", + "x-immich-history": [ + { + "version": "v4.0.0", + "state": "Added" + } + ] + }, "major": { "description": "Major version number", "maximum": 9007199254740991, @@ -28110,6 +28765,7 @@ } }, "required": [ + "featureLevel", "major", "minor", "patch", @@ -28282,6 +28938,14 @@ "restoreBackupFilename": { "description": "Restore backup filename", "type": "string" + }, + "rollbackRepositoryId": { + "description": "Rollback repository ID", + "type": "string" + }, + "rollbackSnapshotId": { + "description": "Rollback snapshot ID", + "type": "string" } }, "required": [ @@ -33090,9 +33754,15 @@ "map": { "$ref": "#/components/schemas/UserConfigMapDto" }, + "notifications": { + "$ref": "#/components/schemas/UserConfigNotificationsDto" + }, "oauth": { "$ref": "#/components/schemas/UserConfigOAuthDto" }, + "passkey": { + "$ref": "#/components/schemas/UserConfigPasskeyDto" + }, "passwordLogin": { "$ref": "#/components/schemas/UserConfigPasswordLoginDto" }, @@ -33102,9 +33772,6 @@ "server": { "$ref": "#/components/schemas/UserConfigServerDto" }, - "theme": { - "$ref": "#/components/schemas/UserConfigThemeDto" - }, "trash": { "$ref": "#/components/schemas/UserConfigTrashDto" }, @@ -33117,11 +33784,12 @@ "image", "machineLearning", "map", + "notifications", "oauth", + "passkey", "passwordLogin", "reverseGeocoding", "server", - "theme", "trash", "user" ], @@ -33294,8 +33962,24 @@ ], "type": "object" }, + "UserConfigNotificationsDto": { + "properties": { + "smtp": { + "$ref": "#/components/schemas/UserConfigSmtpDto" + } + }, + "required": [ + "smtp" + ], + "type": "object" + }, "UserConfigOAuthDto": { "properties": { + "accountManagementUrl": { + "default": "", + "description": "Account management URL", + "type": "string" + }, "autoLaunch": { "description": "Auto launch", "type": "boolean" @@ -33328,6 +34012,18 @@ ], "type": "object" }, + "UserConfigPasskeyDto": { + "properties": { + "enabled": { + "description": "Enabled", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "type": "object" + }, "UserConfigPasswordLoginDto": { "properties": { "enabled": { @@ -33374,15 +34070,15 @@ ], "type": "object" }, - "UserConfigThemeDto": { + "UserConfigSmtpDto": { "properties": { - "customCss": { - "description": "Custom CSS for theming", - "type": "string" + "enabled": { + "description": "Whether SMTP email notifications are enabled", + "type": "boolean" } }, "required": [ - "customCss" + "enabled" ], "type": "object" }, @@ -33976,6 +34672,7 @@ "enum": [ "AssetCreate", "AssetMetadataExtraction", + "AssetOcrExtraction", "AssetTagged" ], "type": "string" diff --git a/docs/client-workflows.md b/docs/client-workflows.md index b8282c8..6bb4978 100644 --- a/docs/client-workflows.md +++ b/docs/client-workflows.md @@ -19,6 +19,8 @@ Run destructive workflows with `--dry-run` first. Workflows show their planned a | `cw repair-assets` | Repair supported JPEG/TIFF defects or delete confirmed Google Takeout JSON sidecars | | `cw fix-album-dates` | Check date-named albums and optionally correct exact-day capture dates | | `cw date-from-ocr` | Set capture years from a year printed in the image (OCR), per asset or interactively per album | +| `cw tz-audit` | Report assets per time zone class (none, UTC, offset, IANA, DST mismatch); read-only | +| `cw tz-set` | Give assets without any time zone an IANA zone's offset, keeping the shown time | | `cw download-album` | Export or synchronize an album to a local folder | | `cw find-similar` | Find visually similar Immich assets for a local image through immich-clip-probe | | `cw merge-album` | Merge album contents and metadata | @@ -99,7 +101,7 @@ immich-admin cw repair-assets --mode takeout-json --check-all-assets --dry-run `fix-album-dates` recognizes albums named `yyyy-MM-dd ` or `yyyy <title>`. It compares `LocalDateTime`, Immich's timezone-naive photographer-local timestamp, to the date implied by the album name. Use `--offset-days` to tolerate near-boundary camera or timezone errors. -Exact-day albums can be corrected while retaining each asset's time of day; year-only albums are report-only. This is the only command that intentionally uses Immich's deprecated `updateAsset` endpoint because no replacement can set a capture date. +Exact-day albums can be corrected while retaining each asset's time of day; year-only albums are report-only. Dates are set through `updateAsset` (`PUT /assets/{id}`). ```sh # Report first @@ -129,7 +131,37 @@ immich-admin cw date-from-ocr https://immich.example.com/photos/<id> --interacti immich-admin cw date-from-ocr --all --interactive ``` -`--interactive` offers `[s]kip`, `[t]his -> YYYY`, `[a]lbum -> YYYY`, `[n]ext album` (skip the rest of this album), `[y]ear...` (type another year), `[o]pen` (browser) and `[q]uit`. `[a]lbum` lists every asset of the album with its current and new date and asks again (default No); assets that are already in that year are kept, and the propagated ones are tagged `immich-admin-cli/date-from-ocr-album`. `--all` finds many numbers that are not dates (e.g. "seit 1938", "2000 qm"), so it is refused together with `--yes`; review the `--all --json` report or use `--all --interactive`. Album-wide changes are not available outside `--interactive`. Like `fix-album-dates`, this uses the deprecated `updateAsset` endpoint. +`--interactive` offers `[s]kip`, `[t]his -> YYYY`, `[a]lbum -> YYYY`, `[n]ext album` (skip the rest of this album), `[y]ear...` (type another year), `[o]pen` (browser) and `[q]uit`. `[a]lbum` lists every asset of the album with its current and new date and asks again (default No); assets that are already in that year are kept, and the propagated ones are tagged `immich-admin-cli/date-from-ocr-album`. `--all` finds many numbers that are not dates (e.g. "seit 1938", "2000 qm"), so it is refused together with `--yes`; review the `--all --json` report or use `--all --interactive`. Album-wide changes are not available outside `--interactive`. Like `fix-album-dates`, this sets dates through `updateAsset`. + +## Audit and Set Time Zones + +`tz-audit` (read-only) searches the library with EXIF data (narrow it with the `search metadata` filter flags) and counts assets per `exifInfo.timeZone` class, with the top cameras per class, then lists every distinct time zone value with its asset count (`(none)` = no zone; also `timeZones` in `--json`): + +| Class | Meaning | +|-------|---------| +| `none` | No time zone at all: EXIF without offset and no GPS. Fix with `tz-set`. | +| `utc` | Plain `UTC`: EXIF had no offset, so the camera's wall clock was taken as UTC. | +| `offset` | Fixed offset such as `UTC+2`. | +| `iana` | IANA name such as `Europe/Berlin`, usually inferred from GPS. | +| `dst-mismatch` | With `--reference-zone`: a fixed offset that is the zone's other offset on that date (e.g. `UTC+2` in January for `Europe/Berlin`), i.e. the camera clock was not switched for DST. Add `--country` to avoid hits from trips abroad. | +| `iana-inconsistent` | IANA zone whose offset does not match `localDateTime − fileCreatedAt`. | + +`tz-set --time-zone <IANA>` changes only assets whose time zone is null. For each one it computes the zone's offset in effect at the asset's local date and time (DST-aware) and sets `dateTimeOriginal` to the unchanged wall-clock time with that offset. The time shown in Immich stays the same; the absolute instant moves. Assets that already have a zone, or have no `dateTimeOriginal`, are skipped. Only IANA names are accepted; fixed offsets like `UTC+1` are rejected. Immich rewrites the sidecar and re-extracts metadata afterwards, so the stored zone ends up as the fixed offset (`UTC+1`/`UTC+2`), not the IANA name. + +```sh +# Overview, with the DST check for cameras used in Germany +immich-admin cw tz-audit --reference-zone Europe/Berlin --country Germany + +# List the assets without a time zone of one camera +immich-admin cw tz-audit --class none --make Canon + +# Preview, then apply (stdin IDs need --yes) +immich-admin cw tz-audit --class none --make Canon -q | immich-admin cw tz-set --time-zone Europe/Berlin --ids-file - --dry-run +immich-admin cw tz-audit --class none --make Canon -q | immich-admin cw tz-set --time-zone Europe/Berlin --ids-file - --yes + +# Or select by search directly: every asset without a time zone taken before 2010 +immich-admin cw tz-set --time-zone Europe/Berlin --taken-before 2010-01-01T00:00:00Z +``` ## Download or Mirror an Album diff --git a/immich-admin-cli/SKILL.md b/immich-admin-cli/SKILL.md index 14fa894..100b827 100644 --- a/immich-admin-cli/SKILL.md +++ b/immich-admin-cli/SKILL.md @@ -23,7 +23,7 @@ Args: `[ASSET_ID ...]` ### assets update -⚠ DEPRECATED upstream: update one or more assets (PUT /assets/{id}) +Update one or more assets (PUT /assets/{id}); --date-time-original with an offset also sets the time zone Args: `[ASSET_ID ...]` - `--ids-file` (string): read IDs from `FILE`, one UUID (or Immich asset link) per line ('-' for stdin; '#' or '//' starts a comment) - `--date-time-original` (string): set the asset's original date and time @@ -371,6 +371,58 @@ Args: `[ASSET_ID|ASSET_URL ...]` - `--yes` (bool): apply the unambiguous single-asset changes without asking (never whole albums) - `--json` (bool): print the report as JSON (report only; not with --yes/--interactive) +### client-workflow tz-audit + +Report the time zone classes of assets (none, utc, offset, iana, dst-mismatch, iana-inconsistent); read-only +- `--original-file-name, -n` (string): filter by original file name (substring match) +- `--original-path` (string): filter by original file path +- `--type` (string): filter by asset type: IMAGE, VIDEO, AUDIO, OTHER +- `--is-favorite` (string): filter favorites: true or false +- `--is-not-in-album` (string): filter assets not in any album: true or false +- `--is-offline` (string): filter offline assets: true or false +- `--is-motion` (string): filter motion photos: true or false +- `--city` (string): filter by city name +- `--country` (string): filter by country name +- `--state` (string): filter by state/province name +- `--make` (string): filter by camera make +- `--model` (string): filter by camera model +- `--lens-model` (string): filter by lens model +- `--taken-after` (string): filter by taken date after (RFC3339, e.g. 2024-01-01T00:00:00Z) +- `--taken-before` (string): filter by taken date before (RFC3339, e.g. 2024-12-31T23:59:59Z) +- `--ocr` (string): filter by OCR text recognized in the image (fuzzy word match, e.g. a year printed on a scan) +- `--description` (string): filter by description text (substring match) +- `--reference-zone` (string): IANA `ZONE` (e.g. Europe/Berlin) enabling the dst-mismatch class +- `--class` (string): list the assets of this class `NAME`: none, utc, offset, iana, dst-mismatch, iana-inconsistent +- `--top` (int): number of cameras shown per class in the summary [default: 5] +- `--ids-only, -q` (bool): with --class: print only asset IDs, one per line +- `--json` (bool): print the summary (and with --class the matching assets) as JSON + +### client-workflow tz-set + +Give assets without any time zone an IANA zone's offset, keeping the wall-clock time they show +Args: `[ASSET_ID|ASSET_URL ...]` +- `--original-file-name, -n` (string): filter by original file name (substring match) +- `--original-path` (string): filter by original file path +- `--type` (string): filter by asset type: IMAGE, VIDEO, AUDIO, OTHER +- `--is-favorite` (string): filter favorites: true or false +- `--is-not-in-album` (string): filter assets not in any album: true or false +- `--is-offline` (string): filter offline assets: true or false +- `--is-motion` (string): filter motion photos: true or false +- `--city` (string): filter by city name +- `--country` (string): filter by country name +- `--state` (string): filter by state/province name +- `--make` (string): filter by camera make +- `--model` (string): filter by camera model +- `--lens-model` (string): filter by lens model +- `--taken-after` (string): filter by taken date after (RFC3339, e.g. 2024-01-01T00:00:00Z) +- `--taken-before` (string): filter by taken date before (RFC3339, e.g. 2024-12-31T23:59:59Z) +- `--ocr` (string): filter by OCR text recognized in the image (fuzzy word match, e.g. a year printed on a scan) +- `--description` (string): filter by description text (substring match) +- `--ids-file` (string): read IDs from `FILE`, one UUID (or Immich asset link) per line ('-' for stdin; '#' or '//' starts a comment) +- `--time-zone` (string): IANA `ZONE` to apply, e.g. Europe/Berlin (fixed offsets like UTC+1 are rejected) [required] +- `--dry-run` (bool): print the planned changes without calling the API +- `--yes` (bool): skip the confirmation prompt (required when IDs come from stdin) + ### client-workflow download-album Download all original files or a smaller variant (preview/thumbnail/fullsize) from one album into a local folder, optionally kept in sync @@ -610,6 +662,16 @@ albums separate, or rename instead of merging blindly. Always run old → new date and asks again; those assets get `immich-admin-cli/date-from-ocr-album`; `[n]` skips the rest of an album. Agents should run the report, show it to the user, and leave `--interactive` to them. +- **Time zones**: `client-workflow tz-audit [search filters] [--reference-zone Europe/Berlin]` + (read-only) counts assets per class — `none` (no zone at all), `utc` (EXIF without offset), + `offset` (`UTC+2`), `iana` (`Europe/Berlin`), `dst-mismatch` (camera not switched for DST; needs + `--reference-zone`, add `--country Germany` to avoid hits abroad), `iana-inconsistent` — with the top + cameras per class; `--class none [-q|--json]` lists one class. `client-workflow tz-set --time-zone + Europe/Berlin` gives only `none` assets the zone's DST-correct offset while keeping the shown wall-clock + time (never touches assets that already have a zone; IANA names only). Typical: `cw tz-audit --class + none --make Canon -q | cw tz-set --time-zone Europe/Berlin --ids-file - --dry-run`, then rerun with + `--yes` (required with stdin IDs). Immich stores the result as `UTC+1`/`UTC+2`, not the IANA name. + `none` assets have no GPS, so only the user knows the right zone — ask, never guess. - **Tags**: `tags upsert`, `tags bulk-tag`, `tags tag` for assignment; `client-workflow tag-delete --include/--exclude` for regex bulk deletion (permanent — dry-run first). diff --git a/internal/commands/assets.go b/internal/commands/assets.go index 068de19..f753a46 100644 --- a/internal/commands/assets.go +++ b/internal/commands/assets.go @@ -113,20 +113,16 @@ func printAsset(a *immichapi.AssetResponseDto) { // assetsUpdateCommand exposes PUT /assets/{id} (updateAsset). Kept as a // standalone command per project convention (a client workflow driving an // operation also ships the raw operation), used by `client-workflow -// fix-album-dates` to set an asset's capture date. -// -// updateAsset is marked deprecated upstream with a self-referential (i.e. -// non-existent) replacementId — no stable alternative exists for setting an -// asset's capture date, so this is the project's one deliberate, documented -// exception to "never use deprecated endpoints" (see AGENTS.md). +// fix-album-dates`, `date-from-ocr` and `tz-set` to set capture dates and +// time zones. func assetsUpdateCommand() *cli.Command { return &cli.Command{ Name: "update", - Usage: "⚠ DEPRECATED upstream: update one or more assets (PUT /assets/{id})", + Usage: "Update one or more assets (PUT /assets/{id}); --date-time-original with an offset also sets the time zone", ArgsUsage: "[ASSET_ID ...]", Description: "Updates fields on one or more assets, one request per ID (continues on per-ID error). " + - "updateAsset is deprecated upstream with no working replacement; kept only because it is the sole " + - "way to set an asset's capture date (used by client-workflow fix-album-dates).", + "--date-time-original sets the capture date: without offset (2020-07-15T12:00:00) as naive local time, " + + "with offset (2020-07-15T12:00:00+02:00) Immich also stores that offset as the time zone (UTC+2).", Flags: []cli.Flag{ idsFileFlag(), &cli.StringFlag{ diff --git a/internal/commands/clientworkflow.go b/internal/commands/clientworkflow.go index 4653aeb..2c1b8be 100644 --- a/internal/commands/clientworkflow.go +++ b/internal/commands/clientworkflow.go @@ -42,6 +42,8 @@ func ClientWorkflow() *cli.Command { repairAssetsCommand(), fixAlbumDatesCommand(), dateFromOCRCommand(), + tzAuditCommand(), + tzSetCommand(), downloadAlbumCommand(), mergeAlbumCommand(), findSimilarCommand(), @@ -486,9 +488,7 @@ func fixAlbumDatesCommand() *cli.Command { "outside the range implied by the name. For exact-day albums, offers to fix mismatches by setting the " + "asset's date to the album's date (keeping the original time of day). Year-only albums have no single " + "unambiguous date to fix to, so their mismatches are reported only, never changed.\n" + - "This is the one deliberate exception to this project's rule against deprecated endpoints: fixing " + - "uses PUT /assets/{id} (updateAsset), the only Immich API that can set an asset's capture date, which " + - "upstream marks deprecated with no working replacement.", + "Fixing uses PUT /assets/{id} (updateAsset).", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "dry-run", @@ -540,8 +540,6 @@ func clientWorkflowFixAlbumDates(ctx context.Context, cmd *cli.Command) error { return nil } - fmt.Println("Note: fixing uses the deprecated PUT /assets/{id} endpoint — Immich has not shipped a replacement for setting an asset's capture date.") - // --interactive shows, confirms, and applies one album at a time (rather // than batching every fix to the end) so a prompt never refers back to // details scrolled off-screen, and Ctrl+C at any point can never lose an diff --git a/internal/commands/clientworkflow_datefromocr.go b/internal/commands/clientworkflow_datefromocr.go index f168a51..1daa2f7 100644 --- a/internal/commands/clientworkflow_datefromocr.go +++ b/internal/commands/clientworkflow_datefromocr.go @@ -39,8 +39,7 @@ func dateFromOCRCommand() *cli.Command { "album-propagated assets are tagged " + workflows.DateFromOCRAlbumTag + "), [n]ext album (skip the " + "rest of this album's hits; an asset also in another album is still shown there), [y] enter another year, " + "[o]pen in browser, [q]uit.\n" + - "Setting the date uses the deprecated PUT /assets/{id} (updateAsset), the only Immich API that can " + - "set a capture date (documented exception).", + "Dates are set through PUT /assets/{id} (updateAsset).", Flags: []cli.Flag{ &cli.StringFlag{Name: "album-id", Usage: "scan every asset in this album `UUID`"}, &cli.StringFlag{Name: "album-name", Usage: "scan every asset in the album with this exact `NAME`"}, @@ -156,7 +155,6 @@ func clientWorkflowDateFromOCR(ctx context.Context, cmd *cli.Command) error { // pointless prompts; only review what may need a change. cands = withoutMatching(cands) } - fmt.Println("Note: setting dates uses the deprecated PUT /assets/{id} endpoint — Immich has no replacement for setting a capture date.") groups, err := groupOCRCandidates(cands, album, func(id openapi_types.UUID) ([]immichapi.AlbumResponseDto, error) { return workflows.AlbumsForAsset(ctx, c, id) }) @@ -183,7 +181,6 @@ func clientWorkflowDateFromOCR(ctx context.Context, cmd *cli.Command) error { } return joinErrs(fetchErr, scanErr) } - fmt.Println("Note: setting dates uses the deprecated PUT /assets/{id} endpoint — Immich has no replacement for setting a capture date.") failures := 0 for _, cand := range changes { y, _ := cand.ProposedYear() diff --git a/internal/commands/clientworkflow_tz.go b/internal/commands/clientworkflow_tz.go new file mode 100644 index 0000000..665f365 --- /dev/null +++ b/internal/commands/clientworkflow_tz.go @@ -0,0 +1,295 @@ +package commands + +import ( + "context" + "encoding/json" + "fmt" + "io" + "maps" + "os" + "slices" + "strings" + "time" + + "github.com/urfave/cli/v3" + + "github.com/dhcgn/immich-admin-cli/internal/client" + "github.com/dhcgn/immich-admin-cli/internal/immichapi" + "github.com/dhcgn/immich-admin-cli/internal/workflows" +) + +func tzAuditCommand() *cli.Command { + return &cli.Command{ + Name: "tz-audit", + Usage: "Report the time zone classes of assets (none, utc, offset, iana, dst-mismatch, iana-inconsistent); read-only", + Description: "Pages through POST /search/metadata with EXIF (trash excluded; narrow with the search filter flags) " + + "and classifies every asset by exifInfo.timeZone:\n" + + " none no time zone at all (EXIF without offset and no GPS) — fix with tz-set\n" + + " utc plain UTC: EXIF had no offset, so the wall clock was taken as UTC\n" + + " offset fixed offset, e.g. UTC+2\n" + + " iana IANA name, e.g. Europe/Berlin (usually inferred from GPS)\n" + + " dst-mismatch (with --reference-zone) a fixed offset that is the reference zone's other offset " + + "at that date, e.g. UTC+2 in January for Europe/Berlin: camera clock not switched for DST. " + + "Combine with --country to avoid false hits abroad.\n" + + " iana-inconsistent IANA zone whose offset does not match localDateTime − fileCreatedAt\n" + + "Default output: count per class plus the top cameras per class, then every distinct " + + "exifInfo.timeZone value with its asset count ((none) = no zone). --class NAME lists that class's assets; " + + "with --ids-only it prints only IDs for piping into tz-set --ids-file -. Never changes anything.", + Flags: append(searchFilterFlags(), + &cli.StringFlag{Name: "reference-zone", Usage: "IANA `ZONE` (e.g. Europe/Berlin) enabling the dst-mismatch class"}, + &cli.StringFlag{Name: "class", Usage: "list the assets of this class `NAME`: " + strings.Join(workflows.TZClasses, ", ")}, + &cli.IntFlag{Name: "top", Usage: "number of cameras shown per class in the summary", Value: 5}, + &cli.BoolFlag{Name: "ids-only", Aliases: []string{"q"}, Usage: "with --class: print only asset IDs, one per line"}, + &cli.BoolFlag{Name: "json", Usage: "print the summary (and with --class the matching assets) as JSON"}, + ), + Action: clientWorkflowTZAudit, + } +} + +func tzSetCommand() *cli.Command { + return &cli.Command{ + Name: "tz-set", + Usage: "Give assets without any time zone an IANA zone's offset, keeping the wall-clock time they show", + ArgsUsage: "[ASSET_ID|ASSET_URL ...]", + Description: "Selects assets whose exifInfo.timeZone is null — from asset IDs/links (arguments or --ids-file, " + + "e.g. piped from tz-audit --class none --ids-only) or, without IDs, by searching the library (trash " + + "excluded; narrow with the search filter flags). Assets that already have a time zone or have no " + + "dateTimeOriginal are skipped, never changed.\n" + + "For each asset the offset of --time-zone in effect at its local date/time is computed (DST-aware per " + + "asset) and PUT /assets/{id} (updateAsset) sets dateTimeOriginal to the unchanged wall-clock time with " + + "that offset, e.g. 2020-07-15T12:00:00+02:00. The shown time stays, the absolute instant moves.\n" + + "Immich then rewrites the XMP sidecar and re-extracts metadata, so the stored zone ends up as the " + + "fixed offset (UTC+2), not the IANA name — Immich keeps IANA names only when it can infer them from GPS.", + Flags: append(searchFilterFlags(), + idsFileFlag(), + &cli.StringFlag{Name: "time-zone", Usage: "IANA `ZONE` to apply, e.g. Europe/Berlin (fixed offsets like UTC+1 are rejected)", Required: true}, + &cli.BoolFlag{Name: "dry-run", Usage: "print the planned changes without calling the API"}, + &cli.BoolFlag{Name: "yes", Usage: "skip the confirmation prompt (required when IDs come from stdin)"}, + ), + Action: clientWorkflowTZSet, + } +} + +// tzSearch runs the shared search filter flags through SearchAssetsWithExif. +func tzSearch(ctx context.Context, cmd *cli.Command, c *client.Client) ([]immichapi.AssetResponseDto, error) { + f, err := buildSearchFilter(cmd) + if err != nil { + return nil, err + } + return workflows.SearchAssetsWithExif(ctx, c, immichapi.MetadataSearchDto{Filter: f}, func(n int) { + fmt.Fprintf(os.Stderr, "fetched %d asset(s)...\n", n) + }) +} + +func clientWorkflowTZAudit(ctx context.Context, cmd *cli.Command) error { + class, idsOnly, asJSON := cmd.String("class"), cmd.Bool("ids-only"), cmd.Bool("json") + if class != "" && !slices.Contains(workflows.TZClasses, class) { + return fmt.Errorf("invalid --class %q: must be one of %s", class, strings.Join(workflows.TZClasses, ", ")) + } + if idsOnly && class == "" { + return fmt.Errorf("--ids-only needs --class") + } + if idsOnly && asJSON { + return fmt.Errorf("--ids-only and --json are mutually exclusive") + } + var ref *time.Location + if z := cmd.String("reference-zone"); z != "" { + var err error + if ref, err = workflows.LoadIANAZone(z); err != nil { + return fmt.Errorf("--reference-zone: %w", err) + } + } else if class == workflows.TZClassDSTMismatch { + return fmt.Errorf("--class %s needs --reference-zone", workflows.TZClassDSTMismatch) + } + + c, err := newClient(ctx, cmd) + if err != nil { + return err + } + assets, err := tzSearch(ctx, cmd, c) + if err != nil { + return err + } + return printTZAudit(os.Stdout, assets, ref, class, idsOnly, asJSON, int(cmd.Int("top"))) +} + +type tzAuditAsset struct { + ID string `json:"id"` + OriginalFileName string `json:"originalFileName"` + TimeZone *string `json:"timeZone"` + LocalDateTime string `json:"localDateTime"` + Camera string `json:"camera"` + Classes []string `json:"classes"` +} + +func tzCamera(a immichapi.AssetResponseDto) string { + if a.ExifInfo == nil { + return "(unknown)" + } + cam := strings.TrimSpace(deref(a.ExifInfo.Make) + " " + deref(a.ExifInfo.Model)) + if cam == "" { + return "(unknown)" + } + return cam +} + +func deref(s *string) string { + if s == nil { + return "" + } + return *s +} + +// byCountDesc returns m's keys, highest count first, ties alphabetical. +func byCountDesc(m map[string]int) []string { + keys := slices.Collect(maps.Keys(m)) + slices.SortFunc(keys, func(a, b string) int { + if m[a] != m[b] { + return m[b] - m[a] + } + return strings.Compare(a, b) + }) + return keys +} + +// printTZAudit renders the tz-audit report. Pure apart from writing to w. +func printTZAudit(w io.Writer, assets []immichapi.AssetResponseDto, ref *time.Location, class string, idsOnly, asJSON bool, top int) error { + counts := map[string]int{} + cams := map[string]map[string]int{} + zones := map[string]int{} // exifInfo.timeZone value → assets, "(none)" for null + var listed []tzAuditAsset + for _, a := range assets { + zone := "(none)" + if a.ExifInfo != nil && a.ExifInfo.TimeZone != nil { + zone = *a.ExifInfo.TimeZone + } + zones[zone]++ + classes := workflows.ClassifyTZ(a, ref) + for _, cl := range classes { + counts[cl]++ + if cams[cl] == nil { + cams[cl] = map[string]int{} + } + cams[cl][tzCamera(a)]++ + } + if class != "" && slices.Contains(classes, class) { + var tz *string + if a.ExifInfo != nil { + tz = a.ExifInfo.TimeZone + } + listed = append(listed, tzAuditAsset{ + ID: a.Id.String(), OriginalFileName: a.OriginalFileName, TimeZone: tz, + LocalDateTime: a.LocalDateTime.UTC().Format("2006-01-02 15:04:05"), Camera: tzCamera(a), Classes: classes, + }) + } + } + + switch { + case idsOnly: + for _, l := range listed { + fmt.Fprintln(w, l.ID) + } + return nil + case asJSON: + out := struct { + Total int `json:"total"` + Classes map[string]int `json:"classes"` + TimeZones map[string]int `json:"timeZones"` + Assets []tzAuditAsset `json:"assets,omitempty"` + }{len(assets), counts, zones, listed} + enc := json.NewEncoder(w) + enc.SetIndent("", " ") + return enc.Encode(out) + } + + fmt.Fprintf(w, "Time zone audit: %d asset(s)\n", len(assets)) + for _, cl := range workflows.TZClasses { + if cl == workflows.TZClassDSTMismatch && ref == nil { + fmt.Fprintf(w, " %-18s %8s (needs --reference-zone)\n", cl, "-") + continue + } + fmt.Fprintf(w, " %-18s %8d\n", cl, counts[cl]) + for i, k := range byCountDesc(cams[cl]) { + if i >= top { + break + } + fmt.Fprintf(w, " %8d %s\n", cams[cl][k], k) + } + } + fmt.Fprintf(w, "\nTime zones: %d distinct\n", len(zones)) + for _, k := range byCountDesc(zones) { + fmt.Fprintf(w, " %8d %s\n", zones[k], k) + } + if class != "" { + fmt.Fprintf(w, "\n%s: %d asset(s)\n", class, len(listed)) + for _, l := range listed { + fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\n", l.ID, l.OriginalFileName, deref(l.TimeZone), l.LocalDateTime, l.Camera) + } + } + return nil +} + +func clientWorkflowTZSet(ctx context.Context, cmd *cli.Command) error { + loc, err := workflows.LoadIANAZone(cmd.String("time-zone")) + if err != nil { + return fmt.Errorf("--time-zone: %w", err) + } + dryRun, yes := cmd.Bool("dry-run"), cmd.Bool("yes") + hasIDs := cmd.Args().Len() > 0 || cmd.String("ids-file") != "" + if hasIDs { + for _, f := range searchFilterFlags() { + if cmd.IsSet(f.Names()[0]) { + return fmt.Errorf("pass asset IDs or search filters (--%s), not both", f.Names()[0]) + } + } + } + + c, err := newClient(ctx, cmd) + if err != nil { + return err + } + + var assets []immichapi.AssetResponseDto + var fetchErr error + if hasIDs { + ids, err := collectIDs(cmd) + if err != nil { + return err + } + // Fresh GET /assets/{id} per asset: an ID list may be stale, and + // SplitTZSet must see the current zone to never overwrite one. + assets, fetchErr = workflows.FetchAssets(ctx, c, ids) + } else { + all, err := tzSearch(ctx, cmd, c) + if err != nil { + return err + } + for _, a := range all { + if workflows.ClassifyTZ(a, nil)[0] == workflows.TZClassNone { + assets = append(assets, a) + } + } + } + + todo, skips := workflows.SplitTZSet(assets, loc) + for _, s := range skips { + fmt.Printf("skip %s\n", s) + } + fmt.Printf("%d asset(s) to set to %s, %d skipped\n", len(todo), loc, len(skips)) + if len(todo) == 0 { + return fetchErr + } + if !dryRun && !yes { + fmt.Printf("Set the time zone of %d asset(s) to %s (wall-clock time kept)? [y/N] ", len(todo), loc) + if !confirm(os.Stdin) { + return joinErrs(fmt.Errorf("aborted (pass --yes when piping IDs via stdin)"), fetchErr) + } + } + changed, err := workflows.SetAssetsTimeZone(ctx, c, todo, loc, dryRun) + verb := "changed" + if dryRun { + verb = "would change" + } + fmt.Printf("%s %d asset(s)\n", verb, changed) + return joinErrs(err, fetchErr) +} diff --git a/internal/commands/clientworkflow_tz_test.go b/internal/commands/clientworkflow_tz_test.go new file mode 100644 index 0000000..e53af46 --- /dev/null +++ b/internal/commands/clientworkflow_tz_test.go @@ -0,0 +1,31 @@ +package commands + +import ( + "bytes" + "strings" + "testing" + + "github.com/dhcgn/immich-admin-cli/internal/immichapi" +) + +func TestPrintTZAuditListsTimeZones(t *testing.T) { + asset := func(tz *string) immichapi.AssetResponseDto { + return immichapi.AssetResponseDto{ExifInfo: &immichapi.ExifResponseDto{TimeZone: tz}} + } + berlin, utc2 := "Europe/Berlin", "UTC+2" + assets := []immichapi.AssetResponseDto{asset(&utc2), asset(&berlin), asset(&berlin), asset(nil)} + + var buf bytes.Buffer + if err := printTZAudit(&buf, assets, nil, "", false, false, 5); err != nil { + t.Fatal(err) + } + out := buf.String() + _, zones, ok := strings.Cut(out, "Time zones: 3 distinct\n") + if !ok { + t.Fatalf("no time zone section:\n%s", out) + } + want := " 2 Europe/Berlin\n 1 (none)\n 1 UTC+2\n" + if zones != want { + t.Errorf("time zones =\n%q\nwant\n%q", zones, want) + } +} diff --git a/internal/commands/search.go b/internal/commands/search.go index 1a53e4f..c1bff68 100644 --- a/internal/commands/search.go +++ b/internal/commands/search.go @@ -26,83 +26,7 @@ func Search() *cli.Command { Usage: "Search assets by metadata criteria (POST /search/metadata)", Description: "Search for assets using metadata filters such as file name, type, camera, location, and date ranges. " + "Results are paginated; use --all to fetch every page automatically. Trashed assets are excluded.", - Flags: []cli.Flag{ - // --- file / name --- - &cli.StringFlag{ - Name: "original-file-name", - Aliases: []string{"n"}, - Usage: "filter by original file name (substring match)", - }, - &cli.StringFlag{ - Name: "original-path", - Usage: "filter by original file path", - }, - // --- asset type --- - &cli.StringFlag{ - Name: "type", - Usage: "filter by asset type: IMAGE, VIDEO, AUDIO, OTHER", - }, - // --- boolean filters --- - &cli.StringFlag{ - Name: "is-favorite", - Usage: "filter favorites: true or false", - }, - &cli.StringFlag{ - Name: "is-not-in-album", - Usage: "filter assets not in any album: true or false", - }, - &cli.StringFlag{ - Name: "is-offline", - Usage: "filter offline assets: true or false", - }, - &cli.StringFlag{ - Name: "is-motion", - Usage: "filter motion photos: true or false", - }, - // --- location --- - &cli.StringFlag{ - Name: "city", - Usage: "filter by city name", - }, - &cli.StringFlag{ - Name: "country", - Usage: "filter by country name", - }, - &cli.StringFlag{ - Name: "state", - Usage: "filter by state/province name", - }, - // --- camera --- - &cli.StringFlag{ - Name: "make", - Usage: "filter by camera make", - }, - &cli.StringFlag{ - Name: "model", - Usage: "filter by camera model", - }, - &cli.StringFlag{ - Name: "lens-model", - Usage: "filter by lens model", - }, - // --- dates --- - &cli.StringFlag{ - Name: "taken-after", - Usage: "filter by taken date after (RFC3339, e.g. 2024-01-01T00:00:00Z)", - }, - &cli.StringFlag{ - Name: "taken-before", - Usage: "filter by taken date before (RFC3339, e.g. 2024-12-31T23:59:59Z)", - }, - // --- OCR / description --- - &cli.StringFlag{ - Name: "ocr", - Usage: "filter by OCR text recognized in the image (fuzzy word match, e.g. a year printed on a scan)", - }, - &cli.StringFlag{ - Name: "description", - Usage: "filter by description text (substring match)", - }, + Flags: append(searchFilterFlags(), // --- order --- &cli.StringFlag{ Name: "order", @@ -129,7 +53,7 @@ func Search() *cli.Command { Aliases: []string{"q"}, Usage: "print only asset IDs, one per line (useful for piping to other commands)", }, - }, + ), Action: searchMetadata, }, }, @@ -205,6 +129,24 @@ func searchMetadata(ctx context.Context, cmd *cli.Command) error { // the structured shape (filter/orderBy/cursor, v3.2+): the flat fields are // deprecated and the server rejects mixing the two shapes (400). func buildMetadataSearchDto(cmd *cli.Command) (*immichapi.SearchAssetsJSONRequestBody, error) { + f, err := buildSearchFilter(cmd) + if err != nil { + return nil, err + } + o := immichapi.AssetOrder(cmd.String("order")) + if o != immichapi.AssetOrderAsc && o != immichapi.AssetOrderDesc { + return nil, fmt.Errorf("invalid --order %q: must be asc or desc", o) + } + size := int(cmd.Int("page-size")) + return &immichapi.MetadataSearchDto{ + Filter: f, + OrderBy: &immichapi.SearchOrder{Direction: &o}, // Field nil = server default sort field + Size: &size, + }, nil +} + +// buildSearchFilter maps the searchFilterFlags to the structured search filter. +func buildSearchFilter(cmd *cli.Command) (*immichapi.SearchFilter, error) { f := immichapi.SearchFilter{} str := func(name string) *string { if v := cmd.String(name); v != "" { @@ -270,17 +212,7 @@ func buildMetadataSearchDto(cmd *cli.Command) (*immichapi.SearchAssetsJSONReques if err := setBoolFlag(cmd, "is-motion", func(b bool) { f.IsMotion = boolFilter(b) }); err != nil { return nil, err } - - o := immichapi.AssetOrder(cmd.String("order")) - if o != immichapi.AssetOrderAsc && o != immichapi.AssetOrderDesc { - return nil, fmt.Errorf("invalid --order %q: must be asc or desc", o) - } - size := int(cmd.Int("page-size")) - return &immichapi.MetadataSearchDto{ - Filter: &f, - OrderBy: &immichapi.SearchOrder{Direction: &o}, // Field nil = server default sort field - Size: &size, - }, nil + return &f, nil } func ensureDate(p **immichapi.DateFilter) *immichapi.DateFilter { @@ -303,3 +235,87 @@ func setBoolFlag(cmd *cli.Command, name string, set func(bool)) error { set(b) return nil } + +// searchFilterFlags are the metadata filter flags shared by `search metadata` +// and the client workflows that select assets by search (tz-audit, tz-set); +// buildSearchFilter maps them to the request filter. +func searchFilterFlags() []cli.Flag { + return []cli.Flag{ + // --- file / name --- + &cli.StringFlag{ + Name: "original-file-name", + Aliases: []string{"n"}, + Usage: "filter by original file name (substring match)", + }, + &cli.StringFlag{ + Name: "original-path", + Usage: "filter by original file path", + }, + // --- asset type --- + &cli.StringFlag{ + Name: "type", + Usage: "filter by asset type: IMAGE, VIDEO, AUDIO, OTHER", + }, + // --- boolean filters --- + &cli.StringFlag{ + Name: "is-favorite", + Usage: "filter favorites: true or false", + }, + &cli.StringFlag{ + Name: "is-not-in-album", + Usage: "filter assets not in any album: true or false", + }, + &cli.StringFlag{ + Name: "is-offline", + Usage: "filter offline assets: true or false", + }, + &cli.StringFlag{ + Name: "is-motion", + Usage: "filter motion photos: true or false", + }, + // --- location --- + &cli.StringFlag{ + Name: "city", + Usage: "filter by city name", + }, + &cli.StringFlag{ + Name: "country", + Usage: "filter by country name", + }, + &cli.StringFlag{ + Name: "state", + Usage: "filter by state/province name", + }, + // --- camera --- + &cli.StringFlag{ + Name: "make", + Usage: "filter by camera make", + }, + &cli.StringFlag{ + Name: "model", + Usage: "filter by camera model", + }, + &cli.StringFlag{ + Name: "lens-model", + Usage: "filter by lens model", + }, + // --- dates --- + &cli.StringFlag{ + Name: "taken-after", + Usage: "filter by taken date after (RFC3339, e.g. 2024-01-01T00:00:00Z)", + }, + &cli.StringFlag{ + Name: "taken-before", + Usage: "filter by taken date before (RFC3339, e.g. 2024-12-31T23:59:59Z)", + }, + // --- OCR / description --- + &cli.StringFlag{ + Name: "ocr", + Usage: "filter by OCR text recognized in the image (fuzzy word match, e.g. a year printed on a scan)", + }, + &cli.StringFlag{ + Name: "description", + Usage: "filter by description text (substring match)", + }, + } +} diff --git a/internal/commands/skill_best_practices.md b/internal/commands/skill_best_practices.md index 6875250..405b4b8 100644 --- a/internal/commands/skill_best_practices.md +++ b/internal/commands/skill_best_practices.md @@ -127,6 +127,16 @@ albums separate, or rename instead of merging blindly. Always run old → new date and asks again; those assets get `immich-admin-cli/date-from-ocr-album`; `[n]` skips the rest of an album. Agents should run the report, show it to the user, and leave `--interactive` to them. +- **Time zones**: `client-workflow tz-audit [search filters] [--reference-zone Europe/Berlin]` + (read-only) counts assets per class — `none` (no zone at all), `utc` (EXIF without offset), + `offset` (`UTC+2`), `iana` (`Europe/Berlin`), `dst-mismatch` (camera not switched for DST; needs + `--reference-zone`, add `--country Germany` to avoid hits abroad), `iana-inconsistent` — with the top + cameras per class; `--class none [-q|--json]` lists one class. `client-workflow tz-set --time-zone + Europe/Berlin` gives only `none` assets the zone's DST-correct offset while keeping the shown wall-clock + time (never touches assets that already have a zone; IANA names only). Typical: `cw tz-audit --class + none --make Canon -q | cw tz-set --time-zone Europe/Berlin --ids-file - --dry-run`, then rerun with + `--yes` (required with stdin IDs). Immich stores the result as `UTC+1`/`UTC+2`, not the IANA name. + `none` assets have no GPS, so only the user knows the right zone — ask, never guess. - **Tags**: `tags upsert`, `tags bulk-tag`, `tags tag` for assignment; `client-workflow tag-delete --include/--exclude` for regex bulk deletion (permanent — dry-run first). diff --git a/internal/commands/tzset_integration_test.go b/internal/commands/tzset_integration_test.go new file mode 100644 index 0000000..4a91206 --- /dev/null +++ b/internal/commands/tzset_integration_test.go @@ -0,0 +1,183 @@ +//go:build integration + +// Staging roundtrip for client-workflow tz-audit/tz-set: uploads a JPEG whose +// EXIF DateTimeOriginal has no offset (→ timeZone null), finds it via the +// tz-audit search, sets Europe/Berlin, waits for Immich's sidecar-write → +// metadata re-extraction, and verifies the zone and the unchanged wall clock. +// Force-deletes the asset in t.Cleanup. Run with: +// +// go test -tags integration ./internal/commands/ -run TZSet +package commands + +import ( + "bytes" + "context" + "encoding/binary" + "image" + "image/color" + "image/jpeg" + "math/rand" + "net/http" + "os" + "path/filepath" + "testing" + "time" + + openapi_types "github.com/oapi-codegen/runtime/types" + + "github.com/dhcgn/immich-admin-cli/internal/client" + "github.com/dhcgn/immich-admin-cli/internal/config" + "github.com/dhcgn/immich-admin-cli/internal/immichapi" + "github.com/dhcgn/immich-admin-cli/internal/workflows" +) + +// writeJPEGWithNaiveDate writes a random 8x8 JPEG carrying a minimal EXIF +// APP1 segment (IFD0 → ExifIFD → DateTimeOriginal) without any offset tag. +func writeJPEGWithNaiveDate(t *testing.T, path, dateTimeOriginal string) { + t.Helper() + img := image.NewRGBA(image.Rect(0, 0, 8, 8)) + img.Set(0, 0, color.RGBA{byte(rand.Intn(256)), byte(rand.Intn(256)), byte(rand.Intn(256)), 0xff}) + var j bytes.Buffer + if err := jpeg.Encode(&j, img, nil); err != nil { + t.Fatal(err) + } + var tiff bytes.Buffer + w := func(v any) { _ = binary.Write(&tiff, binary.LittleEndian, v) } + tiff.WriteString("II") + w(uint16(42)) + w(uint32(8)) // IFD0 offset + // IFD0: one entry, ExifIFD pointer (tag 0x8769, LONG) → offset 26. + w(uint16(1)) + w(uint16(0x8769)) + w(uint16(4)) + w(uint32(1)) + w(uint32(26)) + w(uint32(0)) + // ExifIFD: one entry, DateTimeOriginal (0x9003, ASCII, 20 bytes) → offset 44. + w(uint16(1)) + w(uint16(0x9003)) + w(uint16(2)) + w(uint32(20)) + w(uint32(44)) + w(uint32(0)) + tiff.WriteString(dateTimeOriginal + "\x00") + seg := append([]byte("Exif\x00\x00"), tiff.Bytes()...) + + var out bytes.Buffer + out.Write(j.Bytes()[:2]) // SOI + out.Write([]byte{0xFF, 0xE1}) + _ = binary.Write(&out, binary.BigEndian, uint16(len(seg)+2)) + out.Write(seg) + out.Write(j.Bytes()[2:]) + if err := os.WriteFile(path, out.Bytes(), 0o644); err != nil { + t.Fatal(err) + } +} + +func getAsset(t *testing.T, ctx context.Context, c *client.Client, id openapi_types.UUID) immichapi.AssetResponseDto { + t.Helper() + resp, err := c.API.GetAssetInfoWithResponse(ctx, id, nil) + if err == nil { + err = client.Check(resp, http.StatusOK) + } + if err != nil { + t.Fatalf("GetAssetInfo(%s): %v", id, err) + } + return *resp.JSON200 +} + +func TestTZSetRoundtripIntegration(t *testing.T) { + if _, err := os.Stat(stagingConfigPath); err != nil { + t.Skipf("skipping: %s not found (%v)", filepath.Clean(stagingConfigPath), err) + } + cfg, err := config.Load(stagingConfigPath) + if err != nil { + t.Fatalf("loading config: %v", err) + } + c, err := client.New(cfg) + if err != nil { + t.Fatalf("creating client: %v", err) + } + ctx := context.Background() + + name := "tzset-" + time.Now().Format("20060102150405") + ".jpg" + path := filepath.Join(t.TempDir(), name) + writeJPEGWithNaiveDate(t, path, "2020:07:15 12:00:00") + + id, err := workflows.UploadAssetFile(ctx, c, path, workflows.UploadOptions{}) + if err != nil { + t.Fatalf("UploadAssetFile: %v", err) + } + t.Cleanup(func() { + force := true + if _, err := c.API.DeleteAssetsWithResponse(ctx, immichapi.AssetBulkDeleteDto{Ids: []openapi_types.UUID{id}, Force: &force}); err != nil { + t.Logf("cleanup: deleting %s: %v", id, err) + } + }) + + // 1. tz-audit path: the search must find the asset (once metadata + // extraction ran) and classify it as "none". + like := name + var found *immichapi.AssetResponseDto + deadline := time.Now().Add(60 * time.Second) + for found == nil { + as, err := workflows.SearchAssetsWithExif(ctx, c, immichapi.MetadataSearchDto{ + Filter: &immichapi.SearchFilter{OriginalFileName: &immichapi.StringPatternFilter{Like: &like}}, + }, nil) + if err != nil { + t.Fatalf("SearchAssetsWithExif: %v", err) + } + for i := range as { + if as[i].Id == id && as[i].ExifInfo != nil && as[i].ExifInfo.DateTimeOriginal != nil { + found = &as[i] + } + } + if found == nil { + if time.Now().After(deadline) { + t.Fatal("uploaded asset not searchable with EXIF after 60s") + } + time.Sleep(2 * time.Second) + } + } + if got := workflows.ClassifyTZ(*found, nil); got[0] != workflows.TZClassNone { + t.Fatalf("fresh upload classified %v, want none (timeZone=%v)", got, found.ExifInfo.TimeZone) + } + wall := found.LocalDateTime + + // 2. tz-set path. + berlin, err := workflows.LoadIANAZone("Europe/Berlin") + if err != nil { + t.Fatal(err) + } + todo, skips := workflows.SplitTZSet([]immichapi.AssetResponseDto{getAsset(t, ctx, c, id)}, berlin) + if len(todo) != 1 { + t.Fatalf("SplitTZSet: todo=%d skips=%v", len(todo), skips) + } + if n, err := workflows.SetAssetsTimeZone(ctx, c, todo, berlin, false); err != nil || n != 1 { + t.Fatalf("SetAssetsTimeZone = %d, %v", n, err) + } + + // 3. After the server's sidecar roundtrip the zone is the fixed offset. + deadline = time.Now().Add(60 * time.Second) + for { + a := getAsset(t, ctx, c, id) + tz := "" + if a.ExifInfo != nil && a.ExifInfo.TimeZone != nil { + tz = *a.ExifInfo.TimeZone + } + if tz == "UTC+2" && a.FileCreatedAt.Equal(time.Date(2020, 7, 15, 10, 0, 0, 0, time.UTC)) { + if !a.LocalDateTime.Equal(wall) { + t.Errorf("localDateTime = %s, want unchanged %s", a.LocalDateTime, wall) + } + // 4. A second run must skip it: never overwrite an existing zone. + if todo, _ := workflows.SplitTZSet([]immichapi.AssetResponseDto{a}, berlin); len(todo) != 0 { + t.Error("second tz-set run would change an already zoned asset") + } + return + } + if time.Now().After(deadline) { + t.Fatalf("after 60s: timeZone=%q fileCreatedAt=%s localDateTime=%s, want UTC+2 / 2020-07-15T10:00Z / %s", tz, a.FileCreatedAt, a.LocalDateTime, wall) + } + time.Sleep(2 * time.Second) + } +} diff --git a/internal/immichapi/immichapi.gen.go b/internal/immichapi/immichapi.gen.go index 5e4e598..e16cf0c 100644 --- a/internal/immichapi/immichapi.gen.go +++ b/internal/immichapi/immichapi.gen.go @@ -432,6 +432,7 @@ func (e HlsVideoResolution) Valid() bool { // Defines values for ImageFormat. const ( Jpeg ImageFormat = "jpeg" + Jxl ImageFormat = "jxl" Webp ImageFormat = "webp" ) @@ -440,6 +441,8 @@ func (e ImageFormat) Valid() bool { switch e { case Jpeg: return true + case Jxl: + return true case Webp: return true default: @@ -486,6 +489,7 @@ const ( JobNameAssetGenerateThumbnails JobName = "AssetGenerateThumbnails" JobNameAssetGenerateThumbnailsQueueAll JobName = "AssetGenerateThumbnailsQueueAll" JobNameAuditTableCleanup JobName = "AuditTableCleanup" + JobNameAuthChallengeCleanup JobName = "AuthChallengeCleanup" JobNameDatabaseBackup JobName = "DatabaseBackup" JobNameFacialRecognition JobName = "FacialRecognition" JobNameFacialRecognitionQueueAll JobName = "FacialRecognitionQueueAll" @@ -573,6 +577,8 @@ func (e JobName) Valid() bool { return true case JobNameAuditTableCleanup: return true + case JobNameAuthChallengeCleanup: + return true case JobNameDatabaseBackup: return true case JobNameFacialRecognition: @@ -712,6 +718,7 @@ func (e LogLevel) Valid() bool { const ( MaintenanceActionEnd MaintenanceAction = "end" MaintenanceActionRestoreDatabase MaintenanceAction = "restore_database" + MaintenanceActionRollback MaintenanceAction = "rollback" MaintenanceActionSelectDatabaseRestore MaintenanceAction = "select_database_restore" MaintenanceActionStart MaintenanceAction = "start" ) @@ -723,6 +730,8 @@ func (e MaintenanceAction) Valid() bool { return true case MaintenanceActionRestoreDatabase: return true + case MaintenanceActionRollback: + return true case MaintenanceActionSelectDatabaseRestore: return true case MaintenanceActionStart: @@ -1010,6 +1019,7 @@ const ( PermissionBackupDownload Permission = "backup.download" PermissionBackupList Permission = "backup.list" PermissionBackupUpload Permission = "backup.upload" + PermissionClusterGroupAdmin Permission = "clusterGroup.admin" PermissionClusterGroupLeave Permission = "clusterGroup.leave" PermissionClusterGroupRead Permission = "clusterGroup.read" PermissionClusterGroupRequestCreate Permission = "clusterGroupRequest.create" @@ -1047,6 +1057,9 @@ const ( PermissionPartnerDelete Permission = "partner.delete" PermissionPartnerRead Permission = "partner.read" PermissionPartnerUpdate Permission = "partner.update" + PermissionPasskeyDelete Permission = "passkey.delete" + PermissionPasskeyRead Permission = "passkey.read" + PermissionPasskeyUpdate Permission = "passkey.update" PermissionPersonCreate Permission = "person.create" PermissionPersonDelete Permission = "person.delete" PermissionPersonMerge Permission = "person.merge" @@ -1237,6 +1250,8 @@ func (e Permission) Valid() bool { return true case PermissionBackupUpload: return true + case PermissionClusterGroupAdmin: + return true case PermissionClusterGroupLeave: return true case PermissionClusterGroupRead: @@ -1311,6 +1326,12 @@ func (e Permission) Valid() bool { return true case PermissionPartnerUpdate: return true + case PermissionPasskeyDelete: + return true + case PermissionPasskeyRead: + return true + case PermissionPasskeyUpdate: + return true case PermissionPersonCreate: return true case PermissionPersonDelete: @@ -2350,6 +2371,7 @@ func (e WorkflowResult) Valid() bool { const ( AssetCreate WorkflowTrigger = "AssetCreate" AssetMetadataExtraction WorkflowTrigger = "AssetMetadataExtraction" + AssetOcrExtraction WorkflowTrigger = "AssetOcrExtraction" AssetTagged WorkflowTrigger = "AssetTagged" ) @@ -2360,6 +2382,8 @@ func (e WorkflowTrigger) Valid() bool { return true case AssetMetadataExtraction: return true + case AssetOcrExtraction: + return true case AssetTagged: return true default: @@ -2435,6 +2459,8 @@ type AddUsersDto struct { // AdminConfigBackupsDto defines model for AdminConfigBackupsDto. type AdminConfigBackupsDto struct { + // Beta Whether the backups feature is enabled + Beta *bool `json:"beta,omitempty"` Database AdminConfigDatabaseBackupDto `json:"database"` } @@ -2477,6 +2503,7 @@ type AdminConfigDto struct { NightlyTasks AdminConfigNightlyTasksDto `json:"nightlyTasks"` Notifications AdminConfigNotificationsDto `json:"notifications"` Oauth AdminConfigOAuthDto `json:"oauth"` + Passkey AdminConfigPasskeyDto `json:"passkey"` PasswordLogin AdminConfigPasswordLoginDto `json:"passwordLogin"` ReverseGeocoding AdminConfigReverseGeocodingDto `json:"reverseGeocoding"` Server AdminConfigServerDto `json:"server"` @@ -2894,6 +2921,18 @@ type AdminConfigOcrDto struct { ModelName string `json:"modelName"` } +// AdminConfigPasskeyDto defines model for AdminConfigPasskeyDto. +type AdminConfigPasskeyDto struct { + // AdditionalDomains Additional domains + AdditionalDomains []string `json:"additionalDomains"` + + // Domain Passkey domain + Domain *string `json:"domain"` + + // Enabled Enabled + Enabled bool `json:"enabled"` +} + // AdminConfigPasswordLoginDto defines model for AdminConfigPasswordLoginDto. type AdminConfigPasswordLoginDto struct { // Enabled Enabled @@ -4531,11 +4570,14 @@ type MaintenanceLoginDto struct { // MaintenanceStatusResponseDto defines model for MaintenanceStatusResponseDto. type MaintenanceStatusResponseDto struct { // Action Maintenance action - Action MaintenanceAction `json:"action"` - Active bool `json:"active"` - Error *string `json:"error,omitempty"` - Progress *int `json:"progress,omitempty"` - Task *string `json:"task,omitempty"` + Action MaintenanceAction `json:"action"` + Active bool `json:"active"` + Error *string `json:"error,omitempty"` + + // FutoBackupsJobId FUTO Backups job ID + FutoBackupsJobId *string `json:"futoBackupsJobId,omitempty"` + Progress *int `json:"progress,omitempty"` + Task *string `json:"task,omitempty"` } // ManualJobName Manual job name @@ -5126,6 +5168,72 @@ type PartnerUpdateDto struct { InTimeline bool `json:"inTimeline"` } +// PasskeyAuthenticationFinishDto defines model for PasskeyAuthenticationFinishDto. +type PasskeyAuthenticationFinishDto struct { + // Response Response returned by @simplewebauthn/browser's `startAuthentication()` + Response PasskeyAuthenticationFinishDto_Response `json:"response"` +} + +// PasskeyAuthenticationFinishDto_Response_Response defines model for PasskeyAuthenticationFinishDto.Response.Response. +type PasskeyAuthenticationFinishDto_Response_Response struct { + // UserHandle User handle + UserHandle *string `json:"userHandle,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PasskeyAuthenticationFinishDto_Response Response returned by @simplewebauthn/browser's `startAuthentication()` +type PasskeyAuthenticationFinishDto_Response struct { + // Id Credential ID + Id string `json:"id"` + Response PasskeyAuthenticationFinishDto_Response_Response `json:"response"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PasskeyAuthenticationOptionsDto Response returned by @simplewebauthn/server's `generateAuthenticationOptions` +type PasskeyAuthenticationOptionsDto map[string]interface{} + +// PasskeyRegistrationFinishDto defines model for PasskeyRegistrationFinishDto. +type PasskeyRegistrationFinishDto struct { + // Name Passkey name + Name *string `json:"name,omitempty"` + + // Response Response returned by @simplewebauthn/browser's `startAuthentication()` + Response interface{} `json:"response"` +} + +// PasskeyRegistrationOptionsDto Response returned by @simplewebauthn/server's `generateRegistrationOptions` +type PasskeyRegistrationOptionsDto map[string]interface{} + +// PasskeyResponseDto defines model for PasskeyResponseDto. +type PasskeyResponseDto struct { + // CreatedAt Creation date + // + // Example: 2024-01-01T00:00:00.000Z + CreatedAt time.Time `json:"createdAt"` + + // Id Passkey ID + Id openapi_types.UUID `json:"id"` + + // Name Passkey name + Name *string `json:"name"` + + // UpdatedAt Last update date + // + // Example: 2024-01-01T00:00:00.000Z + UpdatedAt time.Time `json:"updatedAt"` + + // UsedAt Last used date + // + // Example: 2024-01-01T00:00:00.000Z + UsedAt *time.Time `json:"usedAt"` +} + +// PasskeyUpdateDto defines model for PasskeyUpdateDto. +type PasskeyUpdateDto struct { + // Name Passkey name + Name *string `json:"name"` +} + // PeopleDeleteDto defines model for PeopleDeleteDto. type PeopleDeleteDto struct { // Ids IDs to process @@ -5529,10 +5637,35 @@ type PluginTemplateStepResponseDto struct { // PublicConfigDto Configuration properties that are visible to everyone type PublicConfigDto struct { + Ffmpeg PublicConfigFFmpegDto `json:"ffmpeg"` + Map PublicConfigMapDto `json:"map"` Oauth PublicConfigOAuthDto `json:"oauth"` + Passkey PublicConfigPasskeyDto `json:"passkey"` PasswordLogin PublicConfigPasswordLoginDto `json:"passwordLogin"` Server PublicConfigServerDto `json:"server"` - Theme PublicConfigThemeDto `json:"theme"` +} + +// PublicConfigFFmpegDto defines model for PublicConfigFFmpegDto. +type PublicConfigFFmpegDto struct { + Realtime PublicConfigFFmpegRealtimeDto `json:"realtime"` +} + +// PublicConfigFFmpegRealtimeDto defines model for PublicConfigFFmpegRealtimeDto. +type PublicConfigFFmpegRealtimeDto struct { + // Enabled Enable real-time HLS transcoding (alpha) + Enabled bool `json:"enabled"` +} + +// PublicConfigMapDto defines model for PublicConfigMapDto. +type PublicConfigMapDto struct { + // DarkStyle Dark map style URL + DarkStyle string `json:"darkStyle"` + + // Enabled Enabled + Enabled bool `json:"enabled"` + + // LightStyle Light map style URL + LightStyle string `json:"lightStyle"` } // PublicConfigOAuthDto defines model for PublicConfigOAuthDto. @@ -5547,6 +5680,12 @@ type PublicConfigOAuthDto struct { Enabled bool `json:"enabled"` } +// PublicConfigPasskeyDto defines model for PublicConfigPasskeyDto. +type PublicConfigPasskeyDto struct { + // Enabled Enabled + Enabled bool `json:"enabled"` +} + // PublicConfigPasswordLoginDto defines model for PublicConfigPasswordLoginDto. type PublicConfigPasswordLoginDto struct { // Enabled Enabled @@ -5559,12 +5698,6 @@ type PublicConfigServerDto struct { LoginPageMessage string `json:"loginPageMessage"` } -// PublicConfigThemeDto defines model for PublicConfigThemeDto. -type PublicConfigThemeDto struct { - // CustomCss Custom CSS for theming - CustomCss string `json:"customCss"` -} - // PurchaseResponse defines model for PurchaseResponse. type PurchaseResponse struct { // HideBuyButtonUntil Date until which to hide buy button @@ -6171,6 +6304,9 @@ type ServerConfigDto struct { // ServerFeaturesDto defines model for ServerFeaturesDto. type ServerFeaturesDto struct { + // Backups Whether the backups feature is enabled + Backups bool `json:"backups"` + // ConfigFile Whether config file is available ConfigFile bool `json:"configFile"` @@ -6299,6 +6435,9 @@ type ServerVersionHistoryResponseDto struct { // ServerVersionResponseDto defines model for ServerVersionResponseDto. type ServerVersionResponseDto struct { + // FeatureLevel Highest feature level supported by the server, which increments independently of the release version + FeatureLevel int `json:"featureLevel"` + // Major Major version number Major int `json:"major"` @@ -6413,6 +6552,12 @@ type SetMaintenanceModeDto struct { // RestoreBackupFilename Restore backup filename RestoreBackupFilename *string `json:"restoreBackupFilename,omitempty"` + + // RollbackRepositoryId Rollback repository ID + RollbackRepositoryId *string `json:"rollbackRepositoryId,omitempty"` + + // RollbackSnapshotId Rollback snapshot ID + RollbackSnapshotId *string `json:"rollbackSnapshotId,omitempty"` } // SharedLinkCreateDto defines model for SharedLinkCreateDto. @@ -7406,11 +7551,12 @@ type UserConfigDto struct { Image UserConfigImageDto `json:"image"` MachineLearning UserConfigMachineLearningDto `json:"machineLearning"` Map UserConfigMapDto `json:"map"` + Notifications UserConfigNotificationsDto `json:"notifications"` Oauth UserConfigOAuthDto `json:"oauth"` + Passkey UserConfigPasskeyDto `json:"passkey"` PasswordLogin UserConfigPasswordLoginDto `json:"passwordLogin"` ReverseGeocoding UserConfigReverseGeocodingDto `json:"reverseGeocoding"` Server UserConfigServerDto `json:"server"` - Theme UserConfigThemeDto `json:"theme"` Trash UserConfigTrashDto `json:"trash"` User UserConfigUserDto `json:"user"` } @@ -7489,8 +7635,16 @@ type UserConfigMapDto struct { LightStyle string `json:"lightStyle"` } +// UserConfigNotificationsDto defines model for UserConfigNotificationsDto. +type UserConfigNotificationsDto struct { + Smtp UserConfigSmtpDto `json:"smtp"` +} + // UserConfigOAuthDto defines model for UserConfigOAuthDto. type UserConfigOAuthDto struct { + // AccountManagementUrl Account management URL + AccountManagementUrl *string `json:"accountManagementUrl,omitempty"` + // AutoLaunch Auto launch AutoLaunch bool `json:"autoLaunch"` @@ -7507,6 +7661,12 @@ type UserConfigOcrDto struct { Enabled bool `json:"enabled"` } +// UserConfigPasskeyDto defines model for UserConfigPasskeyDto. +type UserConfigPasskeyDto struct { + // Enabled Enabled + Enabled bool `json:"enabled"` +} + // UserConfigPasswordLoginDto defines model for UserConfigPasswordLoginDto. type UserConfigPasswordLoginDto struct { // Enabled Enabled @@ -7531,10 +7691,10 @@ type UserConfigServerDto struct { PublicUsers bool `json:"publicUsers"` } -// UserConfigThemeDto defines model for UserConfigThemeDto. -type UserConfigThemeDto struct { - // CustomCss Custom CSS for theming - CustomCss string `json:"customCss"` +// UserConfigSmtpDto defines model for UserConfigSmtpDto. +type UserConfigSmtpDto struct { + // Enabled Whether SMTP email notifications are enabled + Enabled bool `json:"enabled"` } // UserConfigTrashDto defines model for UserConfigTrashDto. @@ -8138,6 +8298,12 @@ type GetPartnersParams struct { Direction PartnerDirection `form:"direction" json:"direction"` } +// SearchPasskeysParams defines parameters for SearchPasskeys. +type SearchPasskeysParams struct { + // Id Filter by passkey ID + Id *openapi_types.UUID `form:"id,omitempty" json:"id,omitempty"` +} + // GetAllPeopleParams defines parameters for GetAllPeople. type GetAllPeopleParams struct { // ClosestAssetId Closest asset ID for similarity search @@ -8596,13 +8762,9 @@ type CreateUserAdminJSONRequestBody = UserAdminCreateDto type DeleteUserAdminJSONRequestBody = UserAdminDeleteDto // UpdateUserAdminJSONRequestBody defines body for UpdateUserAdmin for application/json ContentType. -// -// Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set type UpdateUserAdminJSONRequestBody = UserAdminUpdateDto // UpdateUserPreferencesAdminJSONRequestBody defines body for UpdateUserPreferencesAdmin for application/json ContentType. -// -// Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set type UpdateUserPreferencesAdminJSONRequestBody = UserPreferencesUpdateDto // CreateAlbumJSONRequestBody defines body for CreateAlbum for application/json ContentType. @@ -8630,8 +8792,6 @@ type AddUsersToAlbumJSONRequestBody = AddUsersDto type CreateApiKeyJSONRequestBody = ApiKeyCreateDto // UpdateApiKeyJSONRequestBody defines body for UpdateApiKey for application/json ContentType. -// -// Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set type UpdateApiKeyJSONRequestBody = ApiKeyUpdateDto // DeleteAssetsJSONRequestBody defines body for DeleteAssets for application/json ContentType. @@ -8641,8 +8801,6 @@ type DeleteAssetsJSONRequestBody = AssetBulkDeleteDto type UploadAssetMultipartRequestBody = AssetMediaCreateDto // UpdateAssetsJSONRequestBody defines body for UpdateAssets for application/json ContentType. -// -// Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set type UpdateAssetsJSONRequestBody = AssetBulkUpdateDto // CheckBulkUploadJSONRequestBody defines body for CheckBulkUpload for application/json ContentType. @@ -8661,8 +8819,6 @@ type DeleteBulkAssetMetadataJSONRequestBody = AssetMetadataBulkDeleteDto type UpdateBulkAssetMetadataJSONRequestBody = AssetMetadataBulkUpsertDto // UpdateAssetJSONRequestBody defines body for UpdateAsset for application/json ContentType. -// -// Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set type UpdateAssetJSONRequestBody = UpdateAssetDto // EditAssetJSONRequestBody defines body for EditAsset for application/json ContentType. @@ -8728,8 +8884,6 @@ type RunQueueCommandLegacyJSONRequestBody = QueueCommandDto type CreateLibraryJSONRequestBody = CreateLibraryDto // UpdateLibraryJSONRequestBody defines body for UpdateLibrary for application/json ContentType. -// -// Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set type UpdateLibraryJSONRequestBody = UpdateLibraryDto // ValidateJSONRequestBody defines body for Validate for application/json ContentType. @@ -8739,8 +8893,6 @@ type ValidateJSONRequestBody = ValidateLibraryDto type CreateMemoryJSONRequestBody = MemoryCreateDto // UpdateMemoryJSONRequestBody defines body for UpdateMemory for application/json ContentType. -// -// Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set type UpdateMemoryJSONRequestBody = MemoryUpdateDto // RemoveMemoryAssetsJSONRequestBody defines body for RemoveMemoryAssets for application/json ContentType. @@ -8776,6 +8928,15 @@ type CreatePartnerJSONRequestBody = PartnerCreateDto // UpdatePartnerJSONRequestBody defines body for UpdatePartner for application/json ContentType. type UpdatePartnerJSONRequestBody = PartnerUpdateDto +// FinishAuthenticationJSONRequestBody defines body for FinishAuthentication for application/json ContentType. +type FinishAuthenticationJSONRequestBody = PasskeyAuthenticationFinishDto + +// FinishRegistrationJSONRequestBody defines body for FinishRegistration for application/json ContentType. +type FinishRegistrationJSONRequestBody = PasskeyRegistrationFinishDto + +// UpdatePasskeyJSONRequestBody defines body for UpdatePasskey for application/json ContentType. +type UpdatePasskeyJSONRequestBody = PasskeyUpdateDto + // DeletePeopleJSONRequestBody defines body for DeletePeople for application/json ContentType. type DeletePeopleJSONRequestBody = PeopleDeleteDto @@ -8798,8 +8959,6 @@ type UpsertPeopleUsersJSONRequestBody = PeopleUsersUpsertDto type DeletePersonJSONRequestBody = PersonDeleteDto // UpdatePersonJSONRequestBody defines body for UpdatePerson for application/json ContentType. -// -// Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set type UpdatePersonJSONRequestBody = PersonUpdateDto // MergePersonLegacyJSONRequestBody defines body for MergePersonLegacy for application/json ContentType. @@ -8835,8 +8994,6 @@ type SetServerLicenseJSONRequestBody = LicenseKeyDto type CreateSessionJSONRequestBody = SessionCreateDto // UpdateSessionJSONRequestBody defines body for UpdateSession for application/json ContentType. -// -// Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set type UpdateSessionJSONRequestBody = SessionUpdateDto // CreateSharedLinkJSONRequestBody defines body for CreateSharedLink for application/json ContentType. @@ -8861,8 +9018,6 @@ type DeleteStacksJSONRequestBody = BulkIdsDto type CreateStackJSONRequestBody = StackCreateDto // UpdateStackJSONRequestBody defines body for UpdateStack for application/json ContentType. -// -// Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set type UpdateStackJSONRequestBody = StackUpdateDto // DeleteSyncAckJSONRequestBody defines body for DeleteSyncAck for application/json ContentType. @@ -8892,8 +9047,6 @@ type UpsertTagsJSONRequestBody = TagUpsertDto type BulkTagAssetsJSONRequestBody = TagBulkAssetsDto // UpdateTagJSONRequestBody defines body for UpdateTag for application/json ContentType. -// -// Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set type UpdateTagJSONRequestBody = TagUpdateDto // UntagAssetsJSONRequestBody defines body for UntagAssets for application/json ContentType. @@ -8906,8 +9059,6 @@ type TagAssetsJSONRequestBody = BulkIdsDto type RestoreAssetsJSONRequestBody = BulkIdsDto // UpdateMyUserJSONRequestBody defines body for UpdateMyUser for application/json ContentType. -// -// Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set type UpdateMyUserJSONRequestBody = UserUpdateMeDto // SetUserLicenseJSONRequestBody defines body for SetUserLicense for application/json ContentType. @@ -8917,8 +9068,6 @@ type SetUserLicenseJSONRequestBody = LicenseKeyDto type SetUserOnboardingJSONRequestBody = OnboardingDto // UpdateMyPreferencesJSONRequestBody defines body for UpdateMyPreferences for application/json ContentType. -// -// Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set type UpdateMyPreferencesJSONRequestBody = UserPreferencesUpdateDto // CreateProfileImageMultipartRequestBody defines body for CreateProfileImage for multipart/form-data ContentType. @@ -8928,10 +9077,155 @@ type CreateProfileImageMultipartRequestBody = CreateProfileImageDto type CreateWorkflowJSONRequestBody = WorkflowCreateDto // UpdateWorkflowJSONRequestBody defines body for UpdateWorkflow for application/json ContentType. -// -// Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set type UpdateWorkflowJSONRequestBody = WorkflowUpdateDto +// Getter for additional properties for PasskeyAuthenticationFinishDto_Response_Response. Returns the specified +// element and whether it was found +func (a PasskeyAuthenticationFinishDto_Response_Response) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PasskeyAuthenticationFinishDto_Response_Response +func (a *PasskeyAuthenticationFinishDto_Response_Response) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PasskeyAuthenticationFinishDto_Response_Response to handle AdditionalProperties +func (a *PasskeyAuthenticationFinishDto_Response_Response) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["userHandle"]; found { + err = json.Unmarshal(raw, &a.UserHandle) + if err != nil { + return fmt.Errorf("error reading 'userHandle': %w", err) + } + delete(object, "userHandle") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PasskeyAuthenticationFinishDto_Response_Response to handle AdditionalProperties +func (a PasskeyAuthenticationFinishDto_Response_Response) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.UserHandle != nil { + object["userHandle"], err = json.Marshal(a.UserHandle) + if err != nil { + return nil, fmt.Errorf("error marshaling 'userHandle': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PasskeyAuthenticationFinishDto_Response. Returns the specified +// element and whether it was found +func (a PasskeyAuthenticationFinishDto_Response) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PasskeyAuthenticationFinishDto_Response +func (a *PasskeyAuthenticationFinishDto_Response) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PasskeyAuthenticationFinishDto_Response to handle AdditionalProperties +func (a *PasskeyAuthenticationFinishDto_Response) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if raw, found := object["response"]; found { + err = json.Unmarshal(raw, &a.Response) + if err != nil { + return fmt.Errorf("error reading 'response': %w", err) + } + delete(object, "response") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PasskeyAuthenticationFinishDto_Response to handle AdditionalProperties +func (a PasskeyAuthenticationFinishDto_Response) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + + object["response"], err = json.Marshal(a.Response) + if err != nil { + return nil, fmt.Errorf("error marshaling 'response': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + // AsCropParameters returns the union data inside the AssetEditActionItemDto_Parameters as a CropParameters func (t AssetEditActionItemDto_Parameters) AsCropParameters() (CropParameters, error) { var body CropParameters @@ -9504,8 +9798,6 @@ type ClientInterface interface { // Takes any type of body and a specified content type. // // Corresponds with PUT /admin/users/{id} (the `UpdateUserAdmin` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateUserAdminWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateUserAdmin Update a user @@ -9515,8 +9807,6 @@ type ClientInterface interface { // Takes a body of the `application/json` content type. // // Corresponds with PUT /admin/users/{id} (the `UpdateUserAdmin` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateUserAdmin(ctx context.Context, id openapi_types.UUID, body UpdateUserAdminJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetUserCalendarHeatmapAdmin Retrieve calendar heatmap activity @@ -9540,8 +9830,6 @@ type ClientInterface interface { // Takes any type of body and a specified content type. // // Corresponds with PUT /admin/users/{id}/preferences (the `UpdateUserPreferencesAdmin` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateUserPreferencesAdminWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateUserPreferencesAdmin Update user preferences @@ -9551,8 +9839,6 @@ type ClientInterface interface { // Takes a body of the `application/json` content type. // // Corresponds with PUT /admin/users/{id}/preferences (the `UpdateUserPreferencesAdmin` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateUserPreferencesAdmin(ctx context.Context, id openapi_types.UUID, body UpdateUserPreferencesAdminJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // RestoreUserAdmin Restore a deleted user @@ -9797,8 +10083,6 @@ type ClientInterface interface { // Takes any type of body and a specified content type. // // Corresponds with PUT /api-keys/{id} (the `UpdateApiKey` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateApiKeyWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateApiKey Update an API key @@ -9808,8 +10092,6 @@ type ClientInterface interface { // Takes a body of the `application/json` content type. // // Corresponds with PUT /api-keys/{id} (the `UpdateApiKey` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateApiKey(ctx context.Context, id openapi_types.UUID, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // RotateApiKey Rotate an API key @@ -9881,8 +10163,6 @@ type ClientInterface interface { // Takes any type of body and a specified content type. // // Corresponds with PUT /assets (the `UpdateAssets` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateAssetsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateAssets Update assets @@ -9892,8 +10172,6 @@ type ClientInterface interface { // Takes a body of the `application/json` content type. // // Corresponds with PUT /assets (the `UpdateAssets` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateAssets(ctx context.Context, body UpdateAssetsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // CheckBulkUploadWithBody Check bulk upload @@ -10007,8 +10285,6 @@ type ClientInterface interface { // Takes any type of body and a specified content type. // // Corresponds with PUT /assets/{id} (the `UpdateAsset` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateAssetWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateAsset Update an asset @@ -10018,8 +10294,6 @@ type ClientInterface interface { // Takes a body of the `application/json` content type. // // Corresponds with PUT /assets/{id} (the `UpdateAsset` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateAsset(ctx context.Context, id openapi_types.UUID, body UpdateAssetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // RemoveAssetEdits Remove edits from an existing asset @@ -10626,8 +10900,6 @@ type ClientInterface interface { // Takes any type of body and a specified content type. // // Corresponds with PUT /libraries/{id} (the `UpdateLibrary` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateLibraryWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateLibrary Update a library @@ -10637,8 +10909,6 @@ type ClientInterface interface { // Takes a body of the `application/json` content type. // // Corresponds with PUT /libraries/{id} (the `UpdateLibrary` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateLibrary(ctx context.Context, id openapi_types.UUID, body UpdateLibraryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ScanLibrary Scan a library @@ -10740,8 +11010,6 @@ type ClientInterface interface { // Takes any type of body and a specified content type. // // Corresponds with PUT /memories/{id} (the `UpdateMemory` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateMemoryWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateMemory Update a memory @@ -10751,8 +11019,6 @@ type ClientInterface interface { // Takes a body of the `application/json` content type. // // Corresponds with PUT /memories/{id} (the `UpdateMemory` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateMemory(ctx context.Context, id openapi_types.UUID, body UpdateMemoryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // RemoveMemoryAssetsWithBody Remove assets from a memory @@ -11011,6 +11277,95 @@ type ClientInterface interface { // Corresponds with PUT /partners/{id} (the `UpdatePartner` operationId). UpdatePartner(ctx context.Context, id openapi_types.UUID, body UpdatePartnerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // SearchPasskeys Search passkeys + // + // Search the passkeys of the current user. + // + // Corresponds with GET /passkeys (the `SearchPasskeys` operationId). + SearchPasskeys(ctx context.Context, params *SearchPasskeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // FinishAuthenticationWithBody Finish passkey authentication + // + // Verify the response from the authenticator and receive a session token. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /passkeys/authentication/finish (the `FinishAuthentication` operationId). + FinishAuthenticationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // FinishAuthentication Finish passkey authentication + // + // Verify the response from the authenticator and receive a session token. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /passkeys/authentication/finish (the `FinishAuthentication` operationId). + FinishAuthentication(ctx context.Context, body FinishAuthenticationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // StartAuthentication Start passkey authentication + // + // Generate the options used by the browser to sign in with a passkey. + // + // Corresponds with POST /passkeys/authentication/start (the `StartAuthentication` operationId). + StartAuthentication(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // FinishRegistrationWithBody Finish passkey registration + // + // Verify the response from the authenticator and save the new passkey for the current user. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /passkeys/registration/finish (the `FinishRegistration` operationId). + FinishRegistrationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // FinishRegistration Finish passkey registration + // + // Verify the response from the authenticator and save the new passkey for the current user. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /passkeys/registration/finish (the `FinishRegistration` operationId). + FinishRegistration(ctx context.Context, body FinishRegistrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // StartRegistration Start passkey registration + // + // Generate the options used by the browser to create a new passkey for the current user. + // + // Corresponds with POST /passkeys/registration/start (the `StartRegistration` operationId). + StartRegistration(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeletePasskey Delete a passkey + // + // Delete a passkey by its ID. The current user must own this passkey. + // + // Corresponds with DELETE /passkeys/{id} (the `DeletePasskey` operationId). + DeletePasskey(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetPasskey Retrieve a passkey + // + // Retrieve a passkey by its ID. The current user must own this passkey. + // + // Corresponds with GET /passkeys/{id} (the `GetPasskey` operationId). + GetPasskey(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdatePasskeyWithBody Update a passkey + // + // Update the name of a passkey by its ID. The current user must own this passkey. + // + // Takes any type of body and a specified content type. + // + // Corresponds with PATCH /passkeys/{id} (the `UpdatePasskey` operationId). + UpdatePasskeyWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdatePasskey Update a passkey + // + // Update the name of a passkey by its ID. The current user must own this passkey. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PATCH /passkeys/{id} (the `UpdatePasskey` operationId). + UpdatePasskey(ctx context.Context, id openapi_types.UUID, body UpdatePasskeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeletePeopleWithBody Delete people // // Bulk delete a list of people at once. @@ -11165,8 +11520,6 @@ type ClientInterface interface { // Takes any type of body and a specified content type. // // Corresponds with PUT /people/{id} (the `UpdatePerson` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdatePersonWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdatePerson Update person @@ -11176,8 +11529,6 @@ type ClientInterface interface { // Takes a body of the `application/json` content type. // // Corresponds with PUT /people/{id} (the `UpdatePerson` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdatePerson(ctx context.Context, id openapi_types.UUID, body UpdatePersonJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // MergePersonLegacyWithBody Merge people @@ -11608,8 +11959,6 @@ type ClientInterface interface { // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{id} (the `UpdateSession` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateSessionWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateSession Update a session @@ -11619,8 +11968,6 @@ type ClientInterface interface { // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{id} (the `UpdateSession` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateSession(ctx context.Context, id openapi_types.UUID, body UpdateSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // LockSession Lock a session @@ -11812,8 +12159,6 @@ type ClientInterface interface { // Takes any type of body and a specified content type. // // Corresponds with PUT /stacks/{id} (the `UpdateStack` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateStackWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateStack Update a stack @@ -11823,8 +12168,6 @@ type ClientInterface interface { // Takes a body of the `application/json` content type. // // Corresponds with PUT /stacks/{id} (the `UpdateStack` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateStack(ctx context.Context, id openapi_types.UUID, body UpdateStackJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // RemoveAssetFromStack Remove an asset from a stack @@ -12063,8 +12406,6 @@ type ClientInterface interface { // Takes any type of body and a specified content type. // // Corresponds with PUT /tags/{id} (the `UpdateTag` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateTagWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateTag Update a tag @@ -12074,8 +12415,6 @@ type ClientInterface interface { // Takes a body of the `application/json` content type. // // Corresponds with PUT /tags/{id} (the `UpdateTag` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateTag(ctx context.Context, id openapi_types.UUID, body UpdateTagJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // UntagAssetsWithBody Untag assets @@ -12181,8 +12520,6 @@ type ClientInterface interface { // Takes any type of body and a specified content type. // // Corresponds with PUT /users/me (the `UpdateMyUser` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateMyUserWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateMyUser Update current user @@ -12192,8 +12529,6 @@ type ClientInterface interface { // Takes a body of the `application/json` content type. // // Corresponds with PUT /users/me (the `UpdateMyUser` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateMyUser(ctx context.Context, body UpdateMyUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetMyCalendarHeatmap Retrieve calendar heatmap activity @@ -12281,8 +12616,6 @@ type ClientInterface interface { // Takes any type of body and a specified content type. // // Corresponds with PUT /users/me/preferences (the `UpdateMyPreferences` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateMyPreferencesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateMyPreferences Update my preferences @@ -12292,8 +12625,6 @@ type ClientInterface interface { // Takes a body of the `application/json` content type. // // Corresponds with PUT /users/me/preferences (the `UpdateMyPreferences` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateMyPreferences(ctx context.Context, body UpdateMyPreferencesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteProfileImage Delete user profile image @@ -12393,8 +12724,6 @@ type ClientInterface interface { // Takes any type of body and a specified content type. // // Corresponds with PUT /workflows/{id} (the `UpdateWorkflow` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateWorkflowWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateWorkflow Update a workflow @@ -12404,8 +12733,6 @@ type ClientInterface interface { // Takes a body of the `application/json` content type. // // Corresponds with PUT /workflows/{id} (the `UpdateWorkflow` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateWorkflow(ctx context.Context, id openapi_types.UUID, body UpdateWorkflowJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetWorkflowLogs Retrieve workflow logs @@ -13135,7 +13462,6 @@ func (c *Client) GetUserAdmin(ctx context.Context, id openapi_types.UUID, reqEdi // Takes any type of body and a specified content type. // // Corresponds with PUT /admin/users/{id} (the `UpdateUserAdmin` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateUserAdminWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateUserAdminRequestWithBody(c.Server, id, contentType, body) if err != nil { @@ -13155,7 +13481,6 @@ func (c *Client) UpdateUserAdminWithBody(ctx context.Context, id openapi_types.U // Takes a body of the `application/json` content type. // // Corresponds with PUT /admin/users/{id} (the `UpdateUserAdmin` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateUserAdmin(ctx context.Context, id openapi_types.UUID, body UpdateUserAdminJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateUserAdminRequest(c.Server, id, body) if err != nil { @@ -13209,7 +13534,6 @@ func (c *Client) GetUserPreferencesAdmin(ctx context.Context, id openapi_types.U // Takes any type of body and a specified content type. // // Corresponds with PUT /admin/users/{id}/preferences (the `UpdateUserPreferencesAdmin` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateUserPreferencesAdminWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateUserPreferencesAdminRequestWithBody(c.Server, id, contentType, body) if err != nil { @@ -13229,7 +13553,6 @@ func (c *Client) UpdateUserPreferencesAdminWithBody(ctx context.Context, id open // Takes a body of the `application/json` content type. // // Corresponds with PUT /admin/users/{id}/preferences (the `UpdateUserPreferencesAdmin` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateUserPreferencesAdmin(ctx context.Context, id openapi_types.UUID, body UpdateUserPreferencesAdminJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateUserPreferencesAdminRequest(c.Server, id, body) if err != nil { @@ -13774,7 +14097,6 @@ func (c *Client) GetApiKey(ctx context.Context, id openapi_types.UUID, reqEditor // Takes any type of body and a specified content type. // // Corresponds with PUT /api-keys/{id} (the `UpdateApiKey` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateApiKeyWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateApiKeyRequestWithBody(c.Server, id, contentType, body) if err != nil { @@ -13794,7 +14116,6 @@ func (c *Client) UpdateApiKeyWithBody(ctx context.Context, id openapi_types.UUID // Takes a body of the `application/json` content type. // // Corresponds with PUT /api-keys/{id} (the `UpdateApiKey` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateApiKey(ctx context.Context, id openapi_types.UUID, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateApiKeyRequest(c.Server, id, body) if err != nil { @@ -13956,7 +14277,6 @@ func (c *Client) UploadAssetWithBody(ctx context.Context, params *UploadAssetPar // Takes any type of body and a specified content type. // // Corresponds with PUT /assets (the `UpdateAssets` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateAssetsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateAssetsRequestWithBody(c.Server, contentType, body) if err != nil { @@ -13976,7 +14296,6 @@ func (c *Client) UpdateAssetsWithBody(ctx context.Context, contentType string, b // Takes a body of the `application/json` content type. // // Corresponds with PUT /assets (the `UpdateAssets` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateAssets(ctx context.Context, body UpdateAssetsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateAssetsRequest(c.Server, body) if err != nil { @@ -14220,7 +14539,6 @@ func (c *Client) GetAssetInfo(ctx context.Context, id openapi_types.UUID, params // Takes any type of body and a specified content type. // // Corresponds with PUT /assets/{id} (the `UpdateAsset` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateAssetWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateAssetRequestWithBody(c.Server, id, contentType, body) if err != nil { @@ -14240,7 +14558,6 @@ func (c *Client) UpdateAssetWithBody(ctx context.Context, id openapi_types.UUID, // Takes a body of the `application/json` content type. // // Corresponds with PUT /assets/{id} (the `UpdateAsset` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateAsset(ctx context.Context, id openapi_types.UUID, body UpdateAssetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateAssetRequest(c.Server, id, body) if err != nil { @@ -15584,7 +15901,6 @@ func (c *Client) GetLibrary(ctx context.Context, id openapi_types.UUID, reqEdito // Takes any type of body and a specified content type. // // Corresponds with PUT /libraries/{id} (the `UpdateLibrary` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateLibraryWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateLibraryRequestWithBody(c.Server, id, contentType, body) if err != nil { @@ -15604,7 +15920,6 @@ func (c *Client) UpdateLibraryWithBody(ctx context.Context, id openapi_types.UUI // Takes a body of the `application/json` content type. // // Corresponds with PUT /libraries/{id} (the `UpdateLibrary` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateLibrary(ctx context.Context, id openapi_types.UUID, body UpdateLibraryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateLibraryRequest(c.Server, id, body) if err != nil { @@ -15836,7 +16151,6 @@ func (c *Client) GetMemory(ctx context.Context, id openapi_types.UUID, reqEditor // Takes any type of body and a specified content type. // // Corresponds with PUT /memories/{id} (the `UpdateMemory` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateMemoryWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateMemoryRequestWithBody(c.Server, id, contentType, body) if err != nil { @@ -15856,7 +16170,6 @@ func (c *Client) UpdateMemoryWithBody(ctx context.Context, id openapi_types.UUID // Takes a body of the `application/json` content type. // // Corresponds with PUT /memories/{id} (the `UpdateMemory` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateMemory(ctx context.Context, id openapi_types.UUID, body UpdateMemoryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateMemoryRequest(c.Server, id, body) if err != nil { @@ -16424,6 +16737,205 @@ func (c *Client) UpdatePartner(ctx context.Context, id openapi_types.UUID, body return c.Client.Do(req) } +// SearchPasskeys Search passkeys +// +// Search the passkeys of the current user. +// +// Corresponds with GET /passkeys (the `SearchPasskeys` operationId). +func (c *Client) SearchPasskeys(ctx context.Context, params *SearchPasskeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSearchPasskeysRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// FinishAuthenticationWithBody Finish passkey authentication +// +// Verify the response from the authenticator and receive a session token. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /passkeys/authentication/finish (the `FinishAuthentication` operationId). +func (c *Client) FinishAuthenticationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewFinishAuthenticationRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// FinishAuthentication Finish passkey authentication +// +// Verify the response from the authenticator and receive a session token. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /passkeys/authentication/finish (the `FinishAuthentication` operationId). +func (c *Client) FinishAuthentication(ctx context.Context, body FinishAuthenticationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewFinishAuthenticationRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// StartAuthentication Start passkey authentication +// +// Generate the options used by the browser to sign in with a passkey. +// +// Corresponds with POST /passkeys/authentication/start (the `StartAuthentication` operationId). +func (c *Client) StartAuthentication(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewStartAuthenticationRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// FinishRegistrationWithBody Finish passkey registration +// +// Verify the response from the authenticator and save the new passkey for the current user. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /passkeys/registration/finish (the `FinishRegistration` operationId). +func (c *Client) FinishRegistrationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewFinishRegistrationRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// FinishRegistration Finish passkey registration +// +// Verify the response from the authenticator and save the new passkey for the current user. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /passkeys/registration/finish (the `FinishRegistration` operationId). +func (c *Client) FinishRegistration(ctx context.Context, body FinishRegistrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewFinishRegistrationRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// StartRegistration Start passkey registration +// +// Generate the options used by the browser to create a new passkey for the current user. +// +// Corresponds with POST /passkeys/registration/start (the `StartRegistration` operationId). +func (c *Client) StartRegistration(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewStartRegistrationRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeletePasskey Delete a passkey +// +// Delete a passkey by its ID. The current user must own this passkey. +// +// Corresponds with DELETE /passkeys/{id} (the `DeletePasskey` operationId). +func (c *Client) DeletePasskey(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeletePasskeyRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetPasskey Retrieve a passkey +// +// Retrieve a passkey by its ID. The current user must own this passkey. +// +// Corresponds with GET /passkeys/{id} (the `GetPasskey` operationId). +func (c *Client) GetPasskey(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetPasskeyRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// UpdatePasskeyWithBody Update a passkey +// +// Update the name of a passkey by its ID. The current user must own this passkey. +// +// Takes any type of body and a specified content type. +// +// Corresponds with PATCH /passkeys/{id} (the `UpdatePasskey` operationId). +func (c *Client) UpdatePasskeyWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePasskeyRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// UpdatePasskey Update a passkey +// +// Update the name of a passkey by its ID. The current user must own this passkey. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PATCH /passkeys/{id} (the `UpdatePasskey` operationId). +func (c *Client) UpdatePasskey(ctx context.Context, id openapi_types.UUID, body UpdatePasskeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePasskeyRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + // DeletePeopleWithBody Delete people // // Bulk delete a list of people at once. @@ -16748,7 +17260,6 @@ func (c *Client) GetPerson(ctx context.Context, id openapi_types.UUID, reqEditor // Takes any type of body and a specified content type. // // Corresponds with PUT /people/{id} (the `UpdatePerson` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdatePersonWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdatePersonRequestWithBody(c.Server, id, contentType, body) if err != nil { @@ -16768,7 +17279,6 @@ func (c *Client) UpdatePersonWithBody(ctx context.Context, id openapi_types.UUID // Takes a body of the `application/json` content type. // // Corresponds with PUT /people/{id} (the `UpdatePerson` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdatePerson(ctx context.Context, id openapi_types.UUID, body UpdatePersonJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdatePersonRequest(c.Server, id, body) if err != nil { @@ -17734,7 +18244,6 @@ func (c *Client) DeleteSession(ctx context.Context, id openapi_types.UUID, reqEd // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{id} (the `UpdateSession` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateSessionWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateSessionRequestWithBody(c.Server, id, contentType, body) if err != nil { @@ -17754,7 +18263,6 @@ func (c *Client) UpdateSessionWithBody(ctx context.Context, id openapi_types.UUI // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{id} (the `UpdateSession` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateSession(ctx context.Context, id openapi_types.UUID, body UpdateSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateSessionRequest(c.Server, id, body) if err != nil { @@ -18176,7 +18684,6 @@ func (c *Client) GetStack(ctx context.Context, id openapi_types.UUID, reqEditors // Takes any type of body and a specified content type. // // Corresponds with PUT /stacks/{id} (the `UpdateStack` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateStackWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateStackRequestWithBody(c.Server, id, contentType, body) if err != nil { @@ -18196,7 +18703,6 @@ func (c *Client) UpdateStackWithBody(ctx context.Context, id openapi_types.UUID, // Takes a body of the `application/json` content type. // // Corresponds with PUT /stacks/{id} (the `UpdateStack` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateStack(ctx context.Context, id openapi_types.UUID, body UpdateStackJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateStackRequest(c.Server, id, body) if err != nil { @@ -18711,7 +19217,6 @@ func (c *Client) GetTagById(ctx context.Context, id openapi_types.UUID, reqEdito // Takes any type of body and a specified content type. // // Corresponds with PUT /tags/{id} (the `UpdateTag` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateTagWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateTagRequestWithBody(c.Server, id, contentType, body) if err != nil { @@ -18731,7 +19236,6 @@ func (c *Client) UpdateTagWithBody(ctx context.Context, id openapi_types.UUID, c // Takes a body of the `application/json` content type. // // Corresponds with PUT /tags/{id} (the `UpdateTag` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateTag(ctx context.Context, id openapi_types.UUID, body UpdateTagJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateTagRequest(c.Server, id, body) if err != nil { @@ -18967,7 +19471,6 @@ func (c *Client) GetMyUser(ctx context.Context, reqEditors ...RequestEditorFn) ( // Takes any type of body and a specified content type. // // Corresponds with PUT /users/me (the `UpdateMyUser` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateMyUserWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateMyUserRequestWithBody(c.Server, contentType, body) if err != nil { @@ -18987,7 +19490,6 @@ func (c *Client) UpdateMyUserWithBody(ctx context.Context, contentType string, b // Takes a body of the `application/json` content type. // // Corresponds with PUT /users/me (the `UpdateMyUser` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateMyUser(ctx context.Context, body UpdateMyUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateMyUserRequest(c.Server, body) if err != nil { @@ -19185,7 +19687,6 @@ func (c *Client) GetMyPreferences(ctx context.Context, reqEditors ...RequestEdit // Takes any type of body and a specified content type. // // Corresponds with PUT /users/me/preferences (the `UpdateMyPreferences` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateMyPreferencesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateMyPreferencesRequestWithBody(c.Server, contentType, body) if err != nil { @@ -19205,7 +19706,6 @@ func (c *Client) UpdateMyPreferencesWithBody(ctx context.Context, contentType st // Takes a body of the `application/json` content type. // // Corresponds with PUT /users/me/preferences (the `UpdateMyPreferences` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateMyPreferences(ctx context.Context, body UpdateMyPreferencesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateMyPreferencesRequest(c.Server, body) if err != nil { @@ -19435,7 +19935,6 @@ func (c *Client) GetWorkflow(ctx context.Context, id openapi_types.UUID, reqEdit // Takes any type of body and a specified content type. // // Corresponds with PUT /workflows/{id} (the `UpdateWorkflow` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateWorkflowWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateWorkflowRequestWithBody(c.Server, id, contentType, body) if err != nil { @@ -19455,7 +19954,6 @@ func (c *Client) UpdateWorkflowWithBody(ctx context.Context, id openapi_types.UU // Takes a body of the `application/json` content type. // // Corresponds with PUT /workflows/{id} (the `UpdateWorkflow` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *Client) UpdateWorkflow(ctx context.Context, id openapi_types.UUID, body UpdateWorkflowJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateWorkflowRequest(c.Server, id, body) if err != nil { @@ -26677,6 +27175,309 @@ func NewUpdatePartnerRequestWithBody(server string, id openapi_types.UUID, conte return req, nil } +// NewSearchPasskeysRequest constructs an http.Request for the SearchPasskeys method +func NewSearchPasskeysRequest(server string, params *SearchPasskeysParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/passkeys") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Id != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "id", *params.Id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uuid"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewFinishAuthenticationRequest calls the generic FinishAuthentication builder with application/json body +func NewFinishAuthenticationRequest(server string, body FinishAuthenticationJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewFinishAuthenticationRequestWithBody(server, "application/json", bodyReader) +} + +// NewFinishAuthenticationRequestWithBody constructs an http.Request for the FinishAuthentication method, with any body, and a specified content type +func NewFinishAuthenticationRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/passkeys/authentication/finish") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewStartAuthenticationRequest constructs an http.Request for the StartAuthentication method +func NewStartAuthenticationRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/passkeys/authentication/start") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewFinishRegistrationRequest calls the generic FinishRegistration builder with application/json body +func NewFinishRegistrationRequest(server string, body FinishRegistrationJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewFinishRegistrationRequestWithBody(server, "application/json", bodyReader) +} + +// NewFinishRegistrationRequestWithBody constructs an http.Request for the FinishRegistration method, with any body, and a specified content type +func NewFinishRegistrationRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/passkeys/registration/finish") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewStartRegistrationRequest constructs an http.Request for the StartRegistration method +func NewStartRegistrationRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/passkeys/registration/start") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeletePasskeyRequest constructs an http.Request for the DeletePasskey method +func NewDeletePasskeyRequest(server string, id openapi_types.UUID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/passkeys/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetPasskeyRequest constructs an http.Request for the GetPasskey method +func NewGetPasskeyRequest(server string, id openapi_types.UUID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/passkeys/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdatePasskeyRequest calls the generic UpdatePasskey builder with application/json body +func NewUpdatePasskeyRequest(server string, id openapi_types.UUID, body UpdatePasskeyJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdatePasskeyRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewUpdatePasskeyRequestWithBody constructs an http.Request for the UpdatePasskey method, with any body, and a specified content type +func NewUpdatePasskeyRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/passkeys/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + // NewDeletePeopleRequest calls the generic DeletePeople builder with application/json body func NewDeletePeopleRequest(server string, body DeletePeopleJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader @@ -33053,8 +33854,6 @@ type ClientWithResponsesInterface interface { // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /admin/users/{id} (the `UpdateUserAdmin` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateUserAdminWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUserAdminResponse, error) // UpdateUserAdminWithResponse Update a user @@ -33064,8 +33863,6 @@ type ClientWithResponsesInterface interface { // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /admin/users/{id} (the `UpdateUserAdmin` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateUserAdminWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateUserAdminJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUserAdminResponse, error) // GetUserCalendarHeatmapAdminWithResponse Retrieve calendar heatmap activity @@ -33093,8 +33890,6 @@ type ClientWithResponsesInterface interface { // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /admin/users/{id}/preferences (the `UpdateUserPreferencesAdmin` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateUserPreferencesAdminWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUserPreferencesAdminResponse, error) // UpdateUserPreferencesAdminWithResponse Update user preferences @@ -33104,8 +33899,6 @@ type ClientWithResponsesInterface interface { // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /admin/users/{id}/preferences (the `UpdateUserPreferencesAdmin` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateUserPreferencesAdminWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateUserPreferencesAdminJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUserPreferencesAdminResponse, error) // RestoreUserAdminWithResponse Restore a deleted user @@ -33376,8 +34169,6 @@ type ClientWithResponsesInterface interface { // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /api-keys/{id} (the `UpdateApiKey` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateApiKeyWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) // UpdateApiKeyWithResponse Update an API key @@ -33387,8 +34178,6 @@ type ClientWithResponsesInterface interface { // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /api-keys/{id} (the `UpdateApiKey` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateApiKeyWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) // RotateApiKeyWithResponse Rotate an API key @@ -33470,8 +34259,6 @@ type ClientWithResponsesInterface interface { // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /assets (the `UpdateAssets` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateAssetsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAssetsResponse, error) // UpdateAssetsWithResponse Update assets @@ -33481,8 +34268,6 @@ type ClientWithResponsesInterface interface { // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /assets (the `UpdateAssets` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateAssetsWithResponse(ctx context.Context, body UpdateAssetsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAssetsResponse, error) // CheckBulkUploadWithBodyWithResponse Check bulk upload @@ -33600,8 +34385,6 @@ type ClientWithResponsesInterface interface { // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /assets/{id} (the `UpdateAsset` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateAssetWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAssetResponse, error) // UpdateAssetWithResponse Update an asset @@ -33611,8 +34394,6 @@ type ClientWithResponsesInterface interface { // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /assets/{id} (the `UpdateAsset` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateAssetWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateAssetJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAssetResponse, error) // RemoveAssetEditsWithResponse Remove edits from an existing asset @@ -34285,8 +35066,6 @@ type ClientWithResponsesInterface interface { // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /libraries/{id} (the `UpdateLibrary` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateLibraryWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateLibraryResponse, error) // UpdateLibraryWithResponse Update a library @@ -34296,8 +35075,6 @@ type ClientWithResponsesInterface interface { // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /libraries/{id} (the `UpdateLibrary` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateLibraryWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateLibraryJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateLibraryResponse, error) // ScanLibraryWithResponse Scan a library @@ -34415,8 +35192,6 @@ type ClientWithResponsesInterface interface { // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /memories/{id} (the `UpdateMemory` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateMemoryWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMemoryResponse, error) // UpdateMemoryWithResponse Update a memory @@ -34426,8 +35201,6 @@ type ClientWithResponsesInterface interface { // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /memories/{id} (the `UpdateMemory` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateMemoryWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateMemoryJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMemoryResponse, error) // RemoveMemoryAssetsWithBodyWithResponse Remove assets from a memory @@ -34702,6 +35475,105 @@ type ClientWithResponsesInterface interface { // Corresponds with PUT /partners/{id} (the `UpdatePartner` operationId). UpdatePartnerWithResponse(ctx context.Context, id openapi_types.UUID, body UpdatePartnerJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePartnerResponse, error) + // SearchPasskeysWithResponse Search passkeys + // + // Search the passkeys of the current user. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /passkeys (the `SearchPasskeys` operationId). + SearchPasskeysWithResponse(ctx context.Context, params *SearchPasskeysParams, reqEditors ...RequestEditorFn) (*SearchPasskeysResponse, error) + + // FinishAuthenticationWithBodyWithResponse Finish passkey authentication + // + // Verify the response from the authenticator and receive a session token. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /passkeys/authentication/finish (the `FinishAuthentication` operationId). + FinishAuthenticationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinishAuthenticationResponse, error) + + // FinishAuthenticationWithResponse Finish passkey authentication + // + // Verify the response from the authenticator and receive a session token. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /passkeys/authentication/finish (the `FinishAuthentication` operationId). + FinishAuthenticationWithResponse(ctx context.Context, body FinishAuthenticationJSONRequestBody, reqEditors ...RequestEditorFn) (*FinishAuthenticationResponse, error) + + // StartAuthenticationWithResponse Start passkey authentication + // + // Generate the options used by the browser to sign in with a passkey. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /passkeys/authentication/start (the `StartAuthentication` operationId). + StartAuthenticationWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*StartAuthenticationResponse, error) + + // FinishRegistrationWithBodyWithResponse Finish passkey registration + // + // Verify the response from the authenticator and save the new passkey for the current user. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /passkeys/registration/finish (the `FinishRegistration` operationId). + FinishRegistrationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinishRegistrationResponse, error) + + // FinishRegistrationWithResponse Finish passkey registration + // + // Verify the response from the authenticator and save the new passkey for the current user. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /passkeys/registration/finish (the `FinishRegistration` operationId). + FinishRegistrationWithResponse(ctx context.Context, body FinishRegistrationJSONRequestBody, reqEditors ...RequestEditorFn) (*FinishRegistrationResponse, error) + + // StartRegistrationWithResponse Start passkey registration + // + // Generate the options used by the browser to create a new passkey for the current user. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /passkeys/registration/start (the `StartRegistration` operationId). + StartRegistrationWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*StartRegistrationResponse, error) + + // DeletePasskeyWithResponse Delete a passkey + // + // Delete a passkey by its ID. The current user must own this passkey. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /passkeys/{id} (the `DeletePasskey` operationId). + DeletePasskeyWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeletePasskeyResponse, error) + + // GetPasskeyWithResponse Retrieve a passkey + // + // Retrieve a passkey by its ID. The current user must own this passkey. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /passkeys/{id} (the `GetPasskey` operationId). + GetPasskeyWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetPasskeyResponse, error) + + // UpdatePasskeyWithBodyWithResponse Update a passkey + // + // Update the name of a passkey by its ID. The current user must own this passkey. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /passkeys/{id} (the `UpdatePasskey` operationId). + UpdatePasskeyWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePasskeyResponse, error) + + // UpdatePasskeyWithResponse Update a passkey + // + // Update the name of a passkey by its ID. The current user must own this passkey. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /passkeys/{id} (the `UpdatePasskey` operationId). + UpdatePasskeyWithResponse(ctx context.Context, id openapi_types.UUID, body UpdatePasskeyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePasskeyResponse, error) + // DeletePeopleWithBodyWithResponse Delete people // // Bulk delete a list of people at once. @@ -34862,8 +35734,6 @@ type ClientWithResponsesInterface interface { // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /people/{id} (the `UpdatePerson` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdatePersonWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePersonResponse, error) // UpdatePersonWithResponse Update person @@ -34873,8 +35743,6 @@ type ClientWithResponsesInterface interface { // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /people/{id} (the `UpdatePerson` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdatePersonWithResponse(ctx context.Context, id openapi_types.UUID, body UpdatePersonJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePersonResponse, error) // MergePersonLegacyWithBodyWithResponse Merge people @@ -35371,8 +36239,6 @@ type ClientWithResponsesInterface interface { // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /sessions/{id} (the `UpdateSession` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateSessionWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSessionResponse, error) // UpdateSessionWithResponse Update a session @@ -35382,8 +36248,6 @@ type ClientWithResponsesInterface interface { // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /sessions/{id} (the `UpdateSession` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateSessionWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSessionResponse, error) // LockSessionWithResponse Lock a session @@ -35591,8 +36455,6 @@ type ClientWithResponsesInterface interface { // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /stacks/{id} (the `UpdateStack` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateStackWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateStackResponse, error) // UpdateStackWithResponse Update a stack @@ -35602,8 +36464,6 @@ type ClientWithResponsesInterface interface { // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /stacks/{id} (the `UpdateStack` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateStackWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateStackJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateStackResponse, error) // RemoveAssetFromStackWithResponse Remove an asset from a stack @@ -35864,8 +36724,6 @@ type ClientWithResponsesInterface interface { // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /tags/{id} (the `UpdateTag` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateTagWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTagResponse, error) // UpdateTagWithResponse Update a tag @@ -35875,8 +36733,6 @@ type ClientWithResponsesInterface interface { // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /tags/{id} (the `UpdateTag` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateTagWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateTagJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTagResponse, error) // UntagAssetsWithBodyWithResponse Untag assets @@ -35994,8 +36850,6 @@ type ClientWithResponsesInterface interface { // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /users/me (the `UpdateMyUser` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateMyUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMyUserResponse, error) // UpdateMyUserWithResponse Update current user @@ -36005,8 +36859,6 @@ type ClientWithResponsesInterface interface { // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /users/me (the `UpdateMyUser` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateMyUserWithResponse(ctx context.Context, body UpdateMyUserJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMyUserResponse, error) // GetMyCalendarHeatmapWithResponse Retrieve calendar heatmap activity @@ -36106,8 +36958,6 @@ type ClientWithResponsesInterface interface { // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /users/me/preferences (the `UpdateMyPreferences` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateMyPreferencesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMyPreferencesResponse, error) // UpdateMyPreferencesWithResponse Update my preferences @@ -36117,8 +36967,6 @@ type ClientWithResponsesInterface interface { // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /users/me/preferences (the `UpdateMyPreferences` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateMyPreferencesWithResponse(ctx context.Context, body UpdateMyPreferencesJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMyPreferencesResponse, error) // DeleteProfileImageWithResponse Delete user profile image @@ -36236,8 +37084,6 @@ type ClientWithResponsesInterface interface { // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /workflows/{id} (the `UpdateWorkflow` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateWorkflowWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWorkflowResponse, error) // UpdateWorkflowWithResponse Update a workflow @@ -36247,8 +37093,6 @@ type ClientWithResponsesInterface interface { // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /workflows/{id} (the `UpdateWorkflow` operationId). - // - // Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set UpdateWorkflowWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateWorkflowJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWorkflowResponse, error) // GetWorkflowLogsWithResponse Retrieve workflow logs @@ -42254,6 +43098,327 @@ func (r UpdatePartnerResponse) ContentType() string { return "" } +type SearchPasskeysResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *[]PasskeyResponseDto +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r SearchPasskeysResponse) GetJSON200() *[]PasskeyResponseDto { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r SearchPasskeysResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r SearchPasskeysResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SearchPasskeysResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r SearchPasskeysResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type FinishAuthenticationResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON201 the response for an HTTP 201 `application/json` response + JSON201 *LoginResponseDto +} + +// GetJSON201 returns the response for an HTTP 201 `application/json` response +func (r FinishAuthenticationResponse) GetJSON201() *LoginResponseDto { + return r.JSON201 +} + +// GetBody returns the raw response body bytes +func (r FinishAuthenticationResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r FinishAuthenticationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r FinishAuthenticationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r FinishAuthenticationResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type StartAuthenticationResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *PasskeyAuthenticationOptionsDto +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r StartAuthenticationResponse) GetJSON200() *PasskeyAuthenticationOptionsDto { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r StartAuthenticationResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r StartAuthenticationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r StartAuthenticationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r StartAuthenticationResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type FinishRegistrationResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON201 the response for an HTTP 201 `application/json` response + JSON201 *PasskeyResponseDto +} + +// GetJSON201 returns the response for an HTTP 201 `application/json` response +func (r FinishRegistrationResponse) GetJSON201() *PasskeyResponseDto { + return r.JSON201 +} + +// GetBody returns the raw response body bytes +func (r FinishRegistrationResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r FinishRegistrationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r FinishRegistrationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r FinishRegistrationResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type StartRegistrationResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *PasskeyRegistrationOptionsDto +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r StartRegistrationResponse) GetJSON200() *PasskeyRegistrationOptionsDto { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r StartRegistrationResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r StartRegistrationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r StartRegistrationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r StartRegistrationResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeletePasskeyResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// GetBody returns the raw response body bytes +func (r DeletePasskeyResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeletePasskeyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeletePasskeyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeletePasskeyResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetPasskeyResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *PasskeyResponseDto +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetPasskeyResponse) GetJSON200() *PasskeyResponseDto { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetPasskeyResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetPasskeyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetPasskeyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetPasskeyResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type UpdatePasskeyResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *PasskeyResponseDto +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r UpdatePasskeyResponse) GetJSON200() *PasskeyResponseDto { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r UpdatePasskeyResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r UpdatePasskeyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdatePasskeyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r UpdatePasskeyResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type DeletePeopleResponse struct { Body []byte HTTPResponse *http.Response @@ -47762,8 +48927,6 @@ func (c *ClientWithResponses) GetUserAdminWithResponse(ctx context.Context, id o // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /admin/users/{id} (the `UpdateUserAdmin` operationId). -// -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateUserAdminWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUserAdminResponse, error) { rsp, err := c.UpdateUserAdminWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { @@ -47779,7 +48942,6 @@ func (c *ClientWithResponses) UpdateUserAdminWithBodyWithResponse(ctx context.Co // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /admin/users/{id} (the `UpdateUserAdmin` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateUserAdminWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateUserAdminJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUserAdminResponse, error) { rsp, err := c.UpdateUserAdmin(ctx, id, body, reqEditors...) if err != nil { @@ -47825,8 +48987,6 @@ func (c *ClientWithResponses) GetUserPreferencesAdminWithResponse(ctx context.Co // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /admin/users/{id}/preferences (the `UpdateUserPreferencesAdmin` operationId). -// -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateUserPreferencesAdminWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUserPreferencesAdminResponse, error) { rsp, err := c.UpdateUserPreferencesAdminWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { @@ -47842,7 +49002,6 @@ func (c *ClientWithResponses) UpdateUserPreferencesAdminWithBodyWithResponse(ctx // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /admin/users/{id}/preferences (the `UpdateUserPreferencesAdmin` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateUserPreferencesAdminWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateUserPreferencesAdminJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUserPreferencesAdminResponse, error) { rsp, err := c.UpdateUserPreferencesAdmin(ctx, id, body, reqEditors...) if err != nil { @@ -48293,8 +49452,6 @@ func (c *ClientWithResponses) GetApiKeyWithResponse(ctx context.Context, id open // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /api-keys/{id} (the `UpdateApiKey` operationId). -// -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateApiKeyWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) { rsp, err := c.UpdateApiKeyWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { @@ -48310,7 +49467,6 @@ func (c *ClientWithResponses) UpdateApiKeyWithBodyWithResponse(ctx context.Conte // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /api-keys/{id} (the `UpdateApiKey` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateApiKeyWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) { rsp, err := c.UpdateApiKey(ctx, id, body, reqEditors...) if err != nil { @@ -48446,8 +49602,6 @@ func (c *ClientWithResponses) UploadAssetWithBodyWithResponse(ctx context.Contex // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /assets (the `UpdateAssets` operationId). -// -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateAssetsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAssetsResponse, error) { rsp, err := c.UpdateAssetsWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -48463,7 +49617,6 @@ func (c *ClientWithResponses) UpdateAssetsWithBodyWithResponse(ctx context.Conte // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /assets (the `UpdateAssets` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateAssetsWithResponse(ctx context.Context, body UpdateAssetsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAssetsResponse, error) { rsp, err := c.UpdateAssets(ctx, body, reqEditors...) if err != nil { @@ -48659,8 +49812,6 @@ func (c *ClientWithResponses) GetAssetInfoWithResponse(ctx context.Context, id o // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /assets/{id} (the `UpdateAsset` operationId). -// -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateAssetWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAssetResponse, error) { rsp, err := c.UpdateAssetWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { @@ -48676,7 +49827,6 @@ func (c *ClientWithResponses) UpdateAssetWithBodyWithResponse(ctx context.Contex // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /assets/{id} (the `UpdateAsset` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateAssetWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateAssetJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAssetResponse, error) { rsp, err := c.UpdateAsset(ctx, id, body, reqEditors...) if err != nil { @@ -49792,8 +50942,6 @@ func (c *ClientWithResponses) GetLibraryWithResponse(ctx context.Context, id ope // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /libraries/{id} (the `UpdateLibrary` operationId). -// -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateLibraryWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateLibraryResponse, error) { rsp, err := c.UpdateLibraryWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { @@ -49809,7 +50957,6 @@ func (c *ClientWithResponses) UpdateLibraryWithBodyWithResponse(ctx context.Cont // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /libraries/{id} (the `UpdateLibrary` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateLibraryWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateLibraryJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateLibraryResponse, error) { rsp, err := c.UpdateLibrary(ctx, id, body, reqEditors...) if err != nil { @@ -50005,8 +51152,6 @@ func (c *ClientWithResponses) GetMemoryWithResponse(ctx context.Context, id open // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /memories/{id} (the `UpdateMemory` operationId). -// -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateMemoryWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMemoryResponse, error) { rsp, err := c.UpdateMemoryWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { @@ -50022,7 +51167,6 @@ func (c *ClientWithResponses) UpdateMemoryWithBodyWithResponse(ctx context.Conte // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /memories/{id} (the `UpdateMemory` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateMemoryWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateMemoryJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMemoryResponse, error) { rsp, err := c.UpdateMemory(ctx, id, body, reqEditors...) if err != nil { @@ -50483,6 +51627,171 @@ func (c *ClientWithResponses) UpdatePartnerWithResponse(ctx context.Context, id return ParseUpdatePartnerResponse(rsp) } +// SearchPasskeysWithResponse Search passkeys +// +// Search the passkeys of the current user. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /passkeys (the `SearchPasskeys` operationId). +func (c *ClientWithResponses) SearchPasskeysWithResponse(ctx context.Context, params *SearchPasskeysParams, reqEditors ...RequestEditorFn) (*SearchPasskeysResponse, error) { + rsp, err := c.SearchPasskeys(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseSearchPasskeysResponse(rsp) +} + +// FinishAuthenticationWithBodyWithResponse Finish passkey authentication +// +// Verify the response from the authenticator and receive a session token. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /passkeys/authentication/finish (the `FinishAuthentication` operationId). +func (c *ClientWithResponses) FinishAuthenticationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinishAuthenticationResponse, error) { + rsp, err := c.FinishAuthenticationWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseFinishAuthenticationResponse(rsp) +} + +// FinishAuthenticationWithResponse Finish passkey authentication +// +// Verify the response from the authenticator and receive a session token. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /passkeys/authentication/finish (the `FinishAuthentication` operationId). +func (c *ClientWithResponses) FinishAuthenticationWithResponse(ctx context.Context, body FinishAuthenticationJSONRequestBody, reqEditors ...RequestEditorFn) (*FinishAuthenticationResponse, error) { + rsp, err := c.FinishAuthentication(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseFinishAuthenticationResponse(rsp) +} + +// StartAuthenticationWithResponse Start passkey authentication +// +// Generate the options used by the browser to sign in with a passkey. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /passkeys/authentication/start (the `StartAuthentication` operationId). +func (c *ClientWithResponses) StartAuthenticationWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*StartAuthenticationResponse, error) { + rsp, err := c.StartAuthentication(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseStartAuthenticationResponse(rsp) +} + +// FinishRegistrationWithBodyWithResponse Finish passkey registration +// +// Verify the response from the authenticator and save the new passkey for the current user. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /passkeys/registration/finish (the `FinishRegistration` operationId). +func (c *ClientWithResponses) FinishRegistrationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinishRegistrationResponse, error) { + rsp, err := c.FinishRegistrationWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseFinishRegistrationResponse(rsp) +} + +// FinishRegistrationWithResponse Finish passkey registration +// +// Verify the response from the authenticator and save the new passkey for the current user. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /passkeys/registration/finish (the `FinishRegistration` operationId). +func (c *ClientWithResponses) FinishRegistrationWithResponse(ctx context.Context, body FinishRegistrationJSONRequestBody, reqEditors ...RequestEditorFn) (*FinishRegistrationResponse, error) { + rsp, err := c.FinishRegistration(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseFinishRegistrationResponse(rsp) +} + +// StartRegistrationWithResponse Start passkey registration +// +// Generate the options used by the browser to create a new passkey for the current user. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /passkeys/registration/start (the `StartRegistration` operationId). +func (c *ClientWithResponses) StartRegistrationWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*StartRegistrationResponse, error) { + rsp, err := c.StartRegistration(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseStartRegistrationResponse(rsp) +} + +// DeletePasskeyWithResponse Delete a passkey +// +// Delete a passkey by its ID. The current user must own this passkey. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /passkeys/{id} (the `DeletePasskey` operationId). +func (c *ClientWithResponses) DeletePasskeyWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeletePasskeyResponse, error) { + rsp, err := c.DeletePasskey(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeletePasskeyResponse(rsp) +} + +// GetPasskeyWithResponse Retrieve a passkey +// +// Retrieve a passkey by its ID. The current user must own this passkey. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /passkeys/{id} (the `GetPasskey` operationId). +func (c *ClientWithResponses) GetPasskeyWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetPasskeyResponse, error) { + rsp, err := c.GetPasskey(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetPasskeyResponse(rsp) +} + +// UpdatePasskeyWithBodyWithResponse Update a passkey +// +// Update the name of a passkey by its ID. The current user must own this passkey. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /passkeys/{id} (the `UpdatePasskey` operationId). +func (c *ClientWithResponses) UpdatePasskeyWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePasskeyResponse, error) { + rsp, err := c.UpdatePasskeyWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdatePasskeyResponse(rsp) +} + +// UpdatePasskeyWithResponse Update a passkey +// +// Update the name of a passkey by its ID. The current user must own this passkey. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /passkeys/{id} (the `UpdatePasskey` operationId). +func (c *ClientWithResponses) UpdatePasskeyWithResponse(ctx context.Context, id openapi_types.UUID, body UpdatePasskeyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePasskeyResponse, error) { + rsp, err := c.UpdatePasskey(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdatePasskeyResponse(rsp) +} + // DeletePeopleWithBodyWithResponse Delete people // // Bulk delete a list of people at once. @@ -50745,8 +52054,6 @@ func (c *ClientWithResponses) GetPersonWithResponse(ctx context.Context, id open // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /people/{id} (the `UpdatePerson` operationId). -// -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdatePersonWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePersonResponse, error) { rsp, err := c.UpdatePersonWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { @@ -50762,7 +52069,6 @@ func (c *ClientWithResponses) UpdatePersonWithBodyWithResponse(ctx context.Conte // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /people/{id} (the `UpdatePerson` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdatePersonWithResponse(ctx context.Context, id openapi_types.UUID, body UpdatePersonJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePersonResponse, error) { rsp, err := c.UpdatePerson(ctx, id, body, reqEditors...) if err != nil { @@ -51582,8 +52888,6 @@ func (c *ClientWithResponses) DeleteSessionWithResponse(ctx context.Context, id // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /sessions/{id} (the `UpdateSession` operationId). -// -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateSessionWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSessionResponse, error) { rsp, err := c.UpdateSessionWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { @@ -51599,7 +52903,6 @@ func (c *ClientWithResponses) UpdateSessionWithBodyWithResponse(ctx context.Cont // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /sessions/{id} (the `UpdateSession` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateSessionWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSessionResponse, error) { rsp, err := c.UpdateSession(ctx, id, body, reqEditors...) if err != nil { @@ -51945,8 +53248,6 @@ func (c *ClientWithResponses) GetStackWithResponse(ctx context.Context, id opena // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /stacks/{id} (the `UpdateStack` operationId). -// -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateStackWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateStackResponse, error) { rsp, err := c.UpdateStackWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { @@ -51962,7 +53263,6 @@ func (c *ClientWithResponses) UpdateStackWithBodyWithResponse(ctx context.Contex // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /stacks/{id} (the `UpdateStack` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateStackWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateStackJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateStackResponse, error) { rsp, err := c.UpdateStack(ctx, id, body, reqEditors...) if err != nil { @@ -52390,8 +53690,6 @@ func (c *ClientWithResponses) GetTagByIdWithResponse(ctx context.Context, id ope // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /tags/{id} (the `UpdateTag` operationId). -// -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateTagWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTagResponse, error) { rsp, err := c.UpdateTagWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { @@ -52407,7 +53705,6 @@ func (c *ClientWithResponses) UpdateTagWithBodyWithResponse(ctx context.Context, // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /tags/{id} (the `UpdateTag` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateTagWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateTagJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTagResponse, error) { rsp, err := c.UpdateTag(ctx, id, body, reqEditors...) if err != nil { @@ -52603,8 +53900,6 @@ func (c *ClientWithResponses) GetMyUserWithResponse(ctx context.Context, reqEdit // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /users/me (the `UpdateMyUser` operationId). -// -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateMyUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMyUserResponse, error) { rsp, err := c.UpdateMyUserWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -52620,7 +53915,6 @@ func (c *ClientWithResponses) UpdateMyUserWithBodyWithResponse(ctx context.Conte // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /users/me (the `UpdateMyUser` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateMyUserWithResponse(ctx context.Context, body UpdateMyUserJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMyUserResponse, error) { rsp, err := c.UpdateMyUser(ctx, body, reqEditors...) if err != nil { @@ -52786,8 +54080,6 @@ func (c *ClientWithResponses) GetMyPreferencesWithResponse(ctx context.Context, // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /users/me/preferences (the `UpdateMyPreferences` operationId). -// -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateMyPreferencesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMyPreferencesResponse, error) { rsp, err := c.UpdateMyPreferencesWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -52803,7 +54095,6 @@ func (c *ClientWithResponses) UpdateMyPreferencesWithBodyWithResponse(ctx contex // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /users/me/preferences (the `UpdateMyPreferences` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateMyPreferencesWithResponse(ctx context.Context, body UpdateMyPreferencesJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMyPreferencesResponse, error) { rsp, err := c.UpdateMyPreferences(ctx, body, reqEditors...) if err != nil { @@ -52999,8 +54290,6 @@ func (c *ClientWithResponses) GetWorkflowWithResponse(ctx context.Context, id op // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /workflows/{id} (the `UpdateWorkflow` operationId). -// -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateWorkflowWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWorkflowResponse, error) { rsp, err := c.UpdateWorkflowWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { @@ -53016,7 +54305,6 @@ func (c *ClientWithResponses) UpdateWorkflowWithBodyWithResponse(ctx context.Con // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /workflows/{id} (the `UpdateWorkflow` operationId). -// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set func (c *ClientWithResponses) UpdateWorkflowWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateWorkflowJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWorkflowResponse, error) { rsp, err := c.UpdateWorkflow(ctx, id, body, reqEditors...) if err != nil { @@ -56552,6 +57840,204 @@ func ParseUpdatePartnerResponse(rsp *http.Response) (*UpdatePartnerResponse, err return response, nil } +// ParseSearchPasskeysResponse parses an HTTP response from a SearchPasskeysWithResponse call +func ParseSearchPasskeysResponse(rsp *http.Response) (*SearchPasskeysResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &SearchPasskeysResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []PasskeyResponseDto + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseFinishAuthenticationResponse parses an HTTP response from a FinishAuthenticationWithResponse call +func ParseFinishAuthenticationResponse(rsp *http.Response) (*FinishAuthenticationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &FinishAuthenticationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest LoginResponseDto + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + } + + return response, nil +} + +// ParseStartAuthenticationResponse parses an HTTP response from a StartAuthenticationWithResponse call +func ParseStartAuthenticationResponse(rsp *http.Response) (*StartAuthenticationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &StartAuthenticationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PasskeyAuthenticationOptionsDto + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseFinishRegistrationResponse parses an HTTP response from a FinishRegistrationWithResponse call +func ParseFinishRegistrationResponse(rsp *http.Response) (*FinishRegistrationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &FinishRegistrationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest PasskeyResponseDto + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + } + + return response, nil +} + +// ParseStartRegistrationResponse parses an HTTP response from a StartRegistrationWithResponse call +func ParseStartRegistrationResponse(rsp *http.Response) (*StartRegistrationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &StartRegistrationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PasskeyRegistrationOptionsDto + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeletePasskeyResponse parses an HTTP response from a DeletePasskeyWithResponse call +func ParseDeletePasskeyResponse(rsp *http.Response) (*DeletePasskeyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeletePasskeyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseGetPasskeyResponse parses an HTTP response from a GetPasskeyWithResponse call +func ParseGetPasskeyResponse(rsp *http.Response) (*GetPasskeyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetPasskeyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PasskeyResponseDto + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseUpdatePasskeyResponse parses an HTTP response from a UpdatePasskeyWithResponse call +func ParseUpdatePasskeyResponse(rsp *http.Response) (*UpdatePasskeyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdatePasskeyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PasskeyResponseDto + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + // ParseDeletePeopleResponse parses an HTTP response from a DeletePeopleWithResponse call func ParseDeletePeopleResponse(rsp *http.Response) (*DeletePeopleResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/internal/workflows/datefromocr.go b/internal/workflows/datefromocr.go index 686e70f..8bb083a 100644 --- a/internal/workflows/datefromocr.go +++ b/internal/workflows/datefromocr.go @@ -234,8 +234,7 @@ func AlbumsForAsset(ctx context.Context, c *client.Client, id openapi_types.UUID } // SetAssetsYear sets every asset's capture date to OCRTargetDate(year) via -// updateAsset (the documented deprecated-endpoint exception, see -// FixAlbumDates), then tags the successfully changed assets with tag. +// updateAsset, then tags the successfully changed assets with tag. // Continue-on-error; dry-run only prints. func SetAssetsYear(ctx context.Context, c *client.Client, assets []immichapi.AssetResponseDto, year int, tag string, dryRun bool) error { if len(assets) == 0 { diff --git a/internal/workflows/fixalbumdates.go b/internal/workflows/fixalbumdates.go index 5784971..afa4ddb 100644 --- a/internal/workflows/fixalbumdates.go +++ b/internal/workflows/fixalbumdates.go @@ -248,11 +248,7 @@ func ComputeFixedDateTime(asset immichapi.AssetResponseDto, p AlbumDatePattern) // failure. In dry-run mode it prints the planned step for each asset and // changes nothing. // -// This is the repo's one deliberate exception to "never use deprecated -// endpoints": PUT /assets/{id} (updateAsset) is the only Immich API endpoint -// that can set an asset's capture date, and it is marked deprecated upstream -// with a self-referential (non-existent) replacementId — no stable -// alternative exists (see AGENTS.md). +// Dates are set through PUT /assets/{id} (updateAsset). func FixAlbumDates(ctx context.Context, c *client.Client, checks []AlbumDateCheck, opts FixAlbumDatesOptions) error { return RunBatch(checks, func(check AlbumDateCheck) string { return check.Album.AlbumName }, diff --git a/internal/workflows/timezone.go b/internal/workflows/timezone.go new file mode 100644 index 0000000..8218597 --- /dev/null +++ b/internal/workflows/timezone.go @@ -0,0 +1,206 @@ +package workflows + +import ( + "context" + "fmt" + "net/http" + "regexp" + "strconv" + "strings" + "time" + _ "time/tzdata" // embed the IANA database: LoadLocation must work on hosts without one (Windows) + + "github.com/dhcgn/immich-admin-cli/internal/client" + "github.com/dhcgn/immich-admin-cli/internal/immichapi" +) + +// Time zone classes reported by tz-audit. Every asset has exactly one primary +// class (none, utc, offset, iana); the anomaly classes come on top. +const ( + TZClassNone = "none" // exifInfo.timeZone is null + TZClassUTC = "utc" // plain "UTC": EXIF had no offset, wall clock treated as UTC + TZClassOffset = "offset" // fixed offset, e.g. "UTC+2" + TZClassIANA = "iana" // IANA name, e.g. "Europe/Berlin" + TZClassDSTMismatch = "dst-mismatch" // fixed offset is the reference zone's *other* offset at that date + TZClassIANAInconsistent = "iana-inconsistent" // IANA offset ≠ localDateTime − fileCreatedAt +) + +// TZClasses lists every class in report order. +var TZClasses = []string{TZClassNone, TZClassUTC, TZClassOffset, TZClassIANA, TZClassDSTMismatch, TZClassIANAInconsistent} + +// LoadIANAZone validates a user-supplied IANA zone name. time.LoadLocation +// alone is too lenient: it maps "" to UTC and "Local" to the host zone. +func LoadIANAZone(name string) (*time.Location, error) { + if name == "" || name == "Local" { + return nil, fmt.Errorf("invalid time zone %q: expected an IANA name like Europe/Berlin", name) + } + loc, err := time.LoadLocation(name) + if err != nil { + return nil, fmt.Errorf("invalid time zone %q: expected an IANA name like Europe/Berlin (fixed offsets like UTC+1 are not accepted)", name) + } + return loc, nil +} + +// offsetRe matches Immich's fixed-offset zone names: "UTC+2", "UTC-5", "UTC+5:30", "UTC+0". +var offsetRe = regexp.MustCompile(`^UTC([+-])(\d{1,2})(?::(\d{2}))?$`) + +// parseFixedOffset returns the offset in seconds of an Immich "UTC±H[:MM]" name. +func parseFixedOffset(s string) (int, bool) { + m := offsetRe.FindStringSubmatch(s) + if m == nil { + return 0, false + } + h, _ := strconv.Atoi(m[2]) + mins, _ := strconv.Atoi(m[3]) // "" → 0 + off := h*3600 + mins*60 + if m[1] == "-" { + off = -off + } + return off, true +} + +// assetTZ returns the asset's stored time zone, or "" when it has none. +func assetTZ(a immichapi.AssetResponseDto) string { + if a.ExifInfo == nil || a.ExifInfo.TimeZone == nil { + return "" + } + return *a.ExifInfo.TimeZone +} + +// wallClockIn reinterprets the asset's localDateTime (the wall clock Immich +// shows, stored with a UTC label) as a wall-clock time in loc. +func wallClockIn(a immichapi.AssetResponseDto, loc *time.Location) time.Time { + l := a.LocalDateTime.UTC() + return time.Date(l.Year(), l.Month(), l.Day(), l.Hour(), l.Minute(), l.Second(), l.Nanosecond(), loc) +} + +// ClassifyTZ returns the classes an asset belongs to: its primary class plus +// any anomaly classes. ref (optional) enables dst-mismatch: a fixed offset +// that is one of ref's two offsets that year, but not the one in effect on +// that date (e.g. UTC+2 in January for Europe/Berlin). Pure. +func ClassifyTZ(a immichapi.AssetResponseDto, ref *time.Location) []string { + tz := assetTZ(a) + switch { + case a.ExifInfo == nil || a.ExifInfo.TimeZone == nil: + return []string{TZClassNone} + case tz == "UTC": + return []string{TZClassUTC} + } + if off, ok := parseFixedOffset(tz); ok { + classes := []string{TZClassOffset} + if ref != nil { + w := wallClockIn(a, ref) + _, want := w.Zone() + _, jan := time.Date(w.Year(), time.January, 1, 12, 0, 0, 0, ref).Zone() + _, jul := time.Date(w.Year(), time.July, 1, 12, 0, 0, 0, ref).Zone() + if off != want && jan != jul && (off == jan || off == jul) { + classes = append(classes, TZClassDSTMismatch) + } + } + return classes + } + classes := []string{TZClassIANA} + if loc, err := time.LoadLocation(tz); err == nil && strings.Contains(tz, "/") { + _, off := a.FileCreatedAt.In(loc).Zone() + if diff := a.LocalDateTime.Sub(a.FileCreatedAt); diff != time.Duration(off)*time.Second { + classes = append(classes, TZClassIANAInconsistent) + } + } + return classes +} + +// TZSetDate returns the dateTimeOriginal to send so the asset keeps its +// wall-clock time but gets loc's offset in effect at that local date/time +// (DST-aware per asset), e.g. "2020-07-15T12:00:00+02:00". It refuses +// assets that already have a zone or have no dateTimeOriginal to anchor to. +func TZSetDate(a immichapi.AssetResponseDto, loc *time.Location) (string, error) { + if tz := assetTZ(a); tz != "" { + return "", fmt.Errorf("already has time zone %s", tz) + } + if a.ExifInfo == nil || a.ExifInfo.DateTimeOriginal == nil { + return "", fmt.Errorf("no dateTimeOriginal to anchor the wall-clock time to") + } + return wallClockIn(a, loc).Format(time.RFC3339Nano), nil +} + +// SearchAssetsWithExif pages through POST /search/metadata with withExif set +// (trash excluded), using body's filter. Each page is reported to progress +// (may be nil) so library-wide scans are not silent. +func SearchAssetsWithExif(ctx context.Context, c *client.Client, body immichapi.MetadataSearchDto, progress func(n int)) ([]immichapi.AssetResponseDto, error) { + withExif, size := true, 1000 + body.WithExif, body.Size = &withExif, &size + var out []immichapi.AssetResponseDto + var pager SearchPager + for { + pager.Apply(&body) + resp, err := SearchExcludingTrash(ctx, c, body) + if err == nil { + err = client.Check(resp, http.StatusOK) + } + if err == nil && resp.JSON200 == nil { + err = fmt.Errorf("response had no body") + } + if err != nil { + return out, fmt.Errorf("POST /search/metadata: %w", err) + } + out = append(out, resp.JSON200.Assets.Items...) + if progress != nil { + progress(len(out)) + } + if !pager.Next(resp.JSON200.Assets) { + return out, nil + } + } +} + +// SplitTZSet separates the assets tz-set may change from the ones it must +// skip (already zoned, or no dateTimeOriginal), with a reason per skip. Pure. +func SplitTZSet(assets []immichapi.AssetResponseDto, loc *time.Location) (todo []immichapi.AssetResponseDto, skips []string) { + for _, a := range assets { + if _, err := TZSetDate(a, loc); err != nil { + skips = append(skips, fmt.Sprintf("%s (%s): %v", a.OriginalFileName, a.Id, err)) + continue + } + todo = append(todo, a) + } + return todo, skips +} + +// SetAssetsTimeZone gives every asset in todo (see SplitTZSet) loc's offset +// via PUT /assets/{id} (dateTimeOriginal with explicit offset), keeping the +// wall-clock time. Continue-on-error; dry-run only prints the plan. +// +// Immich v3.4 stores the result as a fixed offset (e.g. "UTC+2"): the +// sidecar-write → metadata re-extraction roundtrip replaces any IANA name +// with the offset written to the XMP sidecar (verified on a staging server). +func SetAssetsTimeZone(ctx context.Context, c *client.Client, todo []immichapi.AssetResponseDto, loc *time.Location, dryRun bool) (changed int, err error) { + progress := NewProgress(len(todo)) + err = RunBatch(todo, + func(a immichapi.AssetResponseDto) string { return a.OriginalFileName }, + func(a immichapi.AssetResponseDto) error { + if !dryRun { + progress.Step(a.OriginalFileName) + } + d, err := TZSetDate(a, loc) + if err != nil { + return err + } + steps := []Step{{ + Name: fmt.Sprintf("Set dateTimeOriginal %s (%s, wall clock %s unchanged)", d, loc, a.LocalDateTime.UTC().Format("2006-01-02 15:04:05")), + Run: func(ctx context.Context) error { + resp, err := c.API.UpdateAssetWithResponse(ctx, a.Id, immichapi.UpdateAssetDto{DateTimeOriginal: &d}) + if err == nil { + err = client.Check(resp, http.StatusOK) + } + return err + }, + }} + if err := RunSteps(ctx, RunOptions{DryRun: dryRun}, a.OriginalFileName, steps); err != nil { + return err + } + changed++ + return nil + }, + ) + return changed, err +} diff --git a/internal/workflows/timezone_test.go b/internal/workflows/timezone_test.go new file mode 100644 index 0000000..dd387a4 --- /dev/null +++ b/internal/workflows/timezone_test.go @@ -0,0 +1,115 @@ +package workflows + +import ( + "slices" + "testing" + "time" + + "github.com/dhcgn/immich-admin-cli/internal/immichapi" +) + +// tzAsset builds an asset with the given zone (nil = none), wall clock and +// UTC offset between localDateTime and fileCreatedAt. +func tzAsset(tz *string, wall string, offset time.Duration) immichapi.AssetResponseDto { + l, _ := time.Parse(time.RFC3339, wall) + dto := l.Add(-offset) + return immichapi.AssetResponseDto{ + OriginalFileName: "x.jpg", + LocalDateTime: l, + FileCreatedAt: l.Add(-offset), + ExifInfo: &immichapi.ExifResponseDto{TimeZone: tz, DateTimeOriginal: &dto}, + } +} + +//go:fix inline +func sp(s string) *string { return new(s) } + +func TestParseFixedOffset(t *testing.T) { + for in, want := range map[string]int{"UTC+2": 7200, "UTC-5": -18000, "UTC+5:30": 19800, "UTC+0": 0, "UTC-03:30": -12600} { + if got, ok := parseFixedOffset(in); !ok || got != want { + t.Errorf("parseFixedOffset(%q) = %d, %v; want %d", in, got, ok, want) + } + } + for _, in := range []string{"UTC", "Europe/Berlin", "UTC+", "GMT+1"} { + if _, ok := parseFixedOffset(in); ok { + t.Errorf("parseFixedOffset(%q) accepted", in) + } + } +} + +func TestClassifyTZ(t *testing.T) { + berlin, _ := time.LoadLocation("Europe/Berlin") + h := time.Hour + cases := []struct { + name string + a immichapi.AssetResponseDto + ref bool + want []string + }{ + {"none", tzAsset(nil, "2005-06-01T12:00:00Z", 0), true, []string{TZClassNone}}, + {"utc", tzAsset(new("UTC"), "2005-06-01T12:00:00Z", 0), true, []string{TZClassUTC}}, + {"offset ok summer", tzAsset(new("UTC+2"), "2024-07-01T12:00:00Z", 2*h), true, []string{TZClassOffset}}, + {"dst winter with summer offset", tzAsset(new("UTC+2"), "2024-01-10T12:00:00Z", 2*h), true, []string{TZClassOffset, TZClassDSTMismatch}}, + {"dst summer with winter offset", tzAsset(new("UTC+1"), "2024-07-10T12:00:00Z", 1*h), true, []string{TZClassOffset, TZClassDSTMismatch}}, + {"foreign offset not a dst mismatch", tzAsset(new("UTC-5"), "2024-01-10T12:00:00Z", -5*h), true, []string{TZClassOffset}}, + {"no ref no dst class", tzAsset(new("UTC+2"), "2024-01-10T12:00:00Z", 2*h), false, []string{TZClassOffset}}, + {"iana consistent", tzAsset(new("Europe/Berlin"), "2024-07-01T12:00:00Z", 2*h), true, []string{TZClassIANA}}, + {"iana inconsistent", tzAsset(new("Europe/Berlin"), "2024-07-01T12:00:00Z", 0), true, []string{TZClassIANA, TZClassIANAInconsistent}}, + {"no exif", immichapi.AssetResponseDto{}, true, []string{TZClassNone}}, + } + for _, c := range cases { + var ref *time.Location + if c.ref { + ref = berlin + } + if got := ClassifyTZ(c.a, ref); !slices.Equal(got, c.want) { + t.Errorf("%s: ClassifyTZ = %v, want %v", c.name, got, c.want) + } + } +} + +func TestTZSetDateKeepsWallClockAcrossDST(t *testing.T) { + berlin, _ := LoadIANAZone("Europe/Berlin") + for wall, want := range map[string]string{ + "2020-07-15T12:00:00Z": "2020-07-15T12:00:00+02:00", + "2020-01-15T12:00:00Z": "2020-01-15T12:00:00+01:00", + "2020-03-29T03:30:00Z": "2020-03-29T03:30:00+02:00", // right after spring-forward + "2020-07-15T12:00:00.08Z": "2020-07-15T12:00:00.08+02:00", + "1983-05-01T08:15:00Z": "1983-05-01T08:15:00+02:00", + "1979-05-01T08:15:00Z": "1979-05-01T08:15:00+01:00", // no DST in West Germany before 1980 + } { + got, err := TZSetDate(tzAsset(nil, wall, 0), berlin) + if err != nil || got != want { + t.Errorf("TZSetDate(%s) = %q, %v; want %q", wall, got, err, want) + } + } +} + +func TestSplitTZSetNeverTouchesZonedOrUndatedAssets(t *testing.T) { + berlin, _ := LoadIANAZone("Europe/Berlin") + undated := tzAsset(nil, "2020-01-01T00:00:00Z", 0) + undated.ExifInfo.DateTimeOriginal = nil + todo, skips := SplitTZSet([]immichapi.AssetResponseDto{ + tzAsset(nil, "2020-01-01T00:00:00Z", 0), + tzAsset(new("UTC"), "2020-01-01T00:00:00Z", 0), + tzAsset(new("UTC+1"), "2020-01-01T00:00:00Z", time.Hour), + undated, + {OriginalFileName: "noexif.jpg"}, + }, berlin) + if len(todo) != 1 || len(skips) != 4 { + t.Fatalf("todo=%d skips=%d (%v), want 1 and 4", len(todo), len(skips), skips) + } +} + +func TestLoadIANAZone(t *testing.T) { + for _, ok := range []string{"Europe/Berlin", "America/Chicago", "UTC"} { + if _, err := LoadIANAZone(ok); err != nil { + t.Errorf("LoadIANAZone(%q): %v", ok, err) + } + } + for _, bad := range []string{"", "Local", "UTC+1", "Europe/Nowhere", "CEST"} { + if _, err := LoadIANAZone(bad); err == nil { + t.Errorf("LoadIANAZone(%q) accepted", bad) + } + } +}