node-appwrite 12.0.1 → 12.1.0-rc.4

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 (298) hide show
  1. package/.travis.yml +18 -8
  2. package/README.md +1 -1
  3. package/dist/client.d.mts +131 -0
  4. package/dist/client.d.ts +131 -0
  5. package/dist/client.js +302 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/client.mjs +295 -0
  8. package/dist/client.mjs.map +1 -0
  9. package/dist/enums/authentication-factor.d.mts +8 -0
  10. package/dist/enums/authentication-factor.d.ts +8 -0
  11. package/dist/enums/authentication-factor.js +13 -0
  12. package/dist/enums/authentication-factor.js.map +1 -0
  13. package/dist/enums/authentication-factor.mjs +11 -0
  14. package/dist/enums/authentication-factor.mjs.map +1 -0
  15. package/dist/enums/authenticator-type.d.mts +5 -0
  16. package/dist/enums/authenticator-type.d.ts +5 -0
  17. package/dist/enums/authenticator-type.js +10 -0
  18. package/dist/enums/authenticator-type.js.map +1 -0
  19. package/dist/enums/authenticator-type.mjs +8 -0
  20. package/dist/enums/authenticator-type.mjs.map +1 -0
  21. package/dist/enums/browser.d.mts +18 -0
  22. package/dist/enums/browser.d.ts +18 -0
  23. package/dist/enums/browser.js +23 -0
  24. package/dist/enums/browser.js.map +1 -0
  25. package/dist/enums/browser.mjs +21 -0
  26. package/dist/enums/browser.mjs.map +1 -0
  27. package/dist/enums/compression.d.mts +7 -0
  28. package/dist/enums/compression.d.ts +7 -0
  29. package/dist/enums/compression.js +12 -0
  30. package/dist/enums/compression.js.map +1 -0
  31. package/dist/enums/compression.mjs +10 -0
  32. package/dist/enums/compression.mjs.map +1 -0
  33. package/dist/enums/credit-card.d.mts +20 -0
  34. package/dist/enums/credit-card.d.ts +20 -0
  35. package/dist/enums/credit-card.js +25 -0
  36. package/dist/enums/credit-card.js.map +1 -0
  37. package/dist/enums/credit-card.mjs +23 -0
  38. package/dist/enums/credit-card.mjs.map +1 -0
  39. package/dist/enums/execution-method.d.mts +10 -0
  40. package/dist/enums/execution-method.d.ts +10 -0
  41. package/dist/enums/execution-method.js +15 -0
  42. package/dist/enums/execution-method.js.map +1 -0
  43. package/dist/enums/execution-method.mjs +13 -0
  44. package/dist/enums/execution-method.mjs.map +1 -0
  45. package/dist/enums/flag.d.mts +198 -0
  46. package/dist/enums/flag.d.ts +198 -0
  47. package/dist/enums/flag.js +203 -0
  48. package/dist/enums/flag.js.map +1 -0
  49. package/dist/enums/flag.mjs +201 -0
  50. package/dist/enums/flag.mjs.map +1 -0
  51. package/dist/enums/image-format.d.mts +9 -0
  52. package/dist/enums/image-format.d.ts +9 -0
  53. package/dist/enums/image-format.js +14 -0
  54. package/dist/enums/image-format.js.map +1 -0
  55. package/dist/enums/image-format.mjs +12 -0
  56. package/dist/enums/image-format.mjs.map +1 -0
  57. package/dist/enums/image-gravity.d.mts +13 -0
  58. package/dist/enums/image-gravity.d.ts +13 -0
  59. package/dist/enums/image-gravity.js +18 -0
  60. package/dist/enums/image-gravity.js.map +1 -0
  61. package/dist/enums/image-gravity.mjs +16 -0
  62. package/dist/enums/image-gravity.mjs.map +1 -0
  63. package/dist/enums/index-type.d.mts +7 -0
  64. package/dist/enums/index-type.d.ts +7 -0
  65. package/dist/enums/index-type.js +12 -0
  66. package/dist/enums/index-type.js.map +1 -0
  67. package/dist/enums/index-type.mjs +10 -0
  68. package/dist/enums/index-type.mjs.map +1 -0
  69. package/dist/enums/messaging-provider-type.d.mts +7 -0
  70. package/dist/enums/messaging-provider-type.d.ts +7 -0
  71. package/dist/enums/messaging-provider-type.js +12 -0
  72. package/dist/enums/messaging-provider-type.js.map +1 -0
  73. package/dist/enums/messaging-provider-type.mjs +10 -0
  74. package/dist/enums/messaging-provider-type.mjs.map +1 -0
  75. package/dist/enums/name.d.mts +17 -0
  76. package/dist/enums/name.d.ts +17 -0
  77. package/dist/enums/name.js +22 -0
  78. package/dist/enums/name.js.map +1 -0
  79. package/dist/enums/name.mjs +20 -0
  80. package/dist/enums/name.mjs.map +1 -0
  81. package/dist/enums/o-auth-provider.d.mts +43 -0
  82. package/dist/enums/o-auth-provider.d.ts +43 -0
  83. package/dist/enums/o-auth-provider.js +48 -0
  84. package/dist/enums/o-auth-provider.js.map +1 -0
  85. package/dist/enums/o-auth-provider.mjs +46 -0
  86. package/dist/enums/o-auth-provider.mjs.map +1 -0
  87. package/dist/enums/password-hash.d.mts +15 -0
  88. package/dist/enums/password-hash.d.ts +15 -0
  89. package/dist/enums/password-hash.js +20 -0
  90. package/dist/enums/password-hash.js.map +1 -0
  91. package/dist/enums/password-hash.mjs +18 -0
  92. package/dist/enums/password-hash.mjs.map +1 -0
  93. package/dist/enums/relation-mutate.d.mts +7 -0
  94. package/dist/enums/relation-mutate.d.ts +7 -0
  95. package/dist/enums/relation-mutate.js +12 -0
  96. package/dist/enums/relation-mutate.js.map +1 -0
  97. package/dist/enums/relation-mutate.mjs +10 -0
  98. package/dist/enums/relation-mutate.mjs.map +1 -0
  99. package/dist/enums/relationship-type.d.mts +8 -0
  100. package/dist/enums/relationship-type.d.ts +8 -0
  101. package/dist/enums/relationship-type.js +13 -0
  102. package/dist/enums/relationship-type.js.map +1 -0
  103. package/dist/enums/relationship-type.mjs +11 -0
  104. package/dist/enums/relationship-type.mjs.map +1 -0
  105. package/dist/enums/runtime.d.mts +48 -0
  106. package/dist/enums/runtime.d.ts +48 -0
  107. package/dist/enums/runtime.js +53 -0
  108. package/dist/enums/runtime.js.map +1 -0
  109. package/dist/enums/runtime.mjs +51 -0
  110. package/dist/enums/runtime.mjs.map +1 -0
  111. package/dist/enums/smtp-encryption.d.mts +7 -0
  112. package/dist/enums/smtp-encryption.d.ts +7 -0
  113. package/dist/enums/smtp-encryption.js +12 -0
  114. package/dist/enums/smtp-encryption.js.map +1 -0
  115. package/dist/enums/smtp-encryption.mjs +10 -0
  116. package/dist/enums/smtp-encryption.mjs.map +1 -0
  117. package/dist/id.d.mts +7 -0
  118. package/dist/id.d.ts +7 -0
  119. package/dist/id.js +29 -0
  120. package/dist/id.js.map +1 -0
  121. package/dist/id.mjs +27 -0
  122. package/dist/id.mjs.map +1 -0
  123. package/dist/index.d.mts +35 -0
  124. package/dist/index.d.ts +35 -0
  125. package/dist/index.js +180 -0
  126. package/dist/index.js.map +1 -0
  127. package/dist/index.mjs +35 -0
  128. package/dist/index.mjs.map +1 -0
  129. package/dist/inputFile.d.mts +9 -0
  130. package/dist/inputFile.d.ts +9 -0
  131. package/dist/inputFile.js +23 -0
  132. package/dist/inputFile.js.map +1 -0
  133. package/dist/inputFile.mjs +21 -0
  134. package/dist/inputFile.mjs.map +1 -0
  135. package/dist/models.d.mts +2406 -0
  136. package/dist/models.d.ts +2406 -0
  137. package/dist/models.js +4 -0
  138. package/dist/models.js.map +1 -0
  139. package/dist/models.mjs +3 -0
  140. package/dist/models.mjs.map +1 -0
  141. package/dist/permission.d.mts +9 -0
  142. package/dist/permission.d.ts +9 -0
  143. package/dist/permission.js +23 -0
  144. package/dist/permission.js.map +1 -0
  145. package/dist/permission.mjs +21 -0
  146. package/dist/permission.mjs.map +1 -0
  147. package/dist/query.d.mts +35 -0
  148. package/dist/query.d.ts +35 -0
  149. package/dist/query.js +49 -0
  150. package/dist/query.js.map +1 -0
  151. package/dist/query.mjs +47 -0
  152. package/dist/query.mjs.map +1 -0
  153. package/dist/role.d.mts +72 -0
  154. package/dist/role.d.ts +72 -0
  155. package/dist/role.js +96 -0
  156. package/dist/role.js.map +1 -0
  157. package/dist/role.mjs +94 -0
  158. package/dist/role.mjs.map +1 -0
  159. package/dist/services/account.d.mts +478 -0
  160. package/dist/services/account.d.ts +478 -0
  161. package/dist/services/account.js +1331 -0
  162. package/dist/services/account.js.map +1 -0
  163. package/dist/services/account.mjs +1329 -0
  164. package/dist/services/account.mjs.map +1 -0
  165. package/dist/services/avatars.d.mts +118 -0
  166. package/dist/services/avatars.d.ts +118 -0
  167. package/dist/services/avatars.js +297 -0
  168. package/dist/services/avatars.js.map +1 -0
  169. package/dist/services/avatars.mjs +295 -0
  170. package/dist/services/avatars.mjs.map +1 -0
  171. package/dist/services/databases.d.mts +606 -0
  172. package/dist/services/databases.d.ts +606 -0
  173. package/dist/services/databases.js +1908 -0
  174. package/dist/services/databases.js.map +1 -0
  175. package/dist/services/databases.mjs +1906 -0
  176. package/dist/services/databases.mjs.map +1 -0
  177. package/dist/services/functions.d.mts +287 -0
  178. package/dist/services/functions.d.ts +287 -0
  179. package/dist/services/functions.js +837 -0
  180. package/dist/services/functions.js.map +1 -0
  181. package/dist/services/functions.mjs +835 -0
  182. package/dist/services/functions.mjs.map +1 -0
  183. package/dist/services/graphql.d.mts +30 -0
  184. package/dist/services/graphql.d.ts +30 -0
  185. package/dist/services/graphql.js +73 -0
  186. package/dist/services/graphql.js.map +1 -0
  187. package/dist/services/graphql.mjs +71 -0
  188. package/dist/services/graphql.mjs.map +1 -0
  189. package/dist/services/health.d.mts +235 -0
  190. package/dist/services/health.d.ts +235 -0
  191. package/dist/services/health.js +584 -0
  192. package/dist/services/health.js.map +1 -0
  193. package/dist/services/health.mjs +582 -0
  194. package/dist/services/health.mjs.map +1 -0
  195. package/dist/services/locale.d.mts +84 -0
  196. package/dist/services/locale.d.ts +84 -0
  197. package/dist/services/locale.js +189 -0
  198. package/dist/services/locale.js.map +1 -0
  199. package/dist/services/locale.mjs +187 -0
  200. package/dist/services/locale.mjs.map +1 -0
  201. package/dist/services/messaging.d.mts +688 -0
  202. package/dist/services/messaging.d.ts +688 -0
  203. package/dist/services/messaging.js +2152 -0
  204. package/dist/services/messaging.js.map +1 -0
  205. package/dist/services/messaging.mjs +2150 -0
  206. package/dist/services/messaging.mjs.map +1 -0
  207. package/dist/services/storage.d.mts +193 -0
  208. package/dist/services/storage.d.ts +193 -0
  209. package/dist/services/storage.js +550 -0
  210. package/dist/services/storage.js.map +1 -0
  211. package/dist/services/storage.mjs +548 -0
  212. package/dist/services/storage.mjs.map +1 -0
  213. package/dist/services/teams.d.mts +171 -0
  214. package/dist/services/teams.d.ts +171 -0
  215. package/dist/services/teams.js +466 -0
  216. package/dist/services/teams.js.map +1 -0
  217. package/dist/services/teams.mjs +464 -0
  218. package/dist/services/teams.mjs.map +1 -0
  219. package/dist/services/users.d.mts +490 -0
  220. package/dist/services/users.d.ts +490 -0
  221. package/dist/services/users.js +1464 -0
  222. package/dist/services/users.js.map +1 -0
  223. package/dist/services/users.mjs +1462 -0
  224. package/dist/services/users.mjs.map +1 -0
  225. package/docs/examples/functions/create-deployment.md +1 -1
  226. package/docs/examples/messaging/create-msg91provider.md +1 -1
  227. package/docs/examples/messaging/update-msg91provider.md +2 -2
  228. package/docs/examples/storage/create-file.md +1 -1
  229. package/package.json +35 -5
  230. package/src/client.ts +366 -0
  231. package/src/enums/authentication-factor.ts +6 -0
  232. package/src/enums/authenticator-type.ts +3 -0
  233. package/src/enums/browser.ts +16 -0
  234. package/src/enums/compression.ts +5 -0
  235. package/src/enums/credit-card.ts +18 -0
  236. package/src/enums/execution-method.ts +8 -0
  237. package/src/enums/flag.ts +196 -0
  238. package/src/enums/image-format.ts +7 -0
  239. package/src/enums/image-gravity.ts +11 -0
  240. package/src/enums/index-type.ts +5 -0
  241. package/src/enums/messaging-provider-type.ts +5 -0
  242. package/src/enums/name.ts +15 -0
  243. package/src/enums/o-auth-provider.ts +41 -0
  244. package/src/enums/password-hash.ts +13 -0
  245. package/src/enums/relation-mutate.ts +5 -0
  246. package/src/enums/relationship-type.ts +6 -0
  247. package/src/enums/runtime.ts +46 -0
  248. package/src/enums/smtp-encryption.ts +5 -0
  249. package/{lib/id.js → src/id.ts} +8 -12
  250. package/src/index.ts +35 -0
  251. package/src/inputFile.ts +23 -0
  252. package/src/models.ts +2404 -0
  253. package/src/permission.ts +22 -0
  254. package/src/query.ts +101 -0
  255. package/{lib/role.js → src/role.ts} +23 -25
  256. package/src/services/account.ts +1418 -0
  257. package/src/services/avatars.ts +312 -0
  258. package/{lib/services/databases.js → src/services/databases.ts} +644 -638
  259. package/{lib/services/functions.js → src/services/functions.ts} +317 -369
  260. package/{lib/services/graphql.js → src/services/graphql.ts} +35 -34
  261. package/src/services/health.ts +629 -0
  262. package/src/services/locale.ts +205 -0
  263. package/{lib/services/messaging.js → src/services/messaging.ts} +666 -641
  264. package/{lib/services/storage.js → src/services/storage.ts} +211 -298
  265. package/{lib/services/teams.js → src/services/teams.ts} +211 -200
  266. package/{lib/services/users.js → src/services/users.ts} +603 -519
  267. package/tsconfig.json +18 -0
  268. package/tsup.config.js +19 -0
  269. package/index.d.ts +0 -6656
  270. package/index.js +0 -75
  271. package/lib/client.js +0 -245
  272. package/lib/enums/authentication-factor.js +0 -8
  273. package/lib/enums/authenticator-type.js +0 -5
  274. package/lib/enums/browser.js +0 -18
  275. package/lib/enums/compression.js +0 -7
  276. package/lib/enums/credit-card.js +0 -20
  277. package/lib/enums/execution-method.js +0 -10
  278. package/lib/enums/flag.js +0 -198
  279. package/lib/enums/image-format.js +0 -9
  280. package/lib/enums/image-gravity.js +0 -13
  281. package/lib/enums/index-type.js +0 -7
  282. package/lib/enums/messaging-provider-type.js +0 -7
  283. package/lib/enums/name.js +0 -17
  284. package/lib/enums/o-auth-provider.js +0 -43
  285. package/lib/enums/password-hash.js +0 -15
  286. package/lib/enums/relation-mutate.js +0 -7
  287. package/lib/enums/relationship-type.js +0 -8
  288. package/lib/enums/runtime.js +0 -48
  289. package/lib/enums/smtp-encryption.js +0 -7
  290. package/lib/exception.js +0 -10
  291. package/lib/inputFile.js +0 -117
  292. package/lib/permission.js +0 -24
  293. package/lib/query.js +0 -90
  294. package/lib/service.js +0 -10
  295. package/lib/services/account.js +0 -1365
  296. package/lib/services/avatars.js +0 -325
  297. package/lib/services/health.js +0 -513
  298. package/lib/services/locale.js +0 -169
@@ -0,0 +1,84 @@
1
+ import { Client } from '../client.mjs';
2
+ import { Models } from '../models.mjs';
3
+ import '../query.mjs';
4
+
5
+ declare class Locale {
6
+ client: Client;
7
+ constructor(client: Client);
8
+ /**
9
+ * Get user locale
10
+ *
11
+ * Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
12
+
13
+ ([IP Geolocation by DB-IP](https://db-ip.com))
14
+ *
15
+ * @throws {AppwriteException}
16
+ * @returns {Promise<Models.Locale>}
17
+ */
18
+ get(): Promise<Models.Locale>;
19
+ /**
20
+ * List Locale Codes
21
+ *
22
+ * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
23
+ *
24
+ * @throws {AppwriteException}
25
+ * @returns {Promise<Models.LocaleCodeList>}
26
+ */
27
+ listCodes(): Promise<Models.LocaleCodeList>;
28
+ /**
29
+ * List continents
30
+ *
31
+ * List of all continents. You can use the locale header to get the data in a supported language.
32
+ *
33
+ * @throws {AppwriteException}
34
+ * @returns {Promise<Models.ContinentList>}
35
+ */
36
+ listContinents(): Promise<Models.ContinentList>;
37
+ /**
38
+ * List countries
39
+ *
40
+ * List of all countries. You can use the locale header to get the data in a supported language.
41
+ *
42
+ * @throws {AppwriteException}
43
+ * @returns {Promise<Models.CountryList>}
44
+ */
45
+ listCountries(): Promise<Models.CountryList>;
46
+ /**
47
+ * List EU countries
48
+ *
49
+ * List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
50
+ *
51
+ * @throws {AppwriteException}
52
+ * @returns {Promise<Models.CountryList>}
53
+ */
54
+ listCountriesEU(): Promise<Models.CountryList>;
55
+ /**
56
+ * List countries phone codes
57
+ *
58
+ * List of all countries phone codes. You can use the locale header to get the data in a supported language.
59
+ *
60
+ * @throws {AppwriteException}
61
+ * @returns {Promise<Models.PhoneList>}
62
+ */
63
+ listCountriesPhones(): Promise<Models.PhoneList>;
64
+ /**
65
+ * List currencies
66
+ *
67
+ * List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
68
+ *
69
+ * @throws {AppwriteException}
70
+ * @returns {Promise<Models.CurrencyList>}
71
+ */
72
+ listCurrencies(): Promise<Models.CurrencyList>;
73
+ /**
74
+ * List languages
75
+ *
76
+ * List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
77
+ *
78
+ * @throws {AppwriteException}
79
+ * @returns {Promise<Models.LanguageList>}
80
+ */
81
+ listLanguages(): Promise<Models.LanguageList>;
82
+ }
83
+
84
+ export { Locale };
@@ -0,0 +1,84 @@
1
+ import { Client } from '../client.js';
2
+ import { Models } from '../models.js';
3
+ import '../query.js';
4
+
5
+ declare class Locale {
6
+ client: Client;
7
+ constructor(client: Client);
8
+ /**
9
+ * Get user locale
10
+ *
11
+ * Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
12
+
13
+ ([IP Geolocation by DB-IP](https://db-ip.com))
14
+ *
15
+ * @throws {AppwriteException}
16
+ * @returns {Promise<Models.Locale>}
17
+ */
18
+ get(): Promise<Models.Locale>;
19
+ /**
20
+ * List Locale Codes
21
+ *
22
+ * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
23
+ *
24
+ * @throws {AppwriteException}
25
+ * @returns {Promise<Models.LocaleCodeList>}
26
+ */
27
+ listCodes(): Promise<Models.LocaleCodeList>;
28
+ /**
29
+ * List continents
30
+ *
31
+ * List of all continents. You can use the locale header to get the data in a supported language.
32
+ *
33
+ * @throws {AppwriteException}
34
+ * @returns {Promise<Models.ContinentList>}
35
+ */
36
+ listContinents(): Promise<Models.ContinentList>;
37
+ /**
38
+ * List countries
39
+ *
40
+ * List of all countries. You can use the locale header to get the data in a supported language.
41
+ *
42
+ * @throws {AppwriteException}
43
+ * @returns {Promise<Models.CountryList>}
44
+ */
45
+ listCountries(): Promise<Models.CountryList>;
46
+ /**
47
+ * List EU countries
48
+ *
49
+ * List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
50
+ *
51
+ * @throws {AppwriteException}
52
+ * @returns {Promise<Models.CountryList>}
53
+ */
54
+ listCountriesEU(): Promise<Models.CountryList>;
55
+ /**
56
+ * List countries phone codes
57
+ *
58
+ * List of all countries phone codes. You can use the locale header to get the data in a supported language.
59
+ *
60
+ * @throws {AppwriteException}
61
+ * @returns {Promise<Models.PhoneList>}
62
+ */
63
+ listCountriesPhones(): Promise<Models.PhoneList>;
64
+ /**
65
+ * List currencies
66
+ *
67
+ * List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
68
+ *
69
+ * @throws {AppwriteException}
70
+ * @returns {Promise<Models.CurrencyList>}
71
+ */
72
+ listCurrencies(): Promise<Models.CurrencyList>;
73
+ /**
74
+ * List languages
75
+ *
76
+ * List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
77
+ *
78
+ * @throws {AppwriteException}
79
+ * @returns {Promise<Models.LanguageList>}
80
+ */
81
+ listLanguages(): Promise<Models.LanguageList>;
82
+ }
83
+
84
+ export { Locale };
@@ -0,0 +1,189 @@
1
+ 'use strict';
2
+
3
+ class Locale {
4
+ constructor(client) {
5
+ this.client = client;
6
+ }
7
+ /**
8
+ * Get user locale
9
+ *
10
+ * Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
11
+
12
+ ([IP Geolocation by DB-IP](https://db-ip.com))
13
+ *
14
+ * @throws {AppwriteException}
15
+ * @returns {Promise<Models.Locale>}
16
+ */
17
+ async get() {
18
+ const apiPath = "/locale";
19
+ const payload = {};
20
+ const uri = new URL(this.client.config.endpoint + apiPath);
21
+ const apiHeaders = {
22
+ "content-type": "application/json"
23
+ };
24
+ return await this.client.call(
25
+ "get",
26
+ uri,
27
+ apiHeaders,
28
+ payload
29
+ );
30
+ }
31
+ /**
32
+ * List Locale Codes
33
+ *
34
+ * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
35
+ *
36
+ * @throws {AppwriteException}
37
+ * @returns {Promise<Models.LocaleCodeList>}
38
+ */
39
+ async listCodes() {
40
+ const apiPath = "/locale/codes";
41
+ const payload = {};
42
+ const uri = new URL(this.client.config.endpoint + apiPath);
43
+ const apiHeaders = {
44
+ "content-type": "application/json"
45
+ };
46
+ return await this.client.call(
47
+ "get",
48
+ uri,
49
+ apiHeaders,
50
+ payload
51
+ );
52
+ }
53
+ /**
54
+ * List continents
55
+ *
56
+ * List of all continents. You can use the locale header to get the data in a supported language.
57
+ *
58
+ * @throws {AppwriteException}
59
+ * @returns {Promise<Models.ContinentList>}
60
+ */
61
+ async listContinents() {
62
+ const apiPath = "/locale/continents";
63
+ const payload = {};
64
+ const uri = new URL(this.client.config.endpoint + apiPath);
65
+ const apiHeaders = {
66
+ "content-type": "application/json"
67
+ };
68
+ return await this.client.call(
69
+ "get",
70
+ uri,
71
+ apiHeaders,
72
+ payload
73
+ );
74
+ }
75
+ /**
76
+ * List countries
77
+ *
78
+ * List of all countries. You can use the locale header to get the data in a supported language.
79
+ *
80
+ * @throws {AppwriteException}
81
+ * @returns {Promise<Models.CountryList>}
82
+ */
83
+ async listCountries() {
84
+ const apiPath = "/locale/countries";
85
+ const payload = {};
86
+ const uri = new URL(this.client.config.endpoint + apiPath);
87
+ const apiHeaders = {
88
+ "content-type": "application/json"
89
+ };
90
+ return await this.client.call(
91
+ "get",
92
+ uri,
93
+ apiHeaders,
94
+ payload
95
+ );
96
+ }
97
+ /**
98
+ * List EU countries
99
+ *
100
+ * List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
101
+ *
102
+ * @throws {AppwriteException}
103
+ * @returns {Promise<Models.CountryList>}
104
+ */
105
+ async listCountriesEU() {
106
+ const apiPath = "/locale/countries/eu";
107
+ const payload = {};
108
+ const uri = new URL(this.client.config.endpoint + apiPath);
109
+ const apiHeaders = {
110
+ "content-type": "application/json"
111
+ };
112
+ return await this.client.call(
113
+ "get",
114
+ uri,
115
+ apiHeaders,
116
+ payload
117
+ );
118
+ }
119
+ /**
120
+ * List countries phone codes
121
+ *
122
+ * List of all countries phone codes. You can use the locale header to get the data in a supported language.
123
+ *
124
+ * @throws {AppwriteException}
125
+ * @returns {Promise<Models.PhoneList>}
126
+ */
127
+ async listCountriesPhones() {
128
+ const apiPath = "/locale/countries/phones";
129
+ const payload = {};
130
+ const uri = new URL(this.client.config.endpoint + apiPath);
131
+ const apiHeaders = {
132
+ "content-type": "application/json"
133
+ };
134
+ return await this.client.call(
135
+ "get",
136
+ uri,
137
+ apiHeaders,
138
+ payload
139
+ );
140
+ }
141
+ /**
142
+ * List currencies
143
+ *
144
+ * List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
145
+ *
146
+ * @throws {AppwriteException}
147
+ * @returns {Promise<Models.CurrencyList>}
148
+ */
149
+ async listCurrencies() {
150
+ const apiPath = "/locale/currencies";
151
+ const payload = {};
152
+ const uri = new URL(this.client.config.endpoint + apiPath);
153
+ const apiHeaders = {
154
+ "content-type": "application/json"
155
+ };
156
+ return await this.client.call(
157
+ "get",
158
+ uri,
159
+ apiHeaders,
160
+ payload
161
+ );
162
+ }
163
+ /**
164
+ * List languages
165
+ *
166
+ * List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
167
+ *
168
+ * @throws {AppwriteException}
169
+ * @returns {Promise<Models.LanguageList>}
170
+ */
171
+ async listLanguages() {
172
+ const apiPath = "/locale/languages";
173
+ const payload = {};
174
+ const uri = new URL(this.client.config.endpoint + apiPath);
175
+ const apiHeaders = {
176
+ "content-type": "application/json"
177
+ };
178
+ return await this.client.call(
179
+ "get",
180
+ uri,
181
+ apiHeaders,
182
+ payload
183
+ );
184
+ }
185
+ }
186
+
187
+ exports.Locale = Locale;
188
+ //# sourceMappingURL=out.js.map
189
+ //# sourceMappingURL=locale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/locale.ts"],"names":[],"mappings":"AAGO,MAAM,OAAO;AAAA,EAGhB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAA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AK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,MAAM,KAAK,OAAO;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AACJ","sourcesContent":["import { AppwriteException, Client, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\n\nexport class Locale {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * Get user locale\n *\n * Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https://db-ip.com))\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.Locale>}\n */\n async get(): Promise<Models.Locale> {\n const apiPath = '/locale';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List Locale Codes\n *\n * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.LocaleCodeList>}\n */\n async listCodes(): Promise<Models.LocaleCodeList> {\n const apiPath = '/locale/codes';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List continents\n *\n * List of all continents. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.ContinentList>}\n */\n async listContinents(): Promise<Models.ContinentList> {\n const apiPath = '/locale/continents';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List countries\n *\n * List of all countries. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.CountryList>}\n */\n async listCountries(): Promise<Models.CountryList> {\n const apiPath = '/locale/countries';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List EU countries\n *\n * List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.CountryList>}\n */\n async listCountriesEU(): Promise<Models.CountryList> {\n const apiPath = '/locale/countries/eu';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List countries phone codes\n *\n * List of all countries phone codes. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.PhoneList>}\n */\n async listCountriesPhones(): Promise<Models.PhoneList> {\n const apiPath = '/locale/countries/phones';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List currencies\n *\n * List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.CurrencyList>}\n */\n async listCurrencies(): Promise<Models.CurrencyList> {\n const apiPath = '/locale/currencies';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List languages\n *\n * List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.LanguageList>}\n */\n async listLanguages(): Promise<Models.LanguageList> {\n const apiPath = '/locale/languages';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n}\n"]}
@@ -0,0 +1,187 @@
1
+ class Locale {
2
+ constructor(client) {
3
+ this.client = client;
4
+ }
5
+ /**
6
+ * Get user locale
7
+ *
8
+ * Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
9
+
10
+ ([IP Geolocation by DB-IP](https://db-ip.com))
11
+ *
12
+ * @throws {AppwriteException}
13
+ * @returns {Promise<Models.Locale>}
14
+ */
15
+ async get() {
16
+ const apiPath = "/locale";
17
+ const payload = {};
18
+ const uri = new URL(this.client.config.endpoint + apiPath);
19
+ const apiHeaders = {
20
+ "content-type": "application/json"
21
+ };
22
+ return await this.client.call(
23
+ "get",
24
+ uri,
25
+ apiHeaders,
26
+ payload
27
+ );
28
+ }
29
+ /**
30
+ * List Locale Codes
31
+ *
32
+ * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
33
+ *
34
+ * @throws {AppwriteException}
35
+ * @returns {Promise<Models.LocaleCodeList>}
36
+ */
37
+ async listCodes() {
38
+ const apiPath = "/locale/codes";
39
+ const payload = {};
40
+ const uri = new URL(this.client.config.endpoint + apiPath);
41
+ const apiHeaders = {
42
+ "content-type": "application/json"
43
+ };
44
+ return await this.client.call(
45
+ "get",
46
+ uri,
47
+ apiHeaders,
48
+ payload
49
+ );
50
+ }
51
+ /**
52
+ * List continents
53
+ *
54
+ * List of all continents. You can use the locale header to get the data in a supported language.
55
+ *
56
+ * @throws {AppwriteException}
57
+ * @returns {Promise<Models.ContinentList>}
58
+ */
59
+ async listContinents() {
60
+ const apiPath = "/locale/continents";
61
+ const payload = {};
62
+ const uri = new URL(this.client.config.endpoint + apiPath);
63
+ const apiHeaders = {
64
+ "content-type": "application/json"
65
+ };
66
+ return await this.client.call(
67
+ "get",
68
+ uri,
69
+ apiHeaders,
70
+ payload
71
+ );
72
+ }
73
+ /**
74
+ * List countries
75
+ *
76
+ * List of all countries. You can use the locale header to get the data in a supported language.
77
+ *
78
+ * @throws {AppwriteException}
79
+ * @returns {Promise<Models.CountryList>}
80
+ */
81
+ async listCountries() {
82
+ const apiPath = "/locale/countries";
83
+ const payload = {};
84
+ const uri = new URL(this.client.config.endpoint + apiPath);
85
+ const apiHeaders = {
86
+ "content-type": "application/json"
87
+ };
88
+ return await this.client.call(
89
+ "get",
90
+ uri,
91
+ apiHeaders,
92
+ payload
93
+ );
94
+ }
95
+ /**
96
+ * List EU countries
97
+ *
98
+ * List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
99
+ *
100
+ * @throws {AppwriteException}
101
+ * @returns {Promise<Models.CountryList>}
102
+ */
103
+ async listCountriesEU() {
104
+ const apiPath = "/locale/countries/eu";
105
+ const payload = {};
106
+ const uri = new URL(this.client.config.endpoint + apiPath);
107
+ const apiHeaders = {
108
+ "content-type": "application/json"
109
+ };
110
+ return await this.client.call(
111
+ "get",
112
+ uri,
113
+ apiHeaders,
114
+ payload
115
+ );
116
+ }
117
+ /**
118
+ * List countries phone codes
119
+ *
120
+ * List of all countries phone codes. You can use the locale header to get the data in a supported language.
121
+ *
122
+ * @throws {AppwriteException}
123
+ * @returns {Promise<Models.PhoneList>}
124
+ */
125
+ async listCountriesPhones() {
126
+ const apiPath = "/locale/countries/phones";
127
+ const payload = {};
128
+ const uri = new URL(this.client.config.endpoint + apiPath);
129
+ const apiHeaders = {
130
+ "content-type": "application/json"
131
+ };
132
+ return await this.client.call(
133
+ "get",
134
+ uri,
135
+ apiHeaders,
136
+ payload
137
+ );
138
+ }
139
+ /**
140
+ * List currencies
141
+ *
142
+ * List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
143
+ *
144
+ * @throws {AppwriteException}
145
+ * @returns {Promise<Models.CurrencyList>}
146
+ */
147
+ async listCurrencies() {
148
+ const apiPath = "/locale/currencies";
149
+ const payload = {};
150
+ const uri = new URL(this.client.config.endpoint + apiPath);
151
+ const apiHeaders = {
152
+ "content-type": "application/json"
153
+ };
154
+ return await this.client.call(
155
+ "get",
156
+ uri,
157
+ apiHeaders,
158
+ payload
159
+ );
160
+ }
161
+ /**
162
+ * List languages
163
+ *
164
+ * List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
165
+ *
166
+ * @throws {AppwriteException}
167
+ * @returns {Promise<Models.LanguageList>}
168
+ */
169
+ async listLanguages() {
170
+ const apiPath = "/locale/languages";
171
+ const payload = {};
172
+ const uri = new URL(this.client.config.endpoint + apiPath);
173
+ const apiHeaders = {
174
+ "content-type": "application/json"
175
+ };
176
+ return await this.client.call(
177
+ "get",
178
+ uri,
179
+ apiHeaders,
180
+ payload
181
+ );
182
+ }
183
+ }
184
+
185
+ export { Locale };
186
+ //# sourceMappingURL=out.js.map
187
+ //# sourceMappingURL=locale.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/locale.ts"],"names":[],"mappings":"AAGO,MAAM,OAAO;AAAA,EAGhB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,MAA8B;AAChC,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,gBAAgB;AAAA,IACpB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../client';\nimport type { Models } from '../models';\n\nexport class Locale {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * Get user locale\n *\n * Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https://db-ip.com))\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.Locale>}\n */\n async get(): Promise<Models.Locale> {\n const apiPath = '/locale';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List Locale Codes\n *\n * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.LocaleCodeList>}\n */\n async listCodes(): Promise<Models.LocaleCodeList> {\n const apiPath = '/locale/codes';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List continents\n *\n * List of all continents. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.ContinentList>}\n */\n async listContinents(): Promise<Models.ContinentList> {\n const apiPath = '/locale/continents';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List countries\n *\n * List of all countries. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.CountryList>}\n */\n async listCountries(): Promise<Models.CountryList> {\n const apiPath = '/locale/countries';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List EU countries\n *\n * List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.CountryList>}\n */\n async listCountriesEU(): Promise<Models.CountryList> {\n const apiPath = '/locale/countries/eu';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List countries phone codes\n *\n * List of all countries phone codes. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.PhoneList>}\n */\n async listCountriesPhones(): Promise<Models.PhoneList> {\n const apiPath = '/locale/countries/phones';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List currencies\n *\n * List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.CurrencyList>}\n */\n async listCurrencies(): Promise<Models.CurrencyList> {\n const apiPath = '/locale/currencies';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * List languages\n *\n * List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.LanguageList>}\n */\n async listLanguages(): Promise<Models.LanguageList> {\n const apiPath = '/locale/languages';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return await this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n}\n"]}