diff --git a/.yarn/cache/@mittwald-api-client-commons-npm-4.430.0-70bb458241-3e3a563c3a.zip b/.yarn/cache/@mittwald-api-client-commons-npm-4.436.0-9b050290d3-4996448145.zip similarity index 88% rename from .yarn/cache/@mittwald-api-client-commons-npm-4.430.0-70bb458241-3e3a563c3a.zip rename to .yarn/cache/@mittwald-api-client-commons-npm-4.436.0-9b050290d3-4996448145.zip index b9763e3f2..85552deb2 100644 Binary files a/.yarn/cache/@mittwald-api-client-commons-npm-4.430.0-70bb458241-3e3a563c3a.zip and b/.yarn/cache/@mittwald-api-client-commons-npm-4.436.0-9b050290d3-4996448145.zip differ diff --git a/.yarn/cache/@mittwald-api-client-npm-4.430.0-41134e9036-3645b95caa.zip b/.yarn/cache/@mittwald-api-client-npm-4.430.0-41134e9036-3645b95caa.zip deleted file mode 100644 index c977b450b..000000000 Binary files a/.yarn/cache/@mittwald-api-client-npm-4.430.0-41134e9036-3645b95caa.zip and /dev/null differ diff --git a/.yarn/cache/@mittwald-api-client-npm-4.436.0-d8ff25010b-5cffe9f29c.zip b/.yarn/cache/@mittwald-api-client-npm-4.436.0-d8ff25010b-5cffe9f29c.zip new file mode 100644 index 000000000..75dd7a22e Binary files /dev/null and b/.yarn/cache/@mittwald-api-client-npm-4.436.0-d8ff25010b-5cffe9f29c.zip differ diff --git a/CLAUDE.md b/CLAUDE.md index 4405f11f4..04dbffa81 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -82,6 +82,19 @@ providers: - Uses `@mittwald/api-client` for API communication - Automatic retry logic and consistency handling - Authentication via API tokens (file, environment, or flag) +- **Only ever call the API through the methods that `@mittwald/api-client` + generates.** Never hand-roll API calls (for example via `apiClient.axios`, + `fetch` or a hand-written operation descriptor), and never re-implement an + operation the client no longer exposes. +- When a client method disappears after an `@mittwald/api-client` bump, the + underlying operation was deprecated in the OpenAPI spec and dropped from code + generation. Do not work around this — find the successor operation the spec + points to and use it. The replacement is frequently a property on a regular + resource endpoint rather than a like-for-like operation. For instance, + `app-link-database` and `app-replace-database` were superseded by the + `databases` property of `app.patchAppinstallation`. Searching the spec for + paths containing the resource name will miss such successors; check the + resource's own `PATCH` endpoint too. ## Coding hints diff --git a/src/commands/app/database/link.tsx b/src/commands/app/database/link.tsx index 927c623cf..4303516a1 100644 --- a/src/commands/app/database/link.tsx +++ b/src/commands/app/database/link.tsx @@ -71,13 +71,16 @@ export default class Link extends ExecRenderBaseCommand { }); await process.runStep("linking database", async () => { - const response = await this.apiClient.app.linkDatabase({ + const response = await this.apiClient.app.patchAppinstallation({ appInstallationId, data: { - databaseId, - purpose: purpose as "primary" | "cache" | "custom", - databaseUserIds: { - admin: adminUserId, + databases: { + [databaseId]: { + purpose: purpose as "primary" | "cache" | "custom", + databaseUserIds: { + admin: adminUserId, + }, + }, }, }, }); diff --git a/src/commands/app/database/replace.tsx b/src/commands/app/database/replace.tsx index a77e02683..2c9b2e148 100644 --- a/src/commands/app/database/replace.tsx +++ b/src/commands/app/database/replace.tsx @@ -87,13 +87,16 @@ export default class Replace extends ExecRenderBaseCommand< ); await process.runStep("replacing database", async () => { - const response = await this.apiClient.app.replaceDatabase({ + const response = await this.apiClient.app.patchAppinstallation({ appInstallationId, data: { - oldDatabaseId, - newDatabaseId, - databaseUserIds: { - admin: adminUserId, + databases: { + [newDatabaseId]: { + replacesDatabaseId: oldDatabaseId, + databaseUserIds: { + admin: adminUserId, + }, + }, }, }, }); diff --git a/yarn.lock b/yarn.lock index dd7e76265..cd6b046ff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1870,9 +1870,9 @@ __metadata: languageName: node linkType: hard -"@mittwald/api-client-commons@npm:^4.430.0": - version: 4.430.0 - resolution: "@mittwald/api-client-commons@npm:4.430.0" +"@mittwald/api-client-commons@npm:^4.436.0": + version: 4.436.0 + resolution: "@mittwald/api-client-commons@npm:4.436.0" dependencies: "@types/parse-path": ^7.0.3 axios: ^1.15.2 @@ -1886,22 +1886,22 @@ __metadata: optional: true "@mittwald/react-use-promise": optional: true - checksum: 3e3a563c3a4de7e99ed0d3950280b1a5e7bcb878365dafbf2361c9db1caddabd7d1751be57269daa47170b6c171d560faee9666b9c8c79946fb4c76da5d7a16f + checksum: 499644814517aa12fc2d13ef87de6433236da0057b2aeebb3b60ca66b0ce347989fba39aa971085fd4ec7502f9ff455dd214fda312e0770c82370b1ef1250b98 languageName: node linkType: hard "@mittwald/api-client@npm:^4.400.0": - version: 4.430.0 - resolution: "@mittwald/api-client@npm:4.430.0" + version: 4.436.0 + resolution: "@mittwald/api-client@npm:4.436.0" dependencies: - "@mittwald/api-client-commons": ^4.430.0 + "@mittwald/api-client-commons": ^4.436.0 browser-or-node: ^3.0.0 peerDependencies: "@mittwald/react-use-promise": ^2.6.0 peerDependenciesMeta: "@mittwald/react-use-promise": optional: true - checksum: 3645b95caad1129d4961b779dc0c99f687143f9db249d2a96768a1fae1632a50625f7cb62bf3fca4797f1d897e6f52915c66cfa9473e1f0a31a1e789f9bf78bc + checksum: 5cffe9f29c6899115ae92750aa7d1d85785ce82030068129364e0484893fd0f8fd612b8f8c20eda653f924f9569df1a26872d80cb054ad22d214111bc4358c00 languageName: node linkType: hard