@appwrite.io/console 0.4.2 → 0.6.0-rc.1

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 (83) hide show
  1. package/.github/workflows/publish.yml +2 -2
  2. package/LICENSE +1 -1
  3. package/README.md +1 -1
  4. package/dist/cjs/sdk.js +2115 -109
  5. package/dist/cjs/sdk.js.map +1 -1
  6. package/dist/esm/sdk.js +2115 -110
  7. package/dist/esm/sdk.js.map +1 -1
  8. package/dist/iife/sdk.js +2115 -109
  9. package/docs/examples/account/add-authenticator.md +18 -0
  10. package/docs/examples/account/create-challenge.md +18 -0
  11. package/docs/examples/account/list-providers.md +18 -0
  12. package/docs/examples/account/update-challenge.md +18 -0
  13. package/docs/examples/account/update-m-f-a.md +18 -0
  14. package/docs/examples/account/update-recovery.md +1 -1
  15. package/docs/examples/account/verify-authenticator.md +18 -0
  16. package/docs/examples/messaging/create-apns-provider.md +18 -0
  17. package/docs/examples/messaging/create-email-message.md +18 -0
  18. package/docs/examples/messaging/create-fcm-provider.md +18 -0
  19. package/docs/examples/messaging/create-mailgun-provider.md +18 -0
  20. package/docs/examples/messaging/create-msg91provider.md +18 -0
  21. package/docs/examples/messaging/create-push-message.md +18 -0
  22. package/docs/examples/messaging/create-s-m-s-message.md +18 -0
  23. package/docs/examples/messaging/create-sendgrid-provider.md +18 -0
  24. package/docs/examples/messaging/create-subscriber.md +18 -0
  25. package/docs/examples/messaging/create-telesign-provider.md +18 -0
  26. package/docs/examples/messaging/create-textmagic-provider.md +18 -0
  27. package/docs/examples/messaging/create-topic.md +18 -0
  28. package/docs/examples/messaging/create-twilio-provider.md +18 -0
  29. package/docs/examples/messaging/create-vonage-provider.md +18 -0
  30. package/docs/examples/messaging/delete-provider.md +18 -0
  31. package/docs/examples/messaging/delete-subscriber.md +18 -0
  32. package/docs/examples/messaging/delete-topic.md +18 -0
  33. package/docs/examples/messaging/get-message.md +18 -0
  34. package/docs/examples/messaging/get-provider.md +18 -0
  35. package/docs/examples/messaging/get-subscriber.md +18 -0
  36. package/docs/examples/messaging/get-topic.md +18 -0
  37. package/docs/examples/messaging/list-message-logs.md +18 -0
  38. package/docs/examples/messaging/list-messages.md +18 -0
  39. package/docs/examples/messaging/list-provider-logs.md +18 -0
  40. package/docs/examples/messaging/list-providers.md +18 -0
  41. package/docs/examples/messaging/list-subscriber-logs.md +18 -0
  42. package/docs/examples/messaging/list-subscribers.md +18 -0
  43. package/docs/examples/messaging/list-topic-logs.md +18 -0
  44. package/docs/examples/messaging/list-topics.md +18 -0
  45. package/docs/examples/messaging/update-apns-provider.md +18 -0
  46. package/docs/examples/messaging/update-email.md +18 -0
  47. package/docs/examples/messaging/update-fcm-provider.md +18 -0
  48. package/docs/examples/messaging/update-mailgun-provider.md +18 -0
  49. package/docs/examples/messaging/update-msg91provider.md +18 -0
  50. package/docs/examples/messaging/update-push-notification.md +18 -0
  51. package/docs/examples/messaging/update-s-m-s.md +18 -0
  52. package/docs/examples/messaging/update-sendgrid-provider.md +18 -0
  53. package/docs/examples/messaging/update-telesign-provider.md +18 -0
  54. package/docs/examples/messaging/update-textmagic-provider.md +18 -0
  55. package/docs/examples/messaging/update-topic.md +18 -0
  56. package/docs/examples/messaging/update-twilio-provider.md +18 -0
  57. package/docs/examples/messaging/update-vonage-provider.md +18 -0
  58. package/docs/examples/project/get-usage.md +1 -1
  59. package/docs/examples/projects/get-usage.md +18 -0
  60. package/docs/examples/projects/update-auth-mfa-factors.md +18 -0
  61. package/docs/examples/users/create-target.md +18 -0
  62. package/docs/examples/users/delete-target.md +18 -0
  63. package/docs/examples/users/get-target.md +18 -0
  64. package/docs/examples/users/list-targets.md +18 -0
  65. package/docs/examples/users/update-target.md +18 -0
  66. package/package.json +1 -1
  67. package/src/client.ts +1 -1
  68. package/src/index.ts +1 -0
  69. package/src/models.ts +547 -151
  70. package/src/services/account.ts +158 -0
  71. package/src/services/messaging.ts +1901 -0
  72. package/src/services/project.ts +4 -22
  73. package/src/services/projects.ts +58 -0
  74. package/src/services/storage.ts +1 -1
  75. package/src/services/users.ts +188 -1
  76. package/types/index.d.ts +1 -0
  77. package/types/models.d.ts +547 -151
  78. package/types/services/account.d.ts +56 -0
  79. package/types/services/messaging.d.ts +553 -0
  80. package/types/services/project.d.ts +2 -4
  81. package/types/services/projects.d.ts +20 -0
  82. package/types/services/storage.d.ts +1 -1
  83. package/types/services/users.d.ts +59 -1
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.listTopicLogs('[TOPIC_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.listTopics();
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.updateApnsProvider('[PROVIDER_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.updateEmail('[MESSAGE_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.updateFcmProvider('[PROVIDER_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.updateMailgunProvider('[PROVIDER_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.updateMsg91Provider('[PROVIDER_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.updatePushNotification('[MESSAGE_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.updateSMS('[MESSAGE_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.updateSendgridProvider('[PROVIDER_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.updateTelesignProvider('[PROVIDER_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.updateTextmagicProvider('[PROVIDER_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.updateTopic('[TOPIC_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.updateTwilioProvider('[PROVIDER_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.updateVonageProvider('[PROVIDER_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -9,7 +9,7 @@ client
9
9
  .setProject('5df5acd0d48c2') // Your project ID
10
10
  ;
11
11
 
12
- const promise = project.getUsage('', '');
12
+ const promise = project.getUsage();
13
13
 
14
14
  promise.then(function (response) {
15
15
  console.log(response); // Success
@@ -0,0 +1,18 @@
1
+ import { Client, Projects } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const projects = new Projects(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = projects.getUsage('[PROJECT_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Projects } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const projects = new Projects(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = projects.updateAuthMfaFactors('[PROJECT_ID]', 1);
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Users } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const users = new Users(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = users.createTarget('[USER_ID]', '[TARGET_ID]', 'email', '[IDENTIFIER]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Users } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const users = new Users(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = users.deleteTarget('[USER_ID]', '[TARGET_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Users } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const users = new Users(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = users.getTarget('[USER_ID]', '[TARGET_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Users } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const users = new Users(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = users.listTargets('[USER_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Users } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const users = new Users(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = users.updateTarget('[USER_ID]', '[TARGET_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
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": "0.4.2",
5
+ "version": "0.6.0-rc.1",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
package/src/client.ts CHANGED
@@ -104,7 +104,7 @@ class Client {
104
104
  'x-sdk-name': 'Console',
105
105
  'x-sdk-platform': 'console',
106
106
  'x-sdk-language': 'web',
107
- 'x-sdk-version': '0.4.2',
107
+ 'x-sdk-version': '0.6.0-rc.1',
108
108
  'X-Appwrite-Response-Format': '1.4.0',
109
109
  };
110
110
 
package/src/index.ts CHANGED
@@ -8,6 +8,7 @@ export { Functions } from './services/functions';
8
8
  export { Graphql } from './services/graphql';
9
9
  export { Health } from './services/health';
10
10
  export { Locale } from './services/locale';
11
+ export { Messaging } from './services/messaging';
11
12
  export { Migrations } from './services/migrations';
12
13
  export { Project } from './services/project';
13
14
  export { Projects } from './services/projects';