mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
Merge branch 'main' of github.com:appwrite/console into billing
This commit is contained in:
commit
550febfe62
198 files changed
+561
-546
No files matched your search
@@ -1,11 +1,11 @@
|
||||
<script lang="ts">
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import Avatar from './avatar.svelte';
|
||||
|
||||
export let name: string;
|
||||
export let size: number;
|
||||
|
||||
$: src = sdkForConsole.avatars.getInitials(name, size * 2, size * 2).toString();
|
||||
$: src = sdk.forConsole.avatars.getInitials(name, size * 2, size * 2).toString();
|
||||
</script>
|
||||
|
||||
<Avatar {name} {size} {src} />
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { tooltip } from '$lib/actions/tooltip';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { tick } from 'svelte';
|
||||
import { AvatarInitials } from '../';
|
||||
@@ -18,11 +18,11 @@
|
||||
const role = permission.split(':')[0];
|
||||
const id = permission.split(':')[1].split('/')[0];
|
||||
if (role === 'user') {
|
||||
const user = await sdkForProject.users.get(id);
|
||||
const user = await sdk.forProject.users.get(id);
|
||||
return user;
|
||||
}
|
||||
if (role === 'team') {
|
||||
const team = await sdkForProject.teams.get(id);
|
||||
const team = await sdk.forProject.teams.get(id);
|
||||
return team;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { Button, InputSearch } from '$lib/elements/forms';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Query, type Models } from '@aw-labs/appwrite-console';
|
||||
import { AvatarInitials, EmptySearch, Modal, PaginationInline } from '..';
|
||||
import type { Writable } from 'svelte/store';
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
async function request() {
|
||||
if (!show) return;
|
||||
results = await sdkForProject.teams.list([Query.limit(5), Query.offset(offset)], search);
|
||||
results = await sdk.forProject.teams.list([Query.limit(5), Query.offset(offset)], search);
|
||||
}
|
||||
|
||||
function onSelection(event: Event, role: string) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { Button, InputSearch } from '$lib/elements/forms';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { AvatarInitials, EmptySearch, Modal, PaginationInline } from '..';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Query, type Models } from '@aw-labs/appwrite-console';
|
||||
import type { Writable } from 'svelte/store';
|
||||
import type { Permission } from './permissions.svelte';
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
async function request() {
|
||||
if (!show) return;
|
||||
results = await sdkForProject.users.list([Query.limit(5), Query.offset(offset)], search);
|
||||
results = await sdk.forProject.users.list([Query.limit(5), Query.offset(offset)], search);
|
||||
}
|
||||
|
||||
function onSelection(event: Event, role: string) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { uploader } from '$lib/stores/uploader';
|
||||
import { Pill } from '$lib/elements';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Avatar } from '$lib/components';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
@@ -9,7 +9,7 @@
|
||||
let hovering = false;
|
||||
|
||||
const getPreview = (fileId: string, bucketId: string) =>
|
||||
sdkForProject.storage.getFilePreview(bucketId, fileId, 32, 32).toString() + '&mode=admin';
|
||||
sdk.forProject.storage.getFilePreview(bucketId, fileId, 32, 32).toString() + '&mode=admin';
|
||||
</script>
|
||||
|
||||
{#if $uploader?.isOpen}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
export function getProjectId() {
|
||||
const pathname = window.location.pathname;
|
||||
const projectMatch = pathname.match(/\/project-(.*?)\//);
|
||||
return projectMatch?.[1] || null;
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
import { slide } from 'svelte/transition';
|
||||
import { page } from '$app/stores';
|
||||
import { Submit, trackEvent } from '$lib/actions/analytics';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
let showDropdown = false;
|
||||
@@ -35,7 +35,7 @@
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
await sdkForConsole.account.deleteSession('current');
|
||||
await sdk.forConsole.account.deleteSession('current');
|
||||
trackEvent(Submit.AccountLogout);
|
||||
await goto(`${base}/login`);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { base } from '$app/paths';
|
||||
import { app } from '$lib/stores/app';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { page } from '$app/stores';
|
||||
import { calculateTime } from '$lib/helpers/timeConversion';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
@@ -17,7 +17,7 @@
|
||||
function isDeployment(data: Models.Deployment | Models.Execution): data is Models.Deployment {
|
||||
if ('buildId' in data) {
|
||||
selectedTab = 'logs';
|
||||
rawData = `${sdkForConsole.client.config.endpoint}/functions/${$log.func.$id}/deployment/${$log.data.$id}?mode=admin&project=${$page.params.project}`;
|
||||
rawData = `${sdk.forConsole.client.config.endpoint}/functions/${$log.func.$id}/deployment/${$log.data.$id}?mode=admin&project=${$page.params.project}`;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@
|
||||
function isExecution(data: Models.Deployment | Models.Execution): data is Models.Execution {
|
||||
if ('trigger' in data) {
|
||||
selectedTab = 'response';
|
||||
rawData = `${sdkForConsole.client.config.endpoint}/functions/${$log.func.$id}/execution/${$log.data.$id}?mode=admin&project=${$page.params.project}`;
|
||||
rawData = `${sdk.forConsole.client.config.endpoint}/functions/${$log.func.$id}/execution/${$log.data.$id}?mode=admin&project=${$page.params.project}`;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
+23
-16
@@ -1,3 +1,4 @@
|
||||
import { getProjectId } from '$lib/helpers/project';
|
||||
import { Project } from '$lib/sdk/project';
|
||||
import { VARS } from '$lib/system';
|
||||
import {
|
||||
@@ -23,21 +24,6 @@ clientConsole.setEndpoint(endpoint).setProject('console');
|
||||
const clientProject = new Client();
|
||||
clientProject.setEndpoint(endpoint).setMode('admin');
|
||||
|
||||
const setProject = (projectId: string): Client => clientProject.setProject(projectId);
|
||||
|
||||
const sdkForConsole = {
|
||||
client: clientConsole,
|
||||
account: new Account(clientConsole),
|
||||
avatars: new Avatars(clientConsole),
|
||||
functions: new Functions(clientConsole),
|
||||
health: new Health(clientConsole),
|
||||
locale: new Locale(clientConsole),
|
||||
projects: new Projects(clientConsole),
|
||||
teams: new Teams(clientConsole),
|
||||
users: new Users(clientConsole),
|
||||
billing: new Billing(clientConsole)
|
||||
};
|
||||
|
||||
const sdkForProject = {
|
||||
client: clientProject,
|
||||
account: new Account(clientProject),
|
||||
@@ -52,4 +38,25 @@ const sdkForProject = {
|
||||
users: new Users(clientProject)
|
||||
};
|
||||
|
||||
export { sdkForConsole, sdkForProject, setProject };
|
||||
export const sdk = {
|
||||
forConsole: {
|
||||
client: clientConsole,
|
||||
account: new Account(clientConsole),
|
||||
avatars: new Avatars(clientConsole),
|
||||
functions: new Functions(clientConsole),
|
||||
health: new Health(clientConsole),
|
||||
locale: new Locale(clientConsole),
|
||||
projects: new Projects(clientConsole),
|
||||
teams: new Teams(clientConsole),
|
||||
users: new Users(clientConsole),
|
||||
billing: new Billing(clientConsole)
|
||||
},
|
||||
get forProject() {
|
||||
const projectId = getProjectId();
|
||||
if (projectId && projectId !== clientProject.config.project) {
|
||||
clientProject.setProject(projectId);
|
||||
}
|
||||
|
||||
return sdkForProject;
|
||||
}
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { writable } from 'svelte/store';
|
||||
import { sdkForProject } from './sdk';
|
||||
import { sdk } from './sdk';
|
||||
|
||||
type UploaderFile = {
|
||||
$id: string;
|
||||
@@ -71,7 +71,7 @@ const createUploader = () => {
|
||||
n.files.unshift(newFile);
|
||||
return n;
|
||||
});
|
||||
const uploadedFile = await sdkForProject.storage.createFile(
|
||||
const uploadedFile = await sdk.forProject.storage.createFile(
|
||||
bucketId,
|
||||
id ?? 'unique()',
|
||||
file,
|
||||
|
||||
@@ -2,7 +2,7 @@ import '@appwrite.io/pink';
|
||||
import '@appwrite.io/pink-icons';
|
||||
import 'tippy.js/dist/tippy.css';
|
||||
import LogRocket from 'logrocket';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import type { LayoutLoad } from './$types';
|
||||
@@ -12,7 +12,7 @@ export const ssr = false;
|
||||
export const load: LayoutLoad = async ({ depends, url }) => {
|
||||
depends(Dependencies.ACCOUNT);
|
||||
try {
|
||||
const account = await sdkForConsole.account.get();
|
||||
const account = await sdk.forConsole.account.get();
|
||||
|
||||
LogRocket.identify(account.$id, {
|
||||
name: account.name,
|
||||
@@ -21,7 +21,7 @@ export const load: LayoutLoad = async ({ depends, url }) => {
|
||||
|
||||
return {
|
||||
account,
|
||||
organizations: sdkForConsole.teams.list()
|
||||
organizations: sdk.forConsole.teams.list()
|
||||
};
|
||||
} catch (error) {
|
||||
const acceptedRoutes = [
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { LayoutLoad } from './$types';
|
||||
|
||||
export const load: LayoutLoad = async () => {
|
||||
const response = await fetch(`${sdkForConsole.client.config.endpoint}/health/version`);
|
||||
const response = await fetch(`${sdk.forConsole.client.config.endpoint}/health/version`);
|
||||
const data = await response.json();
|
||||
|
||||
return {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { Container } from '$lib/layout';
|
||||
import { onMount } from 'svelte';
|
||||
import { user } from '$lib/stores/user';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { base } from '$app/paths';
|
||||
import Delete from './delete.svelte';
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
async function updateName() {
|
||||
try {
|
||||
await sdkForConsole.account.updateName(name);
|
||||
await sdk.forConsole.account.updateName(name);
|
||||
invalidate(Dependencies.ACCOUNT);
|
||||
addNotification({
|
||||
message: 'Name has been updated',
|
||||
@@ -43,7 +43,7 @@
|
||||
}
|
||||
async function updateEmail() {
|
||||
try {
|
||||
await sdkForConsole.account.updateEmail(email, emailPassword);
|
||||
await sdk.forConsole.account.updateEmail(email, emailPassword);
|
||||
invalidate(Dependencies.ACCOUNT);
|
||||
addNotification({
|
||||
message: 'Email has been updated',
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
async function updatePassword() {
|
||||
try {
|
||||
await sdkForConsole.account.updatePassword(newPassword, oldPassword);
|
||||
await sdk.forConsole.account.updatePassword(newPassword, oldPassword);
|
||||
newPassword = oldPassword = null;
|
||||
addNotification({
|
||||
message: 'Password has been updated',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
@@ -10,6 +10,6 @@ export const load: PageLoad = async ({ params }) => {
|
||||
|
||||
return {
|
||||
offset,
|
||||
logs: await sdkForConsole.account.listLogs([Query.offset(offset), Query.limit(PAGE_LIMIT)])
|
||||
logs: await sdk.forConsole.account.listLogs([Query.offset(offset), Query.limit(PAGE_LIMIT)])
|
||||
};
|
||||
};
|
||||
@@ -5,13 +5,13 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
|
||||
export let showDelete = false;
|
||||
|
||||
const deleteAccount = async () => {
|
||||
try {
|
||||
await sdkForConsole.account.updateStatus();
|
||||
await sdk.forConsole.account.updateStatus();
|
||||
showDelete = false;
|
||||
invalidate(Dependencies.ACCOUNT);
|
||||
addNotification({
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
import { Cover, CoverTitle } from '$lib/layout';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { user } from '$lib/stores/user';
|
||||
|
||||
const path = `/console/account`;
|
||||
@@ -38,7 +38,7 @@
|
||||
];
|
||||
|
||||
async function logout() {
|
||||
await sdkForConsole.account.deleteSession('current');
|
||||
await sdk.forConsole.account.deleteSession('current');
|
||||
trackEvent(Submit.AccountLogout);
|
||||
await goto(`${base}/login`);
|
||||
}
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { Container } from '$lib/layout';
|
||||
import CreateOrganization from '../../../createOrganization.svelte';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { CARD_LIMIT } from '$lib/constants';
|
||||
import type { PageData } from './$types';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
const getMemberships = async (teamId: string) => {
|
||||
const memberships = await sdkForConsole.teams.listMemberships(teamId);
|
||||
const memberships = await sdk.forConsole.teams.listMemberships(teamId);
|
||||
return memberships.memberships.map((team) => team.userName);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { CARD_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
@@ -10,7 +10,7 @@ export const load: PageLoad = async ({ params }) => {
|
||||
|
||||
return {
|
||||
offset,
|
||||
organizations: await sdkForConsole.teams.list([
|
||||
organizations: await sdk.forConsole.teams.list([
|
||||
Query.offset(offset),
|
||||
Query.limit(CARD_LIMIT),
|
||||
Query.orderDesc('$createdAt')
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
TableScroll
|
||||
} from '$lib/elements/table';
|
||||
import { Container } from '$lib/layout';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
@@ -23,11 +23,11 @@
|
||||
export let data: PageData;
|
||||
|
||||
const getBrowser = (clientCode: string) => {
|
||||
return sdkForConsole.avatars.getBrowser(clientCode, 40, 40);
|
||||
return sdk.forConsole.avatars.getBrowser(clientCode, 40, 40);
|
||||
};
|
||||
|
||||
const logout = async (session: Models.Session) => {
|
||||
await sdkForConsole.account.deleteSession(session.$id);
|
||||
await sdk.forConsole.account.deleteSession(session.$id);
|
||||
trackEvent(Submit.AccountDeleteSession);
|
||||
if (session.current) {
|
||||
await goto(`${base}/login`);
|
||||
@@ -35,7 +35,7 @@
|
||||
invalidate(Dependencies.ACCOUNT_SESSIONS);
|
||||
};
|
||||
const logoutAll = async () => {
|
||||
await sdkForConsole.account.deleteSessions();
|
||||
await sdk.forConsole.account.deleteSessions();
|
||||
trackEvent(Submit.AccountDeleteAllSessions);
|
||||
await goto(`${base}/login`);
|
||||
invalidate(Dependencies.ACCOUNT_SESSIONS);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ depends }) => {
|
||||
depends(Dependencies.ACCOUNT_SESSIONS);
|
||||
|
||||
return {
|
||||
sessions: await sdkForConsole.account.listSessions()
|
||||
sessions: await sdk.forConsole.account.listSessions()
|
||||
};
|
||||
};
|
||||
@@ -3,7 +3,7 @@
|
||||
import { Pill } from '$lib/elements';
|
||||
import { InputText, Button, FormList } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
const create = async () => {
|
||||
try {
|
||||
const org = await sdkForConsole.teams.create(id ?? ID.unique(), name);
|
||||
const org = await sdk.forConsole.teams.create(id ?? ID.unique(), name);
|
||||
await invalidate(Dependencies.ACCOUNT);
|
||||
dispatch('created');
|
||||
await goto(`/console/organization-${org.$id}`);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import FormList from '$lib/elements/forms/formList.svelte';
|
||||
import { Container } from '$lib/layout';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { ID } from '@aw-labs/appwrite-console';
|
||||
|
||||
let name: string;
|
||||
@@ -21,7 +21,7 @@
|
||||
try {
|
||||
loading = true;
|
||||
const org = await createOrganization();
|
||||
const project = await sdkForConsole.projects.create(
|
||||
const project = await sdk.forConsole.projects.create(
|
||||
id ?? ID.unique(),
|
||||
name,
|
||||
org.$id,
|
||||
@@ -44,7 +44,7 @@
|
||||
}
|
||||
|
||||
async function createOrganization() {
|
||||
return await sdkForConsole.teams.create(ID.unique(), 'Personal Projects');
|
||||
return await sdk.forConsole.teams.create(ID.unique(), 'Personal Projects');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import Header from './header.svelte';
|
||||
import Breadcrumbs from './breadcrumbs.svelte';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { LayoutLoad } from './$types';
|
||||
import { error } from '@sveltejs/kit';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.ORGANIZATION);
|
||||
depends(Dependencies.PAYMENT_METHODS);
|
||||
|
||||
@@ -14,8 +13,8 @@ export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
return {
|
||||
header: Header,
|
||||
breadcrumbs: Breadcrumbs,
|
||||
organization: await sdkForConsole.teams.get(params.organization),
|
||||
members: await sdkForConsole.teams.listMemberships(params.organization)
|
||||
organization: await sdk.forConsole.teams.get(params.organization),
|
||||
members: await sdk.forConsole.teams.listMemberships(params.organization)
|
||||
};
|
||||
} catch (e) {
|
||||
localStorage.removeItem('organization');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { CARD_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
@@ -10,7 +10,7 @@ export const load: PageLoad = async ({ params }) => {
|
||||
|
||||
return {
|
||||
offset,
|
||||
projects: await sdkForConsole.projects.list([
|
||||
projects: await sdk.forConsole.projects.list([
|
||||
Query.offset(offset),
|
||||
Query.limit(CARD_LIMIT),
|
||||
Query.equal('teamId', params.organization),
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
import { InputText, Button, FormList } from '$lib/elements/forms';
|
||||
import { publicKey } from './store';
|
||||
import { paymentMethods, publicKey } from './store';
|
||||
import {
|
||||
loadStripe,
|
||||
type Stripe,
|
||||
@@ -11,7 +11,7 @@
|
||||
} from '@stripe/stripe-js';
|
||||
import { onMount } from 'svelte';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { app } from '$lib/stores/app';
|
||||
@@ -82,11 +82,13 @@
|
||||
|
||||
onMount(async () => {
|
||||
stripe = await loadStripe(publicKey);
|
||||
|
||||
try {
|
||||
paymentMethod = await sdkForConsole.billing.createPaymentMethod($organization.$id);
|
||||
const clientSecret = $paymentMethods?.paymentMethods[0]?.clientSecret;
|
||||
if (!clientSecret) {
|
||||
paymentMethod = await sdk.forConsole.billing.createPaymentMethod($organization.$id);
|
||||
}
|
||||
const options = {
|
||||
clientSecret: paymentMethod.clientSecret,
|
||||
clientSecret: clientSecret ? clientSecret : paymentMethod.clientSecret,
|
||||
appearance: $app.themeInUse === 'dark' ? apperanceDark : apperanceLight
|
||||
};
|
||||
console.log(paymentMethod);
|
||||
@@ -124,7 +126,7 @@
|
||||
// trackError(StripeError, Submit.ProjectCreate);
|
||||
} else if (setupIntent && setupIntent.status === 'succeeded') {
|
||||
try {
|
||||
await sdkForConsole.billing.updatePaymentMethod(
|
||||
await sdk.forConsole.billing.updatePaymentMethod(
|
||||
$organization.$id,
|
||||
paymentMethod.$id,
|
||||
setupIntent.payment_method as string
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { Modal } from '$lib/components';
|
||||
import { InputText, InputEmail, Button, FormList } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { invalidate } from '$app/navigation';
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
const create = async () => {
|
||||
try {
|
||||
const team = await sdkForConsole.teams.createMembership(
|
||||
const team = await sdk.forConsole.teams.createMembership(
|
||||
$organization.$id,
|
||||
email,
|
||||
['owner'],
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { Pill } from '$lib/elements';
|
||||
import { InputText, Button, FormList } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { ID } from '@aw-labs/appwrite-console';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
async function create() {
|
||||
try {
|
||||
isCreating = true;
|
||||
const project = await sdkForConsole.projects.create(
|
||||
const project = await sdk.forConsole.projects.create(
|
||||
id ?? ID.unique(),
|
||||
name,
|
||||
teamId,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { user } from '$lib/stores/user';
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
const deleteMembership = async () => {
|
||||
try {
|
||||
await sdkForConsole.teams.deleteMembership(selectedMember.teamId, selectedMember.$id);
|
||||
await sdk.forConsole.teams.deleteMembership(selectedMember.teamId, selectedMember.$id);
|
||||
|
||||
if (isUser) {
|
||||
await sdkForConsole.account.deleteSession('current');
|
||||
await sdk.forConsole.account.deleteSession('current');
|
||||
await goto(`${base}/login`);
|
||||
} else {
|
||||
dispatch('deleted');
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { organization, organizationList } from '$lib/stores/organization';
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
const deleteOrg = async () => {
|
||||
try {
|
||||
await sdkForConsole.teams.delete($organization.$id);
|
||||
await sdk.forConsole.teams.delete($organization.$id);
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${$organization.name} has been deleted`
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
import { Container } from '$lib/layout';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { members, newMemberModal, organization } from '$lib/stores/organization';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import Delete from '../../deleteMember.svelte';
|
||||
import type { PageData } from './$types';
|
||||
import Delete from '../../deleteMember.svelte';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
const deleted = () => invalidate(Dependencies.ACCOUNT);
|
||||
const resend = async (member: Models.Membership) => {
|
||||
try {
|
||||
await sdkForConsole.teams.createMembership(
|
||||
await sdk.forConsole.teams.createMembership(
|
||||
$organization.$id,
|
||||
member.userEmail,
|
||||
member.roles,
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
import { PAGE_LIMIT } from '$lib/constants';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
return {
|
||||
offset,
|
||||
organizationMembers: await sdkForConsole.teams.listMemberships(params.organization, [
|
||||
organizationMembers: await sdk.forConsole.teams.listMemberships(params.organization, [
|
||||
Query.limit(PAGE_LIMIT),
|
||||
Query.offset(offset)
|
||||
])
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { InputText, Form, Button } from '$lib/elements/forms';
|
||||
import { Container } from '$lib/layout';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { members, organization } from '$lib/stores/organization';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
async function updateName() {
|
||||
try {
|
||||
await sdkForConsole.teams.update($organization.$id, name);
|
||||
await sdk.forConsole.teams.update($organization.$id, name);
|
||||
await invalidate(Dependencies.ORGANIZATION);
|
||||
addNotification({
|
||||
message: 'Name has been updated',
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<script lang="ts">
|
||||
import { UploadBox } from '$lib/components';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
import { stats } from './store';
|
||||
|
||||
let unsubscribe: { (): void };
|
||||
|
||||
onMount(() => {
|
||||
unsubscribe = sdkForConsole.client.subscribe(['project', 'console'], (response) => {
|
||||
unsubscribe = sdk.forConsole.client.subscribe(['project', 'console'], (response) => {
|
||||
if (response.events.includes('stats.connections')) {
|
||||
for (const [projectId, value] of Object.entries(response.payload)) {
|
||||
stats.add(projectId, [new Date(response.timestamp).toISOString(), value]);
|
||||
|
||||
@@ -1,23 +1,19 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { sdkForConsole, sdkForProject, setProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { error } from '@sveltejs/kit';
|
||||
import type { LayoutLoad } from './$types';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.PROJECT);
|
||||
|
||||
if (sdkForProject.client.config.project !== params.project) {
|
||||
setProject(params.project);
|
||||
}
|
||||
|
||||
try {
|
||||
const project = await sdkForConsole.projects.get(params.project);
|
||||
const project = await sdk.forConsole.projects.get(params.project);
|
||||
localStorage.setItem('project', project.$id);
|
||||
localStorage.setItem('organization', project.teamId);
|
||||
|
||||
return {
|
||||
project,
|
||||
organization: await sdkForConsole.teams.get(project.teamId)
|
||||
organization: await sdk.forConsole.teams.get(project.teamId)
|
||||
};
|
||||
} catch (e) {
|
||||
throw error(e.code, e.message);
|
||||
|
||||
@@ -2,9 +2,7 @@ import Breadcrumbs from './breadcrumbs.svelte';
|
||||
import Header from './header.svelte';
|
||||
import type { LayoutLoad } from './$types';
|
||||
|
||||
export const load: LayoutLoad = async ({ parent }) => {
|
||||
await parent();
|
||||
|
||||
export const load: LayoutLoad = async () => {
|
||||
return {
|
||||
header: Header,
|
||||
breadcrumbs: Breadcrumbs
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, url }) => {
|
||||
await parent();
|
||||
export const load: PageLoad = async ({ params, url }) => {
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
const search = url.search.slice(1) ?? undefined;
|
||||
@@ -14,7 +13,7 @@ export const load: PageLoad = async ({ params, parent, url }) => {
|
||||
offset,
|
||||
search,
|
||||
page,
|
||||
users: await sdkForProject.users.list(
|
||||
users: await sdk.forProject.users.list(
|
||||
[Query.limit(PAGE_LIMIT), Query.offset(offset), Query.orderDesc('$createdAt')],
|
||||
search
|
||||
)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { Modal, CopyInput, Alert } from '$lib/components';
|
||||
import { Button, InputText, InputTextarea, InputSwitch, FormList } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Provider } from '$lib/stores/oauth-providers';
|
||||
import { onMount } from 'svelte';
|
||||
import { invalidate } from '$app/navigation';
|
||||
@@ -29,7 +29,7 @@
|
||||
const projectId = $page.params.project;
|
||||
const update = async () => {
|
||||
try {
|
||||
await sdkForConsole.projects.updateOAuth2(
|
||||
await sdk.forConsole.projects.updateOAuth2(
|
||||
projectId,
|
||||
provider.name.toLowerCase(),
|
||||
appId,
|
||||
@@ -84,7 +84,7 @@
|
||||
<p>URI</p>
|
||||
<CopyInput
|
||||
value={`${
|
||||
sdkForConsole.client.config.endpoint
|
||||
sdk.forConsole.client.config.endpoint
|
||||
}/account/sessions/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
|
||||
</div>
|
||||
</FormList>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { page } from '$app/stores';
|
||||
import { Modal, CopyInput, Alert } from '$lib/components';
|
||||
import { Button, InputPassword, InputText, InputSwitch, FormList } from '$lib/elements/forms';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Provider } from '$lib/stores/oauth-providers';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { onMount } from 'svelte';
|
||||
@@ -27,7 +27,7 @@
|
||||
const projectId = $page.params.project;
|
||||
const update = async () => {
|
||||
try {
|
||||
await sdkForConsole.projects.updateOAuth2(
|
||||
await sdk.forConsole.projects.updateOAuth2(
|
||||
projectId,
|
||||
provider.name.toLowerCase(),
|
||||
appId,
|
||||
@@ -93,7 +93,7 @@
|
||||
<p>URI</p>
|
||||
<CopyInput
|
||||
value={`${
|
||||
sdkForConsole.client.config.endpoint
|
||||
sdk.forConsole.client.config.endpoint
|
||||
}/account/sessions/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
|
||||
</div>
|
||||
</FormList>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { page } from '$app/stores';
|
||||
import { Modal, CopyInput, Alert } from '$lib/components';
|
||||
import { Button, InputPassword, InputText, InputSwitch, FormList } from '$lib/elements/forms';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Provider } from '$lib/stores/oauth-providers';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { onMount } from 'svelte';
|
||||
@@ -27,7 +27,7 @@
|
||||
const projectId = $page.params.project;
|
||||
const update = async () => {
|
||||
try {
|
||||
await sdkForConsole.projects.updateOAuth2(
|
||||
await sdk.forConsole.projects.updateOAuth2(
|
||||
projectId,
|
||||
provider.name.toLowerCase(),
|
||||
appId,
|
||||
@@ -93,7 +93,7 @@
|
||||
<p>URI</p>
|
||||
<CopyInput
|
||||
value={`${
|
||||
sdkForConsole.client.config.endpoint
|
||||
sdk.forConsole.client.config.endpoint
|
||||
}/account/sessions/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
|
||||
</div>
|
||||
</FormList>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { Pill } from '$lib/elements';
|
||||
import { InputText, Button, FormList } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { ID } from '@aw-labs/appwrite-console';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
const create = async () => {
|
||||
try {
|
||||
const team = await sdkForProject.teams.create(id ?? ID.unique(), name);
|
||||
const team = await sdk.forProject.teams.create(id ?? ID.unique(), name);
|
||||
name = '';
|
||||
showCreate = false;
|
||||
showCustomId = false;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
FormList
|
||||
} from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { ID } from '@aw-labs/appwrite-console';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
const create = async () => {
|
||||
try {
|
||||
const user = await sdkForProject.users.create(
|
||||
const user = await sdk.forProject.users.create(
|
||||
id ?? ID.unique(),
|
||||
mail,
|
||||
phone,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { page } from '$app/stores';
|
||||
import { Modal, CopyInput, Alert } from '$lib/components';
|
||||
import { Button, InputPassword, InputText, InputSwitch, FormList } from '$lib/elements/forms';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Provider } from '$lib/stores/oauth-providers';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { onMount } from 'svelte';
|
||||
@@ -27,7 +27,7 @@
|
||||
const projectId = $page.params.project;
|
||||
const update = async () => {
|
||||
try {
|
||||
await sdkForConsole.projects.updateOAuth2(
|
||||
await sdk.forConsole.projects.updateOAuth2(
|
||||
projectId,
|
||||
provider.name.toLowerCase(),
|
||||
appId,
|
||||
@@ -91,7 +91,7 @@
|
||||
<p>URI</p>
|
||||
<CopyInput
|
||||
value={`${
|
||||
sdkForConsole.client.config.endpoint
|
||||
sdk.forConsole.client.config.endpoint
|
||||
}/account/sessions/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
|
||||
</div>
|
||||
</FormList>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { page } from '$app/stores';
|
||||
import { Modal, CopyInput, Alert } from '$lib/components';
|
||||
import { Button, InputPassword, InputText, InputSwitch, FormList } from '$lib/elements/forms';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Provider } from '$lib/stores/oauth-providers';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { onMount } from 'svelte';
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
const update = async () => {
|
||||
try {
|
||||
await sdkForConsole.projects.updateOAuth2(
|
||||
await sdk.forConsole.projects.updateOAuth2(
|
||||
projectId,
|
||||
provider.name.toLowerCase(),
|
||||
appId,
|
||||
@@ -84,7 +84,7 @@
|
||||
<p>URI</p>
|
||||
<CopyInput
|
||||
value={`${
|
||||
sdkForConsole.client.config.endpoint
|
||||
sdk.forConsole.client.config.endpoint
|
||||
}/account/sessions/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
|
||||
</div>
|
||||
</FormList>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { page } from '$app/stores';
|
||||
import { Modal, CopyInput, Alert } from '$lib/components';
|
||||
import { Button, InputPassword, InputText, InputSwitch, FormList } from '$lib/elements/forms';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Provider } from '$lib/stores/oauth-providers';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { onMount } from 'svelte';
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
const update = async () => {
|
||||
try {
|
||||
await sdkForConsole.projects.updateOAuth2(
|
||||
await sdk.forConsole.projects.updateOAuth2(
|
||||
projectId,
|
||||
provider.name.toLowerCase(),
|
||||
appId,
|
||||
@@ -93,7 +93,7 @@
|
||||
<p>URI</p>
|
||||
<CopyInput
|
||||
value={`${
|
||||
sdkForConsole.client.config.endpoint
|
||||
sdk.forConsole.client.config.endpoint
|
||||
}/account/sessions/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
|
||||
</div>
|
||||
</FormList>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { page } from '$app/stores';
|
||||
import { Modal, CopyInput, Alert } from '$lib/components';
|
||||
import { Button, InputPassword, InputText, InputSwitch, FormList } from '$lib/elements/forms';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Provider } from '$lib/stores/oauth-providers';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { onMount } from 'svelte';
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
const update = async () => {
|
||||
try {
|
||||
await sdkForConsole.projects.updateOAuth2(
|
||||
await sdk.forConsole.projects.updateOAuth2(
|
||||
projectId,
|
||||
provider.name.toLowerCase(),
|
||||
appId,
|
||||
@@ -103,7 +103,7 @@
|
||||
<p>URI</p>
|
||||
<CopyInput
|
||||
value={`${
|
||||
sdkForConsole.client.config.endpoint
|
||||
sdk.forConsole.client.config.endpoint
|
||||
}/account/sessions/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
|
||||
</div>
|
||||
</FormList>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { Button, InputNumber, InputSelect } from '$lib/elements/forms';
|
||||
import { createTimeUnitPair } from '$lib/helpers/unit';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { project } from '../../store';
|
||||
|
||||
const projectId = $project.$id;
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
async function updateSessionLength() {
|
||||
try {
|
||||
await sdkForConsole.projects.updateAuthDuration(projectId, $baseValue);
|
||||
await sdk.forConsole.projects.updateAuthDuration(projectId, $baseValue);
|
||||
invalidate(Dependencies.PROJECT);
|
||||
|
||||
addNotification({
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { CardGrid, Heading } from '$lib/components';
|
||||
import { Button, Form, InputNumber } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { project } from '../../store';
|
||||
|
||||
const projectId = $project.$id;
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
async function updateSessionsLimit() {
|
||||
try {
|
||||
await sdkForConsole.projects.updateAuthSessionsLimit(projectId, maxSessions);
|
||||
await sdk.forConsole.projects.updateAuthSessionsLimit(projectId, maxSessions);
|
||||
|
||||
addNotification({
|
||||
type: 'success',
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { clickOnEnter } from '$lib/helpers/a11y';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { project } from '../../store';
|
||||
|
||||
const projectId = $project.$id;
|
||||
@@ -31,7 +31,7 @@
|
||||
async function updateLimit() {
|
||||
submitting = true;
|
||||
try {
|
||||
await sdkForConsole.projects.updateAuthLimit(projectId, isLimited ? newLimit : 0);
|
||||
await sdk.forConsole.projects.updateAuthLimit(projectId, isLimited ? newLimit : 0);
|
||||
invalidate(Dependencies.PROJECT).then(() => (submitting = false));
|
||||
addNotification({
|
||||
type: 'success',
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { InputSwitch } from '$lib/elements/forms';
|
||||
import { Container } from '$lib/layout';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { project } from '../../store';
|
||||
import { authMethods, type AuthMethod } from '$lib/stores/auth-methods';
|
||||
import { OAuthProviders } from '$lib/stores/oauth-providers';
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
async function authUpdate(box: AuthMethod) {
|
||||
try {
|
||||
await sdkForConsole.projects.updateAuthStatus(projectId, box.method, box.value);
|
||||
await sdk.forConsole.projects.updateAuthStatus(projectId, box.method, box.value);
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${box.label} authentication has been ${
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, url }) => {
|
||||
await parent();
|
||||
export const load: PageLoad = async ({ params, url }) => {
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
const search = url.search.slice(1) ?? undefined;
|
||||
@@ -14,7 +13,7 @@ export const load: PageLoad = async ({ params, parent, url }) => {
|
||||
offset,
|
||||
search,
|
||||
page,
|
||||
teams: await sdkForProject.teams.list(
|
||||
teams: await sdk.forProject.teams.list(
|
||||
[Query.limit(PAGE_LIMIT), Query.offset(offset), Query.orderDesc('$createdAt')],
|
||||
search
|
||||
)
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
import Breadcrumbs from './breadcrumbs.svelte';
|
||||
import Header from './header.svelte';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { LayoutLoad } from './$types';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.TEAM);
|
||||
try {
|
||||
return {
|
||||
header: Header,
|
||||
breadcrumbs: Breadcrumbs,
|
||||
team: await sdkForProject.teams.get(params.team)
|
||||
team: await sdk.forProject.teams.get(params.team)
|
||||
};
|
||||
} catch (e) {
|
||||
throw error(e.code, e.message);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { CardGrid, Box, Heading, AvatarInitials } from '$lib/components';
|
||||
import { Container } from '$lib/layout';
|
||||
import { Button, InputText, Form } from '$lib/elements/forms';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { toLocaleDateTime } from '$lib/helpers/date';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { team } from './store';
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
async function updateName() {
|
||||
try {
|
||||
await sdkForProject.teams.update($page.params.team, teamName);
|
||||
await sdk.forProject.teams.update($page.params.team, teamName);
|
||||
invalidate(Dependencies.TEAM);
|
||||
addNotification({
|
||||
message: 'Name has been updated',
|
||||
|
||||
+3
-4
@@ -1,17 +1,16 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
return {
|
||||
offset,
|
||||
logs: await sdkForProject.teams.listLogs(params.team, [
|
||||
logs: await sdk.forProject.teams.listLogs(params.team, [
|
||||
Query.limit(PAGE_LIMIT),
|
||||
Query.offset(offset)
|
||||
])
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { Modal, Alert } from '$lib/components';
|
||||
import { Button, InputEmail, InputText, InputTags, FormList } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
|
||||
export let showCreate = false;
|
||||
@@ -19,7 +19,7 @@
|
||||
const url = `${$page.url.origin}/console/project-${$page.params.project}/auth/teams/team-${$page.params.team}/members`;
|
||||
|
||||
try {
|
||||
const user = await sdkForProject.teams.createMembership(
|
||||
const user = await sdk.forProject.teams.createMembership(
|
||||
teamId,
|
||||
email,
|
||||
roles,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
const deleteMembership = async () => {
|
||||
try {
|
||||
await sdkForProject.teams.deleteMembership(
|
||||
await sdk.forProject.teams.deleteMembership(
|
||||
selectedMembership.teamId,
|
||||
selectedMembership.$id
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
|
||||
export let showDelete = false;
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
const deleteTeam = async () => {
|
||||
try {
|
||||
await sdkForProject.teams.delete(team.$id);
|
||||
await sdk.forProject.teams.delete(team.$id);
|
||||
showDelete = false;
|
||||
trackEvent(Submit.TeamDelete);
|
||||
await goto(`${base}/console/project-${$page.params.project}/auth/teams`);
|
||||
|
||||
+3
-4
@@ -1,11 +1,10 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { Dependencies, PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, depends, url }) => {
|
||||
await parent();
|
||||
export const load: PageLoad = async ({ params, depends, url }) => {
|
||||
depends(Dependencies.MEMBERSHIPS);
|
||||
const teamId = params.team;
|
||||
const page = Number(params.page);
|
||||
@@ -15,7 +14,7 @@ export const load: PageLoad = async ({ params, parent, depends, url }) => {
|
||||
return {
|
||||
offset,
|
||||
search,
|
||||
memberships: await sdkForProject.teams.listMemberships(
|
||||
memberships: await sdk.forProject.teams.listMemberships(
|
||||
teamId,
|
||||
[Query.limit(PAGE_LIMIT), Query.offset(offset), Query.orderDesc('$createdAt')],
|
||||
search
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
const { period } = params;
|
||||
const response = await sdkForProject.users.getUsage(period ?? '30d');
|
||||
const response = await sdk.forProject.users.getUsage(period ?? '30d');
|
||||
return {
|
||||
count: response.usersCount as unknown as Models.Metric[],
|
||||
created: response.usersCreate as unknown as Models.Metric[],
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
import type { LayoutLoad } from './$types';
|
||||
import Breadcrumbs from './breadcrumbs.svelte';
|
||||
import Header from './header.svelte';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.USER);
|
||||
|
||||
try {
|
||||
return {
|
||||
header: Header,
|
||||
breadcrumbs: Breadcrumbs,
|
||||
user: await sdkForProject.users.get(params.user)
|
||||
user: await sdk.forProject.users.get(params.user)
|
||||
};
|
||||
} catch (e) {
|
||||
throw error(e.code, e.message);
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
return {
|
||||
offset,
|
||||
logs: await sdkForProject.users.listLogs(params.user, [
|
||||
logs: await sdk.forProject.users.listLogs(params.user, [
|
||||
Query.limit(PAGE_LIMIT),
|
||||
Query.offset(offset)
|
||||
])
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { user } from './store';
|
||||
|
||||
export let showDeleteAll = false;
|
||||
|
||||
const deleteAllSessions = async () => {
|
||||
try {
|
||||
await sdkForProject.users.deleteSessions($page.params.user);
|
||||
await sdk.forProject.users.deleteSessions($page.params.user);
|
||||
invalidate(Dependencies.SESSIONS);
|
||||
showDeleteAll = false;
|
||||
addNotification({
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
|
||||
export let showDelete = false;
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
const deleteMembership = async () => {
|
||||
try {
|
||||
await sdkForProject.teams.deleteMembership(
|
||||
await sdk.forProject.teams.deleteMembership(
|
||||
selectedMembership.teamId,
|
||||
selectedMembership.$id
|
||||
);
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
|
||||
export let showDelete = false;
|
||||
export let selectedSessionId: string;
|
||||
|
||||
const deleteSession = async () => {
|
||||
try {
|
||||
await sdkForProject.users.deleteSession($page.params.user, selectedSessionId);
|
||||
await sdk.forProject.users.deleteSession($page.params.user, selectedSessionId);
|
||||
invalidate(Dependencies.SESSIONS);
|
||||
addNotification({
|
||||
type: 'success',
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { user } from './store';
|
||||
import { project } from '../../store';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
const deleteUser = async () => {
|
||||
try {
|
||||
await sdkForProject.users.delete($user.$id);
|
||||
await sdk.forProject.users.delete($user.$id);
|
||||
showDelete = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
return {
|
||||
memberships: await sdkForProject.users.listMemberships(params.user)
|
||||
memberships: await sdk.forProject.users.listMemberships(params.user)
|
||||
};
|
||||
};
|
||||
+3
-2
@@ -12,7 +12,7 @@
|
||||
import { Pill } from '$lib/elements';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { Container } from '$lib/layout';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import DeleteAllSessions from '../../deleteAllSessions.svelte';
|
||||
import DeleteSessions from '../../deleteSession.svelte';
|
||||
import type { PageData } from './$types';
|
||||
@@ -23,7 +23,8 @@
|
||||
let showDeleteAll = false;
|
||||
let selectedSessionId: string;
|
||||
|
||||
const getBrowser = (clientCode: string) => sdkForProject.avatars.getBrowser(clientCode, 40, 40);
|
||||
const getBrowser = (clientCode: string) =>
|
||||
sdk.forProject.avatars.getBrowser(clientCode, 40, 40);
|
||||
</script>
|
||||
|
||||
<Container>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, depends }) => {
|
||||
export const load: PageLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.SESSIONS);
|
||||
await parent();
|
||||
|
||||
return {
|
||||
sessions: await sdkForProject.users.listSessions(params.user)
|
||||
sessions: await sdk.forProject.users.listSessions(params.user)
|
||||
};
|
||||
};
|
||||
@@ -5,7 +5,7 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Button, Form, InputEmail } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { onMount } from 'svelte';
|
||||
import { user } from './store';
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
async function updateEmail() {
|
||||
try {
|
||||
await sdkForProject.users.updateEmail($user.$id, userEmail);
|
||||
await sdk.forProject.users.updateEmail($user.$id, userEmail);
|
||||
invalidate(Dependencies.USER);
|
||||
addNotification({
|
||||
message: 'Email has been updated',
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Button, Form, InputText } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { onMount } from 'svelte';
|
||||
import { user } from './store';
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
async function updateName() {
|
||||
try {
|
||||
await sdkForProject.users.updateName($user.$id, userName);
|
||||
await sdk.forProject.users.updateName($user.$id, userName);
|
||||
invalidate(Dependencies.USER);
|
||||
addNotification({
|
||||
message: 'Name has been updated',
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
import { CardGrid, Heading } from '$lib/components';
|
||||
import { Button, Form, InputPassword } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { user } from './store';
|
||||
|
||||
let newPassword: string = null;
|
||||
|
||||
async function updatePassword() {
|
||||
try {
|
||||
await sdkForProject.users.updatePassword($user.$id, newPassword);
|
||||
await sdk.forProject.users.updatePassword($user.$id, newPassword);
|
||||
newPassword = null;
|
||||
addNotification({
|
||||
message: 'Password has been updated',
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Button, Form, InputPhone } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { onMount } from 'svelte';
|
||||
import { user } from './store';
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
async function updatePhone() {
|
||||
try {
|
||||
await sdkForProject.users.updatePhone($user.$id, userPhone);
|
||||
await sdk.forProject.users.updatePhone($user.$id, userPhone);
|
||||
invalidate(Dependencies.USER);
|
||||
addNotification({
|
||||
message: 'Phone has been updated',
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Button, Form } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { onMount } from 'svelte';
|
||||
import { user } from './store';
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
try {
|
||||
let updatedPrefs = Object.fromEntries(prefs);
|
||||
|
||||
await sdkForProject.users.updatePrefs($user.$id, updatedPrefs);
|
||||
await sdk.forProject.users.updatePrefs($user.$id, updatedPrefs);
|
||||
invalidate(Dependencies.USER);
|
||||
arePrefsDisabled = true;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { toLocaleDateTime } from '$lib/helpers/date';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { user } from './store';
|
||||
|
||||
let showVerifcationDropdown = false;
|
||||
@@ -15,7 +15,7 @@
|
||||
async function updateVerificationEmail() {
|
||||
showVerifcationDropdown = false;
|
||||
try {
|
||||
await sdkForProject.users.updateEmailVerification($user.$id, !$user.emailVerification);
|
||||
await sdk.forProject.users.updateEmailVerification($user.$id, !$user.emailVerification);
|
||||
invalidate(Dependencies.USER);
|
||||
addNotification({
|
||||
message: `${$user.name || $user.email || $user.phone || 'The account'} has been ${
|
||||
@@ -35,7 +35,7 @@
|
||||
async function updateVerificationPhone() {
|
||||
showVerifcationDropdown = false;
|
||||
try {
|
||||
await sdkForProject.users.updatePhoneVerification($user.$id, !$user.phoneVerification);
|
||||
await sdk.forProject.users.updatePhoneVerification($user.$id, !$user.phoneVerification);
|
||||
invalidate(Dependencies.USER);
|
||||
addNotification({
|
||||
message: `${$user.name || $user.email || $user.phone || 'The account'} has been ${
|
||||
@@ -54,7 +54,7 @@
|
||||
}
|
||||
async function updateStatus() {
|
||||
try {
|
||||
await sdkForProject.users.updateStatus($user.$id, !$user.status);
|
||||
await sdk.forProject.users.updateStatus($user.$id, !$user.status);
|
||||
await invalidate(Dependencies.USER);
|
||||
addNotification({
|
||||
message: `${$user.name || $user.email || $user.phone || 'The account'} has been ${
|
||||
|
||||
@@ -2,9 +2,7 @@ import Breadcrumbs from './breadcrumbs.svelte';
|
||||
import Header from './header.svelte';
|
||||
import type { LayoutLoad } from './$types';
|
||||
|
||||
export const load: LayoutLoad = async ({ parent }) => {
|
||||
await parent();
|
||||
|
||||
export const load: LayoutLoad = async () => {
|
||||
return {
|
||||
header: Header,
|
||||
breadcrumbs: Breadcrumbs
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { CARD_LIMIT } from '$lib/constants';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, CARD_LIMIT);
|
||||
|
||||
return {
|
||||
offset,
|
||||
databases: await sdkForProject.databases.list([
|
||||
databases: await sdk.forProject.databases.list([
|
||||
Query.limit(CARD_LIMIT),
|
||||
Query.offset(offset),
|
||||
Query.orderDesc('$createdAt')
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { Pill } from '$lib/elements';
|
||||
import { Button, InputText, FormList } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { ID } from '@aw-labs/appwrite-console';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
const create = async () => {
|
||||
try {
|
||||
const database = await sdkForProject.databases.create(id ? id : ID.unique(), name);
|
||||
const database = await sdk.forProject.databases.create(id ? id : ID.unique(), name);
|
||||
showCreate = false;
|
||||
dispatch('created', database);
|
||||
addNotification({
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import type { LayoutLoad } from './$types';
|
||||
import Breadcrumbs from './breadcrumbs.svelte';
|
||||
import Header from './header.svelte';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.DATABASE);
|
||||
|
||||
try {
|
||||
return {
|
||||
header: Header,
|
||||
breadcrumbs: Breadcrumbs,
|
||||
database: await sdkForProject.databases.get(params.database)
|
||||
database: await sdk.forProject.databases.get(params.database)
|
||||
};
|
||||
} catch (e) {
|
||||
throw error(e.code, e.message);
|
||||
|
||||
+3
-4
@@ -1,17 +1,16 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { CARD_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, CARD_LIMIT);
|
||||
|
||||
return {
|
||||
offset,
|
||||
collections: await sdkForProject.databases.listCollections(params.database, [
|
||||
collections: await sdk.forProject.databases.listCollections(params.database, [
|
||||
Query.limit(CARD_LIMIT),
|
||||
Query.offset(offset),
|
||||
Query.orderDesc('$createdAt')
|
||||
|
||||
+2
-2
@@ -1,14 +1,14 @@
|
||||
<script lang="ts">
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
import { collection } from './store';
|
||||
|
||||
let unsubscribe: { (): void };
|
||||
|
||||
onMount(() => {
|
||||
unsubscribe = sdkForConsole.client.subscribe('console', (response) => {
|
||||
unsubscribe = sdk.forConsole.client.subscribe('console', (response) => {
|
||||
if (
|
||||
response.events.includes('databases.*.collections.*.attributes.*') ||
|
||||
response.events.includes('databases.*.collections.*.indexes.*')
|
||||
|
||||
+3
-5
@@ -1,19 +1,17 @@
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import type { LayoutLoad } from './$types';
|
||||
import Breadcrumbs from './breadcrumbs.svelte';
|
||||
import Header from './header.svelte';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.COLLECTION);
|
||||
await parent();
|
||||
|
||||
try {
|
||||
return {
|
||||
header: Header,
|
||||
breadcrumbs: Breadcrumbs,
|
||||
collection: await sdkForProject.databases.getCollection(
|
||||
collection: await sdk.forProject.databases.getCollection(
|
||||
params.database,
|
||||
params.collection
|
||||
)
|
||||
|
||||
+9
-10
@@ -1,21 +1,20 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { Dependencies, PAGE_LIMIT } from '$lib/constants';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
export const load: PageLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.DOCUMENTS);
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
return {
|
||||
offset,
|
||||
documents: await sdkForProject.databases.listDocuments(params.database, params.collection, [
|
||||
Query.limit(PAGE_LIMIT),
|
||||
Query.offset(offset),
|
||||
Query.orderDesc('$createdAt')
|
||||
])
|
||||
documents: await sdk.forProject.databases.listDocuments(
|
||||
params.database,
|
||||
params.collection,
|
||||
[Query.limit(PAGE_LIMIT), Query.offset(offset), Query.orderDesc('$createdAt')]
|
||||
)
|
||||
};
|
||||
};
|
||||
+7
-7
@@ -1,19 +1,19 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
return {
|
||||
offset,
|
||||
logs: await sdkForProject.databases.listCollectionLogs(params.database, params.collection, [
|
||||
Query.limit(PAGE_LIMIT),
|
||||
Query.offset(offset)
|
||||
])
|
||||
logs: await sdk.forProject.databases.listCollectionLogs(
|
||||
params.database,
|
||||
params.collection,
|
||||
[Query.limit(PAGE_LIMIT), Query.offset(offset)]
|
||||
)
|
||||
};
|
||||
};
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<script context="module" lang="ts">
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
|
||||
export async function submitBoolean(
|
||||
databaseId: string,
|
||||
@@ -8,7 +8,7 @@
|
||||
key: string,
|
||||
data: Partial<Models.AttributeBoolean>
|
||||
) {
|
||||
await sdkForProject.databases.createBooleanAttribute(
|
||||
await sdk.forProject.databases.createBooleanAttribute(
|
||||
databaseId,
|
||||
collectionId,
|
||||
key,
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<script context="module" lang="ts">
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
|
||||
export async function submitDatetime(
|
||||
databaseId: string,
|
||||
@@ -8,7 +8,7 @@
|
||||
key: string,
|
||||
data: Partial<Models.AttributeDatetime>
|
||||
) {
|
||||
await sdkForProject.databases.createDatetimeAttribute(
|
||||
await sdk.forProject.databases.createDatetimeAttribute(
|
||||
databaseId,
|
||||
collectionId,
|
||||
key,
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { collection } from '../store';
|
||||
import type { Attributes } from '../store';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
const handleDelete = async () => {
|
||||
try {
|
||||
await sdkForProject.databases.deleteAttribute(
|
||||
await sdk.forProject.databases.deleteAttribute(
|
||||
databaseId,
|
||||
$collection.$id,
|
||||
selectedAttribute.key
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
<script context="module" lang="ts">
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
|
||||
export async function submitEmail(
|
||||
databaseId: string,
|
||||
@@ -9,7 +9,7 @@
|
||||
key: string,
|
||||
data: Partial<Models.AttributeEmail>
|
||||
) {
|
||||
await sdkForProject.databases.createEmailAttribute(
|
||||
await sdk.forProject.databases.createEmailAttribute(
|
||||
databaseId,
|
||||
collectionId,
|
||||
key,
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<script context="module" lang="ts">
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
|
||||
export async function submitEnum(
|
||||
databaseId: string,
|
||||
@@ -8,7 +8,7 @@
|
||||
key: string,
|
||||
data: Partial<Models.AttributeEnum>
|
||||
) {
|
||||
await sdkForProject.databases.createEnumAttribute(
|
||||
await sdk.forProject.databases.createEnumAttribute(
|
||||
databaseId,
|
||||
collectionId,
|
||||
key,
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<script context="module" lang="ts">
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
|
||||
export async function submitFloat(
|
||||
databaseId: string,
|
||||
@@ -8,7 +8,7 @@
|
||||
key: string,
|
||||
data: Partial<Models.AttributeFloat>
|
||||
) {
|
||||
await sdkForProject.databases.createFloatAttribute(
|
||||
await sdk.forProject.databases.createFloatAttribute(
|
||||
databaseId,
|
||||
collectionId,
|
||||
key,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
<script context="module" lang="ts">
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
|
||||
export async function submitInteger(
|
||||
@@ -8,7 +8,7 @@
|
||||
key: string,
|
||||
data: Partial<Models.AttributeInteger>
|
||||
) {
|
||||
await sdkForProject.databases.createIntegerAttribute(
|
||||
await sdk.forProject.databases.createIntegerAttribute(
|
||||
databaseId,
|
||||
collectionId,
|
||||
key,
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<script context="module" lang="ts">
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
|
||||
export async function submitIp(
|
||||
databaseId: string,
|
||||
@@ -8,7 +8,7 @@
|
||||
key: string,
|
||||
data: Partial<Models.AttributeIp>
|
||||
) {
|
||||
await sdkForProject.databases.createIpAttribute(
|
||||
await sdk.forProject.databases.createIpAttribute(
|
||||
databaseId,
|
||||
collectionId,
|
||||
key,
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<script context="module" lang="ts">
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
|
||||
export async function submitString(
|
||||
databaseId: string,
|
||||
@@ -8,7 +8,7 @@
|
||||
key: string,
|
||||
data: Partial<Models.AttributeString>
|
||||
) {
|
||||
await sdkForProject.databases.createStringAttribute(
|
||||
await sdk.forProject.databases.createStringAttribute(
|
||||
databaseId,
|
||||
collectionId,
|
||||
key,
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<script context="module" lang="ts">
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
|
||||
export async function submitUrl(
|
||||
databaseId: string,
|
||||
@@ -8,7 +8,7 @@
|
||||
key: string,
|
||||
data: Partial<Models.AttributeUrl>
|
||||
) {
|
||||
await sdkForProject.databases.createUrlAttribute(
|
||||
await sdk.forProject.databases.createUrlAttribute(
|
||||
databaseId,
|
||||
collectionId,
|
||||
key,
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
import { Wizard } from '$lib/layout';
|
||||
import { beforeNavigate, invalidate } from '$app/navigation';
|
||||
import { attributes } from './store';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { page } from '$app/stores';
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
async function create() {
|
||||
try {
|
||||
await sdkForProject.databases.createDocument(
|
||||
await sdk.forProject.databases.createDocument(
|
||||
databaseId,
|
||||
collectionId,
|
||||
$createDocument.id ?? ID.unique(),
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import type { LayoutLoad } from './$types';
|
||||
import Breadcrumbs from './breadcrumbs.svelte';
|
||||
@@ -11,7 +11,7 @@ export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
const { collection } = await parent();
|
||||
|
||||
try {
|
||||
const document = await sdkForProject.databases.getDocument(
|
||||
const document = await sdk.forProject.databases.getDocument(
|
||||
params.database,
|
||||
params.collection,
|
||||
params.document
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
import { CardGrid, Box, Heading, Alert } from '$lib/components';
|
||||
import { Container } from '$lib/layout';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { doc } from './store';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { toLocaleDateTime } from '$lib/helpers/date';
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
async function updatePermissions() {
|
||||
try {
|
||||
await sdkForProject.databases.updateDocument(
|
||||
await sdk.forProject.databases.updateDocument(
|
||||
$doc.$databaseId,
|
||||
$doc.$collectionId,
|
||||
$doc.$id,
|
||||
|
||||
+3
-4
@@ -1,17 +1,16 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
return {
|
||||
offset,
|
||||
logs: await sdkForProject.databases.listDocumentLogs(
|
||||
logs: await sdk.forProject.databases.listDocumentLogs(
|
||||
params.database,
|
||||
params.collection,
|
||||
params.document,
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { collection } from '../store';
|
||||
|
||||
export let showDelete = false;
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
const handleDelete = async () => {
|
||||
try {
|
||||
await sdkForProject.databases.deleteDocument(
|
||||
await sdk.forProject.databases.deleteDocument(
|
||||
databaseId,
|
||||
$page.params.collection,
|
||||
$page.params.document
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
import { doc } from './store';
|
||||
import { onMount } from 'svelte';
|
||||
import { page } from '$app/stores';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { writable } from 'svelte/store';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
async function updateData() {
|
||||
try {
|
||||
await sdkForProject.databases.updateDocument(
|
||||
await sdk.forProject.databases.updateDocument(
|
||||
databaseId,
|
||||
collectionId,
|
||||
documentId,
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
import { Button, FormList, InputSelect, InputText } from '$lib/elements/forms';
|
||||
import { remove } from '$lib/helpers/array';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { indexes, type Attributes } from '../store';
|
||||
import { collection } from '../store';
|
||||
import Select from './select.svelte';
|
||||
@@ -59,7 +59,7 @@
|
||||
creating = true;
|
||||
|
||||
try {
|
||||
await sdkForProject.databases.createIndex(
|
||||
await sdk.forProject.databases.createIndex(
|
||||
databaseId,
|
||||
$collection.$id,
|
||||
key,
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { collection } from '../store';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { page } from '$app/stores';
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
const handleDelete = async () => {
|
||||
try {
|
||||
await sdkForProject.databases.deleteIndex(
|
||||
await sdk.forProject.databases.deleteIndex(
|
||||
databaseId,
|
||||
$collection.$id,
|
||||
selectedIndex.key
|
||||
|
||||
Loaded 100 of 198 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user