diff --git a/package-lock.json b/package-lock.json
index 46a8434389..e7a9968717 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7,7 +7,7 @@
"name": "@appwrite/console",
"dependencies": {
"@analytics/google-analytics": "^1.0.5",
- "@appwrite.io/console": "0.1.0",
+ "@appwrite.io/console": "npm:khushboo-console-vcs@0.0.23",
"@appwrite.io/pink": "^0.0.6-rc.10",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.44.2",
@@ -147,9 +147,10 @@
"integrity": "sha512-1Yw7u/COtxx06BfwlI+kVhsa/upKYzmCNrT4c8QDeCY2KMYlnijkUjtHiPU08HxyTIVB5j6d75O0YWVIHwQS8g=="
},
"node_modules/@appwrite.io/console": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/@appwrite.io/console/-/console-0.1.0.tgz",
- "integrity": "sha512-GzCRUmaXAVgpGwxBNI3PrtCLHz7CM+epBHDDTHw8B2u61KbijGBO3GrwreXy91fy00RJiEzGlMSRzDgwsF3Tsg==",
+ "name": "khushboo-console-vcs",
+ "version": "0.0.23",
+ "resolved": "https://registry.npmjs.org/khushboo-console-vcs/-/khushboo-console-vcs-0.0.23.tgz",
+ "integrity": "sha512-WY5Izd49Ys9kdw7+SIWexT0dZF34L7eDe0J1WR4RjRyTGeb9Fk4S/57QRhCYGtVOZsnLBwmhoIMHg/XIo98ICQ==",
"dependencies": {
"cross-fetch": "3.1.5",
"isomorphic-form-data": "2.0.0"
diff --git a/package.json b/package.json
index 0e7ec8d6e1..691876c08a 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
},
"dependencies": {
"@analytics/google-analytics": "^1.0.5",
- "@appwrite.io/console": "0.1.0",
+ "@appwrite.io/console": "npm:khushboo-console-vcs@0.0.23",
"@appwrite.io/pink": "^0.0.6-rc.10",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.44.2",
diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts
index 84c178cc46..daf9185a45 100644
--- a/src/lib/actions/analytics.ts
+++ b/src/lib/actions/analytics.ts
@@ -173,6 +173,8 @@ export enum Submit {
FunctionUpdateSchedule = 'submit_function_update_schedule',
FunctionUpdateTimeout = 'submit_function_update_timeout',
FunctionUpdateEvents = 'submit_function_update_events',
+ FunctionUpdateVcs = 'submit_function_update_vcs',
+ InstallationDelete = 'submit_installation_delete',
DeploymentCreate = 'submit_deployment_create',
DeploymentDelete = 'submit_deployment_delete',
DeploymentUpdate = 'submit_deployment_update',
diff --git a/src/lib/constants.ts b/src/lib/constants.ts
index 2b3b701257..c37501aecb 100644
--- a/src/lib/constants.ts
+++ b/src/lib/constants.ts
@@ -32,6 +32,7 @@ export enum Dependencies {
KEY = 'dependency:key',
KEYS = 'dependency:keys',
DOMAINS = 'dependency:domains',
+ INSTALLATIONS = 'dependency:installations',
WEBHOOK = 'dependency:webhook',
WEBHOOKS = 'dependency:webhooks'
}
diff --git a/src/lib/stores/sdk.ts b/src/lib/stores/sdk.ts
index 481b930ead..2f0d81a90f 100644
--- a/src/lib/stores/sdk.ts
+++ b/src/lib/stores/sdk.ts
@@ -12,7 +12,8 @@ import {
Projects,
Storage,
Teams,
- Users
+ Users,
+ Vcs
} from '@appwrite.io/console';
const endpoint = VARS.APPWRITE_ENDPOINT ?? `${globalThis?.location?.origin}/v1`;
@@ -33,7 +34,8 @@ const sdkForProject = {
project: new Project(clientProject),
storage: new Storage(clientProject),
teams: new Teams(clientProject),
- users: new Users(clientProject)
+ users: new Users(clientProject),
+ vcs: new Vcs(clientProject)
};
export const sdk = {
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte
index 94aadbc6cd..48fa83c8af 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte
@@ -28,6 +28,7 @@
import Variable from '../../createVariable.svelte';
import { execute, func } from '../store';
import UploadVariables from './uploadVariables.svelte';
+ import GitConnection from './gitConnection.svelte';
import {
Table,
TableBody,
@@ -45,6 +46,7 @@
const functionId = $page.params.function;
let showDelete = false;
let selectedVar: Models.Variable = null;
+ let showGitConnection = false;
let showVariablesUpload = false;
let showVariablesModal = false;
let showVariablesDropdown = [];
@@ -71,7 +73,9 @@
$func.events || undefined,
$func.schedule || undefined,
$func.timeout || undefined,
- $func.enabled
+ $func.enabled,
+ $func.vcsInstallationId || undefined,
+ $func.repositoryId || undefined
);
await invalidate(Dependencies.FUNCTION);
addNotification({
@@ -97,7 +101,9 @@
$func.events || undefined,
$func.schedule || undefined,
$func.timeout || undefined,
- $func.enabled
+ $func.enabled,
+ $func.vcsInstallationId || undefined,
+ $func.repositoryId || undefined
);
await invalidate(Dependencies.FUNCTION);
addNotification({
@@ -123,7 +129,9 @@
$func.events || undefined,
functionSchedule,
$func.timeout || undefined,
- $func.enabled
+ $func.enabled,
+ $func.vcsInstallationId || undefined,
+ $func.repositoryId || undefined
);
await invalidate(Dependencies.FUNCTION);
addNotification({
@@ -149,7 +157,9 @@
$func.events || undefined,
$func.schedule || undefined,
timeout,
- $func.enabled
+ $func.enabled,
+ $func.vcsInstallationId || undefined,
+ $func.repositoryId || undefined
);
await invalidate(Dependencies.FUNCTION);
addNotification({
@@ -166,6 +176,35 @@
}
}
+ async function disconnectVcs() {
+ try {
+ await sdk.forProject.functions.update(
+ functionId,
+ $func.name,
+ $func.execute || undefined,
+ $func.events || undefined,
+ $func.schedule || undefined,
+ timeout,
+ $func.enabled,
+ '',
+ '',
+ ''
+ );
+ await invalidate(Dependencies.FUNCTION);
+ addNotification({
+ type: 'success',
+ message: 'Git has been disconnected'
+ });
+ trackEvent(Submit.FunctionUpdateVcs);
+ } catch (error) {
+ addNotification({
+ type: 'error',
+ message: error.message
+ });
+ trackError(error, Submit.FunctionUpdateVcs);
+ }
+ }
+
async function handleVariableCreated(event: CustomEvent 1. Select installation: No installation found. Create one to continue.
+ 2. Select repository:
+
+
+ {#if repositories === null}
+ Loading...
+ No repository found. You might be missing permissions on your Git
+ provider.
+
+
+ {#each installations.installations as installation (installation.$id)}
+
+
+
+ {/each}
+
+
+
+
+
+
+
+
+
+
+ {#each repositories.repositories as repository (repository.id)}
+
+
+
+ {/each}
+
+
+
+
+
+
+
+
+
+ Are you sure you want to delete {selectedInstallation.$id} from '{$project.name}'? +
+ {/if} ++ You can find a list of domain providers and their DNS setting documentation here. If your domain provider isn't listed, please contact us, and we'll include their + settings as well. +
+Changes may take some time to take effect depending on your provider.
+ ++ {!certificate ? 'Generating SSL certificate' : 'Generated SSL certificate'} +
+Domain has been verified
+ {:else} + {#if isVerifying} + + {:else} +Domain is pending verification
+ {/if} + {#if !isVerified} + + {/if} +