Skip to content

Commit 21aefc0

Browse files
committed
feat: add OAuth2 server settings card
- New updateOAuth2Server.svelte card in project settings - Enable/disable toggle, authorization URL, scopes, per-client token durations with unit selectors, PKCE enforcement - min={1} on all duration inputs, scopes sent directly to allow clearing - Add ProjectUpdateOAuth2Server analytics event Note: awaiting SDK with updateOAuth2Server method and correct enum names
1 parent 0c60e17 commit 21aefc0

57 files changed

Lines changed: 237 additions & 304 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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@81a4f24",
23+
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@35c3dea",
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/domains.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import { RedirectStatusCode } from '@appwrite.io/console';
1+
import { StatusCode } from '@appwrite.io/console';
22

33
export const statusCodeOptions = [
44
{
55
label: '301 Moved permanently',
6-
value: RedirectStatusCode.MovedPermanently
6+
value: StatusCode.MovedPermanently301
77
},
88
{
99
label: '302 Found',
10-
value: RedirectStatusCode.Found
10+
value: StatusCode.Found302
1111
},
1212
{
1313
label: '307 Temporary redirect',
14-
value: RedirectStatusCode.TemporaryRedirect
14+
value: StatusCode.TemporaryRedirect307
1515
},
1616
{
1717
label: '308 Permanent redirect',
18-
value: RedirectStatusCode.PermanentRedirect
18+
value: StatusCode.PermanentRedirect308
1919
}
2020
];
2121

src/routes/(console)/organization-[organization]/settings/+page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { PageLoad } from './$types';
22
import { Dependencies } from '$lib/constants';
33
import { sdk } from '$lib/stores/sdk';
4-
import { OrganizationAddon, Query } from '@appwrite.io/console';
4+
import { Addon, Query } from '@appwrite.io/console';
55
import { isCloud } from '$lib/system';
66
import { redirect } from '@sveltejs/kit';
77
import { resolve } from '$app/paths';
@@ -40,7 +40,7 @@ export const load: PageLoad = async ({ depends, params, parent }) => {
4040
? sdk.forConsole.organizations
4141
.getAddonPrice({
4242
organizationId: params.organization,
43-
addon: OrganizationAddon.Baa
43+
addon: Addon.Baa
4444
})
4545
.catch(() => null)
4646
: null

src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.svelte

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
IconUpload,
3030
IconDownload
3131
} from '@appwrite.io/pink-icons-svelte';
32-
import { MigrationOnDuplicate, type Models } from '@appwrite.io/console';
32+
import { OnDuplicate, type Models } from '@appwrite.io/console';
3333
import { sdk } from '$lib/stores/sdk';
3434
import { goto } from '$app/navigation';
3535
import { resolve } from '$app/paths';
@@ -59,7 +59,7 @@
5959
let showImportJson = $state(false);
6060
let showImportOptions = $state(false);
6161
let showCustomColumnsModal = $state(false);
62-
let importOnDuplicate: MigrationOnDuplicate = $state(MigrationOnDuplicate.Fail);
62+
let importOnDuplicate: OnDuplicate = $state(OnDuplicate.Fail);
6363
let pendingFile: Models.File | null = $state(null);
6464
let pendingLocalFile = $state(false);
6565
@@ -89,7 +89,7 @@
8989
function onSelect(file: Models.File, localFile = false) {
9090
pendingFile = file;
9191
pendingLocalFile = localFile;
92-
importOnDuplicate = MigrationOnDuplicate.Fail;
92+
importOnDuplicate = OnDuplicate.Fail;
9393
showImportOptions = true;
9494
}
9595
@@ -377,7 +377,7 @@
377377
size="s"
378378
bind:group={importOnDuplicate}
379379
name="importOnDuplicate"
380-
value={MigrationOnDuplicate.Fail}
380+
value={OnDuplicate.Fail}
381381
label="Fail on duplicate (default)">
382382
<svelte:fragment slot="description">
383383
Import aborts on the first document with a matching ID.
@@ -387,7 +387,7 @@
387387
size="s"
388388
bind:group={importOnDuplicate}
389389
name="importOnDuplicate"
390-
value={MigrationOnDuplicate.Skip}
390+
value={OnDuplicate.Skip}
391391
label="Skip existing documents">
392392
<svelte:fragment slot="description">
393393
Documents with matching IDs will be silently skipped.
@@ -397,7 +397,7 @@
397397
size="s"
398398
bind:group={importOnDuplicate}
399399
name="importOnDuplicate"
400-
value={MigrationOnDuplicate.Overwrite}
400+
value={OnDuplicate.Overwrite}
401401
label="Overwrite existing documents">
402402
<svelte:fragment slot="description">
403403
Documents with matching IDs will be updated with the imported data.

src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/+page.svelte

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
IconUpload,
4444
IconDownload
4545
} from '@appwrite.io/pink-icons-svelte';
46-
import { MigrationOnDuplicate, type Models } from '@appwrite.io/console';
46+
import { OnDuplicate, type Models } from '@appwrite.io/console';
4747
import CreateRow from '$database/table-[table]/rows/create.svelte';
4848
import { onDestroy } from 'svelte';
4949
import { isCloud } from '$lib/system';
@@ -66,7 +66,7 @@
6666
let isRefreshing = false;
6767
let showImportCSV = false;
6868
let showImportOptions = false;
69-
let importOnDuplicate: MigrationOnDuplicate = MigrationOnDuplicate.Fail;
69+
let importOnDuplicate: OnDuplicate = OnDuplicate.Fail;
7070
let pendingFile: Models.File | null = null;
7171
let pendingLocalFile = false;
7272
@@ -123,7 +123,7 @@
123123
function onSelect(file: Models.File, localFile = false) {
124124
pendingFile = file;
125125
pendingLocalFile = localFile;
126-
importOnDuplicate = MigrationOnDuplicate.Fail;
126+
importOnDuplicate = OnDuplicate.Fail;
127127
showImportOptions = true;
128128
}
129129
@@ -469,7 +469,7 @@
469469
size="s"
470470
bind:group={importOnDuplicate}
471471
name="importOnDuplicate"
472-
value={MigrationOnDuplicate.Fail}
472+
value={OnDuplicate.Fail}
473473
label="Fail on duplicate (default)">
474474
<svelte:fragment slot="description">
475475
Migration aborts on the first row with a matching ID.
@@ -479,7 +479,7 @@
479479
size="s"
480480
bind:group={importOnDuplicate}
481481
name="importOnDuplicate"
482-
value={MigrationOnDuplicate.Skip}
482+
value={OnDuplicate.Skip}
483483
label="Skip existing documents">
484484
<svelte:fragment slot="description">
485485
Documents with matching IDs will be silently skipped.
@@ -489,7 +489,7 @@
489489
size="s"
490490
bind:group={importOnDuplicate}
491491
name="importOnDuplicate"
492-
value={MigrationOnDuplicate.Overwrite}
492+
value={OnDuplicate.Overwrite}
493493
label="Overwrite existing documents">
494494
<svelte:fragment slot="description">
495495
Documents with matching IDs will be updated with the imported data.

src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/aside.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import { Card, SvgIcon } from '$lib/components';
33
import { Icon, Layout, Skeleton, Typography } from '@appwrite.io/pink-svelte';
44
import { IconGithub, IconGitBranch } from '@appwrite.io/pink-icons-svelte';
5-
import type { Models, FunctionRuntime } from '@appwrite.io/console';
5+
import type { Models, Runtime } from '@appwrite.io/console';
66
7-
export let runtime: FunctionRuntime;
7+
export let runtime: Runtime;
88
export let repositoryName: string = undefined;
99
export let branch: string = undefined;
1010
export let rootDir: string = undefined;
@@ -21,7 +21,7 @@
2121
<Layout.Stack gap="l">
2222
{#if selectedRuntime?.name && !loading}
2323
<Layout.Stack gap="xxxs">
24-
<Typography.Caption variant="400">FunctionRuntime</Typography.Caption>
24+
<Typography.Caption variant="400">Runtime</Typography.Caption>
2525
<Layout.Stack gap="xxs" alignItems="center" direction="row">
2626
{#if selectedRuntime?.key}
2727
<SvgIcon iconSize="small" size={16} name={selectedRuntime.key} />

src/routes/(console)/project-[region]-[project]/functions/create-function/(components)/details.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
{:else}
6060
<InputSelect
6161
id="runtime"
62-
label="FunctionRuntime"
62+
label="Runtime"
6363
placeholder="Select runtime"
6464
bind:value={runtime}
6565
required

src/routes/(console)/project-[region]-[project]/functions/create-function/deploy/+page.svelte

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@
1111
import { Fieldset, Layout, Icon, Input, Tag } from '@appwrite.io/pink-svelte';
1212
import { IconGithub, IconPencil } from '@appwrite.io/pink-icons-svelte';
1313
import { onMount } from 'svelte';
14-
import {
15-
ID,
16-
FunctionRuntime,
17-
TemplateReferenceType,
18-
type ProjectKeyScopes
19-
} from '@appwrite.io/console';
14+
import { ID, Runtime, TemplateReferenceType, type Scopes } from '@appwrite.io/console';
2015
import { CustomId } from '$lib/components';
2116
import { getIconFromRuntime } from '$lib/stores/runtimes';
2217
import { regionalConsoleVariables } from '$routes/(console)/project-[region]-[project]/store';
@@ -42,9 +37,9 @@
4237
let execute = $state(true);
4338
let entrypoint = $state('');
4439
let specification = $state('');
45-
let runtime = $state<FunctionRuntime>();
40+
let runtime = $state<Runtime>();
4641
let installCommand = $state('');
47-
let selectedScopes = $state<ProjectKeyScopes[]>([]);
42+
let selectedScopes = $state<Scopes[]>([]);
4843
let rootDir = $state(data.repository?.rootDirectory);
4944
let variables = $state<Array<{ key: string; value: string; secret: boolean }>>([]);
5045
@@ -73,7 +68,7 @@
7368
const runtimeOption = data.runtimesList.runtimes.find(
7469
(runtime) => runtime.$id === runtimeParam
7570
);
76-
runtime = (runtimeOption?.$id ?? data.runtimesList.runtimes[0]?.$id) as FunctionRuntime;
71+
runtime = (runtimeOption?.$id ?? data.runtimesList.runtimes[0]?.$id) as Runtime;
7772
7873
entrypoint = page.url.searchParams.get('entrypoint') || '';
7974
@@ -214,7 +209,7 @@
214209
</Layout.Stack>
215210
<Input.Select
216211
id="runtime"
217-
label="FunctionRuntime"
212+
label="Runtime"
218213
placeholder="Select runtime"
219214
bind:value={runtime}
220215
required

src/routes/(console)/project-[region]-[project]/functions/create-function/manual/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import { sdk } from '$lib/stores/sdk';
1010
import { Icon, Layout, Tooltip, Typography, Upload } from '@appwrite.io/pink-svelte';
1111
import { get, writable } from 'svelte/store';
12-
import { ID, FunctionRuntime } from '@appwrite.io/console';
12+
import { ID, Runtime } from '@appwrite.io/console';
1313
import type { Models } from '@appwrite.io/console';
1414
import Details from '../(components)/details.svelte';
1515
import Aside from '../(components)/aside.svelte';
@@ -57,7 +57,7 @@
5757
5858
let name = '';
5959
let id: string | null = null;
60-
let runtime: FunctionRuntime;
60+
let runtime: Runtime;
6161
let entrypoint = '';
6262
let buildCommand = '';
6363
let roles: string[] = [];

0 commit comments

Comments
 (0)