node-appwrite 20.3.0 → 21.1.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/dist/client.js +2 -2
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +2 -2
- package/dist/client.mjs.map +1 -1
- package/dist/enums/build-runtime.d.mts +3 -1
- package/dist/enums/build-runtime.d.ts +3 -1
- package/dist/enums/build-runtime.js +2 -0
- package/dist/enums/build-runtime.js.map +1 -1
- package/dist/enums/build-runtime.mjs +2 -0
- package/dist/enums/build-runtime.mjs.map +1 -1
- package/dist/enums/output.d.mts +11 -0
- package/dist/enums/output.d.ts +11 -0
- package/dist/enums/output.js +16 -0
- package/dist/enums/output.js.map +1 -0
- package/dist/enums/output.mjs +15 -0
- package/dist/enums/output.mjs.map +1 -0
- package/dist/enums/runtime.d.mts +3 -1
- package/dist/enums/runtime.d.ts +3 -1
- package/dist/enums/runtime.js +2 -0
- package/dist/enums/runtime.js.map +1 -1
- package/dist/enums/runtime.mjs +2 -0
- package/dist/enums/runtime.mjs.map +1 -1
- package/dist/enums/template-reference-type.d.mts +7 -0
- package/dist/enums/template-reference-type.d.ts +7 -0
- package/dist/enums/template-reference-type.js +12 -0
- package/dist/enums/template-reference-type.js.map +1 -0
- package/dist/enums/template-reference-type.mjs +11 -0
- package/dist/enums/template-reference-type.mjs.map +1 -0
- package/dist/enums/theme.d.mts +6 -0
- package/dist/enums/theme.d.ts +6 -0
- package/dist/enums/theme.js +11 -0
- package/dist/enums/theme.js.map +1 -0
- package/dist/enums/theme.mjs +10 -0
- package/dist/enums/theme.mjs.map +1 -0
- package/dist/enums/timezone.d.mts +423 -0
- package/dist/enums/timezone.d.ts +423 -0
- package/dist/enums/timezone.js +428 -0
- package/dist/enums/timezone.js.map +1 -0
- package/dist/enums/timezone.mjs +427 -0
- package/dist/enums/timezone.mjs.map +1 -0
- package/dist/enums/{vcs-deployment-type.d.mts → vcs-reference-type.d.mts} +2 -2
- package/dist/enums/{vcs-deployment-type.d.ts → vcs-reference-type.d.ts} +2 -2
- package/dist/enums/vcs-reference-type.js +12 -0
- package/dist/enums/vcs-reference-type.js.map +1 -0
- package/dist/enums/vcs-reference-type.mjs +11 -0
- package/dist/enums/vcs-reference-type.mjs.map +1 -0
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +23 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/dist/models.d.mts +4 -0
- package/dist/models.d.ts +4 -0
- package/dist/services/account.js +4 -4
- package/dist/services/account.js.map +1 -1
- package/dist/services/account.mjs +4 -4
- package/dist/services/account.mjs.map +1 -1
- package/dist/services/avatars.d.mts +87 -0
- package/dist/services/avatars.d.ts +87 -0
- package/dist/services/avatars.js +123 -0
- package/dist/services/avatars.js.map +1 -1
- package/dist/services/avatars.mjs +123 -0
- package/dist/services/avatars.mjs.map +1 -1
- package/dist/services/databases.d.mts +7 -1
- package/dist/services/databases.d.ts +7 -1
- package/dist/services/databases.js +11 -1
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +11 -1
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +13 -9
- package/dist/services/functions.d.ts +13 -9
- package/dist/services/functions.js +15 -7
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs +15 -7
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/sites.d.mts +15 -11
- package/dist/services/sites.d.ts +15 -11
- package/dist/services/sites.js +15 -7
- package/dist/services/sites.js.map +1 -1
- package/dist/services/sites.mjs +15 -7
- package/dist/services/sites.mjs.map +1 -1
- package/dist/services/storage.d.mts +10 -4
- package/dist/services/storage.d.ts +10 -4
- package/dist/services/storage.js +12 -2
- package/dist/services/storage.js.map +1 -1
- package/dist/services/storage.mjs +12 -2
- package/dist/services/storage.mjs.map +1 -1
- package/dist/services/tables-db.d.mts +9 -3
- package/dist/services/tables-db.d.ts +9 -3
- package/dist/services/tables-db.js +11 -1
- package/dist/services/tables-db.js.map +1 -1
- package/dist/services/tables-db.mjs +11 -1
- package/dist/services/tables-db.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/enums/vcs-deployment-type.js +0 -12
- package/dist/enums/vcs-deployment-type.js.map +0 -1
- package/dist/enums/vcs-deployment-type.mjs +0 -11
- package/dist/enums/vcs-deployment-type.mjs.map +0 -1
|
@@ -54,7 +54,8 @@ var Storage = class {
|
|
|
54
54
|
allowedFileExtensions: rest[5],
|
|
55
55
|
compression: rest[6],
|
|
56
56
|
encryption: rest[7],
|
|
57
|
-
antivirus: rest[8]
|
|
57
|
+
antivirus: rest[8],
|
|
58
|
+
transformations: rest[9]
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
61
|
const bucketId = params.bucketId;
|
|
@@ -67,6 +68,7 @@ var Storage = class {
|
|
|
67
68
|
const compression = params.compression;
|
|
68
69
|
const encryption = params.encryption;
|
|
69
70
|
const antivirus = params.antivirus;
|
|
71
|
+
const transformations = params.transformations;
|
|
70
72
|
if (typeof bucketId === "undefined") {
|
|
71
73
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
72
74
|
}
|
|
@@ -105,6 +107,9 @@ var Storage = class {
|
|
|
105
107
|
if (typeof antivirus !== "undefined") {
|
|
106
108
|
payload["antivirus"] = antivirus;
|
|
107
109
|
}
|
|
110
|
+
if (typeof transformations !== "undefined") {
|
|
111
|
+
payload["transformations"] = transformations;
|
|
112
|
+
}
|
|
108
113
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
109
114
|
const apiHeaders = {
|
|
110
115
|
"content-type": "application/json"
|
|
@@ -155,7 +160,8 @@ var Storage = class {
|
|
|
155
160
|
allowedFileExtensions: rest[5],
|
|
156
161
|
compression: rest[6],
|
|
157
162
|
encryption: rest[7],
|
|
158
|
-
antivirus: rest[8]
|
|
163
|
+
antivirus: rest[8],
|
|
164
|
+
transformations: rest[9]
|
|
159
165
|
};
|
|
160
166
|
}
|
|
161
167
|
const bucketId = params.bucketId;
|
|
@@ -168,6 +174,7 @@ var Storage = class {
|
|
|
168
174
|
const compression = params.compression;
|
|
169
175
|
const encryption = params.encryption;
|
|
170
176
|
const antivirus = params.antivirus;
|
|
177
|
+
const transformations = params.transformations;
|
|
171
178
|
if (typeof bucketId === "undefined") {
|
|
172
179
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
173
180
|
}
|
|
@@ -203,6 +210,9 @@ var Storage = class {
|
|
|
203
210
|
if (typeof antivirus !== "undefined") {
|
|
204
211
|
payload["antivirus"] = antivirus;
|
|
205
212
|
}
|
|
213
|
+
if (typeof transformations !== "undefined") {
|
|
214
|
+
payload["transformations"] = transformations;
|
|
215
|
+
}
|
|
206
216
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
207
217
|
const apiHeaders = {
|
|
208
218
|
"content-type": "application/json"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/services/storage.ts"],"names":[],"mappings":";AAAA,SAAS,yBAA+D;AAOjE,IAAM,UAAN,MAAc;AAAA,EAGjB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA,EAuBA,YACI,kBACG,MACuB;AAC1B,QAAI;AAEJ,QAAI,CAAC,iBAAkB,iBAAiB,OAAO,kBAAkB,YAAY,CAAC,MAAM,QAAQ,aAAa,GAAI;AACzG,eAAU,iBAAiB,CAAC;AAAA,IAChC,OAAO;AACH,eAAS;AAAA,QACL,SAAS;AAAA,QACT,QAAQ,KAAK,CAAC;AAAA,QACd,OAAO,KAAK,CAAC;AAAA,MACjB;AAAA,IACJ;AAEA,UAAM,UAAU,OAAO;AACvB,UAAM,SAAS,OAAO;AACtB,UAAM,QAAQ,OAAO;AAGrB,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,QAAI,OAAO,YAAY,aAAa;AAChC,cAAQ,SAAS,IAAI;AAAA,IACzB;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B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Client, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\n\nimport { Compression } from '../enums/compression';\nimport { ImageGravity } from '../enums/image-gravity';\nimport { ImageFormat } from '../enums/image-format';\n\nexport class Storage {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * Get a list of all the storage buckets. You can use the query params to filter your results.\n *\n * @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: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus\n * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.\n * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.BucketList>}\n */\n listBuckets(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.BucketList>;\n /**\n * Get a list of all the storage buckets. You can use the query params to filter your results.\n *\n * @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: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus\n * @param {string} search - Search term to filter your list results. Max length: 256 chars.\n * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.BucketList>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n listBuckets(queries?: string[], search?: string, total?: boolean): Promise<Models.BucketList>;\n listBuckets(\n paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],\n ...rest: [(string)?, (boolean)?] \n ): Promise<Models.BucketList> {\n let params: { queries?: string[], search?: string, total?: boolean };\n \n if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };\n } else {\n params = {\n queries: paramsOrFirst as string[],\n search: rest[0] as string,\n total: rest[1] as boolean \n };\n }\n \n const queries = params.queries;\n const search = params.search;\n const total = params.total;\n\n\n const apiPath = '/storage/buckets';\n const payload: Payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n if (typeof total !== 'undefined') {\n payload['total'] = total;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Create a new storage bucket.\n *\n * @param {string} params.bucketId - Unique 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.\n * @param {string} params.name - Bucket name\n * @param {string[]} params.permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.\n * @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.\n * @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.\n * @param {Compression} params.compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled\n * @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled\n * @param {boolean} params.antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n createBucket(params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean }): Promise<Models.Bucket>;\n /**\n * Create a new storage bucket.\n *\n * @param {string} bucketId - Unique 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.\n * @param {string} name - Bucket name\n * @param {string[]} permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.\n * @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.\n * @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.\n * @param {Compression} compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled\n * @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled\n * @param {boolean} antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket>;\n createBucket(\n paramsOrFirst: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean } | string,\n ...rest: [(string)?, (string[])?, (boolean)?, (boolean)?, (number)?, (string[])?, (Compression)?, (boolean)?, (boolean)?] \n ): Promise<Models.Bucket> {\n let params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n name: rest[0] as string,\n permissions: rest[1] as string[],\n fileSecurity: rest[2] as boolean,\n enabled: rest[3] as boolean,\n maximumFileSize: rest[4] as number,\n allowedFileExtensions: rest[5] as string[],\n compression: rest[6] as Compression,\n encryption: rest[7] as boolean,\n antivirus: rest[8] as boolean \n };\n }\n \n const bucketId = params.bucketId;\n const name = params.name;\n const permissions = params.permissions;\n const fileSecurity = params.fileSecurity;\n const enabled = params.enabled;\n const maximumFileSize = params.maximumFileSize;\n const allowedFileExtensions = params.allowedFileExtensions;\n const compression = params.compression;\n const encryption = params.encryption;\n const antivirus = params.antivirus;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof name === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"name\"');\n }\n\n const apiPath = '/storage/buckets';\n const payload: Payload = {};\n if (typeof bucketId !== 'undefined') {\n payload['bucketId'] = bucketId;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n if (typeof fileSecurity !== 'undefined') {\n payload['fileSecurity'] = fileSecurity;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n if (typeof maximumFileSize !== 'undefined') {\n payload['maximumFileSize'] = maximumFileSize;\n }\n if (typeof allowedFileExtensions !== 'undefined') {\n payload['allowedFileExtensions'] = allowedFileExtensions;\n }\n if (typeof compression !== 'undefined') {\n payload['compression'] = compression;\n }\n if (typeof encryption !== 'undefined') {\n payload['encryption'] = encryption;\n }\n if (typeof antivirus !== 'undefined') {\n payload['antivirus'] = antivirus;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'post',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.\n *\n * @param {string} params.bucketId - Bucket unique ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n getBucket(params: { bucketId: string }): Promise<Models.Bucket>;\n /**\n * Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.\n *\n * @param {string} bucketId - Bucket unique ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getBucket(bucketId: string): Promise<Models.Bucket>;\n getBucket(\n paramsOrFirst: { bucketId: string } | string \n ): Promise<Models.Bucket> {\n let params: { bucketId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string };\n } else {\n params = {\n bucketId: paramsOrFirst as string \n };\n }\n \n const bucketId = params.bucketId;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Update a storage bucket by its unique ID.\n *\n * @param {string} params.bucketId - Bucket unique ID.\n * @param {string} params.name - Bucket name\n * @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).\n * @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.\n * @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.\n * @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.\n * @param {Compression} params.compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled\n * @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled\n * @param {boolean} params.antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n updateBucket(params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean }): Promise<Models.Bucket>;\n /**\n * Update a storage bucket by its unique ID.\n *\n * @param {string} bucketId - Bucket unique ID.\n * @param {string} name - Bucket name\n * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.\n * @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.\n * @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.\n * @param {Compression} compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled\n * @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled\n * @param {boolean} antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket>;\n updateBucket(\n paramsOrFirst: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean } | string,\n ...rest: [(string)?, (string[])?, (boolean)?, (boolean)?, (number)?, (string[])?, (Compression)?, (boolean)?, (boolean)?] \n ): Promise<Models.Bucket> {\n let params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n name: rest[0] as string,\n permissions: rest[1] as string[],\n fileSecurity: rest[2] as boolean,\n enabled: rest[3] as boolean,\n maximumFileSize: rest[4] as number,\n allowedFileExtensions: rest[5] as string[],\n compression: rest[6] as Compression,\n encryption: rest[7] as boolean,\n antivirus: rest[8] as boolean \n };\n }\n \n const bucketId = params.bucketId;\n const name = params.name;\n const permissions = params.permissions;\n const fileSecurity = params.fileSecurity;\n const enabled = params.enabled;\n const maximumFileSize = params.maximumFileSize;\n const allowedFileExtensions = params.allowedFileExtensions;\n const compression = params.compression;\n const encryption = params.encryption;\n const antivirus = params.antivirus;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof name === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"name\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);\n const payload: Payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n if (typeof fileSecurity !== 'undefined') {\n payload['fileSecurity'] = fileSecurity;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n if (typeof maximumFileSize !== 'undefined') {\n payload['maximumFileSize'] = maximumFileSize;\n }\n if (typeof allowedFileExtensions !== 'undefined') {\n payload['allowedFileExtensions'] = allowedFileExtensions;\n }\n if (typeof compression !== 'undefined') {\n payload['compression'] = compression;\n }\n if (typeof encryption !== 'undefined') {\n payload['encryption'] = encryption;\n }\n if (typeof antivirus !== 'undefined') {\n payload['antivirus'] = antivirus;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Delete a storage bucket by its unique ID.\n *\n * @param {string} params.bucketId - Bucket unique ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n deleteBucket(params: { bucketId: string }): Promise<{}>;\n /**\n * Delete a storage bucket by its unique ID.\n *\n * @param {string} bucketId - Bucket unique ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n deleteBucket(bucketId: string): Promise<{}>;\n deleteBucket(\n paramsOrFirst: { bucketId: string } | string \n ): Promise<{}> {\n let params: { bucketId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string };\n } else {\n params = {\n bucketId: paramsOrFirst as string \n };\n }\n \n const bucketId = params.bucketId;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Get a list of all the user files. You can use the query params to filter your results.\n *\n * @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).\n * @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\n * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.\n * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.FileList>}\n */\n listFiles(params: { bucketId: string, queries?: string[], search?: string, total?: boolean }): Promise<Models.FileList>;\n /**\n * Get a list of all the user files. You can use the query params to filter your results.\n *\n * @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).\n * @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\n * @param {string} search - Search term to filter your list results. Max length: 256 chars.\n * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.FileList>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n listFiles(bucketId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.FileList>;\n listFiles(\n paramsOrFirst: { bucketId: string, queries?: string[], search?: string, total?: boolean } | string,\n ...rest: [(string[])?, (string)?, (boolean)?] \n ): Promise<Models.FileList> {\n let params: { bucketId: string, queries?: string[], search?: string, total?: boolean };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, queries?: string[], search?: string, total?: boolean };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n queries: rest[0] as string[],\n search: rest[1] as string,\n total: rest[2] as boolean \n };\n }\n \n const bucketId = params.bucketId;\n const queries = params.queries;\n const search = params.search;\n const total = params.total;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);\n const payload: Payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n if (typeof total !== 'undefined') {\n payload['total'] = total;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * 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.\n * \n * 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.\n * \n * 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.\n * \n * If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n * \n *\n * @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).\n * @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.\n * @param {File} 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).\n * @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).\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n createFile(params: { bucketId: string, fileId: string, file: File, permissions?: string[] , onProgress?: (progress: UploadProgress) => void }): Promise<Models.File>;\n /**\n * 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.\n * \n * 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.\n * \n * 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.\n * \n * If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n * \n *\n * @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).\n * @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.\n * @param {File} 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).\n * @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).\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void): Promise<Models.File>;\n createFile(\n paramsOrFirst: { bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void } | string,\n ...rest: [(string)?, (File)?, (string[])?,((progress: UploadProgress) => void)?] \n ): Promise<Models.File> {\n let params: { bucketId: string, fileId: string, file: File, permissions?: string[] };\n let onProgress: ((progress: UploadProgress) => void);\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, file: File, permissions?: string[] };\n onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => void);\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n fileId: rest[0] as string,\n file: rest[1] as File,\n permissions: rest[2] as string[] \n };\n onProgress = rest[3] as ((progress: UploadProgress) => void);\n }\n \n const bucketId = params.bucketId;\n const fileId = params.fileId;\n const file = params.file;\n const permissions = params.permissions;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"fileId\"');\n }\n if (typeof file === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"file\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);\n const payload: Payload = {};\n if (typeof fileId !== 'undefined') {\n payload['fileId'] = fileId;\n }\n if (typeof file !== 'undefined') {\n payload['file'] = file;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'multipart/form-data',\n }\n\n return this.client.chunkedUpload(\n 'post',\n uri,\n apiHeaders,\n payload,\n onProgress\n );\n }\n\n /**\n * Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.\n *\n * @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).\n * @param {string} params.fileId - File ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n getFile(params: { bucketId: string, fileId: string }): Promise<Models.File>;\n /**\n * Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.\n *\n * @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).\n * @param {string} fileId - File ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getFile(bucketId: string, fileId: string): Promise<Models.File>;\n getFile(\n paramsOrFirst: { bucketId: string, fileId: string } | string,\n ...rest: [(string)?] \n ): Promise<Models.File> {\n let params: { bucketId: string, fileId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, fileId: string };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n fileId: rest[0] as string \n };\n }\n \n const bucketId = params.bucketId;\n const fileId = params.fileId;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"fileId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Update a file by its unique ID. Only users with write permissions have access to update this resource.\n *\n * @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).\n * @param {string} params.fileId - File unique ID.\n * @param {string} params.name - Name of the file\n * @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).\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n updateFile(params: { bucketId: string, fileId: string, name?: string, permissions?: string[] }): Promise<Models.File>;\n /**\n * Update a file by its unique ID. Only users with write permissions have access to update this resource.\n *\n * @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).\n * @param {string} fileId - File unique ID.\n * @param {string} name - Name of the file\n * @param {string[]} permissions - An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File>;\n updateFile(\n paramsOrFirst: { bucketId: string, fileId: string, name?: string, permissions?: string[] } | string,\n ...rest: [(string)?, (string)?, (string[])?] \n ): Promise<Models.File> {\n let params: { bucketId: string, fileId: string, name?: string, permissions?: string[] };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, name?: string, permissions?: string[] };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n fileId: rest[0] as string,\n name: rest[1] as string,\n permissions: rest[2] as string[] \n };\n }\n \n const bucketId = params.bucketId;\n const fileId = params.fileId;\n const name = params.name;\n const permissions = params.permissions;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"fileId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload: Payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Delete a file by its unique ID. Only users with write permissions have access to delete this resource.\n *\n * @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).\n * @param {string} params.fileId - File ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n deleteFile(params: { bucketId: string, fileId: string }): Promise<{}>;\n /**\n * Delete a file by its unique ID. Only users with write permissions have access to delete this resource.\n *\n * @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).\n * @param {string} fileId - File ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n deleteFile(bucketId: string, fileId: string): Promise<{}>;\n deleteFile(\n paramsOrFirst: { bucketId: string, fileId: string } | string,\n ...rest: [(string)?] \n ): Promise<{}> {\n let params: { bucketId: string, fileId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, fileId: string };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n fileId: rest[0] as string \n };\n }\n \n const bucketId = params.bucketId;\n const fileId = params.fileId;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"fileId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * 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.\n *\n * @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).\n * @param {string} params.fileId - File ID.\n * @param {string} params.token - File token for accessing this file.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getFileDownload(params: { bucketId: string, fileId: string, token?: string }): Promise<ArrayBuffer>;\n /**\n * 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.\n *\n * @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).\n * @param {string} fileId - File ID.\n * @param {string} token - File token for accessing this file.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getFileDownload(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;\n getFileDownload(\n paramsOrFirst: { bucketId: string, fileId: string, token?: string } | string,\n ...rest: [(string)?, (string)?] \n ): Promise<ArrayBuffer> {\n let params: { bucketId: string, fileId: string, token?: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, token?: string };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n fileId: rest[0] as string,\n token: rest[1] as string \n };\n }\n \n const bucketId = params.bucketId;\n const fileId = params.fileId;\n const token = params.token;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"fileId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload: Payload = {};\n if (typeof token !== 'undefined') {\n payload['token'] = token;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * 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.\n *\n * @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).\n * @param {string} params.fileId - File ID\n * @param {number} params.width - Resize preview image width, Pass an integer between 0 to 4000.\n * @param {number} params.height - Resize preview image height, Pass an integer between 0 to 4000.\n * @param {ImageGravity} params.gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right\n * @param {number} params.quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @param {number} params.borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.\n * @param {string} params.borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix.\n * @param {number} params.borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000.\n * @param {number} params.opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.\n * @param {number} params.rotation - Preview image rotation in degrees. Pass an integer between -360 and 360.\n * @param {string} params.background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.\n * @param {ImageFormat} params.output - Output format type (jpeg, jpg, png, gif and webp).\n * @param {string} params.token - File token for accessing this file.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getFilePreview(params: { 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>;\n /**\n * 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.\n *\n * @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).\n * @param {string} fileId - File ID\n * @param {number} width - Resize preview image width, Pass an integer between 0 to 4000.\n * @param {number} height - Resize preview image height, Pass an integer between 0 to 4000.\n * @param {ImageGravity} gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right\n * @param {number} quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @param {number} borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.\n * @param {string} borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix.\n * @param {number} borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000.\n * @param {number} opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.\n * @param {number} rotation - Preview image rotation in degrees. Pass an integer between -360 and 360.\n * @param {string} background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.\n * @param {ImageFormat} output - Output format type (jpeg, jpg, png, gif and webp).\n * @param {string} token - File token for accessing this file.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n 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>;\n getFilePreview(\n paramsOrFirst: { 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 } | string,\n ...rest: [(string)?, (number)?, (number)?, (ImageGravity)?, (number)?, (number)?, (string)?, (number)?, (number)?, (number)?, (string)?, (ImageFormat)?, (string)?] \n ): Promise<ArrayBuffer> {\n let params: { 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 };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { 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 };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n fileId: rest[0] as string,\n width: rest[1] as number,\n height: rest[2] as number,\n gravity: rest[3] as ImageGravity,\n quality: rest[4] as number,\n borderWidth: rest[5] as number,\n borderColor: rest[6] as string,\n borderRadius: rest[7] as number,\n opacity: rest[8] as number,\n rotation: rest[9] as number,\n background: rest[10] as string,\n output: rest[11] as ImageFormat,\n token: rest[12] as string \n };\n }\n \n const bucketId = params.bucketId;\n const fileId = params.fileId;\n const width = params.width;\n const height = params.height;\n const gravity = params.gravity;\n const quality = params.quality;\n const borderWidth = params.borderWidth;\n const borderColor = params.borderColor;\n const borderRadius = params.borderRadius;\n const opacity = params.opacity;\n const rotation = params.rotation;\n const background = params.background;\n const output = params.output;\n const token = params.token;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"fileId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload: Payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof gravity !== 'undefined') {\n payload['gravity'] = gravity;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n if (typeof borderWidth !== 'undefined') {\n payload['borderWidth'] = borderWidth;\n }\n if (typeof borderColor !== 'undefined') {\n payload['borderColor'] = borderColor;\n }\n if (typeof borderRadius !== 'undefined') {\n payload['borderRadius'] = borderRadius;\n }\n if (typeof opacity !== 'undefined') {\n payload['opacity'] = opacity;\n }\n if (typeof rotation !== 'undefined') {\n payload['rotation'] = rotation;\n }\n if (typeof background !== 'undefined') {\n payload['background'] = background;\n }\n if (typeof output !== 'undefined') {\n payload['output'] = output;\n }\n if (typeof token !== 'undefined') {\n payload['token'] = token;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.\n *\n * @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).\n * @param {string} params.fileId - File ID.\n * @param {string} params.token - File token for accessing this file.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getFileView(params: { bucketId: string, fileId: string, token?: string }): Promise<ArrayBuffer>;\n /**\n * Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.\n *\n * @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).\n * @param {string} fileId - File ID.\n * @param {string} token - File token for accessing this file.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getFileView(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;\n getFileView(\n paramsOrFirst: { bucketId: string, fileId: string, token?: string } | string,\n ...rest: [(string)?, (string)?] \n ): Promise<ArrayBuffer> {\n let params: { bucketId: string, fileId: string, token?: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, token?: string };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n fileId: rest[0] as string,\n token: rest[1] as string \n };\n }\n \n const bucketId = params.bucketId;\n const fileId = params.fileId;\n const token = params.token;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"fileId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload: Payload = {};\n if (typeof token !== 'undefined') {\n payload['token'] = token;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/services/storage.ts"],"names":[],"mappings":";AAAA,SAAS,yBAA+D;AAOjE,IAAM,UAAN,MAAc;AAAA,EAGjB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA,EAuBA,YACI,kBACG,MACuB;AAC1B,QAAI;AAEJ,QAAI,CAAC,iBAAkB,iBAAiB,OAAO,kBAAkB,YAAY,CAAC,MAAM,QAAQ,aAAa,GAAI;AACzG,eAAU,iBAAiB,CAAC;AAAA,IAChC,OAAO;AACH,eAAS;AAAA,QACL,SAAS;AAAA,QACT,QAAQ,KAAK,CAAC;AAAA,QACd,OAAO,KAAK,CAAC;AAAA,MAC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AAM,IAAI,kBAAkB,wCAAwC;AAAA,IACxE;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,YAAM,IAAI,kBAAkB,sCAAsC;AAAA,IACtE;AAEA,UAAM,UAAU,kDAAkD,QAAQ,cAAc,QAAQ,EAAE,QAAQ,YAAY,MAAM;AAC5H,UAAM,UAAmB,CAAC;AAC1B,QAAI,OAAO,UAAU,aAAa;AAC9B,cAAQ,OAAO,IAAI;AAAA,IACvB;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C,CACjD;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AACJ","sourcesContent":["import { AppwriteException, Client, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\n\nimport { Compression } from '../enums/compression';\nimport { ImageGravity } from '../enums/image-gravity';\nimport { ImageFormat } from '../enums/image-format';\n\nexport class Storage {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * Get a list of all the storage buckets. You can use the query params to filter your results.\n *\n * @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: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations\n * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.\n * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.BucketList>}\n */\n listBuckets(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.BucketList>;\n /**\n * Get a list of all the storage buckets. You can use the query params to filter your results.\n *\n * @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: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations\n * @param {string} search - Search term to filter your list results. Max length: 256 chars.\n * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.BucketList>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n listBuckets(queries?: string[], search?: string, total?: boolean): Promise<Models.BucketList>;\n listBuckets(\n paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],\n ...rest: [(string)?, (boolean)?] \n ): Promise<Models.BucketList> {\n let params: { queries?: string[], search?: string, total?: boolean };\n \n if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };\n } else {\n params = {\n queries: paramsOrFirst as string[],\n search: rest[0] as string,\n total: rest[1] as boolean \n };\n }\n \n const queries = params.queries;\n const search = params.search;\n const total = params.total;\n\n\n const apiPath = '/storage/buckets';\n const payload: Payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n if (typeof total !== 'undefined') {\n payload['total'] = total;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Create a new storage bucket.\n *\n * @param {string} params.bucketId - Unique 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.\n * @param {string} params.name - Bucket name\n * @param {string[]} params.permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.\n * @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.\n * @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.\n * @param {Compression} params.compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled\n * @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled\n * @param {boolean} params.antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled\n * @param {boolean} params.transformations - Are image transformations enabled?\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n createBucket(params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }): Promise<Models.Bucket>;\n /**\n * Create a new storage bucket.\n *\n * @param {string} bucketId - Unique 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.\n * @param {string} name - Bucket name\n * @param {string[]} permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.\n * @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.\n * @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.\n * @param {Compression} compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled\n * @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled\n * @param {boolean} antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled\n * @param {boolean} transformations - Are image transformations enabled?\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean): Promise<Models.Bucket>;\n createBucket(\n paramsOrFirst: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean } | string,\n ...rest: [(string)?, (string[])?, (boolean)?, (boolean)?, (number)?, (string[])?, (Compression)?, (boolean)?, (boolean)?, (boolean)?] \n ): Promise<Models.Bucket> {\n let params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n name: rest[0] as string,\n permissions: rest[1] as string[],\n fileSecurity: rest[2] as boolean,\n enabled: rest[3] as boolean,\n maximumFileSize: rest[4] as number,\n allowedFileExtensions: rest[5] as string[],\n compression: rest[6] as Compression,\n encryption: rest[7] as boolean,\n antivirus: rest[8] as boolean,\n transformations: rest[9] as boolean \n };\n }\n \n const bucketId = params.bucketId;\n const name = params.name;\n const permissions = params.permissions;\n const fileSecurity = params.fileSecurity;\n const enabled = params.enabled;\n const maximumFileSize = params.maximumFileSize;\n const allowedFileExtensions = params.allowedFileExtensions;\n const compression = params.compression;\n const encryption = params.encryption;\n const antivirus = params.antivirus;\n const transformations = params.transformations;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof name === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"name\"');\n }\n\n const apiPath = '/storage/buckets';\n const payload: Payload = {};\n if (typeof bucketId !== 'undefined') {\n payload['bucketId'] = bucketId;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n if (typeof fileSecurity !== 'undefined') {\n payload['fileSecurity'] = fileSecurity;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n if (typeof maximumFileSize !== 'undefined') {\n payload['maximumFileSize'] = maximumFileSize;\n }\n if (typeof allowedFileExtensions !== 'undefined') {\n payload['allowedFileExtensions'] = allowedFileExtensions;\n }\n if (typeof compression !== 'undefined') {\n payload['compression'] = compression;\n }\n if (typeof encryption !== 'undefined') {\n payload['encryption'] = encryption;\n }\n if (typeof antivirus !== 'undefined') {\n payload['antivirus'] = antivirus;\n }\n if (typeof transformations !== 'undefined') {\n payload['transformations'] = transformations;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'post',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.\n *\n * @param {string} params.bucketId - Bucket unique ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n getBucket(params: { bucketId: string }): Promise<Models.Bucket>;\n /**\n * Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.\n *\n * @param {string} bucketId - Bucket unique ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getBucket(bucketId: string): Promise<Models.Bucket>;\n getBucket(\n paramsOrFirst: { bucketId: string } | string \n ): Promise<Models.Bucket> {\n let params: { bucketId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string };\n } else {\n params = {\n bucketId: paramsOrFirst as string \n };\n }\n \n const bucketId = params.bucketId;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Update a storage bucket by its unique ID.\n *\n * @param {string} params.bucketId - Bucket unique ID.\n * @param {string} params.name - Bucket name\n * @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).\n * @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.\n * @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.\n * @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.\n * @param {Compression} params.compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled\n * @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled\n * @param {boolean} params.antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled\n * @param {boolean} params.transformations - Are image transformations enabled?\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n updateBucket(params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }): Promise<Models.Bucket>;\n /**\n * Update a storage bucket by its unique ID.\n *\n * @param {string} bucketId - Bucket unique ID.\n * @param {string} name - Bucket name\n * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.\n * @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.\n * @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.\n * @param {Compression} compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled\n * @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled\n * @param {boolean} antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled\n * @param {boolean} transformations - Are image transformations enabled?\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean): Promise<Models.Bucket>;\n updateBucket(\n paramsOrFirst: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean } | string,\n ...rest: [(string)?, (string[])?, (boolean)?, (boolean)?, (number)?, (string[])?, (Compression)?, (boolean)?, (boolean)?, (boolean)?] \n ): Promise<Models.Bucket> {\n let params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n name: rest[0] as string,\n permissions: rest[1] as string[],\n fileSecurity: rest[2] as boolean,\n enabled: rest[3] as boolean,\n maximumFileSize: rest[4] as number,\n allowedFileExtensions: rest[5] as string[],\n compression: rest[6] as Compression,\n encryption: rest[7] as boolean,\n antivirus: rest[8] as boolean,\n transformations: rest[9] as boolean \n };\n }\n \n const bucketId = params.bucketId;\n const name = params.name;\n const permissions = params.permissions;\n const fileSecurity = params.fileSecurity;\n const enabled = params.enabled;\n const maximumFileSize = params.maximumFileSize;\n const allowedFileExtensions = params.allowedFileExtensions;\n const compression = params.compression;\n const encryption = params.encryption;\n const antivirus = params.antivirus;\n const transformations = params.transformations;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof name === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"name\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);\n const payload: Payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n if (typeof fileSecurity !== 'undefined') {\n payload['fileSecurity'] = fileSecurity;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n if (typeof maximumFileSize !== 'undefined') {\n payload['maximumFileSize'] = maximumFileSize;\n }\n if (typeof allowedFileExtensions !== 'undefined') {\n payload['allowedFileExtensions'] = allowedFileExtensions;\n }\n if (typeof compression !== 'undefined') {\n payload['compression'] = compression;\n }\n if (typeof encryption !== 'undefined') {\n payload['encryption'] = encryption;\n }\n if (typeof antivirus !== 'undefined') {\n payload['antivirus'] = antivirus;\n }\n if (typeof transformations !== 'undefined') {\n payload['transformations'] = transformations;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Delete a storage bucket by its unique ID.\n *\n * @param {string} params.bucketId - Bucket unique ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n deleteBucket(params: { bucketId: string }): Promise<{}>;\n /**\n * Delete a storage bucket by its unique ID.\n *\n * @param {string} bucketId - Bucket unique ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n deleteBucket(bucketId: string): Promise<{}>;\n deleteBucket(\n paramsOrFirst: { bucketId: string } | string \n ): Promise<{}> {\n let params: { bucketId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string };\n } else {\n params = {\n bucketId: paramsOrFirst as string \n };\n }\n \n const bucketId = params.bucketId;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Get a list of all the user files. You can use the query params to filter your results.\n *\n * @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).\n * @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\n * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.\n * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.FileList>}\n */\n listFiles(params: { bucketId: string, queries?: string[], search?: string, total?: boolean }): Promise<Models.FileList>;\n /**\n * Get a list of all the user files. You can use the query params to filter your results.\n *\n * @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).\n * @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\n * @param {string} search - Search term to filter your list results. Max length: 256 chars.\n * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.FileList>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n listFiles(bucketId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.FileList>;\n listFiles(\n paramsOrFirst: { bucketId: string, queries?: string[], search?: string, total?: boolean } | string,\n ...rest: [(string[])?, (string)?, (boolean)?] \n ): Promise<Models.FileList> {\n let params: { bucketId: string, queries?: string[], search?: string, total?: boolean };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, queries?: string[], search?: string, total?: boolean };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n queries: rest[0] as string[],\n search: rest[1] as string,\n total: rest[2] as boolean \n };\n }\n \n const bucketId = params.bucketId;\n const queries = params.queries;\n const search = params.search;\n const total = params.total;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);\n const payload: Payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n if (typeof total !== 'undefined') {\n payload['total'] = total;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * 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.\n * \n * 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.\n * \n * 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.\n * \n * If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n * \n *\n * @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).\n * @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.\n * @param {File} 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).\n * @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).\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n createFile(params: { bucketId: string, fileId: string, file: File, permissions?: string[] , onProgress?: (progress: UploadProgress) => void }): Promise<Models.File>;\n /**\n * 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.\n * \n * 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.\n * \n * 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.\n * \n * If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n * \n *\n * @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).\n * @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.\n * @param {File} 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).\n * @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).\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void): Promise<Models.File>;\n createFile(\n paramsOrFirst: { bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void } | string,\n ...rest: [(string)?, (File)?, (string[])?,((progress: UploadProgress) => void)?] \n ): Promise<Models.File> {\n let params: { bucketId: string, fileId: string, file: File, permissions?: string[] };\n let onProgress: ((progress: UploadProgress) => void);\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, file: File, permissions?: string[] };\n onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => void);\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n fileId: rest[0] as string,\n file: rest[1] as File,\n permissions: rest[2] as string[] \n };\n onProgress = rest[3] as ((progress: UploadProgress) => void);\n }\n \n const bucketId = params.bucketId;\n const fileId = params.fileId;\n const file = params.file;\n const permissions = params.permissions;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"fileId\"');\n }\n if (typeof file === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"file\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);\n const payload: Payload = {};\n if (typeof fileId !== 'undefined') {\n payload['fileId'] = fileId;\n }\n if (typeof file !== 'undefined') {\n payload['file'] = file;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'multipart/form-data',\n }\n\n return this.client.chunkedUpload(\n 'post',\n uri,\n apiHeaders,\n payload,\n onProgress\n );\n }\n\n /**\n * Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.\n *\n * @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).\n * @param {string} params.fileId - File ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n getFile(params: { bucketId: string, fileId: string }): Promise<Models.File>;\n /**\n * Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.\n *\n * @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).\n * @param {string} fileId - File ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getFile(bucketId: string, fileId: string): Promise<Models.File>;\n getFile(\n paramsOrFirst: { bucketId: string, fileId: string } | string,\n ...rest: [(string)?] \n ): Promise<Models.File> {\n let params: { bucketId: string, fileId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, fileId: string };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n fileId: rest[0] as string \n };\n }\n \n const bucketId = params.bucketId;\n const fileId = params.fileId;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"fileId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Update a file by its unique ID. Only users with write permissions have access to update this resource.\n *\n * @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).\n * @param {string} params.fileId - File unique ID.\n * @param {string} params.name - Name of the file\n * @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).\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n updateFile(params: { bucketId: string, fileId: string, name?: string, permissions?: string[] }): Promise<Models.File>;\n /**\n * Update a file by its unique ID. Only users with write permissions have access to update this resource.\n *\n * @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).\n * @param {string} fileId - File unique ID.\n * @param {string} name - Name of the file\n * @param {string[]} permissions - An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File>;\n updateFile(\n paramsOrFirst: { bucketId: string, fileId: string, name?: string, permissions?: string[] } | string,\n ...rest: [(string)?, (string)?, (string[])?] \n ): Promise<Models.File> {\n let params: { bucketId: string, fileId: string, name?: string, permissions?: string[] };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, name?: string, permissions?: string[] };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n fileId: rest[0] as string,\n name: rest[1] as string,\n permissions: rest[2] as string[] \n };\n }\n \n const bucketId = params.bucketId;\n const fileId = params.fileId;\n const name = params.name;\n const permissions = params.permissions;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"fileId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload: Payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Delete a file by its unique ID. Only users with write permissions have access to delete this resource.\n *\n * @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).\n * @param {string} params.fileId - File ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n deleteFile(params: { bucketId: string, fileId: string }): Promise<{}>;\n /**\n * Delete a file by its unique ID. Only users with write permissions have access to delete this resource.\n *\n * @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).\n * @param {string} fileId - File ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n deleteFile(bucketId: string, fileId: string): Promise<{}>;\n deleteFile(\n paramsOrFirst: { bucketId: string, fileId: string } | string,\n ...rest: [(string)?] \n ): Promise<{}> {\n let params: { bucketId: string, fileId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, fileId: string };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n fileId: rest[0] as string \n };\n }\n \n const bucketId = params.bucketId;\n const fileId = params.fileId;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"fileId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * 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.\n *\n * @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).\n * @param {string} params.fileId - File ID.\n * @param {string} params.token - File token for accessing this file.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getFileDownload(params: { bucketId: string, fileId: string, token?: string }): Promise<ArrayBuffer>;\n /**\n * 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.\n *\n * @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).\n * @param {string} fileId - File ID.\n * @param {string} token - File token for accessing this file.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getFileDownload(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;\n getFileDownload(\n paramsOrFirst: { bucketId: string, fileId: string, token?: string } | string,\n ...rest: [(string)?, (string)?] \n ): Promise<ArrayBuffer> {\n let params: { bucketId: string, fileId: string, token?: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, token?: string };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n fileId: rest[0] as string,\n token: rest[1] as string \n };\n }\n \n const bucketId = params.bucketId;\n const fileId = params.fileId;\n const token = params.token;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"fileId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload: Payload = {};\n if (typeof token !== 'undefined') {\n payload['token'] = token;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * 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.\n *\n * @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).\n * @param {string} params.fileId - File ID\n * @param {number} params.width - Resize preview image width, Pass an integer between 0 to 4000.\n * @param {number} params.height - Resize preview image height, Pass an integer between 0 to 4000.\n * @param {ImageGravity} params.gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right\n * @param {number} params.quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @param {number} params.borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.\n * @param {string} params.borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix.\n * @param {number} params.borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000.\n * @param {number} params.opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.\n * @param {number} params.rotation - Preview image rotation in degrees. Pass an integer between -360 and 360.\n * @param {string} params.background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.\n * @param {ImageFormat} params.output - Output format type (jpeg, jpg, png, gif and webp).\n * @param {string} params.token - File token for accessing this file.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getFilePreview(params: { 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>;\n /**\n * 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.\n *\n * @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).\n * @param {string} fileId - File ID\n * @param {number} width - Resize preview image width, Pass an integer between 0 to 4000.\n * @param {number} height - Resize preview image height, Pass an integer between 0 to 4000.\n * @param {ImageGravity} gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right\n * @param {number} quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.\n * @param {number} borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.\n * @param {string} borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix.\n * @param {number} borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000.\n * @param {number} opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.\n * @param {number} rotation - Preview image rotation in degrees. Pass an integer between -360 and 360.\n * @param {string} background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.\n * @param {ImageFormat} output - Output format type (jpeg, jpg, png, gif and webp).\n * @param {string} token - File token for accessing this file.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n 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>;\n getFilePreview(\n paramsOrFirst: { 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 } | string,\n ...rest: [(string)?, (number)?, (number)?, (ImageGravity)?, (number)?, (number)?, (string)?, (number)?, (number)?, (number)?, (string)?, (ImageFormat)?, (string)?] \n ): Promise<ArrayBuffer> {\n let params: { 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 };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { 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 };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n fileId: rest[0] as string,\n width: rest[1] as number,\n height: rest[2] as number,\n gravity: rest[3] as ImageGravity,\n quality: rest[4] as number,\n borderWidth: rest[5] as number,\n borderColor: rest[6] as string,\n borderRadius: rest[7] as number,\n opacity: rest[8] as number,\n rotation: rest[9] as number,\n background: rest[10] as string,\n output: rest[11] as ImageFormat,\n token: rest[12] as string \n };\n }\n \n const bucketId = params.bucketId;\n const fileId = params.fileId;\n const width = params.width;\n const height = params.height;\n const gravity = params.gravity;\n const quality = params.quality;\n const borderWidth = params.borderWidth;\n const borderColor = params.borderColor;\n const borderRadius = params.borderRadius;\n const opacity = params.opacity;\n const rotation = params.rotation;\n const background = params.background;\n const output = params.output;\n const token = params.token;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"fileId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload: Payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof gravity !== 'undefined') {\n payload['gravity'] = gravity;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n if (typeof borderWidth !== 'undefined') {\n payload['borderWidth'] = borderWidth;\n }\n if (typeof borderColor !== 'undefined') {\n payload['borderColor'] = borderColor;\n }\n if (typeof borderRadius !== 'undefined') {\n payload['borderRadius'] = borderRadius;\n }\n if (typeof opacity !== 'undefined') {\n payload['opacity'] = opacity;\n }\n if (typeof rotation !== 'undefined') {\n payload['rotation'] = rotation;\n }\n if (typeof background !== 'undefined') {\n payload['background'] = background;\n }\n if (typeof output !== 'undefined') {\n payload['output'] = output;\n }\n if (typeof token !== 'undefined') {\n payload['token'] = token;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n\n /**\n * Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.\n *\n * @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).\n * @param {string} params.fileId - File ID.\n * @param {string} params.token - File token for accessing this file.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n getFileView(params: { bucketId: string, fileId: string, token?: string }): Promise<ArrayBuffer>;\n /**\n * Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.\n *\n * @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).\n * @param {string} fileId - File ID.\n * @param {string} token - File token for accessing this file.\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getFileView(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;\n getFileView(\n paramsOrFirst: { bucketId: string, fileId: string, token?: string } | string,\n ...rest: [(string)?, (string)?] \n ): Promise<ArrayBuffer> {\n let params: { bucketId: string, fileId: string, token?: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, token?: string };\n } else {\n params = {\n bucketId: paramsOrFirst as string,\n fileId: rest[0] as string,\n token: rest[1] as string \n };\n }\n \n const bucketId = params.bucketId;\n const fileId = params.fileId;\n const token = params.token;\n\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"fileId\"');\n }\n\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload: Payload = {};\n if (typeof token !== 'undefined') {\n payload['token'] = token;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n}\n"]}
|
|
@@ -293,6 +293,8 @@ declare class TablesDB {
|
|
|
293
293
|
* @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
294
294
|
* @param {boolean} params.rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
295
295
|
* @param {boolean} params.enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
296
|
+
* @param {object[]} params.columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
|
|
297
|
+
* @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
|
|
296
298
|
* @throws {AppwriteException}
|
|
297
299
|
* @returns {Promise<Models.Table>}
|
|
298
300
|
*/
|
|
@@ -303,6 +305,8 @@ declare class TablesDB {
|
|
|
303
305
|
permissions?: string[];
|
|
304
306
|
rowSecurity?: boolean;
|
|
305
307
|
enabled?: boolean;
|
|
308
|
+
columns?: object[];
|
|
309
|
+
indexes?: object[];
|
|
306
310
|
}): Promise<Models.Table>;
|
|
307
311
|
/**
|
|
308
312
|
* Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.
|
|
@@ -313,11 +317,13 @@ declare class TablesDB {
|
|
|
313
317
|
* @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
314
318
|
* @param {boolean} rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
315
319
|
* @param {boolean} enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
320
|
+
* @param {object[]} columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
|
|
321
|
+
* @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
|
|
316
322
|
* @throws {AppwriteException}
|
|
317
323
|
* @returns {Promise<Models.Table>}
|
|
318
324
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
319
325
|
*/
|
|
320
|
-
createTable(databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean): Promise<Models.Table>;
|
|
326
|
+
createTable(databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, columns?: object[], indexes?: object[]): Promise<Models.Table>;
|
|
321
327
|
/**
|
|
322
328
|
* Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.
|
|
323
329
|
*
|
|
@@ -347,7 +353,7 @@ declare class TablesDB {
|
|
|
347
353
|
* @param {string} params.tableId - Table ID.
|
|
348
354
|
* @param {string} params.name - Table name. Max length: 128 chars.
|
|
349
355
|
* @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).
|
|
350
|
-
* @param {boolean} params.rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table
|
|
356
|
+
* @param {boolean} params.rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
351
357
|
* @param {boolean} params.enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
352
358
|
* @throws {AppwriteException}
|
|
353
359
|
* @returns {Promise<Models.Table>}
|
|
@@ -367,7 +373,7 @@ declare class TablesDB {
|
|
|
367
373
|
* @param {string} tableId - Table ID.
|
|
368
374
|
* @param {string} name - Table name. Max length: 128 chars.
|
|
369
375
|
* @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
370
|
-
* @param {boolean} rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table
|
|
376
|
+
* @param {boolean} rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
371
377
|
* @param {boolean} enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
372
378
|
* @throws {AppwriteException}
|
|
373
379
|
* @returns {Promise<Models.Table>}
|
|
@@ -293,6 +293,8 @@ declare class TablesDB {
|
|
|
293
293
|
* @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
294
294
|
* @param {boolean} params.rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
295
295
|
* @param {boolean} params.enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
296
|
+
* @param {object[]} params.columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
|
|
297
|
+
* @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
|
|
296
298
|
* @throws {AppwriteException}
|
|
297
299
|
* @returns {Promise<Models.Table>}
|
|
298
300
|
*/
|
|
@@ -303,6 +305,8 @@ declare class TablesDB {
|
|
|
303
305
|
permissions?: string[];
|
|
304
306
|
rowSecurity?: boolean;
|
|
305
307
|
enabled?: boolean;
|
|
308
|
+
columns?: object[];
|
|
309
|
+
indexes?: object[];
|
|
306
310
|
}): Promise<Models.Table>;
|
|
307
311
|
/**
|
|
308
312
|
* Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.
|
|
@@ -313,11 +317,13 @@ declare class TablesDB {
|
|
|
313
317
|
* @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
314
318
|
* @param {boolean} rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
315
319
|
* @param {boolean} enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
320
|
+
* @param {object[]} columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
|
|
321
|
+
* @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
|
|
316
322
|
* @throws {AppwriteException}
|
|
317
323
|
* @returns {Promise<Models.Table>}
|
|
318
324
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
319
325
|
*/
|
|
320
|
-
createTable(databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean): Promise<Models.Table>;
|
|
326
|
+
createTable(databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, columns?: object[], indexes?: object[]): Promise<Models.Table>;
|
|
321
327
|
/**
|
|
322
328
|
* Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.
|
|
323
329
|
*
|
|
@@ -347,7 +353,7 @@ declare class TablesDB {
|
|
|
347
353
|
* @param {string} params.tableId - Table ID.
|
|
348
354
|
* @param {string} params.name - Table name. Max length: 128 chars.
|
|
349
355
|
* @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).
|
|
350
|
-
* @param {boolean} params.rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table
|
|
356
|
+
* @param {boolean} params.rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
351
357
|
* @param {boolean} params.enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
352
358
|
* @throws {AppwriteException}
|
|
353
359
|
* @returns {Promise<Models.Table>}
|
|
@@ -367,7 +373,7 @@ declare class TablesDB {
|
|
|
367
373
|
* @param {string} tableId - Table ID.
|
|
368
374
|
* @param {string} name - Table name. Max length: 128 chars.
|
|
369
375
|
* @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
370
|
-
* @param {boolean} rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table
|
|
376
|
+
* @param {boolean} rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
371
377
|
* @param {boolean} enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
372
378
|
* @throws {AppwriteException}
|
|
373
379
|
* @returns {Promise<Models.Table>}
|
|
@@ -388,7 +388,9 @@ class TablesDB {
|
|
|
388
388
|
name: rest[1],
|
|
389
389
|
permissions: rest[2],
|
|
390
390
|
rowSecurity: rest[3],
|
|
391
|
-
enabled: rest[4]
|
|
391
|
+
enabled: rest[4],
|
|
392
|
+
columns: rest[5],
|
|
393
|
+
indexes: rest[6]
|
|
392
394
|
};
|
|
393
395
|
}
|
|
394
396
|
const databaseId = params.databaseId;
|
|
@@ -397,6 +399,8 @@ class TablesDB {
|
|
|
397
399
|
const permissions = params.permissions;
|
|
398
400
|
const rowSecurity = params.rowSecurity;
|
|
399
401
|
const enabled = params.enabled;
|
|
402
|
+
const columns = params.columns;
|
|
403
|
+
const indexes = params.indexes;
|
|
400
404
|
if (typeof databaseId === "undefined") {
|
|
401
405
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
402
406
|
}
|
|
@@ -423,6 +427,12 @@ class TablesDB {
|
|
|
423
427
|
if (typeof enabled !== "undefined") {
|
|
424
428
|
payload["enabled"] = enabled;
|
|
425
429
|
}
|
|
430
|
+
if (typeof columns !== "undefined") {
|
|
431
|
+
payload["columns"] = columns;
|
|
432
|
+
}
|
|
433
|
+
if (typeof indexes !== "undefined") {
|
|
434
|
+
payload["indexes"] = indexes;
|
|
435
|
+
}
|
|
426
436
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
427
437
|
const apiHeaders = {
|
|
428
438
|
"content-type": "application/json"
|