Skip to content

Commit 9d55a66

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat-documentsdb
# Conflicts: # bun.lock # package.json # src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/editRelated.svelte # src/routes/(console)/project-[region]-[project]/settings/updateLabels.svelte
2 parents e9a4aa9 + b2c12f8 commit 9d55a66

File tree

82 files changed

+1800
-1353
lines changed

Some content is hidden

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

82 files changed

+1800
-1353
lines changed

bun.lock

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
},
2121
"dependencies": {
2222
"@ai-sdk/svelte": "^1.1.24",
23-
"@appwrite.io/console": "github:appwrite/sdk-for-console#d27fbd5",
23+
"@appwrite.io/console": "github:appwrite/sdk-for-console#vector-db-sdk",
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",
27-
"@appwrite.io/pink-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@bfe7ce3",
27+
"@appwrite.io/pink-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@8dcaa17",
2828
"@codemirror/autocomplete": "^6.19.0",
2929
"@codemirror/commands": "^6.9.0",
3030
"@codemirror/lang-javascript": "^6.2.4",
@@ -68,7 +68,7 @@
6868
"@melt-ui/svelte": "^0.86.6",
6969
"@playwright/test": "^1.58.2",
7070
"@sveltejs/adapter-static": "^3.0.10",
71-
"@sveltejs/kit": "^2.55.0",
71+
"@sveltejs/kit": "^2.57.1",
7272
"@sveltejs/vite-plugin-svelte": "^5.1.1",
7373
"@testing-library/dom": "^10.4.1",
7474
"@testing-library/jest-dom": "^6.9.1",

pnpm-lock.yaml

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

src/lib/actions/analytics.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,8 @@ export enum Submit {
443443
MessagingTopicSubscriberDelete = 'submit_messaging_topic_subscriber_delete',
444444
ApplyQuickFilter = 'submit_apply_quick_filter',
445445
RequestBAA = 'submit_request_baa',
446+
BAAAddonEnable = 'submit_baa_addon_enable',
447+
BAAAddonDisable = 'submit_baa_addon_disable',
446448
RequestSoc2 = 'submit_request_soc2',
447449
SiteCreate = 'submit_site_create',
448450
SiteDelete = 'submit_site_delete',

src/lib/components/billing/alerts/realtimePricing.svelte

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@
1616
}
1717
}
1818
19-
$: href = $currentPlan?.usagePerProject
20-
? `${base}/organization-${$organization.$id}/billing`
21-
: `${base}/organization-${$organization.$id}/usage`;
19+
// Guard org id: this reactive runs even when the {#if} below is false, so optional
20+
// chaining on $currentPlan alone is not enough — $organization can be undefined.
21+
$: orgId = $organization?.$id;
22+
$: href = orgId
23+
? $currentPlan?.usagePerProject
24+
? `${base}/organization-${orgId}/billing`
25+
: `${base}/organization-${orgId}/usage`
26+
: '';
2227
</script>
2328

2429
{#if $organization?.$id && !dismissed}

src/lib/components/billing/planComparisonBox.svelte

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@
8686
{formatNum(currentPlan.executions)} executions
8787
</span>
8888
</li>
89+
{#if currentPlan.domains > 0}
90+
<li class="list-item u-gap-4 u-cross-center">
91+
<span class="icon-arrow-down u-color-text-danger" aria-hidden="true"></span>
92+
<span class="text">
93+
Limited to {currentPlan.domains} custom {pluralize(
94+
currentPlan.domains,
95+
'domain'
96+
)}
97+
per project
98+
</span>
99+
</li>
100+
{/if}
89101
</ul>
90102
{:else}
91103
<ul class="un-order-list">
@@ -105,12 +117,22 @@
105117
<li>
106118
Limited to {formatNum(currentPlan.executions)} executions
107119
</li>
120+
{#if currentPlan.domains > 0}
121+
<li>
122+
Limited to {currentPlan.domains} custom {pluralize(
123+
currentPlan.domains,
124+
'domain'
125+
)} per project
126+
</li>
127+
{:else}
128+
<li>Unlimited custom domains</li>
129+
{/if}
108130
</ul>
109131
{/if}
110132
{:else if planHasGroup(selectedTab, BillingPlanGroup.Pro)}
111133
<Typography.Text>Everything in the Free plan, plus:</Typography.Text>
112134
<ul class="un-order-list">
113-
<li>Unlimited databases, buckets, functions</li>
135+
<li>Unlimited databases, buckets, functions, and custom domains</li>
114136
<li>Unlimited seats</li>
115137
<li>{currentPlan.bandwidth}GB bandwidth</li>
116138
<li>{currentPlan.storage}GB storage</li>

src/lib/components/filePicker.svelte

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import { Button, InputSelect } from '$lib/elements/forms';
1010
import DualTimeView from './dualTimeView.svelte';
1111
import type { Models } from '@appwrite.io/console';
12-
import { calculateSize } from '$lib/helpers/sizeConvertion';
12+
import { calculateSize, humanFileSize, sizeToBytes } from '$lib/helpers/sizeConvertion';
1313
import InputSearch from '$lib/elements/forms/inputSearch.svelte';
1414
import { ID, Query, Permission, Role } from '@appwrite.io/console';
1515
import {
@@ -34,6 +34,8 @@
3434
import { showCreateBucket } from '$routes/(console)/project-[region]-[project]/storage/+page.svelte';
3535
import { preferences } from '$lib/stores/preferences';
3636
import { addNotification } from '$lib/stores/notifications';
37+
import { isCloud } from '$lib/system';
38+
import { currentPlan } from '$lib/stores/organization';
3739
3840
export let show: boolean;
3941
export let mimeTypeQuery: string = 'image/';
@@ -52,7 +54,12 @@
5254
let searchEnabled = false;
5355
let fileSelector: HTMLInputElement;
5456
let uploading = false;
57+
let uploadProgress = 0;
5558
let view: 'grid' | 'list' = 'list';
59+
$: planMaxSize =
60+
isCloud && $currentPlan?.['fileSize']
61+
? sizeToBytes($currentPlan['fileSize'], 'MB', 1000)
62+
: null;
5663
5764
onMount(() => {
5865
const lastSelectedBucket = preferences.getKey('lastSelectedBucket', null);
@@ -91,12 +98,17 @@
9198
async function uploadFile() {
9299
try {
93100
uploading = true;
101+
uploadProgress = 0;
94102
let file = null;
103+
95104
if (localFileBucketSelected) {
96105
file = await sdk.forConsoleIn(page.params.region).storage.createFile({
97106
bucketId: 'default',
98107
fileId: ID.unique(),
99-
file: localFile[0]
108+
file: localFile[0],
109+
onProgress: (progress) => {
110+
uploadProgress = progress.progress;
111+
}
100112
});
101113
} else {
102114
file = await sdk
@@ -105,7 +117,10 @@
105117
bucketId: selectedBucket,
106118
fileId: ID.unique(),
107119
file: fileSelector.files[0],
108-
permissions: [Permission.read(Role.any())]
120+
permissions: [Permission.read(Role.any())],
121+
onProgress: (progress) => {
122+
uploadProgress = progress.progress;
123+
}
109124
});
110125
search.set($search === null ? '' : null);
111126
}
@@ -117,6 +132,7 @@
117132
});
118133
} finally {
119134
uploading = false;
135+
uploadProgress = 0;
120136
}
121137
}
122138
@@ -240,7 +256,7 @@
240256
<svelte:document on:visibilitychange={handleVisibilityChange} />
241257

242258
<Form {onSubmit} isModal class="file-picker-modal-form">
243-
<Modal bind:open={show} title="Select file" size="l">
259+
<Modal bind:open={show} title="Select file" size="l" dismissible={!uploading}>
244260
<Layout.Stack direction={$isSmallViewport ? 'column' : 'row'} height="50vh" gap="none">
245261
<!-- min-width to avoid a layout-shift -->
246262
<aside>
@@ -366,7 +382,7 @@
366382
direction="row"
367383
gap="s">
368384
<Typography.Text variant="l-500">
369-
Drag and drop files here or click to upload
385+
Drag and drop a file here or click to upload
370386
</Typography.Text>
371387
<Tooltip>
372388
<Layout.Stack
@@ -381,8 +397,12 @@
381397
: `${allowedExtension} files are allowed`}</svelte:fragment>
382398
</Tooltip>
383399
</Layout.Stack>
384-
<Typography.Caption variant="400"
385-
>Max file size: 10MB</Typography.Caption>
400+
{#if planMaxSize}
401+
{@const readableMaxSize = humanFileSize(planMaxSize)}
402+
<Typography.Caption variant="400"
403+
>Max file size: {readableMaxSize.value +
404+
readableMaxSize.unit}</Typography.Caption>
405+
{/if}
386406
</Layout.Stack>
387407
</Layout.Stack>
388408
</Upload.Dropzone>
@@ -418,7 +438,10 @@
418438
bind:this={fileSelector} />
419439
{#if uploading}
420440
<div class="loader is-small"></div>
421-
<span>Uploading</span>
441+
<span
442+
>Uploading{uploadProgress > 0
443+
? ` ${uploadProgress}%`
444+
: ''}</span>
422445
{:else}
423446
<span class="icon-upload" aria-hidden="true"></span>
424447
<span>Upload</span>
@@ -701,12 +724,18 @@
701724
</Layout.Stack>
702725
<svelte:fragment slot="footer">
703726
<Layout.Stack direction="row" justifyContent="flex-end">
704-
<Button text on:click={closeModal}>Cancel</Button>
727+
<Button text disabled={uploading} on:click={closeModal}>Cancel</Button>
705728
<Button
706729
submit
707-
disabled={(selectedBucket === null && localFileBucketSelected === false) ||
708-
(selectedFile === null && localFile === null)}
709-
>Select
730+
disabled={uploading ||
731+
(selectedBucket === null && localFileBucketSelected === false) ||
732+
(selectedFile === null && localFile === null)}>
733+
{#if uploading}
734+
<div class="loader is-small"></div>
735+
<span>Uploading{uploadProgress > 0 ? ` ${uploadProgress}%` : ''}</span>
736+
{:else}
737+
Select
738+
{/if}
710739
</Button>
711740
</Layout.Stack>
712741
</svelte:fragment>

src/lib/components/uploadBox.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
return {
1010
name: file.name,
1111
size: file.size,
12-
status: file.status
12+
status: file.status,
13+
progress: file.progress
1314
};
1415
})}
1516
on:close={() => uploader.close()} />

src/lib/components/variables/importVariablesModal.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<Layout.Stack alignItems="center" gap="s">
6565
<Layout.Stack alignItems="center" justifyContent="center" inline>
6666
<Typography.Text variant="l-500" align="center" inline>
67-
Drag and drop files here or click to upload
67+
Drag and drop a file here or click to upload
6868
<Layout.Stack
6969
style="display: inline-flex; vertical-align: middle;"
7070
inline

src/lib/constants.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ export enum Dependencies {
8888
MESSAGING_TOPIC_SUBSCRIBERS = 'dependency:messaging_topic_subscribers',
8989
SITE = 'dependency:site',
9090
SITES = 'dependency:sites',
91-
SITES_DOMAINS = 'dependency:sites_domains'
91+
SITES_DOMAINS = 'dependency:sites_domains',
92+
ADDONS = 'dependency:addons'
9293
}
9394

9495
export const defaultScopes: string[] = [
@@ -475,6 +476,30 @@ export const scopes: ScopeDefinition[] = [
475476
description: "Access to delete your site's logs",
476477
category: 'Sites',
477478
icon: 'globe'
479+
},
480+
{
481+
scope: 'webhooks.read',
482+
description: "Access to read your project's webhooks",
483+
category: 'Other',
484+
icon: 'globe'
485+
},
486+
{
487+
scope: 'webhooks.write',
488+
description: "Access to create, update, and delete your project's webhooks",
489+
category: 'Other',
490+
icon: 'globe'
491+
},
492+
{
493+
scope: 'keys.read',
494+
description: "Access to read your project's API keys",
495+
category: 'Other',
496+
icon: 'globe'
497+
},
498+
{
499+
scope: 'keys.write',
500+
description: "Access to create, update, and delete your project's API keys",
501+
category: 'Other',
502+
icon: 'globe'
478503
}
479504
];
480505

0 commit comments

Comments
 (0)