Skip to content

Commit 35808ed

Browse files
committed
fix: esolve merge conflucts
1 parent 7c26748 commit 35808ed

File tree

13 files changed

+166
-143
lines changed

13 files changed

+166
-143
lines changed

bun.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"dependencies": {
2222
"@ai-sdk/svelte": "^1.1.24",
23-
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@67539a6",
23+
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@f063676",
2424
"@appwrite.io/pink-icons": "0.25.0",
2525
"@appwrite.io/pink-icons-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@bfe7ce3",
2626
"@appwrite.io/pink-legacy": "^1.0.3",

src/lib/stores/project-services.ts

Lines changed: 96 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,114 @@
11
import { writable } from 'svelte/store';
2-
import { ApiService, type Models } from '@appwrite.io/console';
2+
import { ServiceId, type Models } from '@appwrite.io/console';
33

44
export type Service = {
55
label: string;
6-
method: ApiService;
6+
method: ServiceId;
77
value: boolean | null;
88
};
99

10+
function projectServiceRows(project: Models.Project | null): Service[] {
11+
const rows: Service[] = [
12+
{
13+
label: 'Account',
14+
method: ServiceId.Account,
15+
value: project?.serviceStatusForAccount ?? null
16+
},
17+
{
18+
label: 'Avatars',
19+
method: ServiceId.Avatars,
20+
value: project?.serviceStatusForAvatars ?? null
21+
},
22+
{
23+
label: 'Databases',
24+
method: ServiceId.Databases,
25+
value: project?.serviceStatusForDatabases ?? null
26+
},
27+
{
28+
label: 'Functions',
29+
method: ServiceId.Functions,
30+
value: project?.serviceStatusForFunctions ?? null
31+
},
32+
{
33+
label: 'GraphQL',
34+
method: ServiceId.Graphql,
35+
value: project?.serviceStatusForGraphql ?? null
36+
},
37+
{
38+
label: 'Health',
39+
method: ServiceId.Health,
40+
value: project?.serviceStatusForHealth ?? null
41+
},
42+
{
43+
label: 'Locale',
44+
method: ServiceId.Locale,
45+
value: project?.serviceStatusForLocale ?? null
46+
},
47+
{
48+
label: 'Messaging',
49+
method: ServiceId.Messaging,
50+
value: project?.serviceStatusForMessaging ?? null
51+
},
52+
{
53+
label: 'Migrations',
54+
method: ServiceId.Migrations,
55+
value: project?.serviceStatusForMigrations ?? null
56+
},
57+
{
58+
label: 'Project',
59+
method: ServiceId.Project,
60+
value: project?.serviceStatusForProject ?? null
61+
},
62+
{
63+
label: 'Proxy',
64+
method: ServiceId.Proxy,
65+
value: project?.serviceStatusForProxy ?? null
66+
},
67+
{
68+
label: 'Sites',
69+
method: ServiceId.Sites,
70+
value: project?.serviceStatusForSites ?? null
71+
},
72+
{
73+
label: 'Storage',
74+
method: ServiceId.Storage,
75+
value: project?.serviceStatusForStorage ?? null
76+
},
77+
{
78+
label: 'Tables',
79+
method: ServiceId.Tablesdb,
80+
value: project?.serviceStatusForTablesdb ?? null
81+
},
82+
{
83+
label: 'Teams',
84+
method: ServiceId.Teams,
85+
value: project?.serviceStatusForTeams ?? null
86+
},
87+
{
88+
label: 'Users',
89+
method: ServiceId.Users,
90+
value: project?.serviceStatusForUsers ?? null
91+
},
92+
{
93+
label: 'VCS',
94+
method: ServiceId.Vcs,
95+
value: project?.serviceStatusForVcs ?? null
96+
}
97+
];
98+
99+
return rows.sort((a, b) => a.label.localeCompare(b.label));
100+
}
101+
10102
function createServices() {
11103
const { subscribe, set } = writable({
12-
list: [
13-
{ label: 'Account', method: ApiService.Account, value: null },
14-
{ label: 'Avatars', method: ApiService.Avatars, value: null },
15-
{ label: 'Databases', method: ApiService.Databases, value: null },
16-
{ label: 'TablesDB', method: ApiService.Tablesdb, value: null },
17-
{ label: 'Locale', method: ApiService.Locale, value: null },
18-
{ label: 'Health', method: ApiService.Health, value: null },
19-
{ label: 'Storage', method: ApiService.Storage, value: null },
20-
{ label: 'Teams', method: ApiService.Teams, value: null },
21-
{ label: 'Users', method: ApiService.Users, value: null },
22-
{ label: 'Sites', method: ApiService.Sites, value: null },
23-
{ label: 'Functions', method: ApiService.Functions, value: null },
24-
{ label: 'GraphQL', method: ApiService.Graphql, value: null },
25-
{ label: 'Messaging', method: ApiService.Messaging, value: null }
26-
] satisfies Service[]
104+
list: projectServiceRows(null)
27105
});
28106

29107
return {
30108
subscribe,
31109
set,
32110
load: (project: Models.Project) => {
33-
const list: Service[] = [
34-
{
35-
label: 'Account',
36-
method: ApiService.Account,
37-
value: project.serviceStatusForAccount
38-
},
39-
{
40-
label: 'Avatars',
41-
method: ApiService.Avatars,
42-
value: project.serviceStatusForAvatars
43-
},
44-
{
45-
label: 'Databases',
46-
method: ApiService.Databases,
47-
value: project.serviceStatusForDatabases
48-
},
49-
{
50-
label: 'TablesDB',
51-
method: ApiService.Tablesdb,
52-
value: project.serviceStatusForTablesdb
53-
},
54-
{
55-
label: 'Locale',
56-
method: ApiService.Locale,
57-
value: project.serviceStatusForLocale
58-
},
59-
{
60-
label: 'Health',
61-
method: ApiService.Health,
62-
value: project.serviceStatusForHealth
63-
},
64-
{
65-
label: 'Storage',
66-
method: ApiService.Storage,
67-
value: project.serviceStatusForStorage
68-
},
69-
{
70-
label: 'Teams',
71-
method: ApiService.Teams,
72-
value: project.serviceStatusForTeams
73-
},
74-
{
75-
label: 'Users',
76-
method: ApiService.Users,
77-
value: project.serviceStatusForUsers
78-
},
79-
{
80-
label: 'Sites',
81-
method: ApiService.Sites,
82-
value: project.serviceStatusForSites
83-
},
84-
{
85-
label: 'Functions',
86-
method: ApiService.Functions,
87-
value: project.serviceStatusForFunctions
88-
},
89-
{
90-
label: 'GraphQL',
91-
method: ApiService.Graphql,
92-
value: project.serviceStatusForGraphql
93-
},
94-
{
95-
label: 'Messaging',
96-
method: ApiService.Messaging,
97-
value: project.serviceStatusForMessaging
98-
}
99-
];
100-
set({ list });
111+
set({ list: projectServiceRows(project) });
101112
}
102113
};
103114
}

src/routes/(console)/project-[region]-[project]/settings/updateServices.svelte

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
import { project } from '../store';
1111
import Button from '$lib/elements/forms/button.svelte';
1212
import { Dialog, Divider, Layout, Spinner } from '@appwrite.io/pink-svelte';
13-
import type { ApiService } from '@appwrite.io/console';
13+
import type { ServiceId } from '@appwrite.io/console';
14+
import { get } from 'svelte/store';
1415
1516
import { SvelteSet } from 'svelte/reactivity';
1617
1718
let isUpdatingAllServices = $state(false);
1819
let showUpdateServiceDialog = $state(false);
1920
let updateServicesEnabledMode = $state<boolean | null>(null);
2021
21-
let apiServiceUpdates = new SvelteSet<ApiService>();
22+
let apiServiceUpdates = new SvelteSet<ServiceId>();
2223
2324
const isAnyServiceUpdating = $derived(apiServiceUpdates.size > 0);
2425
const isAnyUpdateInProgress = $derived(isUpdatingAllServices || isAnyServiceUpdating);
@@ -41,10 +42,9 @@
4142
apiServiceUpdates.add(service.method);
4243
4344
try {
44-
await sdk.forConsoleIn($project.region).projects.updateServiceStatus({
45-
projectId: $project.$id,
46-
service: service.method,
47-
status: service.value
45+
await sdk.forProject($project.region, $project.$id).project.updateServiceStatus({
46+
serviceId: service.method,
47+
enabled: service.value
4848
});
4949
5050
await invalidate(Dependencies.PROJECT);
@@ -74,10 +74,14 @@
7474
isUpdatingAllServices = true;
7575
7676
try {
77-
await sdk.forConsoleIn($project.region).projects.updateServiceStatusAll({
78-
projectId: $project.$id,
79-
status
80-
});
77+
const projectSdk = sdk.forProject($project.region, $project.$id);
78+
for (const s of get(services).list) {
79+
if (s.value === status) continue;
80+
await projectSdk.project.updateServiceStatus({
81+
serviceId: s.method,
82+
enabled: status
83+
});
84+
}
8185
8286
await invalidate(Dependencies.PROJECT);
8387

src/routes/(console)/project-[region]-[project]/settings/webhooks/[webhook]/details.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
name: $webhook.name,
3131
events: $webhook.events,
3232
url: $webhook.url,
33-
security: $webhook.security,
33+
tls: $webhook.tls,
3434
enabled,
35-
httpUser: $webhook.httpUser || undefined,
36-
httpPass: $webhook.httpPass || undefined
35+
authUsername: $webhook.authUsername || undefined,
36+
authPassword: $webhook.authPassword || undefined
3737
});
3838
await invalidate(Dependencies.WEBHOOK);
3939
addNotification({

src/routes/(console)/project-[region]-[project]/settings/webhooks/[webhook]/regenerate.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1414
async function regenerate() {
1515
try {
16-
await sdk.forProject(page.params.region, projectId).webhooks.updateSignature({
16+
await sdk.forProject(page.params.region, projectId).webhooks.updateSecret({
1717
webhookId: $webhook.$id
1818
});
1919
await invalidate(Dependencies.WEBHOOK);

src/routes/(console)/project-[region]-[project]/settings/webhooks/[webhook]/updateEvents.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
name: $webhook.name,
3232
events: Array.from($eventSet),
3333
url: $webhook.url,
34-
security: $webhook.security,
34+
tls: $webhook.tls,
3535
enabled: true,
36-
httpUser: $webhook.httpUser || undefined,
37-
httpPass: $webhook.httpPass || undefined
36+
authUsername: $webhook.authUsername || undefined,
37+
authPassword: $webhook.authPassword || undefined
3838
});
3939
await invalidate(Dependencies.WEBHOOK);
4040
areEventsDisabled = true;

src/routes/(console)/project-[region]-[project]/settings/webhooks/[webhook]/updateName.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
name,
2525
events: $webhook.events,
2626
url: $webhook.url,
27-
security: $webhook.security,
27+
tls: $webhook.tls,
2828
enabled: true,
29-
httpUser: $webhook.httpUser || undefined,
30-
httpPass: $webhook.httpPass || undefined
29+
authUsername: $webhook.authUsername || undefined,
30+
authPassword: $webhook.authPassword || undefined
3131
});
3232
3333
await invalidate(Dependencies.WEBHOOK);

0 commit comments

Comments
 (0)