@eveai/eve-sdk-for-node 0.0.1 → 0.0.3

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 (447) hide show
  1. package/README.md.bak +510 -0
  2. package/README.md.orig +510 -0
  3. package/dist/client.d.mts +110 -0
  4. package/dist/client.d.ts +110 -0
  5. package/dist/client.js +292 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/client.mjs +286 -0
  8. package/dist/client.mjs.map +1 -0
  9. package/dist/enums/adapter.d.mts +6 -0
  10. package/dist/enums/adapter.d.ts +6 -0
  11. package/dist/enums/adapter.js +11 -0
  12. package/dist/enums/adapter.js.map +1 -0
  13. package/dist/enums/adapter.mjs +10 -0
  14. package/dist/enums/adapter.mjs.map +1 -0
  15. package/dist/enums/attribute-status.d.mts +9 -0
  16. package/dist/enums/attribute-status.d.ts +9 -0
  17. package/dist/enums/attribute-status.js +14 -0
  18. package/dist/enums/attribute-status.js.map +1 -0
  19. package/dist/enums/attribute-status.mjs +13 -0
  20. package/dist/enums/attribute-status.mjs.map +1 -0
  21. package/dist/enums/authentication-factor.d.mts +8 -0
  22. package/dist/enums/authentication-factor.d.ts +8 -0
  23. package/dist/enums/authentication-factor.js +13 -0
  24. package/dist/enums/authentication-factor.js.map +1 -0
  25. package/dist/enums/authentication-factor.mjs +12 -0
  26. package/dist/enums/authentication-factor.mjs.map +1 -0
  27. package/dist/enums/authenticator-type.d.mts +5 -0
  28. package/dist/enums/authenticator-type.d.ts +5 -0
  29. package/dist/enums/authenticator-type.js +10 -0
  30. package/dist/enums/authenticator-type.js.map +1 -0
  31. package/dist/enums/authenticator-type.mjs +9 -0
  32. package/dist/enums/authenticator-type.mjs.map +1 -0
  33. package/dist/enums/browser.d.mts +18 -0
  34. package/dist/enums/browser.d.ts +18 -0
  35. package/dist/enums/browser.js +23 -0
  36. package/dist/enums/browser.js.map +1 -0
  37. package/dist/enums/browser.mjs +22 -0
  38. package/dist/enums/browser.mjs.map +1 -0
  39. package/dist/enums/build-runtime.d.mts +71 -0
  40. package/dist/enums/build-runtime.d.ts +71 -0
  41. package/dist/enums/build-runtime.js +76 -0
  42. package/dist/enums/build-runtime.js.map +1 -0
  43. package/dist/enums/build-runtime.mjs +75 -0
  44. package/dist/enums/build-runtime.mjs.map +1 -0
  45. package/dist/enums/column-status.d.mts +9 -0
  46. package/dist/enums/column-status.d.ts +9 -0
  47. package/dist/enums/column-status.js +14 -0
  48. package/dist/enums/column-status.js.map +1 -0
  49. package/dist/enums/column-status.mjs +13 -0
  50. package/dist/enums/column-status.mjs.map +1 -0
  51. package/dist/enums/compression.d.mts +7 -0
  52. package/dist/enums/compression.d.ts +7 -0
  53. package/dist/enums/compression.js +12 -0
  54. package/dist/enums/compression.js.map +1 -0
  55. package/dist/enums/compression.mjs +11 -0
  56. package/dist/enums/compression.mjs.map +1 -0
  57. package/dist/enums/credit-card.d.mts +21 -0
  58. package/dist/enums/credit-card.d.ts +21 -0
  59. package/dist/enums/credit-card.js +26 -0
  60. package/dist/enums/credit-card.js.map +1 -0
  61. package/dist/enums/credit-card.mjs +25 -0
  62. package/dist/enums/credit-card.mjs.map +1 -0
  63. package/dist/enums/database-type.d.mts +6 -0
  64. package/dist/enums/database-type.d.ts +6 -0
  65. package/dist/enums/database-type.js +11 -0
  66. package/dist/enums/database-type.js.map +1 -0
  67. package/dist/enums/database-type.mjs +10 -0
  68. package/dist/enums/database-type.mjs.map +1 -0
  69. package/dist/enums/deployment-download-type.d.mts +6 -0
  70. package/dist/enums/deployment-download-type.d.ts +6 -0
  71. package/dist/enums/deployment-download-type.js +11 -0
  72. package/dist/enums/deployment-download-type.js.map +1 -0
  73. package/dist/enums/deployment-download-type.mjs +10 -0
  74. package/dist/enums/deployment-download-type.mjs.map +1 -0
  75. package/dist/enums/deployment-status.d.mts +9 -0
  76. package/dist/enums/deployment-status.d.ts +9 -0
  77. package/dist/enums/deployment-status.js +14 -0
  78. package/dist/enums/deployment-status.js.map +1 -0
  79. package/dist/enums/deployment-status.mjs +13 -0
  80. package/dist/enums/deployment-status.mjs.map +1 -0
  81. package/dist/enums/execution-method.d.mts +11 -0
  82. package/dist/enums/execution-method.d.ts +11 -0
  83. package/dist/enums/execution-method.js +16 -0
  84. package/dist/enums/execution-method.js.map +1 -0
  85. package/dist/enums/execution-method.mjs +15 -0
  86. package/dist/enums/execution-method.mjs.map +1 -0
  87. package/dist/enums/execution-status.d.mts +9 -0
  88. package/dist/enums/execution-status.d.ts +9 -0
  89. package/dist/enums/execution-status.js +14 -0
  90. package/dist/enums/execution-status.js.map +1 -0
  91. package/dist/enums/execution-status.mjs +13 -0
  92. package/dist/enums/execution-status.mjs.map +1 -0
  93. package/dist/enums/execution-trigger.d.mts +7 -0
  94. package/dist/enums/execution-trigger.d.ts +7 -0
  95. package/dist/enums/execution-trigger.js +12 -0
  96. package/dist/enums/execution-trigger.js.map +1 -0
  97. package/dist/enums/execution-trigger.mjs +11 -0
  98. package/dist/enums/execution-trigger.mjs.map +1 -0
  99. package/dist/enums/flag.d.mts +199 -0
  100. package/dist/enums/flag.d.ts +199 -0
  101. package/dist/enums/flag.js +204 -0
  102. package/dist/enums/flag.js.map +1 -0
  103. package/dist/enums/flag.mjs +203 -0
  104. package/dist/enums/flag.mjs.map +1 -0
  105. package/dist/enums/framework.d.mts +19 -0
  106. package/dist/enums/framework.d.ts +19 -0
  107. package/dist/enums/framework.js +24 -0
  108. package/dist/enums/framework.js.map +1 -0
  109. package/dist/enums/framework.mjs +23 -0
  110. package/dist/enums/framework.mjs.map +1 -0
  111. package/dist/enums/health-antivirus-status.d.mts +7 -0
  112. package/dist/enums/health-antivirus-status.d.ts +7 -0
  113. package/dist/enums/health-antivirus-status.js +12 -0
  114. package/dist/enums/health-antivirus-status.js.map +1 -0
  115. package/dist/enums/health-antivirus-status.mjs +11 -0
  116. package/dist/enums/health-antivirus-status.mjs.map +1 -0
  117. package/dist/enums/health-check-status.d.mts +6 -0
  118. package/dist/enums/health-check-status.d.ts +6 -0
  119. package/dist/enums/health-check-status.js +11 -0
  120. package/dist/enums/health-check-status.js.map +1 -0
  121. package/dist/enums/health-check-status.mjs +10 -0
  122. package/dist/enums/health-check-status.mjs.map +1 -0
  123. package/dist/enums/image-format.d.mts +11 -0
  124. package/dist/enums/image-format.d.ts +11 -0
  125. package/dist/enums/image-format.js +16 -0
  126. package/dist/enums/image-format.js.map +1 -0
  127. package/dist/enums/image-format.mjs +15 -0
  128. package/dist/enums/image-format.mjs.map +1 -0
  129. package/dist/enums/image-gravity.d.mts +13 -0
  130. package/dist/enums/image-gravity.d.ts +13 -0
  131. package/dist/enums/image-gravity.js +18 -0
  132. package/dist/enums/image-gravity.js.map +1 -0
  133. package/dist/enums/image-gravity.mjs +17 -0
  134. package/dist/enums/image-gravity.mjs.map +1 -0
  135. package/dist/enums/index-status.d.mts +9 -0
  136. package/dist/enums/index-status.d.ts +9 -0
  137. package/dist/enums/index-status.js +14 -0
  138. package/dist/enums/index-status.js.map +1 -0
  139. package/dist/enums/index-status.mjs +13 -0
  140. package/dist/enums/index-status.mjs.map +1 -0
  141. package/dist/enums/index-type.d.mts +8 -0
  142. package/dist/enums/index-type.d.ts +8 -0
  143. package/dist/enums/index-type.js +13 -0
  144. package/dist/enums/index-type.js.map +1 -0
  145. package/dist/enums/index-type.mjs +12 -0
  146. package/dist/enums/index-type.mjs.map +1 -0
  147. package/dist/enums/message-priority.d.mts +6 -0
  148. package/dist/enums/message-priority.d.ts +6 -0
  149. package/dist/enums/message-priority.js +11 -0
  150. package/dist/enums/message-priority.js.map +1 -0
  151. package/dist/enums/message-priority.mjs +10 -0
  152. package/dist/enums/message-priority.mjs.map +1 -0
  153. package/dist/enums/message-status.d.mts +9 -0
  154. package/dist/enums/message-status.d.ts +9 -0
  155. package/dist/enums/message-status.js +14 -0
  156. package/dist/enums/message-status.js.map +1 -0
  157. package/dist/enums/message-status.mjs +13 -0
  158. package/dist/enums/message-status.mjs.map +1 -0
  159. package/dist/enums/messaging-provider-type.d.mts +7 -0
  160. package/dist/enums/messaging-provider-type.d.ts +7 -0
  161. package/dist/enums/messaging-provider-type.js +12 -0
  162. package/dist/enums/messaging-provider-type.js.map +1 -0
  163. package/dist/enums/messaging-provider-type.mjs +11 -0
  164. package/dist/enums/messaging-provider-type.mjs.map +1 -0
  165. package/dist/enums/name.d.mts +16 -0
  166. package/dist/enums/name.d.ts +16 -0
  167. package/dist/enums/name.js +21 -0
  168. package/dist/enums/name.js.map +1 -0
  169. package/dist/enums/name.mjs +20 -0
  170. package/dist/enums/name.mjs.map +1 -0
  171. package/dist/enums/o-auth-provider.d.mts +44 -0
  172. package/dist/enums/o-auth-provider.d.ts +44 -0
  173. package/dist/enums/o-auth-provider.js +49 -0
  174. package/dist/enums/o-auth-provider.js.map +1 -0
  175. package/dist/enums/o-auth-provider.mjs +48 -0
  176. package/dist/enums/o-auth-provider.mjs.map +1 -0
  177. package/dist/enums/output.d.mts +11 -0
  178. package/dist/enums/output.d.ts +11 -0
  179. package/dist/enums/output.js +16 -0
  180. package/dist/enums/output.js.map +1 -0
  181. package/dist/enums/output.mjs +15 -0
  182. package/dist/enums/output.mjs.map +1 -0
  183. package/dist/enums/password-hash.d.mts +15 -0
  184. package/dist/enums/password-hash.d.ts +15 -0
  185. package/dist/enums/password-hash.js +20 -0
  186. package/dist/enums/password-hash.js.map +1 -0
  187. package/dist/enums/password-hash.mjs +19 -0
  188. package/dist/enums/password-hash.mjs.map +1 -0
  189. package/dist/enums/relation-mutate.d.mts +7 -0
  190. package/dist/enums/relation-mutate.d.ts +7 -0
  191. package/dist/enums/relation-mutate.js +12 -0
  192. package/dist/enums/relation-mutate.js.map +1 -0
  193. package/dist/enums/relation-mutate.mjs +11 -0
  194. package/dist/enums/relation-mutate.mjs.map +1 -0
  195. package/dist/enums/relationship-type.d.mts +8 -0
  196. package/dist/enums/relationship-type.d.ts +8 -0
  197. package/dist/enums/relationship-type.js +13 -0
  198. package/dist/enums/relationship-type.js.map +1 -0
  199. package/dist/enums/relationship-type.mjs +12 -0
  200. package/dist/enums/relationship-type.mjs.map +1 -0
  201. package/dist/enums/runtime.d.mts +71 -0
  202. package/dist/enums/runtime.d.ts +71 -0
  203. package/dist/enums/runtime.js +76 -0
  204. package/dist/enums/runtime.js.map +1 -0
  205. package/dist/enums/runtime.mjs +75 -0
  206. package/dist/enums/runtime.mjs.map +1 -0
  207. package/dist/enums/smtp-encryption.d.mts +7 -0
  208. package/dist/enums/smtp-encryption.d.ts +7 -0
  209. package/dist/enums/smtp-encryption.js +12 -0
  210. package/dist/enums/smtp-encryption.js.map +1 -0
  211. package/dist/enums/smtp-encryption.mjs +11 -0
  212. package/dist/enums/smtp-encryption.mjs.map +1 -0
  213. package/dist/enums/template-reference-type.d.mts +7 -0
  214. package/dist/enums/template-reference-type.d.ts +7 -0
  215. package/dist/enums/template-reference-type.js +12 -0
  216. package/dist/enums/template-reference-type.js.map +1 -0
  217. package/dist/enums/template-reference-type.mjs +11 -0
  218. package/dist/enums/template-reference-type.mjs.map +1 -0
  219. package/dist/enums/theme.d.mts +6 -0
  220. package/dist/enums/theme.d.ts +6 -0
  221. package/dist/enums/theme.js +11 -0
  222. package/dist/enums/theme.js.map +1 -0
  223. package/dist/enums/theme.mjs +10 -0
  224. package/dist/enums/theme.mjs.map +1 -0
  225. package/dist/enums/timezone.d.mts +423 -0
  226. package/dist/enums/timezone.d.ts +423 -0
  227. package/dist/enums/timezone.js +428 -0
  228. package/dist/enums/timezone.js.map +1 -0
  229. package/dist/enums/timezone.mjs +427 -0
  230. package/dist/enums/timezone.mjs.map +1 -0
  231. package/dist/enums/vcs-reference-type.d.mts +7 -0
  232. package/dist/enums/vcs-reference-type.d.ts +7 -0
  233. package/dist/enums/vcs-reference-type.js +12 -0
  234. package/dist/enums/vcs-reference-type.js.map +1 -0
  235. package/dist/enums/vcs-reference-type.mjs +11 -0
  236. package/dist/enums/vcs-reference-type.mjs.map +1 -0
  237. package/dist/id.d.mts +22 -0
  238. package/dist/id.d.ts +22 -0
  239. package/dist/id.js +45 -0
  240. package/dist/id.js.map +1 -0
  241. package/dist/id.mjs +44 -0
  242. package/dist/id.mjs.map +1 -0
  243. package/dist/index.d.mts +72 -0
  244. package/dist/index.d.ts +72 -0
  245. package/dist/index.js +369 -0
  246. package/dist/index.js.map +1 -0
  247. package/dist/index.mjs +72 -0
  248. package/dist/index.mjs.map +1 -0
  249. package/dist/inputFile.d.mts +9 -0
  250. package/dist/inputFile.d.ts +9 -0
  251. package/dist/inputFile.js +23 -0
  252. package/dist/inputFile.js.map +1 -0
  253. package/dist/inputFile.mjs +22 -0
  254. package/dist/inputFile.mjs.map +1 -0
  255. package/dist/models.d.mts +3829 -0
  256. package/dist/models.d.ts +3829 -0
  257. package/dist/models.js +4 -0
  258. package/dist/models.js.map +1 -0
  259. package/dist/models.mjs +3 -0
  260. package/dist/models.mjs.map +1 -0
  261. package/dist/operator.d.mts +181 -0
  262. package/dist/operator.d.ts +181 -0
  263. package/dist/operator.js +268 -0
  264. package/dist/operator.js.map +1 -0
  265. package/dist/operator.mjs +266 -0
  266. package/dist/operator.mjs.map +1 -0
  267. package/dist/permission.d.mts +45 -0
  268. package/dist/permission.d.ts +45 -0
  269. package/dist/permission.js +56 -0
  270. package/dist/permission.js.map +1 -0
  271. package/dist/permission.mjs +55 -0
  272. package/dist/permission.mjs.map +1 -0
  273. package/dist/query.d.mts +391 -0
  274. package/dist/query.d.ts +391 -0
  275. package/dist/query.js +402 -0
  276. package/dist/query.js.map +1 -0
  277. package/dist/query.mjs +401 -0
  278. package/dist/query.mjs.map +1 -0
  279. package/dist/role.d.mts +72 -0
  280. package/dist/role.d.ts +72 -0
  281. package/dist/role.js +96 -0
  282. package/dist/role.js.map +1 -0
  283. package/dist/role.mjs +95 -0
  284. package/dist/role.mjs.map +1 -0
  285. package/dist/services/account.d.mts +1011 -0
  286. package/dist/services/account.d.ts +1011 -0
  287. package/dist/services/account.js +1596 -0
  288. package/dist/services/account.js.map +1 -0
  289. package/dist/services/account.mjs +1595 -0
  290. package/dist/services/account.mjs.map +1 -0
  291. package/dist/services/auth.d.mts +52 -0
  292. package/dist/services/auth.d.ts +52 -0
  293. package/dist/services/auth.js +85 -0
  294. package/dist/services/auth.js.map +1 -0
  295. package/dist/services/auth.mjs +84 -0
  296. package/dist/services/auth.mjs.map +1 -0
  297. package/dist/services/avatars.d.mts +334 -0
  298. package/dist/services/avatars.d.ts +334 -0
  299. package/dist/services/avatars.js +405 -0
  300. package/dist/services/avatars.js.map +1 -0
  301. package/dist/services/avatars.mjs +404 -0
  302. package/dist/services/avatars.mjs.map +1 -0
  303. package/dist/services/comment.d.mts +92 -0
  304. package/dist/services/comment.d.ts +92 -0
  305. package/dist/services/comment.js +175 -0
  306. package/dist/services/comment.js.map +1 -0
  307. package/dist/services/comment.mjs +174 -0
  308. package/dist/services/comment.mjs.map +1 -0
  309. package/dist/services/databases.d.mts +1991 -0
  310. package/dist/services/databases.d.ts +1991 -0
  311. package/dist/services/databases.js +2957 -0
  312. package/dist/services/databases.js.map +1 -0
  313. package/dist/services/databases.mjs +2956 -0
  314. package/dist/services/databases.mjs.map +1 -0
  315. package/dist/services/eveai-chat.d.mts +118 -0
  316. package/dist/services/eveai-chat.d.ts +118 -0
  317. package/dist/services/eveai-chat.js +115 -0
  318. package/dist/services/eveai-chat.js.map +1 -0
  319. package/dist/services/eveai-chat.mjs +114 -0
  320. package/dist/services/eveai-chat.mjs.map +1 -0
  321. package/dist/services/eveai-payment.d.mts +145 -0
  322. package/dist/services/eveai-payment.d.ts +145 -0
  323. package/dist/services/eveai-payment.js +132 -0
  324. package/dist/services/eveai-payment.js.map +1 -0
  325. package/dist/services/eveai-payment.mjs +131 -0
  326. package/dist/services/eveai-payment.mjs.map +1 -0
  327. package/dist/services/eveai-provider-discovery.d.mts +126 -0
  328. package/dist/services/eveai-provider-discovery.d.ts +126 -0
  329. package/dist/services/eveai-provider-discovery.js +96 -0
  330. package/dist/services/eveai-provider-discovery.js.map +1 -0
  331. package/dist/services/eveai-provider-discovery.mjs +95 -0
  332. package/dist/services/eveai-provider-discovery.mjs.map +1 -0
  333. package/dist/services/eveai-task.d.mts +137 -0
  334. package/dist/services/eveai-task.d.ts +137 -0
  335. package/dist/services/eveai-task.js +143 -0
  336. package/dist/services/eveai-task.js.map +1 -0
  337. package/dist/services/eveai-task.mjs +142 -0
  338. package/dist/services/eveai-task.mjs.map +1 -0
  339. package/dist/services/favorite.d.mts +68 -0
  340. package/dist/services/favorite.d.ts +68 -0
  341. package/dist/services/favorite.js +127 -0
  342. package/dist/services/favorite.js.map +1 -0
  343. package/dist/services/favorite.mjs +126 -0
  344. package/dist/services/favorite.mjs.map +1 -0
  345. package/dist/services/feed.d.mts +62 -0
  346. package/dist/services/feed.d.ts +62 -0
  347. package/dist/services/feed.js +76 -0
  348. package/dist/services/feed.js.map +1 -0
  349. package/dist/services/feed.mjs +75 -0
  350. package/dist/services/feed.mjs.map +1 -0
  351. package/dist/services/functions.d.mts +749 -0
  352. package/dist/services/functions.d.ts +749 -0
  353. package/dist/services/functions.js +1109 -0
  354. package/dist/services/functions.js.map +1 -0
  355. package/dist/services/functions.mjs +1108 -0
  356. package/dist/services/functions.mjs.map +1 -0
  357. package/dist/services/graphql.d.mts +58 -0
  358. package/dist/services/graphql.d.ts +58 -0
  359. package/dist/services/graphql.js +73 -0
  360. package/dist/services/graphql.js.map +1 -0
  361. package/dist/services/graphql.mjs +72 -0
  362. package/dist/services/graphql.mjs.map +1 -0
  363. package/dist/services/gugotik-storage.d.mts +34 -0
  364. package/dist/services/gugotik-storage.d.ts +34 -0
  365. package/dist/services/gugotik-storage.js +40 -0
  366. package/dist/services/gugotik-storage.js.map +1 -0
  367. package/dist/services/gugotik-storage.mjs +39 -0
  368. package/dist/services/gugotik-storage.mjs.map +1 -0
  369. package/dist/services/health.d.mts +351 -0
  370. package/dist/services/health.d.ts +351 -0
  371. package/dist/services/health.js +503 -0
  372. package/dist/services/health.js.map +1 -0
  373. package/dist/services/health.mjs +502 -0
  374. package/dist/services/health.mjs.map +1 -0
  375. package/dist/services/locale.d.mts +78 -0
  376. package/dist/services/locale.d.ts +78 -0
  377. package/dist/services/locale.js +157 -0
  378. package/dist/services/locale.js.map +1 -0
  379. package/dist/services/locale.mjs +156 -0
  380. package/dist/services/locale.mjs.map +1 -0
  381. package/dist/services/message.d.mts +60 -0
  382. package/dist/services/message.d.ts +60 -0
  383. package/dist/services/message.js +98 -0
  384. package/dist/services/message.js.map +1 -0
  385. package/dist/services/message.mjs +97 -0
  386. package/dist/services/message.mjs.map +1 -0
  387. package/dist/services/messaging.d.mts +2003 -0
  388. package/dist/services/messaging.d.ts +2003 -0
  389. package/dist/services/messaging.js +3054 -0
  390. package/dist/services/messaging.js.map +1 -0
  391. package/dist/services/messaging.mjs +3053 -0
  392. package/dist/services/messaging.mjs.map +1 -0
  393. package/dist/services/publish.d.mts +70 -0
  394. package/dist/services/publish.d.ts +70 -0
  395. package/dist/services/publish.js +154 -0
  396. package/dist/services/publish.js.map +1 -0
  397. package/dist/services/publish.mjs +153 -0
  398. package/dist/services/publish.mjs.map +1 -0
  399. package/dist/services/relation.d.mts +113 -0
  400. package/dist/services/relation.d.ts +113 -0
  401. package/dist/services/relation.js +239 -0
  402. package/dist/services/relation.js.map +1 -0
  403. package/dist/services/relation.mjs +238 -0
  404. package/dist/services/relation.mjs.map +1 -0
  405. package/dist/services/sites.d.mts +705 -0
  406. package/dist/services/sites.d.ts +705 -0
  407. package/dist/services/sites.js +1059 -0
  408. package/dist/services/sites.js.map +1 -0
  409. package/dist/services/sites.mjs +1058 -0
  410. package/dist/services/sites.mjs.map +1 -0
  411. package/dist/services/storage.d.mts +435 -0
  412. package/dist/services/storage.d.ts +435 -0
  413. package/dist/services/storage.js +609 -0
  414. package/dist/services/storage.js.map +1 -0
  415. package/dist/services/storage.mjs +608 -0
  416. package/dist/services/storage.mjs.map +1 -0
  417. package/dist/services/tables-db.d.mts +1934 -0
  418. package/dist/services/tables-db.d.ts +1934 -0
  419. package/dist/services/tables-db.js +2954 -0
  420. package/dist/services/tables-db.js.map +1 -0
  421. package/dist/services/tables-db.mjs +2953 -0
  422. package/dist/services/tables-db.mjs.map +1 -0
  423. package/dist/services/teams.d.mts +355 -0
  424. package/dist/services/teams.d.ts +355 -0
  425. package/dist/services/teams.js +475 -0
  426. package/dist/services/teams.js.map +1 -0
  427. package/dist/services/teams.mjs +474 -0
  428. package/dist/services/teams.mjs.map +1 -0
  429. package/dist/services/tokens.d.mts +133 -0
  430. package/dist/services/tokens.d.ts +133 -0
  431. package/dist/services/tokens.js +169 -0
  432. package/dist/services/tokens.js.map +1 -0
  433. package/dist/services/tokens.mjs +168 -0
  434. package/dist/services/tokens.mjs.map +1 -0
  435. package/dist/services/user.d.mts +66 -0
  436. package/dist/services/user.d.ts +66 -0
  437. package/dist/services/user.js +101 -0
  438. package/dist/services/user.js.map +1 -0
  439. package/dist/services/user.mjs +100 -0
  440. package/dist/services/user.mjs.map +1 -0
  441. package/dist/services/users.d.mts +1176 -0
  442. package/dist/services/users.d.ts +1176 -0
  443. package/dist/services/users.js +1742 -0
  444. package/dist/services/users.js.map +1 -0
  445. package/dist/services/users.mjs +1741 -0
  446. package/dist/services/users.mjs.map +1 -0
  447. package/package.json +15 -1
@@ -0,0 +1,2957 @@
1
+ 'use strict';
2
+
3
+ var client = require('../client');
4
+
5
+ class Databases {
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ list(paramsOrFirst, ...rest) {
10
+ let params;
11
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
12
+ params = paramsOrFirst || {};
13
+ } else {
14
+ params = {
15
+ queries: paramsOrFirst,
16
+ search: rest[0],
17
+ total: rest[1]
18
+ };
19
+ }
20
+ const queries = params.queries;
21
+ const search = params.search;
22
+ const total = params.total;
23
+ const apiPath = "/databases";
24
+ const payload = {};
25
+ if (typeof queries !== "undefined") {
26
+ payload["queries"] = queries;
27
+ }
28
+ if (typeof search !== "undefined") {
29
+ payload["search"] = search;
30
+ }
31
+ if (typeof total !== "undefined") {
32
+ payload["total"] = total;
33
+ }
34
+ const uri = new URL(this.client.config.endpoint + apiPath);
35
+ const apiHeaders = {};
36
+ return this.client.call(
37
+ "get",
38
+ uri,
39
+ apiHeaders,
40
+ payload
41
+ );
42
+ }
43
+ create(paramsOrFirst, ...rest) {
44
+ let params;
45
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
46
+ params = paramsOrFirst || {};
47
+ } else {
48
+ params = {
49
+ databaseId: paramsOrFirst,
50
+ name: rest[0],
51
+ enabled: rest[1]
52
+ };
53
+ }
54
+ const databaseId = params.databaseId;
55
+ const name = params.name;
56
+ const enabled = params.enabled;
57
+ if (typeof databaseId === "undefined") {
58
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
59
+ }
60
+ if (typeof name === "undefined") {
61
+ throw new client.AppwriteException('Missing required parameter: "name"');
62
+ }
63
+ const apiPath = "/databases";
64
+ const payload = {};
65
+ if (typeof databaseId !== "undefined") {
66
+ payload["databaseId"] = databaseId;
67
+ }
68
+ if (typeof name !== "undefined") {
69
+ payload["name"] = name;
70
+ }
71
+ if (typeof enabled !== "undefined") {
72
+ payload["enabled"] = enabled;
73
+ }
74
+ const uri = new URL(this.client.config.endpoint + apiPath);
75
+ const apiHeaders = {
76
+ "content-type": "application/json"
77
+ };
78
+ return this.client.call(
79
+ "post",
80
+ uri,
81
+ apiHeaders,
82
+ payload
83
+ );
84
+ }
85
+ listTransactions(paramsOrFirst) {
86
+ let params;
87
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
88
+ params = paramsOrFirst || {};
89
+ } else {
90
+ params = {
91
+ queries: paramsOrFirst
92
+ };
93
+ }
94
+ const queries = params.queries;
95
+ const apiPath = "/databases/transactions";
96
+ const payload = {};
97
+ if (typeof queries !== "undefined") {
98
+ payload["queries"] = queries;
99
+ }
100
+ const uri = new URL(this.client.config.endpoint + apiPath);
101
+ const apiHeaders = {};
102
+ return this.client.call(
103
+ "get",
104
+ uri,
105
+ apiHeaders,
106
+ payload
107
+ );
108
+ }
109
+ createTransaction(paramsOrFirst) {
110
+ let params;
111
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
112
+ params = paramsOrFirst || {};
113
+ } else {
114
+ params = {
115
+ ttl: paramsOrFirst
116
+ };
117
+ }
118
+ const ttl = params.ttl;
119
+ const apiPath = "/databases/transactions";
120
+ const payload = {};
121
+ if (typeof ttl !== "undefined") {
122
+ payload["ttl"] = ttl;
123
+ }
124
+ const uri = new URL(this.client.config.endpoint + apiPath);
125
+ const apiHeaders = {
126
+ "content-type": "application/json"
127
+ };
128
+ return this.client.call(
129
+ "post",
130
+ uri,
131
+ apiHeaders,
132
+ payload
133
+ );
134
+ }
135
+ getTransaction(paramsOrFirst) {
136
+ let params;
137
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
138
+ params = paramsOrFirst || {};
139
+ } else {
140
+ params = {
141
+ transactionId: paramsOrFirst
142
+ };
143
+ }
144
+ const transactionId = params.transactionId;
145
+ if (typeof transactionId === "undefined") {
146
+ throw new client.AppwriteException('Missing required parameter: "transactionId"');
147
+ }
148
+ const apiPath = "/databases/transactions/{transactionId}".replace("{transactionId}", transactionId);
149
+ const payload = {};
150
+ const uri = new URL(this.client.config.endpoint + apiPath);
151
+ const apiHeaders = {};
152
+ return this.client.call(
153
+ "get",
154
+ uri,
155
+ apiHeaders,
156
+ payload
157
+ );
158
+ }
159
+ updateTransaction(paramsOrFirst, ...rest) {
160
+ let params;
161
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
162
+ params = paramsOrFirst || {};
163
+ } else {
164
+ params = {
165
+ transactionId: paramsOrFirst,
166
+ commit: rest[0],
167
+ rollback: rest[1]
168
+ };
169
+ }
170
+ const transactionId = params.transactionId;
171
+ const commit = params.commit;
172
+ const rollback = params.rollback;
173
+ if (typeof transactionId === "undefined") {
174
+ throw new client.AppwriteException('Missing required parameter: "transactionId"');
175
+ }
176
+ const apiPath = "/databases/transactions/{transactionId}".replace("{transactionId}", transactionId);
177
+ const payload = {};
178
+ if (typeof commit !== "undefined") {
179
+ payload["commit"] = commit;
180
+ }
181
+ if (typeof rollback !== "undefined") {
182
+ payload["rollback"] = rollback;
183
+ }
184
+ const uri = new URL(this.client.config.endpoint + apiPath);
185
+ const apiHeaders = {
186
+ "content-type": "application/json"
187
+ };
188
+ return this.client.call(
189
+ "patch",
190
+ uri,
191
+ apiHeaders,
192
+ payload
193
+ );
194
+ }
195
+ deleteTransaction(paramsOrFirst) {
196
+ let params;
197
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
198
+ params = paramsOrFirst || {};
199
+ } else {
200
+ params = {
201
+ transactionId: paramsOrFirst
202
+ };
203
+ }
204
+ const transactionId = params.transactionId;
205
+ if (typeof transactionId === "undefined") {
206
+ throw new client.AppwriteException('Missing required parameter: "transactionId"');
207
+ }
208
+ const apiPath = "/databases/transactions/{transactionId}".replace("{transactionId}", transactionId);
209
+ const payload = {};
210
+ const uri = new URL(this.client.config.endpoint + apiPath);
211
+ const apiHeaders = {
212
+ "content-type": "application/json"
213
+ };
214
+ return this.client.call(
215
+ "delete",
216
+ uri,
217
+ apiHeaders,
218
+ payload
219
+ );
220
+ }
221
+ createOperations(paramsOrFirst, ...rest) {
222
+ let params;
223
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
224
+ params = paramsOrFirst || {};
225
+ } else {
226
+ params = {
227
+ transactionId: paramsOrFirst,
228
+ operations: rest[0]
229
+ };
230
+ }
231
+ const transactionId = params.transactionId;
232
+ const operations = params.operations;
233
+ if (typeof transactionId === "undefined") {
234
+ throw new client.AppwriteException('Missing required parameter: "transactionId"');
235
+ }
236
+ const apiPath = "/databases/transactions/{transactionId}/operations".replace("{transactionId}", transactionId);
237
+ const payload = {};
238
+ if (typeof operations !== "undefined") {
239
+ payload["operations"] = operations;
240
+ }
241
+ const uri = new URL(this.client.config.endpoint + apiPath);
242
+ const apiHeaders = {
243
+ "content-type": "application/json"
244
+ };
245
+ return this.client.call(
246
+ "post",
247
+ uri,
248
+ apiHeaders,
249
+ payload
250
+ );
251
+ }
252
+ get(paramsOrFirst) {
253
+ let params;
254
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
255
+ params = paramsOrFirst || {};
256
+ } else {
257
+ params = {
258
+ databaseId: paramsOrFirst
259
+ };
260
+ }
261
+ const databaseId = params.databaseId;
262
+ if (typeof databaseId === "undefined") {
263
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
264
+ }
265
+ const apiPath = "/databases/{databaseId}".replace("{databaseId}", databaseId);
266
+ const payload = {};
267
+ const uri = new URL(this.client.config.endpoint + apiPath);
268
+ const apiHeaders = {};
269
+ return this.client.call(
270
+ "get",
271
+ uri,
272
+ apiHeaders,
273
+ payload
274
+ );
275
+ }
276
+ update(paramsOrFirst, ...rest) {
277
+ let params;
278
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
279
+ params = paramsOrFirst || {};
280
+ } else {
281
+ params = {
282
+ databaseId: paramsOrFirst,
283
+ name: rest[0],
284
+ enabled: rest[1]
285
+ };
286
+ }
287
+ const databaseId = params.databaseId;
288
+ const name = params.name;
289
+ const enabled = params.enabled;
290
+ if (typeof databaseId === "undefined") {
291
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
292
+ }
293
+ if (typeof name === "undefined") {
294
+ throw new client.AppwriteException('Missing required parameter: "name"');
295
+ }
296
+ const apiPath = "/databases/{databaseId}".replace("{databaseId}", databaseId);
297
+ const payload = {};
298
+ if (typeof name !== "undefined") {
299
+ payload["name"] = name;
300
+ }
301
+ if (typeof enabled !== "undefined") {
302
+ payload["enabled"] = enabled;
303
+ }
304
+ const uri = new URL(this.client.config.endpoint + apiPath);
305
+ const apiHeaders = {
306
+ "content-type": "application/json"
307
+ };
308
+ return this.client.call(
309
+ "put",
310
+ uri,
311
+ apiHeaders,
312
+ payload
313
+ );
314
+ }
315
+ delete(paramsOrFirst) {
316
+ let params;
317
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
318
+ params = paramsOrFirst || {};
319
+ } else {
320
+ params = {
321
+ databaseId: paramsOrFirst
322
+ };
323
+ }
324
+ const databaseId = params.databaseId;
325
+ if (typeof databaseId === "undefined") {
326
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
327
+ }
328
+ const apiPath = "/databases/{databaseId}".replace("{databaseId}", databaseId);
329
+ const payload = {};
330
+ const uri = new URL(this.client.config.endpoint + apiPath);
331
+ const apiHeaders = {
332
+ "content-type": "application/json"
333
+ };
334
+ return this.client.call(
335
+ "delete",
336
+ uri,
337
+ apiHeaders,
338
+ payload
339
+ );
340
+ }
341
+ listCollections(paramsOrFirst, ...rest) {
342
+ let params;
343
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
344
+ params = paramsOrFirst || {};
345
+ } else {
346
+ params = {
347
+ databaseId: paramsOrFirst,
348
+ queries: rest[0],
349
+ search: rest[1],
350
+ total: rest[2]
351
+ };
352
+ }
353
+ const databaseId = params.databaseId;
354
+ const queries = params.queries;
355
+ const search = params.search;
356
+ const total = params.total;
357
+ if (typeof databaseId === "undefined") {
358
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
359
+ }
360
+ const apiPath = "/databases/{databaseId}/collections".replace("{databaseId}", databaseId);
361
+ const payload = {};
362
+ if (typeof queries !== "undefined") {
363
+ payload["queries"] = queries;
364
+ }
365
+ if (typeof search !== "undefined") {
366
+ payload["search"] = search;
367
+ }
368
+ if (typeof total !== "undefined") {
369
+ payload["total"] = total;
370
+ }
371
+ const uri = new URL(this.client.config.endpoint + apiPath);
372
+ const apiHeaders = {};
373
+ return this.client.call(
374
+ "get",
375
+ uri,
376
+ apiHeaders,
377
+ payload
378
+ );
379
+ }
380
+ createCollection(paramsOrFirst, ...rest) {
381
+ let params;
382
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
383
+ params = paramsOrFirst || {};
384
+ } else {
385
+ params = {
386
+ databaseId: paramsOrFirst,
387
+ collectionId: rest[0],
388
+ name: rest[1],
389
+ permissions: rest[2],
390
+ documentSecurity: rest[3],
391
+ enabled: rest[4],
392
+ attributes: rest[5],
393
+ indexes: rest[6]
394
+ };
395
+ }
396
+ const databaseId = params.databaseId;
397
+ const collectionId = params.collectionId;
398
+ const name = params.name;
399
+ const permissions = params.permissions;
400
+ const documentSecurity = params.documentSecurity;
401
+ const enabled = params.enabled;
402
+ const attributes = params.attributes;
403
+ const indexes = params.indexes;
404
+ if (typeof databaseId === "undefined") {
405
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
406
+ }
407
+ if (typeof collectionId === "undefined") {
408
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
409
+ }
410
+ if (typeof name === "undefined") {
411
+ throw new client.AppwriteException('Missing required parameter: "name"');
412
+ }
413
+ const apiPath = "/databases/{databaseId}/collections".replace("{databaseId}", databaseId);
414
+ const payload = {};
415
+ if (typeof collectionId !== "undefined") {
416
+ payload["collectionId"] = collectionId;
417
+ }
418
+ if (typeof name !== "undefined") {
419
+ payload["name"] = name;
420
+ }
421
+ if (typeof permissions !== "undefined") {
422
+ payload["permissions"] = permissions;
423
+ }
424
+ if (typeof documentSecurity !== "undefined") {
425
+ payload["documentSecurity"] = documentSecurity;
426
+ }
427
+ if (typeof enabled !== "undefined") {
428
+ payload["enabled"] = enabled;
429
+ }
430
+ if (typeof attributes !== "undefined") {
431
+ payload["attributes"] = attributes;
432
+ }
433
+ if (typeof indexes !== "undefined") {
434
+ payload["indexes"] = indexes;
435
+ }
436
+ const uri = new URL(this.client.config.endpoint + apiPath);
437
+ const apiHeaders = {
438
+ "content-type": "application/json"
439
+ };
440
+ return this.client.call(
441
+ "post",
442
+ uri,
443
+ apiHeaders,
444
+ payload
445
+ );
446
+ }
447
+ getCollection(paramsOrFirst, ...rest) {
448
+ let params;
449
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
450
+ params = paramsOrFirst || {};
451
+ } else {
452
+ params = {
453
+ databaseId: paramsOrFirst,
454
+ collectionId: rest[0]
455
+ };
456
+ }
457
+ const databaseId = params.databaseId;
458
+ const collectionId = params.collectionId;
459
+ if (typeof databaseId === "undefined") {
460
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
461
+ }
462
+ if (typeof collectionId === "undefined") {
463
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
464
+ }
465
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
466
+ const payload = {};
467
+ const uri = new URL(this.client.config.endpoint + apiPath);
468
+ const apiHeaders = {};
469
+ return this.client.call(
470
+ "get",
471
+ uri,
472
+ apiHeaders,
473
+ payload
474
+ );
475
+ }
476
+ updateCollection(paramsOrFirst, ...rest) {
477
+ let params;
478
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
479
+ params = paramsOrFirst || {};
480
+ } else {
481
+ params = {
482
+ databaseId: paramsOrFirst,
483
+ collectionId: rest[0],
484
+ name: rest[1],
485
+ permissions: rest[2],
486
+ documentSecurity: rest[3],
487
+ enabled: rest[4]
488
+ };
489
+ }
490
+ const databaseId = params.databaseId;
491
+ const collectionId = params.collectionId;
492
+ const name = params.name;
493
+ const permissions = params.permissions;
494
+ const documentSecurity = params.documentSecurity;
495
+ const enabled = params.enabled;
496
+ if (typeof databaseId === "undefined") {
497
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
498
+ }
499
+ if (typeof collectionId === "undefined") {
500
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
501
+ }
502
+ if (typeof name === "undefined") {
503
+ throw new client.AppwriteException('Missing required parameter: "name"');
504
+ }
505
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
506
+ const payload = {};
507
+ if (typeof name !== "undefined") {
508
+ payload["name"] = name;
509
+ }
510
+ if (typeof permissions !== "undefined") {
511
+ payload["permissions"] = permissions;
512
+ }
513
+ if (typeof documentSecurity !== "undefined") {
514
+ payload["documentSecurity"] = documentSecurity;
515
+ }
516
+ if (typeof enabled !== "undefined") {
517
+ payload["enabled"] = enabled;
518
+ }
519
+ const uri = new URL(this.client.config.endpoint + apiPath);
520
+ const apiHeaders = {
521
+ "content-type": "application/json"
522
+ };
523
+ return this.client.call(
524
+ "put",
525
+ uri,
526
+ apiHeaders,
527
+ payload
528
+ );
529
+ }
530
+ deleteCollection(paramsOrFirst, ...rest) {
531
+ let params;
532
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
533
+ params = paramsOrFirst || {};
534
+ } else {
535
+ params = {
536
+ databaseId: paramsOrFirst,
537
+ collectionId: rest[0]
538
+ };
539
+ }
540
+ const databaseId = params.databaseId;
541
+ const collectionId = params.collectionId;
542
+ if (typeof databaseId === "undefined") {
543
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
544
+ }
545
+ if (typeof collectionId === "undefined") {
546
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
547
+ }
548
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
549
+ const payload = {};
550
+ const uri = new URL(this.client.config.endpoint + apiPath);
551
+ const apiHeaders = {
552
+ "content-type": "application/json"
553
+ };
554
+ return this.client.call(
555
+ "delete",
556
+ uri,
557
+ apiHeaders,
558
+ payload
559
+ );
560
+ }
561
+ listAttributes(paramsOrFirst, ...rest) {
562
+ let params;
563
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
564
+ params = paramsOrFirst || {};
565
+ } else {
566
+ params = {
567
+ databaseId: paramsOrFirst,
568
+ collectionId: rest[0],
569
+ queries: rest[1],
570
+ total: rest[2]
571
+ };
572
+ }
573
+ const databaseId = params.databaseId;
574
+ const collectionId = params.collectionId;
575
+ const queries = params.queries;
576
+ const total = params.total;
577
+ if (typeof databaseId === "undefined") {
578
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
579
+ }
580
+ if (typeof collectionId === "undefined") {
581
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
582
+ }
583
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
584
+ const payload = {};
585
+ if (typeof queries !== "undefined") {
586
+ payload["queries"] = queries;
587
+ }
588
+ if (typeof total !== "undefined") {
589
+ payload["total"] = total;
590
+ }
591
+ const uri = new URL(this.client.config.endpoint + apiPath);
592
+ const apiHeaders = {};
593
+ return this.client.call(
594
+ "get",
595
+ uri,
596
+ apiHeaders,
597
+ payload
598
+ );
599
+ }
600
+ createBooleanAttribute(paramsOrFirst, ...rest) {
601
+ let params;
602
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
603
+ params = paramsOrFirst || {};
604
+ } else {
605
+ params = {
606
+ databaseId: paramsOrFirst,
607
+ collectionId: rest[0],
608
+ key: rest[1],
609
+ required: rest[2],
610
+ xdefault: rest[3],
611
+ array: rest[4]
612
+ };
613
+ }
614
+ const databaseId = params.databaseId;
615
+ const collectionId = params.collectionId;
616
+ const key = params.key;
617
+ const required = params.required;
618
+ const xdefault = params.xdefault;
619
+ const array = params.array;
620
+ if (typeof databaseId === "undefined") {
621
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
622
+ }
623
+ if (typeof collectionId === "undefined") {
624
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
625
+ }
626
+ if (typeof key === "undefined") {
627
+ throw new client.AppwriteException('Missing required parameter: "key"');
628
+ }
629
+ if (typeof required === "undefined") {
630
+ throw new client.AppwriteException('Missing required parameter: "required"');
631
+ }
632
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/boolean".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
633
+ const payload = {};
634
+ if (typeof key !== "undefined") {
635
+ payload["key"] = key;
636
+ }
637
+ if (typeof required !== "undefined") {
638
+ payload["required"] = required;
639
+ }
640
+ if (typeof xdefault !== "undefined") {
641
+ payload["default"] = xdefault;
642
+ }
643
+ if (typeof array !== "undefined") {
644
+ payload["array"] = array;
645
+ }
646
+ const uri = new URL(this.client.config.endpoint + apiPath);
647
+ const apiHeaders = {
648
+ "content-type": "application/json"
649
+ };
650
+ return this.client.call(
651
+ "post",
652
+ uri,
653
+ apiHeaders,
654
+ payload
655
+ );
656
+ }
657
+ updateBooleanAttribute(paramsOrFirst, ...rest) {
658
+ let params;
659
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
660
+ params = paramsOrFirst || {};
661
+ } else {
662
+ params = {
663
+ databaseId: paramsOrFirst,
664
+ collectionId: rest[0],
665
+ key: rest[1],
666
+ required: rest[2],
667
+ xdefault: rest[3],
668
+ newKey: rest[4]
669
+ };
670
+ }
671
+ const databaseId = params.databaseId;
672
+ const collectionId = params.collectionId;
673
+ const key = params.key;
674
+ const required = params.required;
675
+ const xdefault = params.xdefault;
676
+ const newKey = params.newKey;
677
+ if (typeof databaseId === "undefined") {
678
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
679
+ }
680
+ if (typeof collectionId === "undefined") {
681
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
682
+ }
683
+ if (typeof key === "undefined") {
684
+ throw new client.AppwriteException('Missing required parameter: "key"');
685
+ }
686
+ if (typeof required === "undefined") {
687
+ throw new client.AppwriteException('Missing required parameter: "required"');
688
+ }
689
+ if (typeof xdefault === "undefined") {
690
+ throw new client.AppwriteException('Missing required parameter: "xdefault"');
691
+ }
692
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
693
+ const payload = {};
694
+ if (typeof required !== "undefined") {
695
+ payload["required"] = required;
696
+ }
697
+ if (typeof xdefault !== "undefined") {
698
+ payload["default"] = xdefault;
699
+ }
700
+ if (typeof newKey !== "undefined") {
701
+ payload["newKey"] = newKey;
702
+ }
703
+ const uri = new URL(this.client.config.endpoint + apiPath);
704
+ const apiHeaders = {
705
+ "content-type": "application/json"
706
+ };
707
+ return this.client.call(
708
+ "patch",
709
+ uri,
710
+ apiHeaders,
711
+ payload
712
+ );
713
+ }
714
+ createDatetimeAttribute(paramsOrFirst, ...rest) {
715
+ let params;
716
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
717
+ params = paramsOrFirst || {};
718
+ } else {
719
+ params = {
720
+ databaseId: paramsOrFirst,
721
+ collectionId: rest[0],
722
+ key: rest[1],
723
+ required: rest[2],
724
+ xdefault: rest[3],
725
+ array: rest[4]
726
+ };
727
+ }
728
+ const databaseId = params.databaseId;
729
+ const collectionId = params.collectionId;
730
+ const key = params.key;
731
+ const required = params.required;
732
+ const xdefault = params.xdefault;
733
+ const array = params.array;
734
+ if (typeof databaseId === "undefined") {
735
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
736
+ }
737
+ if (typeof collectionId === "undefined") {
738
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
739
+ }
740
+ if (typeof key === "undefined") {
741
+ throw new client.AppwriteException('Missing required parameter: "key"');
742
+ }
743
+ if (typeof required === "undefined") {
744
+ throw new client.AppwriteException('Missing required parameter: "required"');
745
+ }
746
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/datetime".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
747
+ const payload = {};
748
+ if (typeof key !== "undefined") {
749
+ payload["key"] = key;
750
+ }
751
+ if (typeof required !== "undefined") {
752
+ payload["required"] = required;
753
+ }
754
+ if (typeof xdefault !== "undefined") {
755
+ payload["default"] = xdefault;
756
+ }
757
+ if (typeof array !== "undefined") {
758
+ payload["array"] = array;
759
+ }
760
+ const uri = new URL(this.client.config.endpoint + apiPath);
761
+ const apiHeaders = {
762
+ "content-type": "application/json"
763
+ };
764
+ return this.client.call(
765
+ "post",
766
+ uri,
767
+ apiHeaders,
768
+ payload
769
+ );
770
+ }
771
+ updateDatetimeAttribute(paramsOrFirst, ...rest) {
772
+ let params;
773
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
774
+ params = paramsOrFirst || {};
775
+ } else {
776
+ params = {
777
+ databaseId: paramsOrFirst,
778
+ collectionId: rest[0],
779
+ key: rest[1],
780
+ required: rest[2],
781
+ xdefault: rest[3],
782
+ newKey: rest[4]
783
+ };
784
+ }
785
+ const databaseId = params.databaseId;
786
+ const collectionId = params.collectionId;
787
+ const key = params.key;
788
+ const required = params.required;
789
+ const xdefault = params.xdefault;
790
+ const newKey = params.newKey;
791
+ if (typeof databaseId === "undefined") {
792
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
793
+ }
794
+ if (typeof collectionId === "undefined") {
795
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
796
+ }
797
+ if (typeof key === "undefined") {
798
+ throw new client.AppwriteException('Missing required parameter: "key"');
799
+ }
800
+ if (typeof required === "undefined") {
801
+ throw new client.AppwriteException('Missing required parameter: "required"');
802
+ }
803
+ if (typeof xdefault === "undefined") {
804
+ throw new client.AppwriteException('Missing required parameter: "xdefault"');
805
+ }
806
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
807
+ const payload = {};
808
+ if (typeof required !== "undefined") {
809
+ payload["required"] = required;
810
+ }
811
+ if (typeof xdefault !== "undefined") {
812
+ payload["default"] = xdefault;
813
+ }
814
+ if (typeof newKey !== "undefined") {
815
+ payload["newKey"] = newKey;
816
+ }
817
+ const uri = new URL(this.client.config.endpoint + apiPath);
818
+ const apiHeaders = {
819
+ "content-type": "application/json"
820
+ };
821
+ return this.client.call(
822
+ "patch",
823
+ uri,
824
+ apiHeaders,
825
+ payload
826
+ );
827
+ }
828
+ createEmailAttribute(paramsOrFirst, ...rest) {
829
+ let params;
830
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
831
+ params = paramsOrFirst || {};
832
+ } else {
833
+ params = {
834
+ databaseId: paramsOrFirst,
835
+ collectionId: rest[0],
836
+ key: rest[1],
837
+ required: rest[2],
838
+ xdefault: rest[3],
839
+ array: rest[4]
840
+ };
841
+ }
842
+ const databaseId = params.databaseId;
843
+ const collectionId = params.collectionId;
844
+ const key = params.key;
845
+ const required = params.required;
846
+ const xdefault = params.xdefault;
847
+ const array = params.array;
848
+ if (typeof databaseId === "undefined") {
849
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
850
+ }
851
+ if (typeof collectionId === "undefined") {
852
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
853
+ }
854
+ if (typeof key === "undefined") {
855
+ throw new client.AppwriteException('Missing required parameter: "key"');
856
+ }
857
+ if (typeof required === "undefined") {
858
+ throw new client.AppwriteException('Missing required parameter: "required"');
859
+ }
860
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/email".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
861
+ const payload = {};
862
+ if (typeof key !== "undefined") {
863
+ payload["key"] = key;
864
+ }
865
+ if (typeof required !== "undefined") {
866
+ payload["required"] = required;
867
+ }
868
+ if (typeof xdefault !== "undefined") {
869
+ payload["default"] = xdefault;
870
+ }
871
+ if (typeof array !== "undefined") {
872
+ payload["array"] = array;
873
+ }
874
+ const uri = new URL(this.client.config.endpoint + apiPath);
875
+ const apiHeaders = {
876
+ "content-type": "application/json"
877
+ };
878
+ return this.client.call(
879
+ "post",
880
+ uri,
881
+ apiHeaders,
882
+ payload
883
+ );
884
+ }
885
+ updateEmailAttribute(paramsOrFirst, ...rest) {
886
+ let params;
887
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
888
+ params = paramsOrFirst || {};
889
+ } else {
890
+ params = {
891
+ databaseId: paramsOrFirst,
892
+ collectionId: rest[0],
893
+ key: rest[1],
894
+ required: rest[2],
895
+ xdefault: rest[3],
896
+ newKey: rest[4]
897
+ };
898
+ }
899
+ const databaseId = params.databaseId;
900
+ const collectionId = params.collectionId;
901
+ const key = params.key;
902
+ const required = params.required;
903
+ const xdefault = params.xdefault;
904
+ const newKey = params.newKey;
905
+ if (typeof databaseId === "undefined") {
906
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
907
+ }
908
+ if (typeof collectionId === "undefined") {
909
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
910
+ }
911
+ if (typeof key === "undefined") {
912
+ throw new client.AppwriteException('Missing required parameter: "key"');
913
+ }
914
+ if (typeof required === "undefined") {
915
+ throw new client.AppwriteException('Missing required parameter: "required"');
916
+ }
917
+ if (typeof xdefault === "undefined") {
918
+ throw new client.AppwriteException('Missing required parameter: "xdefault"');
919
+ }
920
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
921
+ const payload = {};
922
+ if (typeof required !== "undefined") {
923
+ payload["required"] = required;
924
+ }
925
+ if (typeof xdefault !== "undefined") {
926
+ payload["default"] = xdefault;
927
+ }
928
+ if (typeof newKey !== "undefined") {
929
+ payload["newKey"] = newKey;
930
+ }
931
+ const uri = new URL(this.client.config.endpoint + apiPath);
932
+ const apiHeaders = {
933
+ "content-type": "application/json"
934
+ };
935
+ return this.client.call(
936
+ "patch",
937
+ uri,
938
+ apiHeaders,
939
+ payload
940
+ );
941
+ }
942
+ createEnumAttribute(paramsOrFirst, ...rest) {
943
+ let params;
944
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
945
+ params = paramsOrFirst || {};
946
+ } else {
947
+ params = {
948
+ databaseId: paramsOrFirst,
949
+ collectionId: rest[0],
950
+ key: rest[1],
951
+ elements: rest[2],
952
+ required: rest[3],
953
+ xdefault: rest[4],
954
+ array: rest[5]
955
+ };
956
+ }
957
+ const databaseId = params.databaseId;
958
+ const collectionId = params.collectionId;
959
+ const key = params.key;
960
+ const elements = params.elements;
961
+ const required = params.required;
962
+ const xdefault = params.xdefault;
963
+ const array = params.array;
964
+ if (typeof databaseId === "undefined") {
965
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
966
+ }
967
+ if (typeof collectionId === "undefined") {
968
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
969
+ }
970
+ if (typeof key === "undefined") {
971
+ throw new client.AppwriteException('Missing required parameter: "key"');
972
+ }
973
+ if (typeof elements === "undefined") {
974
+ throw new client.AppwriteException('Missing required parameter: "elements"');
975
+ }
976
+ if (typeof required === "undefined") {
977
+ throw new client.AppwriteException('Missing required parameter: "required"');
978
+ }
979
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/enum".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
980
+ const payload = {};
981
+ if (typeof key !== "undefined") {
982
+ payload["key"] = key;
983
+ }
984
+ if (typeof elements !== "undefined") {
985
+ payload["elements"] = elements;
986
+ }
987
+ if (typeof required !== "undefined") {
988
+ payload["required"] = required;
989
+ }
990
+ if (typeof xdefault !== "undefined") {
991
+ payload["default"] = xdefault;
992
+ }
993
+ if (typeof array !== "undefined") {
994
+ payload["array"] = array;
995
+ }
996
+ const uri = new URL(this.client.config.endpoint + apiPath);
997
+ const apiHeaders = {
998
+ "content-type": "application/json"
999
+ };
1000
+ return this.client.call(
1001
+ "post",
1002
+ uri,
1003
+ apiHeaders,
1004
+ payload
1005
+ );
1006
+ }
1007
+ updateEnumAttribute(paramsOrFirst, ...rest) {
1008
+ let params;
1009
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1010
+ params = paramsOrFirst || {};
1011
+ } else {
1012
+ params = {
1013
+ databaseId: paramsOrFirst,
1014
+ collectionId: rest[0],
1015
+ key: rest[1],
1016
+ elements: rest[2],
1017
+ required: rest[3],
1018
+ xdefault: rest[4],
1019
+ newKey: rest[5]
1020
+ };
1021
+ }
1022
+ const databaseId = params.databaseId;
1023
+ const collectionId = params.collectionId;
1024
+ const key = params.key;
1025
+ const elements = params.elements;
1026
+ const required = params.required;
1027
+ const xdefault = params.xdefault;
1028
+ const newKey = params.newKey;
1029
+ if (typeof databaseId === "undefined") {
1030
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1031
+ }
1032
+ if (typeof collectionId === "undefined") {
1033
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1034
+ }
1035
+ if (typeof key === "undefined") {
1036
+ throw new client.AppwriteException('Missing required parameter: "key"');
1037
+ }
1038
+ if (typeof elements === "undefined") {
1039
+ throw new client.AppwriteException('Missing required parameter: "elements"');
1040
+ }
1041
+ if (typeof required === "undefined") {
1042
+ throw new client.AppwriteException('Missing required parameter: "required"');
1043
+ }
1044
+ if (typeof xdefault === "undefined") {
1045
+ throw new client.AppwriteException('Missing required parameter: "xdefault"');
1046
+ }
1047
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
1048
+ const payload = {};
1049
+ if (typeof elements !== "undefined") {
1050
+ payload["elements"] = elements;
1051
+ }
1052
+ if (typeof required !== "undefined") {
1053
+ payload["required"] = required;
1054
+ }
1055
+ if (typeof xdefault !== "undefined") {
1056
+ payload["default"] = xdefault;
1057
+ }
1058
+ if (typeof newKey !== "undefined") {
1059
+ payload["newKey"] = newKey;
1060
+ }
1061
+ const uri = new URL(this.client.config.endpoint + apiPath);
1062
+ const apiHeaders = {
1063
+ "content-type": "application/json"
1064
+ };
1065
+ return this.client.call(
1066
+ "patch",
1067
+ uri,
1068
+ apiHeaders,
1069
+ payload
1070
+ );
1071
+ }
1072
+ createFloatAttribute(paramsOrFirst, ...rest) {
1073
+ let params;
1074
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1075
+ params = paramsOrFirst || {};
1076
+ } else {
1077
+ params = {
1078
+ databaseId: paramsOrFirst,
1079
+ collectionId: rest[0],
1080
+ key: rest[1],
1081
+ required: rest[2],
1082
+ min: rest[3],
1083
+ max: rest[4],
1084
+ xdefault: rest[5],
1085
+ array: rest[6]
1086
+ };
1087
+ }
1088
+ const databaseId = params.databaseId;
1089
+ const collectionId = params.collectionId;
1090
+ const key = params.key;
1091
+ const required = params.required;
1092
+ const min = params.min;
1093
+ const max = params.max;
1094
+ const xdefault = params.xdefault;
1095
+ const array = params.array;
1096
+ if (typeof databaseId === "undefined") {
1097
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1098
+ }
1099
+ if (typeof collectionId === "undefined") {
1100
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1101
+ }
1102
+ if (typeof key === "undefined") {
1103
+ throw new client.AppwriteException('Missing required parameter: "key"');
1104
+ }
1105
+ if (typeof required === "undefined") {
1106
+ throw new client.AppwriteException('Missing required parameter: "required"');
1107
+ }
1108
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/float".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1109
+ const payload = {};
1110
+ if (typeof key !== "undefined") {
1111
+ payload["key"] = key;
1112
+ }
1113
+ if (typeof required !== "undefined") {
1114
+ payload["required"] = required;
1115
+ }
1116
+ if (typeof min !== "undefined") {
1117
+ payload["min"] = min;
1118
+ }
1119
+ if (typeof max !== "undefined") {
1120
+ payload["max"] = max;
1121
+ }
1122
+ if (typeof xdefault !== "undefined") {
1123
+ payload["default"] = xdefault;
1124
+ }
1125
+ if (typeof array !== "undefined") {
1126
+ payload["array"] = array;
1127
+ }
1128
+ const uri = new URL(this.client.config.endpoint + apiPath);
1129
+ const apiHeaders = {
1130
+ "content-type": "application/json"
1131
+ };
1132
+ return this.client.call(
1133
+ "post",
1134
+ uri,
1135
+ apiHeaders,
1136
+ payload
1137
+ );
1138
+ }
1139
+ updateFloatAttribute(paramsOrFirst, ...rest) {
1140
+ let params;
1141
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1142
+ params = paramsOrFirst || {};
1143
+ } else {
1144
+ params = {
1145
+ databaseId: paramsOrFirst,
1146
+ collectionId: rest[0],
1147
+ key: rest[1],
1148
+ required: rest[2],
1149
+ xdefault: rest[3],
1150
+ min: rest[4],
1151
+ max: rest[5],
1152
+ newKey: rest[6]
1153
+ };
1154
+ }
1155
+ const databaseId = params.databaseId;
1156
+ const collectionId = params.collectionId;
1157
+ const key = params.key;
1158
+ const required = params.required;
1159
+ const xdefault = params.xdefault;
1160
+ const min = params.min;
1161
+ const max = params.max;
1162
+ const newKey = params.newKey;
1163
+ if (typeof databaseId === "undefined") {
1164
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1165
+ }
1166
+ if (typeof collectionId === "undefined") {
1167
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1168
+ }
1169
+ if (typeof key === "undefined") {
1170
+ throw new client.AppwriteException('Missing required parameter: "key"');
1171
+ }
1172
+ if (typeof required === "undefined") {
1173
+ throw new client.AppwriteException('Missing required parameter: "required"');
1174
+ }
1175
+ if (typeof xdefault === "undefined") {
1176
+ throw new client.AppwriteException('Missing required parameter: "xdefault"');
1177
+ }
1178
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
1179
+ const payload = {};
1180
+ if (typeof required !== "undefined") {
1181
+ payload["required"] = required;
1182
+ }
1183
+ if (typeof min !== "undefined") {
1184
+ payload["min"] = min;
1185
+ }
1186
+ if (typeof max !== "undefined") {
1187
+ payload["max"] = max;
1188
+ }
1189
+ if (typeof xdefault !== "undefined") {
1190
+ payload["default"] = xdefault;
1191
+ }
1192
+ if (typeof newKey !== "undefined") {
1193
+ payload["newKey"] = newKey;
1194
+ }
1195
+ const uri = new URL(this.client.config.endpoint + apiPath);
1196
+ const apiHeaders = {
1197
+ "content-type": "application/json"
1198
+ };
1199
+ return this.client.call(
1200
+ "patch",
1201
+ uri,
1202
+ apiHeaders,
1203
+ payload
1204
+ );
1205
+ }
1206
+ createIntegerAttribute(paramsOrFirst, ...rest) {
1207
+ let params;
1208
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1209
+ params = paramsOrFirst || {};
1210
+ } else {
1211
+ params = {
1212
+ databaseId: paramsOrFirst,
1213
+ collectionId: rest[0],
1214
+ key: rest[1],
1215
+ required: rest[2],
1216
+ min: rest[3],
1217
+ max: rest[4],
1218
+ xdefault: rest[5],
1219
+ array: rest[6]
1220
+ };
1221
+ }
1222
+ const databaseId = params.databaseId;
1223
+ const collectionId = params.collectionId;
1224
+ const key = params.key;
1225
+ const required = params.required;
1226
+ const min = params.min;
1227
+ const max = params.max;
1228
+ const xdefault = params.xdefault;
1229
+ const array = params.array;
1230
+ if (typeof databaseId === "undefined") {
1231
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1232
+ }
1233
+ if (typeof collectionId === "undefined") {
1234
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1235
+ }
1236
+ if (typeof key === "undefined") {
1237
+ throw new client.AppwriteException('Missing required parameter: "key"');
1238
+ }
1239
+ if (typeof required === "undefined") {
1240
+ throw new client.AppwriteException('Missing required parameter: "required"');
1241
+ }
1242
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/integer".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1243
+ const payload = {};
1244
+ if (typeof key !== "undefined") {
1245
+ payload["key"] = key;
1246
+ }
1247
+ if (typeof required !== "undefined") {
1248
+ payload["required"] = required;
1249
+ }
1250
+ if (typeof min !== "undefined") {
1251
+ payload["min"] = min;
1252
+ }
1253
+ if (typeof max !== "undefined") {
1254
+ payload["max"] = max;
1255
+ }
1256
+ if (typeof xdefault !== "undefined") {
1257
+ payload["default"] = xdefault;
1258
+ }
1259
+ if (typeof array !== "undefined") {
1260
+ payload["array"] = array;
1261
+ }
1262
+ const uri = new URL(this.client.config.endpoint + apiPath);
1263
+ const apiHeaders = {
1264
+ "content-type": "application/json"
1265
+ };
1266
+ return this.client.call(
1267
+ "post",
1268
+ uri,
1269
+ apiHeaders,
1270
+ payload
1271
+ );
1272
+ }
1273
+ updateIntegerAttribute(paramsOrFirst, ...rest) {
1274
+ let params;
1275
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1276
+ params = paramsOrFirst || {};
1277
+ } else {
1278
+ params = {
1279
+ databaseId: paramsOrFirst,
1280
+ collectionId: rest[0],
1281
+ key: rest[1],
1282
+ required: rest[2],
1283
+ xdefault: rest[3],
1284
+ min: rest[4],
1285
+ max: rest[5],
1286
+ newKey: rest[6]
1287
+ };
1288
+ }
1289
+ const databaseId = params.databaseId;
1290
+ const collectionId = params.collectionId;
1291
+ const key = params.key;
1292
+ const required = params.required;
1293
+ const xdefault = params.xdefault;
1294
+ const min = params.min;
1295
+ const max = params.max;
1296
+ const newKey = params.newKey;
1297
+ if (typeof databaseId === "undefined") {
1298
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1299
+ }
1300
+ if (typeof collectionId === "undefined") {
1301
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1302
+ }
1303
+ if (typeof key === "undefined") {
1304
+ throw new client.AppwriteException('Missing required parameter: "key"');
1305
+ }
1306
+ if (typeof required === "undefined") {
1307
+ throw new client.AppwriteException('Missing required parameter: "required"');
1308
+ }
1309
+ if (typeof xdefault === "undefined") {
1310
+ throw new client.AppwriteException('Missing required parameter: "xdefault"');
1311
+ }
1312
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
1313
+ const payload = {};
1314
+ if (typeof required !== "undefined") {
1315
+ payload["required"] = required;
1316
+ }
1317
+ if (typeof min !== "undefined") {
1318
+ payload["min"] = min;
1319
+ }
1320
+ if (typeof max !== "undefined") {
1321
+ payload["max"] = max;
1322
+ }
1323
+ if (typeof xdefault !== "undefined") {
1324
+ payload["default"] = xdefault;
1325
+ }
1326
+ if (typeof newKey !== "undefined") {
1327
+ payload["newKey"] = newKey;
1328
+ }
1329
+ const uri = new URL(this.client.config.endpoint + apiPath);
1330
+ const apiHeaders = {
1331
+ "content-type": "application/json"
1332
+ };
1333
+ return this.client.call(
1334
+ "patch",
1335
+ uri,
1336
+ apiHeaders,
1337
+ payload
1338
+ );
1339
+ }
1340
+ createIpAttribute(paramsOrFirst, ...rest) {
1341
+ let params;
1342
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1343
+ params = paramsOrFirst || {};
1344
+ } else {
1345
+ params = {
1346
+ databaseId: paramsOrFirst,
1347
+ collectionId: rest[0],
1348
+ key: rest[1],
1349
+ required: rest[2],
1350
+ xdefault: rest[3],
1351
+ array: rest[4]
1352
+ };
1353
+ }
1354
+ const databaseId = params.databaseId;
1355
+ const collectionId = params.collectionId;
1356
+ const key = params.key;
1357
+ const required = params.required;
1358
+ const xdefault = params.xdefault;
1359
+ const array = params.array;
1360
+ if (typeof databaseId === "undefined") {
1361
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1362
+ }
1363
+ if (typeof collectionId === "undefined") {
1364
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1365
+ }
1366
+ if (typeof key === "undefined") {
1367
+ throw new client.AppwriteException('Missing required parameter: "key"');
1368
+ }
1369
+ if (typeof required === "undefined") {
1370
+ throw new client.AppwriteException('Missing required parameter: "required"');
1371
+ }
1372
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/ip".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1373
+ const payload = {};
1374
+ if (typeof key !== "undefined") {
1375
+ payload["key"] = key;
1376
+ }
1377
+ if (typeof required !== "undefined") {
1378
+ payload["required"] = required;
1379
+ }
1380
+ if (typeof xdefault !== "undefined") {
1381
+ payload["default"] = xdefault;
1382
+ }
1383
+ if (typeof array !== "undefined") {
1384
+ payload["array"] = array;
1385
+ }
1386
+ const uri = new URL(this.client.config.endpoint + apiPath);
1387
+ const apiHeaders = {
1388
+ "content-type": "application/json"
1389
+ };
1390
+ return this.client.call(
1391
+ "post",
1392
+ uri,
1393
+ apiHeaders,
1394
+ payload
1395
+ );
1396
+ }
1397
+ updateIpAttribute(paramsOrFirst, ...rest) {
1398
+ let params;
1399
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1400
+ params = paramsOrFirst || {};
1401
+ } else {
1402
+ params = {
1403
+ databaseId: paramsOrFirst,
1404
+ collectionId: rest[0],
1405
+ key: rest[1],
1406
+ required: rest[2],
1407
+ xdefault: rest[3],
1408
+ newKey: rest[4]
1409
+ };
1410
+ }
1411
+ const databaseId = params.databaseId;
1412
+ const collectionId = params.collectionId;
1413
+ const key = params.key;
1414
+ const required = params.required;
1415
+ const xdefault = params.xdefault;
1416
+ const newKey = params.newKey;
1417
+ if (typeof databaseId === "undefined") {
1418
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1419
+ }
1420
+ if (typeof collectionId === "undefined") {
1421
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1422
+ }
1423
+ if (typeof key === "undefined") {
1424
+ throw new client.AppwriteException('Missing required parameter: "key"');
1425
+ }
1426
+ if (typeof required === "undefined") {
1427
+ throw new client.AppwriteException('Missing required parameter: "required"');
1428
+ }
1429
+ if (typeof xdefault === "undefined") {
1430
+ throw new client.AppwriteException('Missing required parameter: "xdefault"');
1431
+ }
1432
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
1433
+ const payload = {};
1434
+ if (typeof required !== "undefined") {
1435
+ payload["required"] = required;
1436
+ }
1437
+ if (typeof xdefault !== "undefined") {
1438
+ payload["default"] = xdefault;
1439
+ }
1440
+ if (typeof newKey !== "undefined") {
1441
+ payload["newKey"] = newKey;
1442
+ }
1443
+ const uri = new URL(this.client.config.endpoint + apiPath);
1444
+ const apiHeaders = {
1445
+ "content-type": "application/json"
1446
+ };
1447
+ return this.client.call(
1448
+ "patch",
1449
+ uri,
1450
+ apiHeaders,
1451
+ payload
1452
+ );
1453
+ }
1454
+ createLineAttribute(paramsOrFirst, ...rest) {
1455
+ let params;
1456
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1457
+ params = paramsOrFirst || {};
1458
+ } else {
1459
+ params = {
1460
+ databaseId: paramsOrFirst,
1461
+ collectionId: rest[0],
1462
+ key: rest[1],
1463
+ required: rest[2],
1464
+ xdefault: rest[3]
1465
+ };
1466
+ }
1467
+ const databaseId = params.databaseId;
1468
+ const collectionId = params.collectionId;
1469
+ const key = params.key;
1470
+ const required = params.required;
1471
+ const xdefault = params.xdefault;
1472
+ if (typeof databaseId === "undefined") {
1473
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1474
+ }
1475
+ if (typeof collectionId === "undefined") {
1476
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1477
+ }
1478
+ if (typeof key === "undefined") {
1479
+ throw new client.AppwriteException('Missing required parameter: "key"');
1480
+ }
1481
+ if (typeof required === "undefined") {
1482
+ throw new client.AppwriteException('Missing required parameter: "required"');
1483
+ }
1484
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/line".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1485
+ const payload = {};
1486
+ if (typeof key !== "undefined") {
1487
+ payload["key"] = key;
1488
+ }
1489
+ if (typeof required !== "undefined") {
1490
+ payload["required"] = required;
1491
+ }
1492
+ if (typeof xdefault !== "undefined") {
1493
+ payload["default"] = xdefault;
1494
+ }
1495
+ const uri = new URL(this.client.config.endpoint + apiPath);
1496
+ const apiHeaders = {
1497
+ "content-type": "application/json"
1498
+ };
1499
+ return this.client.call(
1500
+ "post",
1501
+ uri,
1502
+ apiHeaders,
1503
+ payload
1504
+ );
1505
+ }
1506
+ updateLineAttribute(paramsOrFirst, ...rest) {
1507
+ let params;
1508
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1509
+ params = paramsOrFirst || {};
1510
+ } else {
1511
+ params = {
1512
+ databaseId: paramsOrFirst,
1513
+ collectionId: rest[0],
1514
+ key: rest[1],
1515
+ required: rest[2],
1516
+ xdefault: rest[3],
1517
+ newKey: rest[4]
1518
+ };
1519
+ }
1520
+ const databaseId = params.databaseId;
1521
+ const collectionId = params.collectionId;
1522
+ const key = params.key;
1523
+ const required = params.required;
1524
+ const xdefault = params.xdefault;
1525
+ const newKey = params.newKey;
1526
+ if (typeof databaseId === "undefined") {
1527
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1528
+ }
1529
+ if (typeof collectionId === "undefined") {
1530
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1531
+ }
1532
+ if (typeof key === "undefined") {
1533
+ throw new client.AppwriteException('Missing required parameter: "key"');
1534
+ }
1535
+ if (typeof required === "undefined") {
1536
+ throw new client.AppwriteException('Missing required parameter: "required"');
1537
+ }
1538
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/line/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
1539
+ const payload = {};
1540
+ if (typeof required !== "undefined") {
1541
+ payload["required"] = required;
1542
+ }
1543
+ if (typeof xdefault !== "undefined") {
1544
+ payload["default"] = xdefault;
1545
+ }
1546
+ if (typeof newKey !== "undefined") {
1547
+ payload["newKey"] = newKey;
1548
+ }
1549
+ const uri = new URL(this.client.config.endpoint + apiPath);
1550
+ const apiHeaders = {
1551
+ "content-type": "application/json"
1552
+ };
1553
+ return this.client.call(
1554
+ "patch",
1555
+ uri,
1556
+ apiHeaders,
1557
+ payload
1558
+ );
1559
+ }
1560
+ createPointAttribute(paramsOrFirst, ...rest) {
1561
+ let params;
1562
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1563
+ params = paramsOrFirst || {};
1564
+ } else {
1565
+ params = {
1566
+ databaseId: paramsOrFirst,
1567
+ collectionId: rest[0],
1568
+ key: rest[1],
1569
+ required: rest[2],
1570
+ xdefault: rest[3]
1571
+ };
1572
+ }
1573
+ const databaseId = params.databaseId;
1574
+ const collectionId = params.collectionId;
1575
+ const key = params.key;
1576
+ const required = params.required;
1577
+ const xdefault = params.xdefault;
1578
+ if (typeof databaseId === "undefined") {
1579
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1580
+ }
1581
+ if (typeof collectionId === "undefined") {
1582
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1583
+ }
1584
+ if (typeof key === "undefined") {
1585
+ throw new client.AppwriteException('Missing required parameter: "key"');
1586
+ }
1587
+ if (typeof required === "undefined") {
1588
+ throw new client.AppwriteException('Missing required parameter: "required"');
1589
+ }
1590
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/point".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1591
+ const payload = {};
1592
+ if (typeof key !== "undefined") {
1593
+ payload["key"] = key;
1594
+ }
1595
+ if (typeof required !== "undefined") {
1596
+ payload["required"] = required;
1597
+ }
1598
+ if (typeof xdefault !== "undefined") {
1599
+ payload["default"] = xdefault;
1600
+ }
1601
+ const uri = new URL(this.client.config.endpoint + apiPath);
1602
+ const apiHeaders = {
1603
+ "content-type": "application/json"
1604
+ };
1605
+ return this.client.call(
1606
+ "post",
1607
+ uri,
1608
+ apiHeaders,
1609
+ payload
1610
+ );
1611
+ }
1612
+ updatePointAttribute(paramsOrFirst, ...rest) {
1613
+ let params;
1614
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1615
+ params = paramsOrFirst || {};
1616
+ } else {
1617
+ params = {
1618
+ databaseId: paramsOrFirst,
1619
+ collectionId: rest[0],
1620
+ key: rest[1],
1621
+ required: rest[2],
1622
+ xdefault: rest[3],
1623
+ newKey: rest[4]
1624
+ };
1625
+ }
1626
+ const databaseId = params.databaseId;
1627
+ const collectionId = params.collectionId;
1628
+ const key = params.key;
1629
+ const required = params.required;
1630
+ const xdefault = params.xdefault;
1631
+ const newKey = params.newKey;
1632
+ if (typeof databaseId === "undefined") {
1633
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1634
+ }
1635
+ if (typeof collectionId === "undefined") {
1636
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1637
+ }
1638
+ if (typeof key === "undefined") {
1639
+ throw new client.AppwriteException('Missing required parameter: "key"');
1640
+ }
1641
+ if (typeof required === "undefined") {
1642
+ throw new client.AppwriteException('Missing required parameter: "required"');
1643
+ }
1644
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/point/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
1645
+ const payload = {};
1646
+ if (typeof required !== "undefined") {
1647
+ payload["required"] = required;
1648
+ }
1649
+ if (typeof xdefault !== "undefined") {
1650
+ payload["default"] = xdefault;
1651
+ }
1652
+ if (typeof newKey !== "undefined") {
1653
+ payload["newKey"] = newKey;
1654
+ }
1655
+ const uri = new URL(this.client.config.endpoint + apiPath);
1656
+ const apiHeaders = {
1657
+ "content-type": "application/json"
1658
+ };
1659
+ return this.client.call(
1660
+ "patch",
1661
+ uri,
1662
+ apiHeaders,
1663
+ payload
1664
+ );
1665
+ }
1666
+ createPolygonAttribute(paramsOrFirst, ...rest) {
1667
+ let params;
1668
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1669
+ params = paramsOrFirst || {};
1670
+ } else {
1671
+ params = {
1672
+ databaseId: paramsOrFirst,
1673
+ collectionId: rest[0],
1674
+ key: rest[1],
1675
+ required: rest[2],
1676
+ xdefault: rest[3]
1677
+ };
1678
+ }
1679
+ const databaseId = params.databaseId;
1680
+ const collectionId = params.collectionId;
1681
+ const key = params.key;
1682
+ const required = params.required;
1683
+ const xdefault = params.xdefault;
1684
+ if (typeof databaseId === "undefined") {
1685
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1686
+ }
1687
+ if (typeof collectionId === "undefined") {
1688
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1689
+ }
1690
+ if (typeof key === "undefined") {
1691
+ throw new client.AppwriteException('Missing required parameter: "key"');
1692
+ }
1693
+ if (typeof required === "undefined") {
1694
+ throw new client.AppwriteException('Missing required parameter: "required"');
1695
+ }
1696
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/polygon".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1697
+ const payload = {};
1698
+ if (typeof key !== "undefined") {
1699
+ payload["key"] = key;
1700
+ }
1701
+ if (typeof required !== "undefined") {
1702
+ payload["required"] = required;
1703
+ }
1704
+ if (typeof xdefault !== "undefined") {
1705
+ payload["default"] = xdefault;
1706
+ }
1707
+ const uri = new URL(this.client.config.endpoint + apiPath);
1708
+ const apiHeaders = {
1709
+ "content-type": "application/json"
1710
+ };
1711
+ return this.client.call(
1712
+ "post",
1713
+ uri,
1714
+ apiHeaders,
1715
+ payload
1716
+ );
1717
+ }
1718
+ updatePolygonAttribute(paramsOrFirst, ...rest) {
1719
+ let params;
1720
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1721
+ params = paramsOrFirst || {};
1722
+ } else {
1723
+ params = {
1724
+ databaseId: paramsOrFirst,
1725
+ collectionId: rest[0],
1726
+ key: rest[1],
1727
+ required: rest[2],
1728
+ xdefault: rest[3],
1729
+ newKey: rest[4]
1730
+ };
1731
+ }
1732
+ const databaseId = params.databaseId;
1733
+ const collectionId = params.collectionId;
1734
+ const key = params.key;
1735
+ const required = params.required;
1736
+ const xdefault = params.xdefault;
1737
+ const newKey = params.newKey;
1738
+ if (typeof databaseId === "undefined") {
1739
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1740
+ }
1741
+ if (typeof collectionId === "undefined") {
1742
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1743
+ }
1744
+ if (typeof key === "undefined") {
1745
+ throw new client.AppwriteException('Missing required parameter: "key"');
1746
+ }
1747
+ if (typeof required === "undefined") {
1748
+ throw new client.AppwriteException('Missing required parameter: "required"');
1749
+ }
1750
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
1751
+ const payload = {};
1752
+ if (typeof required !== "undefined") {
1753
+ payload["required"] = required;
1754
+ }
1755
+ if (typeof xdefault !== "undefined") {
1756
+ payload["default"] = xdefault;
1757
+ }
1758
+ if (typeof newKey !== "undefined") {
1759
+ payload["newKey"] = newKey;
1760
+ }
1761
+ const uri = new URL(this.client.config.endpoint + apiPath);
1762
+ const apiHeaders = {
1763
+ "content-type": "application/json"
1764
+ };
1765
+ return this.client.call(
1766
+ "patch",
1767
+ uri,
1768
+ apiHeaders,
1769
+ payload
1770
+ );
1771
+ }
1772
+ createRelationshipAttribute(paramsOrFirst, ...rest) {
1773
+ let params;
1774
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1775
+ params = paramsOrFirst || {};
1776
+ } else {
1777
+ params = {
1778
+ databaseId: paramsOrFirst,
1779
+ collectionId: rest[0],
1780
+ relatedCollectionId: rest[1],
1781
+ type: rest[2],
1782
+ twoWay: rest[3],
1783
+ key: rest[4],
1784
+ twoWayKey: rest[5],
1785
+ onDelete: rest[6]
1786
+ };
1787
+ }
1788
+ const databaseId = params.databaseId;
1789
+ const collectionId = params.collectionId;
1790
+ const relatedCollectionId = params.relatedCollectionId;
1791
+ const type = params.type;
1792
+ const twoWay = params.twoWay;
1793
+ const key = params.key;
1794
+ const twoWayKey = params.twoWayKey;
1795
+ const onDelete = params.onDelete;
1796
+ if (typeof databaseId === "undefined") {
1797
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1798
+ }
1799
+ if (typeof collectionId === "undefined") {
1800
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1801
+ }
1802
+ if (typeof relatedCollectionId === "undefined") {
1803
+ throw new client.AppwriteException('Missing required parameter: "relatedCollectionId"');
1804
+ }
1805
+ if (typeof type === "undefined") {
1806
+ throw new client.AppwriteException('Missing required parameter: "type"');
1807
+ }
1808
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/relationship".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1809
+ const payload = {};
1810
+ if (typeof relatedCollectionId !== "undefined") {
1811
+ payload["relatedCollectionId"] = relatedCollectionId;
1812
+ }
1813
+ if (typeof type !== "undefined") {
1814
+ payload["type"] = type;
1815
+ }
1816
+ if (typeof twoWay !== "undefined") {
1817
+ payload["twoWay"] = twoWay;
1818
+ }
1819
+ if (typeof key !== "undefined") {
1820
+ payload["key"] = key;
1821
+ }
1822
+ if (typeof twoWayKey !== "undefined") {
1823
+ payload["twoWayKey"] = twoWayKey;
1824
+ }
1825
+ if (typeof onDelete !== "undefined") {
1826
+ payload["onDelete"] = onDelete;
1827
+ }
1828
+ const uri = new URL(this.client.config.endpoint + apiPath);
1829
+ const apiHeaders = {
1830
+ "content-type": "application/json"
1831
+ };
1832
+ return this.client.call(
1833
+ "post",
1834
+ uri,
1835
+ apiHeaders,
1836
+ payload
1837
+ );
1838
+ }
1839
+ createStringAttribute(paramsOrFirst, ...rest) {
1840
+ let params;
1841
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1842
+ params = paramsOrFirst || {};
1843
+ } else {
1844
+ params = {
1845
+ databaseId: paramsOrFirst,
1846
+ collectionId: rest[0],
1847
+ key: rest[1],
1848
+ size: rest[2],
1849
+ required: rest[3],
1850
+ xdefault: rest[4],
1851
+ array: rest[5],
1852
+ encrypt: rest[6]
1853
+ };
1854
+ }
1855
+ const databaseId = params.databaseId;
1856
+ const collectionId = params.collectionId;
1857
+ const key = params.key;
1858
+ const size = params.size;
1859
+ const required = params.required;
1860
+ const xdefault = params.xdefault;
1861
+ const array = params.array;
1862
+ const encrypt = params.encrypt;
1863
+ if (typeof databaseId === "undefined") {
1864
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1865
+ }
1866
+ if (typeof collectionId === "undefined") {
1867
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1868
+ }
1869
+ if (typeof key === "undefined") {
1870
+ throw new client.AppwriteException('Missing required parameter: "key"');
1871
+ }
1872
+ if (typeof size === "undefined") {
1873
+ throw new client.AppwriteException('Missing required parameter: "size"');
1874
+ }
1875
+ if (typeof required === "undefined") {
1876
+ throw new client.AppwriteException('Missing required parameter: "required"');
1877
+ }
1878
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/string".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1879
+ const payload = {};
1880
+ if (typeof key !== "undefined") {
1881
+ payload["key"] = key;
1882
+ }
1883
+ if (typeof size !== "undefined") {
1884
+ payload["size"] = size;
1885
+ }
1886
+ if (typeof required !== "undefined") {
1887
+ payload["required"] = required;
1888
+ }
1889
+ if (typeof xdefault !== "undefined") {
1890
+ payload["default"] = xdefault;
1891
+ }
1892
+ if (typeof array !== "undefined") {
1893
+ payload["array"] = array;
1894
+ }
1895
+ if (typeof encrypt !== "undefined") {
1896
+ payload["encrypt"] = encrypt;
1897
+ }
1898
+ const uri = new URL(this.client.config.endpoint + apiPath);
1899
+ const apiHeaders = {
1900
+ "content-type": "application/json"
1901
+ };
1902
+ return this.client.call(
1903
+ "post",
1904
+ uri,
1905
+ apiHeaders,
1906
+ payload
1907
+ );
1908
+ }
1909
+ updateStringAttribute(paramsOrFirst, ...rest) {
1910
+ let params;
1911
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1912
+ params = paramsOrFirst || {};
1913
+ } else {
1914
+ params = {
1915
+ databaseId: paramsOrFirst,
1916
+ collectionId: rest[0],
1917
+ key: rest[1],
1918
+ required: rest[2],
1919
+ xdefault: rest[3],
1920
+ size: rest[4],
1921
+ newKey: rest[5]
1922
+ };
1923
+ }
1924
+ const databaseId = params.databaseId;
1925
+ const collectionId = params.collectionId;
1926
+ const key = params.key;
1927
+ const required = params.required;
1928
+ const xdefault = params.xdefault;
1929
+ const size = params.size;
1930
+ const newKey = params.newKey;
1931
+ if (typeof databaseId === "undefined") {
1932
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1933
+ }
1934
+ if (typeof collectionId === "undefined") {
1935
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1936
+ }
1937
+ if (typeof key === "undefined") {
1938
+ throw new client.AppwriteException('Missing required parameter: "key"');
1939
+ }
1940
+ if (typeof required === "undefined") {
1941
+ throw new client.AppwriteException('Missing required parameter: "required"');
1942
+ }
1943
+ if (typeof xdefault === "undefined") {
1944
+ throw new client.AppwriteException('Missing required parameter: "xdefault"');
1945
+ }
1946
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
1947
+ const payload = {};
1948
+ if (typeof required !== "undefined") {
1949
+ payload["required"] = required;
1950
+ }
1951
+ if (typeof xdefault !== "undefined") {
1952
+ payload["default"] = xdefault;
1953
+ }
1954
+ if (typeof size !== "undefined") {
1955
+ payload["size"] = size;
1956
+ }
1957
+ if (typeof newKey !== "undefined") {
1958
+ payload["newKey"] = newKey;
1959
+ }
1960
+ const uri = new URL(this.client.config.endpoint + apiPath);
1961
+ const apiHeaders = {
1962
+ "content-type": "application/json"
1963
+ };
1964
+ return this.client.call(
1965
+ "patch",
1966
+ uri,
1967
+ apiHeaders,
1968
+ payload
1969
+ );
1970
+ }
1971
+ createUrlAttribute(paramsOrFirst, ...rest) {
1972
+ let params;
1973
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1974
+ params = paramsOrFirst || {};
1975
+ } else {
1976
+ params = {
1977
+ databaseId: paramsOrFirst,
1978
+ collectionId: rest[0],
1979
+ key: rest[1],
1980
+ required: rest[2],
1981
+ xdefault: rest[3],
1982
+ array: rest[4]
1983
+ };
1984
+ }
1985
+ const databaseId = params.databaseId;
1986
+ const collectionId = params.collectionId;
1987
+ const key = params.key;
1988
+ const required = params.required;
1989
+ const xdefault = params.xdefault;
1990
+ const array = params.array;
1991
+ if (typeof databaseId === "undefined") {
1992
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1993
+ }
1994
+ if (typeof collectionId === "undefined") {
1995
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1996
+ }
1997
+ if (typeof key === "undefined") {
1998
+ throw new client.AppwriteException('Missing required parameter: "key"');
1999
+ }
2000
+ if (typeof required === "undefined") {
2001
+ throw new client.AppwriteException('Missing required parameter: "required"');
2002
+ }
2003
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/url".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
2004
+ const payload = {};
2005
+ if (typeof key !== "undefined") {
2006
+ payload["key"] = key;
2007
+ }
2008
+ if (typeof required !== "undefined") {
2009
+ payload["required"] = required;
2010
+ }
2011
+ if (typeof xdefault !== "undefined") {
2012
+ payload["default"] = xdefault;
2013
+ }
2014
+ if (typeof array !== "undefined") {
2015
+ payload["array"] = array;
2016
+ }
2017
+ const uri = new URL(this.client.config.endpoint + apiPath);
2018
+ const apiHeaders = {
2019
+ "content-type": "application/json"
2020
+ };
2021
+ return this.client.call(
2022
+ "post",
2023
+ uri,
2024
+ apiHeaders,
2025
+ payload
2026
+ );
2027
+ }
2028
+ updateUrlAttribute(paramsOrFirst, ...rest) {
2029
+ let params;
2030
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2031
+ params = paramsOrFirst || {};
2032
+ } else {
2033
+ params = {
2034
+ databaseId: paramsOrFirst,
2035
+ collectionId: rest[0],
2036
+ key: rest[1],
2037
+ required: rest[2],
2038
+ xdefault: rest[3],
2039
+ newKey: rest[4]
2040
+ };
2041
+ }
2042
+ const databaseId = params.databaseId;
2043
+ const collectionId = params.collectionId;
2044
+ const key = params.key;
2045
+ const required = params.required;
2046
+ const xdefault = params.xdefault;
2047
+ const newKey = params.newKey;
2048
+ if (typeof databaseId === "undefined") {
2049
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2050
+ }
2051
+ if (typeof collectionId === "undefined") {
2052
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2053
+ }
2054
+ if (typeof key === "undefined") {
2055
+ throw new client.AppwriteException('Missing required parameter: "key"');
2056
+ }
2057
+ if (typeof required === "undefined") {
2058
+ throw new client.AppwriteException('Missing required parameter: "required"');
2059
+ }
2060
+ if (typeof xdefault === "undefined") {
2061
+ throw new client.AppwriteException('Missing required parameter: "xdefault"');
2062
+ }
2063
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
2064
+ const payload = {};
2065
+ if (typeof required !== "undefined") {
2066
+ payload["required"] = required;
2067
+ }
2068
+ if (typeof xdefault !== "undefined") {
2069
+ payload["default"] = xdefault;
2070
+ }
2071
+ if (typeof newKey !== "undefined") {
2072
+ payload["newKey"] = newKey;
2073
+ }
2074
+ const uri = new URL(this.client.config.endpoint + apiPath);
2075
+ const apiHeaders = {
2076
+ "content-type": "application/json"
2077
+ };
2078
+ return this.client.call(
2079
+ "patch",
2080
+ uri,
2081
+ apiHeaders,
2082
+ payload
2083
+ );
2084
+ }
2085
+ getAttribute(paramsOrFirst, ...rest) {
2086
+ let params;
2087
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2088
+ params = paramsOrFirst || {};
2089
+ } else {
2090
+ params = {
2091
+ databaseId: paramsOrFirst,
2092
+ collectionId: rest[0],
2093
+ key: rest[1]
2094
+ };
2095
+ }
2096
+ const databaseId = params.databaseId;
2097
+ const collectionId = params.collectionId;
2098
+ const key = params.key;
2099
+ if (typeof databaseId === "undefined") {
2100
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2101
+ }
2102
+ if (typeof collectionId === "undefined") {
2103
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2104
+ }
2105
+ if (typeof key === "undefined") {
2106
+ throw new client.AppwriteException('Missing required parameter: "key"');
2107
+ }
2108
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
2109
+ const payload = {};
2110
+ const uri = new URL(this.client.config.endpoint + apiPath);
2111
+ const apiHeaders = {};
2112
+ return this.client.call(
2113
+ "get",
2114
+ uri,
2115
+ apiHeaders,
2116
+ payload
2117
+ );
2118
+ }
2119
+ deleteAttribute(paramsOrFirst, ...rest) {
2120
+ let params;
2121
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2122
+ params = paramsOrFirst || {};
2123
+ } else {
2124
+ params = {
2125
+ databaseId: paramsOrFirst,
2126
+ collectionId: rest[0],
2127
+ key: rest[1]
2128
+ };
2129
+ }
2130
+ const databaseId = params.databaseId;
2131
+ const collectionId = params.collectionId;
2132
+ const key = params.key;
2133
+ if (typeof databaseId === "undefined") {
2134
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2135
+ }
2136
+ if (typeof collectionId === "undefined") {
2137
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2138
+ }
2139
+ if (typeof key === "undefined") {
2140
+ throw new client.AppwriteException('Missing required parameter: "key"');
2141
+ }
2142
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
2143
+ const payload = {};
2144
+ const uri = new URL(this.client.config.endpoint + apiPath);
2145
+ const apiHeaders = {
2146
+ "content-type": "application/json"
2147
+ };
2148
+ return this.client.call(
2149
+ "delete",
2150
+ uri,
2151
+ apiHeaders,
2152
+ payload
2153
+ );
2154
+ }
2155
+ updateRelationshipAttribute(paramsOrFirst, ...rest) {
2156
+ let params;
2157
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2158
+ params = paramsOrFirst || {};
2159
+ } else {
2160
+ params = {
2161
+ databaseId: paramsOrFirst,
2162
+ collectionId: rest[0],
2163
+ key: rest[1],
2164
+ onDelete: rest[2],
2165
+ newKey: rest[3]
2166
+ };
2167
+ }
2168
+ const databaseId = params.databaseId;
2169
+ const collectionId = params.collectionId;
2170
+ const key = params.key;
2171
+ const onDelete = params.onDelete;
2172
+ const newKey = params.newKey;
2173
+ if (typeof databaseId === "undefined") {
2174
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2175
+ }
2176
+ if (typeof collectionId === "undefined") {
2177
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2178
+ }
2179
+ if (typeof key === "undefined") {
2180
+ throw new client.AppwriteException('Missing required parameter: "key"');
2181
+ }
2182
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
2183
+ const payload = {};
2184
+ if (typeof onDelete !== "undefined") {
2185
+ payload["onDelete"] = onDelete;
2186
+ }
2187
+ if (typeof newKey !== "undefined") {
2188
+ payload["newKey"] = newKey;
2189
+ }
2190
+ const uri = new URL(this.client.config.endpoint + apiPath);
2191
+ const apiHeaders = {
2192
+ "content-type": "application/json"
2193
+ };
2194
+ return this.client.call(
2195
+ "patch",
2196
+ uri,
2197
+ apiHeaders,
2198
+ payload
2199
+ );
2200
+ }
2201
+ listDocuments(paramsOrFirst, ...rest) {
2202
+ let params;
2203
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2204
+ params = paramsOrFirst || {};
2205
+ } else {
2206
+ params = {
2207
+ databaseId: paramsOrFirst,
2208
+ collectionId: rest[0],
2209
+ queries: rest[1],
2210
+ transactionId: rest[2],
2211
+ total: rest[3]
2212
+ };
2213
+ }
2214
+ const databaseId = params.databaseId;
2215
+ const collectionId = params.collectionId;
2216
+ const queries = params.queries;
2217
+ const transactionId = params.transactionId;
2218
+ const total = params.total;
2219
+ if (typeof databaseId === "undefined") {
2220
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2221
+ }
2222
+ if (typeof collectionId === "undefined") {
2223
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2224
+ }
2225
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
2226
+ const payload = {};
2227
+ if (typeof queries !== "undefined") {
2228
+ payload["queries"] = queries;
2229
+ }
2230
+ if (typeof transactionId !== "undefined") {
2231
+ payload["transactionId"] = transactionId;
2232
+ }
2233
+ if (typeof total !== "undefined") {
2234
+ payload["total"] = total;
2235
+ }
2236
+ const uri = new URL(this.client.config.endpoint + apiPath);
2237
+ const apiHeaders = {};
2238
+ return this.client.call(
2239
+ "get",
2240
+ uri,
2241
+ apiHeaders,
2242
+ payload
2243
+ );
2244
+ }
2245
+ createDocument(paramsOrFirst, ...rest) {
2246
+ let params;
2247
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2248
+ params = paramsOrFirst || {};
2249
+ } else {
2250
+ params = {
2251
+ databaseId: paramsOrFirst,
2252
+ collectionId: rest[0],
2253
+ documentId: rest[1],
2254
+ data: rest[2],
2255
+ permissions: rest[3],
2256
+ transactionId: rest[4]
2257
+ };
2258
+ }
2259
+ const databaseId = params.databaseId;
2260
+ const collectionId = params.collectionId;
2261
+ const documentId = params.documentId;
2262
+ const data = params.data;
2263
+ const permissions = params.permissions;
2264
+ const transactionId = params.transactionId;
2265
+ if (typeof databaseId === "undefined") {
2266
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2267
+ }
2268
+ if (typeof collectionId === "undefined") {
2269
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2270
+ }
2271
+ if (typeof documentId === "undefined") {
2272
+ throw new client.AppwriteException('Missing required parameter: "documentId"');
2273
+ }
2274
+ if (typeof data === "undefined") {
2275
+ throw new client.AppwriteException('Missing required parameter: "data"');
2276
+ }
2277
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
2278
+ const payload = {};
2279
+ if (typeof documentId !== "undefined") {
2280
+ payload["documentId"] = documentId;
2281
+ }
2282
+ if (typeof data !== "undefined") {
2283
+ payload["data"] = data;
2284
+ }
2285
+ if (typeof permissions !== "undefined") {
2286
+ payload["permissions"] = permissions;
2287
+ }
2288
+ if (typeof transactionId !== "undefined") {
2289
+ payload["transactionId"] = transactionId;
2290
+ }
2291
+ const uri = new URL(this.client.config.endpoint + apiPath);
2292
+ const apiHeaders = {
2293
+ "content-type": "application/json"
2294
+ };
2295
+ return this.client.call(
2296
+ "post",
2297
+ uri,
2298
+ apiHeaders,
2299
+ payload
2300
+ );
2301
+ }
2302
+ createDocuments(paramsOrFirst, ...rest) {
2303
+ let params;
2304
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2305
+ params = paramsOrFirst || {};
2306
+ } else {
2307
+ params = {
2308
+ databaseId: paramsOrFirst,
2309
+ collectionId: rest[0],
2310
+ documents: rest[1],
2311
+ transactionId: rest[2]
2312
+ };
2313
+ }
2314
+ const databaseId = params.databaseId;
2315
+ const collectionId = params.collectionId;
2316
+ const documents = params.documents;
2317
+ const transactionId = params.transactionId;
2318
+ if (typeof databaseId === "undefined") {
2319
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2320
+ }
2321
+ if (typeof collectionId === "undefined") {
2322
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2323
+ }
2324
+ if (typeof documents === "undefined") {
2325
+ throw new client.AppwriteException('Missing required parameter: "documents"');
2326
+ }
2327
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
2328
+ const payload = {};
2329
+ if (typeof documents !== "undefined") {
2330
+ payload["documents"] = documents;
2331
+ }
2332
+ if (typeof transactionId !== "undefined") {
2333
+ payload["transactionId"] = transactionId;
2334
+ }
2335
+ const uri = new URL(this.client.config.endpoint + apiPath);
2336
+ const apiHeaders = {
2337
+ "content-type": "application/json"
2338
+ };
2339
+ return this.client.call(
2340
+ "post",
2341
+ uri,
2342
+ apiHeaders,
2343
+ payload
2344
+ );
2345
+ }
2346
+ upsertDocuments(paramsOrFirst, ...rest) {
2347
+ let params;
2348
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2349
+ params = paramsOrFirst || {};
2350
+ } else {
2351
+ params = {
2352
+ databaseId: paramsOrFirst,
2353
+ collectionId: rest[0],
2354
+ documents: rest[1],
2355
+ transactionId: rest[2]
2356
+ };
2357
+ }
2358
+ const databaseId = params.databaseId;
2359
+ const collectionId = params.collectionId;
2360
+ const documents = params.documents;
2361
+ const transactionId = params.transactionId;
2362
+ if (typeof databaseId === "undefined") {
2363
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2364
+ }
2365
+ if (typeof collectionId === "undefined") {
2366
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2367
+ }
2368
+ if (typeof documents === "undefined") {
2369
+ throw new client.AppwriteException('Missing required parameter: "documents"');
2370
+ }
2371
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
2372
+ const payload = {};
2373
+ if (typeof documents !== "undefined") {
2374
+ payload["documents"] = documents;
2375
+ }
2376
+ if (typeof transactionId !== "undefined") {
2377
+ payload["transactionId"] = transactionId;
2378
+ }
2379
+ const uri = new URL(this.client.config.endpoint + apiPath);
2380
+ const apiHeaders = {
2381
+ "content-type": "application/json"
2382
+ };
2383
+ return this.client.call(
2384
+ "put",
2385
+ uri,
2386
+ apiHeaders,
2387
+ payload
2388
+ );
2389
+ }
2390
+ updateDocuments(paramsOrFirst, ...rest) {
2391
+ let params;
2392
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2393
+ params = paramsOrFirst || {};
2394
+ } else {
2395
+ params = {
2396
+ databaseId: paramsOrFirst,
2397
+ collectionId: rest[0],
2398
+ data: rest[1],
2399
+ queries: rest[2],
2400
+ transactionId: rest[3]
2401
+ };
2402
+ }
2403
+ const databaseId = params.databaseId;
2404
+ const collectionId = params.collectionId;
2405
+ const data = params.data;
2406
+ const queries = params.queries;
2407
+ const transactionId = params.transactionId;
2408
+ if (typeof databaseId === "undefined") {
2409
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2410
+ }
2411
+ if (typeof collectionId === "undefined") {
2412
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2413
+ }
2414
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
2415
+ const payload = {};
2416
+ if (typeof data !== "undefined") {
2417
+ payload["data"] = data;
2418
+ }
2419
+ if (typeof queries !== "undefined") {
2420
+ payload["queries"] = queries;
2421
+ }
2422
+ if (typeof transactionId !== "undefined") {
2423
+ payload["transactionId"] = transactionId;
2424
+ }
2425
+ const uri = new URL(this.client.config.endpoint + apiPath);
2426
+ const apiHeaders = {
2427
+ "content-type": "application/json"
2428
+ };
2429
+ return this.client.call(
2430
+ "patch",
2431
+ uri,
2432
+ apiHeaders,
2433
+ payload
2434
+ );
2435
+ }
2436
+ deleteDocuments(paramsOrFirst, ...rest) {
2437
+ let params;
2438
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2439
+ params = paramsOrFirst || {};
2440
+ } else {
2441
+ params = {
2442
+ databaseId: paramsOrFirst,
2443
+ collectionId: rest[0],
2444
+ queries: rest[1],
2445
+ transactionId: rest[2]
2446
+ };
2447
+ }
2448
+ const databaseId = params.databaseId;
2449
+ const collectionId = params.collectionId;
2450
+ const queries = params.queries;
2451
+ const transactionId = params.transactionId;
2452
+ if (typeof databaseId === "undefined") {
2453
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2454
+ }
2455
+ if (typeof collectionId === "undefined") {
2456
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2457
+ }
2458
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
2459
+ const payload = {};
2460
+ if (typeof queries !== "undefined") {
2461
+ payload["queries"] = queries;
2462
+ }
2463
+ if (typeof transactionId !== "undefined") {
2464
+ payload["transactionId"] = transactionId;
2465
+ }
2466
+ const uri = new URL(this.client.config.endpoint + apiPath);
2467
+ const apiHeaders = {
2468
+ "content-type": "application/json"
2469
+ };
2470
+ return this.client.call(
2471
+ "delete",
2472
+ uri,
2473
+ apiHeaders,
2474
+ payload
2475
+ );
2476
+ }
2477
+ getDocument(paramsOrFirst, ...rest) {
2478
+ let params;
2479
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2480
+ params = paramsOrFirst || {};
2481
+ } else {
2482
+ params = {
2483
+ databaseId: paramsOrFirst,
2484
+ collectionId: rest[0],
2485
+ documentId: rest[1],
2486
+ queries: rest[2],
2487
+ transactionId: rest[3]
2488
+ };
2489
+ }
2490
+ const databaseId = params.databaseId;
2491
+ const collectionId = params.collectionId;
2492
+ const documentId = params.documentId;
2493
+ const queries = params.queries;
2494
+ const transactionId = params.transactionId;
2495
+ if (typeof databaseId === "undefined") {
2496
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2497
+ }
2498
+ if (typeof collectionId === "undefined") {
2499
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2500
+ }
2501
+ if (typeof documentId === "undefined") {
2502
+ throw new client.AppwriteException('Missing required parameter: "documentId"');
2503
+ }
2504
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId);
2505
+ const payload = {};
2506
+ if (typeof queries !== "undefined") {
2507
+ payload["queries"] = queries;
2508
+ }
2509
+ if (typeof transactionId !== "undefined") {
2510
+ payload["transactionId"] = transactionId;
2511
+ }
2512
+ const uri = new URL(this.client.config.endpoint + apiPath);
2513
+ const apiHeaders = {};
2514
+ return this.client.call(
2515
+ "get",
2516
+ uri,
2517
+ apiHeaders,
2518
+ payload
2519
+ );
2520
+ }
2521
+ upsertDocument(paramsOrFirst, ...rest) {
2522
+ let params;
2523
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2524
+ params = paramsOrFirst || {};
2525
+ } else {
2526
+ params = {
2527
+ databaseId: paramsOrFirst,
2528
+ collectionId: rest[0],
2529
+ documentId: rest[1],
2530
+ data: rest[2],
2531
+ permissions: rest[3],
2532
+ transactionId: rest[4]
2533
+ };
2534
+ }
2535
+ const databaseId = params.databaseId;
2536
+ const collectionId = params.collectionId;
2537
+ const documentId = params.documentId;
2538
+ const data = params.data;
2539
+ const permissions = params.permissions;
2540
+ const transactionId = params.transactionId;
2541
+ if (typeof databaseId === "undefined") {
2542
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2543
+ }
2544
+ if (typeof collectionId === "undefined") {
2545
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2546
+ }
2547
+ if (typeof documentId === "undefined") {
2548
+ throw new client.AppwriteException('Missing required parameter: "documentId"');
2549
+ }
2550
+ if (typeof data === "undefined") {
2551
+ throw new client.AppwriteException('Missing required parameter: "data"');
2552
+ }
2553
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId);
2554
+ const payload = {};
2555
+ if (typeof data !== "undefined") {
2556
+ payload["data"] = data;
2557
+ }
2558
+ if (typeof permissions !== "undefined") {
2559
+ payload["permissions"] = permissions;
2560
+ }
2561
+ if (typeof transactionId !== "undefined") {
2562
+ payload["transactionId"] = transactionId;
2563
+ }
2564
+ const uri = new URL(this.client.config.endpoint + apiPath);
2565
+ const apiHeaders = {
2566
+ "content-type": "application/json"
2567
+ };
2568
+ return this.client.call(
2569
+ "put",
2570
+ uri,
2571
+ apiHeaders,
2572
+ payload
2573
+ );
2574
+ }
2575
+ updateDocument(paramsOrFirst, ...rest) {
2576
+ let params;
2577
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2578
+ params = paramsOrFirst || {};
2579
+ } else {
2580
+ params = {
2581
+ databaseId: paramsOrFirst,
2582
+ collectionId: rest[0],
2583
+ documentId: rest[1],
2584
+ data: rest[2],
2585
+ permissions: rest[3],
2586
+ transactionId: rest[4]
2587
+ };
2588
+ }
2589
+ const databaseId = params.databaseId;
2590
+ const collectionId = params.collectionId;
2591
+ const documentId = params.documentId;
2592
+ const data = params.data;
2593
+ const permissions = params.permissions;
2594
+ const transactionId = params.transactionId;
2595
+ if (typeof databaseId === "undefined") {
2596
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2597
+ }
2598
+ if (typeof collectionId === "undefined") {
2599
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2600
+ }
2601
+ if (typeof documentId === "undefined") {
2602
+ throw new client.AppwriteException('Missing required parameter: "documentId"');
2603
+ }
2604
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId);
2605
+ const payload = {};
2606
+ if (typeof data !== "undefined") {
2607
+ payload["data"] = data;
2608
+ }
2609
+ if (typeof permissions !== "undefined") {
2610
+ payload["permissions"] = permissions;
2611
+ }
2612
+ if (typeof transactionId !== "undefined") {
2613
+ payload["transactionId"] = transactionId;
2614
+ }
2615
+ const uri = new URL(this.client.config.endpoint + apiPath);
2616
+ const apiHeaders = {
2617
+ "content-type": "application/json"
2618
+ };
2619
+ return this.client.call(
2620
+ "patch",
2621
+ uri,
2622
+ apiHeaders,
2623
+ payload
2624
+ );
2625
+ }
2626
+ deleteDocument(paramsOrFirst, ...rest) {
2627
+ let params;
2628
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2629
+ params = paramsOrFirst || {};
2630
+ } else {
2631
+ params = {
2632
+ databaseId: paramsOrFirst,
2633
+ collectionId: rest[0],
2634
+ documentId: rest[1],
2635
+ transactionId: rest[2]
2636
+ };
2637
+ }
2638
+ const databaseId = params.databaseId;
2639
+ const collectionId = params.collectionId;
2640
+ const documentId = params.documentId;
2641
+ const transactionId = params.transactionId;
2642
+ if (typeof databaseId === "undefined") {
2643
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2644
+ }
2645
+ if (typeof collectionId === "undefined") {
2646
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2647
+ }
2648
+ if (typeof documentId === "undefined") {
2649
+ throw new client.AppwriteException('Missing required parameter: "documentId"');
2650
+ }
2651
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId);
2652
+ const payload = {};
2653
+ if (typeof transactionId !== "undefined") {
2654
+ payload["transactionId"] = transactionId;
2655
+ }
2656
+ const uri = new URL(this.client.config.endpoint + apiPath);
2657
+ const apiHeaders = {
2658
+ "content-type": "application/json"
2659
+ };
2660
+ return this.client.call(
2661
+ "delete",
2662
+ uri,
2663
+ apiHeaders,
2664
+ payload
2665
+ );
2666
+ }
2667
+ decrementDocumentAttribute(paramsOrFirst, ...rest) {
2668
+ let params;
2669
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2670
+ params = paramsOrFirst || {};
2671
+ } else {
2672
+ params = {
2673
+ databaseId: paramsOrFirst,
2674
+ collectionId: rest[0],
2675
+ documentId: rest[1],
2676
+ attribute: rest[2],
2677
+ value: rest[3],
2678
+ min: rest[4],
2679
+ transactionId: rest[5]
2680
+ };
2681
+ }
2682
+ const databaseId = params.databaseId;
2683
+ const collectionId = params.collectionId;
2684
+ const documentId = params.documentId;
2685
+ const attribute = params.attribute;
2686
+ const value = params.value;
2687
+ const min = params.min;
2688
+ const transactionId = params.transactionId;
2689
+ if (typeof databaseId === "undefined") {
2690
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2691
+ }
2692
+ if (typeof collectionId === "undefined") {
2693
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2694
+ }
2695
+ if (typeof documentId === "undefined") {
2696
+ throw new client.AppwriteException('Missing required parameter: "documentId"');
2697
+ }
2698
+ if (typeof attribute === "undefined") {
2699
+ throw new client.AppwriteException('Missing required parameter: "attribute"');
2700
+ }
2701
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId).replace("{attribute}", attribute);
2702
+ const payload = {};
2703
+ if (typeof value !== "undefined") {
2704
+ payload["value"] = value;
2705
+ }
2706
+ if (typeof min !== "undefined") {
2707
+ payload["min"] = min;
2708
+ }
2709
+ if (typeof transactionId !== "undefined") {
2710
+ payload["transactionId"] = transactionId;
2711
+ }
2712
+ const uri = new URL(this.client.config.endpoint + apiPath);
2713
+ const apiHeaders = {
2714
+ "content-type": "application/json"
2715
+ };
2716
+ return this.client.call(
2717
+ "patch",
2718
+ uri,
2719
+ apiHeaders,
2720
+ payload
2721
+ );
2722
+ }
2723
+ incrementDocumentAttribute(paramsOrFirst, ...rest) {
2724
+ let params;
2725
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2726
+ params = paramsOrFirst || {};
2727
+ } else {
2728
+ params = {
2729
+ databaseId: paramsOrFirst,
2730
+ collectionId: rest[0],
2731
+ documentId: rest[1],
2732
+ attribute: rest[2],
2733
+ value: rest[3],
2734
+ max: rest[4],
2735
+ transactionId: rest[5]
2736
+ };
2737
+ }
2738
+ const databaseId = params.databaseId;
2739
+ const collectionId = params.collectionId;
2740
+ const documentId = params.documentId;
2741
+ const attribute = params.attribute;
2742
+ const value = params.value;
2743
+ const max = params.max;
2744
+ const transactionId = params.transactionId;
2745
+ if (typeof databaseId === "undefined") {
2746
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2747
+ }
2748
+ if (typeof collectionId === "undefined") {
2749
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2750
+ }
2751
+ if (typeof documentId === "undefined") {
2752
+ throw new client.AppwriteException('Missing required parameter: "documentId"');
2753
+ }
2754
+ if (typeof attribute === "undefined") {
2755
+ throw new client.AppwriteException('Missing required parameter: "attribute"');
2756
+ }
2757
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId).replace("{attribute}", attribute);
2758
+ const payload = {};
2759
+ if (typeof value !== "undefined") {
2760
+ payload["value"] = value;
2761
+ }
2762
+ if (typeof max !== "undefined") {
2763
+ payload["max"] = max;
2764
+ }
2765
+ if (typeof transactionId !== "undefined") {
2766
+ payload["transactionId"] = transactionId;
2767
+ }
2768
+ const uri = new URL(this.client.config.endpoint + apiPath);
2769
+ const apiHeaders = {
2770
+ "content-type": "application/json"
2771
+ };
2772
+ return this.client.call(
2773
+ "patch",
2774
+ uri,
2775
+ apiHeaders,
2776
+ payload
2777
+ );
2778
+ }
2779
+ listIndexes(paramsOrFirst, ...rest) {
2780
+ let params;
2781
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2782
+ params = paramsOrFirst || {};
2783
+ } else {
2784
+ params = {
2785
+ databaseId: paramsOrFirst,
2786
+ collectionId: rest[0],
2787
+ queries: rest[1],
2788
+ total: rest[2]
2789
+ };
2790
+ }
2791
+ const databaseId = params.databaseId;
2792
+ const collectionId = params.collectionId;
2793
+ const queries = params.queries;
2794
+ const total = params.total;
2795
+ if (typeof databaseId === "undefined") {
2796
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2797
+ }
2798
+ if (typeof collectionId === "undefined") {
2799
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2800
+ }
2801
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
2802
+ const payload = {};
2803
+ if (typeof queries !== "undefined") {
2804
+ payload["queries"] = queries;
2805
+ }
2806
+ if (typeof total !== "undefined") {
2807
+ payload["total"] = total;
2808
+ }
2809
+ const uri = new URL(this.client.config.endpoint + apiPath);
2810
+ const apiHeaders = {};
2811
+ return this.client.call(
2812
+ "get",
2813
+ uri,
2814
+ apiHeaders,
2815
+ payload
2816
+ );
2817
+ }
2818
+ createIndex(paramsOrFirst, ...rest) {
2819
+ let params;
2820
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2821
+ params = paramsOrFirst || {};
2822
+ } else {
2823
+ params = {
2824
+ databaseId: paramsOrFirst,
2825
+ collectionId: rest[0],
2826
+ key: rest[1],
2827
+ type: rest[2],
2828
+ attributes: rest[3],
2829
+ orders: rest[4],
2830
+ lengths: rest[5]
2831
+ };
2832
+ }
2833
+ const databaseId = params.databaseId;
2834
+ const collectionId = params.collectionId;
2835
+ const key = params.key;
2836
+ const type = params.type;
2837
+ const attributes = params.attributes;
2838
+ const orders = params.orders;
2839
+ const lengths = params.lengths;
2840
+ if (typeof databaseId === "undefined") {
2841
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2842
+ }
2843
+ if (typeof collectionId === "undefined") {
2844
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2845
+ }
2846
+ if (typeof key === "undefined") {
2847
+ throw new client.AppwriteException('Missing required parameter: "key"');
2848
+ }
2849
+ if (typeof type === "undefined") {
2850
+ throw new client.AppwriteException('Missing required parameter: "type"');
2851
+ }
2852
+ if (typeof attributes === "undefined") {
2853
+ throw new client.AppwriteException('Missing required parameter: "attributes"');
2854
+ }
2855
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
2856
+ const payload = {};
2857
+ if (typeof key !== "undefined") {
2858
+ payload["key"] = key;
2859
+ }
2860
+ if (typeof type !== "undefined") {
2861
+ payload["type"] = type;
2862
+ }
2863
+ if (typeof attributes !== "undefined") {
2864
+ payload["attributes"] = attributes;
2865
+ }
2866
+ if (typeof orders !== "undefined") {
2867
+ payload["orders"] = orders;
2868
+ }
2869
+ if (typeof lengths !== "undefined") {
2870
+ payload["lengths"] = lengths;
2871
+ }
2872
+ const uri = new URL(this.client.config.endpoint + apiPath);
2873
+ const apiHeaders = {
2874
+ "content-type": "application/json"
2875
+ };
2876
+ return this.client.call(
2877
+ "post",
2878
+ uri,
2879
+ apiHeaders,
2880
+ payload
2881
+ );
2882
+ }
2883
+ getIndex(paramsOrFirst, ...rest) {
2884
+ let params;
2885
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2886
+ params = paramsOrFirst || {};
2887
+ } else {
2888
+ params = {
2889
+ databaseId: paramsOrFirst,
2890
+ collectionId: rest[0],
2891
+ key: rest[1]
2892
+ };
2893
+ }
2894
+ const databaseId = params.databaseId;
2895
+ const collectionId = params.collectionId;
2896
+ const key = params.key;
2897
+ if (typeof databaseId === "undefined") {
2898
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2899
+ }
2900
+ if (typeof collectionId === "undefined") {
2901
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2902
+ }
2903
+ if (typeof key === "undefined") {
2904
+ throw new client.AppwriteException('Missing required parameter: "key"');
2905
+ }
2906
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
2907
+ const payload = {};
2908
+ const uri = new URL(this.client.config.endpoint + apiPath);
2909
+ const apiHeaders = {};
2910
+ return this.client.call(
2911
+ "get",
2912
+ uri,
2913
+ apiHeaders,
2914
+ payload
2915
+ );
2916
+ }
2917
+ deleteIndex(paramsOrFirst, ...rest) {
2918
+ let params;
2919
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2920
+ params = paramsOrFirst || {};
2921
+ } else {
2922
+ params = {
2923
+ databaseId: paramsOrFirst,
2924
+ collectionId: rest[0],
2925
+ key: rest[1]
2926
+ };
2927
+ }
2928
+ const databaseId = params.databaseId;
2929
+ const collectionId = params.collectionId;
2930
+ const key = params.key;
2931
+ if (typeof databaseId === "undefined") {
2932
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
2933
+ }
2934
+ if (typeof collectionId === "undefined") {
2935
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
2936
+ }
2937
+ if (typeof key === "undefined") {
2938
+ throw new client.AppwriteException('Missing required parameter: "key"');
2939
+ }
2940
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
2941
+ const payload = {};
2942
+ const uri = new URL(this.client.config.endpoint + apiPath);
2943
+ const apiHeaders = {
2944
+ "content-type": "application/json"
2945
+ };
2946
+ return this.client.call(
2947
+ "delete",
2948
+ uri,
2949
+ apiHeaders,
2950
+ payload
2951
+ );
2952
+ }
2953
+ }
2954
+
2955
+ exports.Databases = Databases;
2956
+ //# sourceMappingURL=out.js.map
2957
+ //# sourceMappingURL=databases.js.map