react-native-appwrite 0.19.0 → 0.21.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.
- package/.github/workflows/publish.yml +9 -8
- package/CHANGELOG.md +12 -0
- package/LICENSE +1 -1
- package/README.md +3 -3
- package/dist/cjs/sdk.js +254 -64
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +250 -65
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/account/create-anonymous-session.md +2 -0
- package/docs/examples/account/create-email-password-session.md +2 -0
- package/docs/examples/account/create-email-token.md +2 -0
- package/docs/examples/account/create-email-verification.md +2 -0
- package/docs/examples/account/create-jwt.md +5 -1
- package/docs/examples/account/create-magic-url-token.md +2 -0
- package/docs/examples/account/create-mfa-authenticator.md +2 -0
- package/docs/examples/account/create-mfa-challenge.md +2 -0
- package/docs/examples/account/create-mfa-recovery-codes.md +2 -0
- package/docs/examples/account/create-o-auth-2-session.md +2 -0
- package/docs/examples/account/create-o-auth-2-token.md +2 -0
- package/docs/examples/account/create-phone-token.md +2 -0
- package/docs/examples/account/create-phone-verification.md +2 -0
- package/docs/examples/account/create-push-target.md +2 -0
- package/docs/examples/account/create-recovery.md +2 -0
- package/docs/examples/account/create-session.md +2 -0
- package/docs/examples/account/create-verification.md +2 -0
- package/docs/examples/account/create.md +2 -0
- package/docs/examples/account/delete-identity.md +2 -0
- package/docs/examples/account/delete-mfa-authenticator.md +2 -0
- package/docs/examples/account/delete-push-target.md +2 -0
- package/docs/examples/account/delete-session.md +2 -0
- package/docs/examples/account/delete-sessions.md +2 -0
- package/docs/examples/account/get-mfa-recovery-codes.md +2 -0
- package/docs/examples/account/get-prefs.md +2 -0
- package/docs/examples/account/get-session.md +2 -0
- package/docs/examples/account/get.md +2 -0
- package/docs/examples/account/list-identities.md +2 -0
- package/docs/examples/account/list-logs.md +2 -0
- package/docs/examples/account/list-mfa-factors.md +2 -0
- package/docs/examples/account/list-sessions.md +2 -0
- package/docs/examples/account/update-email-verification.md +2 -0
- package/docs/examples/account/update-email.md +2 -0
- package/docs/examples/account/update-magic-url-session.md +2 -0
- package/docs/examples/account/update-mfa-authenticator.md +2 -0
- package/docs/examples/account/update-mfa-challenge.md +2 -0
- package/docs/examples/account/update-mfa-recovery-codes.md +2 -0
- package/docs/examples/account/update-mfa.md +2 -0
- package/docs/examples/account/update-name.md +2 -0
- package/docs/examples/account/update-password.md +2 -0
- package/docs/examples/account/update-phone-session.md +2 -0
- package/docs/examples/account/update-phone-verification.md +2 -0
- package/docs/examples/account/update-phone.md +2 -0
- package/docs/examples/account/update-prefs.md +2 -0
- package/docs/examples/account/update-push-target.md +2 -0
- package/docs/examples/account/update-recovery.md +2 -0
- package/docs/examples/account/update-session.md +2 -0
- package/docs/examples/account/update-status.md +2 -0
- package/docs/examples/account/update-verification.md +2 -0
- package/docs/examples/avatars/get-browser.md +2 -0
- package/docs/examples/avatars/get-credit-card.md +2 -0
- package/docs/examples/avatars/get-favicon.md +2 -0
- package/docs/examples/avatars/get-flag.md +2 -0
- package/docs/examples/avatars/get-image.md +2 -0
- package/docs/examples/avatars/get-initials.md +2 -0
- package/docs/examples/avatars/get-qr.md +2 -0
- package/docs/examples/avatars/get-screenshot.md +7 -5
- package/docs/examples/databases/create-document.md +2 -0
- package/docs/examples/databases/create-operations.md +2 -0
- package/docs/examples/databases/create-transaction.md +2 -0
- package/docs/examples/databases/decrement-document-attribute.md +2 -0
- package/docs/examples/databases/delete-document.md +2 -0
- package/docs/examples/databases/delete-transaction.md +2 -0
- package/docs/examples/databases/get-document.md +2 -0
- package/docs/examples/databases/get-transaction.md +2 -0
- package/docs/examples/databases/increment-document-attribute.md +2 -0
- package/docs/examples/databases/list-documents.md +2 -0
- package/docs/examples/databases/list-transactions.md +2 -0
- package/docs/examples/databases/update-document.md +9 -1
- package/docs/examples/databases/update-transaction.md +2 -0
- package/docs/examples/databases/upsert-document.md +9 -1
- package/docs/examples/functions/create-execution.md +2 -0
- package/docs/examples/functions/get-execution.md +2 -0
- package/docs/examples/functions/list-executions.md +2 -0
- package/docs/examples/graphql/mutation.md +2 -0
- package/docs/examples/graphql/query.md +2 -0
- package/docs/examples/locale/get.md +2 -0
- package/docs/examples/locale/list-codes.md +2 -0
- package/docs/examples/locale/list-continents.md +2 -0
- package/docs/examples/locale/list-countries-eu.md +2 -0
- package/docs/examples/locale/list-countries-phones.md +2 -0
- package/docs/examples/locale/list-countries.md +2 -0
- package/docs/examples/locale/list-currencies.md +2 -0
- package/docs/examples/locale/list-languages.md +2 -0
- package/docs/examples/messaging/create-subscriber.md +2 -0
- package/docs/examples/messaging/delete-subscriber.md +2 -0
- package/docs/examples/storage/create-file.md +2 -0
- package/docs/examples/storage/delete-file.md +2 -0
- package/docs/examples/storage/get-file-download.md +2 -0
- package/docs/examples/storage/get-file-preview.md +2 -0
- package/docs/examples/storage/get-file-view.md +2 -0
- package/docs/examples/storage/get-file.md +2 -0
- package/docs/examples/storage/list-files.md +2 -0
- package/docs/examples/storage/update-file.md +2 -0
- package/docs/examples/tablesdb/create-operations.md +2 -0
- package/docs/examples/tablesdb/create-row.md +2 -0
- package/docs/examples/tablesdb/create-transaction.md +2 -0
- package/docs/examples/tablesdb/decrement-row-column.md +2 -0
- package/docs/examples/tablesdb/delete-row.md +2 -0
- package/docs/examples/tablesdb/delete-transaction.md +2 -0
- package/docs/examples/tablesdb/get-row.md +2 -0
- package/docs/examples/tablesdb/get-transaction.md +2 -0
- package/docs/examples/tablesdb/increment-row-column.md +2 -0
- package/docs/examples/tablesdb/list-rows.md +2 -0
- package/docs/examples/tablesdb/list-transactions.md +2 -0
- package/docs/examples/tablesdb/update-row.md +9 -1
- package/docs/examples/tablesdb/update-transaction.md +2 -0
- package/docs/examples/tablesdb/upsert-row.md +9 -1
- package/docs/examples/teams/create-membership.md +2 -0
- package/docs/examples/teams/create.md +2 -0
- package/docs/examples/teams/delete-membership.md +2 -0
- package/docs/examples/teams/delete.md +2 -0
- package/docs/examples/teams/get-membership.md +2 -0
- package/docs/examples/teams/get-prefs.md +2 -0
- package/docs/examples/teams/get.md +2 -0
- package/docs/examples/teams/list-memberships.md +2 -0
- package/docs/examples/teams/list.md +2 -0
- package/docs/examples/teams/update-membership-status.md +2 -0
- package/docs/examples/teams/update-membership.md +2 -0
- package/docs/examples/teams/update-name.md +2 -0
- package/docs/examples/teams/update-prefs.md +2 -0
- package/package.json +6 -3
- package/rollup.config.js +3 -1
- package/src/channel.ts +132 -0
- package/src/client.ts +72 -10
- package/src/enums/browser-permission.ts +22 -0
- package/src/enums/o-auth-provider.ts +2 -1
- package/src/index.ts +3 -2
- package/src/models.ts +8 -0
- package/src/query.ts +54 -9
- package/src/services/account.ts +45 -16
- package/src/services/avatars.ts +20 -19
- package/src/services/databases.ts +5 -9
- package/src/services/graphql.ts +2 -2
- package/src/services/storage.ts +8 -8
- package/types/channel.d.ts +71 -0
- package/types/client.d.ts +2 -1
- package/types/enums/browser-permission.d.ts +22 -0
- package/types/enums/o-auth-provider.d.ts +2 -1
- package/types/index.d.ts +3 -2
- package/types/models.d.ts +8 -0
- package/types/query.d.ts +36 -6
- package/types/services/account.d.ts +17 -5
- package/types/services/avatars.d.ts +12 -11
- package/types/services/databases.d.ts +2 -2
- package/types/services/storage.d.ts +8 -8
- package/src/enums/output.ts +0 -9
- package/types/enums/output.d.ts +0 -9
package/types/query.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type QueryTypesSingle = string | number | boolean;
|
|
2
|
-
export type QueryTypesList = string[] | number[] | boolean[] | Query[] | any[];
|
|
1
|
+
type QueryTypesSingle = string | number | bigint | boolean;
|
|
2
|
+
export type QueryTypesList = string[] | number[] | bigint[] | boolean[] | Query[] | any[];
|
|
3
3
|
export type QueryTypes = QueryTypesSingle | QueryTypesList;
|
|
4
4
|
type AttributesTypes = string | string[];
|
|
5
5
|
export declare class Query {
|
|
@@ -10,13 +10,35 @@ export declare class Query {
|
|
|
10
10
|
toString(): string;
|
|
11
11
|
static equal: (attribute: string, value: QueryTypes) => string;
|
|
12
12
|
static notEqual: (attribute: string, value: QueryTypes) => string;
|
|
13
|
+
/**
|
|
14
|
+
* Filter resources where attribute matches a regular expression pattern.
|
|
15
|
+
*
|
|
16
|
+
* @param {string} attribute The attribute to filter on.
|
|
17
|
+
* @param {string} pattern The regular expression pattern to match.
|
|
18
|
+
* @returns {string}
|
|
19
|
+
*/
|
|
20
|
+
static regex: (attribute: string, pattern: string) => string;
|
|
13
21
|
static lessThan: (attribute: string, value: QueryTypes) => string;
|
|
14
22
|
static lessThanEqual: (attribute: string, value: QueryTypes) => string;
|
|
15
23
|
static greaterThan: (attribute: string, value: QueryTypes) => string;
|
|
16
24
|
static greaterThanEqual: (attribute: string, value: QueryTypes) => string;
|
|
17
25
|
static isNull: (attribute: string) => string;
|
|
18
26
|
static isNotNull: (attribute: string) => string;
|
|
19
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Filter resources where the specified attributes exist.
|
|
29
|
+
*
|
|
30
|
+
* @param {string[]} attributes The list of attributes that must exist.
|
|
31
|
+
* @returns {string}
|
|
32
|
+
*/
|
|
33
|
+
static exists: (attributes: string[]) => string;
|
|
34
|
+
/**
|
|
35
|
+
* Filter resources where the specified attributes do not exist.
|
|
36
|
+
*
|
|
37
|
+
* @param {string[]} attributes The list of attributes that must not exist.
|
|
38
|
+
* @returns {string}
|
|
39
|
+
*/
|
|
40
|
+
static notExists: (attributes: string[]) => string;
|
|
41
|
+
static between: (attribute: string, start: string | number | bigint, end: string | number | bigint) => string;
|
|
20
42
|
static startsWith: (attribute: string, value: string) => string;
|
|
21
43
|
static endsWith: (attribute: string, value: string) => string;
|
|
22
44
|
static select: (attributes: string[]) => string;
|
|
@@ -57,11 +79,11 @@ export declare class Query {
|
|
|
57
79
|
* Filter resources where attribute is not between start and end (exclusive).
|
|
58
80
|
*
|
|
59
81
|
* @param {string} attribute
|
|
60
|
-
* @param {string | number} start
|
|
61
|
-
* @param {string | number} end
|
|
82
|
+
* @param {string | number | bigint} start
|
|
83
|
+
* @param {string | number | bigint} end
|
|
62
84
|
* @returns {string}
|
|
63
85
|
*/
|
|
64
|
-
static notBetween: (attribute: string, start: string | number, end: string | number) => string;
|
|
86
|
+
static notBetween: (attribute: string, start: string | number | bigint, end: string | number | bigint) => string;
|
|
65
87
|
/**
|
|
66
88
|
* Filter resources where attribute does not start with value.
|
|
67
89
|
*
|
|
@@ -124,6 +146,14 @@ export declare class Query {
|
|
|
124
146
|
static updatedBetween: (start: string, end: string) => string;
|
|
125
147
|
static or: (queries: string[]) => string;
|
|
126
148
|
static and: (queries: string[]) => string;
|
|
149
|
+
/**
|
|
150
|
+
* Filter array elements where at least one element matches all the specified queries.
|
|
151
|
+
*
|
|
152
|
+
* @param {string} attribute The attribute containing the array to filter on.
|
|
153
|
+
* @param {string[]} queries The list of query strings to match against array elements.
|
|
154
|
+
* @returns {string}
|
|
155
|
+
*/
|
|
156
|
+
static elemMatch: (attribute: string, queries: string[]) => string;
|
|
127
157
|
/**
|
|
128
158
|
* Filter resources where attribute is at a specific distance from the given coordinates.
|
|
129
159
|
*
|
|
@@ -111,10 +111,22 @@ export declare class Account extends Service {
|
|
|
111
111
|
/**
|
|
112
112
|
* Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.
|
|
113
113
|
*
|
|
114
|
+
* @param {number} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
|
|
114
115
|
* @throws {AppwriteException}
|
|
115
116
|
* @returns {Promise}
|
|
116
117
|
*/
|
|
117
|
-
createJWT(
|
|
118
|
+
createJWT(params?: {
|
|
119
|
+
duration?: number;
|
|
120
|
+
}): Promise<Models.Jwt>;
|
|
121
|
+
/**
|
|
122
|
+
* Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.
|
|
123
|
+
*
|
|
124
|
+
* @param {number} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
|
|
125
|
+
* @throws {AppwriteException}
|
|
126
|
+
* @returns {Promise<Models.Jwt>}
|
|
127
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
128
|
+
*/
|
|
129
|
+
createJWT(duration?: number): Promise<Models.Jwt>;
|
|
118
130
|
/**
|
|
119
131
|
* Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.
|
|
120
132
|
*
|
|
@@ -641,7 +653,7 @@ export declare class Account extends Service {
|
|
|
641
653
|
* A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
642
654
|
*
|
|
643
655
|
*
|
|
644
|
-
* @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
|
|
656
|
+
* @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine.
|
|
645
657
|
* @param {string} params.success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
646
658
|
* @param {string} params.failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
647
659
|
* @param {string[]} params.scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
|
|
@@ -662,7 +674,7 @@ export declare class Account extends Service {
|
|
|
662
674
|
* A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
663
675
|
*
|
|
664
676
|
*
|
|
665
|
-
* @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
|
|
677
|
+
* @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine.
|
|
666
678
|
* @param {string} success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
667
679
|
* @param {string} failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
668
680
|
* @param {string[]} scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
|
|
@@ -918,7 +930,7 @@ export declare class Account extends Service {
|
|
|
918
930
|
*
|
|
919
931
|
* A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
920
932
|
*
|
|
921
|
-
* @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
|
|
933
|
+
* @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine.
|
|
922
934
|
* @param {string} params.success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
923
935
|
* @param {string} params.failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
924
936
|
* @param {string[]} params.scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
|
|
@@ -938,7 +950,7 @@ export declare class Account extends Service {
|
|
|
938
950
|
*
|
|
939
951
|
* A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
940
952
|
*
|
|
941
|
-
* @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
|
|
953
|
+
* @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine.
|
|
942
954
|
* @param {string} success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
943
955
|
* @param {string} failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
944
956
|
* @param {string[]} scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
|
|
@@ -5,7 +5,8 @@ import { CreditCard } from '../enums/credit-card';
|
|
|
5
5
|
import { Flag } from '../enums/flag';
|
|
6
6
|
import { Theme } from '../enums/theme';
|
|
7
7
|
import { Timezone } from '../enums/timezone';
|
|
8
|
-
import {
|
|
8
|
+
import { BrowserPermission } from '../enums/browser-permission';
|
|
9
|
+
import { ImageFormat } from '../enums/image-format';
|
|
9
10
|
export declare class Avatars extends Service {
|
|
10
11
|
constructor(client: Client);
|
|
11
12
|
/**
|
|
@@ -253,12 +254,12 @@ export declare class Avatars extends Service {
|
|
|
253
254
|
* @param {number} params.longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
|
|
254
255
|
* @param {number} params.accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
|
|
255
256
|
* @param {boolean} params.touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.
|
|
256
|
-
* @param {
|
|
257
|
+
* @param {BrowserPermission[]} params.permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
|
|
257
258
|
* @param {number} params.sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
|
|
258
259
|
* @param {number} params.width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).
|
|
259
260
|
* @param {number} params.height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).
|
|
260
261
|
* @param {number} params.quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
261
|
-
* @param {
|
|
262
|
+
* @param {ImageFormat} params.output - Output format type (jpeg, jpg, png, gif and webp).
|
|
262
263
|
* @throws {AppwriteException}
|
|
263
264
|
* @returns {ArrayBuffer}
|
|
264
265
|
*/
|
|
@@ -277,12 +278,12 @@ export declare class Avatars extends Service {
|
|
|
277
278
|
longitude?: number;
|
|
278
279
|
accuracy?: number;
|
|
279
280
|
touch?: boolean;
|
|
280
|
-
permissions?:
|
|
281
|
+
permissions?: BrowserPermission[];
|
|
281
282
|
sleep?: number;
|
|
282
283
|
width?: number;
|
|
283
284
|
height?: number;
|
|
284
285
|
quality?: number;
|
|
285
|
-
output?:
|
|
286
|
+
output?: ImageFormat;
|
|
286
287
|
}): Promise<ArrayBuffer>;
|
|
287
288
|
/**
|
|
288
289
|
* Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.
|
|
@@ -305,17 +306,17 @@ export declare class Avatars extends Service {
|
|
|
305
306
|
* @param {number} longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
|
|
306
307
|
* @param {number} accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
|
|
307
308
|
* @param {boolean} touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.
|
|
308
|
-
* @param {
|
|
309
|
+
* @param {BrowserPermission[]} permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
|
|
309
310
|
* @param {number} sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
|
|
310
311
|
* @param {number} width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).
|
|
311
312
|
* @param {number} height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).
|
|
312
313
|
* @param {number} quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
313
|
-
* @param {
|
|
314
|
+
* @param {ImageFormat} output - Output format type (jpeg, jpg, png, gif and webp).
|
|
314
315
|
* @throws {AppwriteException}
|
|
315
316
|
* @returns {Promise<ArrayBuffer>}
|
|
316
317
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
317
318
|
*/
|
|
318
|
-
getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?:
|
|
319
|
+
getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat): Promise<ArrayBuffer>;
|
|
319
320
|
/**
|
|
320
321
|
* You can use this endpoint to show different browser icons to your users.
|
|
321
322
|
* The code argument receives the browser code as it appears in your user [GET
|
|
@@ -471,14 +472,14 @@ export declare class Avatars extends Service {
|
|
|
471
472
|
* @param {number} longitude
|
|
472
473
|
* @param {number} accuracy
|
|
473
474
|
* @param {boolean} touch
|
|
474
|
-
* @param {
|
|
475
|
+
* @param {BrowserPermission[]} permissions
|
|
475
476
|
* @param {number} sleep
|
|
476
477
|
* @param {number} width
|
|
477
478
|
* @param {number} height
|
|
478
479
|
* @param {number} quality
|
|
479
|
-
* @param {
|
|
480
|
+
* @param {ImageFormat} output
|
|
480
481
|
* @throws {AppwriteException}
|
|
481
482
|
* @returns {URL}
|
|
482
483
|
*/
|
|
483
|
-
getScreenshotURL(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?:
|
|
484
|
+
getScreenshotURL(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat): URL;
|
|
484
485
|
}
|
|
@@ -242,7 +242,7 @@ export declare class Databases extends Service {
|
|
|
242
242
|
databaseId: string;
|
|
243
243
|
collectionId: string;
|
|
244
244
|
documentId: string;
|
|
245
|
-
data
|
|
245
|
+
data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
|
|
246
246
|
permissions?: string[];
|
|
247
247
|
transactionId?: string;
|
|
248
248
|
}): Promise<Document>;
|
|
@@ -259,7 +259,7 @@ export declare class Databases extends Service {
|
|
|
259
259
|
* @returns {Promise<Document>}
|
|
260
260
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
261
261
|
*/
|
|
262
|
-
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data
|
|
262
|
+
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string): Promise<Document>;
|
|
263
263
|
/**
|
|
264
264
|
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
265
265
|
*
|
|
@@ -112,10 +112,10 @@ export declare class Storage extends Service {
|
|
|
112
112
|
/**
|
|
113
113
|
* Update a file by its unique ID. Only users with write permissions have access to update this resource.
|
|
114
114
|
*
|
|
115
|
-
* @param {string} params.bucketId -
|
|
116
|
-
* @param {string} params.fileId - File
|
|
117
|
-
* @param {string} params.name -
|
|
118
|
-
* @param {string[]} params.permissions - An array of permission
|
|
115
|
+
* @param {string} params.bucketId - Bucket unique ID.
|
|
116
|
+
* @param {string} params.fileId - File ID.
|
|
117
|
+
* @param {string} params.name - File name.
|
|
118
|
+
* @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
119
119
|
* @throws {AppwriteException}
|
|
120
120
|
* @returns {Promise}
|
|
121
121
|
*/
|
|
@@ -128,10 +128,10 @@ export declare class Storage extends Service {
|
|
|
128
128
|
/**
|
|
129
129
|
* Update a file by its unique ID. Only users with write permissions have access to update this resource.
|
|
130
130
|
*
|
|
131
|
-
* @param {string} bucketId -
|
|
132
|
-
* @param {string} fileId - File
|
|
133
|
-
* @param {string} name -
|
|
134
|
-
* @param {string[]} permissions - An array of permission
|
|
131
|
+
* @param {string} bucketId - Bucket unique ID.
|
|
132
|
+
* @param {string} fileId - File ID.
|
|
133
|
+
* @param {string} name - File name.
|
|
134
|
+
* @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
135
135
|
* @throws {AppwriteException}
|
|
136
136
|
* @returns {Promise<Models.File>}
|
|
137
137
|
* @deprecated Use the object parameter style method for a better developer experience.
|
package/src/enums/output.ts
DELETED