react-native-appwrite 0.19.0 → 0.20.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 (158) hide show
  1. package/.github/workflows/publish.yml +9 -8
  2. package/CHANGELOG.md +6 -0
  3. package/LICENSE +1 -1
  4. package/README.md +2 -2
  5. package/dist/cjs/sdk.js +223 -44
  6. package/dist/cjs/sdk.js.map +1 -1
  7. package/dist/esm/sdk.js +219 -45
  8. package/dist/esm/sdk.js.map +1 -1
  9. package/docs/examples/account/create-anonymous-session.md +2 -0
  10. package/docs/examples/account/create-email-password-session.md +2 -0
  11. package/docs/examples/account/create-email-token.md +2 -0
  12. package/docs/examples/account/create-email-verification.md +2 -0
  13. package/docs/examples/account/create-jwt.md +5 -1
  14. package/docs/examples/account/create-magic-url-token.md +2 -0
  15. package/docs/examples/account/create-mfa-authenticator.md +2 -0
  16. package/docs/examples/account/create-mfa-challenge.md +2 -0
  17. package/docs/examples/account/create-mfa-recovery-codes.md +2 -0
  18. package/docs/examples/account/create-o-auth-2-session.md +2 -0
  19. package/docs/examples/account/create-o-auth-2-token.md +2 -0
  20. package/docs/examples/account/create-phone-token.md +2 -0
  21. package/docs/examples/account/create-phone-verification.md +2 -0
  22. package/docs/examples/account/create-push-target.md +2 -0
  23. package/docs/examples/account/create-recovery.md +2 -0
  24. package/docs/examples/account/create-session.md +2 -0
  25. package/docs/examples/account/create-verification.md +2 -0
  26. package/docs/examples/account/create.md +2 -0
  27. package/docs/examples/account/delete-identity.md +2 -0
  28. package/docs/examples/account/delete-mfa-authenticator.md +2 -0
  29. package/docs/examples/account/delete-push-target.md +2 -0
  30. package/docs/examples/account/delete-session.md +2 -0
  31. package/docs/examples/account/delete-sessions.md +2 -0
  32. package/docs/examples/account/get-mfa-recovery-codes.md +2 -0
  33. package/docs/examples/account/get-prefs.md +2 -0
  34. package/docs/examples/account/get-session.md +2 -0
  35. package/docs/examples/account/get.md +2 -0
  36. package/docs/examples/account/list-identities.md +2 -0
  37. package/docs/examples/account/list-logs.md +2 -0
  38. package/docs/examples/account/list-mfa-factors.md +2 -0
  39. package/docs/examples/account/list-sessions.md +2 -0
  40. package/docs/examples/account/update-email-verification.md +2 -0
  41. package/docs/examples/account/update-email.md +2 -0
  42. package/docs/examples/account/update-magic-url-session.md +2 -0
  43. package/docs/examples/account/update-mfa-authenticator.md +2 -0
  44. package/docs/examples/account/update-mfa-challenge.md +2 -0
  45. package/docs/examples/account/update-mfa-recovery-codes.md +2 -0
  46. package/docs/examples/account/update-mfa.md +2 -0
  47. package/docs/examples/account/update-name.md +2 -0
  48. package/docs/examples/account/update-password.md +2 -0
  49. package/docs/examples/account/update-phone-session.md +2 -0
  50. package/docs/examples/account/update-phone-verification.md +2 -0
  51. package/docs/examples/account/update-phone.md +2 -0
  52. package/docs/examples/account/update-prefs.md +2 -0
  53. package/docs/examples/account/update-push-target.md +2 -0
  54. package/docs/examples/account/update-recovery.md +2 -0
  55. package/docs/examples/account/update-session.md +2 -0
  56. package/docs/examples/account/update-status.md +2 -0
  57. package/docs/examples/account/update-verification.md +2 -0
  58. package/docs/examples/avatars/get-browser.md +2 -0
  59. package/docs/examples/avatars/get-credit-card.md +2 -0
  60. package/docs/examples/avatars/get-favicon.md +2 -0
  61. package/docs/examples/avatars/get-flag.md +2 -0
  62. package/docs/examples/avatars/get-image.md +2 -0
  63. package/docs/examples/avatars/get-initials.md +2 -0
  64. package/docs/examples/avatars/get-qr.md +2 -0
  65. package/docs/examples/avatars/get-screenshot.md +7 -5
  66. package/docs/examples/databases/create-document.md +2 -0
  67. package/docs/examples/databases/create-operations.md +2 -0
  68. package/docs/examples/databases/create-transaction.md +2 -0
  69. package/docs/examples/databases/decrement-document-attribute.md +2 -0
  70. package/docs/examples/databases/delete-document.md +2 -0
  71. package/docs/examples/databases/delete-transaction.md +2 -0
  72. package/docs/examples/databases/get-document.md +2 -0
  73. package/docs/examples/databases/get-transaction.md +2 -0
  74. package/docs/examples/databases/increment-document-attribute.md +2 -0
  75. package/docs/examples/databases/list-documents.md +2 -0
  76. package/docs/examples/databases/list-transactions.md +2 -0
  77. package/docs/examples/databases/update-document.md +9 -1
  78. package/docs/examples/databases/update-transaction.md +2 -0
  79. package/docs/examples/databases/upsert-document.md +9 -1
  80. package/docs/examples/functions/create-execution.md +2 -0
  81. package/docs/examples/functions/get-execution.md +2 -0
  82. package/docs/examples/functions/list-executions.md +2 -0
  83. package/docs/examples/graphql/mutation.md +2 -0
  84. package/docs/examples/graphql/query.md +2 -0
  85. package/docs/examples/locale/get.md +2 -0
  86. package/docs/examples/locale/list-codes.md +2 -0
  87. package/docs/examples/locale/list-continents.md +2 -0
  88. package/docs/examples/locale/list-countries-eu.md +2 -0
  89. package/docs/examples/locale/list-countries-phones.md +2 -0
  90. package/docs/examples/locale/list-countries.md +2 -0
  91. package/docs/examples/locale/list-currencies.md +2 -0
  92. package/docs/examples/locale/list-languages.md +2 -0
  93. package/docs/examples/messaging/create-subscriber.md +2 -0
  94. package/docs/examples/messaging/delete-subscriber.md +2 -0
  95. package/docs/examples/storage/create-file.md +2 -0
  96. package/docs/examples/storage/delete-file.md +2 -0
  97. package/docs/examples/storage/get-file-download.md +2 -0
  98. package/docs/examples/storage/get-file-preview.md +2 -0
  99. package/docs/examples/storage/get-file-view.md +2 -0
  100. package/docs/examples/storage/get-file.md +2 -0
  101. package/docs/examples/storage/list-files.md +2 -0
  102. package/docs/examples/storage/update-file.md +2 -0
  103. package/docs/examples/tablesdb/create-operations.md +2 -0
  104. package/docs/examples/tablesdb/create-row.md +2 -0
  105. package/docs/examples/tablesdb/create-transaction.md +2 -0
  106. package/docs/examples/tablesdb/decrement-row-column.md +2 -0
  107. package/docs/examples/tablesdb/delete-row.md +2 -0
  108. package/docs/examples/tablesdb/delete-transaction.md +2 -0
  109. package/docs/examples/tablesdb/get-row.md +2 -0
  110. package/docs/examples/tablesdb/get-transaction.md +2 -0
  111. package/docs/examples/tablesdb/increment-row-column.md +2 -0
  112. package/docs/examples/tablesdb/list-rows.md +2 -0
  113. package/docs/examples/tablesdb/list-transactions.md +2 -0
  114. package/docs/examples/tablesdb/update-row.md +9 -1
  115. package/docs/examples/tablesdb/update-transaction.md +2 -0
  116. package/docs/examples/tablesdb/upsert-row.md +9 -1
  117. package/docs/examples/teams/create-membership.md +4 -2
  118. package/docs/examples/teams/create.md +2 -0
  119. package/docs/examples/teams/delete-membership.md +2 -0
  120. package/docs/examples/teams/delete.md +2 -0
  121. package/docs/examples/teams/get-membership.md +2 -0
  122. package/docs/examples/teams/get-prefs.md +2 -0
  123. package/docs/examples/teams/get.md +2 -0
  124. package/docs/examples/teams/list-memberships.md +2 -0
  125. package/docs/examples/teams/list.md +2 -0
  126. package/docs/examples/teams/update-membership-status.md +2 -0
  127. package/docs/examples/teams/update-membership.md +4 -2
  128. package/docs/examples/teams/update-name.md +2 -0
  129. package/docs/examples/teams/update-prefs.md +2 -0
  130. package/package.json +6 -3
  131. package/rollup.config.js +3 -1
  132. package/src/channel.ts +134 -0
  133. package/src/client.ts +41 -6
  134. package/src/enums/browser-permission.ts +22 -0
  135. package/src/enums/o-auth-provider.ts +0 -1
  136. package/src/enums/roles.ts +5 -0
  137. package/src/index.ts +4 -2
  138. package/src/models.ts +8 -0
  139. package/src/query.ts +54 -9
  140. package/src/services/account.ts +30 -1
  141. package/src/services/avatars.ts +17 -16
  142. package/src/services/databases.ts +5 -9
  143. package/src/services/storage.ts +8 -8
  144. package/src/services/teams.ts +19 -18
  145. package/types/channel.d.ts +71 -0
  146. package/types/enums/browser-permission.d.ts +22 -0
  147. package/types/enums/o-auth-provider.d.ts +1 -2
  148. package/types/enums/roles.d.ts +5 -0
  149. package/types/index.d.ts +4 -2
  150. package/types/models.d.ts +8 -0
  151. package/types/query.d.ts +36 -6
  152. package/types/services/account.d.ts +13 -1
  153. package/types/services/avatars.d.ts +12 -11
  154. package/types/services/databases.d.ts +2 -2
  155. package/types/services/storage.d.ts +8 -8
  156. package/types/services/teams.d.ts +9 -8
  157. package/src/enums/output.ts +0 -9
  158. package/types/enums/output.d.ts +0 -9
@@ -10,7 +10,8 @@ import { CreditCard } from '../enums/credit-card';
10
10
  import { Flag } from '../enums/flag';
11
11
  import { Theme } from '../enums/theme';
12
12
  import { Timezone } from '../enums/timezone';
13
- import { Output } from '../enums/output';
13
+ import { BrowserPermission } from '../enums/browser-permission';
14
+ import { ImageFormat } from '../enums/image-format';
14
15
 
15
16
  export class Avatars extends Service {
16
17
 
@@ -584,16 +585,16 @@ export class Avatars extends Service {
584
585
  * @param {number} params.longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
585
586
  * @param {number} params.accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
586
587
  * @param {boolean} params.touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.
587
- * @param {string[]} params.permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
588
+ * @param {BrowserPermission[]} params.permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
588
589
  * @param {number} params.sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
589
590
  * @param {number} params.width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).
590
591
  * @param {number} params.height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).
591
592
  * @param {number} params.quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
592
- * @param {Output} params.output - Output format type (jpeg, jpg, png, gif and webp).
593
+ * @param {ImageFormat} params.output - Output format type (jpeg, jpg, png, gif and webp).
593
594
  * @throws {AppwriteException}
594
595
  * @returns {ArrayBuffer}
595
596
  */
596
- getScreenshot(params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output }): Promise<ArrayBuffer>;
597
+ getScreenshot(params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }): Promise<ArrayBuffer>;
597
598
  /**
598
599
  * Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.
599
600
  *
@@ -615,25 +616,25 @@ export class Avatars extends Service {
615
616
  * @param {number} longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
616
617
  * @param {number} accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
617
618
  * @param {boolean} touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.
618
- * @param {string[]} permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
619
+ * @param {BrowserPermission[]} permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
619
620
  * @param {number} sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
620
621
  * @param {number} width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).
621
622
  * @param {number} height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).
622
623
  * @param {number} quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
623
- * @param {Output} output - Output format type (jpeg, jpg, png, gif and webp).
624
+ * @param {ImageFormat} output - Output format type (jpeg, jpg, png, gif and webp).
624
625
  * @throws {AppwriteException}
625
626
  * @returns {Promise<ArrayBuffer>}
626
627
  * @deprecated Use the object parameter style method for a better developer experience.
627
628
  */
628
- getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output): Promise<ArrayBuffer>;
629
+ getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat): Promise<ArrayBuffer>;
629
630
  getScreenshot(
630
- paramsOrFirst: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output } | string,
631
- ...rest: [(object)?, (number)?, (number)?, (number)?, (Theme)?, (string)?, (boolean)?, (string)?, (Timezone)?, (number)?, (number)?, (number)?, (boolean)?, (string[])?, (number)?, (number)?, (number)?, (number)?, (Output)?]
631
+ paramsOrFirst: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat } | string,
632
+ ...rest: [(object)?, (number)?, (number)?, (number)?, (Theme)?, (string)?, (boolean)?, (string)?, (Timezone)?, (number)?, (number)?, (number)?, (boolean)?, (BrowserPermission[])?, (number)?, (number)?, (number)?, (number)?, (ImageFormat)?]
632
633
  ): Promise<ArrayBuffer> {
633
- let params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output };
634
+ let params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat };
634
635
 
635
636
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
636
- params = (paramsOrFirst || {}) as { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output };
637
+ params = (paramsOrFirst || {}) as { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat };
637
638
  } else {
638
639
  params = {
639
640
  url: paramsOrFirst as string,
@@ -650,12 +651,12 @@ export class Avatars extends Service {
650
651
  longitude: rest[10] as number,
651
652
  accuracy: rest[11] as number,
652
653
  touch: rest[12] as boolean,
653
- permissions: rest[13] as string[],
654
+ permissions: rest[13] as BrowserPermission[],
654
655
  sleep: rest[14] as number,
655
656
  width: rest[15] as number,
656
657
  height: rest[16] as number,
657
658
  quality: rest[17] as number,
658
- output: rest[18] as Output
659
+ output: rest[18] as ImageFormat
659
660
  };
660
661
  }
661
662
 
@@ -1108,16 +1109,16 @@ export class Avatars extends Service {
1108
1109
  * @param {number} longitude
1109
1110
  * @param {number} accuracy
1110
1111
  * @param {boolean} touch
1111
- * @param {string[]} permissions
1112
+ * @param {BrowserPermission[]} permissions
1112
1113
  * @param {number} sleep
1113
1114
  * @param {number} width
1114
1115
  * @param {number} height
1115
1116
  * @param {number} quality
1116
- * @param {Output} output
1117
+ * @param {ImageFormat} output
1117
1118
  * @throws {AppwriteException}
1118
1119
  * @returns {URL}
1119
1120
  */
1120
- getScreenshotURL(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output): URL {
1121
+ getScreenshotURL(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat): URL {
1121
1122
  const apiPath = '/avatars/screenshots';
1122
1123
  const payload: Payload = {};
1123
1124
 
@@ -571,7 +571,7 @@ export class Databases extends Service {
571
571
  * @returns {Promise}
572
572
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead.
573
573
  */
574
- upsertDocument<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string }): Promise<Document>;
574
+ upsertDocument<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string }): Promise<Document>;
575
575
  /**
576
576
  * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
577
577
  *
@@ -585,15 +585,15 @@ export class Databases extends Service {
585
585
  * @returns {Promise<Document>}
586
586
  * @deprecated Use the object parameter style method for a better developer experience.
587
587
  */
588
- upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string): Promise<Document>;
588
+ upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string): Promise<Document>;
589
589
  upsertDocument<Document extends Models.Document = Models.DefaultDocument>(
590
- paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string } | string,
590
+ paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string } | string,
591
591
  ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>)?, (string[])?, (string)?]
592
592
  ): Promise<Document> {
593
- let params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string };
593
+ let params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string };
594
594
 
595
595
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
596
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string };
596
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string };
597
597
  } else {
598
598
  params = {
599
599
  databaseId: paramsOrFirst as string,
@@ -624,10 +624,6 @@ export class Databases extends Service {
624
624
  throw new AppwriteException('Missing required parameter: "documentId"');
625
625
  }
626
626
 
627
- if (typeof data === 'undefined') {
628
- throw new AppwriteException('Missing required parameter: "data"');
629
- }
630
-
631
627
  const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
632
628
  const payload: Payload = {};
633
629
 
@@ -289,10 +289,10 @@ export class Storage extends Service {
289
289
  /**
290
290
  * Update a file by its unique ID. Only users with write permissions have access to update this resource.
291
291
  *
292
- * @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
293
- * @param {string} params.fileId - File unique ID.
294
- * @param {string} params.name - Name of the file
295
- * @param {string[]} params.permissions - An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
292
+ * @param {string} params.bucketId - Bucket unique ID.
293
+ * @param {string} params.fileId - File ID.
294
+ * @param {string} params.name - File name.
295
+ * @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
296
296
  * @throws {AppwriteException}
297
297
  * @returns {Promise}
298
298
  */
@@ -300,10 +300,10 @@ export class Storage extends Service {
300
300
  /**
301
301
  * Update a file by its unique ID. Only users with write permissions have access to update this resource.
302
302
  *
303
- * @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
304
- * @param {string} fileId - File unique ID.
305
- * @param {string} name - Name of the file
306
- * @param {string[]} permissions - An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
303
+ * @param {string} bucketId - Bucket unique ID.
304
+ * @param {string} fileId - File ID.
305
+ * @param {string} name - File name.
306
+ * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
307
307
  * @throws {AppwriteException}
308
308
  * @returns {Promise<Models.File>}
309
309
  * @deprecated Use the object parameter style method for a better developer experience.
@@ -5,6 +5,7 @@ import type { UploadProgress, Payload } from '../client';
5
5
  import * as FileSystem from 'expo-file-system';
6
6
  import { Platform } from 'react-native';
7
7
 
8
+ import { Roles } from '../enums/roles';
8
9
 
9
10
  export class Teams extends Service {
10
11
 
@@ -371,7 +372,7 @@ export class Teams extends Service {
371
372
  *
372
373
  *
373
374
  * @param {string} params.teamId - Team ID.
374
- * @param {string[]} params.roles - Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
375
+ * @param {Roles[]} params.roles - Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
375
376
  * @param {string} params.email - Email of the new team member.
376
377
  * @param {string} params.userId - ID of the user to be added to a team.
377
378
  * @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
@@ -380,7 +381,7 @@ export class Teams extends Service {
380
381
  * @throws {AppwriteException}
381
382
  * @returns {Promise}
382
383
  */
383
- createMembership(params: { teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string }): Promise<Models.Membership>;
384
+ createMembership(params: { teamId: string, roles: Roles[], email?: string, userId?: string, phone?: string, url?: string, name?: string }): Promise<Models.Membership>;
384
385
  /**
385
386
  * 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't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
386
387
  *
@@ -392,7 +393,7 @@ export class Teams extends Service {
392
393
  *
393
394
  *
394
395
  * @param {string} teamId - Team ID.
395
- * @param {string[]} roles - Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
396
+ * @param {Roles[]} roles - Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
396
397
  * @param {string} email - Email of the new team member.
397
398
  * @param {string} userId - ID of the user to be added to a team.
398
399
  * @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
@@ -402,19 +403,19 @@ export class Teams extends Service {
402
403
  * @returns {Promise<Models.Membership>}
403
404
  * @deprecated Use the object parameter style method for a better developer experience.
404
405
  */
405
- createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership>;
406
+ createMembership(teamId: string, roles: Roles[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership>;
406
407
  createMembership(
407
- paramsOrFirst: { teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string } | string,
408
- ...rest: [(string[])?, (string)?, (string)?, (string)?, (string)?, (string)?]
408
+ paramsOrFirst: { teamId: string, roles: Roles[], email?: string, userId?: string, phone?: string, url?: string, name?: string } | string,
409
+ ...rest: [(Roles[])?, (string)?, (string)?, (string)?, (string)?, (string)?]
409
410
  ): Promise<Models.Membership> {
410
- let params: { teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string };
411
+ let params: { teamId: string, roles: Roles[], email?: string, userId?: string, phone?: string, url?: string, name?: string };
411
412
 
412
413
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
413
- params = (paramsOrFirst || {}) as { teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string };
414
+ params = (paramsOrFirst || {}) as { teamId: string, roles: Roles[], email?: string, userId?: string, phone?: string, url?: string, name?: string };
414
415
  } else {
415
416
  params = {
416
417
  teamId: paramsOrFirst as string,
417
- roles: rest[0] as string[],
418
+ roles: rest[0] as Roles[],
418
419
  email: rest[1] as string,
419
420
  userId: rest[2] as string,
420
421
  phone: rest[3] as string,
@@ -531,36 +532,36 @@ export class Teams extends Service {
531
532
  *
532
533
  * @param {string} params.teamId - Team ID.
533
534
  * @param {string} params.membershipId - Membership ID.
534
- * @param {string[]} params.roles - An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
535
+ * @param {Roles[]} params.roles - An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
535
536
  * @throws {AppwriteException}
536
537
  * @returns {Promise}
537
538
  */
538
- updateMembership(params: { teamId: string, membershipId: string, roles: string[] }): Promise<Models.Membership>;
539
+ updateMembership(params: { teamId: string, membershipId: string, roles: Roles[] }): Promise<Models.Membership>;
539
540
  /**
540
541
  * 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).
541
542
  *
542
543
  *
543
544
  * @param {string} teamId - Team ID.
544
545
  * @param {string} membershipId - Membership ID.
545
- * @param {string[]} roles - An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
546
+ * @param {Roles[]} roles - An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
546
547
  * @throws {AppwriteException}
547
548
  * @returns {Promise<Models.Membership>}
548
549
  * @deprecated Use the object parameter style method for a better developer experience.
549
550
  */
550
- updateMembership(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership>;
551
+ updateMembership(teamId: string, membershipId: string, roles: Roles[]): Promise<Models.Membership>;
551
552
  updateMembership(
552
- paramsOrFirst: { teamId: string, membershipId: string, roles: string[] } | string,
553
- ...rest: [(string)?, (string[])?]
553
+ paramsOrFirst: { teamId: string, membershipId: string, roles: Roles[] } | string,
554
+ ...rest: [(string)?, (Roles[])?]
554
555
  ): Promise<Models.Membership> {
555
- let params: { teamId: string, membershipId: string, roles: string[] };
556
+ let params: { teamId: string, membershipId: string, roles: Roles[] };
556
557
 
557
558
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
558
- params = (paramsOrFirst || {}) as { teamId: string, membershipId: string, roles: string[] };
559
+ params = (paramsOrFirst || {}) as { teamId: string, membershipId: string, roles: Roles[] };
559
560
  } else {
560
561
  params = {
561
562
  teamId: paramsOrFirst as string,
562
563
  membershipId: rest[0] as string,
563
- roles: rest[1] as string[]
564
+ roles: rest[1] as Roles[]
564
565
  };
565
566
  }
566
567
 
@@ -0,0 +1,71 @@
1
+ interface Database {
2
+ _db: any;
3
+ }
4
+ interface Collection {
5
+ _coll: any;
6
+ }
7
+ interface Document {
8
+ _doc: any;
9
+ }
10
+ interface TablesDB {
11
+ _tdb: any;
12
+ }
13
+ interface Table {
14
+ _tbl: any;
15
+ }
16
+ interface Row {
17
+ _row: any;
18
+ }
19
+ interface Bucket {
20
+ _bkt: any;
21
+ }
22
+ interface File {
23
+ _file: any;
24
+ }
25
+ interface Func {
26
+ _fn: any;
27
+ }
28
+ interface Execution {
29
+ _exec: any;
30
+ }
31
+ interface Team {
32
+ _team: any;
33
+ }
34
+ interface Membership {
35
+ _mem: any;
36
+ }
37
+ interface Resolved {
38
+ _res: any;
39
+ }
40
+ type Actionable = Document | Row | File | Execution | Team | Membership;
41
+ export declare class Channel<T> {
42
+ private readonly segments;
43
+ _type: T;
44
+ private constructor();
45
+ private next;
46
+ private resolve;
47
+ toString(): string;
48
+ collection(this: Channel<Database>, id?: string): Channel<Collection>;
49
+ document(this: Channel<Collection>, id?: string): Channel<Document>;
50
+ table(this: Channel<TablesDB>, id?: string): Channel<Table>;
51
+ row(this: Channel<Table>, id?: string): Channel<Row>;
52
+ file(this: Channel<Bucket>, id?: string): Channel<File>;
53
+ execution(this: Channel<Func>, id?: string): Channel<Execution>;
54
+ create(this: Channel<Actionable>): Channel<Resolved>;
55
+ update(this: Channel<Actionable>): Channel<Resolved>;
56
+ delete(this: Channel<Actionable>): Channel<Resolved>;
57
+ static database(id?: string): Channel<Database>;
58
+ static tablesdb(id?: string): Channel<TablesDB>;
59
+ static bucket(id?: string): Channel<Bucket>;
60
+ static function(id?: string): Channel<Func>;
61
+ static team(id?: string): Channel<Team>;
62
+ static membership(id?: string): Channel<Membership>;
63
+ static account(userId?: string): string;
64
+ static get documents(): string;
65
+ static get rows(): string;
66
+ static get files(): string;
67
+ static get executions(): string;
68
+ }
69
+ export type ActionableChannel = Channel<Document> | Channel<Row> | Channel<File> | Channel<Execution> | Channel<Team> | Channel<Membership>;
70
+ export type ResolvedChannel = Channel<Resolved>;
71
+ export {};
@@ -0,0 +1,22 @@
1
+ export declare enum BrowserPermission {
2
+ Geolocation = "geolocation",
3
+ Camera = "camera",
4
+ Microphone = "microphone",
5
+ Notifications = "notifications",
6
+ Midi = "midi",
7
+ Push = "push",
8
+ ClipboardRead = "clipboard-read",
9
+ ClipboardWrite = "clipboard-write",
10
+ PaymentHandler = "payment-handler",
11
+ Usb = "usb",
12
+ Bluetooth = "bluetooth",
13
+ Accelerometer = "accelerometer",
14
+ Gyroscope = "gyroscope",
15
+ Magnetometer = "magnetometer",
16
+ AmbientLightSensor = "ambient-light-sensor",
17
+ BackgroundSync = "background-sync",
18
+ PersistentStorage = "persistent-storage",
19
+ ScreenWakeLock = "screen-wake-lock",
20
+ WebShare = "web-share",
21
+ XrSpatialTracking = "xr-spatial-tracking"
22
+ }
@@ -37,6 +37,5 @@ export declare enum OAuthProvider {
37
37
  Yammer = "yammer",
38
38
  Yandex = "yandex",
39
39
  Zoho = "zoho",
40
- Zoom = "zoom",
41
- Mock = "mock"
40
+ Zoom = "zoom"
42
41
  }
@@ -0,0 +1,5 @@
1
+ export declare enum Roles {
2
+ Admin = "admin",
3
+ Developer = "developer",
4
+ Owner = "owner"
5
+ }
package/types/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export { Query } from './query';
15
15
  export { Permission } from './permission';
16
16
  export { Role } from './role';
17
17
  export { ID } from './id';
18
+ export { Channel } from './channel';
18
19
  export { Operator, Condition } from './operator';
19
20
  export { AuthenticatorType } from './enums/authenticator-type';
20
21
  export { AuthenticationFactor } from './enums/authentication-factor';
@@ -24,9 +25,10 @@ export { CreditCard } from './enums/credit-card';
24
25
  export { Flag } from './enums/flag';
25
26
  export { Theme } from './enums/theme';
26
27
  export { Timezone } from './enums/timezone';
27
- export { Output } from './enums/output';
28
+ export { BrowserPermission } from './enums/browser-permission';
29
+ export { ImageFormat } from './enums/image-format';
28
30
  export { ExecutionMethod } from './enums/execution-method';
29
31
  export { ImageGravity } from './enums/image-gravity';
30
- export { ImageFormat } from './enums/image-format';
32
+ export { Roles } from './enums/roles';
31
33
  export { ExecutionTrigger } from './enums/execution-trigger';
32
34
  export { ExecutionStatus } from './enums/execution-status';
package/types/models.d.ts CHANGED
@@ -863,6 +863,14 @@ export declare namespace Models {
863
863
  * Total number of chunks uploaded
864
864
  */
865
865
  chunksUploaded: number;
866
+ /**
867
+ * Whether file contents are encrypted at rest.
868
+ */
869
+ encryption: boolean;
870
+ /**
871
+ * Compression algorithm used for the file. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd).
872
+ */
873
+ compression: string;
866
874
  };
867
875
  /**
868
876
  * Team
package/types/query.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- type QueryTypesSingle = string | number | boolean;
2
- export type QueryTypesList = string[] | number[] | boolean[] | Query[] | any[];
1
+ type QueryTypesSingle = string | number | bigint | boolean;
2
+ export type QueryTypesList = string[] | number[] | bigint[] | boolean[] | Query[] | any[];
3
3
  export type QueryTypes = QueryTypesSingle | QueryTypesList;
4
4
  type AttributesTypes = string | string[];
5
5
  export declare class Query {
@@ -10,13 +10,35 @@ export declare class Query {
10
10
  toString(): string;
11
11
  static equal: (attribute: string, value: QueryTypes) => string;
12
12
  static notEqual: (attribute: string, value: QueryTypes) => string;
13
+ /**
14
+ * Filter resources where attribute matches a regular expression pattern.
15
+ *
16
+ * @param {string} attribute The attribute to filter on.
17
+ * @param {string} pattern The regular expression pattern to match.
18
+ * @returns {string}
19
+ */
20
+ static regex: (attribute: string, pattern: string) => string;
13
21
  static lessThan: (attribute: string, value: QueryTypes) => string;
14
22
  static lessThanEqual: (attribute: string, value: QueryTypes) => string;
15
23
  static greaterThan: (attribute: string, value: QueryTypes) => string;
16
24
  static greaterThanEqual: (attribute: string, value: QueryTypes) => string;
17
25
  static isNull: (attribute: string) => string;
18
26
  static isNotNull: (attribute: string) => string;
19
- static between: (attribute: string, start: string | number, end: string | number) => string;
27
+ /**
28
+ * Filter resources where the specified attributes exist.
29
+ *
30
+ * @param {string[]} attributes The list of attributes that must exist.
31
+ * @returns {string}
32
+ */
33
+ static exists: (attributes: string[]) => string;
34
+ /**
35
+ * Filter resources where the specified attributes do not exist.
36
+ *
37
+ * @param {string[]} attributes The list of attributes that must not exist.
38
+ * @returns {string}
39
+ */
40
+ static notExists: (attributes: string[]) => string;
41
+ static between: (attribute: string, start: string | number | bigint, end: string | number | bigint) => string;
20
42
  static startsWith: (attribute: string, value: string) => string;
21
43
  static endsWith: (attribute: string, value: string) => string;
22
44
  static select: (attributes: string[]) => string;
@@ -57,11 +79,11 @@ export declare class Query {
57
79
  * Filter resources where attribute is not between start and end (exclusive).
58
80
  *
59
81
  * @param {string} attribute
60
- * @param {string | number} start
61
- * @param {string | number} end
82
+ * @param {string | number | bigint} start
83
+ * @param {string | number | bigint} end
62
84
  * @returns {string}
63
85
  */
64
- static notBetween: (attribute: string, start: string | number, end: string | number) => string;
86
+ static notBetween: (attribute: string, start: string | number | bigint, end: string | number | bigint) => string;
65
87
  /**
66
88
  * Filter resources where attribute does not start with value.
67
89
  *
@@ -124,6 +146,14 @@ export declare class Query {
124
146
  static updatedBetween: (start: string, end: string) => string;
125
147
  static or: (queries: string[]) => string;
126
148
  static and: (queries: string[]) => string;
149
+ /**
150
+ * Filter array elements where at least one element matches all the specified queries.
151
+ *
152
+ * @param {string} attribute The attribute containing the array to filter on.
153
+ * @param {string[]} queries The list of query strings to match against array elements.
154
+ * @returns {string}
155
+ */
156
+ static elemMatch: (attribute: string, queries: string[]) => string;
127
157
  /**
128
158
  * Filter resources where attribute is at a specific distance from the given coordinates.
129
159
  *
@@ -111,10 +111,22 @@ export declare class Account extends Service {
111
111
  /**
112
112
  * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.
113
113
  *
114
+ * @param {number} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
114
115
  * @throws {AppwriteException}
115
116
  * @returns {Promise}
116
117
  */
117
- createJWT(): Promise<Models.Jwt>;
118
+ createJWT(params?: {
119
+ duration?: number;
120
+ }): Promise<Models.Jwt>;
121
+ /**
122
+ * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.
123
+ *
124
+ * @param {number} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
125
+ * @throws {AppwriteException}
126
+ * @returns {Promise<Models.Jwt>}
127
+ * @deprecated Use the object parameter style method for a better developer experience.
128
+ */
129
+ createJWT(duration?: number): Promise<Models.Jwt>;
118
130
  /**
119
131
  * Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.
120
132
  *
@@ -5,7 +5,8 @@ import { CreditCard } from '../enums/credit-card';
5
5
  import { Flag } from '../enums/flag';
6
6
  import { Theme } from '../enums/theme';
7
7
  import { Timezone } from '../enums/timezone';
8
- import { Output } from '../enums/output';
8
+ import { BrowserPermission } from '../enums/browser-permission';
9
+ import { ImageFormat } from '../enums/image-format';
9
10
  export declare class Avatars extends Service {
10
11
  constructor(client: Client);
11
12
  /**
@@ -253,12 +254,12 @@ export declare class Avatars extends Service {
253
254
  * @param {number} params.longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
254
255
  * @param {number} params.accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
255
256
  * @param {boolean} params.touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.
256
- * @param {string[]} params.permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
257
+ * @param {BrowserPermission[]} params.permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
257
258
  * @param {number} params.sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
258
259
  * @param {number} params.width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).
259
260
  * @param {number} params.height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).
260
261
  * @param {number} params.quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
261
- * @param {Output} params.output - Output format type (jpeg, jpg, png, gif and webp).
262
+ * @param {ImageFormat} params.output - Output format type (jpeg, jpg, png, gif and webp).
262
263
  * @throws {AppwriteException}
263
264
  * @returns {ArrayBuffer}
264
265
  */
@@ -277,12 +278,12 @@ export declare class Avatars extends Service {
277
278
  longitude?: number;
278
279
  accuracy?: number;
279
280
  touch?: boolean;
280
- permissions?: string[];
281
+ permissions?: BrowserPermission[];
281
282
  sleep?: number;
282
283
  width?: number;
283
284
  height?: number;
284
285
  quality?: number;
285
- output?: Output;
286
+ output?: ImageFormat;
286
287
  }): Promise<ArrayBuffer>;
287
288
  /**
288
289
  * Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.
@@ -305,17 +306,17 @@ export declare class Avatars extends Service {
305
306
  * @param {number} longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
306
307
  * @param {number} accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
307
308
  * @param {boolean} touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.
308
- * @param {string[]} permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
309
+ * @param {BrowserPermission[]} permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
309
310
  * @param {number} sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
310
311
  * @param {number} width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).
311
312
  * @param {number} height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).
312
313
  * @param {number} quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
313
- * @param {Output} output - Output format type (jpeg, jpg, png, gif and webp).
314
+ * @param {ImageFormat} output - Output format type (jpeg, jpg, png, gif and webp).
314
315
  * @throws {AppwriteException}
315
316
  * @returns {Promise<ArrayBuffer>}
316
317
  * @deprecated Use the object parameter style method for a better developer experience.
317
318
  */
318
- getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output): Promise<ArrayBuffer>;
319
+ getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat): Promise<ArrayBuffer>;
319
320
  /**
320
321
  * You can use this endpoint to show different browser icons to your users.
321
322
  * The code argument receives the browser code as it appears in your user [GET
@@ -471,14 +472,14 @@ export declare class Avatars extends Service {
471
472
  * @param {number} longitude
472
473
  * @param {number} accuracy
473
474
  * @param {boolean} touch
474
- * @param {string[]} permissions
475
+ * @param {BrowserPermission[]} permissions
475
476
  * @param {number} sleep
476
477
  * @param {number} width
477
478
  * @param {number} height
478
479
  * @param {number} quality
479
- * @param {Output} output
480
+ * @param {ImageFormat} output
480
481
  * @throws {AppwriteException}
481
482
  * @returns {URL}
482
483
  */
483
- getScreenshotURL(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output): URL;
484
+ getScreenshotURL(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat): URL;
484
485
  }