@appwrite.io/console 1.9.0 → 1.10.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 (55) hide show
  1. package/.github/workflows/publish.yml +1 -1
  2. package/CHANGELOG.md +45 -6
  3. package/README.md +82 -2
  4. package/dist/cjs/sdk.js +246 -193
  5. package/dist/cjs/sdk.js.map +1 -1
  6. package/dist/esm/sdk.js +246 -193
  7. package/dist/esm/sdk.js.map +1 -1
  8. package/dist/iife/sdk.js +246 -193
  9. package/docs/examples/databases/create-document.md +1 -3
  10. package/docs/examples/databases/create-documents.md +1 -1
  11. package/docs/examples/functions/create-execution.md +1 -1
  12. package/docs/examples/organizations/get-available-credits.md +13 -0
  13. package/docs/examples/organizations/update-projects.md +14 -0
  14. package/docs/examples/vcs/get-repository-contents.md +2 -1
  15. package/package.json +1 -1
  16. package/src/client.ts +1 -1
  17. package/src/models.ts +241 -9
  18. package/src/services/account.ts +97 -36
  19. package/src/services/avatars.ts +26 -20
  20. package/src/services/backups.ts +11 -0
  21. package/src/services/console.ts +8 -1
  22. package/src/services/databases.ts +97 -33
  23. package/src/services/domains.ts +111 -69
  24. package/src/services/functions.ts +37 -8
  25. package/src/services/graphql.ts +1 -0
  26. package/src/services/health.ts +26 -1
  27. package/src/services/locale.ts +9 -2
  28. package/src/services/messaging.ts +53 -8
  29. package/src/services/migrations.ts +12 -0
  30. package/src/services/organizations.ts +106 -16
  31. package/src/services/project.ts +5 -0
  32. package/src/services/projects.ts +50 -0
  33. package/src/services/proxy.ts +7 -0
  34. package/src/services/sites.ts +32 -4
  35. package/src/services/storage.ts +23 -9
  36. package/src/services/teams.ts +30 -17
  37. package/src/services/tokens.ts +4 -0
  38. package/src/services/users.ts +69 -27
  39. package/src/services/vcs.ts +16 -4
  40. package/types/models.d.ts +228 -192
  41. package/types/services/account.d.ts +36 -36
  42. package/types/services/avatars.d.ts +20 -20
  43. package/types/services/console.d.ts +1 -1
  44. package/types/services/databases.d.ts +43 -33
  45. package/types/services/domains.d.ts +69 -69
  46. package/types/services/functions.d.ts +8 -8
  47. package/types/services/health.d.ts +1 -1
  48. package/types/services/locale.d.ts +2 -2
  49. package/types/services/messaging.d.ts +8 -8
  50. package/types/services/organizations.d.ts +33 -16
  51. package/types/services/sites.d.ts +4 -4
  52. package/types/services/storage.d.ts +9 -9
  53. package/types/services/teams.d.ts +17 -17
  54. package/types/services/users.d.ts +27 -27
  55. package/types/services/vcs.d.ts +4 -4
@@ -2,9 +2,7 @@ import { Client, Databases } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
- .setSession('') //
6
- .setKey('<YOUR_API_KEY>') // Your secret API key
7
- .setJWT('<YOUR_JWT>'); // Your secret JSON Web Token
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
8
6
 
9
7
  const databases = new Databases(client);
10
8
 
@@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
- .setKey('<YOUR_API_KEY>'); // Your secret API key
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
6
 
7
7
  const databases = new Databases(client);
8
8
 
@@ -13,7 +13,7 @@ const result = await functions.createExecution(
13
13
  '<PATH>', // path (optional)
14
14
  ExecutionMethod.GET, // method (optional)
15
15
  {}, // headers (optional)
16
- '' // scheduledAt (optional)
16
+ '<SCHEDULED_AT>' // scheduledAt (optional)
17
17
  );
18
18
 
19
19
  console.log(result);
@@ -0,0 +1,13 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.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.getAvailableCredits(
10
+ '<ORGANIZATION_ID>' // organizationId
11
+ );
12
+
13
+ console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.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.updateProjects(
10
+ '<ORGANIZATION_ID>', // organizationId
11
+ [] // projects (optional)
12
+ );
13
+
14
+ console.log(result);
@@ -9,7 +9,8 @@ const vcs = new Vcs(client);
9
9
  const result = await vcs.getRepositoryContents(
10
10
  '<INSTALLATION_ID>', // installationId
11
11
  '<PROVIDER_REPOSITORY_ID>', // providerRepositoryId
12
- '<PROVIDER_ROOT_DIRECTORY>' // providerRootDirectory (optional)
12
+ '<PROVIDER_ROOT_DIRECTORY>', // providerRootDirectory (optional)
13
+ '<PROVIDER_REFERENCE>' // providerReference (optional)
13
14
  );
14
15
 
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.9.0",
5
+ "version": "1.10.0",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
package/src/client.ts CHANGED
@@ -316,7 +316,7 @@ class Client {
316
316
  'x-sdk-name': 'Console',
317
317
  'x-sdk-platform': 'console',
318
318
  'x-sdk-language': 'web',
319
- 'x-sdk-version': '1.9.0',
319
+ 'x-sdk-version': '1.10.0',
320
320
  'X-Appwrite-Response-Format': '1.7.0',
321
321
  };
322
322