Skip to content

Commit

Permalink
Backups beta
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Aug 28, 2024
1 parent 5b34417 commit a132bc0
Show file tree
Hide file tree
Showing 84 changed files with 3,497 additions and 809 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Appwrite Console SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-console.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.5.10-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version 1.6.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).**
**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).**

Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Console SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)

Expand All @@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console";
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:

```html
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@1.0.1"></script>
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@1.1.0-rc.1"></script>
```


Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Client, Functions } from "@appwrite.io/console";
import { Client, Account } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const functions = new Functions(client);
const account = new Account(client);

const result = await functions.listSpecifications();
const result = await account.createPaymentMethod();

console.log(result);
3 changes: 2 additions & 1 deletion docs/examples/account/delete-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const client = new Client()
const account = new Account(client);

const result = await account.deleteMfaAuthenticator(
AuthenticatorType.Totp // type
AuthenticatorType.Totp, // type
'<OTP>' // otp
);

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/account/delete-payment-method.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Account } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const account = new Account(client);

const result = await account.deletePaymentMethod(
'<PAYMENT_METHOD_ID>' // paymentMethodId
);

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/account/get-billing-address.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Account } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const account = new Account(client);

const result = await account.getBillingAddress(
'<BILLING_ADDRESS_ID>' // billingAddressId
);

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/account/get-payment-method.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Account } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const account = new Account(client);

const result = await account.getPaymentMethod(
'<PAYMENT_METHOD_ID>' // paymentMethodId
);

console.log(result);
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Client, Functions } from "@appwrite.io/console";
import { Client, Account } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const functions = new Functions(client);
const account = new Account(client);

const result = await functions.getTemplate(
'<TEMPLATE_ID>' // templateId
const result = await account.listBillingAddresses(
'' // queries (optional)
);

console.log(result);
14 changes: 14 additions & 0 deletions docs/examples/account/list-credits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Client, Account } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const account = new Account(client);

const result = await account.listCredits(
'<ORGANIZATION_ID>', // organizationId
'' // queries (optional)
);

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/account/list-invoices.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Account } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const account = new Account(client);

const result = await account.listInvoices(
'' // queries (optional)
);

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/account/list-payment-methods.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Account } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const account = new Account(client);

const result = await account.listPaymentMethods(
'' // queries (optional)
);

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/account/update-payment-method-mandate-options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Account } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const account = new Account(client);

const result = await account.updatePaymentMethodMandateOptions(
'<PAYMENT_METHOD_ID>' // paymentMethodId
);

console.log(result);
15 changes: 15 additions & 0 deletions docs/examples/account/update-payment-method-provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Client, Account } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const account = new Account(client);

const result = await account.updatePaymentMethodProvider(
'<PAYMENT_METHOD_ID>', // paymentMethodId
'<PROVIDER_METHOD_ID>', // providerMethodId
'<NAME>' // name
);

console.log(result);
15 changes: 15 additions & 0 deletions docs/examples/account/update-payment-method.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Client, Account } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const account = new Account(client);

const result = await account.updatePaymentMethod(
'<PAYMENT_METHOD_ID>', // paymentMethodId
1, // expiryMonth
2024 // expiryYear
);

console.log(result);
14 changes: 14 additions & 0 deletions docs/examples/backups/create-archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Client, Backups } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const backups = new Backups(client);

const result = await backups.createArchive(
[], // services
'<RESOURCE_ID>' // resourceId (optional)
);

console.log(result);
19 changes: 19 additions & 0 deletions docs/examples/backups/create-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Client, Backups } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const backups = new Backups(client);

const result = await backups.createPolicy(
'<POLICY_ID>', // policyId
[], // services
1, // retention
'', // schedule
'<NAME>', // name (optional)
'<RESOURCE_ID>', // resourceId (optional)
false // enabled (optional)
);

console.log(result);
16 changes: 16 additions & 0 deletions docs/examples/backups/create-restoration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Client, Backups } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const backups = new Backups(client);

const result = await backups.createRestoration(
'<ARCHIVE_ID>', // archiveId
[], // services
'<NEW_RESOURCE_ID>', // newResourceId (optional)
'<NEW_RESOURCE_NAME>' // newResourceName (optional)
);

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/backups/delete-archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Backups } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const backups = new Backups(client);

const result = await backups.deleteArchive(
'<ARCHIVE_ID>' // archiveId
);

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/backups/delete-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Backups } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const backups = new Backups(client);

const result = await backups.deletePolicy(
'<POLICY_ID>' // policyId
);

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/backups/get-archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Backups } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const backups = new Backups(client);

const result = await backups.getArchive(
'<ARCHIVE_ID>' // archiveId
);

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/backups/get-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Backups } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const backups = new Backups(client);

const result = await backups.getPolicy(
'<POLICY_ID>' // policyId
);

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/backups/get-restoration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Backups } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const backups = new Backups(client);

const result = await backups.getRestoration(
'<RESTORATION_ID>' // restorationId
);

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/backups/list-archives.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Backups } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const backups = new Backups(client);

const result = await backups.listArchives(
'' // queries (optional)
);

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/backups/list-policies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Backups } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const backups = new Backups(client);

const result = await backups.listPolicies(
'' // queries (optional)
);

console.log(result);
13 changes: 13 additions & 0 deletions docs/examples/backups/list-restorations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Backups } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const backups = new Backups(client);

const result = await backups.listRestorations(
'' // queries (optional)
);

console.log(result);
17 changes: 17 additions & 0 deletions docs/examples/backups/update-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Client, Backups } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const backups = new Backups(client);

const result = await backups.updatePolicy(
'<POLICY_ID>', // policyId
'<NAME>', // name (optional)
1, // retention (optional)
'', // schedule (optional)
false // enabled (optional)
);

console.log(result);
17 changes: 17 additions & 0 deletions docs/examples/console/create-source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Client, Console } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);

const result = await console.createSource(
'<REF>', // ref (optional)
'https://example.com', // referrer (optional)
'<UTM_SOURCE>', // utmSource (optional)
'<UTM_CAMPAIGN>', // utmCampaign (optional)
'<UTM_MEDIUM>' // utmMedium (optional)
);

console.log(result);
Loading

0 comments on commit a132bc0

Please sign in to comment.