react-native-appwrite 0.17.1 → 0.19.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 (54) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cjs/sdk.js +1009 -21
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +1009 -22
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/docs/examples/account/list-identities.md +2 -1
  7. package/docs/examples/account/list-logs.md +2 -1
  8. package/docs/examples/avatars/get-screenshot.md +35 -0
  9. package/docs/examples/databases/create-document.md +1 -1
  10. package/docs/examples/databases/list-documents.md +2 -1
  11. package/docs/examples/databases/update-document.md +1 -1
  12. package/docs/examples/databases/upsert-document.md +1 -1
  13. package/docs/examples/functions/list-executions.md +2 -1
  14. package/docs/examples/storage/create-file.md +1 -1
  15. package/docs/examples/storage/list-files.md +2 -1
  16. package/docs/examples/storage/update-file.md +1 -1
  17. package/docs/examples/tablesdb/create-row.md +1 -1
  18. package/docs/examples/tablesdb/list-rows.md +2 -1
  19. package/docs/examples/tablesdb/update-row.md +1 -1
  20. package/docs/examples/tablesdb/upsert-row.md +1 -1
  21. package/docs/examples/teams/list-memberships.md +2 -1
  22. package/docs/examples/teams/list.md +2 -1
  23. package/package.json +3 -4
  24. package/src/client.ts +1 -1
  25. package/src/enums/execution-status.ts +1 -0
  26. package/src/enums/output.ts +9 -0
  27. package/src/enums/theme.ts +4 -0
  28. package/src/enums/timezone.ts +421 -0
  29. package/src/index.ts +6 -0
  30. package/src/models.ts +1 -1
  31. package/src/operator.ts +308 -0
  32. package/src/query.ts +6 -6
  33. package/src/services/account.ts +34 -16
  34. package/src/services/avatars.ts +347 -0
  35. package/src/services/databases.ts +15 -7
  36. package/src/services/functions.ts +15 -7
  37. package/src/services/storage.ts +15 -7
  38. package/src/services/tables-db.ts +15 -7
  39. package/src/services/teams.ts +30 -14
  40. package/types/enums/execution-status.d.ts +2 -1
  41. package/types/enums/output.d.ts +9 -0
  42. package/types/enums/theme.d.ts +4 -0
  43. package/types/enums/timezone.d.ts +421 -0
  44. package/types/index.d.ts +6 -0
  45. package/types/models.d.ts +1 -1
  46. package/types/operator.d.ts +180 -0
  47. package/types/services/account.d.ts +8 -2
  48. package/types/services/avatars.d.ts +123 -0
  49. package/types/services/databases.d.ts +4 -1
  50. package/types/services/functions.d.ts +4 -1
  51. package/types/services/storage.d.ts +4 -1
  52. package/types/services/tables-db.d.ts +4 -1
  53. package/types/services/teams.d.ts +8 -2
  54. package/.gitpod.yml +0 -10
@@ -8,6 +8,9 @@ import { Platform } from 'react-native';
8
8
  import { Browser } from '../enums/browser';
9
9
  import { CreditCard } from '../enums/credit-card';
10
10
  import { Flag } from '../enums/flag';
11
+ import { Theme } from '../enums/theme';
12
+ import { Timezone } from '../enums/timezone';
13
+ import { Output } from '../enums/output';
11
14
 
12
15
  export class Avatars extends Service {
13
16
 
@@ -560,6 +563,221 @@ export class Avatars extends Service {
560
563
  }, payload, 'arrayBuffer');
561
564
  }
562
565
 
566
+ /**
567
+ * 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.
568
+ *
569
+ * You can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll.
570
+ *
571
+ * When width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px.
572
+ *
573
+ * @param {string} params.url - Website URL which you want to capture.
574
+ * @param {object} params.headers - HTTP headers to send with the browser request. Defaults to empty.
575
+ * @param {number} params.viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.
576
+ * @param {number} params.viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.
577
+ * @param {number} params.scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.
578
+ * @param {Theme} params.theme - Browser theme. Pass "light" or "dark". Defaults to "light".
579
+ * @param {string} params.userAgent - Custom user agent string. Defaults to browser default.
580
+ * @param {boolean} params.fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0.
581
+ * @param {string} params.locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default.
582
+ * @param {Timezone} params.timezone - IANA timezone identifier (e.g., "America/New_York", "Europe/London"). Defaults to browser default.
583
+ * @param {number} params.latitude - Geolocation latitude. Pass a number between -90 to 90. Defaults to 0.
584
+ * @param {number} params.longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
585
+ * @param {number} params.accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
586
+ * @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 {number} params.sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
589
+ * @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
+ * @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
+ * @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
+ * @throws {AppwriteException}
594
+ * @returns {ArrayBuffer}
595
+ */
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
+ /**
598
+ * 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
+ * You can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll.
601
+ *
602
+ * When width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px.
603
+ *
604
+ * @param {string} url - Website URL which you want to capture.
605
+ * @param {object} headers - HTTP headers to send with the browser request. Defaults to empty.
606
+ * @param {number} viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.
607
+ * @param {number} viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.
608
+ * @param {number} scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.
609
+ * @param {Theme} theme - Browser theme. Pass "light" or "dark". Defaults to "light".
610
+ * @param {string} userAgent - Custom user agent string. Defaults to browser default.
611
+ * @param {boolean} fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0.
612
+ * @param {string} locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default.
613
+ * @param {Timezone} timezone - IANA timezone identifier (e.g., "America/New_York", "Europe/London"). Defaults to browser default.
614
+ * @param {number} latitude - Geolocation latitude. Pass a number between -90 to 90. Defaults to 0.
615
+ * @param {number} longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
616
+ * @param {number} accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
617
+ * @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 {number} sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
620
+ * @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
+ * @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
+ * @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
+ * @throws {AppwriteException}
625
+ * @returns {Promise<ArrayBuffer>}
626
+ * @deprecated Use the object parameter style method for a better developer experience.
627
+ */
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(
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)?]
632
+ ): 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
+
635
+ 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
+ } else {
638
+ params = {
639
+ url: paramsOrFirst as string,
640
+ headers: rest[0] as object,
641
+ viewportWidth: rest[1] as number,
642
+ viewportHeight: rest[2] as number,
643
+ scale: rest[3] as number,
644
+ theme: rest[4] as Theme,
645
+ userAgent: rest[5] as string,
646
+ fullpage: rest[6] as boolean,
647
+ locale: rest[7] as string,
648
+ timezone: rest[8] as Timezone,
649
+ latitude: rest[9] as number,
650
+ longitude: rest[10] as number,
651
+ accuracy: rest[11] as number,
652
+ touch: rest[12] as boolean,
653
+ permissions: rest[13] as string[],
654
+ sleep: rest[14] as number,
655
+ width: rest[15] as number,
656
+ height: rest[16] as number,
657
+ quality: rest[17] as number,
658
+ output: rest[18] as Output
659
+ };
660
+ }
661
+
662
+ const url = params.url;
663
+ const headers = params.headers;
664
+ const viewportWidth = params.viewportWidth;
665
+ const viewportHeight = params.viewportHeight;
666
+ const scale = params.scale;
667
+ const theme = params.theme;
668
+ const userAgent = params.userAgent;
669
+ const fullpage = params.fullpage;
670
+ const locale = params.locale;
671
+ const timezone = params.timezone;
672
+ const latitude = params.latitude;
673
+ const longitude = params.longitude;
674
+ const accuracy = params.accuracy;
675
+ const touch = params.touch;
676
+ const permissions = params.permissions;
677
+ const sleep = params.sleep;
678
+ const width = params.width;
679
+ const height = params.height;
680
+ const quality = params.quality;
681
+ const output = params.output;
682
+
683
+ if (typeof url === 'undefined') {
684
+ throw new AppwriteException('Missing required parameter: "url"');
685
+ }
686
+
687
+ const apiPath = '/avatars/screenshots';
688
+ const payload: Payload = {};
689
+
690
+ if (typeof url !== 'undefined') {
691
+ payload['url'] = url;
692
+ }
693
+
694
+ if (typeof headers !== 'undefined') {
695
+ payload['headers'] = headers;
696
+ }
697
+
698
+ if (typeof viewportWidth !== 'undefined') {
699
+ payload['viewportWidth'] = viewportWidth;
700
+ }
701
+
702
+ if (typeof viewportHeight !== 'undefined') {
703
+ payload['viewportHeight'] = viewportHeight;
704
+ }
705
+
706
+ if (typeof scale !== 'undefined') {
707
+ payload['scale'] = scale;
708
+ }
709
+
710
+ if (typeof theme !== 'undefined') {
711
+ payload['theme'] = theme;
712
+ }
713
+
714
+ if (typeof userAgent !== 'undefined') {
715
+ payload['userAgent'] = userAgent;
716
+ }
717
+
718
+ if (typeof fullpage !== 'undefined') {
719
+ payload['fullpage'] = fullpage;
720
+ }
721
+
722
+ if (typeof locale !== 'undefined') {
723
+ payload['locale'] = locale;
724
+ }
725
+
726
+ if (typeof timezone !== 'undefined') {
727
+ payload['timezone'] = timezone;
728
+ }
729
+
730
+ if (typeof latitude !== 'undefined') {
731
+ payload['latitude'] = latitude;
732
+ }
733
+
734
+ if (typeof longitude !== 'undefined') {
735
+ payload['longitude'] = longitude;
736
+ }
737
+
738
+ if (typeof accuracy !== 'undefined') {
739
+ payload['accuracy'] = accuracy;
740
+ }
741
+
742
+ if (typeof touch !== 'undefined') {
743
+ payload['touch'] = touch;
744
+ }
745
+
746
+ if (typeof permissions !== 'undefined') {
747
+ payload['permissions'] = permissions;
748
+ }
749
+
750
+ if (typeof sleep !== 'undefined') {
751
+ payload['sleep'] = sleep;
752
+ }
753
+
754
+ if (typeof width !== 'undefined') {
755
+ payload['width'] = width;
756
+ }
757
+
758
+ if (typeof height !== 'undefined') {
759
+ payload['height'] = height;
760
+ }
761
+
762
+ if (typeof quality !== 'undefined') {
763
+ payload['quality'] = quality;
764
+ }
765
+
766
+ if (typeof output !== 'undefined') {
767
+ payload['output'] = output;
768
+ }
769
+
770
+ const uri = new URL(this.client.config.endpoint + apiPath);
771
+ payload['project'] = this.client.config.project;
772
+
773
+
774
+ for (const [key, value] of Object.entries(Service.flatten(payload))) {
775
+ uri.searchParams.append(key, value);
776
+ }
777
+ return this.client.call('get', uri, {
778
+ }, payload, 'arrayBuffer');
779
+ }
780
+
563
781
  /**
564
782
  * You can use this endpoint to show different browser icons to your users.
565
783
  * The code argument receives the browser code as it appears in your user [GET
@@ -863,4 +1081,133 @@ export class Avatars extends Service {
863
1081
 
864
1082
  return uri;
865
1083
  }
1084
+
1085
+ /**
1086
+ * Use this endpoint to capture a screenshot of any website URL. This endpoint
1087
+ * uses a headless browser to render the webpage and capture it as an image.
1088
+ *
1089
+ * You can configure the browser viewport size, theme, user agent,
1090
+ * geolocation, permissions, and more. Capture either just the viewport or the
1091
+ * full page scroll.
1092
+ *
1093
+ * When width and height are specified, the image is resized accordingly. If
1094
+ * both dimensions are 0, the API provides an image at original size. If
1095
+ * dimensions are not specified, the default viewport size is 1280x720px.
1096
+ *
1097
+ * @param {string} url
1098
+ * @param {object} headers
1099
+ * @param {number} viewportWidth
1100
+ * @param {number} viewportHeight
1101
+ * @param {number} scale
1102
+ * @param {Theme} theme
1103
+ * @param {string} userAgent
1104
+ * @param {boolean} fullpage
1105
+ * @param {string} locale
1106
+ * @param {Timezone} timezone
1107
+ * @param {number} latitude
1108
+ * @param {number} longitude
1109
+ * @param {number} accuracy
1110
+ * @param {boolean} touch
1111
+ * @param {string[]} permissions
1112
+ * @param {number} sleep
1113
+ * @param {number} width
1114
+ * @param {number} height
1115
+ * @param {number} quality
1116
+ * @param {Output} output
1117
+ * @throws {AppwriteException}
1118
+ * @returns {URL}
1119
+ */
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
+ const apiPath = '/avatars/screenshots';
1122
+ const payload: Payload = {};
1123
+
1124
+ if (typeof url !== 'undefined') {
1125
+ payload['url'] = url;
1126
+ }
1127
+
1128
+ if (typeof headers !== 'undefined') {
1129
+ payload['headers'] = headers;
1130
+ }
1131
+
1132
+ if (typeof viewportWidth !== 'undefined') {
1133
+ payload['viewportWidth'] = viewportWidth;
1134
+ }
1135
+
1136
+ if (typeof viewportHeight !== 'undefined') {
1137
+ payload['viewportHeight'] = viewportHeight;
1138
+ }
1139
+
1140
+ if (typeof scale !== 'undefined') {
1141
+ payload['scale'] = scale;
1142
+ }
1143
+
1144
+ if (typeof theme !== 'undefined') {
1145
+ payload['theme'] = theme;
1146
+ }
1147
+
1148
+ if (typeof userAgent !== 'undefined') {
1149
+ payload['userAgent'] = userAgent;
1150
+ }
1151
+
1152
+ if (typeof fullpage !== 'undefined') {
1153
+ payload['fullpage'] = fullpage;
1154
+ }
1155
+
1156
+ if (typeof locale !== 'undefined') {
1157
+ payload['locale'] = locale;
1158
+ }
1159
+
1160
+ if (typeof timezone !== 'undefined') {
1161
+ payload['timezone'] = timezone;
1162
+ }
1163
+
1164
+ if (typeof latitude !== 'undefined') {
1165
+ payload['latitude'] = latitude;
1166
+ }
1167
+
1168
+ if (typeof longitude !== 'undefined') {
1169
+ payload['longitude'] = longitude;
1170
+ }
1171
+
1172
+ if (typeof accuracy !== 'undefined') {
1173
+ payload['accuracy'] = accuracy;
1174
+ }
1175
+
1176
+ if (typeof touch !== 'undefined') {
1177
+ payload['touch'] = touch;
1178
+ }
1179
+
1180
+ if (typeof permissions !== 'undefined') {
1181
+ payload['permissions'] = permissions;
1182
+ }
1183
+
1184
+ if (typeof sleep !== 'undefined') {
1185
+ payload['sleep'] = sleep;
1186
+ }
1187
+
1188
+ if (typeof width !== 'undefined') {
1189
+ payload['width'] = width;
1190
+ }
1191
+
1192
+ if (typeof height !== 'undefined') {
1193
+ payload['height'] = height;
1194
+ }
1195
+
1196
+ if (typeof quality !== 'undefined') {
1197
+ payload['quality'] = quality;
1198
+ }
1199
+
1200
+ if (typeof output !== 'undefined') {
1201
+ payload['output'] = output;
1202
+ }
1203
+
1204
+ const uri = new URL(this.client.config.endpoint + apiPath);
1205
+ payload['project'] = this.client.config.project;
1206
+
1207
+ for (const [key, value] of Object.entries(Service.flatten(payload))) {
1208
+ uri.searchParams.append(key, value);
1209
+ }
1210
+
1211
+ return uri;
1212
+ }
866
1213
  };
@@ -314,11 +314,12 @@ export class Databases extends Service {
314
314
  * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
315
315
  * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
316
316
  * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
317
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
317
318
  * @throws {AppwriteException}
318
319
  * @returns {Promise}
319
320
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.
320
321
  */
321
- listDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }): Promise<Models.DocumentList<Document>>;
322
+ listDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean }): Promise<Models.DocumentList<Document>>;
322
323
  /**
323
324
  * Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
324
325
  *
@@ -326,25 +327,27 @@ export class Databases extends Service {
326
327
  * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
327
328
  * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
328
329
  * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
330
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
329
331
  * @throws {AppwriteException}
330
332
  * @returns {Promise<Models.DocumentList<Document>>}
331
333
  * @deprecated Use the object parameter style method for a better developer experience.
332
334
  */
333
- listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[], transactionId?: string): Promise<Models.DocumentList<Document>>;
335
+ listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean): Promise<Models.DocumentList<Document>>;
334
336
  listDocuments<Document extends Models.Document = Models.DefaultDocument>(
335
- paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string } | string,
336
- ...rest: [(string)?, (string[])?, (string)?]
337
+ paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean } | string,
338
+ ...rest: [(string)?, (string[])?, (string)?, (boolean)?]
337
339
  ): Promise<Models.DocumentList<Document>> {
338
- let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string };
340
+ let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean };
339
341
 
340
342
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
341
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string };
343
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean };
342
344
  } else {
343
345
  params = {
344
346
  databaseId: paramsOrFirst as string,
345
347
  collectionId: rest[0] as string,
346
348
  queries: rest[1] as string[],
347
- transactionId: rest[2] as string
349
+ transactionId: rest[2] as string,
350
+ total: rest[3] as boolean
348
351
  };
349
352
  }
350
353
 
@@ -352,6 +355,7 @@ export class Databases extends Service {
352
355
  const collectionId = params.collectionId;
353
356
  const queries = params.queries;
354
357
  const transactionId = params.transactionId;
358
+ const total = params.total;
355
359
 
356
360
  if (typeof databaseId === 'undefined') {
357
361
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -372,6 +376,10 @@ export class Databases extends Service {
372
376
  payload['transactionId'] = transactionId;
373
377
  }
374
378
 
379
+ if (typeof total !== 'undefined') {
380
+ payload['total'] = total;
381
+ }
382
+
375
383
  const uri = new URL(this.client.config.endpoint + apiPath);
376
384
  return this.client.call('get', uri, {
377
385
  }, payload);
@@ -19,37 +19,41 @@ export class Functions extends Service {
19
19
  *
20
20
  * @param {string} params.functionId - Function ID.
21
21
  * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
22
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
22
23
  * @throws {AppwriteException}
23
24
  * @returns {Promise}
24
25
  */
25
- listExecutions(params: { functionId: string, queries?: string[] }): Promise<Models.ExecutionList>;
26
+ listExecutions(params: { functionId: string, queries?: string[], total?: boolean }): Promise<Models.ExecutionList>;
26
27
  /**
27
28
  * Get a list of all the current user function execution logs. You can use the query params to filter your results.
28
29
  *
29
30
  * @param {string} functionId - Function ID.
30
31
  * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
32
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
31
33
  * @throws {AppwriteException}
32
34
  * @returns {Promise<Models.ExecutionList>}
33
35
  * @deprecated Use the object parameter style method for a better developer experience.
34
36
  */
35
- listExecutions(functionId: string, queries?: string[]): Promise<Models.ExecutionList>;
37
+ listExecutions(functionId: string, queries?: string[], total?: boolean): Promise<Models.ExecutionList>;
36
38
  listExecutions(
37
- paramsOrFirst: { functionId: string, queries?: string[] } | string,
38
- ...rest: [(string[])?]
39
+ paramsOrFirst: { functionId: string, queries?: string[], total?: boolean } | string,
40
+ ...rest: [(string[])?, (boolean)?]
39
41
  ): Promise<Models.ExecutionList> {
40
- let params: { functionId: string, queries?: string[] };
42
+ let params: { functionId: string, queries?: string[], total?: boolean };
41
43
 
42
44
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
43
- params = (paramsOrFirst || {}) as { functionId: string, queries?: string[] };
45
+ params = (paramsOrFirst || {}) as { functionId: string, queries?: string[], total?: boolean };
44
46
  } else {
45
47
  params = {
46
48
  functionId: paramsOrFirst as string,
47
- queries: rest[0] as string[]
49
+ queries: rest[0] as string[],
50
+ total: rest[1] as boolean
48
51
  };
49
52
  }
50
53
 
51
54
  const functionId = params.functionId;
52
55
  const queries = params.queries;
56
+ const total = params.total;
53
57
 
54
58
  if (typeof functionId === 'undefined') {
55
59
  throw new AppwriteException('Missing required parameter: "functionId"');
@@ -62,6 +66,10 @@ export class Functions extends Service {
62
66
  payload['queries'] = queries;
63
67
  }
64
68
 
69
+ if (typeof total !== 'undefined') {
70
+ payload['total'] = total;
71
+ }
72
+
65
73
  const uri = new URL(this.client.config.endpoint + apiPath);
66
74
  return this.client.call('get', uri, {
67
75
  }, payload);
@@ -21,40 +21,44 @@ export class Storage extends Service {
21
21
  * @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).
22
22
  * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
23
23
  * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
24
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
24
25
  * @throws {AppwriteException}
25
26
  * @returns {Promise}
26
27
  */
27
- listFiles(params: { bucketId: string, queries?: string[], search?: string }): Promise<Models.FileList>;
28
+ listFiles(params: { bucketId: string, queries?: string[], search?: string, total?: boolean }): Promise<Models.FileList>;
28
29
  /**
29
30
  * Get a list of all the user files. You can use the query params to filter your results.
30
31
  *
31
32
  * @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).
32
33
  * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
33
34
  * @param {string} search - Search term to filter your list results. Max length: 256 chars.
35
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
34
36
  * @throws {AppwriteException}
35
37
  * @returns {Promise<Models.FileList>}
36
38
  * @deprecated Use the object parameter style method for a better developer experience.
37
39
  */
38
- listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList>;
40
+ listFiles(bucketId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.FileList>;
39
41
  listFiles(
40
- paramsOrFirst: { bucketId: string, queries?: string[], search?: string } | string,
41
- ...rest: [(string[])?, (string)?]
42
+ paramsOrFirst: { bucketId: string, queries?: string[], search?: string, total?: boolean } | string,
43
+ ...rest: [(string[])?, (string)?, (boolean)?]
42
44
  ): Promise<Models.FileList> {
43
- let params: { bucketId: string, queries?: string[], search?: string };
45
+ let params: { bucketId: string, queries?: string[], search?: string, total?: boolean };
44
46
 
45
47
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
46
- params = (paramsOrFirst || {}) as { bucketId: string, queries?: string[], search?: string };
48
+ params = (paramsOrFirst || {}) as { bucketId: string, queries?: string[], search?: string, total?: boolean };
47
49
  } else {
48
50
  params = {
49
51
  bucketId: paramsOrFirst as string,
50
52
  queries: rest[0] as string[],
51
- search: rest[1] as string
53
+ search: rest[1] as string,
54
+ total: rest[2] as boolean
52
55
  };
53
56
  }
54
57
 
55
58
  const bucketId = params.bucketId;
56
59
  const queries = params.queries;
57
60
  const search = params.search;
61
+ const total = params.total;
58
62
 
59
63
  if (typeof bucketId === 'undefined') {
60
64
  throw new AppwriteException('Missing required parameter: "bucketId"');
@@ -71,6 +75,10 @@ export class Storage extends Service {
71
75
  payload['search'] = search;
72
76
  }
73
77
 
78
+ if (typeof total !== 'undefined') {
79
+ payload['total'] = total;
80
+ }
81
+
74
82
  const uri = new URL(this.client.config.endpoint + apiPath);
75
83
  return this.client.call('get', uri, {
76
84
  }, payload);
@@ -314,10 +314,11 @@ export class TablesDB extends Service {
314
314
  * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table).
315
315
  * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
316
316
  * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
317
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
317
318
  * @throws {AppwriteException}
318
319
  * @returns {Promise}
319
320
  */
320
- listRows<Row extends Models.Row = Models.DefaultRow>(params: { databaseId: string, tableId: string, queries?: string[], transactionId?: string }): Promise<Models.RowList<Row>>;
321
+ listRows<Row extends Models.Row = Models.DefaultRow>(params: { databaseId: string, tableId: string, queries?: string[], transactionId?: string, total?: boolean }): Promise<Models.RowList<Row>>;
321
322
  /**
322
323
  * Get a list of all the user's rows in a given table. You can use the query params to filter your results.
323
324
  *
@@ -325,25 +326,27 @@ export class TablesDB extends Service {
325
326
  * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table).
326
327
  * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
327
328
  * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
329
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
328
330
  * @throws {AppwriteException}
329
331
  * @returns {Promise<Models.RowList<Row>>}
330
332
  * @deprecated Use the object parameter style method for a better developer experience.
331
333
  */
332
- listRows<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, queries?: string[], transactionId?: string): Promise<Models.RowList<Row>>;
334
+ listRows<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, queries?: string[], transactionId?: string, total?: boolean): Promise<Models.RowList<Row>>;
333
335
  listRows<Row extends Models.Row = Models.DefaultRow>(
334
- paramsOrFirst: { databaseId: string, tableId: string, queries?: string[], transactionId?: string } | string,
335
- ...rest: [(string)?, (string[])?, (string)?]
336
+ paramsOrFirst: { databaseId: string, tableId: string, queries?: string[], transactionId?: string, total?: boolean } | string,
337
+ ...rest: [(string)?, (string[])?, (string)?, (boolean)?]
336
338
  ): Promise<Models.RowList<Row>> {
337
- let params: { databaseId: string, tableId: string, queries?: string[], transactionId?: string };
339
+ let params: { databaseId: string, tableId: string, queries?: string[], transactionId?: string, total?: boolean };
338
340
 
339
341
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
340
- params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, queries?: string[], transactionId?: string };
342
+ params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, queries?: string[], transactionId?: string, total?: boolean };
341
343
  } else {
342
344
  params = {
343
345
  databaseId: paramsOrFirst as string,
344
346
  tableId: rest[0] as string,
345
347
  queries: rest[1] as string[],
346
- transactionId: rest[2] as string
348
+ transactionId: rest[2] as string,
349
+ total: rest[3] as boolean
347
350
  };
348
351
  }
349
352
 
@@ -351,6 +354,7 @@ export class TablesDB extends Service {
351
354
  const tableId = params.tableId;
352
355
  const queries = params.queries;
353
356
  const transactionId = params.transactionId;
357
+ const total = params.total;
354
358
 
355
359
  if (typeof databaseId === 'undefined') {
356
360
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -371,6 +375,10 @@ export class TablesDB extends Service {
371
375
  payload['transactionId'] = transactionId;
372
376
  }
373
377
 
378
+ if (typeof total !== 'undefined') {
379
+ payload['total'] = total;
380
+ }
381
+
374
382
  const uri = new URL(this.client.config.endpoint + apiPath);
375
383
  return this.client.call('get', uri, {
376
384
  }, payload);