@appwrite.io/console 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/.github/workflows/autoclose.yml +1 -1
  2. package/README.md +1 -1
  3. package/dist/cjs/sdk.js +4877 -3337
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +4876 -3338
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +4877 -3337
  8. package/docs/examples/account/create-payment-method.md +11 -0
  9. package/docs/examples/account/delete-payment-method.md +13 -0
  10. package/docs/examples/account/get-billing-address.md +13 -0
  11. package/docs/examples/account/get-payment-method.md +13 -0
  12. package/docs/examples/account/list-billing-addresses.md +13 -0
  13. package/docs/examples/account/list-credits.md +14 -0
  14. package/docs/examples/account/list-invoices.md +13 -0
  15. package/docs/examples/account/list-payment-methods.md +13 -0
  16. package/docs/examples/account/update-payment-method-mandate-options.md +13 -0
  17. package/docs/examples/account/update-payment-method-provider.md +15 -0
  18. package/docs/examples/account/update-payment-method.md +15 -0
  19. package/docs/examples/backups/create-archive.md +14 -0
  20. package/docs/examples/backups/create-policy.md +19 -0
  21. package/docs/examples/backups/create-restoration.md +16 -0
  22. package/docs/examples/backups/delete-archive.md +13 -0
  23. package/docs/examples/backups/delete-policy.md +13 -0
  24. package/docs/examples/backups/get-archive.md +13 -0
  25. package/docs/examples/backups/get-policy.md +13 -0
  26. package/docs/examples/backups/get-restoration.md +13 -0
  27. package/docs/examples/backups/list-archives.md +13 -0
  28. package/docs/examples/backups/list-policies.md +13 -0
  29. package/docs/examples/backups/list-restorations.md +13 -0
  30. package/docs/examples/backups/update-policy.md +17 -0
  31. package/docs/examples/console/create-source.md +17 -0
  32. package/docs/examples/console/get-campaign.md +13 -0
  33. package/docs/examples/console/get-copon.md +13 -0
  34. package/docs/examples/console/plans.md +11 -0
  35. package/docs/examples/console/regions.md +11 -0
  36. package/docs/examples/health/get-queue-billing-aggregation.md +13 -0
  37. package/docs/examples/health/get-queue-priority-builds.md +13 -0
  38. package/docs/examples/organizations/add-credit.md +14 -0
  39. package/docs/examples/organizations/create-invoice-payment.md +15 -0
  40. package/docs/examples/organizations/create.md +17 -0
  41. package/docs/examples/organizations/delete-backup-payment-method.md +13 -0
  42. package/docs/examples/organizations/delete-billing-address.md +13 -0
  43. package/docs/examples/organizations/delete-default-payment-method.md +13 -0
  44. package/docs/examples/organizations/delete.md +13 -0
  45. package/docs/examples/organizations/get-aggregation.md +14 -0
  46. package/docs/examples/organizations/get-billing-address.md +14 -0
  47. package/docs/examples/organizations/get-credit.md +14 -0
  48. package/docs/examples/organizations/get-invoice-download.md +14 -0
  49. package/docs/examples/organizations/get-invoice-view.md +14 -0
  50. package/docs/examples/organizations/get-invoice.md +14 -0
  51. package/docs/examples/organizations/get-payment-method.md +14 -0
  52. package/docs/examples/organizations/get-plan.md +13 -0
  53. package/docs/examples/organizations/get-scopes.md +13 -0
  54. package/docs/examples/organizations/get-usage.md +15 -0
  55. package/docs/examples/organizations/list-aggregations.md +14 -0
  56. package/docs/examples/organizations/list-invoices.md +14 -0
  57. package/docs/examples/organizations/list.md +14 -0
  58. package/docs/examples/organizations/set-backup-payment-method.md +14 -0
  59. package/docs/examples/organizations/set-billing-address.md +14 -0
  60. package/docs/examples/organizations/set-billing-email.md +14 -0
  61. package/docs/examples/organizations/set-billing-tax-id.md +14 -0
  62. package/docs/examples/organizations/set-default-payment-method.md +14 -0
  63. package/docs/examples/organizations/update-budget.md +15 -0
  64. package/docs/examples/organizations/update-plan.md +16 -0
  65. package/package.json +1 -1
  66. package/src/client.ts +1 -1
  67. package/src/enums/billing-plan.ts +5 -0
  68. package/src/enums/runtime.ts +2 -5
  69. package/src/index.ts +3 -0
  70. package/src/models.ts +1120 -1
  71. package/src/services/account.ts +336 -0
  72. package/src/services/backups.ts +425 -0
  73. package/src/services/console.ts +148 -0
  74. package/src/services/health.ts +56 -0
  75. package/src/services/organizations.ts +924 -0
  76. package/types/enums/billing-plan.d.ts +5 -0
  77. package/types/enums/runtime.d.ts +2 -5
  78. package/types/index.d.ts +3 -0
  79. package/types/models.d.ts +1120 -1
  80. package/types/services/account.d.ts +103 -0
  81. package/types/services/backups.d.ts +128 -0
  82. package/types/services/console.d.ts +47 -0
  83. package/types/services/health.d.ts +18 -0
  84. package/types/services/organizations.d.ts +282 -0
  85. package/.travis.yml +0 -32
@@ -0,0 +1,14 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.getInvoice(
10
+ '<ORGANIZATION_ID>', // organizationId
11
+ '<INVOICE_ID>' // invoiceId
12
+ );
13
+
14
+ console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.getPaymentMethod(
10
+ '<ORGANIZATION_ID>', // organizationId
11
+ '<PAYMENT_METHOD_ID>' // paymentMethodId
12
+ );
13
+
14
+ console.log(result);
@@ -0,0 +1,13 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.getPlan(
10
+ '<ORGANIZATION_ID>' // organizationId
11
+ );
12
+
13
+ console.log(result);
@@ -0,0 +1,13 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.getScopes(
10
+ '<ORGANIZATION_ID>' // organizationId
11
+ );
12
+
13
+ console.log(result);
@@ -0,0 +1,15 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.getUsage(
10
+ '<ORGANIZATION_ID>', // organizationId
11
+ '', // startDate (optional)
12
+ '' // endDate (optional)
13
+ );
14
+
15
+ console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.listAggregations(
10
+ '<ORGANIZATION_ID>', // organizationId
11
+ [] // queries (optional)
12
+ );
13
+
14
+ console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.listInvoices(
10
+ '<ORGANIZATION_ID>', // organizationId
11
+ [] // queries (optional)
12
+ );
13
+
14
+ console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.list(
10
+ [], // queries (optional)
11
+ '<SEARCH>' // search (optional)
12
+ );
13
+
14
+ console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.setBackupPaymentMethod(
10
+ '<ORGANIZATION_ID>', // organizationId
11
+ '<PAYMENT_METHOD_ID>' // paymentMethodId
12
+ );
13
+
14
+ console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.setBillingAddress(
10
+ '<ORGANIZATION_ID>', // organizationId
11
+ '<BILLING_ADDRESS_ID>' // billingAddressId
12
+ );
13
+
14
+ console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.setBillingEmail(
10
+ '<ORGANIZATION_ID>', // organizationId
11
+ 'email@example.com' // billingEmail
12
+ );
13
+
14
+ console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.setBillingTaxId(
10
+ '<ORGANIZATION_ID>', // organizationId
11
+ '<TAX_ID>' // taxId
12
+ );
13
+
14
+ console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.setDefaultPaymentMethod(
10
+ '<ORGANIZATION_ID>', // organizationId
11
+ '<PAYMENT_METHOD_ID>' // paymentMethodId
12
+ );
13
+
14
+ console.log(result);
@@ -0,0 +1,15 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.updateBudget(
10
+ '<ORGANIZATION_ID>', // organizationId
11
+ 0, // budget
12
+ [] // alerts (optional)
13
+ );
14
+
15
+ console.log(result);
@@ -0,0 +1,16 @@
1
+ import { Client, Organizations, } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.updatePlan(
10
+ '<ORGANIZATION_ID>', // organizationId
11
+ .Tier0, // billingPlan
12
+ '<PAYMENT_METHOD_ID>', // paymentMethodId (optional)
13
+ '<BILLING_ADDRESS_ID>' // billingAddressId (optional)
14
+ );
15
+
16
+ console.log(result);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@appwrite.io/console",
3
3
  "homepage": "https://appwrite.io/support",
4
4
  "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5
- "version": "1.2.1",
5
+ "version": "1.3.0",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
package/src/client.ts CHANGED
@@ -304,7 +304,7 @@ class Client {
304
304
  'x-sdk-name': 'Console',
305
305
  'x-sdk-platform': 'console',
306
306
  'x-sdk-language': 'web',
307
- 'x-sdk-version': '1.2.1',
307
+ 'x-sdk-version': '1.3.0',
308
308
  'X-Appwrite-Response-Format': '1.6.0',
309
309
  };
310
310
 
@@ -0,0 +1,5 @@
1
+ export enum BillingPlan {
2
+ Tier0 = 'tier-0',
3
+ Tier1 = 'tier-1',
4
+ Tier2 = 'tier-2',
5
+ }
@@ -5,7 +5,7 @@ export enum Runtime {
5
5
  Node190 = 'node-19.0',
6
6
  Node200 = 'node-20.0',
7
7
  Node210 = 'node-21.0',
8
- Node220 = 'node-22.0',
8
+ Node22 = 'node-22',
9
9
  Php80 = 'php-8.0',
10
10
  Php81 = 'php-8.1',
11
11
  Php82 = 'php-8.2',
@@ -20,9 +20,6 @@ export enum Runtime {
20
20
  Python311 = 'python-3.11',
21
21
  Python312 = 'python-3.12',
22
22
  Pythonml311 = 'python-ml-3.11',
23
- Deno121 = 'deno-1.21',
24
- Deno124 = 'deno-1.24',
25
- Deno135 = 'deno-1.35',
26
23
  Deno140 = 'deno-1.40',
27
24
  Deno146 = 'deno-1.46',
28
25
  Deno20 = 'deno-2.0',
@@ -42,7 +39,7 @@ export enum Runtime {
42
39
  Java170 = 'java-17.0',
43
40
  Java180 = 'java-18.0',
44
41
  Java210 = 'java-21.0',
45
- Java220 = 'java-22.0',
42
+ Java22 = 'java-22',
46
43
  Swift55 = 'swift-5.5',
47
44
  Swift58 = 'swift-5.8',
48
45
  Swift59 = 'swift-5.9',
package/src/index.ts CHANGED
@@ -8,6 +8,7 @@
8
8
  export { Client, Query, AppwriteException } from './client';
9
9
  export { Account } from './services/account';
10
10
  export { Avatars } from './services/avatars';
11
+ export { Backups } from './services/backups';
11
12
  export { Assistant } from './services/assistant';
12
13
  export { Console } from './services/console';
13
14
  export { Databases } from './services/databases';
@@ -17,6 +18,7 @@ export { Health } from './services/health';
17
18
  export { Locale } from './services/locale';
18
19
  export { Messaging } from './services/messaging';
19
20
  export { Migrations } from './services/migrations';
21
+ export { Organizations } from './services/organizations';
20
22
  export { Project } from './services/project';
21
23
  export { Projects } from './services/projects';
22
24
  export { Proxy } from './services/proxy';
@@ -44,6 +46,7 @@ export { FunctionUsageRange } from './enums/function-usage-range';
44
46
  export { ExecutionMethod } from './enums/execution-method';
45
47
  export { Name } from './enums/name';
46
48
  export { SmtpEncryption } from './enums/smtp-encryption';
49
+ export { BillingPlan } from './enums/billing-plan';
47
50
  export { ProjectUsageRange } from './enums/project-usage-range';
48
51
  export { Region } from './enums/region';
49
52
  export { Api } from './enums/api';