react-native-appwrite 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +84 -3
  2. package/dist/cjs/sdk.js +1741 -1120
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +1741 -1121
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/docs/examples/account/create-email-password-session.md +4 -4
  7. package/docs/examples/account/create-email-token.md +5 -5
  8. package/docs/examples/account/{create-magic-u-r-l-token.md → create-magic-url-token.md} +6 -6
  9. package/docs/examples/account/create-mfa-authenticator.md +3 -3
  10. package/docs/examples/account/create-mfa-challenge.md +3 -3
  11. package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
  12. package/docs/examples/account/{create-o-auth2token.md → create-o-auth-2-session.md} +6 -6
  13. package/docs/examples/account/{create-o-auth2session.md → create-o-auth-2-token.md} +6 -6
  14. package/docs/examples/account/create-phone-token.md +4 -4
  15. package/docs/examples/account/create-push-target.md +5 -5
  16. package/docs/examples/account/create-recovery.md +4 -4
  17. package/docs/examples/account/create-session.md +4 -4
  18. package/docs/examples/account/create-verification.md +3 -3
  19. package/docs/examples/account/create.md +6 -6
  20. package/docs/examples/account/delete-identity.md +3 -3
  21. package/docs/examples/account/delete-mfa-authenticator.md +3 -3
  22. package/docs/examples/account/delete-push-target.md +3 -3
  23. package/docs/examples/account/delete-session.md +3 -3
  24. package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
  25. package/docs/examples/account/get-session.md +3 -3
  26. package/docs/examples/account/list-identities.md +3 -3
  27. package/docs/examples/account/list-logs.md +3 -3
  28. package/docs/examples/account/list-mfa-factors.md +1 -1
  29. package/docs/examples/account/update-email.md +4 -4
  30. package/docs/examples/account/{update-magic-u-r-l-session.md → update-magic-url-session.md} +4 -4
  31. package/docs/examples/account/update-mfa-authenticator.md +4 -4
  32. package/docs/examples/account/update-mfa-challenge.md +4 -4
  33. package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
  34. package/docs/examples/account/{update-m-f-a.md → update-mfa.md} +3 -3
  35. package/docs/examples/account/update-name.md +3 -3
  36. package/docs/examples/account/update-password.md +4 -4
  37. package/docs/examples/account/update-phone-session.md +4 -4
  38. package/docs/examples/account/update-phone-verification.md +4 -4
  39. package/docs/examples/account/update-phone.md +4 -4
  40. package/docs/examples/account/update-prefs.md +3 -3
  41. package/docs/examples/account/update-push-target.md +4 -4
  42. package/docs/examples/account/update-recovery.md +5 -5
  43. package/docs/examples/account/update-session.md +3 -3
  44. package/docs/examples/account/update-verification.md +4 -4
  45. package/docs/examples/avatars/get-browser.md +6 -6
  46. package/docs/examples/avatars/get-credit-card.md +6 -6
  47. package/docs/examples/avatars/get-favicon.md +3 -3
  48. package/docs/examples/avatars/get-flag.md +6 -6
  49. package/docs/examples/avatars/get-image.md +5 -5
  50. package/docs/examples/avatars/get-initials.md +6 -6
  51. package/docs/examples/avatars/{get-q-r.md → get-qr.md} +6 -6
  52. package/docs/examples/databases/create-document.md +7 -7
  53. package/docs/examples/databases/decrement-document-attribute.md +8 -8
  54. package/docs/examples/databases/delete-document.md +5 -5
  55. package/docs/examples/databases/get-document.md +6 -6
  56. package/docs/examples/databases/increment-document-attribute.md +8 -8
  57. package/docs/examples/databases/list-documents.md +5 -5
  58. package/docs/examples/databases/update-document.md +7 -7
  59. package/docs/examples/databases/upsert-document.md +7 -7
  60. package/docs/examples/functions/create-execution.md +9 -9
  61. package/docs/examples/functions/get-execution.md +4 -4
  62. package/docs/examples/functions/list-executions.md +4 -4
  63. package/docs/examples/graphql/mutation.md +3 -3
  64. package/docs/examples/graphql/query.md +3 -3
  65. package/docs/examples/messaging/create-subscriber.md +5 -5
  66. package/docs/examples/messaging/delete-subscriber.md +4 -4
  67. package/docs/examples/storage/create-file.md +6 -6
  68. package/docs/examples/storage/delete-file.md +4 -4
  69. package/docs/examples/storage/get-file-download.md +5 -5
  70. package/docs/examples/storage/get-file-preview.md +16 -16
  71. package/docs/examples/storage/get-file-view.md +5 -5
  72. package/docs/examples/storage/get-file.md +4 -4
  73. package/docs/examples/storage/list-files.md +5 -5
  74. package/docs/examples/storage/update-file.md +6 -6
  75. package/docs/examples/tablesdb/create-row.md +17 -0
  76. package/docs/examples/tablesdb/decrement-row-column.md +18 -0
  77. package/docs/examples/tablesdb/delete-row.md +15 -0
  78. package/docs/examples/tablesdb/get-row.md +16 -0
  79. package/docs/examples/tablesdb/increment-row-column.md +18 -0
  80. package/docs/examples/tablesdb/list-rows.md +15 -0
  81. package/docs/examples/tablesdb/update-row.md +17 -0
  82. package/docs/examples/tablesdb/upsert-row.md +17 -0
  83. package/docs/examples/teams/create-membership.md +9 -9
  84. package/docs/examples/teams/create.md +5 -5
  85. package/docs/examples/teams/delete-membership.md +4 -4
  86. package/docs/examples/teams/delete.md +3 -3
  87. package/docs/examples/teams/get-membership.md +4 -4
  88. package/docs/examples/teams/get-prefs.md +3 -3
  89. package/docs/examples/teams/get.md +3 -3
  90. package/docs/examples/teams/list-memberships.md +5 -5
  91. package/docs/examples/teams/list.md +4 -4
  92. package/docs/examples/teams/update-membership-status.md +6 -6
  93. package/docs/examples/teams/update-membership.md +5 -5
  94. package/docs/examples/teams/update-name.md +4 -4
  95. package/docs/examples/teams/update-prefs.md +4 -4
  96. package/package.json +1 -1
  97. package/src/client.ts +2 -2
  98. package/src/index.ts +1 -0
  99. package/src/models.ts +72 -27
  100. package/src/query.ts +95 -0
  101. package/src/services/account.ts +1469 -315
  102. package/src/services/avatars.ts +289 -80
  103. package/src/services/databases.ts +354 -63
  104. package/src/services/functions.ts +115 -20
  105. package/src/services/graphql.ts +52 -4
  106. package/src/services/locale.ts +8 -19
  107. package/src/services/messaging.ts +66 -7
  108. package/src/services/storage.ts +345 -76
  109. package/src/services/tables-db.ts +621 -0
  110. package/src/services/teams.ts +454 -93
  111. package/types/index.d.ts +1 -0
  112. package/types/models.d.ts +69 -25
  113. package/types/query.d.ts +77 -0
  114. package/types/services/account.d.ts +734 -280
  115. package/types/services/avatars.d.ts +168 -73
  116. package/types/services/databases.d.ts +199 -58
  117. package/types/services/functions.d.ts +62 -17
  118. package/types/services/graphql.d.ts +24 -2
  119. package/types/services/locale.d.ts +8 -19
  120. package/types/services/messaging.d.ts +33 -5
  121. package/types/services/storage.d.ts +201 -68
  122. package/types/services/tables-db.d.ts +245 -0
  123. package/types/services/teams.d.ts +242 -80
  124. /package/docs/examples/account/{create-j-w-t.md → create-jwt.md} +0 -0
  125. /package/docs/examples/locale/{list-countries-e-u.md → list-countries-eu.md} +0 -0
package/types/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export { Graphql } from './services/graphql';
7
7
  export { Locale } from './services/locale';
8
8
  export { Messaging } from './services/messaging';
9
9
  export { Storage } from './services/storage';
10
+ export { TablesDB } from './services/tables-db';
10
11
  export { Teams } from './services/teams';
11
12
  export type { Models, Payload, RealtimeResponseEvent, UploadProgress } from './client';
12
13
  export type { QueryTypes, QueryTypesList } from './query';
package/types/models.d.ts CHANGED
@@ -1,11 +1,24 @@
1
1
  export declare namespace Models {
2
2
  const __default: unique symbol;
3
+ /**
4
+ * Rows List
5
+ */
6
+ export type RowList<Row extends Models.Row = Models.DefaultRow> = {
7
+ /**
8
+ * Total number of rows that matched your query.
9
+ */
10
+ total: number;
11
+ /**
12
+ * List of rows.
13
+ */
14
+ rows: Row[];
15
+ };
3
16
  /**
4
17
  * Documents List
5
18
  */
6
19
  export type DocumentList<Document extends Models.Document = Models.DefaultDocument> = {
7
20
  /**
8
- * Total number of documents documents that matched your query.
21
+ * Total number of documents that matched your query.
9
22
  */
10
23
  total: number;
11
24
  /**
@@ -18,7 +31,7 @@ export declare namespace Models {
18
31
  */
19
32
  export type SessionList = {
20
33
  /**
21
- * Total number of sessions documents that matched your query.
34
+ * Total number of sessions that matched your query.
22
35
  */
23
36
  total: number;
24
37
  /**
@@ -31,7 +44,7 @@ export declare namespace Models {
31
44
  */
32
45
  export type IdentityList = {
33
46
  /**
34
- * Total number of identities documents that matched your query.
47
+ * Total number of identities that matched your query.
35
48
  */
36
49
  total: number;
37
50
  /**
@@ -44,7 +57,7 @@ export declare namespace Models {
44
57
  */
45
58
  export type LogList = {
46
59
  /**
47
- * Total number of logs documents that matched your query.
60
+ * Total number of logs that matched your query.
48
61
  */
49
62
  total: number;
50
63
  /**
@@ -57,7 +70,7 @@ export declare namespace Models {
57
70
  */
58
71
  export type FileList = {
59
72
  /**
60
- * Total number of files documents that matched your query.
73
+ * Total number of files that matched your query.
61
74
  */
62
75
  total: number;
63
76
  /**
@@ -70,7 +83,7 @@ export declare namespace Models {
70
83
  */
71
84
  export type TeamList<Preferences extends Models.Preferences = Models.DefaultPreferences> = {
72
85
  /**
73
- * Total number of teams documents that matched your query.
86
+ * Total number of teams that matched your query.
74
87
  */
75
88
  total: number;
76
89
  /**
@@ -83,7 +96,7 @@ export declare namespace Models {
83
96
  */
84
97
  export type MembershipList = {
85
98
  /**
86
- * Total number of memberships documents that matched your query.
99
+ * Total number of memberships that matched your query.
87
100
  */
88
101
  total: number;
89
102
  /**
@@ -96,7 +109,7 @@ export declare namespace Models {
96
109
  */
97
110
  export type ExecutionList = {
98
111
  /**
99
- * Total number of executions documents that matched your query.
112
+ * Total number of executions that matched your query.
100
113
  */
101
114
  total: number;
102
115
  /**
@@ -109,7 +122,7 @@ export declare namespace Models {
109
122
  */
110
123
  export type CountryList = {
111
124
  /**
112
- * Total number of countries documents that matched your query.
125
+ * Total number of countries that matched your query.
113
126
  */
114
127
  total: number;
115
128
  /**
@@ -122,7 +135,7 @@ export declare namespace Models {
122
135
  */
123
136
  export type ContinentList = {
124
137
  /**
125
- * Total number of continents documents that matched your query.
138
+ * Total number of continents that matched your query.
126
139
  */
127
140
  total: number;
128
141
  /**
@@ -135,7 +148,7 @@ export declare namespace Models {
135
148
  */
136
149
  export type LanguageList = {
137
150
  /**
138
- * Total number of languages documents that matched your query.
151
+ * Total number of languages that matched your query.
139
152
  */
140
153
  total: number;
141
154
  /**
@@ -148,7 +161,7 @@ export declare namespace Models {
148
161
  */
149
162
  export type CurrencyList = {
150
163
  /**
151
- * Total number of currencies documents that matched your query.
164
+ * Total number of currencies that matched your query.
152
165
  */
153
166
  total: number;
154
167
  /**
@@ -161,7 +174,7 @@ export declare namespace Models {
161
174
  */
162
175
  export type PhoneList = {
163
176
  /**
164
- * Total number of phones documents that matched your query.
177
+ * Total number of phones that matched your query.
165
178
  */
166
179
  total: number;
167
180
  /**
@@ -174,7 +187,7 @@ export declare namespace Models {
174
187
  */
175
188
  export type LocaleCodeList = {
176
189
  /**
177
- * Total number of localeCodes documents that matched your query.
190
+ * Total number of localeCodes that matched your query.
178
191
  */
179
192
  total: number;
180
193
  /**
@@ -182,6 +195,43 @@ export declare namespace Models {
182
195
  */
183
196
  localeCodes: LocaleCode[];
184
197
  };
198
+ /**
199
+ * Row
200
+ */
201
+ export type Row = {
202
+ /**
203
+ * Row ID.
204
+ */
205
+ $id: string;
206
+ /**
207
+ * Row automatically incrementing ID.
208
+ */
209
+ $sequence: number;
210
+ /**
211
+ * Table ID.
212
+ */
213
+ $tableId: string;
214
+ /**
215
+ * Database ID.
216
+ */
217
+ $databaseId: string;
218
+ /**
219
+ * Row creation date in ISO 8601 format.
220
+ */
221
+ $createdAt: string;
222
+ /**
223
+ * Row update date in ISO 8601 format.
224
+ */
225
+ $updatedAt: string;
226
+ /**
227
+ * Row permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
228
+ */
229
+ $permissions: string[];
230
+ };
231
+ export type DefaultRow = Row & {
232
+ [key: string]: any;
233
+ [__default]: true;
234
+ };
185
235
  /**
186
236
  * Document
187
237
  */
@@ -219,11 +269,6 @@ export declare namespace Models {
219
269
  [key: string]: any;
220
270
  [__default]: true;
221
271
  };
222
- export type DataWithoutDocumentKeys = {
223
- [K in string]: any;
224
- } & {
225
- [K in keyof Document]?: never;
226
- };
227
272
  /**
228
273
  * Log
229
274
  */
@@ -505,11 +550,6 @@ export declare namespace Models {
505
550
  [key: string]: any;
506
551
  [__default]: true;
507
552
  };
508
- export type DataWithoutPreferencesKeys = {
509
- [K in string]: any;
510
- } & {
511
- [K in keyof Preferences]?: never;
512
- };
513
553
  /**
514
554
  * Session
515
555
  */
@@ -908,7 +948,7 @@ export declare namespace Models {
908
948
  */
909
949
  $createdAt: string;
910
950
  /**
911
- * Execution upate date in ISO 8601 format.
951
+ * Execution update date in ISO 8601 format.
912
952
  */
913
953
  $updatedAt: string;
914
954
  /**
@@ -919,6 +959,10 @@ export declare namespace Models {
919
959
  * Function ID.
920
960
  */
921
961
  functionId: string;
962
+ /**
963
+ * Function&#039;s deployment ID used to create the execution.
964
+ */
965
+ deploymentId: string;
922
966
  /**
923
967
  * The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.
924
968
  */
package/types/query.d.ts CHANGED
@@ -27,7 +27,84 @@ export declare class Query {
27
27
  static cursorBefore: (documentId: string) => string;
28
28
  static limit: (limit: number) => string;
29
29
  static offset: (offset: number) => string;
30
+ /**
31
+ * Filter resources where attribute contains the specified value.
32
+ *
33
+ * @param {string} attribute
34
+ * @param {string | string[]} value
35
+ * @returns {string}
36
+ */
30
37
  static contains: (attribute: string, value: string | string[]) => string;
38
+ /**
39
+ * Filter resources where attribute does not contain the specified value.
40
+ *
41
+ * @param {string} attribute
42
+ * @param {string | string[]} value
43
+ * @returns {string}
44
+ */
45
+ static notContains: (attribute: string, value: string | string[]) => string;
46
+ /**
47
+ * Filter resources by searching attribute for value (inverse of search).
48
+ * A fulltext index on attribute is required for this query to work.
49
+ *
50
+ * @param {string} attribute
51
+ * @param {string} value
52
+ * @returns {string}
53
+ */
54
+ static notSearch: (attribute: string, value: string) => string;
55
+ /**
56
+ * Filter resources where attribute is not between start and end (exclusive).
57
+ *
58
+ * @param {string} attribute
59
+ * @param {string | number} start
60
+ * @param {string | number} end
61
+ * @returns {string}
62
+ */
63
+ static notBetween: (attribute: string, start: string | number, end: string | number) => string;
64
+ /**
65
+ * Filter resources where attribute does not start with value.
66
+ *
67
+ * @param {string} attribute
68
+ * @param {string} value
69
+ * @returns {string}
70
+ */
71
+ static notStartsWith: (attribute: string, value: string) => string;
72
+ /**
73
+ * Filter resources where attribute does not end with value.
74
+ *
75
+ * @param {string} attribute
76
+ * @param {string} value
77
+ * @returns {string}
78
+ */
79
+ static notEndsWith: (attribute: string, value: string) => string;
80
+ /**
81
+ * Filter resources where document was created before date.
82
+ *
83
+ * @param {string} value
84
+ * @returns {string}
85
+ */
86
+ static createdBefore: (value: string) => string;
87
+ /**
88
+ * Filter resources where document was created after date.
89
+ *
90
+ * @param {string} value
91
+ * @returns {string}
92
+ */
93
+ static createdAfter: (value: string) => string;
94
+ /**
95
+ * Filter resources where document was updated before date.
96
+ *
97
+ * @param {string} value
98
+ * @returns {string}
99
+ */
100
+ static updatedBefore: (value: string) => string;
101
+ /**
102
+ * Filter resources where document was updated after date.
103
+ *
104
+ * @param {string} value
105
+ * @returns {string}
106
+ */
107
+ static updatedAfter: (value: string) => string;
31
108
  static or: (queries: string[]) => string;
32
109
  static and: (queries: string[]) => string;
33
110
  }