react-native-appwrite 0.10.1 → 0.12.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/CHANGELOG.md +7 -1
- package/README.md +84 -3
- package/dist/cjs/sdk.js +1810 -1113
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +1810 -1114
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/account/create-email-password-session.md +4 -4
- package/docs/examples/account/create-email-token.md +5 -5
- package/docs/examples/account/{create-magic-u-r-l-token.md → create-magic-url-token.md} +6 -6
- package/docs/examples/account/create-mfa-authenticator.md +3 -3
- package/docs/examples/account/create-mfa-challenge.md +3 -3
- package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/{create-o-auth2token.md → create-o-auth-2-session.md} +6 -6
- package/docs/examples/account/{create-o-auth2session.md → create-o-auth-2-token.md} +6 -6
- package/docs/examples/account/create-phone-token.md +4 -4
- package/docs/examples/account/create-push-target.md +5 -5
- package/docs/examples/account/create-recovery.md +4 -4
- package/docs/examples/account/create-session.md +4 -4
- package/docs/examples/account/create-verification.md +3 -3
- package/docs/examples/account/create.md +6 -6
- package/docs/examples/account/delete-identity.md +3 -3
- package/docs/examples/account/delete-mfa-authenticator.md +3 -3
- package/docs/examples/account/delete-push-target.md +3 -3
- package/docs/examples/account/delete-session.md +3 -3
- package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/get-session.md +3 -3
- package/docs/examples/account/list-identities.md +3 -3
- package/docs/examples/account/list-logs.md +3 -3
- package/docs/examples/account/list-mfa-factors.md +1 -1
- package/docs/examples/account/update-email.md +4 -4
- package/docs/examples/account/{update-magic-u-r-l-session.md → update-magic-url-session.md} +4 -4
- package/docs/examples/account/update-mfa-authenticator.md +4 -4
- package/docs/examples/account/update-mfa-challenge.md +4 -4
- package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/{update-m-f-a.md → update-mfa.md} +3 -3
- package/docs/examples/account/update-name.md +3 -3
- package/docs/examples/account/update-password.md +4 -4
- package/docs/examples/account/update-phone-session.md +4 -4
- package/docs/examples/account/update-phone-verification.md +4 -4
- package/docs/examples/account/update-phone.md +4 -4
- package/docs/examples/account/update-prefs.md +3 -3
- package/docs/examples/account/update-push-target.md +4 -4
- package/docs/examples/account/update-recovery.md +5 -5
- package/docs/examples/account/update-session.md +3 -3
- package/docs/examples/account/update-verification.md +4 -4
- package/docs/examples/avatars/get-browser.md +6 -6
- package/docs/examples/avatars/get-credit-card.md +6 -6
- package/docs/examples/avatars/get-favicon.md +3 -3
- package/docs/examples/avatars/get-flag.md +6 -6
- package/docs/examples/avatars/get-image.md +5 -5
- package/docs/examples/avatars/get-initials.md +6 -6
- package/docs/examples/avatars/{get-q-r.md → get-qr.md} +6 -6
- package/docs/examples/databases/create-document.md +8 -10
- package/docs/examples/databases/decrement-document-attribute.md +18 -0
- package/docs/examples/databases/delete-document.md +5 -5
- package/docs/examples/databases/get-document.md +6 -6
- package/docs/examples/databases/increment-document-attribute.md +18 -0
- package/docs/examples/databases/list-documents.md +5 -5
- package/docs/examples/databases/update-document.md +7 -7
- package/docs/examples/databases/upsert-document.md +7 -7
- package/docs/examples/functions/create-execution.md +9 -9
- package/docs/examples/functions/get-execution.md +4 -4
- package/docs/examples/functions/list-executions.md +4 -4
- package/docs/examples/graphql/mutation.md +3 -3
- package/docs/examples/graphql/query.md +3 -3
- package/docs/examples/messaging/create-subscriber.md +5 -5
- package/docs/examples/messaging/delete-subscriber.md +4 -4
- package/docs/examples/storage/create-file.md +6 -6
- package/docs/examples/storage/delete-file.md +4 -4
- package/docs/examples/storage/get-file-download.md +5 -5
- package/docs/examples/storage/get-file-preview.md +16 -16
- package/docs/examples/storage/get-file-view.md +5 -5
- package/docs/examples/storage/get-file.md +4 -4
- package/docs/examples/storage/list-files.md +5 -5
- package/docs/examples/storage/update-file.md +6 -6
- package/docs/examples/tablesdb/create-row.md +17 -0
- package/docs/examples/tablesdb/decrement-row-column.md +18 -0
- package/docs/examples/tablesdb/delete-row.md +15 -0
- package/docs/examples/tablesdb/get-row.md +16 -0
- package/docs/examples/tablesdb/increment-row-column.md +18 -0
- package/docs/examples/tablesdb/list-rows.md +15 -0
- package/docs/examples/tablesdb/update-row.md +17 -0
- package/docs/examples/tablesdb/upsert-row.md +17 -0
- package/docs/examples/teams/create-membership.md +9 -9
- package/docs/examples/teams/create.md +5 -5
- package/docs/examples/teams/delete-membership.md +4 -4
- package/docs/examples/teams/delete.md +3 -3
- package/docs/examples/teams/get-membership.md +4 -4
- package/docs/examples/teams/get-prefs.md +3 -3
- package/docs/examples/teams/get.md +3 -3
- package/docs/examples/teams/list-memberships.md +5 -5
- package/docs/examples/teams/list.md +4 -4
- package/docs/examples/teams/update-membership-status.md +6 -6
- package/docs/examples/teams/update-membership.md +5 -5
- package/docs/examples/teams/update-name.md +4 -4
- package/docs/examples/teams/update-prefs.md +4 -4
- package/package.json +1 -1
- package/src/client.ts +2 -2
- package/src/index.ts +1 -0
- package/src/models.ts +139 -21
- package/src/query.ts +95 -0
- package/src/services/account.ts +1518 -364
- package/src/services/avatars.ts +296 -87
- package/src/services/databases.ts +438 -55
- package/src/services/functions.ts +118 -23
- package/src/services/graphql.ts +54 -6
- package/src/services/locale.ts +16 -27
- package/src/services/messaging.ts +68 -9
- package/src/services/storage.ts +353 -84
- package/src/services/tables-db.ts +621 -0
- package/src/services/teams.ts +467 -106
- package/types/index.d.ts +1 -0
- package/types/models.d.ts +127 -62
- package/types/query.d.ts +77 -0
- package/types/services/account.d.ts +791 -337
- package/types/services/avatars.d.ts +175 -80
- package/types/services/databases.d.ts +220 -53
- package/types/services/functions.d.ts +65 -20
- package/types/services/graphql.d.ts +26 -4
- package/types/services/locale.d.ts +16 -27
- package/types/services/messaging.d.ts +35 -7
- package/types/services/storage.d.ts +209 -76
- package/types/services/tables-db.d.ts +245 -0
- package/types/services/teams.d.ts +261 -99
- /package/docs/examples/account/{create-j-w-t.md → create-jwt.md} +0 -0
- /package/docs/examples/locale/{list-countries-e-u.md → list-countries-eu.md} +0 -0
|
@@ -5,39 +5,84 @@ import { ExecutionMethod } from '../enums/execution-method';
|
|
|
5
5
|
export declare class Functions extends Service {
|
|
6
6
|
constructor(client: Client);
|
|
7
7
|
/**
|
|
8
|
-
* Get a list of all the current user function execution logs. You can use the
|
|
9
|
-
* query params to filter your results.
|
|
8
|
+
* Get a list of all the current user function execution logs. You can use the query params to filter your results.
|
|
10
9
|
*
|
|
11
|
-
* @param {string} functionId
|
|
12
|
-
* @param {string[]} queries
|
|
10
|
+
* @param {string} params.functionId - Function ID.
|
|
11
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
|
13
12
|
* @throws {AppwriteException}
|
|
14
13
|
* @returns {Promise}
|
|
15
|
-
|
|
14
|
+
*/
|
|
15
|
+
listExecutions(params: {
|
|
16
|
+
functionId: string;
|
|
17
|
+
queries?: string[];
|
|
18
|
+
}): Promise<Models.ExecutionList>;
|
|
19
|
+
/**
|
|
20
|
+
* Get a list of all the current user function execution logs. You can use the query params to filter your results.
|
|
21
|
+
*
|
|
22
|
+
* @param {string} functionId - Function ID.
|
|
23
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
|
24
|
+
* @throws {AppwriteException}
|
|
25
|
+
* @returns {Promise<Models.ExecutionList>}
|
|
26
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
27
|
+
*/
|
|
16
28
|
listExecutions(functionId: string, queries?: string[]): Promise<Models.ExecutionList>;
|
|
17
29
|
/**
|
|
18
|
-
* Trigger a function execution. The returned object will return you the
|
|
19
|
-
* current execution status. You can ping the `Get Execution` endpoint to get
|
|
20
|
-
* updates on the current execution status. Once this endpoint is called, your
|
|
21
|
-
* function execution process will start asynchronously.
|
|
30
|
+
* Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
|
|
22
31
|
*
|
|
23
|
-
* @param {string} functionId
|
|
24
|
-
* @param {string} body
|
|
25
|
-
* @param {boolean} async
|
|
26
|
-
* @param {string} xpath
|
|
27
|
-
* @param {ExecutionMethod} method
|
|
28
|
-
* @param {object} headers
|
|
29
|
-
* @param {string} scheduledAt
|
|
32
|
+
* @param {string} params.functionId - Function ID.
|
|
33
|
+
* @param {string} params.body - HTTP body of execution. Default value is empty string.
|
|
34
|
+
* @param {boolean} params.async - Execute code in the background. Default value is false.
|
|
35
|
+
* @param {string} params.xpath - HTTP path of execution. Path can include query params. Default value is /
|
|
36
|
+
* @param {ExecutionMethod} params.method - HTTP method of execution. Default value is GET.
|
|
37
|
+
* @param {object} params.headers - HTTP headers of execution. Defaults to empty.
|
|
38
|
+
* @param {string} params.scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
|
|
30
39
|
* @throws {AppwriteException}
|
|
31
40
|
* @returns {Promise}
|
|
32
|
-
|
|
41
|
+
*/
|
|
42
|
+
createExecution(params: {
|
|
43
|
+
functionId: string;
|
|
44
|
+
body?: string;
|
|
45
|
+
async?: boolean;
|
|
46
|
+
xpath?: string;
|
|
47
|
+
method?: ExecutionMethod;
|
|
48
|
+
headers?: object;
|
|
49
|
+
scheduledAt?: string;
|
|
50
|
+
}): Promise<Models.Execution>;
|
|
51
|
+
/**
|
|
52
|
+
* Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} functionId - Function ID.
|
|
55
|
+
* @param {string} body - HTTP body of execution. Default value is empty string.
|
|
56
|
+
* @param {boolean} async - Execute code in the background. Default value is false.
|
|
57
|
+
* @param {string} xpath - HTTP path of execution. Path can include query params. Default value is /
|
|
58
|
+
* @param {ExecutionMethod} method - HTTP method of execution. Default value is GET.
|
|
59
|
+
* @param {object} headers - HTTP headers of execution. Defaults to empty.
|
|
60
|
+
* @param {string} scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
|
|
61
|
+
* @throws {AppwriteException}
|
|
62
|
+
* @returns {Promise<Models.Execution>}
|
|
63
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
64
|
+
*/
|
|
33
65
|
createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution>;
|
|
34
66
|
/**
|
|
35
67
|
* Get a function execution log by its unique ID.
|
|
36
68
|
*
|
|
37
|
-
* @param {string} functionId
|
|
38
|
-
* @param {string} executionId
|
|
69
|
+
* @param {string} params.functionId - Function ID.
|
|
70
|
+
* @param {string} params.executionId - Execution ID.
|
|
39
71
|
* @throws {AppwriteException}
|
|
40
72
|
* @returns {Promise}
|
|
41
|
-
|
|
73
|
+
*/
|
|
74
|
+
getExecution(params: {
|
|
75
|
+
functionId: string;
|
|
76
|
+
executionId: string;
|
|
77
|
+
}): Promise<Models.Execution>;
|
|
78
|
+
/**
|
|
79
|
+
* Get a function execution log by its unique ID.
|
|
80
|
+
*
|
|
81
|
+
* @param {string} functionId - Function ID.
|
|
82
|
+
* @param {string} executionId - Execution ID.
|
|
83
|
+
* @throws {AppwriteException}
|
|
84
|
+
* @returns {Promise<Models.Execution>}
|
|
85
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
86
|
+
*/
|
|
42
87
|
getExecution(functionId: string, executionId: string): Promise<Models.Execution>;
|
|
43
88
|
}
|
|
@@ -5,17 +5,39 @@ export declare class Graphql extends Service {
|
|
|
5
5
|
/**
|
|
6
6
|
* Execute a GraphQL mutation.
|
|
7
7
|
*
|
|
8
|
-
* @param {object} query
|
|
8
|
+
* @param {object} params.query - The query or queries to execute.
|
|
9
9
|
* @throws {AppwriteException}
|
|
10
10
|
* @returns {Promise}
|
|
11
|
-
|
|
11
|
+
*/
|
|
12
|
+
query(params: {
|
|
13
|
+
query: object;
|
|
14
|
+
}): Promise<{}>;
|
|
15
|
+
/**
|
|
16
|
+
* Execute a GraphQL mutation.
|
|
17
|
+
*
|
|
18
|
+
* @param {object} query - The query or queries to execute.
|
|
19
|
+
* @throws {AppwriteException}
|
|
20
|
+
* @returns {Promise<{}>}
|
|
21
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
22
|
+
*/
|
|
12
23
|
query(query: object): Promise<{}>;
|
|
13
24
|
/**
|
|
14
25
|
* Execute a GraphQL mutation.
|
|
15
26
|
*
|
|
16
|
-
* @param {object} query
|
|
27
|
+
* @param {object} params.query - The query or queries to execute.
|
|
17
28
|
* @throws {AppwriteException}
|
|
18
29
|
* @returns {Promise}
|
|
19
|
-
|
|
30
|
+
*/
|
|
31
|
+
mutation(params: {
|
|
32
|
+
query: object;
|
|
33
|
+
}): Promise<{}>;
|
|
34
|
+
/**
|
|
35
|
+
* Execute a GraphQL mutation.
|
|
36
|
+
*
|
|
37
|
+
* @param {object} query - The query or queries to execute.
|
|
38
|
+
* @throws {AppwriteException}
|
|
39
|
+
* @returns {Promise<{}>}
|
|
40
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
41
|
+
*/
|
|
20
42
|
mutation(query: object): Promise<{}>;
|
|
21
43
|
}
|
|
@@ -4,72 +4,61 @@ import type { Models } from '../models';
|
|
|
4
4
|
export declare class Locale extends Service {
|
|
5
5
|
constructor(client: Client);
|
|
6
6
|
/**
|
|
7
|
-
* Get the current user location based on IP. Returns an object with user
|
|
8
|
-
* country code, country name, continent name, continent code, ip address and
|
|
9
|
-
* suggested currency. You can use the locale header to get the data in a
|
|
10
|
-
* supported language.
|
|
7
|
+
* Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
|
|
11
8
|
*
|
|
12
9
|
* ([IP Geolocation by DB-IP](https://db-ip.com))
|
|
13
10
|
*
|
|
14
11
|
* @throws {AppwriteException}
|
|
15
12
|
* @returns {Promise}
|
|
16
|
-
|
|
13
|
+
*/
|
|
17
14
|
get(): Promise<Models.Locale>;
|
|
18
15
|
/**
|
|
19
|
-
* List of all locale codes in [ISO
|
|
20
|
-
* 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
|
16
|
+
* List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
|
21
17
|
*
|
|
22
18
|
* @throws {AppwriteException}
|
|
23
19
|
* @returns {Promise}
|
|
24
|
-
|
|
20
|
+
*/
|
|
25
21
|
listCodes(): Promise<Models.LocaleCodeList>;
|
|
26
22
|
/**
|
|
27
|
-
* List of all continents. You can use the locale header to get the data in a
|
|
28
|
-
* supported language.
|
|
23
|
+
* List of all continents. You can use the locale header to get the data in a supported language.
|
|
29
24
|
*
|
|
30
25
|
* @throws {AppwriteException}
|
|
31
26
|
* @returns {Promise}
|
|
32
|
-
|
|
27
|
+
*/
|
|
33
28
|
listContinents(): Promise<Models.ContinentList>;
|
|
34
29
|
/**
|
|
35
|
-
* List of all countries. You can use the locale header to get the data in a
|
|
36
|
-
* supported language.
|
|
30
|
+
* List of all countries. You can use the locale header to get the data in a supported language.
|
|
37
31
|
*
|
|
38
32
|
* @throws {AppwriteException}
|
|
39
33
|
* @returns {Promise}
|
|
40
|
-
|
|
34
|
+
*/
|
|
41
35
|
listCountries(): Promise<Models.CountryList>;
|
|
42
36
|
/**
|
|
43
|
-
* List of all countries that are currently members of the EU. You can use the
|
|
44
|
-
* locale header to get the data in a supported language.
|
|
37
|
+
* List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
|
|
45
38
|
*
|
|
46
39
|
* @throws {AppwriteException}
|
|
47
40
|
* @returns {Promise}
|
|
48
|
-
|
|
41
|
+
*/
|
|
49
42
|
listCountriesEU(): Promise<Models.CountryList>;
|
|
50
43
|
/**
|
|
51
|
-
* List of all countries phone codes. You can use the locale header to get the
|
|
52
|
-
* data in a supported language.
|
|
44
|
+
* List of all countries phone codes. You can use the locale header to get the data in a supported language.
|
|
53
45
|
*
|
|
54
46
|
* @throws {AppwriteException}
|
|
55
47
|
* @returns {Promise}
|
|
56
|
-
|
|
48
|
+
*/
|
|
57
49
|
listCountriesPhones(): Promise<Models.PhoneList>;
|
|
58
50
|
/**
|
|
59
|
-
* List of all currencies, including currency symbol, name, plural, and
|
|
60
|
-
* decimal digits for all major and minor currencies. You can use the locale
|
|
61
|
-
* header to get the data in a supported language.
|
|
51
|
+
* List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
|
|
62
52
|
*
|
|
63
53
|
* @throws {AppwriteException}
|
|
64
54
|
* @returns {Promise}
|
|
65
|
-
|
|
55
|
+
*/
|
|
66
56
|
listCurrencies(): Promise<Models.CurrencyList>;
|
|
67
57
|
/**
|
|
68
|
-
* List of all languages classified by ISO 639-1 including 2-letter code, name
|
|
69
|
-
* in English, and name in the respective language.
|
|
58
|
+
* List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
|
|
70
59
|
*
|
|
71
60
|
* @throws {AppwriteException}
|
|
72
61
|
* @returns {Promise}
|
|
73
|
-
|
|
62
|
+
*/
|
|
74
63
|
listLanguages(): Promise<Models.LanguageList>;
|
|
75
64
|
}
|
|
@@ -6,20 +6,48 @@ export declare class Messaging extends Service {
|
|
|
6
6
|
/**
|
|
7
7
|
* Create a new subscriber.
|
|
8
8
|
*
|
|
9
|
-
* @param {string} topicId
|
|
10
|
-
* @param {string} subscriberId
|
|
11
|
-
* @param {string} targetId
|
|
9
|
+
* @param {string} params.topicId - Topic ID. The topic ID to subscribe to.
|
|
10
|
+
* @param {string} params.subscriberId - Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.
|
|
11
|
+
* @param {string} params.targetId - Target ID. The target ID to link to the specified Topic ID.
|
|
12
12
|
* @throws {AppwriteException}
|
|
13
13
|
* @returns {Promise}
|
|
14
|
-
|
|
14
|
+
*/
|
|
15
|
+
createSubscriber(params: {
|
|
16
|
+
topicId: string;
|
|
17
|
+
subscriberId: string;
|
|
18
|
+
targetId: string;
|
|
19
|
+
}): Promise<Models.Subscriber>;
|
|
20
|
+
/**
|
|
21
|
+
* Create a new subscriber.
|
|
22
|
+
*
|
|
23
|
+
* @param {string} topicId - Topic ID. The topic ID to subscribe to.
|
|
24
|
+
* @param {string} subscriberId - Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.
|
|
25
|
+
* @param {string} targetId - Target ID. The target ID to link to the specified Topic ID.
|
|
26
|
+
* @throws {AppwriteException}
|
|
27
|
+
* @returns {Promise<Models.Subscriber>}
|
|
28
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
29
|
+
*/
|
|
15
30
|
createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise<Models.Subscriber>;
|
|
16
31
|
/**
|
|
17
32
|
* Delete a subscriber by its unique ID.
|
|
18
33
|
*
|
|
19
|
-
* @param {string} topicId
|
|
20
|
-
* @param {string} subscriberId
|
|
34
|
+
* @param {string} params.topicId - Topic ID. The topic ID subscribed to.
|
|
35
|
+
* @param {string} params.subscriberId - Subscriber ID.
|
|
21
36
|
* @throws {AppwriteException}
|
|
22
37
|
* @returns {Promise}
|
|
23
|
-
|
|
38
|
+
*/
|
|
39
|
+
deleteSubscriber(params: {
|
|
40
|
+
topicId: string;
|
|
41
|
+
subscriberId: string;
|
|
42
|
+
}): Promise<{}>;
|
|
43
|
+
/**
|
|
44
|
+
* Delete a subscriber by its unique ID.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} topicId - Topic ID. The topic ID subscribed to.
|
|
47
|
+
* @param {string} subscriberId - Subscriber ID.
|
|
48
|
+
* @throws {AppwriteException}
|
|
49
|
+
* @returns {Promise<{}>}
|
|
50
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
51
|
+
*/
|
|
24
52
|
deleteSubscriber(topicId: string, subscriberId: string): Promise<{}>;
|
|
25
53
|
}
|
|
@@ -7,43 +7,77 @@ import { ImageFormat } from '../enums/image-format';
|
|
|
7
7
|
export declare class Storage extends Service {
|
|
8
8
|
constructor(client: Client);
|
|
9
9
|
/**
|
|
10
|
-
* Get a list of all the user files. You can use the query params to filter
|
|
11
|
-
* your results.
|
|
10
|
+
* Get a list of all the user files. You can use the query params to filter your results.
|
|
12
11
|
*
|
|
13
|
-
* @param {string} bucketId
|
|
14
|
-
* @param {string[]} queries
|
|
15
|
-
* @param {string} search
|
|
12
|
+
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
13
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
|
14
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
16
15
|
* @throws {AppwriteException}
|
|
17
16
|
* @returns {Promise}
|
|
18
|
-
|
|
17
|
+
*/
|
|
18
|
+
listFiles(params: {
|
|
19
|
+
bucketId: string;
|
|
20
|
+
queries?: string[];
|
|
21
|
+
search?: string;
|
|
22
|
+
}): Promise<Models.FileList>;
|
|
23
|
+
/**
|
|
24
|
+
* Get a list of all the user files. You can use the query params to filter your results.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
27
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
|
28
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
29
|
+
* @throws {AppwriteException}
|
|
30
|
+
* @returns {Promise<Models.FileList>}
|
|
31
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
32
|
+
*/
|
|
19
33
|
listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList>;
|
|
20
34
|
/**
|
|
21
|
-
* Create a new file. Before using this route, you should create a new bucket
|
|
22
|
-
* resource using either a [server
|
|
23
|
-
* integration](https://appwrite.io/docs/server/storage#storageCreateBucket)
|
|
24
|
-
* API or directly from your Appwrite console.
|
|
35
|
+
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.
|
|
25
36
|
*
|
|
26
|
-
* Larger files should be uploaded using multiple requests with the
|
|
27
|
-
* [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range)
|
|
28
|
-
* header to send a partial request with a maximum supported chunk of `5MB`.
|
|
29
|
-
* The `content-range` header values should always be in bytes.
|
|
37
|
+
* Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
|
|
30
38
|
*
|
|
31
|
-
* When the first request is sent, the server will return the **File** object,
|
|
32
|
-
* and the subsequent part request must include the file's **id** in
|
|
33
|
-
* `x-appwrite-id` header to allow the server to know that the partial upload
|
|
34
|
-
* is for the existing file and not for a new one.
|
|
39
|
+
* When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
|
|
35
40
|
*
|
|
36
|
-
* If you're creating a new file using one of the Appwrite SDKs, all the
|
|
37
|
-
* chunking logic will be managed by the SDK internally.
|
|
41
|
+
* If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
|
|
38
42
|
*
|
|
39
43
|
*
|
|
40
|
-
* @param {string} bucketId
|
|
41
|
-
* @param {string} fileId
|
|
42
|
-
* @param {{name: string, type: string, size: number, uri: string}} file
|
|
43
|
-
* @param {string[]} permissions
|
|
44
|
+
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
45
|
+
* @param {string} params.fileId - File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
46
|
+
* @param {{name: string, type: string, size: number, uri: string}} params.file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).
|
|
47
|
+
* @param {string[]} params.permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
44
48
|
* @throws {AppwriteException}
|
|
45
49
|
* @returns {Promise}
|
|
46
|
-
|
|
50
|
+
*/
|
|
51
|
+
createFile(params: {
|
|
52
|
+
bucketId: string;
|
|
53
|
+
fileId: string;
|
|
54
|
+
file: {
|
|
55
|
+
name: string;
|
|
56
|
+
type: string;
|
|
57
|
+
size: number;
|
|
58
|
+
uri: string;
|
|
59
|
+
};
|
|
60
|
+
permissions?: string[];
|
|
61
|
+
onProgress?: (progress: UploadProgress) => void;
|
|
62
|
+
}): Promise<Models.File>;
|
|
63
|
+
/**
|
|
64
|
+
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.
|
|
65
|
+
*
|
|
66
|
+
* Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
|
|
67
|
+
*
|
|
68
|
+
* When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
|
|
69
|
+
*
|
|
70
|
+
* If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
|
|
71
|
+
*
|
|
72
|
+
*
|
|
73
|
+
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
74
|
+
* @param {string} fileId - File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
75
|
+
* @param {{name: string, type: string, size: number, uri: string}} file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).
|
|
76
|
+
* @param {string[]} permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
77
|
+
* @throws {AppwriteException}
|
|
78
|
+
* @returns {Promise<Models.File>}
|
|
79
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
80
|
+
*/
|
|
47
81
|
createFile(bucketId: string, fileId: string, file: {
|
|
48
82
|
name: string;
|
|
49
83
|
type: string;
|
|
@@ -51,85 +85,184 @@ export declare class Storage extends Service {
|
|
|
51
85
|
uri: string;
|
|
52
86
|
}, permissions?: string[], onProgress?: (progress: UploadProgress) => void): Promise<Models.File>;
|
|
53
87
|
/**
|
|
54
|
-
* Get a file by its unique ID. This endpoint response returns a JSON object
|
|
55
|
-
* with the file metadata.
|
|
88
|
+
* Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.
|
|
56
89
|
*
|
|
57
|
-
* @param {string} bucketId
|
|
58
|
-
* @param {string} fileId
|
|
90
|
+
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
91
|
+
* @param {string} params.fileId - File ID.
|
|
59
92
|
* @throws {AppwriteException}
|
|
60
93
|
* @returns {Promise}
|
|
61
|
-
|
|
94
|
+
*/
|
|
95
|
+
getFile(params: {
|
|
96
|
+
bucketId: string;
|
|
97
|
+
fileId: string;
|
|
98
|
+
}): Promise<Models.File>;
|
|
99
|
+
/**
|
|
100
|
+
* Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.
|
|
101
|
+
*
|
|
102
|
+
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
103
|
+
* @param {string} fileId - File ID.
|
|
104
|
+
* @throws {AppwriteException}
|
|
105
|
+
* @returns {Promise<Models.File>}
|
|
106
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
107
|
+
*/
|
|
62
108
|
getFile(bucketId: string, fileId: string): Promise<Models.File>;
|
|
63
109
|
/**
|
|
64
|
-
* Update a file by its unique ID. Only users with write permissions have
|
|
65
|
-
* access to update this resource.
|
|
110
|
+
* Update a file by its unique ID. Only users with write permissions have access to update this resource.
|
|
66
111
|
*
|
|
67
|
-
* @param {string} bucketId
|
|
68
|
-
* @param {string} fileId
|
|
69
|
-
* @param {string} name
|
|
70
|
-
* @param {string[]} permissions
|
|
112
|
+
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
113
|
+
* @param {string} params.fileId - File unique ID.
|
|
114
|
+
* @param {string} params.name - Name of the file
|
|
115
|
+
* @param {string[]} params.permissions - An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
71
116
|
* @throws {AppwriteException}
|
|
72
117
|
* @returns {Promise}
|
|
73
|
-
|
|
118
|
+
*/
|
|
119
|
+
updateFile(params: {
|
|
120
|
+
bucketId: string;
|
|
121
|
+
fileId: string;
|
|
122
|
+
name?: string;
|
|
123
|
+
permissions?: string[];
|
|
124
|
+
}): Promise<Models.File>;
|
|
125
|
+
/**
|
|
126
|
+
* Update a file by its unique ID. Only users with write permissions have access to update this resource.
|
|
127
|
+
*
|
|
128
|
+
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
129
|
+
* @param {string} fileId - File unique ID.
|
|
130
|
+
* @param {string} name - Name of the file
|
|
131
|
+
* @param {string[]} permissions - An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
132
|
+
* @throws {AppwriteException}
|
|
133
|
+
* @returns {Promise<Models.File>}
|
|
134
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
135
|
+
*/
|
|
74
136
|
updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File>;
|
|
75
137
|
/**
|
|
76
|
-
* Delete a file by its unique ID. Only users with write permissions have
|
|
77
|
-
* access to delete this resource.
|
|
138
|
+
* Delete a file by its unique ID. Only users with write permissions have access to delete this resource.
|
|
78
139
|
*
|
|
79
|
-
* @param {string} bucketId
|
|
80
|
-
* @param {string} fileId
|
|
140
|
+
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
141
|
+
* @param {string} params.fileId - File ID.
|
|
81
142
|
* @throws {AppwriteException}
|
|
82
143
|
* @returns {Promise}
|
|
83
|
-
|
|
144
|
+
*/
|
|
145
|
+
deleteFile(params: {
|
|
146
|
+
bucketId: string;
|
|
147
|
+
fileId: string;
|
|
148
|
+
}): Promise<{}>;
|
|
149
|
+
/**
|
|
150
|
+
* Delete a file by its unique ID. Only users with write permissions have access to delete this resource.
|
|
151
|
+
*
|
|
152
|
+
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
153
|
+
* @param {string} fileId - File ID.
|
|
154
|
+
* @throws {AppwriteException}
|
|
155
|
+
* @returns {Promise<{}>}
|
|
156
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
157
|
+
*/
|
|
84
158
|
deleteFile(bucketId: string, fileId: string): Promise<{}>;
|
|
85
159
|
/**
|
|
86
|
-
* Get a file content by its unique ID. The endpoint response return with a
|
|
87
|
-
* 'Content-Disposition: attachment' header that tells the browser to start
|
|
88
|
-
* downloading the file to user downloads directory.
|
|
160
|
+
* Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
|
89
161
|
*
|
|
90
|
-
* @param {string} bucketId
|
|
91
|
-
* @param {string} fileId
|
|
92
|
-
* @param {string} token
|
|
162
|
+
* @param {string} params.bucketId - Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
163
|
+
* @param {string} params.fileId - File ID.
|
|
164
|
+
* @param {string} params.token - File token for accessing this file.
|
|
93
165
|
* @throws {AppwriteException}
|
|
94
166
|
* @returns {ArrayBuffer}
|
|
95
|
-
|
|
167
|
+
*/
|
|
168
|
+
getFileDownload(params: {
|
|
169
|
+
bucketId: string;
|
|
170
|
+
fileId: string;
|
|
171
|
+
token?: string;
|
|
172
|
+
}): Promise<ArrayBuffer>;
|
|
173
|
+
/**
|
|
174
|
+
* Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
|
175
|
+
*
|
|
176
|
+
* @param {string} bucketId - Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
177
|
+
* @param {string} fileId - File ID.
|
|
178
|
+
* @param {string} token - File token for accessing this file.
|
|
179
|
+
* @throws {AppwriteException}
|
|
180
|
+
* @returns {Promise<ArrayBuffer>}
|
|
181
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
182
|
+
*/
|
|
96
183
|
getFileDownload(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;
|
|
97
184
|
/**
|
|
98
|
-
* Get a file preview image. Currently, this method supports preview for image
|
|
99
|
-
* files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
|
|
100
|
-
* and spreadsheets, will return the file icon image. You can also pass query
|
|
101
|
-
* string arguments for cutting and resizing your preview image. Preview is
|
|
102
|
-
* supported only for image files smaller than 10MB.
|
|
185
|
+
* Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.
|
|
103
186
|
*
|
|
104
|
-
* @param {string} bucketId
|
|
105
|
-
* @param {string} fileId
|
|
106
|
-
* @param {number} width
|
|
107
|
-
* @param {number} height
|
|
108
|
-
* @param {ImageGravity} gravity
|
|
109
|
-
* @param {number} quality
|
|
110
|
-
* @param {number} borderWidth
|
|
111
|
-
* @param {string} borderColor
|
|
112
|
-
* @param {number} borderRadius
|
|
113
|
-
* @param {number} opacity
|
|
114
|
-
* @param {number} rotation
|
|
115
|
-
* @param {string} background
|
|
116
|
-
* @param {ImageFormat} output
|
|
117
|
-
* @param {string} token
|
|
187
|
+
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
188
|
+
* @param {string} params.fileId - File ID
|
|
189
|
+
* @param {number} params.width - Resize preview image width, Pass an integer between 0 to 4000.
|
|
190
|
+
* @param {number} params.height - Resize preview image height, Pass an integer between 0 to 4000.
|
|
191
|
+
* @param {ImageGravity} params.gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right
|
|
192
|
+
* @param {number} params.quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
193
|
+
* @param {number} params.borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.
|
|
194
|
+
* @param {string} params.borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix.
|
|
195
|
+
* @param {number} params.borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000.
|
|
196
|
+
* @param {number} params.opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.
|
|
197
|
+
* @param {number} params.rotation - Preview image rotation in degrees. Pass an integer between -360 and 360.
|
|
198
|
+
* @param {string} params.background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.
|
|
199
|
+
* @param {ImageFormat} params.output - Output format type (jpeg, jpg, png, gif and webp).
|
|
200
|
+
* @param {string} params.token - File token for accessing this file.
|
|
118
201
|
* @throws {AppwriteException}
|
|
119
202
|
* @returns {ArrayBuffer}
|
|
120
|
-
|
|
203
|
+
*/
|
|
204
|
+
getFilePreview(params: {
|
|
205
|
+
bucketId: string;
|
|
206
|
+
fileId: string;
|
|
207
|
+
width?: number;
|
|
208
|
+
height?: number;
|
|
209
|
+
gravity?: ImageGravity;
|
|
210
|
+
quality?: number;
|
|
211
|
+
borderWidth?: number;
|
|
212
|
+
borderColor?: string;
|
|
213
|
+
borderRadius?: number;
|
|
214
|
+
opacity?: number;
|
|
215
|
+
rotation?: number;
|
|
216
|
+
background?: string;
|
|
217
|
+
output?: ImageFormat;
|
|
218
|
+
token?: string;
|
|
219
|
+
}): Promise<ArrayBuffer>;
|
|
220
|
+
/**
|
|
221
|
+
* Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.
|
|
222
|
+
*
|
|
223
|
+
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
224
|
+
* @param {string} fileId - File ID
|
|
225
|
+
* @param {number} width - Resize preview image width, Pass an integer between 0 to 4000.
|
|
226
|
+
* @param {number} height - Resize preview image height, Pass an integer between 0 to 4000.
|
|
227
|
+
* @param {ImageGravity} gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right
|
|
228
|
+
* @param {number} quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
229
|
+
* @param {number} borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.
|
|
230
|
+
* @param {string} borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix.
|
|
231
|
+
* @param {number} borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000.
|
|
232
|
+
* @param {number} opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.
|
|
233
|
+
* @param {number} rotation - Preview image rotation in degrees. Pass an integer between -360 and 360.
|
|
234
|
+
* @param {string} background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.
|
|
235
|
+
* @param {ImageFormat} output - Output format type (jpeg, jpg, png, gif and webp).
|
|
236
|
+
* @param {string} token - File token for accessing this file.
|
|
237
|
+
* @throws {AppwriteException}
|
|
238
|
+
* @returns {Promise<ArrayBuffer>}
|
|
239
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
240
|
+
*/
|
|
121
241
|
getFilePreview(bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string): Promise<ArrayBuffer>;
|
|
122
242
|
/**
|
|
123
|
-
* Get a file content by its unique ID. This endpoint is similar to the
|
|
124
|
-
* download method but returns with no 'Content-Disposition: attachment'
|
|
125
|
-
* header.
|
|
243
|
+
* Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.
|
|
126
244
|
*
|
|
127
|
-
* @param {string} bucketId
|
|
128
|
-
* @param {string} fileId
|
|
129
|
-
* @param {string} token
|
|
245
|
+
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
246
|
+
* @param {string} params.fileId - File ID.
|
|
247
|
+
* @param {string} params.token - File token for accessing this file.
|
|
130
248
|
* @throws {AppwriteException}
|
|
131
249
|
* @returns {ArrayBuffer}
|
|
132
|
-
|
|
250
|
+
*/
|
|
251
|
+
getFileView(params: {
|
|
252
|
+
bucketId: string;
|
|
253
|
+
fileId: string;
|
|
254
|
+
token?: string;
|
|
255
|
+
}): Promise<ArrayBuffer>;
|
|
256
|
+
/**
|
|
257
|
+
* Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.
|
|
258
|
+
*
|
|
259
|
+
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
260
|
+
* @param {string} fileId - File ID.
|
|
261
|
+
* @param {string} token - File token for accessing this file.
|
|
262
|
+
* @throws {AppwriteException}
|
|
263
|
+
* @returns {Promise<ArrayBuffer>}
|
|
264
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
265
|
+
*/
|
|
133
266
|
getFileView(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;
|
|
134
267
|
/**
|
|
135
268
|
* Get a file content by its unique ID. The endpoint response return with a
|