Skip to content

Commit afa7761

Browse files
committed
fix(backups): update routes to snapshots
1 parent 0b4d9fc commit afa7761

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

.changeset/lovely-nails-prove.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@squarecloud/api": patch
3+
---
4+
5+
Update backups routes to snapshots

src/lib/routes.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ export const Routes = {
3939
commit: (appId: string) => {
4040
return Route<"apps/commit">(`apps/${appId}/commit`);
4141
},
42-
backups: (appId: string) => {
43-
return Route<"apps/backups">(`apps/${appId}/backups`);
42+
snapshots: (appId: string) => {
43+
return Route<"apps/snapshots">(`apps/${appId}/snapshots`);
4444
},
45-
generateBackup: (appId: string) => {
46-
return Route<"apps/generate-backup">(`apps/${appId}/backups`);
45+
generateSnapshot: (appId: string) => {
46+
return Route<"apps/generate-snapshot">(`apps/${appId}/snapshots`);
4747
},
4848
start: (appId: string) => {
4949
return Route<"apps/start">(`apps/${appId}/start`);

src/modules/backups.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class BackupsModule {
1212
*/
1313
async list(): Promise<Backup[]> {
1414
const data = await this.application.client.api.request(
15-
Routes.apps.backups(this.application.id),
15+
Routes.apps.snapshots(this.application.id),
1616
);
1717

1818
const backups = data.response.map(
@@ -36,7 +36,7 @@ export class BackupsModule {
3636
*/
3737
async create(): Promise<RESTPostAPIApplicationBackupResult> {
3838
const data = await this.application.client.api.request(
39-
Routes.apps.generateBackup(this.application.id),
39+
Routes.apps.generateSnapshot(this.application.id),
4040
{ method: "POST" },
4141
);
4242

src/structures/backup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class Backup {
3939
this.modifiedAt = new Date(modified);
4040
this.modifiedTimestamp = this.modifiedAt.getTime();
4141
this.key = key;
42-
this.url = `https://backups.squarecloud.app/${userId}_${name}.zip?${key}`;
42+
this.url = `https://snapshots.squarecloud.app/applications/${userId}/${name}.zip?${key}`;
4343
}
4444

4545
/**

src/types/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ export interface APIEndpoints {
5151
"apps/logs": {
5252
response: APIApplicationLogs;
5353
};
54-
"apps/backups": {
54+
"apps/snapshots": {
5555
response: APIApplicationBackup[];
5656
};
57-
"apps/generate-backup": {
57+
"apps/generate-snapshot": {
5858
method: "POST";
5959
response: RESTPostAPIApplicationBackupResult;
6060
};

0 commit comments

Comments
 (0)