Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
e9adda3
feat: set project endpoint based on the region
christyjacob4 Nov 11, 2024
c6a011e
feat: set project endpoint based on the region
christyjacob4 Nov 11, 2024
c86d6aa
feat: linter
christyjacob4 Nov 11, 2024
b708507
feat: linter
christyjacob4 Nov 11, 2024
4159544
Merge branch 'main' of github.com:appwrite/console into feat-support-…
christyjacob4 Nov 12, 2024
2f744a8
feat: add constants for regions
christyjacob4 Nov 12, 2024
2c4af1f
feat: add constants for regions
christyjacob4 Nov 12, 2024
d02f97f
feat: linter
christyjacob4 Nov 12, 2024
88b6390
chore: update endpoint
christyjacob4 Nov 12, 2024
d667129
feat: update domains for staging
christyjacob4 Nov 12, 2024
63fa46f
Merge branch 'main' of github.com:appwrite/console into feat-support-…
christyjacob4 Nov 12, 2024
018a732
Merge branch 'main' of https://github.com/appwrite/console into feat-…
TorstenDittmann Dec 9, 2024
37124f7
fix: sdk context
TorstenDittmann Dec 10, 2024
08369e4
Merge branch 'main' of https://github.com/appwrite/console into feat-…
TorstenDittmann Dec 10, 2024
5c4b6ed
Merge branch 'feat-support-multi-region' of https://github.com/appwri…
TorstenDittmann Dec 10, 2024
b4fc532
fix: leftovers
TorstenDittmann Dec 10, 2024
e887b36
fix: build
TorstenDittmann Dec 11, 2024
a1cabc8
fix: more explicit projectId handling
TorstenDittmann Dec 12, 2024
dcaff79
fix: tests
TorstenDittmann Dec 12, 2024
cca4a81
fix: error during attribute creation.
ItzNotABug Jan 20, 2025
63c896b
Merge pull request #1617 from appwrite/fix-attribute-creation-issue
ItzNotABug Jan 20, 2025
1234691
ci: fix docker hub credentials
TorstenDittmann Jan 22, 2025
5a5b4d4
Merge branch 'main' of https://github.com/appwrite/console into fix-s…
TorstenDittmann Jan 22, 2025
9af0556
fix: realtime using project namespace
TorstenDittmann Jan 22, 2025
f7aca88
Merge pull request #1626 from appwrite/fix-realtime-endpoint
TorstenDittmann Jan 22, 2025
03bd2b4
fix: more links
TorstenDittmann Jan 28, 2025
2222bee
fix: realtime connection
TorstenDittmann Feb 13, 2025
4a59519
fix: dockerfile corepack version
TorstenDittmann Feb 13, 2025
698cc91
fix: realtime context on creating executions
TorstenDittmann Feb 13, 2025
2cc527e
fix: realtime issues with database
TorstenDittmann Feb 13, 2025
81516f9
fix: region calls and realtime connections
TorstenDittmann Feb 13, 2025
d141116
fix: show multi-region cname target.
ItzNotABug Feb 19, 2025
7aaa19e
patch: dependency.
ItzNotABug Feb 19, 2025
551dac8
address comment.
ItzNotABug Feb 19, 2025
dffa8cc
Merge pull request #1679 from appwrite/fix-cname-table
ItzNotABug Feb 19, 2025
b41f15c
fix: endpoint as per region
ItzNotABug Feb 19, 2025
c07b81c
Merge pull request #1681 from appwrite/change-endpoint
ItzNotABug Feb 19, 2025
b3460c1
fix: realtime on backups.
ItzNotABug Feb 20, 2025
cd2825f
fix: tests.
ItzNotABug Feb 20, 2025
5537020
revert: pink paths.
ItzNotABug Feb 20, 2025
ac9b0a7
Update src/lib/helpers/project.ts
ItzNotABug Feb 20, 2025
a7fa268
Merge pull request #1685 from appwrite/fix-realtime
ItzNotABug Feb 20, 2025
255debe
update: region management
ItzNotABug Feb 21, 2025
e788fa6
update: wizard with endpoints.
ItzNotABug Feb 21, 2025
a091b32
ran: formatter.
ItzNotABug Feb 21, 2025
718b59e
fix: flutter code sample.
ItzNotABug Feb 21, 2025
63811f5
update: remove debugging leftover.
ItzNotABug Feb 21, 2025
bbf51f3
fix: edge case when wizard is auto closed due to modal close;
ItzNotABug Feb 21, 2025
dcd335f
fix: test <> svelte diagnostics.
ItzNotABug Feb 21, 2025
9734fe7
update: reuse function from component.
ItzNotABug Feb 21, 2025
5f3ac67
address internal comments: add todo for future.
ItzNotABug Feb 21, 2025
dbada9e
Merge pull request #1692 from appwrite/add-endpoints-in-wizard
ItzNotABug Feb 21, 2025
b3c18a0
address comments.
ItzNotABug Feb 25, 2025
2bc3679
address comments.
ItzNotABug Feb 25, 2025
e271bca
address comments.
ItzNotABug Feb 25, 2025
0acf199
fix: outdated billing usage.
ItzNotABug Mar 16, 2025
017245f
fix: ai-sdk dependency and stream protocol.
ItzNotABug Mar 16, 2025
3114f75
Merge branch 'main' 'into sdk-context-main-merge'.
ItzNotABug Mar 16, 2025
cdba879
fix: todo.
ItzNotABug Mar 16, 2025
492f391
ran: formatter.
ItzNotABug Mar 16, 2025
b39d689
fix: conflicts.
ItzNotABug Mar 16, 2025
aeaab5d
misc: cleanup.
ItzNotABug Mar 16, 2025
a6901fc
fix: org/team api usage.
ItzNotABug Mar 16, 2025
67dbebc
fix: org/team api usage.
ItzNotABug Mar 16, 2025
f391888
remove: hardcoded project region.
ItzNotABug Mar 16, 2025
febda51
fix: import order!
ItzNotABug Mar 16, 2025
1a5b302
clean: paths.
ItzNotABug Mar 16, 2025
2766859
clean: paths.
ItzNotABug Mar 16, 2025
8a4abb1
misc: add line.
ItzNotABug Mar 16, 2025
24d47ed
fix: api loads failing when no project access is available.
ItzNotABug Mar 16, 2025
c47bae1
fix: warning on e2e -
ItzNotABug Mar 16, 2025
8980fcf
bump: deps.
ItzNotABug Mar 16, 2025
07e754e
fix: tests?.
ItzNotABug Mar 17, 2025
18d08c4
update: regexify the tests.
ItzNotABug Mar 17, 2025
1b72479
fix: realtime endpoint issue.
ItzNotABug Mar 22, 2025
403ae5c
fix: invalid calls.
ItzNotABug Mar 22, 2025
d0b496d
Merge branch 'fix-sdk-context' into 'sdk-context-main-merge'.
ItzNotABug Mar 22, 2025
72a1aae
Merge pull request #1746 from appwrite/sdk-context-main-merge
ItzNotABug Mar 25, 2025
e8224fa
updates: change order and copy of project and endpoints.
ItzNotABug Apr 1, 2025
5472d5f
update: dashes to subdomains.
ItzNotABug Apr 11, 2025
ece27d9
Merge pull request #1790 from appwrite/fix-multi-region-endpoints
shimonewman Apr 11, 2025
93754b3
Merge pull request #1551 from appwrite/fix-sdk-context
TorstenDittmann Apr 14, 2025
7ae265d
Merge branch 'main' of https://github.com/appwrite/console into feat-…
TorstenDittmann Apr 14, 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
8 changes: 8 additions & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ export const PAGE_LIMIT = 12; // default page limit
export const CARD_LIMIT = 6; // default card limit
export const INTERVAL = 5 * 60000; // default interval to check for feedback

export const REGION_FRA = 'fra';
export const REGION_SYD = 'syd';
export const REGION_NYC = 'nyc';

export const SUBDOMAIN_FRA = 'fra.';
export const SUBDOMAIN_SYD = 'syd.';
export const SUBDOMAIN_NYC = 'nyc.';

export enum Dependencies {
FACTORS = 'dependency:factors',
IDENTITIES = 'dependency:identities',
Expand Down
28 changes: 26 additions & 2 deletions src/lib/stores/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,36 @@ import {
import { Billing } from '../sdk/billing';
import { Backups } from '../sdk/backups';
import { Sources } from '$lib/sdk/sources';
import {
REGION_FRA,
REGION_NYC,
REGION_SYD,
SUBDOMAIN_FRA,
SUBDOMAIN_NYC,
SUBDOMAIN_SYD
} from '$lib/constants';

export function getApiEndpoint(): string {
export function getApiEndpoint(region?: string): string {
if (VARS.APPWRITE_ENDPOINT) return VARS.APPWRITE_ENDPOINT;
return globalThis?.location?.origin + '/v1';
const protocol = globalThis?.location?.protocol;
const hostname = globalThis?.location?.hostname;
const subdomain = getSubdomain(region);
return `${protocol}//${subdomain}${hostname}/v1`;
}

const getSubdomain = (region?: string) => {
switch (region) {
case REGION_FRA:
return SUBDOMAIN_FRA;
case REGION_SYD:
return SUBDOMAIN_SYD;
case REGION_NYC:
return SUBDOMAIN_NYC;
default:
return '';
}
};

const endpoint = getApiEndpoint();

const clientConsole = new Client();
Expand Down
5 changes: 4 additions & 1 deletion src/routes/(console)/project-[project]/+layout.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Dependencies } from '$lib/constants';
import { sdk } from '$lib/stores/sdk';
import { getApiEndpoint, sdk } from '$lib/stores/sdk';
import { error } from '@sveltejs/kit';
import type { LayoutLoad } from './$types';
import { preferences } from '$lib/stores/preferences';
Expand Down Expand Up @@ -35,6 +35,9 @@ export const load: LayoutLoad = async ({ params, depends }) => {
}
}

console.log(getApiEndpoint(project.region));
sdk.forProject.client.setEndpoint(getApiEndpoint(project.region));

return {
project,
organization,
Expand Down
5 changes: 4 additions & 1 deletion src/routes/+layout.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@appwrite.io/pink';
import '@appwrite.io/pink-icons';
import 'tippy.js/dist/tippy.css';
import { sdk } from '$lib/stores/sdk';
import { getApiEndpoint, sdk } from '$lib/stores/sdk';
import { redirect } from '@sveltejs/kit';
import { Dependencies } from '$lib/constants';
import type { LayoutLoad } from './$types';
Expand All @@ -15,6 +15,9 @@ export const ssr = false;
export const load: LayoutLoad = async ({ depends, url, route }) => {
depends(Dependencies.ACCOUNT);

console.log(getApiEndpoint());
sdk.forProject.client.setEndpoint(getApiEndpoint());

const [account, error] = (await sdk.forConsole.account
.get()
.then((response) => [response, null])
Expand Down
Loading