Skip to content
Draft
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
737 commits
Select commit Hold shift + click to select a range
64e5a79
Merge pull request #2591 from appwrite/disable-buttons
ItzNotABug Nov 12, 2025
fa714ae
tiny
hmacr Nov 12, 2025
32077e3
Update pink deps to a3ac011
TorstenDittmann Nov 12, 2025
337af8f
Update pink-icons-svelte and pink-svelte versions
TorstenDittmann Nov 12, 2025
e02c4e2
Merge pull request #2593 from appwrite/chore-update-pink-design
TorstenDittmann Nov 12, 2025
bd8c9d2
Comment out onNotFound handler in Row
TorstenDittmann Nov 12, 2025
a56be7a
Update permissions.svelte
TorstenDittmann Nov 12, 2025
a8bdb86
Merge pull request #2594 from appwrite/fix-prevent-row-deletion
TorstenDittmann Nov 12, 2025
372b110
fix: prevent duplicate repository connection notifications (#2474)
AbhiVarde Nov 13, 2025
39e9783
fix: input selects.
ItzNotABug Nov 13, 2025
2efea53
Merge branch 'main' into 'fix-input-selects'.
ItzNotABug Nov 13, 2025
3287d5b
Merge pull request #2597 from appwrite/fix-input-selects
ItzNotABug Nov 13, 2025
bf11f29
Merge branch 'main' into hmacr/ser-213
hmacr Nov 13, 2025
5a80c06
lint
hmacr Nov 13, 2025
62cd183
update: add enum support.
ItzNotABug Nov 13, 2025
2d97852
Merge pull request #2598 from appwrite/add-enum-support
abnegate Nov 13, 2025
dbe1fbb
feedback
hmacr Nov 13, 2025
92716d2
else if
hmacr Nov 13, 2025
029c57d
svelte 5
hmacr Nov 13, 2025
acaff6f
Merge pull request #2539 from appwrite/ser-279
ItzNotABug Nov 13, 2025
a6d6223
Merge pull request #2406 from appwrite/hmacr/ser-213
ItzNotABug Nov 13, 2025
4e0649f
Always send email
abnegate Nov 14, 2025
1a81cb8
Remove bucket selection
abnegate Nov 14, 2025
b1988cc
Always download
abnegate Nov 14, 2025
f637513
Update to icon buttons
abnegate Nov 14, 2025
6e783c2
chore(profiles): dockerize profiles action
arielweinberger Nov 17, 2025
f7f3abc
chore(profiles): dockerize profiles workflow
arielweinberger Nov 17, 2025
93accb9
final tweaks to prompt to perfect the agent behaviour
atharvadeosthale Nov 18, 2025
b620823
address comments
atharvadeosthale Nov 18, 2025
0c3d29a
merge conflicts
atharvadeosthale Nov 18, 2025
32bf16b
merge conflicts
atharvadeosthale Nov 18, 2025
04a1b2e
Update src/routes/(console)/project-[region]-[project]/overview/platf…
atharvadeosthale Nov 18, 2025
83d1310
Merge branch 'main' into 'revert-2491-revert-2477-copy-prompt'.
ItzNotABug Nov 18, 2025
9555ef5
Merge remote-tracking branch 'origin/revert-2491-revert-2477-copy-pro…
ItzNotABug Nov 18, 2025
a9f551e
fix: empty-state.
ItzNotABug Nov 18, 2025
754c1ad
ci: empty commit
ItzNotABug Nov 18, 2025
9423fc9
ci: empty commit
ItzNotABug Nov 18, 2025
2f91d97
feat: enhance support wizard
Copilot Nov 18, 2025
25a1432
feat: add image transformations configuration to bucket settings
ChiragAgg5k Nov 19, 2025
63668b2
update lock file
ChiragAgg5k Nov 19, 2025
7bd46f4
fix build
ChiragAgg5k Nov 19, 2025
e93999c
lint
ChiragAgg5k Nov 19, 2025
731209d
update: make `undefined` from `null`s.
ItzNotABug Nov 19, 2025
da7305b
Merge remote-tracking branch 'origin/main' into feat-csv-export
abnegate Nov 19, 2025
2ed1d8c
update: make `undefined` from `null`s.
ItzNotABug Nov 19, 2025
81c4568
update
ChiragAgg5k Nov 19, 2025
6b3409d
Merge pull request #2615 from appwrite/fix-organization-billing
ItzNotABug Nov 19, 2025
e2e208f
Merge branch 'main' into feat-bucket-transformations-settings
ChiragAgg5k Nov 19, 2025
e662265
Merge pull request #2614 from appwrite/feat-bucket-transformations-se…
ItzNotABug Nov 19, 2025
8a708ce
Merge branch 'main' into revert-2491-revert-2477-copy-prompt
atharvadeosthale Nov 19, 2025
8b25d4f
fetch latest releases from github api
atharvadeosthale Nov 19, 2025
c7fb232
add android version fetching
atharvadeosthale Nov 19, 2025
6930968
use appwrite endpoint for versions
atharvadeosthale Nov 19, 2025
d174af8
use the split button
atharvadeosthale Nov 19, 2025
2632b0a
Merge pull request #2512 from appwrite/revert-2491-revert-2477-copy-p…
TorstenDittmann Nov 19, 2025
2920ccf
ci: empty commit
ItzNotABug Nov 19, 2025
5a92fbe
ci: empty commit
ItzNotABug Nov 19, 2025
6238502
Merge pull request #2608 from appwrite/fix-empty-states
ItzNotABug Nov 19, 2025
0cbd9ef
Fix billing address replacement modal using undefined project context…
Copilot Nov 20, 2025
973c576
Sync main
abnegate Nov 20, 2025
c08225c
Catch downloadUrl
abnegate Nov 20, 2025
e0836fb
Merge remote-tracking branch 'origin/main' into feat-csv-export
abnegate Nov 20, 2025
4d440b2
Fix custom plan names displaying as "Free" on account organizations p…
Copilot Nov 20, 2025
345acee
Fix Update button disabled when clearing optional tenantID in Microso…
Copilot Nov 21, 2025
570316d
chore: update scope descriptions for database index access
stnguyen90 Nov 21, 2025
fcd523b
chore: fix possessive form in database index descriptions
stnguyen90 Nov 21, 2025
81c53a4
Merge pull request #2625 from appwrite/chore-api-key-scopes-description
abnegate Nov 21, 2025
f1d40ae
fix: handle missing deploymentId gracefully
HarshMN2345 Nov 21, 2025
8946e7f
added types
HarshMN2345 Nov 21, 2025
667cc6c
pushed imports together
HarshMN2345 Nov 21, 2025
553587e
Merge pull request #2626 from appwrite/fix-SER-635-handle-missing-dep…
ItzNotABug Nov 21, 2025
273488f
Fix: Preserve null value for "Never" expiration option (#2605)
Copilot Nov 21, 2025
a5c9df2
Add support wizard topics and fix space-to-dash conversion (#2618)
Copilot Nov 21, 2025
9e8c3e2
fix: alignment and make it responsive!
ItzNotABug Nov 22, 2025
7407bbd
Merge pull request #2630 from appwrite/fix-alignment
ItzNotABug Nov 22, 2025
0a07c0a
use plan capabilities instead of hardcoded plan checks for backup pol…
HarshMN2345 Nov 22, 2025
e0d881d
remove try catch
HarshMN2345 Nov 22, 2025
bab1c5a
Update commandCenter.svelte
HarshMN2345 Nov 22, 2025
08989b7
Update commandCenter.svelte
HarshMN2345 Nov 22, 2025
ca24b61
Merge pull request #2583 from appwrite/fix-SER-493-prevent-global-sho…
ItzNotABug Nov 22, 2025
2b20b68
use master branch
HarshMN2345 Nov 22, 2025
5b141ec
Merge pull request #2631 from appwrite/fix-use-plan-capabilities-for-…
ItzNotABug Nov 22, 2025
bd669c3
add: platform filter.
ItzNotABug Nov 22, 2025
ceef3d7
Merge pull request #2632 from appwrite/org-listing-filters
ItzNotABug Nov 22, 2025
78f1950
Merge pull request #2403 from appwrite/fix-remove-space-right-end-whe…
ItzNotABug Nov 22, 2025
9cbf8d2
Differentiate archived project behavior by plan tier (#2549)
Copilot Nov 23, 2025
1ebb7c4
add: cache.
ItzNotABug Nov 23, 2025
586da02
ci: empty commit
ItzNotABug Nov 23, 2025
6abce07
ci: empty commit
ItzNotABug Nov 23, 2025
523d3d7
remove: pnpm cache. adds overhead!
ItzNotABug Nov 23, 2025
86ec87d
Feat: feedback
lohanidamodar Nov 24, 2025
b352dcb
remove unused var
lohanidamodar Nov 24, 2025
f230946
Merge remote-tracking branch 'origin/main' into feat-csv-export
abnegate Nov 24, 2025
ae4ed9c
Review fixes
abnegate Nov 24, 2025
1c61fde
updates: patch and improve logic.
ItzNotABug Nov 24, 2025
4b6e174
Merge pull request #2637 from appwrite/patches-to-pagination
HarshMN2345 Nov 24, 2025
1a0ea48
Hide billing paginator when project breakdown empty.
HarshMN2345 Nov 24, 2025
d58bc8f
Disable export if no rows
abnegate Nov 24, 2025
cb856cb
Merge pull request #2633 from appwrite/cach-ci-deps
TorstenDittmann Nov 24, 2025
751b3cd
Format
abnegate Nov 25, 2025
b354f45
Update box text
abnegate Nov 25, 2025
a9385fb
Simplify notification
abnegate Nov 25, 2025
abbe7e1
Format
abnegate Nov 25, 2025
4a95f3a
Merge pull request #2496 from appwrite/feat-csv-export
abnegate Nov 25, 2025
e2c8613
fix: responsive layout for input fields and tables on mobile devices
AbhiVarde Nov 25, 2025
4371c8f
Merge pull request #2636 from appwrite/feat-feedback
lohanidamodar Nov 25, 2025
b592255
Merge pull request #2350 from appwrite/feat-SER-347-Add-pagination-ne…
lohanidamodar Nov 25, 2025
c51cbe9
fix: check if the type is non-spatial before clearing.
ItzNotABug Nov 25, 2025
4feb151
Merge pull request #2640 from appwrite/fix-spatial-issue
abnegate Nov 25, 2025
237ae93
Merge pull request #2579 from appwrite/fix-SER-483-respect-directory-…
ItzNotABug Nov 25, 2025
5ccfd08
fix: apply review feedback
AbhiVarde Nov 25, 2025
08508ab
fix: prevent filters dropdown from being clipped by dialog overflow
Nov 25, 2025
b175e08
Merge pull request #2643 from jaysomani/fix-2628_filters-dropdown-ove…
ItzNotABug Nov 26, 2025
4cc00c9
Merge branch 'main' into fix-SER-467-git-details-not-showing
Meldiron Nov 26, 2025
7d24475
feat: add Database AI suggestions bottom alert
HarshMN2345 Nov 26, 2025
6f76fbc
Merge pull request #2589 from appwrite/fix-SER-467-git-details-not-sh…
Meldiron Nov 26, 2025
d4a56ad
update: disable ev.
ItzNotABug Nov 27, 2025
7a00fac
Merge pull request #2648 from appwrite/disable-ev-on-stage
ItzNotABug Nov 27, 2025
07cfb72
Revert "CSV export"
ItzNotABug Nov 27, 2025
3ce9054
update: filtering.
ItzNotABug Nov 27, 2025
71cad9b
fix: plan getter.
ItzNotABug Nov 27, 2025
c09e82d
Merge pull request #2650 from appwrite/fix-filtering
ItzNotABug Nov 27, 2025
8505391
Merge pull request #2649 from appwrite/revert-2496-feat-csv-export
abnegate Nov 27, 2025
6b29e04
add: missing scopes.
ItzNotABug Nov 27, 2025
4ec08c1
Merge pull request #2651 from appwrite/add-scopes
abnegate Nov 27, 2025
75992fd
fix: Docs button in create site repository connection modal
Nov 27, 2025
ff4ff0c
Pagination for list repositories
hmacr Nov 28, 2025
90fb24e
fix: pagination.
ItzNotABug Nov 29, 2025
75d7523
Merge pull request #2657 from appwrite/fix-pagination
ItzNotABug Nov 29, 2025
c1f0d2e
bump: dep.
ItzNotABug Nov 30, 2025
0fa57b3
Merge pull request #2658 from appwrite/fix-tooltips-popovers
ItzNotABug Nov 30, 2025
277e06a
Fix: setup intent might return payment method in different format
lohanidamodar Dec 1, 2025
2d4ecb1
fix typo
lohanidamodar Dec 1, 2025
707019a
Merge pull request #2645 from appwrite/feat-SER-645-Console-Notificat…
ItzNotABug Dec 1, 2025
e6f8578
Format
lohanidamodar Dec 1, 2025
59f7152
Merge pull request #2659 from appwrite/fix-captcha-payment
lohanidamodar Dec 1, 2025
fc11a90
Merge pull request #2653 from jaysomani/fix-2356-docs-button-create-site
ItzNotABug Dec 1, 2025
7d10c30
use: smart portal on droplist.
ItzNotABug Dec 2, 2025
f6b29f2
Merge pull request #2660 from appwrite/fix-modal-overflows
ItzNotABug Dec 2, 2025
fe7fdeb
fix: disable free plan in selection if one already exists.
ItzNotABug Dec 2, 2025
b3b19df
Merge pull request #2662 from appwrite/disable-free-when-applicable
ItzNotABug Dec 2, 2025
3b172e7
add: column waiting logic on ai suggestions as well.
ItzNotABug Dec 2, 2025
e977a00
Merge pull request #2663 from appwrite/fix-sample-data
ItzNotABug Dec 2, 2025
fa9c9d4
feat: add quick create-organization button in org header
HarshMN2345 Dec 2, 2025
ea3216d
use stack
HarshMN2345 Dec 2, 2025
e79bffb
Fix: retry payment model while adding new payment method
lohanidamodar Dec 2, 2025
f7a5bfc
remove log
lohanidamodar Dec 2, 2025
4f386f6
remove import
lohanidamodar Dec 2, 2025
20874f5
Merge pull request #2666 from appwrite/fix-retry-payment-model
lohanidamodar Dec 3, 2025
20e9ef9
Merge branch 'main' into ser-504
hmacr Dec 3, 2025
93708e7
fix: search and clear search behaviour in search query component
Dec 3, 2025
4531063
Merge pull request #2639 from AbhiVarde/fix-2629-mobile-responsive-ta…
ItzNotABug Dec 4, 2025
d3bd71e
fix: direct url hits for wrong platform org and projects.
ItzNotABug Dec 5, 2025
2653a93
used plussm icon
HarshMN2345 Dec 5, 2025
97afec4
update SDK
hmacr Dec 5, 2025
5eac7d7
Merge pull request #2664 from appwrite/feat-SER-360-quick-org-access-…
ItzNotABug Dec 5, 2025
1ab59eb
feedback
hmacr Dec 5, 2025
76f4ec1
Merge pull request #2670 from appwrite/fix-direct-org-hits
ItzNotABug Dec 5, 2025
231613a
Hide internal OAuth providers from UI
TorstenDittmann Dec 4, 2025
1b7299e
Merge pull request #2671 from appwrite/fix-internal-oauth-providers
TorstenDittmann Dec 5, 2025
6344127
Merge pull request #2654 from appwrite/ser-504
ItzNotABug Dec 5, 2025
71db5d6
Fix bottom-nav-container z-index in database subNavigation (#2672)
Copilot Dec 6, 2025
3cd0f12
truncate long labels
HarshMN2345 Dec 6, 2025
38cf37d
changed character limit
HarshMN2345 Dec 6, 2025
4f19450
Merge pull request #2675 from appwrite/fix-SER-SER-414-truncate-long-…
ItzNotABug Dec 6, 2025
2803000
Fix: Migration redirect 404 on self-hosted instances
WhoamiI00 Dec 6, 2025
577410f
Merge pull request #2571 from appwrite/fix-SER-529-datetime-local-to-…
ItzNotABug Dec 7, 2025
44898e5
enable file upload for push notifications
HarshMN2345 Dec 7, 2025
1503e21
addressed comments
HarshMN2345 Dec 7, 2025
4e07f21
Merge pull request #2677 from WhoamiI00/fix-migration-redirect-404
ItzNotABug Dec 7, 2025
a499ae5
refactor: display "Buckets" instead of "Databases" in storage tab (#2…
floherzler Dec 8, 2025
c278a79
fix: ensure the entire $id cell is hidden if user hides (#2691)
stnguyen90 Dec 9, 2025
04a7ef0
Update src/lib/elements/forms/inputFilePicker.svelte
HarshMN2345 Dec 10, 2025
6c838e3
Merge pull request #2679 from appwrite/fix-SER-468-file-upload-for-pu…
ItzNotABug Dec 10, 2025
978bd4d
prevent squishing of organization header plus button
HarshMN2345 Dec 11, 2025
e26e9bb
Merge pull request #2697 from appwrite/fix-squished-icon-for-org-shor…
ItzNotABug Dec 11, 2025
55ad9a6
fix: states not updated.
ItzNotABug Dec 11, 2025
e714a46
Merge pull request #2698 from appwrite/fix-disabled-states
ItzNotABug Dec 11, 2025
eabf5c0
Fix org mobile/tablet sidebar visibility and actions
HarshMN2345 Dec 11, 2025
a56bf0b
Merge pull request #2699 from appwrite/fix-SER-670-org-sidebar-visibi…
loks0n Dec 11, 2025
82bc4a5
add: nice looking thing :D
ItzNotABug Dec 11, 2025
558f921
bump: engine.
ItzNotABug Dec 11, 2025
cd7ee26
bump: engine.
ItzNotABug Dec 11, 2025
9de0afb
update: design changes.
ItzNotABug Dec 11, 2025
e7eaad6
add: shadow and mobile config.
ItzNotABug Dec 11, 2025
09651e0
add: flag.
ItzNotABug Dec 11, 2025
a80a211
Merge pull request #2701 from appwrite/add-imagine-banner
ItzNotABug Dec 11, 2025
557a0cd
Add skeleton loader to database subNavigation while tables load (#2673)
Copilot Dec 11, 2025
f54f660
remove: link.
ItzNotABug Dec 12, 2025
b92b94f
Merge pull request #2703 from appwrite/remove-studio-link
ItzNotABug Dec 12, 2025
212d2ce
Show proper labels when adding sites/functions domain
hmacr Dec 12, 2025
c09eb5d
realtime support, skip badge for new domain flow
hmacr Dec 12, 2025
7269eff
make sure only Appwrite projects are fetched on self-hosted (#2696)
atharvadeosthale Dec 12, 2025
c4d7d64
fix: clear existing stripe state.
ItzNotABug Dec 13, 2025
9f05f73
fix: enter on state picker.
ItzNotABug Dec 13, 2025
ba54f8d
Merge pull request #2706 from appwrite/improve-payment-modal
ItzNotABug Dec 13, 2025
4059ee3
project settings
hmacr Dec 15, 2025
f455327
tiny
hmacr Dec 15, 2025
454cd7b
logs + better checks
hmacr Dec 15, 2025
94e07ac
remove IIFE
hmacr Dec 15, 2025
da3dfcf
feedback
hmacr Dec 15, 2025
0802cfb
Merge branch 'main' into ser-287
hmacr Dec 16, 2025
1a01859
fix null domainsList
hmacr Dec 16, 2025
0ba7a6b
Merge pull request #2704 from appwrite/ser-287
ItzNotABug Dec 16, 2025
b1976e0
fix: width.
ItzNotABug Dec 16, 2025
88df9e9
fix: table overflows for payments.
ItzNotABug Dec 16, 2025
569b43e
Merge pull request #2711 from appwrite/fix-dat-975
ItzNotABug Dec 16, 2025
957617a
Add CNAME warning for apex domains
hmacr Dec 16, 2025
7c08691
Merge pull request #2712 from appwrite/ser-330
ItzNotABug Dec 16, 2025
a1a95c7
Enable Imagine promo on console
adityaoberai Dec 16, 2025
bc5837c
Update link to Imagine homepage
adityaoberai Dec 16, 2025
02e15a7
Fix styling for Imagine promo component
adityaoberai Dec 16, 2025
952cf85
Merge pull request #2715 from appwrite/enable-imagine-promo
TorstenDittmann Dec 16, 2025
900ea90
Fix Imagine promo copy
adityaoberai Dec 16, 2025
849ced0
Merge pull request #2716 from appwrite/fix-imagine-promo-copy
adityaoberai Dec 16, 2025
8838922
Fix status code filter to match responseStatusCode column ID (#2690)
Copilot Dec 17, 2025
a2667f8
Update Console to handle specifications for self-hosted (#2685)
Copilot Dec 19, 2025
3a2bdcd
update: smaller payloads :D
ItzNotABug Dec 19, 2025
b178461
add: todo for later.
ItzNotABug Dec 20, 2025
c0f5b62
remove: platforms dependency.
ItzNotABug Dec 20, 2025
2271b9a
remove: todo.
ItzNotABug Dec 20, 2025
51eb30b
update: query.
ItzNotABug Dec 20, 2025
721f7d3
update: query.
ItzNotABug Dec 20, 2025
59d4a4b
fix: lint.
ItzNotABug Dec 20, 2025
2c8e4e7
fix: alert aligment issue in max file size card
HarshMN2345 Dec 22, 2025
87854c5
Merge pull request #2727 from appwrite/fix-SER-524-alert-alignment-issue
HarshMN2345 Dec 22, 2025
580e5bf
Merge pull request #2724 from appwrite/optimize-projects-list
ItzNotABug Dec 22, 2025
e57444f
fix: tooltip content truncated in billing ui table
HarshMN2345 Dec 23, 2025
d913262
Update ProgressBar.svelte
HarshMN2345 Dec 23, 2025
1fabaa5
Merge pull request #2730 from appwrite/fix-small-tooltip-issue
HarshMN2345 Dec 23, 2025
6173cb1
fix: add `organizationId`.
ItzNotABug Dec 23, 2025
b18a769
Merge pull request #2731 from appwrite/update-sdk
ItzNotABug Dec 23, 2025
66dafc6
update: use `billingPlanId`.
ItzNotABug Dec 23, 2025
6cac26f
revert: keep using `billingPlan`.
ItzNotABug Dec 23, 2025
3735257
lint.
ItzNotABug Dec 23, 2025
4f4855a
revert: unnecessary changes.
ItzNotABug Dec 23, 2025
4af5e83
fix: empty string key causing crashes, plus the key accessor was wrong.
ItzNotABug Dec 24, 2025
72ddec4
use: derived.
ItzNotABug Dec 24, 2025
c2c9a40
remove: onmount.
ItzNotABug Dec 24, 2025
cd161af
Merge pull request #2733 from appwrite/fix-web-crash
ItzNotABug Dec 24, 2025
5d0fe28
update: as per sdk.
ItzNotABug Dec 24, 2025
4425d99
Merge pull request #2732 from appwrite/add-billing-plan-object
ItzNotABug Dec 24, 2025
e446f7f
feat: add attachment support to support wizard (#2624)
stnguyen90 Dec 25, 2025
b10a000
Merge branch 'appwrite:main' into fix-2656_search_query_clear_button
jaysomani Dec 27, 2025
4d7cb51
updated based on the changes requested
Dec 27, 2025
442e16f
fixed linting issue
Dec 27, 2025
baf47f8
Merge pull request #2668 from jaysomani/fix-2656_search_query_clear_b…
ItzNotABug Dec 27, 2025
220dc97
Merge branch 'main' into 'multiple-terminologies'.
ItzNotABug Dec 30, 2025
1eea12f
updates: misc.
ItzNotABug Dec 30, 2025
26871a8
fix: realtime todo.
ItzNotABug Dec 30, 2025
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
26 changes: 16 additions & 10 deletions src/lib/actions/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const analytics = Analytics({
});

export function trackEvent(name: string, data: object = null): void {
if (!isTrackingAllowed()) {
if (!name || !isTrackingAllowed()) {
return;
}

Expand All @@ -76,7 +76,7 @@ export function trackEvent(name: string, data: object = null): void {
}

export function trackError(exception: Error, event: Submit): void {
if (exception instanceof AppwriteException && exception.type) {
if (exception instanceof AppwriteException && exception.type && event) {
trackEvent(Submit.Error, {
type: exception.type,
form: event
Expand Down Expand Up @@ -148,11 +148,14 @@ export enum Click {
ConnectRepositoryClick = 'click_connect_repository',
CreditsRedeemClick = 'click_credits_redeem',
CloudSignupClick = 'click_cloud_signup',

DatabaseColumnDelete = 'click_column_delete',
DatabaseIndexDelete = 'click_index_delete',
DatabaseTableDelete = 'click_table_delete',
DatabaseRowDelete = 'click_row_delete',
DatabaseDatabaseDelete = 'click_database_delete',
DatabaseImportCsv = 'click_database_import_csv',

DomainCreateClick = 'click_domain_create',
DomainDeleteClick = 'click_domain_delete',
DomainRetryDomainVerificationClick = 'click_domain_retry_domain_verification',
Expand Down Expand Up @@ -265,7 +268,7 @@ export enum Submit {
AuthSessionAlertsUpdate = 'submit_auth_session_alerts_update',
AuthMembershipPrivacyUpdate = 'submit_auth_membership_privacy_update',
AuthMockNumbersUpdate = 'submit_auth_mock_numbers_update',
AuthInvalidateSesssion = 'submit_auth_invalidate_session',
AuthInvalidateSession = 'submit_auth_invalidate_session',
SessionsLengthUpdate = 'submit_sessions_length_update',
SessionsLimitUpdate = 'submit_sessions_limit_update',
SessionDelete = 'submit_session_delete',
Expand All @@ -284,15 +287,18 @@ export enum Submit {
RowDelete = 'submit_row_delete',
RowUpdate = 'submit_row_update',
RowUpdatePermissions = 'submit_row_update_permissions',

IndexCreate = 'submit_index_create',
IndexDelete = 'submit_index_delete',
TableCreate = 'submit_row_create',
TableDelete = 'submit_row_delete',
TableUpdateName = 'submit_row_update_name',
TableUpdatePermissions = 'submit_row_update_permissions',
TableUpdateSecurity = 'submit_row_update_security',
TableUpdateEnabled = 'submit_row_update_enabled',
TableUpdateDisplayNames = 'submit_row_update_display_names',

TableCreate = 'submit_table_create',
TableDelete = 'submit_table_delete',
TableUpdateName = 'submit_table_update_name',
TableUpdatePermissions = 'submit_table_update_permissions',
TableUpdateSecurity = 'submit_table_update_security',
TableUpdateEnabled = 'submit_table_update_enabled',
TableUpdateDisplayNames = 'submit_table_update_display_names',

FunctionCreate = 'submit_function_create',
FunctionDelete = 'submit_function_delete',
FunctionUpdateName = 'submit_function_update_name',
Expand Down
15 changes: 8 additions & 7 deletions src/lib/components/backupRestoreBox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,22 @@
}

function updateOrAddItem(payload: Payload) {
// todo: @itznotabug - might need a change to $table?
const { $id, status, $collection, policyId } = payload;
if ($collection === 'archives' && policyId !== null) {
// the internal structure still uses `$collection`,
// and is basically an identifier of the op. type here!
const { $id, status, $collection: type, policyId } = payload;
if (type === 'archives' && policyId !== null) {
return;
}

if ($collection in backupRestoreItems) {
const collectionMap = backupRestoreItems[$collection];
if (type in backupRestoreItems) {
const collectionMap = backupRestoreItems[type];

if (collectionMap.has($id)) {
collectionMap.get($id).status = status;
if (status === 'completed') {
invalidate(Dependencies.BACKUPS);

if ($collection === 'restorations') {
if (type === 'restorations') {
const { newId, newName } =
collectionMap.get($id).options?.['databases']?.['database'][0] || {};

Expand All @@ -81,7 +82,7 @@
} else if (status === 'pending' || status === 'processing' || status === 'uploading') {
collectionMap.set($id, payload);
}
backupRestoreItems[$collection] = collectionMap;
backupRestoreItems[type] = collectionMap;
}
}

Expand Down
37 changes: 37 additions & 0 deletions src/lib/helpers/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,43 @@ export function singular(str: string): string {
return str.replace(/s$/, '');
}

/**
* Given a string, returns the plural version of it.
*
* Handles common English pluralization rules:
* - Words ending in consonant + y → ies
* - Words ending in vowel + y → s
* - Words ending in sibilants (s, sh, ch, x, z) → es
* - Regular words → s
*
* @export
* @param {string} str
* @returns {string}
*/
export function plural(str: string): string {
if (!str) return str;

const lower = str.toLowerCase();

// Words ending in sibilants: s, sh, ch, x, z
if (/[sxz]$/.test(lower) || /[cs]h$/.test(lower)) {
return str + 'es';
}

// Words ending in consonant + y → ies
// Words ending in vowel + y → s
if (str.endsWith('y')) {
const beforeY = str.slice(-2, -1).toLowerCase();
if (beforeY && !['a', 'e', 'i', 'o', 'u'].includes(beforeY)) {
return str.slice(0, -1) + 'ies';
}
return str + 's';
}

// Default: add 's'
return str + 's';
}

/**
* Convert a dash/underscore/space separated string to camelCase.
*
Expand Down
29 changes: 29 additions & 0 deletions src/lib/stores/navigation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { resolve } from '$app/paths';
import { goto } from '$app/navigation';
import type { Pathname, RouteId, RouteParams } from '$app/types';

// taken directly from svelte's source!
type ResolveArgs<T extends RouteId | Pathname> = T extends RouteId
? RouteParams<T> extends Record<string, never>
? [route: T]
: [route: T, params: RouteParams<T>]
: [route: T];

export function withPath(base: string, ...parts: string[]) {
return [base.replace(/\/+$/, ''), ...parts].join('/');
}

export function resolveRoute<T extends RouteId>(route: T, params?: Record<string, string>) {
// type cast is necessary here!
const resolveArgs = params ? ([route, params] as [T, RouteParams<T>]) : [route];

return resolve(...(resolveArgs as ResolveArgs<T>));
}

export function navigate<T extends RouteId>(
route: T,
params?: Record<string, string>
): Promise<void> {
// type cast is necessary here!
return goto(resolveRoute(route, params));
}
4 changes: 3 additions & 1 deletion src/lib/stores/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import {
Sites,
Tokens,
TablesDB,
Domains
Domains,
Databases // DocumentsDB later
} from '@appwrite.io/console';
import { Billing } from '../sdk/billing';
import { Backups } from '../sdk/backups';
Expand Down Expand Up @@ -131,6 +132,7 @@ const sdkForProject = {
migrations: new Migrations(clientProject),
sites: new Sites(clientProject),
tablesDB: new TablesDB(clientProject),
documentsDB: new Databases(clientProject), // documentsDB later
console: new Console(clientProject) // for suggestions API
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
type: 'success',
message: 'Updated session invalidation check.'
});
trackEvent(Submit.AuthInvalidateSesssion);
trackEvent(Submit.AuthInvalidateSession);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.AuthInvalidateSesssion);
trackError(error, Submit.AuthInvalidateSession);
}
}
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import type { Page } from '@sveltejs/kit';

import { useTerminology } from './terminology';
import { Submit, Click } from '$lib/actions/analytics';
import type { AnalyticsResult, TerminologyResult, TerminologyShape } from './types';

export function useAnalytics(pageOrTerms: Page | TerminologyResult): AnalyticsResult {
// source is in `TerminologyResult`.
const terminology = 'source' in pageOrTerms ? pageOrTerms : useTerminology(pageOrTerms);

const createSubmitHandler = <TAction extends string>(termType: keyof TerminologyShape) => {
return (action: TAction) => {
const term = terminology.source[termType];
if (!term) {
throw new Error(`No ${termType} terminology found`);
}
const enumKey = `${term.title.singular}${action}`;
return Submit[enumKey as keyof typeof Submit];
};
};

const createClickHandler = <TAction extends string>(termType: keyof TerminologyShape) => {
return (action: TAction) => {
const term = terminology.source[termType];
if (!term) {
throw new Error(`No ${termType} terminology found`);
}
const enumKey = `Database${term.title.singular}${action}`;
return Click[enumKey as keyof typeof Click];
};
};

const result: AnalyticsResult = { submit: {}, click: {} };

if (terminology.entity) {
result.click.entity = createClickHandler('entity');
result.submit.entity = createSubmitHandler('entity');
}

if (terminology.field) {
result.click.field = createClickHandler('field');
result.submit.field = createSubmitHandler('field');
}

if (terminology.record) {
result.click.record = createClickHandler('record');
result.submit.record = createSubmitHandler('record');
}

return result;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { Page } from '@sveltejs/kit';

import { useTerminology } from './terminology';
import { Dependencies } from '$lib/constants';
import type { DependenciesResult, Term, TerminologyResult } from './types';

export function useDependencies(pageOrTerms: Page | TerminologyResult): DependenciesResult {
// source is in `TerminologyResult`.
const terminology = 'source' in pageOrTerms ? pageOrTerms : useTerminology(pageOrTerms);

const getDependencies = (term: { title: Term }) => ({
singular: Dependencies[term.title.singular.toUpperCase() as keyof typeof Dependencies],
plural: Dependencies[term.title.plural.toUpperCase() as keyof typeof Dependencies]
});

return {
entity: terminology.entity ? getDependencies(terminology.entity) : undefined,
field: terminology.field ? getDependencies(terminology.field) : undefined,
record: terminology.record ? getDependencies(terminology.record) : undefined
};
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be in a "helpers" context? Can't it just be defined for all entities

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would just mix up the logic with stranded TS files while the views has its own directory structure. Mainly for organizing TS ops in a specific directory so its easier to manage. Maybe helpers isn't the right term but injections seems more broad and overkill to me.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from './init';
export * from './types';
export * from './analytics';
export * from './terminology';
export * from './dependencies';
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import type { Page } from '@sveltejs/kit';
import { getContext, setContext } from 'svelte';
import {
type AnalyticsResult,
type DependenciesResult,
type TerminologyResult,
useAnalytics,
useDependencies,
useTerminology
} from '$database/(entity)';

const TERMINOLOGIES_KEY = Symbol('terminologies');

export type Terminologies = {
analytics: AnalyticsResult;
terminology: TerminologyResult;
dependencies: DependenciesResult;
};

export function getTerminologies(): Terminologies {
return getContext<Terminologies>(TERMINOLOGIES_KEY);
}

export function setTerminologies(page: Page) {
setContext(TERMINOLOGIES_KEY, buildTerminologies(page));
}

function buildTerminologies(page: Page) {
const terminology = useTerminology(page);
return {
terminology,
analytics: useAnalytics(terminology),
dependencies: useDependencies(terminology)
};
}
Loading