Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
# and commit this file to your remote git repository to share the goodness with others.

# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart

tasks:
- init: npm install && npm run build
command: npm run dev
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependencies": {
"@analytics/google-analytics": "^1.0.5",
"@appwrite.io/pink": "^0.0.4",
"@aw-labs/appwrite-console": "^13.1.0",
"@aw-labs/appwrite-console": "npm:everly-appwrite-console@7.2.0",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.36.0",
"@sentry/tracing": "^7.36.0",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/sdk/project.ts → src/lib/sdk/appwrite-project.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Models, Payload } from '@aw-labs/appwrite-console';
import { Service } from './service';

export class Project extends Service {
export class AppwriteProject extends Service {
/**
* Get usage stats for a project
*
Expand Down
12 changes: 8 additions & 4 deletions src/lib/stores/sdk.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { Project } from '$lib/sdk/project';
import { AppwriteProject } from '$lib/sdk/appwrite-project';
import { VARS } from '$lib/system';
import {
Account,
Admin,
Avatars,
Client,
Databases,
Functions,
Health,
Locale,
Projects,
Project,
Storage,
Teams,
Users
Expand All @@ -27,18 +28,20 @@ const setProject = (projectId: string): Client => clientProject.setProject(proje
const sdkForConsole = {
client: clientConsole,
account: new Account(clientConsole),
admin: new Admin(clientConsole),
avatars: new Avatars(clientConsole),
functions: new Functions(clientConsole),
health: new Health(clientConsole),
locale: new Locale(clientConsole),
projects: new Projects(clientConsole),
project: new Project(clientConsole),
teams: new Teams(clientConsole),
users: new Users(clientConsole)
};

const sdkForProject = {
client: clientProject,
account: new Account(clientProject),
admin: new Admin(clientConsole),
avatars: new Avatars(clientProject),
databases: new Databases(clientProject),
functions: new Functions(clientProject),
Expand All @@ -47,7 +50,8 @@ const sdkForProject = {
project: new Project(clientProject),
storage: new Storage(clientProject),
teams: new Teams(clientProject),
users: new Users(clientProject)
users: new Users(clientProject),
appwriteProject: new AppwriteProject(clientProject)
};

export { sdkForConsole, sdkForProject, setProject };
2 changes: 1 addition & 1 deletion src/routes/console/onboarding/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
try {
loading = true;
const org = await createOrganization();
const project = await sdkForConsole.projects.create(
const project = await sdkForConsole.project.create(
id ?? ID.unique(),
name,
org.$id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const load: PageLoad = async ({ params }) => {

return {
offset,
projects: await sdkForConsole.projects.list([
projects: await sdkForConsole.admin.listProjects([
Query.offset(offset),
Query.limit(CARD_LIMIT),
Query.equal('teamId', params.organization),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
async function create() {
try {
isCreating = true;
const project = await sdkForConsole.projects.create(
const project = await sdkForConsole.project.create(
id ?? ID.unique(),
name,
teamId,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/console/project-[project]/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const load: LayoutLoad = async ({ params, depends }) => {
}

try {
const project = await sdkForConsole.projects.get(params.project);
const project = await sdkForConsole.project.get(params.project);
localStorage.setItem('project', project.$id);
localStorage.setItem('organization', project.teamId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
const projectId = $page.params.project;
const update = async () => {
try {
await sdkForConsole.projects.updateOAuth2(
await sdkForConsole.project.updateOAuth2(
projectId,
provider.name.toLowerCase(),
appId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
const projectId = $page.params.project;
const update = async () => {
try {
await sdkForConsole.projects.updateOAuth2(
await sdkForConsole.project.updateOAuth2(
projectId,
provider.name.toLowerCase(),
appId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
const projectId = $page.params.project;
const update = async () => {
try {
await sdkForConsole.projects.updateOAuth2(
await sdkForConsole.project.updateOAuth2(
projectId,
provider.name.toLowerCase(),
appId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
const projectId = $page.params.project;
const update = async () => {
try {
await sdkForConsole.projects.updateOAuth2(
await sdkForConsole.project.updateOAuth2(
projectId,
provider.name.toLowerCase(),
appId,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/console/project-[project]/auth/mainOAuth.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

const update = async () => {
try {
await sdkForConsole.projects.updateOAuth2(
await sdkForConsole.project.updateOAuth2(
projectId,
provider.name.toLowerCase(),
appId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

const update = async () => {
try {
await sdkForConsole.projects.updateOAuth2(
await sdkForConsole.project.updateOAuth2(
projectId,
provider.name.toLowerCase(),
appId,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/console/project-[project]/auth/oktaOAuth.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

const update = async () => {
try {
await sdkForConsole.projects.updateOAuth2(
await sdkForConsole.project.updateOAuth2(
projectId,
provider.name.toLowerCase(),
appId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

async function updateSessionLength() {
try {
await sdkForConsole.projects.updateAuthDuration(projectId, $baseValue);
await sdkForConsole.project.updateAuthDuration(projectId, $baseValue);
invalidate(Dependencies.PROJECT);

addNotification({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

async function updateSessionsLimit() {
try {
await sdkForConsole.projects.updateAuthSessionsLimit(projectId, maxSessions);
await sdkForConsole.project.updateAuthSessionsLimit(projectId, maxSessions);

addNotification({
type: 'success',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
async function updateLimit() {
submitting = true;
try {
await sdkForConsole.projects.updateAuthLimit(projectId, isLimited ? newLimit : 0);
await sdkForConsole.project.updateAuthLimit(projectId, isLimited ? newLimit : 0);
invalidate(Dependencies.PROJECT).then(() => (submitting = false));
addNotification({
type: 'success',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

async function authUpdate(box: AuthMethod) {
try {
await sdkForConsole.projects.updateAuthStatus(projectId, box.method, box.value);
await sdkForConsole.project.updateAuthStatus(projectId, box.method, box.value);
addNotification({
type: 'success',
message: `${box.label} authentication has been ${
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ selectedTab.set('keys');
export const load: PageLoad = async ({ params, depends }) => {
depends(Dependencies.KEYS);
return {
keys: await sdkForConsole.projects.listKeys(params.project)
keys: await sdkForConsole.project.listKeys(params.project)
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { PageLoad } from './$types';
export const load: PageLoad = async ({ params, depends }) => {
depends(Dependencies.KEY);

const key = await sdkForConsole.projects.getKey(params.project, params.key);
const key = await sdkForConsole.project.getKey(params.project, params.key);
if (key.expire) {
key.expire = new Date(key.expire).toISOString().slice(0, 23);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

async function updateName() {
try {
await sdkForConsole.projects.updateKey(
await sdkForConsole.project.updateKey(
$project.$id,
$key.$id,
name,
Expand All @@ -53,7 +53,7 @@

async function updateScopes() {
try {
await sdkForConsole.projects.updateKey(
await sdkForConsole.project.updateKey(
$project.$id,
$key.$id,
$key.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

async function handleDelete() {
try {
await sdkForConsole.projects.deleteKey($project.$id, $key.$id);
await sdkForConsole.project.deleteKey($project.$id, $key.$id);
showDelete = false;
addNotification({
type: 'success',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

async function updateExpire() {
try {
await sdkForConsole.projects.updateKey(
await sdkForConsole.project.updateKey(
$project.$id,
$key.$id,
$key.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

async function onFinish() {
try {
const { $id } = await sdkForConsole.projects.createKey(
const { $id } = await sdkForConsole.project.createKey(
$page.params.project,
$key.name,
$key.scopes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ selectedTab.set('platforms');
export const load: PageLoad = async ({ params, depends }) => {
depends(Dependencies.PLATFORMS);
return {
platforms: await sdkForConsole.projects.listPlatforms(params.project)
platforms: await sdkForConsole.project.listPlatforms(params.project)
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export const load: PageLoad = async ({ params, depends }) => {
return {
header: Header,
breadcrumbs: Breadcrumbs,
platform: await sdkForConsole.projects.getPlatform(params.project, params.platform)
platform: await sdkForConsole.project.getPlatform(params.project, params.platform)
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
async function updateName() {
updating = true;
try {
await sdkForConsole.projects.updatePlatform(
await sdkForConsole.project.updatePlatform(
$project.$id,
$platform.$id,
name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

const updateHostname = async () => {
try {
await sdkForConsole.projects.updatePlatform(
await sdkForConsole.project.updatePlatform(
$project.$id,
$platform.$id,
$platform.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

const updateHostname = async () => {
try {
await sdkForConsole.projects.updatePlatform(
await sdkForConsole.project.updatePlatform(
$project.$id,
$platform.$id,
$platform.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

const updateHostname = async () => {
try {
await sdkForConsole.projects.updatePlatform(
await sdkForConsole.project.updatePlatform(
$project.$id,
$platform.$id,
$platform.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

const updateHostname = async () => {
try {
await sdkForConsole.projects.updatePlatform(
await sdkForConsole.project.updatePlatform(
$project.$id,
$platform.$id,
$platform.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

const updateHostname = async () => {
try {
await sdkForConsole.projects.updatePlatform(
await sdkForConsole.project.updatePlatform(
$project.$id,
$platform.$id,
$platform.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

const handleDelete = async () => {
try {
await sdkForConsole.projects.deletePlatform($project.$id, $platform.$id);
await sdkForConsole.project.deletePlatform($project.$id, $platform.$id);
showDelete = false;
addNotification({
type: 'success',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

const updateHostname = async () => {
try {
await sdkForConsole.projects.updatePlatform(
await sdkForConsole.project.updatePlatform(
$project.$id,
$platform.$id,
$platform.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

const updateHostname = async () => {
try {
await sdkForConsole.projects.updatePlatform(
await sdkForConsole.project.updatePlatform(
$project.$id,
$platform.$id,
$platform.name,
Expand Down
Loading