node-appwrite 11.0.0 → 12.0.0-rc.4
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.
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/docs/examples/account/add-authenticator.md +12 -0
- package/docs/examples/account/create-anonymous-session.md +9 -0
- package/docs/examples/account/create-email-password-session.md +12 -0
- package/docs/examples/account/create-email-token.md +13 -0
- package/docs/examples/account/create-j-w-t.md +9 -0
- package/docs/examples/account/create-magic-u-r-l-token.md +14 -0
- package/docs/examples/account/create-o-auth2session.md +15 -0
- package/docs/examples/account/create-phone-token.md +12 -0
- package/docs/examples/account/create-phone-verification.md +4 -14
- package/docs/examples/account/create-recovery.md +7 -14
- package/docs/examples/account/create-session.md +12 -0
- package/docs/examples/account/create-verification.md +6 -14
- package/docs/examples/account/create.md +14 -0
- package/docs/examples/account/create2f-a-challenge.md +11 -0
- package/docs/examples/account/delete-authenticator.md +13 -0
- package/docs/examples/account/delete-identity.md +6 -14
- package/docs/examples/account/delete-session.md +6 -14
- package/docs/examples/account/delete-sessions.md +4 -14
- package/docs/examples/account/get-prefs.md +4 -14
- package/docs/examples/account/get-session.md +6 -14
- package/docs/examples/account/get.md +4 -14
- package/docs/examples/account/list-factors.md +10 -0
- package/docs/examples/account/list-identities.md +6 -14
- package/docs/examples/account/list-logs.md +6 -14
- package/docs/examples/account/list-sessions.md +4 -14
- package/docs/examples/account/update-challenge.md +13 -0
- package/docs/examples/account/update-email.md +7 -14
- package/docs/examples/account/update-m-f-a.md +12 -0
- package/docs/examples/account/update-magic-u-r-l-session.md +12 -0
- package/docs/examples/account/update-name.md +6 -14
- package/docs/examples/account/update-password.md +7 -14
- package/docs/examples/account/update-phone-verification.md +7 -14
- package/docs/examples/account/update-phone.md +7 -14
- package/docs/examples/account/update-prefs.md +6 -14
- package/docs/examples/account/update-recovery.md +8 -14
- package/docs/examples/account/update-session.md +6 -14
- package/docs/examples/account/update-status.md +4 -14
- package/docs/examples/account/update-verification.md +7 -14
- package/docs/examples/account/verify-authenticator.md +13 -0
- package/docs/examples/avatars/get-browser.md +9 -14
- package/docs/examples/avatars/get-credit-card.md +9 -14
- package/docs/examples/avatars/get-favicon.md +6 -14
- package/docs/examples/avatars/get-flag.md +9 -14
- package/docs/examples/avatars/get-image.md +8 -14
- package/docs/examples/avatars/get-initials.md +9 -14
- package/docs/examples/avatars/get-q-r.md +9 -14
- package/docs/examples/databases/create-boolean-attribute.md +11 -14
- package/docs/examples/databases/create-collection.md +11 -14
- package/docs/examples/databases/create-datetime-attribute.md +11 -14
- package/docs/examples/databases/create-document.md +10 -14
- package/docs/examples/databases/create-email-attribute.md +11 -14
- package/docs/examples/databases/create-enum-attribute.md +12 -14
- package/docs/examples/databases/create-float-attribute.md +13 -14
- package/docs/examples/databases/create-index.md +11 -14
- package/docs/examples/databases/create-integer-attribute.md +13 -14
- package/docs/examples/databases/create-ip-attribute.md +11 -14
- package/docs/examples/databases/create-relationship-attribute.md +13 -14
- package/docs/examples/databases/create-string-attribute.md +13 -14
- package/docs/examples/databases/create-url-attribute.md +11 -14
- package/docs/examples/databases/create.md +8 -14
- package/docs/examples/databases/delete-attribute.md +8 -14
- package/docs/examples/databases/delete-collection.md +7 -14
- package/docs/examples/databases/delete-document.md +8 -14
- package/docs/examples/databases/delete-index.md +8 -14
- package/docs/examples/databases/delete.md +6 -14
- package/docs/examples/databases/get-attribute.md +8 -14
- package/docs/examples/databases/get-collection.md +7 -14
- package/docs/examples/databases/get-document.md +9 -14
- package/docs/examples/databases/get-index.md +8 -14
- package/docs/examples/databases/get.md +6 -14
- package/docs/examples/databases/list-attributes.md +8 -14
- package/docs/examples/databases/list-collections.md +8 -14
- package/docs/examples/databases/list-documents.md +8 -14
- package/docs/examples/databases/list-indexes.md +8 -14
- package/docs/examples/databases/list.md +7 -14
- package/docs/examples/databases/update-boolean-attribute.md +10 -14
- package/docs/examples/databases/update-collection.md +11 -14
- package/docs/examples/databases/update-datetime-attribute.md +10 -14
- package/docs/examples/databases/update-document.md +10 -14
- package/docs/examples/databases/update-email-attribute.md +10 -14
- package/docs/examples/databases/update-enum-attribute.md +11 -14
- package/docs/examples/databases/update-float-attribute.md +12 -14
- package/docs/examples/databases/update-integer-attribute.md +12 -14
- package/docs/examples/databases/update-ip-attribute.md +10 -14
- package/docs/examples/databases/update-relationship-attribute.md +9 -14
- package/docs/examples/databases/update-string-attribute.md +10 -14
- package/docs/examples/databases/update-url-attribute.md +10 -14
- package/docs/examples/databases/update.md +8 -14
- package/docs/examples/functions/create-build.md +8 -14
- package/docs/examples/functions/create-deployment.md +10 -14
- package/docs/examples/functions/create-execution.md +11 -14
- package/docs/examples/functions/create-variable.md +8 -14
- package/docs/examples/functions/create.md +25 -14
- package/docs/examples/functions/delete-deployment.md +7 -14
- package/docs/examples/functions/delete-variable.md +7 -14
- package/docs/examples/functions/delete.md +6 -14
- package/docs/examples/functions/download-deployment.md +7 -14
- package/docs/examples/functions/get-deployment.md +7 -14
- package/docs/examples/functions/get-execution.md +7 -14
- package/docs/examples/functions/get-variable.md +7 -14
- package/docs/examples/functions/get.md +6 -14
- package/docs/examples/functions/list-deployments.md +8 -14
- package/docs/examples/functions/list-executions.md +8 -14
- package/docs/examples/functions/list-runtimes.md +4 -14
- package/docs/examples/functions/list-variables.md +6 -14
- package/docs/examples/functions/list.md +7 -14
- package/docs/examples/functions/update-deployment.md +7 -14
- package/docs/examples/functions/update-variable.md +9 -14
- package/docs/examples/functions/update.md +21 -14
- package/docs/examples/graphql/mutation.md +6 -14
- package/docs/examples/graphql/query.md +6 -14
- package/docs/examples/health/get-antivirus.md +4 -14
- package/docs/examples/health/get-cache.md +4 -14
- package/docs/examples/health/get-certificate.md +12 -0
- package/docs/examples/health/get-d-b.md +4 -14
- package/docs/examples/health/get-failed-jobs.md +13 -0
- package/docs/examples/health/get-pub-sub.md +4 -14
- package/docs/examples/health/get-queue-builds.md +12 -0
- package/docs/examples/health/get-queue-certificates.md +6 -14
- package/docs/examples/health/get-queue-databases.md +13 -0
- package/docs/examples/health/get-queue-deletes.md +12 -0
- package/docs/examples/health/get-queue-functions.md +6 -14
- package/docs/examples/health/get-queue-logs.md +6 -14
- package/docs/examples/health/get-queue-mails.md +12 -0
- package/docs/examples/health/get-queue-messaging.md +12 -0
- package/docs/examples/health/get-queue-migrations.md +12 -0
- package/docs/examples/health/get-queue-webhooks.md +6 -14
- package/docs/examples/health/get-queue.md +4 -14
- package/docs/examples/health/get-storage-local.md +4 -14
- package/docs/examples/health/get-time.md +4 -14
- package/docs/examples/health/get.md +4 -14
- package/docs/examples/locale/get.md +4 -14
- package/docs/examples/locale/list-codes.md +4 -14
- package/docs/examples/locale/list-continents.md +4 -14
- package/docs/examples/locale/list-countries-e-u.md +4 -14
- package/docs/examples/locale/list-countries-phones.md +4 -14
- package/docs/examples/locale/list-countries.md +4 -14
- package/docs/examples/locale/list-currencies.md +4 -14
- package/docs/examples/locale/list-languages.md +4 -14
- package/docs/examples/messaging/create-apns-provider.md +18 -0
- package/docs/examples/messaging/create-email.md +23 -0
- package/docs/examples/messaging/create-fcm-provider.md +15 -0
- package/docs/examples/messaging/create-mailgun-provider.md +21 -0
- package/docs/examples/messaging/create-msg91provider.md +17 -0
- package/docs/examples/messaging/create-push.md +27 -0
- package/docs/examples/messaging/create-sendgrid-provider.md +19 -0
- package/docs/examples/messaging/create-sms.md +18 -0
- package/docs/examples/messaging/create-smtp-provider.md +25 -0
- package/docs/examples/messaging/create-subscriber.md +14 -0
- package/docs/examples/messaging/create-telesign-provider.md +17 -0
- package/docs/examples/messaging/create-textmagic-provider.md +17 -0
- package/docs/examples/messaging/create-topic.md +14 -0
- package/docs/examples/messaging/create-twilio-provider.md +17 -0
- package/docs/examples/messaging/create-vonage-provider.md +17 -0
- package/docs/examples/messaging/delete-provider.md +12 -0
- package/docs/examples/messaging/delete-subscriber.md +13 -0
- package/docs/examples/messaging/delete-topic.md +12 -0
- package/docs/examples/messaging/delete.md +12 -0
- package/docs/examples/messaging/get-message.md +12 -0
- package/docs/examples/messaging/get-provider.md +12 -0
- package/docs/examples/messaging/get-subscriber.md +13 -0
- package/docs/examples/messaging/get-topic.md +12 -0
- package/docs/examples/messaging/list-message-logs.md +13 -0
- package/docs/examples/messaging/list-messages.md +13 -0
- package/docs/examples/messaging/list-provider-logs.md +13 -0
- package/docs/examples/messaging/list-providers.md +13 -0
- package/docs/examples/messaging/list-subscriber-logs.md +13 -0
- package/docs/examples/messaging/list-subscribers.md +14 -0
- package/docs/examples/messaging/list-targets.md +13 -0
- package/docs/examples/messaging/list-topic-logs.md +13 -0
- package/docs/examples/messaging/list-topics.md +13 -0
- package/docs/examples/messaging/update-a-p-n-s-provider.md +18 -0
- package/docs/examples/messaging/update-email.md +22 -0
- package/docs/examples/messaging/update-f-c-m-provider.md +15 -0
- package/docs/examples/messaging/update-mailgun-provider.md +21 -0
- package/docs/examples/messaging/update-msg91provider.md +17 -0
- package/docs/examples/messaging/update-push.md +27 -0
- package/docs/examples/messaging/update-sendgrid-provider.md +19 -0
- package/docs/examples/messaging/update-sms.md +18 -0
- package/docs/examples/messaging/update-smtp-provider.md +25 -0
- package/docs/examples/messaging/update-telesign-provider.md +17 -0
- package/docs/examples/messaging/update-textmagic-provider.md +17 -0
- package/docs/examples/messaging/update-topic.md +13 -0
- package/docs/examples/messaging/update-twilio-provider.md +17 -0
- package/docs/examples/messaging/update-vonage-provider.md +17 -0
- package/docs/examples/storage/create-bucket.md +15 -14
- package/docs/examples/storage/create-file.md +9 -14
- package/docs/examples/storage/delete-bucket.md +6 -14
- package/docs/examples/storage/delete-file.md +7 -14
- package/docs/examples/storage/get-bucket.md +6 -14
- package/docs/examples/storage/get-file-download.md +7 -14
- package/docs/examples/storage/get-file-preview.md +18 -14
- package/docs/examples/storage/get-file-view.md +7 -14
- package/docs/examples/storage/get-file.md +7 -14
- package/docs/examples/storage/list-buckets.md +7 -14
- package/docs/examples/storage/list-files.md +8 -14
- package/docs/examples/storage/update-bucket.md +15 -14
- package/docs/examples/storage/update-file.md +9 -14
- package/docs/examples/teams/create-membership.md +12 -14
- package/docs/examples/teams/create.md +8 -14
- package/docs/examples/teams/delete-membership.md +7 -14
- package/docs/examples/teams/delete.md +6 -14
- package/docs/examples/teams/get-membership.md +7 -14
- package/docs/examples/teams/get-prefs.md +6 -14
- package/docs/examples/teams/get.md +6 -14
- package/docs/examples/teams/list-memberships.md +8 -14
- package/docs/examples/teams/list.md +7 -14
- package/docs/examples/teams/update-membership-status.md +9 -14
- package/docs/examples/teams/update-membership.md +8 -14
- package/docs/examples/teams/update-name.md +7 -14
- package/docs/examples/teams/update-prefs.md +7 -14
- package/docs/examples/users/create-argon2user.md +9 -14
- package/docs/examples/users/create-bcrypt-user.md +9 -14
- package/docs/examples/users/create-m-d5user.md +9 -14
- package/docs/examples/users/create-p-h-pass-user.md +9 -14
- package/docs/examples/users/create-s-h-a-user.md +10 -14
- package/docs/examples/users/create-scrypt-modified-user.md +12 -14
- package/docs/examples/users/create-scrypt-user.md +14 -14
- package/docs/examples/users/create-session.md +12 -0
- package/docs/examples/users/create-target.md +17 -0
- package/docs/examples/users/create-token.md +14 -0
- package/docs/examples/users/create.md +10 -14
- package/docs/examples/users/delete-authenticator.md +14 -0
- package/docs/examples/users/delete-identity.md +6 -14
- package/docs/examples/users/delete-session.md +7 -14
- package/docs/examples/users/delete-sessions.md +6 -14
- package/docs/examples/users/delete-target.md +13 -0
- package/docs/examples/users/delete.md +6 -14
- package/docs/examples/users/get-prefs.md +6 -14
- package/docs/examples/users/get-target.md +13 -0
- package/docs/examples/users/get.md +6 -14
- package/docs/examples/users/list-factors.md +12 -0
- package/docs/examples/users/list-identities.md +7 -14
- package/docs/examples/users/list-logs.md +7 -14
- package/docs/examples/users/list-memberships.md +6 -14
- package/docs/examples/users/list-sessions.md +6 -14
- package/docs/examples/users/list-targets.md +13 -0
- package/docs/examples/users/list.md +7 -14
- package/docs/examples/users/update-email-verification.md +7 -14
- package/docs/examples/users/update-email.md +7 -14
- package/docs/examples/users/update-labels.md +7 -14
- package/docs/examples/users/update-mfa.md +13 -0
- package/docs/examples/users/update-name.md +7 -14
- package/docs/examples/users/update-password.md +7 -14
- package/docs/examples/users/update-phone-verification.md +7 -14
- package/docs/examples/users/update-phone.md +7 -14
- package/docs/examples/users/update-prefs.md +7 -14
- package/docs/examples/users/update-status.md +7 -14
- package/docs/examples/users/update-target.md +16 -0
- package/index.d.ts +2280 -309
- package/index.js +40 -0
- package/lib/client.js +122 -65
- package/lib/enums/authentication-factor.js +7 -0
- package/lib/enums/authenticator-type.js +5 -0
- package/lib/enums/browser.js +18 -0
- package/lib/enums/compression.js +7 -0
- package/lib/enums/credit-card.js +20 -0
- package/lib/enums/encryption.js +7 -0
- package/lib/enums/execution-method.js +10 -0
- package/lib/enums/flag.js +198 -0
- package/lib/enums/image-format.js +9 -0
- package/lib/enums/image-gravity.js +13 -0
- package/lib/enums/index-type.js +8 -0
- package/lib/enums/message-status.js +7 -0
- package/lib/enums/messaging-provider-type.js +7 -0
- package/lib/enums/name.js +16 -0
- package/lib/enums/o-auth-provider.js +43 -0
- package/lib/enums/password-hash.js +15 -0
- package/lib/enums/relation-mutate.js +7 -0
- package/lib/enums/relationship-type.js +8 -0
- package/lib/enums/runtime.js +40 -0
- package/lib/inputFile.js +88 -16
- package/lib/query.js +56 -38
- package/lib/services/account.js +639 -46
- package/lib/services/avatars.js +16 -13
- package/lib/services/databases.js +54 -52
- package/lib/services/functions.js +77 -109
- package/lib/services/graphql.js +4 -2
- package/lib/services/health.js +229 -14
- package/lib/services/locale.js +9 -7
- package/lib/services/messaging.js +2198 -0
- package/lib/services/storage.js +64 -100
- package/lib/services/teams.js +19 -17
- package/lib/services/users.js +367 -45
- package/package.json +2 -3
package/lib/services/avatars.js
CHANGED
|
@@ -5,6 +5,8 @@ const client = require('../client.js');
|
|
|
5
5
|
const Stream = require('stream');
|
|
6
6
|
const { promisify } = require('util');
|
|
7
7
|
const fs = require('fs');
|
|
8
|
+
const { File } = require('undici');
|
|
9
|
+
const Query = require('../query.js');
|
|
8
10
|
|
|
9
11
|
class Avatars extends Service {
|
|
10
12
|
|
|
@@ -15,19 +17,20 @@ class Avatars extends Service {
|
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
/**
|
|
18
|
-
* Get
|
|
20
|
+
* Get browser icon
|
|
19
21
|
*
|
|
20
22
|
* You can use this endpoint to show different browser icons to your users.
|
|
21
23
|
* The code argument receives the browser code as it appears in your user [GET
|
|
22
|
-
* /account/sessions](/docs/client/account#
|
|
23
|
-
* width, height and quality arguments to change the output
|
|
24
|
+
* /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions)
|
|
25
|
+
* endpoint. Use width, height and quality arguments to change the output
|
|
26
|
+
* settings.
|
|
24
27
|
*
|
|
25
28
|
* When one dimension is specified and the other is 0, the image is scaled
|
|
26
29
|
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
27
30
|
* image at source quality. If dimensions are not specified, the default size
|
|
28
31
|
* of image returned is 100x100px.
|
|
29
32
|
*
|
|
30
|
-
* @param {
|
|
33
|
+
* @param {Browser} code
|
|
31
34
|
* @param {number} width
|
|
32
35
|
* @param {number} height
|
|
33
36
|
* @param {number} quality
|
|
@@ -60,7 +63,7 @@ class Avatars extends Service {
|
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
/**
|
|
63
|
-
* Get
|
|
66
|
+
* Get credit card icon
|
|
64
67
|
*
|
|
65
68
|
* The credit card endpoint will return you the icon of the credit card
|
|
66
69
|
* provider you need. Use width, height and quality arguments to change the
|
|
@@ -72,7 +75,7 @@ class Avatars extends Service {
|
|
|
72
75
|
* of image returned is 100x100px.
|
|
73
76
|
*
|
|
74
77
|
*
|
|
75
|
-
* @param {
|
|
78
|
+
* @param {CreditCard} code
|
|
76
79
|
* @param {number} width
|
|
77
80
|
* @param {number} height
|
|
78
81
|
* @param {number} quality
|
|
@@ -105,7 +108,7 @@ class Avatars extends Service {
|
|
|
105
108
|
}
|
|
106
109
|
|
|
107
110
|
/**
|
|
108
|
-
* Get
|
|
111
|
+
* Get favicon
|
|
109
112
|
*
|
|
110
113
|
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
|
|
111
114
|
* website URL.
|
|
@@ -133,12 +136,12 @@ class Avatars extends Service {
|
|
|
133
136
|
}
|
|
134
137
|
|
|
135
138
|
/**
|
|
136
|
-
* Get
|
|
139
|
+
* Get country flag
|
|
137
140
|
*
|
|
138
141
|
* You can use this endpoint to show different country flags icons to your
|
|
139
142
|
* users. The code argument receives the 2 letter country code. Use width,
|
|
140
143
|
* height and quality arguments to change the output settings. Country codes
|
|
141
|
-
* follow the [ISO 3166-1](
|
|
144
|
+
* follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
|
142
145
|
*
|
|
143
146
|
* When one dimension is specified and the other is 0, the image is scaled
|
|
144
147
|
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
@@ -146,7 +149,7 @@ class Avatars extends Service {
|
|
|
146
149
|
* of image returned is 100x100px.
|
|
147
150
|
*
|
|
148
151
|
*
|
|
149
|
-
* @param {
|
|
152
|
+
* @param {Flag} code
|
|
150
153
|
* @param {number} width
|
|
151
154
|
* @param {number} height
|
|
152
155
|
* @param {number} quality
|
|
@@ -179,7 +182,7 @@ class Avatars extends Service {
|
|
|
179
182
|
}
|
|
180
183
|
|
|
181
184
|
/**
|
|
182
|
-
* Get
|
|
185
|
+
* Get image from URL
|
|
183
186
|
*
|
|
184
187
|
* Use this endpoint to fetch a remote image URL and crop it to any image size
|
|
185
188
|
* you want. This endpoint is very useful if you need to crop and display
|
|
@@ -224,7 +227,7 @@ class Avatars extends Service {
|
|
|
224
227
|
}
|
|
225
228
|
|
|
226
229
|
/**
|
|
227
|
-
* Get
|
|
230
|
+
* Get user initials
|
|
228
231
|
*
|
|
229
232
|
* Use this endpoint to show your user initials avatar icon on your website or
|
|
230
233
|
* app. By default, this route will try to print your logged-in user name or
|
|
@@ -276,7 +279,7 @@ class Avatars extends Service {
|
|
|
276
279
|
}
|
|
277
280
|
|
|
278
281
|
/**
|
|
279
|
-
* Get QR
|
|
282
|
+
* Get QR code
|
|
280
283
|
*
|
|
281
284
|
* Converts a given plain text to a QR code image. You can use the query
|
|
282
285
|
* parameters to change the size and style of the resulting image.
|
|
@@ -5,6 +5,8 @@ const client = require('../client.js');
|
|
|
5
5
|
const Stream = require('stream');
|
|
6
6
|
const { promisify } = require('util');
|
|
7
7
|
const fs = require('fs');
|
|
8
|
+
const { File } = require('undici');
|
|
9
|
+
const Query = require('../query.js');
|
|
8
10
|
|
|
9
11
|
class Databases extends Service {
|
|
10
12
|
|
|
@@ -15,7 +17,7 @@ class Databases extends Service {
|
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
/**
|
|
18
|
-
* List
|
|
20
|
+
* List databases
|
|
19
21
|
*
|
|
20
22
|
* Get a list of all databases from the current Appwrite project. You can use
|
|
21
23
|
* the search parameter to filter your results.
|
|
@@ -43,7 +45,7 @@ class Databases extends Service {
|
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
/**
|
|
46
|
-
* Create
|
|
48
|
+
* Create database
|
|
47
49
|
*
|
|
48
50
|
* Create a new Database.
|
|
49
51
|
*
|
|
@@ -84,7 +86,7 @@ class Databases extends Service {
|
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
/**
|
|
87
|
-
* Get
|
|
89
|
+
* Get database
|
|
88
90
|
*
|
|
89
91
|
* Get a database by its unique ID. This endpoint response returns a JSON
|
|
90
92
|
* object with the database metadata.
|
|
@@ -107,7 +109,7 @@ class Databases extends Service {
|
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
/**
|
|
110
|
-
* Update
|
|
112
|
+
* Update database
|
|
111
113
|
*
|
|
112
114
|
* Update a database by its unique ID.
|
|
113
115
|
*
|
|
@@ -143,7 +145,7 @@ class Databases extends Service {
|
|
|
143
145
|
}
|
|
144
146
|
|
|
145
147
|
/**
|
|
146
|
-
* Delete
|
|
148
|
+
* Delete database
|
|
147
149
|
*
|
|
148
150
|
* Delete a database by its unique ID. Only API keys with with databases.write
|
|
149
151
|
* scope can delete a database.
|
|
@@ -166,7 +168,7 @@ class Databases extends Service {
|
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
/**
|
|
169
|
-
* List
|
|
171
|
+
* List collections
|
|
170
172
|
*
|
|
171
173
|
* Get a list of all collections that belong to the provided databaseId. You
|
|
172
174
|
* can use the search parameter to filter your results.
|
|
@@ -199,12 +201,12 @@ class Databases extends Service {
|
|
|
199
201
|
}
|
|
200
202
|
|
|
201
203
|
/**
|
|
202
|
-
* Create
|
|
204
|
+
* Create collection
|
|
203
205
|
*
|
|
204
206
|
* Create a new Collection. Before using this route, you should create a new
|
|
205
207
|
* database resource using either a [server
|
|
206
|
-
* integration](/docs/server/databases#databasesCreateCollection)
|
|
207
|
-
* directly from your database console.
|
|
208
|
+
* integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
|
209
|
+
* API or directly from your database console.
|
|
208
210
|
*
|
|
209
211
|
* @param {string} databaseId
|
|
210
212
|
* @param {string} collectionId
|
|
@@ -257,7 +259,7 @@ class Databases extends Service {
|
|
|
257
259
|
}
|
|
258
260
|
|
|
259
261
|
/**
|
|
260
|
-
* Get
|
|
262
|
+
* Get collection
|
|
261
263
|
*
|
|
262
264
|
* Get a collection by its unique ID. This endpoint response returns a JSON
|
|
263
265
|
* object with the collection metadata.
|
|
@@ -285,7 +287,7 @@ class Databases extends Service {
|
|
|
285
287
|
}
|
|
286
288
|
|
|
287
289
|
/**
|
|
288
|
-
* Update
|
|
290
|
+
* Update collection
|
|
289
291
|
*
|
|
290
292
|
* Update a collection by its unique ID.
|
|
291
293
|
*
|
|
@@ -336,7 +338,7 @@ class Databases extends Service {
|
|
|
336
338
|
}
|
|
337
339
|
|
|
338
340
|
/**
|
|
339
|
-
* Delete
|
|
341
|
+
* Delete collection
|
|
340
342
|
*
|
|
341
343
|
* Delete a collection by its unique ID. Only users with write permissions
|
|
342
344
|
* have access to delete this resource.
|
|
@@ -364,7 +366,7 @@ class Databases extends Service {
|
|
|
364
366
|
}
|
|
365
367
|
|
|
366
368
|
/**
|
|
367
|
-
* List
|
|
369
|
+
* List attributes
|
|
368
370
|
*
|
|
369
371
|
* @param {string} databaseId
|
|
370
372
|
* @param {string} collectionId
|
|
@@ -394,7 +396,7 @@ class Databases extends Service {
|
|
|
394
396
|
}
|
|
395
397
|
|
|
396
398
|
/**
|
|
397
|
-
* Create
|
|
399
|
+
* Create boolean attribute
|
|
398
400
|
*
|
|
399
401
|
* Create a boolean attribute.
|
|
400
402
|
*
|
|
@@ -450,7 +452,7 @@ class Databases extends Service {
|
|
|
450
452
|
}
|
|
451
453
|
|
|
452
454
|
/**
|
|
453
|
-
* Update
|
|
455
|
+
* Update boolean attribute
|
|
454
456
|
*
|
|
455
457
|
* @param {string} databaseId
|
|
456
458
|
* @param {string} collectionId
|
|
@@ -498,7 +500,7 @@ class Databases extends Service {
|
|
|
498
500
|
}
|
|
499
501
|
|
|
500
502
|
/**
|
|
501
|
-
* Create
|
|
503
|
+
* Create datetime attribute
|
|
502
504
|
*
|
|
503
505
|
* @param {string} databaseId
|
|
504
506
|
* @param {string} collectionId
|
|
@@ -551,7 +553,7 @@ class Databases extends Service {
|
|
|
551
553
|
}
|
|
552
554
|
|
|
553
555
|
/**
|
|
554
|
-
* Update
|
|
556
|
+
* Update dateTime attribute
|
|
555
557
|
*
|
|
556
558
|
* @param {string} databaseId
|
|
557
559
|
* @param {string} collectionId
|
|
@@ -599,7 +601,7 @@ class Databases extends Service {
|
|
|
599
601
|
}
|
|
600
602
|
|
|
601
603
|
/**
|
|
602
|
-
* Create
|
|
604
|
+
* Create email attribute
|
|
603
605
|
*
|
|
604
606
|
* Create an email attribute.
|
|
605
607
|
*
|
|
@@ -655,7 +657,7 @@ class Databases extends Service {
|
|
|
655
657
|
}
|
|
656
658
|
|
|
657
659
|
/**
|
|
658
|
-
* Update
|
|
660
|
+
* Update email attribute
|
|
659
661
|
*
|
|
660
662
|
* Update an email attribute. Changing the `default` value will not update
|
|
661
663
|
* already existing documents.
|
|
@@ -707,7 +709,7 @@ class Databases extends Service {
|
|
|
707
709
|
}
|
|
708
710
|
|
|
709
711
|
/**
|
|
710
|
-
* Create
|
|
712
|
+
* Create enum attribute
|
|
711
713
|
*
|
|
712
714
|
* @param {string} databaseId
|
|
713
715
|
* @param {string} collectionId
|
|
@@ -769,7 +771,7 @@ class Databases extends Service {
|
|
|
769
771
|
}
|
|
770
772
|
|
|
771
773
|
/**
|
|
772
|
-
* Update
|
|
774
|
+
* Update enum attribute
|
|
773
775
|
*
|
|
774
776
|
* Update an enum attribute. Changing the `default` value will not update
|
|
775
777
|
* already existing documents.
|
|
@@ -830,7 +832,7 @@ class Databases extends Service {
|
|
|
830
832
|
}
|
|
831
833
|
|
|
832
834
|
/**
|
|
833
|
-
* Create
|
|
835
|
+
* Create float attribute
|
|
834
836
|
*
|
|
835
837
|
* Create a float attribute. Optionally, minimum and maximum values can be
|
|
836
838
|
* provided.
|
|
@@ -897,7 +899,7 @@ class Databases extends Service {
|
|
|
897
899
|
}
|
|
898
900
|
|
|
899
901
|
/**
|
|
900
|
-
* Update
|
|
902
|
+
* Update float attribute
|
|
901
903
|
*
|
|
902
904
|
* Update a float attribute. Changing the `default` value will not update
|
|
903
905
|
* already existing documents.
|
|
@@ -967,7 +969,7 @@ class Databases extends Service {
|
|
|
967
969
|
}
|
|
968
970
|
|
|
969
971
|
/**
|
|
970
|
-
* Create
|
|
972
|
+
* Create integer attribute
|
|
971
973
|
*
|
|
972
974
|
* Create an integer attribute. Optionally, minimum and maximum values can be
|
|
973
975
|
* provided.
|
|
@@ -1034,7 +1036,7 @@ class Databases extends Service {
|
|
|
1034
1036
|
}
|
|
1035
1037
|
|
|
1036
1038
|
/**
|
|
1037
|
-
* Update
|
|
1039
|
+
* Update integer attribute
|
|
1038
1040
|
*
|
|
1039
1041
|
* Update an integer attribute. Changing the `default` value will not update
|
|
1040
1042
|
* already existing documents.
|
|
@@ -1104,7 +1106,7 @@ class Databases extends Service {
|
|
|
1104
1106
|
}
|
|
1105
1107
|
|
|
1106
1108
|
/**
|
|
1107
|
-
* Create IP
|
|
1109
|
+
* Create IP address attribute
|
|
1108
1110
|
*
|
|
1109
1111
|
* Create IP address attribute.
|
|
1110
1112
|
*
|
|
@@ -1160,7 +1162,7 @@ class Databases extends Service {
|
|
|
1160
1162
|
}
|
|
1161
1163
|
|
|
1162
1164
|
/**
|
|
1163
|
-
* Update IP
|
|
1165
|
+
* Update IP address attribute
|
|
1164
1166
|
*
|
|
1165
1167
|
* Update an ip attribute. Changing the `default` value will not update
|
|
1166
1168
|
* already existing documents.
|
|
@@ -1212,20 +1214,20 @@ class Databases extends Service {
|
|
|
1212
1214
|
}
|
|
1213
1215
|
|
|
1214
1216
|
/**
|
|
1215
|
-
* Create
|
|
1217
|
+
* Create relationship attribute
|
|
1216
1218
|
*
|
|
1217
1219
|
* Create relationship attribute. [Learn more about relationship
|
|
1218
|
-
* attributes](/docs/databases-relationships#relationship-attributes).
|
|
1220
|
+
* attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1219
1221
|
*
|
|
1220
1222
|
*
|
|
1221
1223
|
* @param {string} databaseId
|
|
1222
1224
|
* @param {string} collectionId
|
|
1223
1225
|
* @param {string} relatedCollectionId
|
|
1224
|
-
* @param {
|
|
1226
|
+
* @param {RelationshipType} type
|
|
1225
1227
|
* @param {boolean} twoWay
|
|
1226
1228
|
* @param {string} key
|
|
1227
1229
|
* @param {string} twoWayKey
|
|
1228
|
-
* @param {
|
|
1230
|
+
* @param {RelationMutate} onDelete
|
|
1229
1231
|
* @throws {AppwriteException}
|
|
1230
1232
|
* @returns {Promise}
|
|
1231
1233
|
*/
|
|
@@ -1279,7 +1281,7 @@ class Databases extends Service {
|
|
|
1279
1281
|
}
|
|
1280
1282
|
|
|
1281
1283
|
/**
|
|
1282
|
-
* Create
|
|
1284
|
+
* Create string attribute
|
|
1283
1285
|
*
|
|
1284
1286
|
* Create a string attribute.
|
|
1285
1287
|
*
|
|
@@ -1349,7 +1351,7 @@ class Databases extends Service {
|
|
|
1349
1351
|
}
|
|
1350
1352
|
|
|
1351
1353
|
/**
|
|
1352
|
-
* Update
|
|
1354
|
+
* Update string attribute
|
|
1353
1355
|
*
|
|
1354
1356
|
* Update a string attribute. Changing the `default` value will not update
|
|
1355
1357
|
* already existing documents.
|
|
@@ -1401,7 +1403,7 @@ class Databases extends Service {
|
|
|
1401
1403
|
}
|
|
1402
1404
|
|
|
1403
1405
|
/**
|
|
1404
|
-
* Create URL
|
|
1406
|
+
* Create URL attribute
|
|
1405
1407
|
*
|
|
1406
1408
|
* Create a URL attribute.
|
|
1407
1409
|
*
|
|
@@ -1457,7 +1459,7 @@ class Databases extends Service {
|
|
|
1457
1459
|
}
|
|
1458
1460
|
|
|
1459
1461
|
/**
|
|
1460
|
-
* Update URL
|
|
1462
|
+
* Update URL attribute
|
|
1461
1463
|
*
|
|
1462
1464
|
* Update an url attribute. Changing the `default` value will not update
|
|
1463
1465
|
* already existing documents.
|
|
@@ -1509,7 +1511,7 @@ class Databases extends Service {
|
|
|
1509
1511
|
}
|
|
1510
1512
|
|
|
1511
1513
|
/**
|
|
1512
|
-
* Get
|
|
1514
|
+
* Get attribute
|
|
1513
1515
|
*
|
|
1514
1516
|
* @param {string} databaseId
|
|
1515
1517
|
* @param {string} collectionId
|
|
@@ -1539,7 +1541,7 @@ class Databases extends Service {
|
|
|
1539
1541
|
}
|
|
1540
1542
|
|
|
1541
1543
|
/**
|
|
1542
|
-
* Delete
|
|
1544
|
+
* Delete attribute
|
|
1543
1545
|
*
|
|
1544
1546
|
* @param {string} databaseId
|
|
1545
1547
|
* @param {string} collectionId
|
|
@@ -1569,16 +1571,16 @@ class Databases extends Service {
|
|
|
1569
1571
|
}
|
|
1570
1572
|
|
|
1571
1573
|
/**
|
|
1572
|
-
* Update
|
|
1574
|
+
* Update relationship attribute
|
|
1573
1575
|
*
|
|
1574
1576
|
* Update relationship attribute. [Learn more about relationship
|
|
1575
|
-
* attributes](/docs/databases-relationships#relationship-attributes).
|
|
1577
|
+
* attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1576
1578
|
*
|
|
1577
1579
|
*
|
|
1578
1580
|
* @param {string} databaseId
|
|
1579
1581
|
* @param {string} collectionId
|
|
1580
1582
|
* @param {string} key
|
|
1581
|
-
* @param {
|
|
1583
|
+
* @param {RelationMutate} onDelete
|
|
1582
1584
|
* @throws {AppwriteException}
|
|
1583
1585
|
* @returns {Promise}
|
|
1584
1586
|
*/
|
|
@@ -1608,7 +1610,7 @@ class Databases extends Service {
|
|
|
1608
1610
|
}
|
|
1609
1611
|
|
|
1610
1612
|
/**
|
|
1611
|
-
* List
|
|
1613
|
+
* List documents
|
|
1612
1614
|
*
|
|
1613
1615
|
* Get a list of all the user's documents in a given collection. You can use
|
|
1614
1616
|
* the query params to filter your results.
|
|
@@ -1641,12 +1643,12 @@ class Databases extends Service {
|
|
|
1641
1643
|
}
|
|
1642
1644
|
|
|
1643
1645
|
/**
|
|
1644
|
-
* Create
|
|
1646
|
+
* Create document
|
|
1645
1647
|
*
|
|
1646
1648
|
* Create a new Document. Before using this route, you should create a new
|
|
1647
1649
|
* collection resource using either a [server
|
|
1648
|
-
* integration](/docs/server/databases#databasesCreateCollection)
|
|
1649
|
-
* directly from your database console.
|
|
1650
|
+
* integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
|
1651
|
+
* API or directly from your database console.
|
|
1650
1652
|
*
|
|
1651
1653
|
* @param {string} databaseId
|
|
1652
1654
|
* @param {string} collectionId
|
|
@@ -1694,7 +1696,7 @@ class Databases extends Service {
|
|
|
1694
1696
|
}
|
|
1695
1697
|
|
|
1696
1698
|
/**
|
|
1697
|
-
* Get
|
|
1699
|
+
* Get document
|
|
1698
1700
|
*
|
|
1699
1701
|
* Get a document by its unique ID. This endpoint response returns a JSON
|
|
1700
1702
|
* object with the document data.
|
|
@@ -1732,7 +1734,7 @@ class Databases extends Service {
|
|
|
1732
1734
|
}
|
|
1733
1735
|
|
|
1734
1736
|
/**
|
|
1735
|
-
* Update
|
|
1737
|
+
* Update document
|
|
1736
1738
|
*
|
|
1737
1739
|
* Update a document by its unique ID. Using the patch method you can pass
|
|
1738
1740
|
* only specific fields that will get updated.
|
|
@@ -1775,7 +1777,7 @@ class Databases extends Service {
|
|
|
1775
1777
|
}
|
|
1776
1778
|
|
|
1777
1779
|
/**
|
|
1778
|
-
* Delete
|
|
1780
|
+
* Delete document
|
|
1779
1781
|
*
|
|
1780
1782
|
* Delete a document by its unique ID.
|
|
1781
1783
|
*
|
|
@@ -1807,7 +1809,7 @@ class Databases extends Service {
|
|
|
1807
1809
|
}
|
|
1808
1810
|
|
|
1809
1811
|
/**
|
|
1810
|
-
* List
|
|
1812
|
+
* List indexes
|
|
1811
1813
|
*
|
|
1812
1814
|
* @param {string} databaseId
|
|
1813
1815
|
* @param {string} collectionId
|
|
@@ -1837,12 +1839,12 @@ class Databases extends Service {
|
|
|
1837
1839
|
}
|
|
1838
1840
|
|
|
1839
1841
|
/**
|
|
1840
|
-
* Create
|
|
1842
|
+
* Create index
|
|
1841
1843
|
*
|
|
1842
1844
|
* @param {string} databaseId
|
|
1843
1845
|
* @param {string} collectionId
|
|
1844
1846
|
* @param {string} key
|
|
1845
|
-
* @param {
|
|
1847
|
+
* @param {IndexType} type
|
|
1846
1848
|
* @param {string[]} attributes
|
|
1847
1849
|
* @param {string[]} orders
|
|
1848
1850
|
* @throws {AppwriteException}
|
|
@@ -1894,7 +1896,7 @@ class Databases extends Service {
|
|
|
1894
1896
|
}
|
|
1895
1897
|
|
|
1896
1898
|
/**
|
|
1897
|
-
* Get
|
|
1899
|
+
* Get index
|
|
1898
1900
|
*
|
|
1899
1901
|
* @param {string} databaseId
|
|
1900
1902
|
* @param {string} collectionId
|
|
@@ -1924,7 +1926,7 @@ class Databases extends Service {
|
|
|
1924
1926
|
}
|
|
1925
1927
|
|
|
1926
1928
|
/**
|
|
1927
|
-
* Delete
|
|
1929
|
+
* Delete index
|
|
1928
1930
|
*
|
|
1929
1931
|
* @param {string} databaseId
|
|
1930
1932
|
* @param {string} collectionId
|