node-appwrite 14.0.0 → 14.2.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.
Files changed (76) hide show
  1. package/README.md +1 -1
  2. package/dist/client.d.mts +1 -0
  3. package/dist/client.d.ts +1 -0
  4. package/dist/client.js +5 -2
  5. package/dist/client.js.map +1 -1
  6. package/dist/client.mjs +5 -2
  7. package/dist/client.mjs.map +1 -1
  8. package/dist/enums/image-format.d.mts +2 -1
  9. package/dist/enums/image-format.d.ts +2 -1
  10. package/dist/enums/image-format.js +1 -0
  11. package/dist/enums/image-format.js.map +1 -1
  12. package/dist/enums/image-format.mjs +1 -0
  13. package/dist/enums/image-format.mjs.map +1 -1
  14. package/dist/enums/message-priority.d.mts +6 -0
  15. package/dist/enums/message-priority.d.ts +6 -0
  16. package/dist/enums/message-priority.js +11 -0
  17. package/dist/enums/message-priority.js.map +1 -0
  18. package/dist/enums/message-priority.mjs +10 -0
  19. package/dist/enums/message-priority.mjs.map +1 -0
  20. package/dist/enums/runtime.d.mts +15 -2
  21. package/dist/enums/runtime.d.ts +15 -2
  22. package/dist/enums/runtime.js +14 -1
  23. package/dist/enums/runtime.js.map +1 -1
  24. package/dist/enums/runtime.mjs +14 -1
  25. package/dist/enums/runtime.mjs.map +1 -1
  26. package/dist/index.d.mts +1 -0
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.js +5 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/index.mjs +1 -0
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/models.d.mts +96 -4
  33. package/dist/models.d.ts +96 -4
  34. package/dist/services/account.d.mts +11 -11
  35. package/dist/services/account.d.ts +11 -11
  36. package/dist/services/account.js +11 -11
  37. package/dist/services/account.js.map +1 -1
  38. package/dist/services/account.mjs +11 -11
  39. package/dist/services/account.mjs.map +1 -1
  40. package/dist/services/databases.d.mts +21 -10
  41. package/dist/services/databases.d.ts +21 -10
  42. package/dist/services/databases.js +54 -10
  43. package/dist/services/databases.js.map +1 -1
  44. package/dist/services/databases.mjs +54 -10
  45. package/dist/services/databases.mjs.map +1 -1
  46. package/dist/services/locale.d.mts +1 -1
  47. package/dist/services/locale.d.ts +1 -1
  48. package/dist/services/locale.js +1 -1
  49. package/dist/services/locale.js.map +1 -1
  50. package/dist/services/locale.mjs +1 -1
  51. package/dist/services/locale.mjs.map +1 -1
  52. package/dist/services/messaging.d.mts +10 -3
  53. package/dist/services/messaging.d.ts +10 -3
  54. package/dist/services/messaging.js +27 -9
  55. package/dist/services/messaging.js.map +1 -1
  56. package/dist/services/messaging.mjs +27 -9
  57. package/dist/services/messaging.mjs.map +1 -1
  58. package/dist/services/storage.d.mts +1 -1
  59. package/dist/services/storage.d.ts +1 -1
  60. package/dist/services/storage.js +1 -1
  61. package/dist/services/storage.js.map +1 -1
  62. package/dist/services/storage.mjs +1 -1
  63. package/dist/services/storage.mjs.map +1 -1
  64. package/dist/services/teams.d.mts +2 -2
  65. package/dist/services/teams.d.ts +2 -2
  66. package/dist/services/teams.js +2 -2
  67. package/dist/services/teams.js.map +1 -1
  68. package/dist/services/teams.mjs +2 -2
  69. package/dist/services/teams.mjs.map +1 -1
  70. package/dist/services/users.d.mts +10 -10
  71. package/dist/services/users.d.ts +10 -10
  72. package/dist/services/users.js +10 -10
  73. package/dist/services/users.js.map +1 -1
  74. package/dist/services/users.mjs +10 -10
  75. package/dist/services/users.mjs.map +1 -1
  76. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/services/storage.ts"],"names":[],"mappings":"AAAA,SAAS,yBAA+D;AAMjE,MAAM,QAAQ;AAAA,EAGjB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,YAAY,SAAoB,QAA6C;AAC/E,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,QAAI,OAAO,YAAY,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, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\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 * List buckets\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\n * @param {string} search\n * @throws {AppwriteException}\n * @returns {Promise<Models.BucketList>}\n */\n async listBuckets(queries?: string[], search?: string): Promise<Models.BucketList> {\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Create bucket\n *\n * Create a new storage bucket.\n *\n * @param {string} bucketId\n * @param {string} name\n * @param {string[]} permissions\n * @param {boolean} fileSecurity\n * @param {boolean} enabled\n * @param {number} maximumFileSize\n * @param {string[]} allowedFileExtensions\n * @param {Compression} compression\n * @param {boolean} encryption\n * @param {boolean} antivirus\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n async 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 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 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 await this.client.call(\n 'post',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get 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\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n async getBucket(bucketId: string): Promise<Models.Bucket> {\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update bucket\n *\n * Update a storage bucket by its unique ID.\n *\n * @param {string} bucketId\n * @param {string} name\n * @param {string[]} permissions\n * @param {boolean} fileSecurity\n * @param {boolean} enabled\n * @param {number} maximumFileSize\n * @param {string[]} allowedFileExtensions\n * @param {Compression} compression\n * @param {boolean} encryption\n * @param {boolean} antivirus\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n async 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 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 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 await this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Delete bucket\n *\n * Delete a storage bucket by its unique ID.\n *\n * @param {string} bucketId\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n async deleteBucket(bucketId: string): Promise<{}> {\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\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 await this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List files\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\n * @param {string[]} queries\n * @param {string} search\n * @throws {AppwriteException}\n * @returns {Promise<Models.FileList>}\n */\n async listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList> {\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Create 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\nLarger 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\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file&#039;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\nIf you&#039;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\n * @param {string} fileId\n * @param {File} file\n * @param {string[]} permissions\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n async createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress = (progress: UploadProgress) => {}): Promise<Models.File> {\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 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 await this.client.chunkedUpload(\n 'post',\n uri,\n apiHeaders,\n payload,\n onProgress\n );\n }\n /**\n * Get 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\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n async getFile(bucketId: string, fileId: string): Promise<Models.File> {\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update 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\n * @param {string} fileId\n * @param {string} name\n * @param {string[]} permissions\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n async updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File> {\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 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 await this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Delete File\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\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n async deleteFile(bucketId: string, fileId: string): Promise<{}> {\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 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 await this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get file for download\n *\n * Get a file content by its unique ID. The endpoint response return with a &#039;Content-Disposition: attachment&#039; header that tells the browser to start downloading the file to user downloads directory.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n async getFileDownload(bucketId: string, fileId: string): Promise<ArrayBuffer> {\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 const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n /**\n * Get file preview\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\n * @param {string} fileId\n * @param {number} width\n * @param {number} height\n * @param {ImageGravity} gravity\n * @param {number} quality\n * @param {number} borderWidth\n * @param {string} borderColor\n * @param {number} borderRadius\n * @param {number} opacity\n * @param {number} rotation\n * @param {string} background\n * @param {ImageFormat} output\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n async 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): Promise<ArrayBuffer> {\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 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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n /**\n * Get file for view\n *\n * Get a file content by its unique ID. This endpoint is similar to the download method but returns with no &#039;Content-Disposition: attachment&#039; header.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n async getFileView(bucketId: string, fileId: string): Promise<ArrayBuffer> {\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 const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.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 await 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;AAMjE,MAAM,QAAQ;AAAA,EAGjB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,YAAY,SAAoB,QAA6C;AAC/E,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,QAAI,OAAO,YAAY,aAAa;AAChC,cAAQ,SAAS,IAAI;AAAA,IACzB;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,cAAQ,QAAQ,IAAI;AAAA,IACxB;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,O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AAO,YAAY,aAAa;AAChC,cAAQ,SAAS,IAAI;AAAA,IACzB;AACA,QAAI,OAAO,aAAa,aAAa;AACjC,cAAQ,UAAU,IAAI;AAAA,IAC1B;AACA,QAAI,OAAO,eAAe,aAAa;AACnC,cAAQ,YAAY,IAAI;AAAA,IAC5B;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,cAAQ,QAAQ,IAAI;AAAA,IACxB;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,MAAM,KAAK,OAAO;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,YAAY,UAAkB,QAAsC;AACtE,QAAI,OAAO,aAAa,aAAa;AACjC,YAAM,IAAI,kBAAkB,wCAAwC;AAAA,IACxE;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,YAAM,IAAI,kBAAkB,sCAAsC;AAAA,IACtE;AACA,UAAM,UAAU,kDAAkD,QAAQ,cAAc,QAAQ,EAAE,QAAQ,YAAY,MAAM;AAC5H,UAAM,UAAmB,CAAC;AAC1B,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,MAAM,KAAK,OAAO;AAAA,MACrB;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';\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 * List buckets\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\n * @param {string} search\n * @throws {AppwriteException}\n * @returns {Promise<Models.BucketList>}\n */\n async listBuckets(queries?: string[], search?: string): Promise<Models.BucketList> {\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Create bucket\n *\n * Create a new storage bucket.\n *\n * @param {string} bucketId\n * @param {string} name\n * @param {string[]} permissions\n * @param {boolean} fileSecurity\n * @param {boolean} enabled\n * @param {number} maximumFileSize\n * @param {string[]} allowedFileExtensions\n * @param {Compression} compression\n * @param {boolean} encryption\n * @param {boolean} antivirus\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n async 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 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 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 await this.client.call(\n 'post',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get 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\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n async getBucket(bucketId: string): Promise<Models.Bucket> {\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update bucket\n *\n * Update a storage bucket by its unique ID.\n *\n * @param {string} bucketId\n * @param {string} name\n * @param {string[]} permissions\n * @param {boolean} fileSecurity\n * @param {boolean} enabled\n * @param {number} maximumFileSize\n * @param {string[]} allowedFileExtensions\n * @param {Compression} compression\n * @param {boolean} encryption\n * @param {boolean} antivirus\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n async 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 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 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 await this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Delete bucket\n *\n * Delete a storage bucket by its unique ID.\n *\n * @param {string} bucketId\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n async deleteBucket(bucketId: string): Promise<{}> {\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\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 await this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List files\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\n * @param {string[]} queries\n * @param {string} search\n * @throws {AppwriteException}\n * @returns {Promise<Models.FileList>}\n */\n async listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList> {\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Create 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\nLarger 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\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file&#039;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\nIf you&#039;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\n * @param {string} fileId\n * @param {File} file\n * @param {string[]} permissions\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n async createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress = (progress: UploadProgress) => {}): Promise<Models.File> {\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 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 await this.client.chunkedUpload(\n 'post',\n uri,\n apiHeaders,\n payload,\n onProgress\n );\n }\n /**\n * Get 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\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n async getFile(bucketId: string, fileId: string): Promise<Models.File> {\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update 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\n * @param {string} fileId\n * @param {string} name\n * @param {string[]} permissions\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n async updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File> {\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 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 await this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Delete file\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\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n async deleteFile(bucketId: string, fileId: string): Promise<{}> {\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 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 await this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get file for download\n *\n * Get a file content by its unique ID. The endpoint response return with a &#039;Content-Disposition: attachment&#039; header that tells the browser to start downloading the file to user downloads directory.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n async getFileDownload(bucketId: string, fileId: string): Promise<ArrayBuffer> {\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 const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n /**\n * Get file preview\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\n * @param {string} fileId\n * @param {number} width\n * @param {number} height\n * @param {ImageGravity} gravity\n * @param {number} quality\n * @param {number} borderWidth\n * @param {string} borderColor\n * @param {number} borderRadius\n * @param {number} opacity\n * @param {number} rotation\n * @param {string} background\n * @param {ImageFormat} output\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n async 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): Promise<ArrayBuffer> {\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 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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n /**\n * Get file for view\n *\n * Get a file content by its unique ID. This endpoint is similar to the download method but returns with no &#039;Content-Disposition: attachment&#039; header.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n async getFileView(bucketId: string, fileId: string): Promise<ArrayBuffer> {\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 const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n}\n"]}
@@ -376,7 +376,7 @@ var Storage = class {
376
376
  );
377
377
  }
378
378
  /**
379
- * Delete File
379
+ * Delete file
380
380
  *
381
381
  * Delete a file by its unique ID. Only users with write permissions have access to delete this resource.
382
382
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/services/storage.ts"],"names":[],"mappings":";AAAA,SAAS,yBAA+D;AAMjE,IAAM,UAAN,MAAc;AAAA,EAGjB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,YAAY,SAAoB,QAA6C;AAC/E,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,QAAI,OAAO,YAAY,aAAa;AAChC,cAAQ,SAAS,IAAI;AAAA,IACzB;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,cAAQ,QAAQ,IAAI;AAAA,IACxB;AACA,UAAM,MAAM,IAAI,IAAI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,QAAI,OAAO,YAAY,aAAa;AAChC,cAAQ,SAAS,IAAI;AAAA,IACzB;AACA,QAAI,OAAO,aAAa,aAAa;AACjC,cAAQ,UAAU,IAAI;AAAA,IAC1B;AACA,QAAI,OAAO,eAAe,aAAa;AACnC,cAAQ,YAAY,IAAI;AAAA,IAC5B;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,cAAQ,QAAQ,IAAI;AAAA,IACxB;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,MAAM,KAAK,OAAO;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,YAAY,UAAkB,QAAsC;AACtE,QAAI,OAAO,aAAa,aAAa;AACjC,YAAM,IAAI,kBAAkB,wCAAwC;AAAA,IACxE;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,YAAM,IAAI,kBAAkB,sCAAsC;AAAA,IACtE;AACA,UAAM,UAAU,kDAAkD,QAAQ,cAAc,QAAQ,EAAE,QAAQ,YAAY,MAAM;AAC5H,UAAM,UAAmB,CAAC;AAC1B,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,MAAM,KAAK,OAAO;AAAA,MACrB;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';\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 * List buckets\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\n * @param {string} search\n * @throws {AppwriteException}\n * @returns {Promise<Models.BucketList>}\n */\n async listBuckets(queries?: string[], search?: string): Promise<Models.BucketList> {\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Create bucket\n *\n * Create a new storage bucket.\n *\n * @param {string} bucketId\n * @param {string} name\n * @param {string[]} permissions\n * @param {boolean} fileSecurity\n * @param {boolean} enabled\n * @param {number} maximumFileSize\n * @param {string[]} allowedFileExtensions\n * @param {Compression} compression\n * @param {boolean} encryption\n * @param {boolean} antivirus\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n async 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 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 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 await this.client.call(\n 'post',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get 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\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n async getBucket(bucketId: string): Promise<Models.Bucket> {\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update bucket\n *\n * Update a storage bucket by its unique ID.\n *\n * @param {string} bucketId\n * @param {string} name\n * @param {string[]} permissions\n * @param {boolean} fileSecurity\n * @param {boolean} enabled\n * @param {number} maximumFileSize\n * @param {string[]} allowedFileExtensions\n * @param {Compression} compression\n * @param {boolean} encryption\n * @param {boolean} antivirus\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n async 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 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 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 await this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Delete bucket\n *\n * Delete a storage bucket by its unique ID.\n *\n * @param {string} bucketId\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n async deleteBucket(bucketId: string): Promise<{}> {\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\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 await this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List files\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\n * @param {string[]} queries\n * @param {string} search\n * @throws {AppwriteException}\n * @returns {Promise<Models.FileList>}\n */\n async listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList> {\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Create 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\nLarger 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\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file&#039;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\nIf you&#039;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\n * @param {string} fileId\n * @param {File} file\n * @param {string[]} permissions\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n async createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress = (progress: UploadProgress) => {}): Promise<Models.File> {\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 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 await this.client.chunkedUpload(\n 'post',\n uri,\n apiHeaders,\n payload,\n onProgress\n );\n }\n /**\n * Get 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\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n async getFile(bucketId: string, fileId: string): Promise<Models.File> {\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update 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\n * @param {string} fileId\n * @param {string} name\n * @param {string[]} permissions\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n async updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File> {\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 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 await this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Delete File\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\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n async deleteFile(bucketId: string, fileId: string): Promise<{}> {\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 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 await this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get file for download\n *\n * Get a file content by its unique ID. The endpoint response return with a &#039;Content-Disposition: attachment&#039; header that tells the browser to start downloading the file to user downloads directory.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n async getFileDownload(bucketId: string, fileId: string): Promise<ArrayBuffer> {\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 const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n /**\n * Get file preview\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\n * @param {string} fileId\n * @param {number} width\n * @param {number} height\n * @param {ImageGravity} gravity\n * @param {number} quality\n * @param {number} borderWidth\n * @param {string} borderColor\n * @param {number} borderRadius\n * @param {number} opacity\n * @param {number} rotation\n * @param {string} background\n * @param {ImageFormat} output\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n async 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): Promise<ArrayBuffer> {\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 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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n /**\n * Get file for view\n *\n * Get a file content by its unique ID. This endpoint is similar to the download method but returns with no &#039;Content-Disposition: attachment&#039; header.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n async getFileView(bucketId: string, fileId: string): Promise<ArrayBuffer> {\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 const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.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 await 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;AAMjE,IAAM,UAAN,MAAc;AAAA,EAGjB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,YAAY,SAAoB,QAA6C;AAC/E,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,QAAI,OAAO,YAAY,aAAa;AAChC,cAAQ,SAAS,IAAI;AAAA,IACzB;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,cAAQ,QAAQ,IAAI;AAAA,IACxB;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,MAAM,KAAK,OAAO;AAAA,MACrB;AAAA,MACA;AAAA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AO,eAAe,aAAa;AACnC,cAAQ,YAAY,IAAI;AAAA,IAC5B;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,cAAQ,QAAQ,IAAI;AAAA,IACxB;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,MAAM,KAAK,OAAO;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,YAAY,UAAkB,QAAsC;AACtE,QAAI,OAAO,aAAa,aAAa;AACjC,YAAM,IAAI,kBAAkB,wCAAwC;AAAA,IACxE;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,YAAM,IAAI,kBAAkB,sCAAsC;AAAA,IACtE;AACA,UAAM,UAAU,kDAAkD,QAAQ,cAAc,QAAQ,EAAE,QAAQ,YAAY,MAAM;AAC5H,UAAM,UAAmB,CAAC;AAC1B,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,MAAM,KAAK,OAAO;AAAA,MACrB;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';\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 * List buckets\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\n * @param {string} search\n * @throws {AppwriteException}\n * @returns {Promise<Models.BucketList>}\n */\n async listBuckets(queries?: string[], search?: string): Promise<Models.BucketList> {\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Create bucket\n *\n * Create a new storage bucket.\n *\n * @param {string} bucketId\n * @param {string} name\n * @param {string[]} permissions\n * @param {boolean} fileSecurity\n * @param {boolean} enabled\n * @param {number} maximumFileSize\n * @param {string[]} allowedFileExtensions\n * @param {Compression} compression\n * @param {boolean} encryption\n * @param {boolean} antivirus\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n async 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 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 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 await this.client.call(\n 'post',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get 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\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n async getBucket(bucketId: string): Promise<Models.Bucket> {\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update bucket\n *\n * Update a storage bucket by its unique ID.\n *\n * @param {string} bucketId\n * @param {string} name\n * @param {string[]} permissions\n * @param {boolean} fileSecurity\n * @param {boolean} enabled\n * @param {number} maximumFileSize\n * @param {string[]} allowedFileExtensions\n * @param {Compression} compression\n * @param {boolean} encryption\n * @param {boolean} antivirus\n * @throws {AppwriteException}\n * @returns {Promise<Models.Bucket>}\n */\n async 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 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 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 await this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Delete bucket\n *\n * Delete a storage bucket by its unique ID.\n *\n * @param {string} bucketId\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n async deleteBucket(bucketId: string): Promise<{}> {\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\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 await this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List files\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\n * @param {string[]} queries\n * @param {string} search\n * @throws {AppwriteException}\n * @returns {Promise<Models.FileList>}\n */\n async listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList> {\n if (typeof bucketId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"bucketId\"');\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Create 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\nLarger 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\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file&#039;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\nIf you&#039;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\n * @param {string} fileId\n * @param {File} file\n * @param {string[]} permissions\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n async createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress = (progress: UploadProgress) => {}): Promise<Models.File> {\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 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 await this.client.chunkedUpload(\n 'post',\n uri,\n apiHeaders,\n payload,\n onProgress\n );\n }\n /**\n * Get 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\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n async getFile(bucketId: string, fileId: string): Promise<Models.File> {\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update 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\n * @param {string} fileId\n * @param {string} name\n * @param {string[]} permissions\n * @throws {AppwriteException}\n * @returns {Promise<Models.File>}\n */\n async updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File> {\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 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 await this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Delete file\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\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n async deleteFile(bucketId: string, fileId: string): Promise<{}> {\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 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 await this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get file for download\n *\n * Get a file content by its unique ID. The endpoint response return with a &#039;Content-Disposition: attachment&#039; header that tells the browser to start downloading the file to user downloads directory.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n async getFileDownload(bucketId: string, fileId: string): Promise<ArrayBuffer> {\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 const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n /**\n * Get file preview\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\n * @param {string} fileId\n * @param {number} width\n * @param {number} height\n * @param {ImageGravity} gravity\n * @param {number} quality\n * @param {number} borderWidth\n * @param {string} borderColor\n * @param {number} borderRadius\n * @param {number} opacity\n * @param {number} rotation\n * @param {string} background\n * @param {ImageFormat} output\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n async 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): Promise<ArrayBuffer> {\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 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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n /**\n * Get file for view\n *\n * Get a file content by its unique ID. This endpoint is similar to the download method but returns with no &#039;Content-Disposition: attachment&#039; header.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {AppwriteException}\n * @returns {Promise<ArrayBuffer>}\n */\n async getFileView(bucketId: string, fileId: string): Promise<ArrayBuffer> {\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 const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n 'arrayBuffer'\n );\n }\n}\n"]}
@@ -62,7 +62,7 @@ declare class Teams {
62
62
  /**
63
63
  * List team memberships
64
64
  *
65
- * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint.
65
+ * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
66
66
  *
67
67
  * @param {string} teamId
68
68
  * @param {string[]} queries
@@ -97,7 +97,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee
97
97
  /**
98
98
  * Get team membership
99
99
  *
100
- * Get a team member by the membership unique id. All team members have read access for this resource.
100
+ * Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
101
101
  *
102
102
  * @param {string} teamId
103
103
  * @param {string} membershipId
@@ -62,7 +62,7 @@ declare class Teams {
62
62
  /**
63
63
  * List team memberships
64
64
  *
65
- * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint.
65
+ * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
66
66
  *
67
67
  * @param {string} teamId
68
68
  * @param {string[]} queries
@@ -97,7 +97,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee
97
97
  /**
98
98
  * Get team membership
99
99
  *
100
- * Get a team member by the membership unique id. All team members have read access for this resource.
100
+ * Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
101
101
  *
102
102
  * @param {string} teamId
103
103
  * @param {string} membershipId
@@ -164,7 +164,7 @@ class Teams {
164
164
  /**
165
165
  * List team memberships
166
166
  *
167
- * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint.
167
+ * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
168
168
  *
169
169
  * @param {string} teamId
170
170
  * @param {string[]} queries
@@ -258,7 +258,7 @@ class Teams {
258
258
  /**
259
259
  * Get team membership
260
260
  *
261
- * Get a team member by the membership unique id. All team members have read access for this resource.
261
+ * Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
262
262
  *
263
263
  * @param {string} teamId
264
264
  * @param {string} membershipId
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/services/teams.ts"],"names":[],"mappings":"AAAA,SAAS,yBAA+D;AAGjE,MAAM,MAAM;AAAA,EAGf,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,KAA6C,SAAoB,QAAwD;AAC3H,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,QAAI,OAAO,YAAY,aAAa;AAChC,cAAQ,SAAS,IAAI;AAAA,IACzB;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,cAAQ,QAAQ,IAAI;AAAA,IACxB;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,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AAM,IAAI,kBAAkB,sCAAsC;AAAA,IACtE;AACA,QAAI,OAAO,UAAU,aAAa;AAC9B,YAAM,IAAI,kBAAkB,qCAAqC;AAAA,IACrE;AACA,UAAM,UAAU,wBAAwB,QAAQ,YAAY,MAAM;AAClE,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;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,MAAM,KAAK,OAAO;AAAA,MACrB;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\nexport class Teams {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * List teams\n *\n * Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\n *\n * @param {string[]} queries\n * @param {string} search\n * @throws {AppwriteException}\n * @returns {Promise<Models.TeamList<Preferences>>}\n */\n async list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>> {\n const apiPath = '/teams';\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Create team\n *\n * Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.\n *\n * @param {string} teamId\n * @param {string} name\n * @param {string[]} roles\n * @throws {AppwriteException}\n * @returns {Promise<Models.Team<Preferences>>}\n */\n async create<Preferences extends Models.Preferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof name === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"name\"');\n }\n const apiPath = '/teams';\n const payload: Payload = {};\n if (typeof teamId !== 'undefined') {\n payload['teamId'] = teamId;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof roles !== 'undefined') {\n payload['roles'] = roles;\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 await this.client.call(\n 'post',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get team\n *\n * Get a team by its ID. All team members have read access for this resource.\n *\n * @param {string} teamId\n * @throws {AppwriteException}\n * @returns {Promise<Models.Team<Preferences>>}\n */\n async get<Preferences extends Models.Preferences>(teamId: string): Promise<Models.Team<Preferences>> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);\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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update name\n *\n * Update the team&#039;s name by its unique ID.\n *\n * @param {string} teamId\n * @param {string} name\n * @throws {AppwriteException}\n * @returns {Promise<Models.Team<Preferences>>}\n */\n async updateName<Preferences extends Models.Preferences>(teamId: string, name: string): Promise<Models.Team<Preferences>> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof name === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"name\"');\n }\n const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);\n const payload: Payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\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 await this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Delete team\n *\n * Delete a team using its ID. Only team members with the owner role can delete the team.\n *\n * @param {string} teamId\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n async delete(teamId: string): Promise<{}> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);\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 await this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List team memberships\n *\n * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint.\n *\n * @param {string} teamId\n * @param {string[]} queries\n * @param {string} search\n * @throws {AppwriteException}\n * @returns {Promise<Models.MembershipList>}\n */\n async listMemberships(teamId: string, queries?: string[], search?: string): Promise<Models.MembershipList> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Create team membership\n *\n * Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn&#039;t exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID &gt; email &gt; phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n\n *\n * @param {string} teamId\n * @param {string[]} roles\n * @param {string} email\n * @param {string} userId\n * @param {string} phone\n * @param {string} url\n * @param {string} name\n * @throws {AppwriteException}\n * @returns {Promise<Models.Membership>}\n */\n async createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof roles === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"roles\"');\n }\n const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);\n const payload: Payload = {};\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof phone !== 'undefined') {\n payload['phone'] = phone;\n }\n if (typeof roles !== 'undefined') {\n payload['roles'] = roles;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\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 await this.client.call(\n 'post',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get team membership\n *\n * Get a team member by the membership unique id. All team members have read access for this resource.\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @throws {AppwriteException}\n * @returns {Promise<Models.Membership>}\n */\n async getMembership(teamId: string, membershipId: string): Promise<Models.Membership> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"membershipId\"');\n }\n const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update membership\n *\n * Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions).\n\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @param {string[]} roles\n * @throws {AppwriteException}\n * @returns {Promise<Models.Membership>}\n */\n async updateMembership(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"membershipId\"');\n }\n if (typeof roles === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"roles\"');\n }\n const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\n const payload: Payload = {};\n if (typeof roles !== 'undefined') {\n payload['roles'] = roles;\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 await this.client.call(\n 'patch',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Delete team membership\n *\n * This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n async deleteMembership(teamId: string, membershipId: string): Promise<{}> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"membershipId\"');\n }\n const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\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 await this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update team membership status\n *\n * Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @param {string} userId\n * @param {string} secret\n * @throws {AppwriteException}\n * @returns {Promise<Models.Membership>}\n */\n async updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"membershipId\"');\n }\n if (typeof userId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"secret\"');\n }\n const apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\n const payload: Payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\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 await this.client.call(\n 'patch',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get team preferences\n *\n * Get the team&#039;s shared preferences by its unique ID. If a preference doesn&#039;t need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).\n *\n * @param {string} teamId\n * @throws {AppwriteException}\n * @returns {Promise<Preferences>}\n */\n async getPrefs<Preferences extends Models.Preferences>(teamId: string): Promise<Preferences> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);\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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update preferences\n *\n * Update the team&#039;s preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.\n *\n * @param {string} teamId\n * @param {object} prefs\n * @throws {AppwriteException}\n * @returns {Promise<Preferences>}\n */\n async updatePrefs<Preferences extends Models.Preferences>(teamId: string, prefs: object): Promise<Preferences> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof prefs === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"prefs\"');\n }\n const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);\n const payload: Payload = {};\n if (typeof prefs !== 'undefined') {\n payload['prefs'] = prefs;\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 await this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["../../src/services/teams.ts"],"names":[],"mappings":"AAAA,SAAS,yBAA+D;AAGjE,MAAM,MAAM;AAAA,EAGf,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,KAA6C,SAAoB,QAAwD;AAC3H,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;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AO,MAAM,KAAK,OAAO;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,YAAoD,QAAgB,OAAqC;AAC3G,QAAI,OAAO,WAAW,aAAa;AAC/B,YAAM,IAAI,kBAAkB,sCAAsC;AAAA,IACtE;AACA,QAAI,OAAO,UAAU,aAAa;AAC9B,YAAM,IAAI,kBAAkB,qCAAqC;AAAA,IACrE;AACA,UAAM,UAAU,wBAAwB,QAAQ,YAAY,MAAM;AAClE,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;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,MAAM,KAAK,OAAO;AAAA,MACrB;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\nexport class Teams {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * List teams\n *\n * Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\n *\n * @param {string[]} queries\n * @param {string} search\n * @throws {AppwriteException}\n * @returns {Promise<Models.TeamList<Preferences>>}\n */\n async list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>> {\n const apiPath = '/teams';\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Create team\n *\n * Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.\n *\n * @param {string} teamId\n * @param {string} name\n * @param {string[]} roles\n * @throws {AppwriteException}\n * @returns {Promise<Models.Team<Preferences>>}\n */\n async create<Preferences extends Models.Preferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof name === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"name\"');\n }\n const apiPath = '/teams';\n const payload: Payload = {};\n if (typeof teamId !== 'undefined') {\n payload['teamId'] = teamId;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof roles !== 'undefined') {\n payload['roles'] = roles;\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 await this.client.call(\n 'post',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get team\n *\n * Get a team by its ID. All team members have read access for this resource.\n *\n * @param {string} teamId\n * @throws {AppwriteException}\n * @returns {Promise<Models.Team<Preferences>>}\n */\n async get<Preferences extends Models.Preferences>(teamId: string): Promise<Models.Team<Preferences>> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);\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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update name\n *\n * Update the team&#039;s name by its unique ID.\n *\n * @param {string} teamId\n * @param {string} name\n * @throws {AppwriteException}\n * @returns {Promise<Models.Team<Preferences>>}\n */\n async updateName<Preferences extends Models.Preferences>(teamId: string, name: string): Promise<Models.Team<Preferences>> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof name === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"name\"');\n }\n const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);\n const payload: Payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\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 await this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Delete team\n *\n * Delete a team using its ID. Only team members with the owner role can delete the team.\n *\n * @param {string} teamId\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n async delete(teamId: string): Promise<{}> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);\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 await this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List team memberships\n *\n * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.\n *\n * @param {string} teamId\n * @param {string[]} queries\n * @param {string} search\n * @throws {AppwriteException}\n * @returns {Promise<Models.MembershipList>}\n */\n async listMemberships(teamId: string, queries?: string[], search?: string): Promise<Models.MembershipList> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);\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 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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Create team membership\n *\n * Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn&#039;t exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID &gt; email &gt; phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n\n *\n * @param {string} teamId\n * @param {string[]} roles\n * @param {string} email\n * @param {string} userId\n * @param {string} phone\n * @param {string} url\n * @param {string} name\n * @throws {AppwriteException}\n * @returns {Promise<Models.Membership>}\n */\n async createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof roles === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"roles\"');\n }\n const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);\n const payload: Payload = {};\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof phone !== 'undefined') {\n payload['phone'] = phone;\n }\n if (typeof roles !== 'undefined') {\n payload['roles'] = roles;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\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 await this.client.call(\n 'post',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get team membership\n *\n * Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @throws {AppwriteException}\n * @returns {Promise<Models.Membership>}\n */\n async getMembership(teamId: string, membershipId: string): Promise<Models.Membership> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"membershipId\"');\n }\n const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update membership\n *\n * Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions).\n\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @param {string[]} roles\n * @throws {AppwriteException}\n * @returns {Promise<Models.Membership>}\n */\n async updateMembership(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"membershipId\"');\n }\n if (typeof roles === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"roles\"');\n }\n const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\n const payload: Payload = {};\n if (typeof roles !== 'undefined') {\n payload['roles'] = roles;\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 await this.client.call(\n 'patch',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Delete team membership\n *\n * This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n async deleteMembership(teamId: string, membershipId: string): Promise<{}> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"membershipId\"');\n }\n const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\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 await this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update team membership status\n *\n * Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @param {string} userId\n * @param {string} secret\n * @throws {AppwriteException}\n * @returns {Promise<Models.Membership>}\n */\n async updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"membershipId\"');\n }\n if (typeof userId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"secret\"');\n }\n const apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\n const payload: Payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\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 await this.client.call(\n 'patch',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get team preferences\n *\n * Get the team&#039;s shared preferences by its unique ID. If a preference doesn&#039;t need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).\n *\n * @param {string} teamId\n * @throws {AppwriteException}\n * @returns {Promise<Preferences>}\n */\n async getPrefs<Preferences extends Models.Preferences>(teamId: string): Promise<Preferences> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);\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 await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Update preferences\n *\n * Update the team&#039;s preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.\n *\n * @param {string} teamId\n * @param {object} prefs\n * @throws {AppwriteException}\n * @returns {Promise<Preferences>}\n */\n async updatePrefs<Preferences extends Models.Preferences>(teamId: string, prefs: object): Promise<Preferences> {\n if (typeof teamId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"teamId\"');\n }\n if (typeof prefs === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"prefs\"');\n }\n const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);\n const payload: Payload = {};\n if (typeof prefs !== 'undefined') {\n payload['prefs'] = prefs;\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 await this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n}\n"]}
@@ -163,7 +163,7 @@ var Teams = class {
163
163
  /**
164
164
  * List team memberships
165
165
  *
166
- * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint.
166
+ * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
167
167
  *
168
168
  * @param {string} teamId
169
169
  * @param {string[]} queries
@@ -257,7 +257,7 @@ var Teams = class {
257
257
  /**
258
258
  * Get team membership
259
259
  *
260
- * Get a team member by the membership unique id. All team members have read access for this resource.
260
+ * Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
261
261
  *
262
262
  * @param {string} teamId
263
263
  * @param {string} membershipId