Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
13 changes: 13 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 8 additions & 5 deletions src/commands/app/database/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,16 @@ export default class Link extends ExecRenderBaseCommand<typeof Link, void> {
});

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,
},
},
},
},
});
Expand Down
13 changes: 8 additions & 5 deletions src/commands/app/database/replace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
},
},
});
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Loading