@appwrite.io/console 1.1.0-rc.2 → 1.1.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 (115) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/sdk.js +2196 -3306
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +2197 -3305
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +2196 -3306
  7. package/docs/examples/account/delete-mfa-authenticator.md +1 -2
  8. package/docs/examples/databases/update-boolean-attribute.md +2 -1
  9. package/docs/examples/databases/update-datetime-attribute.md +2 -1
  10. package/docs/examples/databases/update-email-attribute.md +2 -1
  11. package/docs/examples/databases/update-enum-attribute.md +2 -1
  12. package/docs/examples/databases/update-float-attribute.md +2 -1
  13. package/docs/examples/databases/update-integer-attribute.md +2 -1
  14. package/docs/examples/databases/update-ip-attribute.md +2 -1
  15. package/docs/examples/databases/update-relationship-attribute.md +2 -1
  16. package/docs/examples/databases/update-string-attribute.md +3 -1
  17. package/docs/examples/databases/update-url-attribute.md +2 -1
  18. package/docs/examples/functions/create-build.md +1 -1
  19. package/docs/examples/functions/create-execution.md +2 -1
  20. package/docs/examples/functions/create.md +3 -1
  21. package/docs/examples/functions/delete-execution.md +14 -0
  22. package/docs/examples/functions/{download-deployment.md → get-deployment-download.md} +1 -1
  23. package/docs/examples/{account/list-billing-addresses.md → functions/get-template.md} +4 -4
  24. package/docs/examples/{account/create-payment-method.md → functions/list-specifications.md} +3 -3
  25. package/docs/examples/functions/list-templates.md +16 -0
  26. package/docs/examples/functions/update-deployment-build.md +14 -0
  27. package/docs/examples/functions/update.md +3 -1
  28. package/docs/examples/projects/create-j-w-t.md +15 -0
  29. package/docs/examples/projects/update-mock-numbers.md +14 -0
  30. package/docs/examples/projects/update-session-alerts.md +14 -0
  31. package/docs/examples/users/create-j-w-t.md +15 -0
  32. package/docs/examples/vcs/get-repository-contents.md +15 -0
  33. package/package.json +1 -1
  34. package/src/client.ts +2 -2
  35. package/src/enums/email-template-type.ts +2 -0
  36. package/src/enums/platform-type.ts +2 -0
  37. package/src/enums/runtime.ts +1 -0
  38. package/src/index.ts +1 -4
  39. package/src/models.ts +286 -960
  40. package/src/services/account.ts +2 -345
  41. package/src/services/console.ts +0 -120
  42. package/src/services/databases.ts +54 -10
  43. package/src/services/functions.ts +195 -14
  44. package/src/services/projects.ts +110 -1
  45. package/src/services/users.ts +37 -0
  46. package/src/services/vcs.ts +36 -0
  47. package/types/enums/email-template-type.d.ts +3 -1
  48. package/types/enums/platform-type.d.ts +3 -1
  49. package/types/enums/runtime.d.ts +2 -1
  50. package/types/index.d.ts +1 -4
  51. package/types/models.d.ts +286 -960
  52. package/types/services/account.d.ts +1 -105
  53. package/types/services/console.d.ts +0 -38
  54. package/types/services/databases.d.ts +21 -10
  55. package/types/services/functions.d.ts +67 -8
  56. package/types/services/projects.d.ts +32 -1
  57. package/types/services/users.d.ts +12 -0
  58. package/types/services/vcs.d.ts +11 -0
  59. package/docs/examples/account/delete-payment-method.md +0 -13
  60. package/docs/examples/account/get-billing-address.md +0 -13
  61. package/docs/examples/account/get-payment-method.md +0 -13
  62. package/docs/examples/account/list-credits.md +0 -14
  63. package/docs/examples/account/list-invoices.md +0 -13
  64. package/docs/examples/account/list-payment-methods.md +0 -13
  65. package/docs/examples/account/update-payment-method-mandate-options.md +0 -13
  66. package/docs/examples/account/update-payment-method-provider.md +0 -15
  67. package/docs/examples/account/update-payment-method.md +0 -15
  68. package/docs/examples/backups/create-archive.md +0 -14
  69. package/docs/examples/backups/create-policy.md +0 -19
  70. package/docs/examples/backups/create-restoration.md +0 -16
  71. package/docs/examples/backups/delete-archive.md +0 -13
  72. package/docs/examples/backups/delete-policy.md +0 -13
  73. package/docs/examples/backups/get-archive.md +0 -13
  74. package/docs/examples/backups/get-policy.md +0 -13
  75. package/docs/examples/backups/get-restoration.md +0 -13
  76. package/docs/examples/backups/list-archives.md +0 -13
  77. package/docs/examples/backups/list-policies.md +0 -13
  78. package/docs/examples/backups/list-restorations.md +0 -13
  79. package/docs/examples/backups/update-policy.md +0 -17
  80. package/docs/examples/console/create-source.md +0 -17
  81. package/docs/examples/console/get-copon.md +0 -13
  82. package/docs/examples/console/plans.md +0 -11
  83. package/docs/examples/console/regions.md +0 -11
  84. package/docs/examples/organizations/add-credit.md +0 -14
  85. package/docs/examples/organizations/create-invoice-payment.md +0 -15
  86. package/docs/examples/organizations/create.md +0 -17
  87. package/docs/examples/organizations/delete-backup-payment-method.md +0 -13
  88. package/docs/examples/organizations/delete-billing-address.md +0 -13
  89. package/docs/examples/organizations/delete-default-payment-method.md +0 -13
  90. package/docs/examples/organizations/delete.md +0 -13
  91. package/docs/examples/organizations/get-aggregation.md +0 -14
  92. package/docs/examples/organizations/get-billing-address.md +0 -14
  93. package/docs/examples/organizations/get-credit.md +0 -14
  94. package/docs/examples/organizations/get-invoice-download.md +0 -14
  95. package/docs/examples/organizations/get-invoice-view.md +0 -14
  96. package/docs/examples/organizations/get-invoice.md +0 -14
  97. package/docs/examples/organizations/get-payment-method.md +0 -14
  98. package/docs/examples/organizations/get-plan.md +0 -13
  99. package/docs/examples/organizations/get-usage.md +0 -15
  100. package/docs/examples/organizations/list-aggregations.md +0 -14
  101. package/docs/examples/organizations/list-invoices.md +0 -14
  102. package/docs/examples/organizations/list.md +0 -14
  103. package/docs/examples/organizations/set-backup-payment-method.md +0 -14
  104. package/docs/examples/organizations/set-billing-address.md +0 -14
  105. package/docs/examples/organizations/set-billing-email.md +0 -14
  106. package/docs/examples/organizations/set-billing-tax-id.md +0 -14
  107. package/docs/examples/organizations/set-default-payment-method.md +0 -14
  108. package/docs/examples/organizations/update-budget.md +0 -15
  109. package/docs/examples/organizations/update-plan.md +0 -16
  110. package/src/enums/billing-plan.ts +0 -5
  111. package/src/services/backups.ts +0 -425
  112. package/src/services/organizations.ts +0 -896
  113. package/types/enums/billing-plan.d.ts +0 -5
  114. package/types/services/backups.d.ts +0 -128
  115. package/types/services/organizations.d.ts +0 -273
@@ -7,8 +7,7 @@ const client = new Client()
7
7
  const account = new Account(client);
8
8
 
9
9
  const result = await account.deleteMfaAuthenticator(
10
- AuthenticatorType.Totp, // type
11
- '<OTP>' // otp
10
+ AuthenticatorType.Totp // type
12
11
  );
13
12
 
14
13
  console.log(result);
@@ -11,7 +11,8 @@ const result = await databases.updateBooleanAttribute(
11
11
  '<COLLECTION_ID>', // collectionId
12
12
  '', // key
13
13
  false, // required
14
- false // default
14
+ false, // default
15
+ '' // newKey (optional)
15
16
  );
16
17
 
17
18
  console.log(result);
@@ -11,7 +11,8 @@ const result = await databases.updateDatetimeAttribute(
11
11
  '<COLLECTION_ID>', // collectionId
12
12
  '', // key
13
13
  false, // required
14
- '' // default
14
+ '', // default
15
+ '' // newKey (optional)
15
16
  );
16
17
 
17
18
  console.log(result);
@@ -11,7 +11,8 @@ const result = await databases.updateEmailAttribute(
11
11
  '<COLLECTION_ID>', // collectionId
12
12
  '', // key
13
13
  false, // required
14
- 'email@example.com' // default
14
+ 'email@example.com', // default
15
+ '' // newKey (optional)
15
16
  );
16
17
 
17
18
  console.log(result);
@@ -12,7 +12,8 @@ const result = await databases.updateEnumAttribute(
12
12
  '', // key
13
13
  [], // elements
14
14
  false, // required
15
- '<DEFAULT>' // default
15
+ '<DEFAULT>', // default
16
+ '' // newKey (optional)
16
17
  );
17
18
 
18
19
  console.log(result);
@@ -13,7 +13,8 @@ const result = await databases.updateFloatAttribute(
13
13
  false, // required
14
14
  null, // min
15
15
  null, // max
16
- null // default
16
+ null, // default
17
+ '' // newKey (optional)
17
18
  );
18
19
 
19
20
  console.log(result);
@@ -13,7 +13,8 @@ const result = await databases.updateIntegerAttribute(
13
13
  false, // required
14
14
  null, // min
15
15
  null, // max
16
- null // default
16
+ null, // default
17
+ '' // newKey (optional)
17
18
  );
18
19
 
19
20
  console.log(result);
@@ -11,7 +11,8 @@ const result = await databases.updateIpAttribute(
11
11
  '<COLLECTION_ID>', // collectionId
12
12
  '', // key
13
13
  false, // required
14
- '' // default
14
+ '', // default
15
+ '' // newKey (optional)
15
16
  );
16
17
 
17
18
  console.log(result);
@@ -10,7 +10,8 @@ const result = await databases.updateRelationshipAttribute(
10
10
  '<DATABASE_ID>', // databaseId
11
11
  '<COLLECTION_ID>', // collectionId
12
12
  '', // key
13
- RelationMutate.Cascade // onDelete (optional)
13
+ RelationMutate.Cascade, // onDelete (optional)
14
+ '' // newKey (optional)
14
15
  );
15
16
 
16
17
  console.log(result);
@@ -11,7 +11,9 @@ const result = await databases.updateStringAttribute(
11
11
  '<COLLECTION_ID>', // collectionId
12
12
  '', // key
13
13
  false, // required
14
- '<DEFAULT>' // default
14
+ '<DEFAULT>', // default
15
+ null, // size (optional)
16
+ '' // newKey (optional)
15
17
  );
16
18
 
17
19
  console.log(result);
@@ -11,7 +11,8 @@ const result = await databases.updateUrlAttribute(
11
11
  '<COLLECTION_ID>', // collectionId
12
12
  '', // key
13
13
  false, // required
14
- 'https://example.com' // default
14
+ 'https://example.com', // default
15
+ '' // newKey (optional)
15
16
  );
16
17
 
17
18
  console.log(result);
@@ -9,7 +9,7 @@ const functions = new Functions(client);
9
9
  const result = await functions.createBuild(
10
10
  '<FUNCTION_ID>', // functionId
11
11
  '<DEPLOYMENT_ID>', // deploymentId
12
- '<BUILD_ID>' // buildId
12
+ '<BUILD_ID>' // buildId (optional)
13
13
  );
14
14
 
15
15
  console.log(result);
@@ -12,7 +12,8 @@ const result = await functions.createExecution(
12
12
  false, // async (optional)
13
13
  '<PATH>', // path (optional)
14
14
  ExecutionMethod.GET, // method (optional)
15
- {} // headers (optional)
15
+ {}, // headers (optional)
16
+ '' // scheduledAt (optional)
16
17
  );
17
18
 
18
19
  console.log(result);
@@ -18,6 +18,7 @@ const result = await functions.create(
18
18
  false, // logging (optional)
19
19
  '<ENTRYPOINT>', // entrypoint (optional)
20
20
  '<COMMANDS>', // commands (optional)
21
+ [], // scopes (optional)
21
22
  '<INSTALLATION_ID>', // installationId (optional)
22
23
  '<PROVIDER_REPOSITORY_ID>', // providerRepositoryId (optional)
23
24
  '<PROVIDER_BRANCH>', // providerBranch (optional)
@@ -26,7 +27,8 @@ const result = await functions.create(
26
27
  '<TEMPLATE_REPOSITORY>', // templateRepository (optional)
27
28
  '<TEMPLATE_OWNER>', // templateOwner (optional)
28
29
  '<TEMPLATE_ROOT_DIRECTORY>', // templateRootDirectory (optional)
29
- '<TEMPLATE_BRANCH>' // templateBranch (optional)
30
+ '<TEMPLATE_VERSION>', // templateVersion (optional)
31
+ '' // specification (optional)
30
32
  );
31
33
 
32
34
  console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Functions } 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 functions = new Functions(client);
8
+
9
+ const result = await functions.deleteExecution(
10
+ '<FUNCTION_ID>', // functionId
11
+ '<EXECUTION_ID>' // executionId
12
+ );
13
+
14
+ console.log(result);
@@ -6,7 +6,7 @@ const client = new Client()
6
6
 
7
7
  const functions = new Functions(client);
8
8
 
9
- const result = functions.downloadDeployment(
9
+ const result = functions.getDeploymentDownload(
10
10
  '<FUNCTION_ID>', // functionId
11
11
  '<DEPLOYMENT_ID>' // deploymentId
12
12
  );
@@ -1,13 +1,13 @@
1
- import { Client, Account } from "@appwrite.io/console";
1
+ import { Client, Functions } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
5
  .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
6
 
7
- const account = new Account(client);
7
+ const functions = new Functions(client);
8
8
 
9
- const result = await account.listBillingAddresses(
10
- [] // queries (optional)
9
+ const result = await functions.getTemplate(
10
+ '<TEMPLATE_ID>' // templateId
11
11
  );
12
12
 
13
13
  console.log(result);
@@ -1,11 +1,11 @@
1
- import { Client, Account } from "@appwrite.io/console";
1
+ import { Client, Functions } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
5
  .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
6
 
7
- const account = new Account(client);
7
+ const functions = new Functions(client);
8
8
 
9
- const result = await account.createPaymentMethod();
9
+ const result = await functions.listSpecifications();
10
10
 
11
11
  console.log(result);
@@ -0,0 +1,16 @@
1
+ import { Client, Functions } 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 functions = new Functions(client);
8
+
9
+ const result = await functions.listTemplates(
10
+ [], // runtimes (optional)
11
+ [], // useCases (optional)
12
+ 1, // limit (optional)
13
+ 0 // offset (optional)
14
+ );
15
+
16
+ console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Functions } 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 functions = new Functions(client);
8
+
9
+ const result = await functions.updateDeploymentBuild(
10
+ '<FUNCTION_ID>', // functionId
11
+ '<DEPLOYMENT_ID>' // deploymentId
12
+ );
13
+
14
+ console.log(result);
@@ -18,11 +18,13 @@ const result = await functions.update(
18
18
  false, // logging (optional)
19
19
  '<ENTRYPOINT>', // entrypoint (optional)
20
20
  '<COMMANDS>', // commands (optional)
21
+ [], // scopes (optional)
21
22
  '<INSTALLATION_ID>', // installationId (optional)
22
23
  '<PROVIDER_REPOSITORY_ID>', // providerRepositoryId (optional)
23
24
  '<PROVIDER_BRANCH>', // providerBranch (optional)
24
25
  false, // providerSilentMode (optional)
25
- '<PROVIDER_ROOT_DIRECTORY>' // providerRootDirectory (optional)
26
+ '<PROVIDER_ROOT_DIRECTORY>', // providerRootDirectory (optional)
27
+ '' // specification (optional)
26
28
  );
27
29
 
28
30
  console.log(result);
@@ -0,0 +1,15 @@
1
+ import { Client, Projects } 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 projects = new Projects(client);
8
+
9
+ const result = await projects.createJWT(
10
+ '<PROJECT_ID>', // projectId
11
+ [], // scopes
12
+ 0 // duration (optional)
13
+ );
14
+
15
+ console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Projects } 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 projects = new Projects(client);
8
+
9
+ const result = await projects.updateMockNumbers(
10
+ '<PROJECT_ID>', // projectId
11
+ [] // numbers
12
+ );
13
+
14
+ console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Projects } 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 projects = new Projects(client);
8
+
9
+ const result = await projects.updateSessionAlerts(
10
+ '<PROJECT_ID>', // projectId
11
+ false // alerts
12
+ );
13
+
14
+ console.log(result);
@@ -0,0 +1,15 @@
1
+ import { Client, Users } 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 users = new Users(client);
8
+
9
+ const result = await users.createJWT(
10
+ '<USER_ID>', // userId
11
+ '<SESSION_ID>', // sessionId (optional)
12
+ 0 // duration (optional)
13
+ );
14
+
15
+ console.log(result);
@@ -0,0 +1,15 @@
1
+ import { Client, Vcs } 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 vcs = new Vcs(client);
8
+
9
+ const result = await vcs.getRepositoryContents(
10
+ '<INSTALLATION_ID>', // installationId
11
+ '<PROVIDER_REPOSITORY_ID>', // providerRepositoryId
12
+ '<PROVIDER_ROOT_DIRECTORY>' // providerRootDirectory (optional)
13
+ );
14
+
15
+ 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.1.0-rc.2",
5
+ "version": "1.1.0",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
package/src/client.ts CHANGED
@@ -304,8 +304,8 @@ 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.1.0-rc.2',
308
- 'X-Appwrite-Response-Format': '1.5.0',
307
+ 'x-sdk-version': '1.1.0',
308
+ 'X-Appwrite-Response-Format': '1.6.0',
309
309
  };
310
310
 
311
311
  /**
@@ -4,4 +4,6 @@ export enum EmailTemplateType {
4
4
  Recovery = 'recovery',
5
5
  Invitation = 'invitation',
6
6
  Mfachallenge = 'mfachallenge',
7
+ Sessionalert = 'sessionalert',
8
+ Otpsession = 'otpsession',
7
9
  }
@@ -12,4 +12,6 @@ export enum PlatformType {
12
12
  Appletvos = 'apple-tvos',
13
13
  Android = 'android',
14
14
  Unity = 'unity',
15
+ Reactnativeios = 'react-native-ios',
16
+ Reactnativeandroid = 'react-native-android',
15
17
  }
@@ -44,4 +44,5 @@ export enum Runtime {
44
44
  Cpp17 = 'cpp-17',
45
45
  Cpp20 = 'cpp-20',
46
46
  Bun10 = 'bun-1.0',
47
+ Go123 = 'go-1.23',
47
48
  }
package/src/index.ts CHANGED
@@ -1,14 +1,13 @@
1
1
  /**
2
2
  * Appwrite Console SDK
3
3
  *
4
- * This SDK is compatible with Appwrite server version 1.5.x.
4
+ * This SDK is compatible with Appwrite server version 1.6.x.
5
5
  * For older versions, please check
6
6
  * [previous releases](https://github.com/appwrite/sdk-for-console/releases).
7
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';
12
11
  export { Assistant } from './services/assistant';
13
12
  export { Console } from './services/console';
14
13
  export { Databases } from './services/databases';
@@ -18,7 +17,6 @@ export { Health } from './services/health';
18
17
  export { Locale } from './services/locale';
19
18
  export { Messaging } from './services/messaging';
20
19
  export { Migrations } from './services/migrations';
21
- export { Organizations } from './services/organizations';
22
20
  export { Project } from './services/project';
23
21
  export { Projects } from './services/projects';
24
22
  export { Proxy } from './services/proxy';
@@ -46,7 +44,6 @@ export { FunctionUsageRange } from './enums/function-usage-range';
46
44
  export { ExecutionMethod } from './enums/execution-method';
47
45
  export { Name } from './enums/name';
48
46
  export { SmtpEncryption } from './enums/smtp-encryption';
49
- export { BillingPlan } from './enums/billing-plan';
50
47
  export { ProjectUsageRange } from './enums/project-usage-range';
51
48
  export { Region } from './enums/region';
52
49
  export { Api } from './enums/api';