react-native-appwrite 0.18.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 (161) hide show
  1. package/.github/workflows/publish.yml +9 -8
  2. package/CHANGELOG.md +11 -0
  3. package/LICENSE +1 -1
  4. package/README.md +2 -2
  5. package/dist/cjs/sdk.js +881 -36
  6. package/dist/cjs/sdk.js.map +1 -1
  7. package/dist/esm/sdk.js +877 -37
  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 +37 -0
  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 +7 -4
  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/enums/theme.ts +4 -0
  138. package/src/enums/timezone.ts +421 -0
  139. package/src/index.ts +6 -1
  140. package/src/models.ts +8 -0
  141. package/src/query.ts +54 -9
  142. package/src/services/account.ts +34 -5
  143. package/src/services/avatars.ts +348 -0
  144. package/src/services/databases.ts +5 -9
  145. package/src/services/storage.ts +8 -8
  146. package/src/services/teams.ts +19 -18
  147. package/types/channel.d.ts +71 -0
  148. package/types/enums/browser-permission.d.ts +22 -0
  149. package/types/enums/o-auth-provider.d.ts +1 -2
  150. package/types/enums/roles.d.ts +5 -0
  151. package/types/enums/theme.d.ts +4 -0
  152. package/types/enums/timezone.d.ts +421 -0
  153. package/types/index.d.ts +6 -1
  154. package/types/models.d.ts +8 -0
  155. package/types/query.d.ts +36 -6
  156. package/types/services/account.d.ts +13 -1
  157. package/types/services/avatars.d.ts +124 -0
  158. package/types/services/databases.d.ts +2 -2
  159. package/types/services/storage.d.ts +8 -8
  160. package/types/services/teams.d.ts +9 -8
  161. package/.gitpod.yml +0 -10
@@ -0,0 +1,421 @@
1
+ export enum Timezone {
2
+ AfricaAbidjan = 'africa/abidjan',
3
+ AfricaAccra = 'africa/accra',
4
+ AfricaAddisAbaba = 'africa/addis_ababa',
5
+ AfricaAlgiers = 'africa/algiers',
6
+ AfricaAsmara = 'africa/asmara',
7
+ AfricaBamako = 'africa/bamako',
8
+ AfricaBangui = 'africa/bangui',
9
+ AfricaBanjul = 'africa/banjul',
10
+ AfricaBissau = 'africa/bissau',
11
+ AfricaBlantyre = 'africa/blantyre',
12
+ AfricaBrazzaville = 'africa/brazzaville',
13
+ AfricaBujumbura = 'africa/bujumbura',
14
+ AfricaCairo = 'africa/cairo',
15
+ AfricaCasablanca = 'africa/casablanca',
16
+ AfricaCeuta = 'africa/ceuta',
17
+ AfricaConakry = 'africa/conakry',
18
+ AfricaDakar = 'africa/dakar',
19
+ AfricaDarEsSalaam = 'africa/dar_es_salaam',
20
+ AfricaDjibouti = 'africa/djibouti',
21
+ AfricaDouala = 'africa/douala',
22
+ AfricaElAaiun = 'africa/el_aaiun',
23
+ AfricaFreetown = 'africa/freetown',
24
+ AfricaGaborone = 'africa/gaborone',
25
+ AfricaHarare = 'africa/harare',
26
+ AfricaJohannesburg = 'africa/johannesburg',
27
+ AfricaJuba = 'africa/juba',
28
+ AfricaKampala = 'africa/kampala',
29
+ AfricaKhartoum = 'africa/khartoum',
30
+ AfricaKigali = 'africa/kigali',
31
+ AfricaKinshasa = 'africa/kinshasa',
32
+ AfricaLagos = 'africa/lagos',
33
+ AfricaLibreville = 'africa/libreville',
34
+ AfricaLome = 'africa/lome',
35
+ AfricaLuanda = 'africa/luanda',
36
+ AfricaLubumbashi = 'africa/lubumbashi',
37
+ AfricaLusaka = 'africa/lusaka',
38
+ AfricaMalabo = 'africa/malabo',
39
+ AfricaMaputo = 'africa/maputo',
40
+ AfricaMaseru = 'africa/maseru',
41
+ AfricaMbabane = 'africa/mbabane',
42
+ AfricaMogadishu = 'africa/mogadishu',
43
+ AfricaMonrovia = 'africa/monrovia',
44
+ AfricaNairobi = 'africa/nairobi',
45
+ AfricaNdjamena = 'africa/ndjamena',
46
+ AfricaNiamey = 'africa/niamey',
47
+ AfricaNouakchott = 'africa/nouakchott',
48
+ AfricaOuagadougou = 'africa/ouagadougou',
49
+ AfricaPortoNovo = 'africa/porto-novo',
50
+ AfricaSaoTome = 'africa/sao_tome',
51
+ AfricaTripoli = 'africa/tripoli',
52
+ AfricaTunis = 'africa/tunis',
53
+ AfricaWindhoek = 'africa/windhoek',
54
+ AmericaAdak = 'america/adak',
55
+ AmericaAnchorage = 'america/anchorage',
56
+ AmericaAnguilla = 'america/anguilla',
57
+ AmericaAntigua = 'america/antigua',
58
+ AmericaAraguaina = 'america/araguaina',
59
+ AmericaArgentinaBuenosAires = 'america/argentina/buenos_aires',
60
+ AmericaArgentinaCatamarca = 'america/argentina/catamarca',
61
+ AmericaArgentinaCordoba = 'america/argentina/cordoba',
62
+ AmericaArgentinaJujuy = 'america/argentina/jujuy',
63
+ AmericaArgentinaLaRioja = 'america/argentina/la_rioja',
64
+ AmericaArgentinaMendoza = 'america/argentina/mendoza',
65
+ AmericaArgentinaRioGallegos = 'america/argentina/rio_gallegos',
66
+ AmericaArgentinaSalta = 'america/argentina/salta',
67
+ AmericaArgentinaSanJuan = 'america/argentina/san_juan',
68
+ AmericaArgentinaSanLuis = 'america/argentina/san_luis',
69
+ AmericaArgentinaTucuman = 'america/argentina/tucuman',
70
+ AmericaArgentinaUshuaia = 'america/argentina/ushuaia',
71
+ AmericaAruba = 'america/aruba',
72
+ AmericaAsuncion = 'america/asuncion',
73
+ AmericaAtikokan = 'america/atikokan',
74
+ AmericaBahia = 'america/bahia',
75
+ AmericaBahiaBanderas = 'america/bahia_banderas',
76
+ AmericaBarbados = 'america/barbados',
77
+ AmericaBelem = 'america/belem',
78
+ AmericaBelize = 'america/belize',
79
+ AmericaBlancSablon = 'america/blanc-sablon',
80
+ AmericaBoaVista = 'america/boa_vista',
81
+ AmericaBogota = 'america/bogota',
82
+ AmericaBoise = 'america/boise',
83
+ AmericaCambridgeBay = 'america/cambridge_bay',
84
+ AmericaCampoGrande = 'america/campo_grande',
85
+ AmericaCancun = 'america/cancun',
86
+ AmericaCaracas = 'america/caracas',
87
+ AmericaCayenne = 'america/cayenne',
88
+ AmericaCayman = 'america/cayman',
89
+ AmericaChicago = 'america/chicago',
90
+ AmericaChihuahua = 'america/chihuahua',
91
+ AmericaCiudadJuarez = 'america/ciudad_juarez',
92
+ AmericaCostaRica = 'america/costa_rica',
93
+ AmericaCoyhaique = 'america/coyhaique',
94
+ AmericaCreston = 'america/creston',
95
+ AmericaCuiaba = 'america/cuiaba',
96
+ AmericaCuracao = 'america/curacao',
97
+ AmericaDanmarkshavn = 'america/danmarkshavn',
98
+ AmericaDawson = 'america/dawson',
99
+ AmericaDawsonCreek = 'america/dawson_creek',
100
+ AmericaDenver = 'america/denver',
101
+ AmericaDetroit = 'america/detroit',
102
+ AmericaDominica = 'america/dominica',
103
+ AmericaEdmonton = 'america/edmonton',
104
+ AmericaEirunepe = 'america/eirunepe',
105
+ AmericaElSalvador = 'america/el_salvador',
106
+ AmericaFortNelson = 'america/fort_nelson',
107
+ AmericaFortaleza = 'america/fortaleza',
108
+ AmericaGlaceBay = 'america/glace_bay',
109
+ AmericaGooseBay = 'america/goose_bay',
110
+ AmericaGrandTurk = 'america/grand_turk',
111
+ AmericaGrenada = 'america/grenada',
112
+ AmericaGuadeloupe = 'america/guadeloupe',
113
+ AmericaGuatemala = 'america/guatemala',
114
+ AmericaGuayaquil = 'america/guayaquil',
115
+ AmericaGuyana = 'america/guyana',
116
+ AmericaHalifax = 'america/halifax',
117
+ AmericaHavana = 'america/havana',
118
+ AmericaHermosillo = 'america/hermosillo',
119
+ AmericaIndianaIndianapolis = 'america/indiana/indianapolis',
120
+ AmericaIndianaKnox = 'america/indiana/knox',
121
+ AmericaIndianaMarengo = 'america/indiana/marengo',
122
+ AmericaIndianaPetersburg = 'america/indiana/petersburg',
123
+ AmericaIndianaTellCity = 'america/indiana/tell_city',
124
+ AmericaIndianaVevay = 'america/indiana/vevay',
125
+ AmericaIndianaVincennes = 'america/indiana/vincennes',
126
+ AmericaIndianaWinamac = 'america/indiana/winamac',
127
+ AmericaInuvik = 'america/inuvik',
128
+ AmericaIqaluit = 'america/iqaluit',
129
+ AmericaJamaica = 'america/jamaica',
130
+ AmericaJuneau = 'america/juneau',
131
+ AmericaKentuckyLouisville = 'america/kentucky/louisville',
132
+ AmericaKentuckyMonticello = 'america/kentucky/monticello',
133
+ AmericaKralendijk = 'america/kralendijk',
134
+ AmericaLaPaz = 'america/la_paz',
135
+ AmericaLima = 'america/lima',
136
+ AmericaLosAngeles = 'america/los_angeles',
137
+ AmericaLowerPrinces = 'america/lower_princes',
138
+ AmericaMaceio = 'america/maceio',
139
+ AmericaManagua = 'america/managua',
140
+ AmericaManaus = 'america/manaus',
141
+ AmericaMarigot = 'america/marigot',
142
+ AmericaMartinique = 'america/martinique',
143
+ AmericaMatamoros = 'america/matamoros',
144
+ AmericaMazatlan = 'america/mazatlan',
145
+ AmericaMenominee = 'america/menominee',
146
+ AmericaMerida = 'america/merida',
147
+ AmericaMetlakatla = 'america/metlakatla',
148
+ AmericaMexicoCity = 'america/mexico_city',
149
+ AmericaMiquelon = 'america/miquelon',
150
+ AmericaMoncton = 'america/moncton',
151
+ AmericaMonterrey = 'america/monterrey',
152
+ AmericaMontevideo = 'america/montevideo',
153
+ AmericaMontserrat = 'america/montserrat',
154
+ AmericaNassau = 'america/nassau',
155
+ AmericaNewYork = 'america/new_york',
156
+ AmericaNome = 'america/nome',
157
+ AmericaNoronha = 'america/noronha',
158
+ AmericaNorthDakotaBeulah = 'america/north_dakota/beulah',
159
+ AmericaNorthDakotaCenter = 'america/north_dakota/center',
160
+ AmericaNorthDakotaNewSalem = 'america/north_dakota/new_salem',
161
+ AmericaNuuk = 'america/nuuk',
162
+ AmericaOjinaga = 'america/ojinaga',
163
+ AmericaPanama = 'america/panama',
164
+ AmericaParamaribo = 'america/paramaribo',
165
+ AmericaPhoenix = 'america/phoenix',
166
+ AmericaPortAuPrince = 'america/port-au-prince',
167
+ AmericaPortOfSpain = 'america/port_of_spain',
168
+ AmericaPortoVelho = 'america/porto_velho',
169
+ AmericaPuertoRico = 'america/puerto_rico',
170
+ AmericaPuntaArenas = 'america/punta_arenas',
171
+ AmericaRankinInlet = 'america/rankin_inlet',
172
+ AmericaRecife = 'america/recife',
173
+ AmericaRegina = 'america/regina',
174
+ AmericaResolute = 'america/resolute',
175
+ AmericaRioBranco = 'america/rio_branco',
176
+ AmericaSantarem = 'america/santarem',
177
+ AmericaSantiago = 'america/santiago',
178
+ AmericaSantoDomingo = 'america/santo_domingo',
179
+ AmericaSaoPaulo = 'america/sao_paulo',
180
+ AmericaScoresbysund = 'america/scoresbysund',
181
+ AmericaSitka = 'america/sitka',
182
+ AmericaStBarthelemy = 'america/st_barthelemy',
183
+ AmericaStJohns = 'america/st_johns',
184
+ AmericaStKitts = 'america/st_kitts',
185
+ AmericaStLucia = 'america/st_lucia',
186
+ AmericaStThomas = 'america/st_thomas',
187
+ AmericaStVincent = 'america/st_vincent',
188
+ AmericaSwiftCurrent = 'america/swift_current',
189
+ AmericaTegucigalpa = 'america/tegucigalpa',
190
+ AmericaThule = 'america/thule',
191
+ AmericaTijuana = 'america/tijuana',
192
+ AmericaToronto = 'america/toronto',
193
+ AmericaTortola = 'america/tortola',
194
+ AmericaVancouver = 'america/vancouver',
195
+ AmericaWhitehorse = 'america/whitehorse',
196
+ AmericaWinnipeg = 'america/winnipeg',
197
+ AmericaYakutat = 'america/yakutat',
198
+ AntarcticaCasey = 'antarctica/casey',
199
+ AntarcticaDavis = 'antarctica/davis',
200
+ AntarcticaDumontdurville = 'antarctica/dumontdurville',
201
+ AntarcticaMacquarie = 'antarctica/macquarie',
202
+ AntarcticaMawson = 'antarctica/mawson',
203
+ AntarcticaMcmurdo = 'antarctica/mcmurdo',
204
+ AntarcticaPalmer = 'antarctica/palmer',
205
+ AntarcticaRothera = 'antarctica/rothera',
206
+ AntarcticaSyowa = 'antarctica/syowa',
207
+ AntarcticaTroll = 'antarctica/troll',
208
+ AntarcticaVostok = 'antarctica/vostok',
209
+ ArcticLongyearbyen = 'arctic/longyearbyen',
210
+ AsiaAden = 'asia/aden',
211
+ AsiaAlmaty = 'asia/almaty',
212
+ AsiaAmman = 'asia/amman',
213
+ AsiaAnadyr = 'asia/anadyr',
214
+ AsiaAqtau = 'asia/aqtau',
215
+ AsiaAqtobe = 'asia/aqtobe',
216
+ AsiaAshgabat = 'asia/ashgabat',
217
+ AsiaAtyrau = 'asia/atyrau',
218
+ AsiaBaghdad = 'asia/baghdad',
219
+ AsiaBahrain = 'asia/bahrain',
220
+ AsiaBaku = 'asia/baku',
221
+ AsiaBangkok = 'asia/bangkok',
222
+ AsiaBarnaul = 'asia/barnaul',
223
+ AsiaBeirut = 'asia/beirut',
224
+ AsiaBishkek = 'asia/bishkek',
225
+ AsiaBrunei = 'asia/brunei',
226
+ AsiaChita = 'asia/chita',
227
+ AsiaColombo = 'asia/colombo',
228
+ AsiaDamascus = 'asia/damascus',
229
+ AsiaDhaka = 'asia/dhaka',
230
+ AsiaDili = 'asia/dili',
231
+ AsiaDubai = 'asia/dubai',
232
+ AsiaDushanbe = 'asia/dushanbe',
233
+ AsiaFamagusta = 'asia/famagusta',
234
+ AsiaGaza = 'asia/gaza',
235
+ AsiaHebron = 'asia/hebron',
236
+ AsiaHoChiMinh = 'asia/ho_chi_minh',
237
+ AsiaHongKong = 'asia/hong_kong',
238
+ AsiaHovd = 'asia/hovd',
239
+ AsiaIrkutsk = 'asia/irkutsk',
240
+ AsiaJakarta = 'asia/jakarta',
241
+ AsiaJayapura = 'asia/jayapura',
242
+ AsiaJerusalem = 'asia/jerusalem',
243
+ AsiaKabul = 'asia/kabul',
244
+ AsiaKamchatka = 'asia/kamchatka',
245
+ AsiaKarachi = 'asia/karachi',
246
+ AsiaKathmandu = 'asia/kathmandu',
247
+ AsiaKhandyga = 'asia/khandyga',
248
+ AsiaKolkata = 'asia/kolkata',
249
+ AsiaKrasnoyarsk = 'asia/krasnoyarsk',
250
+ AsiaKualaLumpur = 'asia/kuala_lumpur',
251
+ AsiaKuching = 'asia/kuching',
252
+ AsiaKuwait = 'asia/kuwait',
253
+ AsiaMacau = 'asia/macau',
254
+ AsiaMagadan = 'asia/magadan',
255
+ AsiaMakassar = 'asia/makassar',
256
+ AsiaManila = 'asia/manila',
257
+ AsiaMuscat = 'asia/muscat',
258
+ AsiaNicosia = 'asia/nicosia',
259
+ AsiaNovokuznetsk = 'asia/novokuznetsk',
260
+ AsiaNovosibirsk = 'asia/novosibirsk',
261
+ AsiaOmsk = 'asia/omsk',
262
+ AsiaOral = 'asia/oral',
263
+ AsiaPhnomPenh = 'asia/phnom_penh',
264
+ AsiaPontianak = 'asia/pontianak',
265
+ AsiaPyongyang = 'asia/pyongyang',
266
+ AsiaQatar = 'asia/qatar',
267
+ AsiaQostanay = 'asia/qostanay',
268
+ AsiaQyzylorda = 'asia/qyzylorda',
269
+ AsiaRiyadh = 'asia/riyadh',
270
+ AsiaSakhalin = 'asia/sakhalin',
271
+ AsiaSamarkand = 'asia/samarkand',
272
+ AsiaSeoul = 'asia/seoul',
273
+ AsiaShanghai = 'asia/shanghai',
274
+ AsiaSingapore = 'asia/singapore',
275
+ AsiaSrednekolymsk = 'asia/srednekolymsk',
276
+ AsiaTaipei = 'asia/taipei',
277
+ AsiaTashkent = 'asia/tashkent',
278
+ AsiaTbilisi = 'asia/tbilisi',
279
+ AsiaTehran = 'asia/tehran',
280
+ AsiaThimphu = 'asia/thimphu',
281
+ AsiaTokyo = 'asia/tokyo',
282
+ AsiaTomsk = 'asia/tomsk',
283
+ AsiaUlaanbaatar = 'asia/ulaanbaatar',
284
+ AsiaUrumqi = 'asia/urumqi',
285
+ AsiaUstNera = 'asia/ust-nera',
286
+ AsiaVientiane = 'asia/vientiane',
287
+ AsiaVladivostok = 'asia/vladivostok',
288
+ AsiaYakutsk = 'asia/yakutsk',
289
+ AsiaYangon = 'asia/yangon',
290
+ AsiaYekaterinburg = 'asia/yekaterinburg',
291
+ AsiaYerevan = 'asia/yerevan',
292
+ AtlanticAzores = 'atlantic/azores',
293
+ AtlanticBermuda = 'atlantic/bermuda',
294
+ AtlanticCanary = 'atlantic/canary',
295
+ AtlanticCapeVerde = 'atlantic/cape_verde',
296
+ AtlanticFaroe = 'atlantic/faroe',
297
+ AtlanticMadeira = 'atlantic/madeira',
298
+ AtlanticReykjavik = 'atlantic/reykjavik',
299
+ AtlanticSouthGeorgia = 'atlantic/south_georgia',
300
+ AtlanticStHelena = 'atlantic/st_helena',
301
+ AtlanticStanley = 'atlantic/stanley',
302
+ AustraliaAdelaide = 'australia/adelaide',
303
+ AustraliaBrisbane = 'australia/brisbane',
304
+ AustraliaBrokenHill = 'australia/broken_hill',
305
+ AustraliaDarwin = 'australia/darwin',
306
+ AustraliaEucla = 'australia/eucla',
307
+ AustraliaHobart = 'australia/hobart',
308
+ AustraliaLindeman = 'australia/lindeman',
309
+ AustraliaLordHowe = 'australia/lord_howe',
310
+ AustraliaMelbourne = 'australia/melbourne',
311
+ AustraliaPerth = 'australia/perth',
312
+ AustraliaSydney = 'australia/sydney',
313
+ EuropeAmsterdam = 'europe/amsterdam',
314
+ EuropeAndorra = 'europe/andorra',
315
+ EuropeAstrakhan = 'europe/astrakhan',
316
+ EuropeAthens = 'europe/athens',
317
+ EuropeBelgrade = 'europe/belgrade',
318
+ EuropeBerlin = 'europe/berlin',
319
+ EuropeBratislava = 'europe/bratislava',
320
+ EuropeBrussels = 'europe/brussels',
321
+ EuropeBucharest = 'europe/bucharest',
322
+ EuropeBudapest = 'europe/budapest',
323
+ EuropeBusingen = 'europe/busingen',
324
+ EuropeChisinau = 'europe/chisinau',
325
+ EuropeCopenhagen = 'europe/copenhagen',
326
+ EuropeDublin = 'europe/dublin',
327
+ EuropeGibraltar = 'europe/gibraltar',
328
+ EuropeGuernsey = 'europe/guernsey',
329
+ EuropeHelsinki = 'europe/helsinki',
330
+ EuropeIsleOfMan = 'europe/isle_of_man',
331
+ EuropeIstanbul = 'europe/istanbul',
332
+ EuropeJersey = 'europe/jersey',
333
+ EuropeKaliningrad = 'europe/kaliningrad',
334
+ EuropeKirov = 'europe/kirov',
335
+ EuropeKyiv = 'europe/kyiv',
336
+ EuropeLisbon = 'europe/lisbon',
337
+ EuropeLjubljana = 'europe/ljubljana',
338
+ EuropeLondon = 'europe/london',
339
+ EuropeLuxembourg = 'europe/luxembourg',
340
+ EuropeMadrid = 'europe/madrid',
341
+ EuropeMalta = 'europe/malta',
342
+ EuropeMariehamn = 'europe/mariehamn',
343
+ EuropeMinsk = 'europe/minsk',
344
+ EuropeMonaco = 'europe/monaco',
345
+ EuropeMoscow = 'europe/moscow',
346
+ EuropeOslo = 'europe/oslo',
347
+ EuropeParis = 'europe/paris',
348
+ EuropePodgorica = 'europe/podgorica',
349
+ EuropePrague = 'europe/prague',
350
+ EuropeRiga = 'europe/riga',
351
+ EuropeRome = 'europe/rome',
352
+ EuropeSamara = 'europe/samara',
353
+ EuropeSanMarino = 'europe/san_marino',
354
+ EuropeSarajevo = 'europe/sarajevo',
355
+ EuropeSaratov = 'europe/saratov',
356
+ EuropeSimferopol = 'europe/simferopol',
357
+ EuropeSkopje = 'europe/skopje',
358
+ EuropeSofia = 'europe/sofia',
359
+ EuropeStockholm = 'europe/stockholm',
360
+ EuropeTallinn = 'europe/tallinn',
361
+ EuropeTirane = 'europe/tirane',
362
+ EuropeUlyanovsk = 'europe/ulyanovsk',
363
+ EuropeVaduz = 'europe/vaduz',
364
+ EuropeVatican = 'europe/vatican',
365
+ EuropeVienna = 'europe/vienna',
366
+ EuropeVilnius = 'europe/vilnius',
367
+ EuropeVolgograd = 'europe/volgograd',
368
+ EuropeWarsaw = 'europe/warsaw',
369
+ EuropeZagreb = 'europe/zagreb',
370
+ EuropeZurich = 'europe/zurich',
371
+ IndianAntananarivo = 'indian/antananarivo',
372
+ IndianChagos = 'indian/chagos',
373
+ IndianChristmas = 'indian/christmas',
374
+ IndianCocos = 'indian/cocos',
375
+ IndianComoro = 'indian/comoro',
376
+ IndianKerguelen = 'indian/kerguelen',
377
+ IndianMahe = 'indian/mahe',
378
+ IndianMaldives = 'indian/maldives',
379
+ IndianMauritius = 'indian/mauritius',
380
+ IndianMayotte = 'indian/mayotte',
381
+ IndianReunion = 'indian/reunion',
382
+ PacificApia = 'pacific/apia',
383
+ PacificAuckland = 'pacific/auckland',
384
+ PacificBougainville = 'pacific/bougainville',
385
+ PacificChatham = 'pacific/chatham',
386
+ PacificChuuk = 'pacific/chuuk',
387
+ PacificEaster = 'pacific/easter',
388
+ PacificEfate = 'pacific/efate',
389
+ PacificFakaofo = 'pacific/fakaofo',
390
+ PacificFiji = 'pacific/fiji',
391
+ PacificFunafuti = 'pacific/funafuti',
392
+ PacificGalapagos = 'pacific/galapagos',
393
+ PacificGambier = 'pacific/gambier',
394
+ PacificGuadalcanal = 'pacific/guadalcanal',
395
+ PacificGuam = 'pacific/guam',
396
+ PacificHonolulu = 'pacific/honolulu',
397
+ PacificKanton = 'pacific/kanton',
398
+ PacificKiritimati = 'pacific/kiritimati',
399
+ PacificKosrae = 'pacific/kosrae',
400
+ PacificKwajalein = 'pacific/kwajalein',
401
+ PacificMajuro = 'pacific/majuro',
402
+ PacificMarquesas = 'pacific/marquesas',
403
+ PacificMidway = 'pacific/midway',
404
+ PacificNauru = 'pacific/nauru',
405
+ PacificNiue = 'pacific/niue',
406
+ PacificNorfolk = 'pacific/norfolk',
407
+ PacificNoumea = 'pacific/noumea',
408
+ PacificPagoPago = 'pacific/pago_pago',
409
+ PacificPalau = 'pacific/palau',
410
+ PacificPitcairn = 'pacific/pitcairn',
411
+ PacificPohnpei = 'pacific/pohnpei',
412
+ PacificPortMoresby = 'pacific/port_moresby',
413
+ PacificRarotonga = 'pacific/rarotonga',
414
+ PacificSaipan = 'pacific/saipan',
415
+ PacificTahiti = 'pacific/tahiti',
416
+ PacificTarawa = 'pacific/tarawa',
417
+ PacificTongatapu = 'pacific/tongatapu',
418
+ PacificWake = 'pacific/wake',
419
+ PacificWallis = 'pacific/wallis',
420
+ Utc = 'utc',
421
+ }
package/src/index.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';
@@ -22,8 +23,12 @@ export { OAuthProvider } from './enums/o-auth-provider';
22
23
  export { Browser } from './enums/browser';
23
24
  export { CreditCard } from './enums/credit-card';
24
25
  export { Flag } from './enums/flag';
26
+ export { Theme } from './enums/theme';
27
+ export { Timezone } from './enums/timezone';
28
+ export { BrowserPermission } from './enums/browser-permission';
29
+ export { ImageFormat } from './enums/image-format';
25
30
  export { ExecutionMethod } from './enums/execution-method';
26
31
  export { ImageGravity } from './enums/image-gravity';
27
- export { ImageFormat } from './enums/image-format';
32
+ export { Roles } from './enums/roles';
28
33
  export { ExecutionTrigger } from './enums/execution-trigger';
29
34
  export { ExecutionStatus } from './enums/execution-status';
package/src/models.ts CHANGED
@@ -904,6 +904,14 @@ export namespace Models {
904
904
  * Total number of chunks uploaded
905
905
  */
906
906
  chunksUploaded: number;
907
+ /**
908
+ * Whether file contents are encrypted at rest.
909
+ */
910
+ encryption: boolean;
911
+ /**
912
+ * 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).
913
+ */
914
+ compression: string;
907
915
  }
908
916
 
909
917
  /**
package/src/query.ts CHANGED
@@ -1,5 +1,8 @@
1
- type QueryTypesSingle = string | number | boolean;
2
- export type QueryTypesList = string[] | number[] | boolean[] | Query[] | any[];
1
+ import JSONbigModule from 'json-bigint';
2
+ const JSONbig = JSONbigModule({ useNativeBigInt: true });
3
+
4
+ type QueryTypesSingle = string | number | bigint | boolean;
5
+ export type QueryTypesList = string[] | number[] | bigint[] | boolean[] | Query[] | any[];
3
6
  export type QueryTypes = QueryTypesSingle | QueryTypesList;
4
7
  type AttributesTypes = string | string[];
5
8
 
@@ -26,7 +29,7 @@ export class Query {
26
29
  }
27
30
 
28
31
  toString(): string {
29
- return JSON.stringify({
32
+ return JSONbig.stringify({
30
33
  method: this.method,
31
34
  attribute: this.attribute,
32
35
  values: this.values,
@@ -39,6 +42,16 @@ export class Query {
39
42
  static notEqual = (attribute: string, value: QueryTypes): string =>
40
43
  new Query("notEqual", attribute, value).toString();
41
44
 
45
+ /**
46
+ * Filter resources where attribute matches a regular expression pattern.
47
+ *
48
+ * @param {string} attribute The attribute to filter on.
49
+ * @param {string} pattern The regular expression pattern to match.
50
+ * @returns {string}
51
+ */
52
+ static regex = (attribute: string, pattern: string): string =>
53
+ new Query("regex", attribute, pattern).toString();
54
+
42
55
  static lessThan = (attribute: string, value: QueryTypes): string =>
43
56
  new Query("lessThan", attribute, value).toString();
44
57
 
@@ -57,7 +70,25 @@ export class Query {
57
70
  static isNotNull = (attribute: string): string =>
58
71
  new Query("isNotNull", attribute).toString();
59
72
 
60
- static between = (attribute: string, start: string | number, end: string | number) =>
73
+ /**
74
+ * Filter resources where the specified attributes exist.
75
+ *
76
+ * @param {string[]} attributes The list of attributes that must exist.
77
+ * @returns {string}
78
+ */
79
+ static exists = (attributes: string[]): string =>
80
+ new Query("exists", undefined, attributes).toString();
81
+
82
+ /**
83
+ * Filter resources where the specified attributes do not exist.
84
+ *
85
+ * @param {string[]} attributes The list of attributes that must not exist.
86
+ * @returns {string}
87
+ */
88
+ static notExists = (attributes: string[]): string =>
89
+ new Query("notExists", undefined, attributes).toString();
90
+
91
+ static between = (attribute: string, start: string | number | bigint, end: string | number | bigint) =>
61
92
  new Query("between", attribute, [start, end] as QueryTypesList).toString();
62
93
 
63
94
  static startsWith = (attribute: string, value: string): string =>
@@ -128,11 +159,11 @@ export class Query {
128
159
  * Filter resources where attribute is not between start and end (exclusive).
129
160
  *
130
161
  * @param {string} attribute
131
- * @param {string | number} start
132
- * @param {string | number} end
162
+ * @param {string | number | bigint} start
163
+ * @param {string | number | bigint} end
133
164
  * @returns {string}
134
165
  */
135
- static notBetween = (attribute: string, start: string | number, end: string | number): string =>
166
+ static notBetween = (attribute: string, start: string | number | bigint, end: string | number | bigint): string =>
136
167
  new Query("notBetween", attribute, [start, end] as QueryTypesList).toString();
137
168
 
138
169
  /**
@@ -212,10 +243,24 @@ export class Query {
212
243
  Query.between("$updatedAt", start, end);
213
244
 
214
245
  static or = (queries: string[]) =>
215
- new Query("or", undefined, queries.map((query) => JSON.parse(query))).toString();
246
+ new Query("or", undefined, queries.map((query) => JSONbig.parse(query))).toString();
216
247
 
217
248
  static and = (queries: string[]) =>
218
- new Query("and", undefined, queries.map((query) => JSON.parse(query))).toString();
249
+ new Query("and", undefined, queries.map((query) => JSONbig.parse(query))).toString();
250
+
251
+ /**
252
+ * Filter array elements where at least one element matches all the specified queries.
253
+ *
254
+ * @param {string} attribute The attribute containing the array to filter on.
255
+ * @param {string[]} queries The list of query strings to match against array elements.
256
+ * @returns {string}
257
+ */
258
+ static elemMatch = (attribute: string, queries: string[]): string =>
259
+ new Query(
260
+ "elemMatch",
261
+ attribute,
262
+ queries.map((query) => JSONbig.parse(query))
263
+ ).toString();
219
264
 
220
265
  /**
221
266
  * Filter resources where attribute is at a specific distance from the given coordinates.
@@ -280,13 +280,42 @@ export class Account extends Service {
280
280
  /**
281
281
  * 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.
282
282
  *
283
+ * @param {number} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
283
284
  * @throws {AppwriteException}
284
285
  * @returns {Promise}
285
286
  */
286
- createJWT(): Promise<Models.Jwt> {
287
+ createJWT(params?: { duration?: number }): Promise<Models.Jwt>;
288
+ /**
289
+ * 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.
290
+ *
291
+ * @param {number} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
292
+ * @throws {AppwriteException}
293
+ * @returns {Promise<Models.Jwt>}
294
+ * @deprecated Use the object parameter style method for a better developer experience.
295
+ */
296
+ createJWT(duration?: number): Promise<Models.Jwt>;
297
+ createJWT(
298
+ paramsOrFirst?: { duration?: number } | number
299
+ ): Promise<Models.Jwt> {
300
+ let params: { duration?: number };
301
+
302
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
303
+ params = (paramsOrFirst || {}) as { duration?: number };
304
+ } else {
305
+ params = {
306
+ duration: paramsOrFirst as number
307
+ };
308
+ }
309
+
310
+ const duration = params.duration;
311
+
287
312
  const apiPath = '/account/jwts';
288
313
  const payload: Payload = {};
289
314
 
315
+ if (typeof duration !== 'undefined') {
316
+ payload['duration'] = duration;
317
+ }
318
+
290
319
  const uri = new URL(this.client.config.endpoint + apiPath);
291
320
  return this.client.call('post', uri, {
292
321
  'content-type': 'application/json',
@@ -731,7 +760,7 @@ export class Account extends Service {
731
760
  throw new AppwriteException('Missing required parameter: "factor"');
732
761
  }
733
762
 
734
- const apiPath = '/account/mfa/challenge';
763
+ const apiPath = '/account/mfa/challenges';
735
764
  const payload: Payload = {};
736
765
 
737
766
  if (typeof factor !== 'undefined') {
@@ -780,7 +809,7 @@ export class Account extends Service {
780
809
  throw new AppwriteException('Missing required parameter: "factor"');
781
810
  }
782
811
 
783
- const apiPath = '/account/mfa/challenge';
812
+ const apiPath = '/account/mfa/challenges';
784
813
  const payload: Payload = {};
785
814
 
786
815
  if (typeof factor !== 'undefined') {
@@ -839,7 +868,7 @@ export class Account extends Service {
839
868
  throw new AppwriteException('Missing required parameter: "otp"');
840
869
  }
841
870
 
842
- const apiPath = '/account/mfa/challenge';
871
+ const apiPath = '/account/mfa/challenges';
843
872
  const payload: Payload = {};
844
873
 
845
874
  if (typeof challengeId !== 'undefined') {
@@ -901,7 +930,7 @@ export class Account extends Service {
901
930
  throw new AppwriteException('Missing required parameter: "otp"');
902
931
  }
903
932
 
904
- const apiPath = '/account/mfa/challenge';
933
+ const apiPath = '/account/mfa/challenges';
905
934
  const payload: Payload = {};
906
935
 
907
936
  if (typeof challengeId !== 'undefined') {