loop-client 0.0.1

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 (351) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/README.md +3 -0
  3. package/build/const.d.ts +31 -0
  4. package/build/const.d.ts.map +1 -0
  5. package/build/const.js +40 -0
  6. package/build/const.js.map +1 -0
  7. package/build/errors.d.ts +621 -0
  8. package/build/errors.d.ts.map +1 -0
  9. package/build/errors.js +665 -0
  10. package/build/errors.js.map +1 -0
  11. package/build/index.d.ts +6 -0
  12. package/build/index.d.ts.map +1 -0
  13. package/build/index.js +27 -0
  14. package/build/index.js.map +1 -0
  15. package/build/instrument.d.ts +14 -0
  16. package/build/instrument.d.ts.map +1 -0
  17. package/build/instrument.js +75 -0
  18. package/build/instrument.js.map +1 -0
  19. package/build/logger.d.ts +6 -0
  20. package/build/logger.d.ts.map +1 -0
  21. package/build/logger.js +24 -0
  22. package/build/logger.js.map +1 -0
  23. package/build/methods.d.ts +1101 -0
  24. package/build/methods.d.ts.map +1 -0
  25. package/build/methods.js +2080 -0
  26. package/build/methods.js.map +1 -0
  27. package/build/types/admin.d.ts +56 -0
  28. package/build/types/admin.d.ts.map +1 -0
  29. package/build/types/admin.js +18 -0
  30. package/build/types/admin.js.map +1 -0
  31. package/build/types/apps.d.ts +214 -0
  32. package/build/types/apps.d.ts.map +1 -0
  33. package/build/types/apps.js +81 -0
  34. package/build/types/apps.js.map +1 -0
  35. package/build/types/audits.d.ts +10 -0
  36. package/build/types/audits.d.ts.map +1 -0
  37. package/build/types/audits.js +3 -0
  38. package/build/types/audits.js.map +1 -0
  39. package/build/types/autocomplete.d.ts +13 -0
  40. package/build/types/autocomplete.d.ts.map +1 -0
  41. package/build/types/autocomplete.js +3 -0
  42. package/build/types/autocomplete.js.map +1 -0
  43. package/build/types/boards.d.ts +57 -0
  44. package/build/types/boards.d.ts.map +1 -0
  45. package/build/types/boards.js +28 -0
  46. package/build/types/boards.js.map +1 -0
  47. package/build/types/bots.d.ts +16 -0
  48. package/build/types/bots.d.ts.map +1 -0
  49. package/build/types/bots.js +3 -0
  50. package/build/types/bots.js.map +1 -0
  51. package/build/types/channels.d.ts +279 -0
  52. package/build/types/channels.d.ts.map +1 -0
  53. package/build/types/channels.js +62 -0
  54. package/build/types/channels.js.map +1 -0
  55. package/build/types/cloud.d.ts +155 -0
  56. package/build/types/cloud.d.ts.map +1 -0
  57. package/build/types/cloud.js +12 -0
  58. package/build/types/cloud.js.map +1 -0
  59. package/build/types/common.d.ts +5 -0
  60. package/build/types/common.d.ts.map +1 -0
  61. package/build/types/common.js +3 -0
  62. package/build/types/common.js.map +1 -0
  63. package/build/types/compliance.d.ts +14 -0
  64. package/build/types/compliance.d.ts.map +1 -0
  65. package/build/types/compliance.js +3 -0
  66. package/build/types/compliance.js.map +1 -0
  67. package/build/types/config.d.ts +966 -0
  68. package/build/types/config.d.ts.map +1 -0
  69. package/build/types/config.js +17 -0
  70. package/build/types/config.js.map +1 -0
  71. package/build/types/data-retention.d.ts +31 -0
  72. package/build/types/data-retention.d.ts.map +1 -0
  73. package/build/types/data-retention.js +3 -0
  74. package/build/types/data-retention.js.map +1 -0
  75. package/build/types/dialog.d.ts +63 -0
  76. package/build/types/dialog.d.ts.map +1 -0
  77. package/build/types/dialog.js +26 -0
  78. package/build/types/dialog.js.map +1 -0
  79. package/build/types/drafts.d.ts +15 -0
  80. package/build/types/drafts.d.ts.map +1 -0
  81. package/build/types/drafts.js +3 -0
  82. package/build/types/drafts.js.map +1 -0
  83. package/build/types/emojis.d.ts +52 -0
  84. package/build/types/emojis.d.ts.map +1 -0
  85. package/build/types/emojis.js +19 -0
  86. package/build/types/emojis.js.map +1 -0
  87. package/build/types/files.d.ts +53 -0
  88. package/build/types/files.d.ts.map +1 -0
  89. package/build/types/files.js +3 -0
  90. package/build/types/files.js.map +1 -0
  91. package/build/types/groups.d.ts +143 -0
  92. package/build/types/groups.d.ts.map +1 -0
  93. package/build/types/groups.js +14 -0
  94. package/build/types/groups.js.map +1 -0
  95. package/build/types/index.d.ts +46 -0
  96. package/build/types/index.d.ts.map +1 -0
  97. package/build/types/index.js +62 -0
  98. package/build/types/index.js.map +1 -0
  99. package/build/types/integrations.d.ts +108 -0
  100. package/build/types/integrations.d.ts.map +1 -0
  101. package/build/types/integrations.js +15 -0
  102. package/build/types/integrations.js.map +1 -0
  103. package/build/types/jobs.d.ts +28 -0
  104. package/build/types/jobs.d.ts.map +1 -0
  105. package/build/types/jobs.js +22 -0
  106. package/build/types/jobs.js.map +1 -0
  107. package/build/types/limits.d.ts +5 -0
  108. package/build/types/limits.d.ts.map +1 -0
  109. package/build/types/limits.js +3 -0
  110. package/build/types/limits.js.map +1 -0
  111. package/build/types/marketplace.d.ts +43 -0
  112. package/build/types/marketplace.d.ts.map +1 -0
  113. package/build/types/marketplace.js +21 -0
  114. package/build/types/marketplace.js.map +1 -0
  115. package/build/types/metadata.d.ts +16 -0
  116. package/build/types/metadata.d.ts.map +1 -0
  117. package/build/types/metadata.js +3 -0
  118. package/build/types/metadata.js.map +1 -0
  119. package/build/types/methods/bots.methods.d.ts +77 -0
  120. package/build/types/methods/bots.methods.d.ts.map +1 -0
  121. package/build/types/methods/bots.methods.js +3 -0
  122. package/build/types/methods/bots.methods.js.map +1 -0
  123. package/build/types/methods/brand.methods.d.ts +15 -0
  124. package/build/types/methods/brand.methods.d.ts.map +1 -0
  125. package/build/types/methods/brand.methods.js +3 -0
  126. package/build/types/methods/brand.methods.js.map +1 -0
  127. package/build/types/methods/channels.methods.d.ts +473 -0
  128. package/build/types/methods/channels.methods.d.ts.map +1 -0
  129. package/build/types/methods/channels.methods.js +3 -0
  130. package/build/types/methods/channels.methods.js.map +1 -0
  131. package/build/types/methods/cloud.methods.d.ts +14 -0
  132. package/build/types/methods/cloud.methods.d.ts.map +1 -0
  133. package/build/types/methods/cloud.methods.js +3 -0
  134. package/build/types/methods/cloud.methods.js.map +1 -0
  135. package/build/types/methods/common.methods.d.ts +87 -0
  136. package/build/types/methods/common.methods.d.ts.map +1 -0
  137. package/build/types/methods/common.methods.js +4 -0
  138. package/build/types/methods/common.methods.js.map +1 -0
  139. package/build/types/methods/compliance.methods.d.ts +32 -0
  140. package/build/types/methods/compliance.methods.d.ts.map +1 -0
  141. package/build/types/methods/compliance.methods.js +3 -0
  142. package/build/types/methods/compliance.methods.js.map +1 -0
  143. package/build/types/methods/data-retention.methods.d.ts +67 -0
  144. package/build/types/methods/data-retention.methods.d.ts.map +1 -0
  145. package/build/types/methods/data-retention.methods.js +3 -0
  146. package/build/types/methods/data-retention.methods.js.map +1 -0
  147. package/build/types/methods/emojis.methods.d.ts +32 -0
  148. package/build/types/methods/emojis.methods.d.ts.map +1 -0
  149. package/build/types/methods/emojis.methods.js +3 -0
  150. package/build/types/methods/emojis.methods.js.map +1 -0
  151. package/build/types/methods/files.methods.d.ts +139 -0
  152. package/build/types/methods/files.methods.d.ts.map +1 -0
  153. package/build/types/methods/files.methods.js +3 -0
  154. package/build/types/methods/files.methods.js.map +1 -0
  155. package/build/types/methods/groups.methods.d.ts +113 -0
  156. package/build/types/methods/groups.methods.d.ts.map +1 -0
  157. package/build/types/methods/groups.methods.js +3 -0
  158. package/build/types/methods/groups.methods.js.map +1 -0
  159. package/build/types/methods/index.d.ts +28 -0
  160. package/build/types/methods/index.d.ts.map +1 -0
  161. package/build/types/methods/index.js +44 -0
  162. package/build/types/methods/index.js.map +1 -0
  163. package/build/types/methods/integrations.methods.d.ts +191 -0
  164. package/build/types/methods/integrations.methods.d.ts.map +1 -0
  165. package/build/types/methods/integrations.methods.js +3 -0
  166. package/build/types/methods/integrations.methods.js.map +1 -0
  167. package/build/types/methods/interactive.methods.d.ts +38 -0
  168. package/build/types/methods/interactive.methods.d.ts.map +1 -0
  169. package/build/types/methods/interactive.methods.js +3 -0
  170. package/build/types/methods/interactive.methods.js.map +1 -0
  171. package/build/types/methods/jobs.methods.d.ts +20 -0
  172. package/build/types/methods/jobs.methods.d.ts.map +1 -0
  173. package/build/types/methods/jobs.methods.js +3 -0
  174. package/build/types/methods/jobs.methods.js.map +1 -0
  175. package/build/types/methods/playbook-runs.methods.d.ts +89 -0
  176. package/build/types/methods/playbook-runs.methods.d.ts.map +1 -0
  177. package/build/types/methods/playbook-runs.methods.js +3 -0
  178. package/build/types/methods/playbook-runs.methods.js.map +1 -0
  179. package/build/types/methods/playbooks.methods.d.ts +156 -0
  180. package/build/types/methods/playbooks.methods.d.ts.map +1 -0
  181. package/build/types/methods/playbooks.methods.js +3 -0
  182. package/build/types/methods/playbooks.methods.js.map +1 -0
  183. package/build/types/methods/plugins.methods.d.ts +31 -0
  184. package/build/types/methods/plugins.methods.d.ts.map +1 -0
  185. package/build/types/methods/plugins.methods.js +3 -0
  186. package/build/types/methods/plugins.methods.js.map +1 -0
  187. package/build/types/methods/posts.methods.d.ts +216 -0
  188. package/build/types/methods/posts.methods.d.ts.map +1 -0
  189. package/build/types/methods/posts.methods.js +3 -0
  190. package/build/types/methods/posts.methods.js.map +1 -0
  191. package/build/types/methods/preferences.methods.d.ts +12 -0
  192. package/build/types/methods/preferences.methods.d.ts.map +1 -0
  193. package/build/types/methods/preferences.methods.js +3 -0
  194. package/build/types/methods/preferences.methods.js.map +1 -0
  195. package/build/types/methods/reactions.methods.d.ts +15 -0
  196. package/build/types/methods/reactions.methods.d.ts.map +1 -0
  197. package/build/types/methods/reactions.methods.js +3 -0
  198. package/build/types/methods/reactions.methods.js.map +1 -0
  199. package/build/types/methods/reports.methods.d.ts +4 -0
  200. package/build/types/methods/reports.methods.d.ts.map +1 -0
  201. package/build/types/methods/reports.methods.js +3 -0
  202. package/build/types/methods/reports.methods.js.map +1 -0
  203. package/build/types/methods/roles.methods.d.ts +14 -0
  204. package/build/types/methods/roles.methods.d.ts.map +1 -0
  205. package/build/types/methods/roles.methods.js +3 -0
  206. package/build/types/methods/roles.methods.js.map +1 -0
  207. package/build/types/methods/schemes.methods.d.ts +30 -0
  208. package/build/types/methods/schemes.methods.d.ts.map +1 -0
  209. package/build/types/methods/schemes.methods.js +3 -0
  210. package/build/types/methods/schemes.methods.js.map +1 -0
  211. package/build/types/methods/system.methods.d.ts +107 -0
  212. package/build/types/methods/system.methods.d.ts.map +1 -0
  213. package/build/types/methods/system.methods.js +3 -0
  214. package/build/types/methods/system.methods.js.map +1 -0
  215. package/build/types/methods/teams.methods.d.ts +161 -0
  216. package/build/types/methods/teams.methods.d.ts.map +1 -0
  217. package/build/types/methods/teams.methods.js +3 -0
  218. package/build/types/methods/teams.methods.js.map +1 -0
  219. package/build/types/methods/terms-of-service.methods.d.ts +24 -0
  220. package/build/types/methods/terms-of-service.methods.d.ts.map +1 -0
  221. package/build/types/methods/terms-of-service.methods.js +3 -0
  222. package/build/types/methods/terms-of-service.methods.js.map +1 -0
  223. package/build/types/methods/uploads.methods.d.ts +13 -0
  224. package/build/types/methods/uploads.methods.d.ts.map +1 -0
  225. package/build/types/methods/uploads.methods.js +3 -0
  226. package/build/types/methods/uploads.methods.js.map +1 -0
  227. package/build/types/methods/users.methods.d.ts +257 -0
  228. package/build/types/methods/users.methods.d.ts.map +1 -0
  229. package/build/types/methods/users.methods.js +3 -0
  230. package/build/types/methods/users.methods.js.map +1 -0
  231. package/build/types/mfa.d.ts +5 -0
  232. package/build/types/mfa.d.ts.map +1 -0
  233. package/build/types/mfa.js +3 -0
  234. package/build/types/mfa.js.map +1 -0
  235. package/build/types/playbooks.d.ts +221 -0
  236. package/build/types/playbooks.d.ts.map +1 -0
  237. package/build/types/playbooks.js +3 -0
  238. package/build/types/playbooks.js.map +1 -0
  239. package/build/types/plugins.d.ts +101 -0
  240. package/build/types/plugins.d.ts.map +1 -0
  241. package/build/types/plugins.js +3 -0
  242. package/build/types/plugins.js.map +1 -0
  243. package/build/types/posts.d.ts +290 -0
  244. package/build/types/posts.d.ts.map +1 -0
  245. package/build/types/posts.js +88 -0
  246. package/build/types/posts.js.map +1 -0
  247. package/build/types/preferences.d.ts +7 -0
  248. package/build/types/preferences.d.ts.map +1 -0
  249. package/build/types/preferences.js +3 -0
  250. package/build/types/preferences.js.map +1 -0
  251. package/build/types/product-notices.d.ts +27 -0
  252. package/build/types/product-notices.d.ts.map +1 -0
  253. package/build/types/product-notices.js +8 -0
  254. package/build/types/product-notices.js.map +1 -0
  255. package/build/types/products.d.ts +8 -0
  256. package/build/types/products.d.ts.map +1 -0
  257. package/build/types/products.js +3 -0
  258. package/build/types/products.js.map +1 -0
  259. package/build/types/reactions.d.ts +7 -0
  260. package/build/types/reactions.d.ts.map +1 -0
  261. package/build/types/reactions.js +3 -0
  262. package/build/types/reactions.js.map +1 -0
  263. package/build/types/reports.d.ts +66 -0
  264. package/build/types/reports.d.ts.map +1 -0
  265. package/build/types/reports.js +30 -0
  266. package/build/types/reports.js.map +1 -0
  267. package/build/types/requests.d.ts +61 -0
  268. package/build/types/requests.d.ts.map +1 -0
  269. package/build/types/requests.js +12 -0
  270. package/build/types/requests.js.map +1 -0
  271. package/build/types/responses/common.responses.d.ts +23 -0
  272. package/build/types/responses/common.responses.d.ts.map +1 -0
  273. package/build/types/responses/common.responses.js +3 -0
  274. package/build/types/responses/common.responses.js.map +1 -0
  275. package/build/types/responses/index.d.ts +5 -0
  276. package/build/types/responses/index.d.ts.map +1 -0
  277. package/build/types/responses/index.js +21 -0
  278. package/build/types/responses/index.js.map +1 -0
  279. package/build/types/responses/playbooks.responses.d.ts +19 -0
  280. package/build/types/responses/playbooks.responses.d.ts.map +1 -0
  281. package/build/types/responses/playbooks.responses.js +3 -0
  282. package/build/types/responses/playbooks.responses.js.map +1 -0
  283. package/build/types/responses/posts.responses.d.ts +32 -0
  284. package/build/types/responses/posts.responses.d.ts.map +1 -0
  285. package/build/types/responses/posts.responses.js +8 -0
  286. package/build/types/responses/posts.responses.js.map +1 -0
  287. package/build/types/responses/system.responses.d.ts +87 -0
  288. package/build/types/responses/system.responses.d.ts.map +1 -0
  289. package/build/types/responses/system.responses.js +3 -0
  290. package/build/types/responses/system.responses.js.map +1 -0
  291. package/build/types/roles.d.ts +41 -0
  292. package/build/types/roles.d.ts.map +1 -0
  293. package/build/types/roles.js +33 -0
  294. package/build/types/roles.js.map +1 -0
  295. package/build/types/saml.d.ts +11 -0
  296. package/build/types/saml.d.ts.map +1 -0
  297. package/build/types/saml.js +3 -0
  298. package/build/types/saml.js.map +1 -0
  299. package/build/types/schemes.d.ts +28 -0
  300. package/build/types/schemes.d.ts.map +1 -0
  301. package/build/types/schemes.js +9 -0
  302. package/build/types/schemes.js.map +1 -0
  303. package/build/types/search.d.ts +13 -0
  304. package/build/types/search.d.ts.map +1 -0
  305. package/build/types/search.js +3 -0
  306. package/build/types/search.js.map +1 -0
  307. package/build/types/setup.d.ts +5 -0
  308. package/build/types/setup.d.ts.map +1 -0
  309. package/build/types/setup.js +3 -0
  310. package/build/types/setup.js.map +1 -0
  311. package/build/types/state.d.ts +464 -0
  312. package/build/types/state.d.ts.map +1 -0
  313. package/build/types/state.js +3 -0
  314. package/build/types/state.js.map +1 -0
  315. package/build/types/store.d.ts +65 -0
  316. package/build/types/store.d.ts.map +1 -0
  317. package/build/types/store.js +3 -0
  318. package/build/types/store.js.map +1 -0
  319. package/build/types/teams.d.ts +94 -0
  320. package/build/types/teams.d.ts.map +1 -0
  321. package/build/types/teams.js +9 -0
  322. package/build/types/teams.js.map +1 -0
  323. package/build/types/terms-of-service.d.ts +7 -0
  324. package/build/types/terms-of-service.d.ts.map +1 -0
  325. package/build/types/terms-of-service.js +3 -0
  326. package/build/types/terms-of-service.js.map +1 -0
  327. package/build/types/threads.d.ts +40 -0
  328. package/build/types/threads.d.ts.map +1 -0
  329. package/build/types/threads.js +8 -0
  330. package/build/types/threads.js.map +1 -0
  331. package/build/types/typing.d.ts +6 -0
  332. package/build/types/typing.d.ts.map +1 -0
  333. package/build/types/typing.js +3 -0
  334. package/build/types/typing.js.map +1 -0
  335. package/build/types/users.d.ts +281 -0
  336. package/build/types/users.d.ts.map +1 -0
  337. package/build/types/users.js +42 -0
  338. package/build/types/users.js.map +1 -0
  339. package/build/types/web-client.d.ts +82 -0
  340. package/build/types/web-client.d.ts.map +1 -0
  341. package/build/types/web-client.js +17 -0
  342. package/build/types/web-client.js.map +1 -0
  343. package/build/utils.d.ts +24 -0
  344. package/build/utils.d.ts.map +1 -0
  345. package/build/utils.js +136 -0
  346. package/build/utils.js.map +1 -0
  347. package/build/web-client.d.ts +117 -0
  348. package/build/web-client.d.ts.map +1 -0
  349. package/build/web-client.js +421 -0
  350. package/build/web-client.js.map +1 -0
  351. package/package.json +74 -0
@@ -0,0 +1,2080 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Methods = void 0;
7
+ const eventemitter3_1 = __importDefault(require("eventemitter3"));
8
+ const web_client_1 = require("./types/web-client");
9
+ /**
10
+ * Binds a certain `method` and its (required) arguments and result types to the `apiCall` method in `LoopClient`.
11
+ */
12
+ function bindApiCall(self, config) {
13
+ return self.apiCall.bind(self, config);
14
+ }
15
+ /**
16
+ * Binds a certain `method` and its (required) arguments and result types to the `apiCall` method in `LoopClient`.
17
+ * */
18
+ function bindApiCallWithOptionalArg(self, config) {
19
+ return self.apiCall.bind(self, config);
20
+ }
21
+ /**
22
+ * @description A class that defines all Web API methods, their arguments type,
23
+ * their response type, and binds those methods to the `apiCall` class method.
24
+ *
25
+ * Due to irregularities in API some method paths include path params in Express.js notation
26
+ * @example `users/:user_id`
27
+ *
28
+ * Path params are then filled using options object
29
+ * @example { user_id: 'user_id_123456 } with path `users/:user_id/promote` will result in `users/user_id_123456/promote`
30
+ *
31
+ * Loop API reference:
32
+ * @see {@link https://developers.loop.ru/category/loop-api | Loop API}
33
+ */
34
+ class Methods extends eventemitter3_1.default {
35
+ constructor() {
36
+ super();
37
+ if (new.target.name !== "WebClient") {
38
+ // Check that the class being created extends from `WebClient` rather than this class
39
+ throw new Error("Attempt to inherit from WebClient methods without inheriting from WebClient");
40
+ }
41
+ }
42
+ /**
43
+ * ============================================================================
44
+ * @description Bots methods
45
+ * ============================================================================
46
+ */
47
+ bots = {
48
+ convert: {
49
+ /**
50
+ * @description Convert a user to a bot.
51
+ * Requires `manage_system` permission.
52
+ */
53
+ fromUser: bindApiCall(this, {
54
+ method: "POST",
55
+ path: "users/:user_id/convert_to_bot",
56
+ type: web_client_1.ContentType.URLEncoded
57
+ }),
58
+ /**
59
+ * @description Convert a bot to a user.
60
+ * Requires `manage_system` permission.
61
+ */
62
+ toUser: bindApiCall(this, {
63
+ method: "POST",
64
+ path: "bots/:bot_user_id/convert_to_user",
65
+ type: web_client_1.ContentType.JSON
66
+ })
67
+ },
68
+ /**
69
+ * @description Create a new bot.
70
+ * Requires `create_bot` permission.
71
+ */
72
+ create: bindApiCall(this, {
73
+ method: "POST",
74
+ path: "bots",
75
+ type: web_client_1.ContentType.JSON
76
+ }),
77
+ get: bindApiCall(this, {
78
+ method: "GET",
79
+ path: "bots/:user_id",
80
+ type: web_client_1.ContentType.URLEncoded
81
+ }),
82
+ list: bindApiCallWithOptionalArg(this, {
83
+ method: "GET",
84
+ path: "bots",
85
+ type: web_client_1.ContentType.URLEncoded
86
+ }),
87
+ patch: bindApiCall(this, {
88
+ method: "PUT",
89
+ path: "bots/:user_id",
90
+ type: web_client_1.ContentType.JSON
91
+ }),
92
+ disable: bindApiCall(this, {
93
+ method: "POST",
94
+ path: "bots/:bot_user_id/disable",
95
+ type: web_client_1.ContentType.JSON
96
+ }),
97
+ enable: bindApiCall(this, {
98
+ method: "POST",
99
+ path: "bots/:bot_user_id/enable",
100
+ type: web_client_1.ContentType.JSON
101
+ }),
102
+ assign: bindApiCall(this, {
103
+ method: "POST",
104
+ path: "bots/:bot_user_id/assign/:user_id",
105
+ type: web_client_1.ContentType.JSON
106
+ }),
107
+ icon: {
108
+ get: bindApiCall(this, {
109
+ method: "GET",
110
+ path: "bots/:bot_user_id/icon",
111
+ type: web_client_1.ContentType.URLEncoded
112
+ }),
113
+ set: bindApiCall(this, {
114
+ method: "POST",
115
+ path: "bots/:bot_user_id/icon",
116
+ type: web_client_1.ContentType.FormData
117
+ }),
118
+ delete: bindApiCall(this, {
119
+ method: "DELETE",
120
+ path: "bots/:bot_user_id/icon",
121
+ type: web_client_1.ContentType.JSON
122
+ })
123
+ }
124
+ };
125
+ /**
126
+ * ============================================================================
127
+ * @description Brand methods
128
+ * ============================================================================
129
+ */
130
+ brand = {
131
+ image: {
132
+ get: bindApiCall(this, {
133
+ method: "GET",
134
+ path: "brand/image",
135
+ type: web_client_1.ContentType.URLEncoded
136
+ }),
137
+ delete: bindApiCallWithOptionalArg(this, {
138
+ method: "DELETE",
139
+ path: "brand/image",
140
+ type: web_client_1.ContentType.URLEncoded
141
+ }),
142
+ upload: bindApiCall(this, {
143
+ method: "POST",
144
+ path: "brand/image",
145
+ type: web_client_1.ContentType.FormData
146
+ })
147
+ }
148
+ };
149
+ /**
150
+ * ============================================================================
151
+ * Compliance methods
152
+ * ============================================================================
153
+ */
154
+ compliance = {
155
+ createReport: bindApiCall(this, {
156
+ method: "POST",
157
+ path: "compliance/reports",
158
+ type: web_client_1.ContentType.JSON
159
+ }),
160
+ downloadReport: bindApiCall(this, {
161
+ method: "GET",
162
+ path: "compliance/reports/:report_id/download",
163
+ type: web_client_1.ContentType.URLEncoded
164
+ }),
165
+ getReports: bindApiCall(this, {
166
+ method: "GET",
167
+ path: "compliance/reports",
168
+ type: web_client_1.ContentType.URLEncoded
169
+ })
170
+ };
171
+ /**
172
+ * ============================================================================
173
+ * @description Channels methods
174
+ * ============================================================================
175
+ */
176
+ channels = {
177
+ autocomplete: bindApiCall(this, {
178
+ method: "GET",
179
+ path: "teams/:team_id/channels/autocomplete",
180
+ type: web_client_1.ContentType.URLEncoded
181
+ }),
182
+ /**
183
+ * @description Create a new channel.
184
+ * If creating a public channel, create_public_channel permission is required.
185
+ * If creating a private channel, create_private_channel permission is required.
186
+ */
187
+ create: {
188
+ regular: bindApiCall(this, {
189
+ method: "POST",
190
+ path: "channels",
191
+ type: web_client_1.ContentType.JSON
192
+ }),
193
+ direct: bindApiCall(this, {
194
+ method: "POST",
195
+ path: "channels/direct",
196
+ type: web_client_1.ContentType.JSON
197
+ }),
198
+ group: bindApiCall(this, {
199
+ method: "POST",
200
+ path: "channels/group",
201
+ type: web_client_1.ContentType.JSON
202
+ })
203
+ },
204
+ list: {
205
+ /**
206
+ * @description List all channels
207
+ */
208
+ all: bindApiCallWithOptionalArg(this, {
209
+ method: "GET",
210
+ path: "channels",
211
+ type: web_client_1.ContentType.URLEncoded
212
+ }),
213
+ /**
214
+ * @description List channels for a team.
215
+ */
216
+ inTeam: bindApiCall(this, {
217
+ method: "GET",
218
+ path: "teams/:team_id/channels",
219
+ type: web_client_1.ContentType.URLEncoded
220
+ }),
221
+ byIds: bindApiCall(this, {
222
+ method: "POST",
223
+ path: "teams/:team_id/channels/ids",
224
+ type: web_client_1.ContentType.JSON
225
+ }),
226
+ /**
227
+ * @description Get all channels for a user across all teams.
228
+ */
229
+ forUser: bindApiCall(this, {
230
+ method: "GET",
231
+ path: "users/:user_id/channels",
232
+ type: web_client_1.ContentType.URLEncoded
233
+ }),
234
+ /**
235
+ * @description Get all channels for a user in a specific team.
236
+ */
237
+ forUserInTeam: bindApiCall(this, {
238
+ method: "GET",
239
+ path: "users/:user_id/teams/:team_id/channels",
240
+ type: web_client_1.ContentType.URLEncoded
241
+ }),
242
+ /**
243
+ * @description Get private channels for a team.
244
+ */
245
+ private: bindApiCall(this, {
246
+ method: "GET",
247
+ path: "teams/:team_id/channels/private",
248
+ type: web_client_1.ContentType.URLEncoded
249
+ }),
250
+ /**
251
+ * @description Get deleted channels for a team.
252
+ */
253
+ deleted: bindApiCall(this, {
254
+ method: "GET",
255
+ path: "teams/:team_id/channels/deleted",
256
+ type: web_client_1.ContentType.URLEncoded
257
+ })
258
+ },
259
+ search: {
260
+ team: bindApiCall(this, {
261
+ method: "POST",
262
+ path: "teams/:team_id/channels/search",
263
+ type: web_client_1.ContentType.JSON
264
+ }),
265
+ all: bindApiCall(this, {
266
+ method: "POST",
267
+ path: "channels/search",
268
+ type: web_client_1.ContentType.JSON
269
+ }),
270
+ archived: bindApiCall(this, {
271
+ method: "POST",
272
+ path: "teams/:team_id/channels/search_archived",
273
+ type: web_client_1.ContentType.JSON
274
+ }),
275
+ /**
276
+ * @description Autocomplete channels for search in a team.
277
+ */
278
+ autocomplete: bindApiCall(this, {
279
+ method: "GET",
280
+ path: "teams/:team_id/channels/search_autocomplete",
281
+ type: web_client_1.ContentType.URLEncoded
282
+ }),
283
+ /**
284
+ * @description Search for group message channels.
285
+ */
286
+ groups: bindApiCall(this, {
287
+ method: "POST",
288
+ path: "channels/group/search",
289
+ type: web_client_1.ContentType.JSON
290
+ })
291
+ },
292
+ get: {
293
+ /**
294
+ * @description Get a channel by ID.
295
+ */
296
+ byId: bindApiCall(this, {
297
+ method: "GET",
298
+ path: "channels/:channel_id",
299
+ type: web_client_1.ContentType.URLEncoded
300
+ }),
301
+ /**
302
+ * @description Get a channel by name.
303
+ */
304
+ byName: bindApiCall(this, {
305
+ method: "GET",
306
+ path: "channels/:team_id/channels/:channel_name",
307
+ type: web_client_1.ContentType.URLEncoded
308
+ })
309
+ },
310
+ /**
311
+ * @description Update a channel.
312
+ */
313
+ update: bindApiCall(this, {
314
+ method: "PUT",
315
+ path: "channels/:channel_id",
316
+ type: web_client_1.ContentType.JSON
317
+ }),
318
+ /**
319
+ * @description Delete a channel.
320
+ */
321
+ delete: bindApiCall(this, {
322
+ method: "DELETE",
323
+ path: "channels/:channel_id",
324
+ type: web_client_1.ContentType.URLEncoded
325
+ }),
326
+ patch: bindApiCall(this, {
327
+ method: "PUT",
328
+ path: "channels/:channel_id/patch",
329
+ type: web_client_1.ContentType.JSON
330
+ }),
331
+ restore: bindApiCall(this, {
332
+ method: "POST",
333
+ path: "channels/:channel_id/restore",
334
+ type: web_client_1.ContentType.URLEncoded
335
+ }),
336
+ getStats: bindApiCall(this, {
337
+ method: "GET",
338
+ path: "channels/:channel_id/stats",
339
+ type: web_client_1.ContentType.URLEncoded
340
+ }),
341
+ view: bindApiCall(this, {
342
+ method: "POST",
343
+ path: "channels/members/:channel_id/view",
344
+ type: web_client_1.ContentType.JSON
345
+ }),
346
+ members: {
347
+ /**
348
+ * @description Get channel members.
349
+ */
350
+ get: bindApiCall(this, {
351
+ method: "GET",
352
+ path: "channels/:channel_id/members",
353
+ type: web_client_1.ContentType.URLEncoded
354
+ }),
355
+ /**
356
+ * @description Get a specific channel member.
357
+ */
358
+ getById: bindApiCall(this, {
359
+ method: "GET",
360
+ path: "channels/:channel_id/members/:user_id",
361
+ type: web_client_1.ContentType.URLEncoded
362
+ }),
363
+ /**
364
+ * @description Add a user to a channel.
365
+ * Requires `join_public_channels` for public channels.
366
+ */
367
+ add: bindApiCall(this, {
368
+ method: "POST",
369
+ path: "channels/:channel_id/members",
370
+ type: web_client_1.ContentType.JSON
371
+ }),
372
+ /**
373
+ * @description Remove a user from a channel.
374
+ */
375
+ remove: bindApiCall(this, {
376
+ method: "DELETE",
377
+ path: "channels/:channel_id/members/:user_id",
378
+ type: web_client_1.ContentType.URLEncoded
379
+ }),
380
+ /**
381
+ * @description Get channel members by user IDs.
382
+ */
383
+ getByIds: bindApiCall(this, {
384
+ method: "POST",
385
+ path: "channels/:channel_id/members/ids",
386
+ type: web_client_1.ContentType.JSON
387
+ }),
388
+ /**
389
+ * @description Update the roles of a channel member.
390
+ */
391
+ updateRoles: bindApiCall(this, {
392
+ method: "PUT",
393
+ path: "channels/:channel_id/members/:user_id/roles",
394
+ type: web_client_1.ContentType.JSON
395
+ }),
396
+ /**
397
+ * @description Update the scheme-derived roles of a channel member.
398
+ */
399
+ updateSchemeRoles: bindApiCall(this, {
400
+ method: "PUT",
401
+ path: "channels/:channel_id/members/:user_id/scheme_roles",
402
+ type: web_client_1.ContentType.JSON
403
+ }),
404
+ /**
405
+ * @description Update a user's notification properties for a channel.
406
+ */
407
+ updateNotifyProps: bindApiCall(this, {
408
+ method: "PUT",
409
+ path: "channels/:channel_id/members/:user_id/notify_props",
410
+ type: web_client_1.ContentType.JSON
411
+ }),
412
+ /**
413
+ * @description Get channel members minus group members.
414
+ * @permission Must have manage_system permission.
415
+ */
416
+ getMinusGroupMembers: bindApiCall(this, {
417
+ method: "GET",
418
+ path: "channels/:channel_id/members_minus_group_members",
419
+ type: web_client_1.ContentType.URLEncoded
420
+ }),
421
+ /**
422
+ * @description Get member counts by group for a channel.
423
+ */
424
+ countByGroup: bindApiCall(this, {
425
+ method: "GET",
426
+ path: "channels/:channel_id/member_counts_by_group",
427
+ type: web_client_1.ContentType.URLEncoded
428
+ })
429
+ },
430
+ /**
431
+ * @description Update a channel's privacy setting.
432
+ * Converts a public channel to private or vice-versa.
433
+ */
434
+ updatePrivacy: bindApiCall(this, {
435
+ method: "PUT",
436
+ path: "channels/:channel_id/privacy",
437
+ type: web_client_1.ContentType.JSON
438
+ }),
439
+ /**
440
+ * @description Move a channel to a different team.
441
+ */
442
+ move: bindApiCall(this, {
443
+ method: "POST",
444
+ path: "channels/:channel_id/move",
445
+ type: web_client_1.ContentType.JSON
446
+ }),
447
+ /**
448
+ * @description Get pinned posts in a channel.
449
+ */
450
+ getPinned: bindApiCall(this, {
451
+ method: "GET",
452
+ path: "channels/:channel_id/pinned",
453
+ type: web_client_1.ContentType.URLEncoded
454
+ }),
455
+ /**
456
+ * @description Get timezones of users in a channel.
457
+ */
458
+ getTimezones: bindApiCall(this, {
459
+ method: "GET",
460
+ path: "channels/:channel_id/timezones",
461
+ type: web_client_1.ContentType.URLEncoded
462
+ }),
463
+ /**
464
+ * @description Get unread message and mention counts for a user in a channel.
465
+ */
466
+ getUnread: bindApiCall(this, {
467
+ method: "GET",
468
+ path: "users/:user_id/channels/:channel_id/unread",
469
+ type: web_client_1.ContentType.URLEncoded
470
+ }),
471
+ /**
472
+ * @description Set a channel's scheme.
473
+ */
474
+ setScheme: bindApiCall(this, {
475
+ method: "PUT",
476
+ path: "channels/:channel_id/scheme",
477
+ type: web_client_1.ContentType.JSON
478
+ }),
479
+ moderation: {
480
+ /**
481
+ * @description Get moderation settings for a channel.
482
+ */
483
+ get: bindApiCall(this, {
484
+ method: "GET",
485
+ path: "channels/:channel_id/moderations",
486
+ type: web_client_1.ContentType.URLEncoded
487
+ }),
488
+ /**
489
+ * @description Update moderation settings for a channel.
490
+ */
491
+ update: bindApiCall(this, {
492
+ method: "PUT",
493
+ path: "channels/:channel_id/moderations/patch",
494
+ type: web_client_1.ContentType.JSON
495
+ })
496
+ }
497
+ };
498
+ /**
499
+ * ============================================================================
500
+ * @description Cloud methods
501
+ * ============================================================================
502
+ */
503
+ cloud = {
504
+ customer: {
505
+ get: bindApiCallWithOptionalArg(this, {
506
+ method: "GET",
507
+ path: "cloud/customer",
508
+ type: web_client_1.ContentType.URLEncoded
509
+ }),
510
+ /**
511
+ * Updates the customer information for the LOOP Cloud customer bound to this installation.
512
+ * @description Must have manage_system permission and be licensed for Cloud.
513
+ * Minimum server version: 5.29 Note: This is intended for internal use and is subject to change.
514
+ */
515
+ update: bindApiCall(this, {
516
+ method: "PUT",
517
+ path: "cloud/customer",
518
+ type: web_client_1.ContentType.JSON
519
+ }),
520
+ /**
521
+ * @description Updates the company address for the LOOP Cloud customer bound to this installation.
522
+ * Must have manage_system permission and be licensed for Cloud.
523
+ * Minimum server version: 5.29 Note: This is intended for internal use and is subject to change.
524
+ */
525
+ updateAddress: bindApiCall(this, {
526
+ method: "PUT",
527
+ path: "cloud/customer/address",
528
+ type: web_client_1.ContentType.JSON
529
+ }),
530
+ validateBusinessEmail: bindApiCall(this, {
531
+ method: "POST",
532
+ path: "cloud/validate_business_email",
533
+ type: web_client_1.ContentType.JSON
534
+ }),
535
+ confirmPayment: bindApiCall(this, {
536
+ method: "POST",
537
+ path: "cloud/payment/confirm",
538
+ type: web_client_1.ContentType.JSON
539
+ })
540
+ },
541
+ invoices: {
542
+ get: bindApiCallWithOptionalArg(this, {
543
+ method: "GET",
544
+ path: "cloud/invoices",
545
+ type: web_client_1.ContentType.URLEncoded
546
+ })
547
+ },
548
+ subscription: {
549
+ get: bindApiCallWithOptionalArg(this, {
550
+ method: "GET",
551
+ path: "cloud/subscription",
552
+ type: web_client_1.ContentType.URLEncoded
553
+ }),
554
+ update: bindApiCallWithOptionalArg(this, {
555
+ method: "PUT",
556
+ path: "cloud/subscription",
557
+ type: web_client_1.ContentType.JSON
558
+ })
559
+ },
560
+ products: {
561
+ get: bindApiCallWithOptionalArg(this, {
562
+ method: "GET",
563
+ path: "cloud/products",
564
+ type: web_client_1.ContentType.URLEncoded
565
+ })
566
+ },
567
+ limits: {
568
+ get: bindApiCallWithOptionalArg(this, {
569
+ method: "GET",
570
+ path: "cloud/limits",
571
+ type: web_client_1.ContentType.URLEncoded
572
+ })
573
+ }
574
+ };
575
+ /**
576
+ * ============================================================================
577
+ * @description Data retention methods
578
+ * ============================================================================
579
+ */
580
+ dataRetention = {
581
+ policies: {
582
+ create: bindApiCall(this, {
583
+ method: "POST",
584
+ path: "data_retention/policies",
585
+ type: web_client_1.ContentType.JSON
586
+ }),
587
+ get: bindApiCall(this, {
588
+ method: "GET",
589
+ path: "data_retention/policies/:policy_id",
590
+ type: web_client_1.ContentType.URLEncoded
591
+ }),
592
+ delete: bindApiCall(this, {
593
+ method: "DELETE",
594
+ path: "data_retention/policies/:policy_id",
595
+ type: web_client_1.ContentType.URLEncoded
596
+ }),
597
+ update: bindApiCall(this, {
598
+ method: "PUT",
599
+ path: "data_retention/policies/:policy_id",
600
+ type: web_client_1.ContentType.JSON
601
+ }),
602
+ patch: bindApiCall(this, {
603
+ method: "PATCH",
604
+ path: "data_retention/policies/:policy_id",
605
+ type: web_client_1.ContentType.JSON
606
+ }),
607
+ list: bindApiCall(this, {
608
+ method: "GET",
609
+ path: "data_retention/policies",
610
+ type: web_client_1.ContentType.URLEncoded
611
+ }),
612
+ teams: {
613
+ search: bindApiCall(this, {
614
+ method: "POST",
615
+ path: "data_retention/policies/:policy_id/teams/search",
616
+ type: web_client_1.ContentType.JSON
617
+ }),
618
+ add: bindApiCall(this, {
619
+ method: "POST",
620
+ path: "data_retention/policies/:policy_id/teams",
621
+ type: web_client_1.ContentType.JSON
622
+ }),
623
+ remove: bindApiCall(this, {
624
+ method: "DELETE",
625
+ path: "data_retention/policies/:policy_id/teams/:team_id",
626
+ type: web_client_1.ContentType.URLEncoded
627
+ }),
628
+ get: bindApiCall(this, {
629
+ method: "GET",
630
+ path: "data_retention/policies/:policy_id/teams",
631
+ type: web_client_1.ContentType.URLEncoded
632
+ })
633
+ },
634
+ channels: {
635
+ search: bindApiCall(this, {
636
+ method: "POST",
637
+ path: "data_retention/policies/:policy_id/channels/search",
638
+ type: web_client_1.ContentType.JSON
639
+ }),
640
+ add: bindApiCall(this, {
641
+ method: "POST",
642
+ path: "data_retention/policies/:policy_id/channels",
643
+ type: web_client_1.ContentType.JSON
644
+ }),
645
+ remove: bindApiCall(this, {
646
+ method: "DELETE",
647
+ path: "data_retention/policies/:policy_id/channels/:channel_id",
648
+ type: web_client_1.ContentType.URLEncoded
649
+ }),
650
+ get: bindApiCall(this, {
651
+ method: "GET",
652
+ path: "data_retention/policies/:policy_id/channels",
653
+ type: web_client_1.ContentType.URLEncoded
654
+ })
655
+ }
656
+ },
657
+ users: {
658
+ getTeams: bindApiCall(this, {
659
+ method: "GET",
660
+ path: "users/:user_id/teams/data_retention/policies",
661
+ type: web_client_1.ContentType.URLEncoded
662
+ }),
663
+ getChannels: bindApiCall(this, {
664
+ method: "GET",
665
+ path: "users/:user_id/channels/data_retention/policies",
666
+ type: web_client_1.ContentType.URLEncoded
667
+ })
668
+ },
669
+ policy: {
670
+ get: bindApiCallWithOptionalArg(this, {
671
+ method: "GET",
672
+ path: "data_retention/policy",
673
+ type: web_client_1.ContentType.URLEncoded
674
+ })
675
+ },
676
+ policiesCount: {
677
+ get: bindApiCallWithOptionalArg(this, {
678
+ method: "GET",
679
+ path: "data_retention/policies_count",
680
+ type: web_client_1.ContentType.URLEncoded
681
+ })
682
+ }
683
+ };
684
+ /**
685
+ * ============================================================================
686
+ * @description Emojis methods
687
+ * ============================================================================
688
+ */
689
+ emojis = {
690
+ autocomplete: bindApiCall(this, {
691
+ method: "GET",
692
+ path: "emoji/autocomplete",
693
+ type: web_client_1.ContentType.URLEncoded
694
+ }),
695
+ create: bindApiCall(this, {
696
+ method: "POST",
697
+ path: "emoji",
698
+ type: web_client_1.ContentType.FormData
699
+ }),
700
+ list: bindApiCall(this, {
701
+ method: "GET",
702
+ path: "emoji",
703
+ type: web_client_1.ContentType.URLEncoded
704
+ }),
705
+ get: {
706
+ byId: bindApiCall(this, {
707
+ method: "GET",
708
+ path: "emoji/:emoji_id",
709
+ type: web_client_1.ContentType.URLEncoded
710
+ }),
711
+ byName: bindApiCall(this, {
712
+ method: "GET",
713
+ path: "emoji/name/:name",
714
+ type: web_client_1.ContentType.URLEncoded
715
+ })
716
+ },
717
+ delete: bindApiCall(this, {
718
+ method: "DELETE",
719
+ path: "emoji/:emoji_id",
720
+ type: web_client_1.ContentType.JSON
721
+ }),
722
+ getImage: bindApiCall(this, {
723
+ method: "GET",
724
+ path: "emoji/:emoji_id/image",
725
+ type: web_client_1.ContentType.URLEncoded
726
+ }),
727
+ search: bindApiCall(this, {
728
+ method: "POST",
729
+ path: "emoji/search",
730
+ type: web_client_1.ContentType.JSON
731
+ })
732
+ };
733
+ /**
734
+ * ============================================================================
735
+ * @description Files methods
736
+ * ============================================================================
737
+ */
738
+ files = {
739
+ /**
740
+ * Upload a file
741
+ *
742
+ * @description Uploads a file that can later be attached to a post.
743
+ * This request can either be a multipart/form-data request with a channel_id,
744
+ * files and optional client_ids defined in the FormData, or it can be a request
745
+ * with the channel_id and filename defined as query parameters with the contents of a single file in the body of the request.
746
+ *
747
+ * Only multipart/form-data requests are supported by server versions up to and including 4.7.
748
+ * Server versions 4.8 and higher support both types of requests.
749
+ *
750
+ * Must have upload_file permission.
751
+ *
752
+ * @see https://developers.loop.ru/API/4.0.0/upload-file
753
+ */
754
+ upload: bindApiCall(this, {
755
+ method: "POST",
756
+ path: "files",
757
+ type: web_client_1.ContentType.FormData
758
+ }),
759
+ /**
760
+ * @description Get file and various file-related data
761
+ */
762
+ get: {
763
+ /**
764
+ * Get a file
765
+ *
766
+ * @description Gets a file that has been uploaded previously.
767
+ *
768
+ * Must have read_channel permission or be uploader of the file.
769
+ */
770
+ file: bindApiCall(this, {
771
+ method: "GET",
772
+ path: "files/:file_id",
773
+ type: web_client_1.ContentType.URLEncoded
774
+ }),
775
+ /**
776
+ * Get metadata for a file
777
+ *
778
+ * @description Gets a file's info.
779
+ *
780
+ * Must have read_channel permission or be uploader of the file.
781
+ */
782
+ metadata: bindApiCall(this, {
783
+ method: "GET",
784
+ path: "files/:file_id/info",
785
+ type: web_client_1.ContentType.URLEncoded
786
+ }),
787
+ /**
788
+ * Get a file's preview
789
+ *
790
+ * @description Gets a file's preview.
791
+ *
792
+ * Must have read_channel permission or be uploader of the file.
793
+ */
794
+ preview: bindApiCall(this, {
795
+ method: "GET",
796
+ path: "files/:file_id/preview",
797
+ type: web_client_1.ContentType.URLEncoded
798
+ }),
799
+ /**
800
+ * Get a public file link
801
+ *
802
+ * @description Gets a public link for a file that can be accessed without logging into LOOP.
803
+ *
804
+ * Must have read_channel permission or be uploader of the file.
805
+ */
806
+ publicLink: bindApiCall(this, {
807
+ method: "GET",
808
+ path: "files/:file_id/link",
809
+ type: web_client_1.ContentType.URLEncoded
810
+ }),
811
+ /**
812
+ * Get a public file
813
+ *
814
+ * No permissions required.
815
+ */
816
+ publicFile: bindApiCall(this, {
817
+ method: "GET",
818
+ path: "files/:file_id/public",
819
+ type: web_client_1.ContentType.URLEncoded
820
+ }),
821
+ /**
822
+ * Get a file's thumbnail
823
+ *
824
+ * @description Gets a file's thumbnail.
825
+ *
826
+ * Must have read_channel permission or be uploader of the file.
827
+ */
828
+ thumbnail: bindApiCall(this, {
829
+ method: "GET",
830
+ path: "files/:file_id/thumbnail",
831
+ type: web_client_1.ContentType.URLEncoded
832
+ })
833
+ },
834
+ /**
835
+ * Search files in team
836
+ *
837
+ * @description Search for files in a team based on file name, extention and file content
838
+ * (if file content extraction is enabled and supported for the files).
839
+ * Must be authenticated and have the view_team permission.
840
+ *
841
+ * @version 5.34+
842
+ *
843
+ * @see https://developers.loop.ru/API/4.0.0/search-files
844
+ */
845
+ search: bindApiCall(this, {
846
+ method: "POST",
847
+ path: "teams/:team_id/files/search",
848
+ type: web_client_1.ContentType.JSON
849
+ })
850
+ };
851
+ /**
852
+ * ============================================================================
853
+ * @description Integrations methods
854
+ * ============================================================================
855
+ */
856
+ integrations = {
857
+ /**
858
+ * ============================================================================
859
+ * @description Integration interactive dialogs methods
860
+ * ============================================================================
861
+ */
862
+ dialogs: {
863
+ /**
864
+ * @description Open an interactive dialog using a trigger ID provided
865
+ * by a slash command, or some other action payload.
866
+ * @see {@link https://docs.loop.ru/developer/interactive-dialogs.html | Interactive Dialogs}
867
+ * for more information on interactive dialogs.
868
+ * Minimum server @version 5.6
869
+ */
870
+ open: bindApiCall(this, {
871
+ method: "POST",
872
+ path: "actions/dialogs/open",
873
+ type: web_client_1.ContentType.JSON
874
+ }),
875
+ /**
876
+ * @description Endpoint used by the LOOP clients to submit a dialog.
877
+ * @see {@link https://docs.loop.ru/developer/interactive-dialogs.html | Interactive Dialogs}
878
+ * for more information on interactive dialogs.
879
+ * Minimum server @version 5.6
880
+ */
881
+ submit: bindApiCall(this, {
882
+ method: "POST",
883
+ path: "actions/dialogs/submit",
884
+ type: web_client_1.ContentType.JSON
885
+ })
886
+ },
887
+ /**
888
+ * ============================================================================
889
+ * @description Integration commands methods
890
+ * ============================================================================
891
+ */
892
+ commands: {
893
+ /**
894
+ * @description Create a command for a team.
895
+ * `manage_slash_commands` for the team the command is in.
896
+ */
897
+ create: bindApiCall(this, {
898
+ method: "POST",
899
+ path: "commands",
900
+ type: web_client_1.ContentType.JSON
901
+ }),
902
+ /**
903
+ * @description List commands for a team.
904
+ * @permission `manage_slash_commands` if need to list custom commands.
905
+ */
906
+ update: bindApiCall(this, {
907
+ method: "PUT",
908
+ path: "commands/:id",
909
+ type: web_client_1.ContentType.JSON
910
+ }),
911
+ /**
912
+ * @description List autocomplete commands in the team.
913
+ * @permisstion `view_team` for the team.
914
+ */
915
+ delete: bindApiCall(this, {
916
+ method: "DELETE",
917
+ path: "commands/:command_id",
918
+ type: web_client_1.ContentType.URLEncoded
919
+ }),
920
+ list: bindApiCall(this, {
921
+ method: "GET",
922
+ path: "commands",
923
+ type: web_client_1.ContentType.URLEncoded
924
+ }),
925
+ regenerateToken: bindApiCall(this, {
926
+ method: "PUT",
927
+ path: "commands/:command_id/regen_token",
928
+ type: web_client_1.ContentType.JSON
929
+ }),
930
+ execute: bindApiCall(this, {
931
+ method: "POST",
932
+ path: "commands/execute",
933
+ type: web_client_1.ContentType.JSON
934
+ }),
935
+ listAutocomplete: bindApiCall(this, {
936
+ method: "GET",
937
+ path: "teams/:team_id/commands/autocomplete",
938
+ type: web_client_1.ContentType.URLEncoded
939
+ })
940
+ },
941
+ /**
942
+ * ============================================================================
943
+ * @description Integration webhooks methods
944
+ * ============================================================================
945
+ */
946
+ webhooks: {
947
+ incoming: {
948
+ create: bindApiCall(this, {
949
+ method: "POST",
950
+ path: "hooks/incoming",
951
+ type: web_client_1.ContentType.JSON
952
+ }),
953
+ update: bindApiCall(this, {
954
+ method: "PUT",
955
+ path: "hooks/incoming/:id",
956
+ type: web_client_1.ContentType.JSON
957
+ }),
958
+ delete: bindApiCall(this, {
959
+ method: "DELETE",
960
+ path: "hooks/incoming/:hook_id",
961
+ type: web_client_1.ContentType.URLEncoded
962
+ }),
963
+ list: bindApiCall(this, {
964
+ method: "GET",
965
+ path: "hooks/incoming",
966
+ type: web_client_1.ContentType.URLEncoded
967
+ }),
968
+ get: bindApiCall(this, {
969
+ method: "GET",
970
+ path: "hooks/incoming/:hook_id",
971
+ type: web_client_1.ContentType.URLEncoded
972
+ })
973
+ },
974
+ outgoing: {
975
+ create: bindApiCall(this, {
976
+ method: "POST",
977
+ path: "hooks/outgoing",
978
+ type: web_client_1.ContentType.JSON
979
+ }),
980
+ update: bindApiCall(this, {
981
+ method: "PUT",
982
+ path: "hooks/outgoing/:id",
983
+ type: web_client_1.ContentType.JSON
984
+ }),
985
+ delete: bindApiCall(this, {
986
+ method: "DELETE",
987
+ path: "hooks/outgoing/:hook_id",
988
+ type: web_client_1.ContentType.URLEncoded
989
+ }),
990
+ list: bindApiCall(this, {
991
+ method: "GET",
992
+ path: "hooks/outgoing",
993
+ type: web_client_1.ContentType.URLEncoded
994
+ }),
995
+ get: bindApiCall(this, {
996
+ method: "GET",
997
+ path: "hooks/outgoing/:hook_id",
998
+ type: web_client_1.ContentType.URLEncoded
999
+ }),
1000
+ regenerateToken: bindApiCall(this, {
1001
+ method: "POST",
1002
+ path: "hooks/outgoing/:hook_id/regen_token",
1003
+ type: web_client_1.ContentType.JSON
1004
+ })
1005
+ }
1006
+ },
1007
+ /**
1008
+ * ============================================================================
1009
+ * @description OAuth apps methods
1010
+ * ============================================================================
1011
+ */
1012
+ oauth: {
1013
+ apps: {
1014
+ create: bindApiCall(this, {
1015
+ method: "POST",
1016
+ path: "oauth/apps",
1017
+ type: web_client_1.ContentType.JSON
1018
+ }),
1019
+ update: bindApiCall(this, {
1020
+ method: "PUT",
1021
+ path: "oauth/apps/:id",
1022
+ type: web_client_1.ContentType.JSON
1023
+ }),
1024
+ delete: bindApiCall(this, {
1025
+ method: "DELETE",
1026
+ path: "oauth/apps/:app_id",
1027
+ type: web_client_1.ContentType.URLEncoded
1028
+ }),
1029
+ get: bindApiCall(this, {
1030
+ method: "GET",
1031
+ path: "oauth/apps/:app_id",
1032
+ type: web_client_1.ContentType.URLEncoded
1033
+ }),
1034
+ getInfo: bindApiCall(this, {
1035
+ method: "GET",
1036
+ path: "oauth/apps/:app_id/info",
1037
+ type: web_client_1.ContentType.URLEncoded
1038
+ }),
1039
+ list: bindApiCall(this, {
1040
+ method: "GET",
1041
+ path: "oauth/apps",
1042
+ type: web_client_1.ContentType.URLEncoded
1043
+ }),
1044
+ regenerateSecret: bindApiCall(this, {
1045
+ method: "POST",
1046
+ path: "oauth/apps/:app_id/regen_secret",
1047
+ type: web_client_1.ContentType.JSON
1048
+ })
1049
+ }
1050
+ }
1051
+ };
1052
+ /**
1053
+ * ============================================================================
1054
+ * @description Groups methods
1055
+ * ============================================================================
1056
+ */
1057
+ groups = {
1058
+ /**
1059
+ * @description Create a new group.
1060
+ * Requires `manage_system` permission.
1061
+ */
1062
+ create: bindApiCall(this, {
1063
+ method: "POST",
1064
+ path: "groups",
1065
+ type: web_client_1.ContentType.JSON
1066
+ }),
1067
+ /**
1068
+ * @description Retrieve a group by its ID.
1069
+ * Requires `manage_system` permission.
1070
+ */
1071
+ get: bindApiCall(this, {
1072
+ method: "GET",
1073
+ path: "groups/:group_id",
1074
+ type: web_client_1.ContentType.URLEncoded
1075
+ }),
1076
+ /**
1077
+ * @description List all groups.
1078
+ * Requires `manage_system` permission.
1079
+ */
1080
+ list: bindApiCall(this, {
1081
+ method: "GET",
1082
+ path: "groups",
1083
+ type: web_client_1.ContentType.URLEncoded
1084
+ }),
1085
+ update: bindApiCall(this, {
1086
+ method: "PUT",
1087
+ path: "groups/:group_id",
1088
+ type: web_client_1.ContentType.JSON
1089
+ }),
1090
+ delete: bindApiCall(this, {
1091
+ method: "DELETE",
1092
+ path: "groups/:group_id",
1093
+ type: web_client_1.ContentType.URLEncoded
1094
+ }),
1095
+ patch: bindApiCall(this, {
1096
+ method: "PUT",
1097
+ path: "groups/:group_id/patch",
1098
+ type: web_client_1.ContentType.JSON
1099
+ }),
1100
+ restore: bindApiCall(this, {
1101
+ method: "POST",
1102
+ path: "groups/:group_id/restore",
1103
+ type: web_client_1.ContentType.URLEncoded
1104
+ }),
1105
+ getStats: bindApiCall(this, {
1106
+ method: "GET",
1107
+ path: "groups/:group_id/stats",
1108
+ type: web_client_1.ContentType.URLEncoded
1109
+ }),
1110
+ syncables: {
1111
+ list: bindApiCall(this, {
1112
+ method: "GET",
1113
+ path: "groups/:group_id/syncables",
1114
+ type: web_client_1.ContentType.URLEncoded
1115
+ }),
1116
+ add: bindApiCall(this, {
1117
+ method: "POST",
1118
+ path: "groups/:group_id/syncables",
1119
+ type: web_client_1.ContentType.JSON
1120
+ }),
1121
+ remove: bindApiCall(this, {
1122
+ method: "DELETE",
1123
+ path: "groups/:group_id/syncables/:syncable_id?syncable_type=:syncable_type",
1124
+ type: web_client_1.ContentType.URLEncoded
1125
+ }),
1126
+ patch: bindApiCall(this, {
1127
+ method: "PUT",
1128
+ path: "groups/:group_id/syncables/:syncable_id/patch",
1129
+ type: web_client_1.ContentType.JSON
1130
+ })
1131
+ },
1132
+ /**
1133
+ * ============================================================================
1134
+ * @description Group members methods
1135
+ * ============================================================================
1136
+ */
1137
+ members: {
1138
+ /**
1139
+ * @description Get groups for a user.
1140
+ */
1141
+ listForUser: bindApiCall(this, {
1142
+ method: "GET",
1143
+ path: "users/:user_id/groups",
1144
+ type: web_client_1.ContentType.URLEncoded
1145
+ }),
1146
+ /**
1147
+ * @description Get members of a group.
1148
+ */
1149
+ get: bindApiCall(this, {
1150
+ method: "GET",
1151
+ path: "groups/:group_id/members",
1152
+ type: web_client_1.ContentType.URLEncoded
1153
+ }),
1154
+ /**
1155
+ * @description Add members to a custom group.
1156
+ */
1157
+ add: bindApiCall(this, {
1158
+ method: "POST",
1159
+ path: "groups/:group_id/members",
1160
+ type: web_client_1.ContentType.JSON
1161
+ }),
1162
+ /**
1163
+ * @description Remove members from a custom group.
1164
+ */
1165
+ remove: bindApiCall(this, {
1166
+ method: "DELETE",
1167
+ path: "groups/:group_id/members",
1168
+ type: web_client_1.ContentType.JSON
1169
+ })
1170
+ },
1171
+ teams: {
1172
+ /**
1173
+ * @description Get a group's teams.
1174
+ */
1175
+ get: bindApiCall(this, {
1176
+ method: "GET",
1177
+ path: "groups/:group_id/teams",
1178
+ type: web_client_1.ContentType.URLEncoded
1179
+ })
1180
+ },
1181
+ channels: {
1182
+ /**
1183
+ * @description Get a group's channels.
1184
+ */
1185
+ get: bindApiCall(this, {
1186
+ method: "GET",
1187
+ path: "groups/:group_id/channels",
1188
+ type: web_client_1.ContentType.URLEncoded
1189
+ })
1190
+ },
1191
+ deleteLdapLink: bindApiCall(this, {
1192
+ method: "DELETE",
1193
+ path: "groups/:group_id/link",
1194
+ type: web_client_1.ContentType.URLEncoded
1195
+ })
1196
+ };
1197
+ /**
1198
+ * ============================================================================
1199
+ * @description Jobs methods
1200
+ * ============================================================================
1201
+ */
1202
+ jobs = {
1203
+ /**
1204
+ * @description Create a new job.
1205
+ * Requires `manage_jobs` permission.
1206
+ */
1207
+ create: bindApiCall(this, {
1208
+ method: "POST",
1209
+ path: "jobs",
1210
+ type: web_client_1.ContentType.JSON
1211
+ }),
1212
+ /**
1213
+ * @description Retrieve a job by its ID.
1214
+ */
1215
+ get: bindApiCall(this, {
1216
+ method: "GET",
1217
+ path: "jobs/:job_id",
1218
+ type: web_client_1.ContentType.URLEncoded
1219
+ }),
1220
+ /**
1221
+ * @description List all jobs.
1222
+ */
1223
+ list: {
1224
+ all: bindApiCall(this, {
1225
+ method: "GET",
1226
+ path: "jobs",
1227
+ type: web_client_1.ContentType.URLEncoded
1228
+ }) /**
1229
+ * @description List jobs by type.
1230
+ */,
1231
+ byType: bindApiCall(this, {
1232
+ method: "GET",
1233
+ path: "jobs/type/:type",
1234
+ type: web_client_1.ContentType.URLEncoded
1235
+ })
1236
+ },
1237
+ /**
1238
+ * @description Cancel a job.
1239
+ */
1240
+ cancel: bindApiCall(this, {
1241
+ method: "POST",
1242
+ path: "jobs/:job_id/cancel",
1243
+ type: web_client_1.ContentType.JSON
1244
+ })
1245
+ };
1246
+ /**
1247
+ * ============================================================================
1248
+ * @description Plugins methods
1249
+ * ============================================================================
1250
+ */
1251
+ plugins = {
1252
+ /**
1253
+ * @description Upload a plugin.
1254
+ * Requires `manage_system` permission.
1255
+ */
1256
+ upload: bindApiCall(this, {
1257
+ method: "POST",
1258
+ path: "plugins",
1259
+ type: web_client_1.ContentType.FormData
1260
+ }),
1261
+ install: {
1262
+ fromUrl: bindApiCall(this, {
1263
+ method: "POST",
1264
+ path: "plugins/install_from_url",
1265
+ type: web_client_1.ContentType.JSON
1266
+ }),
1267
+ fromMarketplace: bindApiCall(this, {
1268
+ method: "POST",
1269
+ path: "plugins/marketplace",
1270
+ type: web_client_1.ContentType.JSON
1271
+ })
1272
+ },
1273
+ remove: bindApiCall(this, {
1274
+ method: "DELETE",
1275
+ path: "plugins/:plugin_id",
1276
+ type: web_client_1.ContentType.URLEncoded
1277
+ }),
1278
+ enable: bindApiCall(this, {
1279
+ method: "POST",
1280
+ path: "plugins/:plugin_id/enable",
1281
+ type: web_client_1.ContentType.URLEncoded
1282
+ }),
1283
+ disable: bindApiCall(this, {
1284
+ method: "POST",
1285
+ path: "plugins/:plugin_id/disable",
1286
+ type: web_client_1.ContentType.URLEncoded
1287
+ }),
1288
+ get: bindApiCallWithOptionalArg(this, {
1289
+ method: "GET",
1290
+ path: "plugins",
1291
+ type: web_client_1.ContentType.URLEncoded
1292
+ }),
1293
+ getWebapp: bindApiCallWithOptionalArg(this, {
1294
+ method: "GET",
1295
+ path: "plugins/webapp",
1296
+ type: web_client_1.ContentType.URLEncoded
1297
+ }),
1298
+ getStatuses: bindApiCallWithOptionalArg(this, {
1299
+ method: "GET",
1300
+ path: "plugins/statuses",
1301
+ type: web_client_1.ContentType.URLEncoded
1302
+ }),
1303
+ getMarketplace: bindApiCall(this, {
1304
+ method: "GET",
1305
+ path: "plugins/marketplace",
1306
+ type: web_client_1.ContentType.URLEncoded
1307
+ })
1308
+ };
1309
+ /**
1310
+ * ============================================================================
1311
+ * @description Roles methods
1312
+ * ============================================================================
1313
+ */
1314
+ roles = {
1315
+ get: {
1316
+ /**
1317
+ * @description Retrieve a role by its ID.
1318
+ */
1319
+ byId: bindApiCall(this, {
1320
+ method: "GET",
1321
+ path: "roles/:role_id",
1322
+ type: web_client_1.ContentType.URLEncoded
1323
+ }),
1324
+ byName: bindApiCall(this, {
1325
+ method: "GET",
1326
+ path: "roles/name/:name",
1327
+ type: web_client_1.ContentType.URLEncoded
1328
+ }),
1329
+ byNames: bindApiCall(this, {
1330
+ method: "POST",
1331
+ path: "roles/names",
1332
+ type: web_client_1.ContentType.JSON
1333
+ })
1334
+ },
1335
+ patch: bindApiCall(this, {
1336
+ method: "PUT",
1337
+ path: "roles/:role_id/patch",
1338
+ type: web_client_1.ContentType.JSON
1339
+ })
1340
+ };
1341
+ /**
1342
+ * ============================================================================
1343
+ * @description Schemes methods
1344
+ * ============================================================================
1345
+ */
1346
+ schemes = {
1347
+ create: bindApiCall(this, {
1348
+ method: "POST",
1349
+ path: "schemes",
1350
+ type: web_client_1.ContentType.JSON
1351
+ }),
1352
+ delete: bindApiCall(this, {
1353
+ method: "DELETE",
1354
+ path: "schemes/:scheme_id",
1355
+ type: web_client_1.ContentType.URLEncoded
1356
+ }),
1357
+ get: bindApiCall(this, {
1358
+ method: "GET",
1359
+ path: "schemes/:scheme_id",
1360
+ type: web_client_1.ContentType.URLEncoded
1361
+ }),
1362
+ getChannels: bindApiCall(this, {
1363
+ method: "GET",
1364
+ path: "schemes/:scheme_id/channels",
1365
+ type: web_client_1.ContentType.URLEncoded
1366
+ }),
1367
+ getTeams: bindApiCall(this, {
1368
+ method: "GET",
1369
+ path: "schemes/:scheme_id/teams",
1370
+ type: web_client_1.ContentType.URLEncoded
1371
+ }),
1372
+ list: bindApiCall(this, {
1373
+ method: "GET",
1374
+ path: "schemes",
1375
+ type: web_client_1.ContentType.URLEncoded
1376
+ }),
1377
+ patch: bindApiCall(this, {
1378
+ method: "PUT",
1379
+ path: "schemes/:scheme_id/patch",
1380
+ type: web_client_1.ContentType.JSON
1381
+ })
1382
+ };
1383
+ /**
1384
+ * ============================================================================
1385
+ * @description Teams methods
1386
+ * ============================================================================
1387
+ */
1388
+ teams = {
1389
+ create: bindApiCall(this, {
1390
+ method: "POST",
1391
+ path: "teams",
1392
+ type: web_client_1.ContentType.JSON
1393
+ }),
1394
+ list: bindApiCallWithOptionalArg(this, {
1395
+ method: "GET",
1396
+ path: "teams",
1397
+ type: web_client_1.ContentType.URLEncoded
1398
+ }),
1399
+ get: {
1400
+ byId: bindApiCall(this, {
1401
+ method: "GET",
1402
+ path: "teams/:team_id",
1403
+ type: web_client_1.ContentType.URLEncoded
1404
+ }),
1405
+ byName: bindApiCall(this, {
1406
+ method: "GET",
1407
+ path: "teams/name/:name",
1408
+ type: web_client_1.ContentType.URLEncoded
1409
+ })
1410
+ },
1411
+ update: bindApiCall(this, {
1412
+ method: "PUT",
1413
+ path: "teams/:id",
1414
+ type: web_client_1.ContentType.JSON
1415
+ }),
1416
+ delete: bindApiCall(this, {
1417
+ method: "DELETE",
1418
+ path: "teams/:team_id",
1419
+ type: web_client_1.ContentType.URLEncoded
1420
+ }),
1421
+ patch: bindApiCall(this, {
1422
+ method: "PUT",
1423
+ path: "teams/:team_id/patch",
1424
+ type: web_client_1.ContentType.JSON
1425
+ }),
1426
+ regenerateInviteId: bindApiCall(this, {
1427
+ method: "POST",
1428
+ path: "teams/:team_id/regenerate_invite_id",
1429
+ type: web_client_1.ContentType.URLEncoded
1430
+ }),
1431
+ getStats: bindApiCall(this, {
1432
+ method: "GET",
1433
+ path: "teams/:team_id/stats",
1434
+ type: web_client_1.ContentType.URLEncoded
1435
+ }),
1436
+ search: bindApiCall(this, {
1437
+ method: "POST",
1438
+ path: "teams/search",
1439
+ type: web_client_1.ContentType.JSON
1440
+ }),
1441
+ checkNameExists: bindApiCall(this, {
1442
+ method: "GET",
1443
+ path: "teams/name/:name/exists",
1444
+ type: web_client_1.ContentType.URLEncoded
1445
+ }),
1446
+ import: bindApiCall(this, {
1447
+ method: "POST",
1448
+ path: "teams/import",
1449
+ type: web_client_1.ContentType.FormData
1450
+ }),
1451
+ icon: {
1452
+ set: bindApiCall(this, {
1453
+ method: "POST",
1454
+ path: "teams/:team_id/image",
1455
+ type: web_client_1.ContentType.FormData
1456
+ }),
1457
+ remove: bindApiCall(this, {
1458
+ method: "DELETE",
1459
+ path: "teams/:team_id/image",
1460
+ type: web_client_1.ContentType.URLEncoded
1461
+ }),
1462
+ get: bindApiCall(this, {
1463
+ method: "GET",
1464
+ path: "teams/:team_id/image",
1465
+ type: web_client_1.ContentType.URLEncoded
1466
+ })
1467
+ },
1468
+ members: {
1469
+ /**
1470
+ * @description Get a page of team members list.
1471
+ * Requires `view_team` permission.
1472
+ */
1473
+ list: bindApiCall(this, {
1474
+ method: "GET",
1475
+ path: "teams/:team_id/members",
1476
+ type: web_client_1.ContentType.URLEncoded
1477
+ }),
1478
+ /**
1479
+ * @description Add a user to a team.
1480
+ * Requires `add_user_to_team` permission.
1481
+ */
1482
+ add: bindApiCall(this, {
1483
+ method: "POST",
1484
+ path: "teams/:team_id/members",
1485
+ type: web_client_1.ContentType.JSON
1486
+ }),
1487
+ /**
1488
+ * @description Add a number of users to a team.
1489
+ * Requires `add_user_to_team` permission.
1490
+ */
1491
+ addBatch: bindApiCall(this, {
1492
+ method: "POST",
1493
+ path: "teams/:team_id/members/batch",
1494
+ type: web_client_1.ContentType.JSON
1495
+ }),
1496
+ /**
1497
+ * @description Get a team member.
1498
+ */
1499
+ get: bindApiCall(this, {
1500
+ method: "GET",
1501
+ path: "teams/:team_id/members/:user_id",
1502
+ type: web_client_1.ContentType.URLEncoded
1503
+ }),
1504
+ /**
1505
+ * @description Remove a user from a team.
1506
+ * Requires `remove_user_from_team` permission.
1507
+ */
1508
+ remove: bindApiCall(this, {
1509
+ method: "DELETE",
1510
+ path: "teams/:team_id/members/:user_id",
1511
+ type: web_client_1.ContentType.URLEncoded
1512
+ }),
1513
+ /**
1514
+ * @description Get a list of team members based on user IDs.
1515
+ */
1516
+ getByIds: bindApiCall(this, {
1517
+ method: "POST",
1518
+ path: "teams/:team_id/members/ids",
1519
+ type: web_client_1.ContentType.JSON
1520
+ }),
1521
+ /**
1522
+ * @description Update the roles of a team member.
1523
+ */
1524
+ updateRoles: bindApiCall(this, {
1525
+ method: "PUT",
1526
+ path: "teams/:team_id/members/:user_id/roles",
1527
+ type: web_client_1.ContentType.JSON
1528
+ }),
1529
+ /**
1530
+ * @description Update the scheme-derived roles of a team member.
1531
+ */
1532
+ updateSchemeRoles: bindApiCall(this, {
1533
+ method: "PUT",
1534
+ path: "teams/:team_id/members/:user_id/scheme_roles",
1535
+ type: web_client_1.ContentType.JSON
1536
+ })
1537
+ }
1538
+ };
1539
+ playbooks = {
1540
+ list: bindApiCall(this, {
1541
+ method: "GET",
1542
+ path: "playbooks",
1543
+ type: web_client_1.ContentType.URLEncoded
1544
+ }),
1545
+ get: bindApiCall(this, {
1546
+ method: "GET",
1547
+ path: "/playbooks/:id",
1548
+ type: web_client_1.ContentType.URLEncoded
1549
+ }),
1550
+ create: bindApiCall(this, {
1551
+ method: "POST",
1552
+ path: "playbooks",
1553
+ type: web_client_1.ContentType.JSON
1554
+ }),
1555
+ update: bindApiCall(this, {
1556
+ method: "PUT",
1557
+ path: "playbooks",
1558
+ type: web_client_1.ContentType.JSON
1559
+ }),
1560
+ delete: bindApiCall(this, {
1561
+ method: "DELETE",
1562
+ path: `playbooks/:id`,
1563
+ type: web_client_1.ContentType.URLEncoded
1564
+ }),
1565
+ runs: {
1566
+ get: bindApiCall(this, {
1567
+ method: "GET",
1568
+ path: "runs/:id",
1569
+ type: web_client_1.ContentType.URLEncoded
1570
+ }),
1571
+ create: bindApiCall(this, {
1572
+ method: "POST",
1573
+ path: "runs",
1574
+ type: web_client_1.ContentType.JSON
1575
+ }),
1576
+ list: bindApiCall(this, {
1577
+ method: "GET",
1578
+ path: "runs",
1579
+ type: web_client_1.ContentType.URLEncoded
1580
+ })
1581
+ }
1582
+ };
1583
+ /**
1584
+ * ============================================================================
1585
+ * @description Posts methods
1586
+ * ============================================================================
1587
+ */
1588
+ posts = {
1589
+ create: bindApiCall(this, {
1590
+ method: "POST",
1591
+ path: "posts",
1592
+ type: web_client_1.ContentType.JSON
1593
+ }),
1594
+ /**
1595
+ * @description Create an ephemeral post.
1596
+ * Creates a new ephemeral post that is visible only to the specified user.
1597
+ */
1598
+ createEphemeral: bindApiCall(this, {
1599
+ method: "POST",
1600
+ path: "posts/ephemeral",
1601
+ type: web_client_1.ContentType.JSON
1602
+ }),
1603
+ update: bindApiCall(this, {
1604
+ method: "PUT",
1605
+ path: "posts/:id",
1606
+ type: web_client_1.ContentType.JSON
1607
+ }),
1608
+ get: bindApiCall(this, {
1609
+ method: "GET",
1610
+ path: "posts/:post_id",
1611
+ type: web_client_1.ContentType.URLEncoded
1612
+ }),
1613
+ delete: bindApiCall(this, {
1614
+ method: "DELETE",
1615
+ path: "posts/:post_id",
1616
+ type: web_client_1.ContentType.URLEncoded
1617
+ }),
1618
+ getThread: bindApiCall(this, {
1619
+ method: "GET",
1620
+ path: "posts/:post_id/thread",
1621
+ type: web_client_1.ContentType.URLEncoded
1622
+ }),
1623
+ getForChannel: bindApiCall(this, {
1624
+ method: "GET",
1625
+ path: "channels/:channel_id/posts",
1626
+ type: web_client_1.ContentType.URLEncoded
1627
+ }),
1628
+ pin: bindApiCall(this, {
1629
+ method: "POST",
1630
+ path: "posts/:post_id/pin",
1631
+ type: web_client_1.ContentType.URLEncoded
1632
+ }),
1633
+ unpin: bindApiCall(this, {
1634
+ method: "POST",
1635
+ path: "posts/:post_id/unpin",
1636
+ type: web_client_1.ContentType.URLEncoded
1637
+ }),
1638
+ move: bindApiCall(this, {
1639
+ method: "POST",
1640
+ path: "posts/:post_id/move",
1641
+ type: web_client_1.ContentType.JSON
1642
+ }),
1643
+ /**
1644
+ * @description Mark a channel as being unread from a given post.
1645
+ * Sets the last viewed at timestamp for the user's channel to the post's create_at timestamp.
1646
+ */
1647
+ setUnread: bindApiCall(this, {
1648
+ method: "POST",
1649
+ path: "users/:user_id/posts/:post_id/set_unread",
1650
+ type: web_client_1.ContentType.JSON
1651
+ }),
1652
+ /**
1653
+ * @description Partially update a post.
1654
+ * Updates a post by providing only the fields that need to change.
1655
+ */
1656
+ patch: bindApiCall(this, {
1657
+ method: "PUT",
1658
+ path: "posts/:post_id/patch",
1659
+ type: web_client_1.ContentType.JSON
1660
+ }),
1661
+ /**
1662
+ * @description Get a list of flagged posts for a user.
1663
+ * Retrieves posts that the specified user has flagged/saved.
1664
+ */
1665
+ getFlagged: bindApiCall(this, {
1666
+ method: "GET",
1667
+ path: "users/:user_id/posts/flagged",
1668
+ type: web_client_1.ContentType.URLEncoded
1669
+ }),
1670
+ /**
1671
+ * @description Get file info for a post.
1672
+ * Gets a list of file information objects for the files attached to a post.
1673
+ */
1674
+ getFilesInfo: bindApiCall(this, {
1675
+ method: "GET",
1676
+ path: "posts/:post_id/files/info",
1677
+ type: web_client_1.ContentType.URLEncoded
1678
+ }),
1679
+ /**
1680
+ * @description Get posts around the last unread.
1681
+ * Get the posts around the oldest unread post in a channel for a given user.
1682
+ */
1683
+ getAroundUnread: bindApiCall(this, {
1684
+ method: "GET",
1685
+ path: "users/:user_id/channels/:channel_id/posts/unread",
1686
+ type: web_client_1.ContentType.URLEncoded
1687
+ }),
1688
+ /**
1689
+ * @description Search posts in a team.
1690
+ * Search posts in the specified team using the provided terms.
1691
+ */
1692
+ search: bindApiCall(this, {
1693
+ method: "POST",
1694
+ path: "teams/:team_id/posts/search",
1695
+ type: web_client_1.ContentType.JSON
1696
+ }),
1697
+ /**
1698
+ * @description Perform a post action.
1699
+ * Perform an action on a post, such as clicking an interactive button.
1700
+ */
1701
+ doAction: bindApiCall(this, {
1702
+ method: "POST",
1703
+ path: "posts/:post_id/actions/:action_id",
1704
+ type: web_client_1.ContentType.JSON
1705
+ }),
1706
+ /**
1707
+ * @description Get posts by IDs.
1708
+ * Get a list of posts based on a provided list of post IDs.
1709
+ */
1710
+ getByIds: bindApiCall(this, {
1711
+ method: "POST",
1712
+ path: "posts/ids",
1713
+ type: web_client_1.ContentType.JSON
1714
+ }),
1715
+ /**
1716
+ * @description Set a reminder for a post.
1717
+ * Set a reminder for the specified user on the specified post.
1718
+ */
1719
+ setReminder: bindApiCall(this, {
1720
+ method: "POST",
1721
+ path: "users/:user_id/posts/:post_id/reminder",
1722
+ type: web_client_1.ContentType.JSON
1723
+ })
1724
+ };
1725
+ /**
1726
+ * ============================================================================
1727
+ * @description Reactions methods
1728
+ * ============================================================================
1729
+ */
1730
+ reactions = {
1731
+ create: bindApiCall(this, {
1732
+ method: "POST",
1733
+ path: "reactions",
1734
+ type: web_client_1.ContentType.JSON
1735
+ }),
1736
+ getForPost: bindApiCall(this, {
1737
+ method: "GET",
1738
+ path: "posts/:post_id/reactions",
1739
+ type: web_client_1.ContentType.URLEncoded
1740
+ }),
1741
+ delete: bindApiCall(this, {
1742
+ method: "DELETE",
1743
+ path: "users/:user_id/posts/:post_id/reactions/:emoji_name",
1744
+ type: web_client_1.ContentType.URLEncoded
1745
+ }),
1746
+ getBulk: bindApiCall(this, {
1747
+ method: "POST",
1748
+ path: "reactions/bulk",
1749
+ type: web_client_1.ContentType.JSON
1750
+ })
1751
+ };
1752
+ /**
1753
+ * ============================================================================
1754
+ * @description System methods
1755
+ * ============================================================================
1756
+ */
1757
+ system = {
1758
+ checkHealth: bindApiCallWithOptionalArg(this, {
1759
+ method: "GET",
1760
+ path: "system/ping",
1761
+ type: web_client_1.ContentType.URLEncoded
1762
+ }),
1763
+ checkDatabaseIntegrity: bindApiCallWithOptionalArg(this, {
1764
+ method: "POST",
1765
+ path: "system/check_integrity",
1766
+ type: web_client_1.ContentType.JSON
1767
+ }),
1768
+ getAnalytics: bindApiCall(this, {
1769
+ method: "GET",
1770
+ path: "analytics/old",
1771
+ type: web_client_1.ContentType.URLEncoded
1772
+ }),
1773
+ getLogs: bindApiCall(this, {
1774
+ method: "GET",
1775
+ path: "logs",
1776
+ type: web_client_1.ContentType.URLEncoded
1777
+ }),
1778
+ testEmail: bindApiCall(this, {
1779
+ method: "POST",
1780
+ path: "email/test",
1781
+ type: web_client_1.ContentType.JSON
1782
+ }),
1783
+ testS3Connection: bindApiCall(this, {
1784
+ method: "POST",
1785
+ path: "file/s3_test",
1786
+ type: web_client_1.ContentType.JSON
1787
+ }),
1788
+ testSiteURL: bindApiCall(this, {
1789
+ method: "POST",
1790
+ path: "site_url/test",
1791
+ type: web_client_1.ContentType.JSON
1792
+ }),
1793
+ updateConfig: bindApiCall(this, {
1794
+ method: "PUT",
1795
+ path: "config",
1796
+ type: web_client_1.ContentType.JSON
1797
+ }),
1798
+ uploadLogFile: bindApiCall(this, {
1799
+ method: "POST",
1800
+ path: "logs/upload",
1801
+ type: web_client_1.ContentType.FormData
1802
+ })
1803
+ };
1804
+ termsOfService = {
1805
+ create: bindApiCall(this, {
1806
+ method: "POST",
1807
+ path: "terms_of_service",
1808
+ type: web_client_1.ContentType.JSON
1809
+ }),
1810
+ get: bindApiCall(this, {
1811
+ method: "GET",
1812
+ path: "terms_of_service",
1813
+ type: web_client_1.ContentType.URLEncoded
1814
+ }),
1815
+ update: bindApiCall(this, {
1816
+ method: "POST", // or PUT? Check if update is same as create or distinct.
1817
+ path: "terms_of_service/:term_id", // Usually ID
1818
+ type: web_client_1.ContentType.JSON
1819
+ })
1820
+ };
1821
+ /**
1822
+ * ============================================================================
1823
+ * @description Uploads profile methods
1824
+ * ============================================================================
1825
+ */
1826
+ uploads = {
1827
+ create: bindApiCall(this, {
1828
+ method: "POST",
1829
+ path: "uploads",
1830
+ type: web_client_1.ContentType.JSON
1831
+ }),
1832
+ get: bindApiCall(this, {
1833
+ method: "GET",
1834
+ path: "uploads/:upload_id",
1835
+ type: web_client_1.ContentType.URLEncoded
1836
+ }),
1837
+ upload: bindApiCall(this, {
1838
+ method: "POST",
1839
+ path: "uploads/:upload_id",
1840
+ type: web_client_1.ContentType.FormData
1841
+ })
1842
+ };
1843
+ /**
1844
+ * ============================================================================
1845
+ * @description User methods
1846
+ * ============================================================================
1847
+ */
1848
+ users = {
1849
+ list: bindApiCallWithOptionalArg(this, {
1850
+ method: "GET",
1851
+ path: "users",
1852
+ type: web_client_1.ContentType.URLEncoded
1853
+ }),
1854
+ autocomplete: bindApiCall(this, {
1855
+ method: "GET",
1856
+ path: "users/autocomplete",
1857
+ type: web_client_1.ContentType.URLEncoded
1858
+ }),
1859
+ channels: {
1860
+ list: {
1861
+ inTeam: this.channels.list.forUserInTeam,
1862
+ all: this.channels.list.forUser
1863
+ },
1864
+ sidebar: {
1865
+ categories: {
1866
+ /**
1867
+ * @description Get sidebar categories for a user in a team.
1868
+ */
1869
+ list: bindApiCall(this, {
1870
+ method: "GET",
1871
+ path: "users/:user_id/teams/:team_id/channels/categories",
1872
+ type: web_client_1.ContentType.URLEncoded
1873
+ }),
1874
+ /**
1875
+ * @description Create a new sidebar category.
1876
+ */
1877
+ create: bindApiCall(this, {
1878
+ method: "POST",
1879
+ path: "users/:user_id/teams/:team_id/channels/categories",
1880
+ type: web_client_1.ContentType.JSON
1881
+ }),
1882
+ /**
1883
+ * @description Update all sidebar categories for a user.
1884
+ */
1885
+ updateAll: bindApiCall(this, {
1886
+ method: "PUT",
1887
+ path: "users/:user_id/teams/:team_id/channels/categories",
1888
+ type: web_client_1.ContentType.JSON
1889
+ }),
1890
+ /**
1891
+ * @description Get a specific sidebar category.
1892
+ */
1893
+ get: bindApiCall(this, {
1894
+ method: "GET",
1895
+ path: "users/:user_id/teams/:team_id/channels/categories/:category_id",
1896
+ type: web_client_1.ContentType.URLEncoded
1897
+ }),
1898
+ /**
1899
+ * @description Update a specific sidebar category.
1900
+ */
1901
+ update: bindApiCall(this, {
1902
+ method: "PUT",
1903
+ path: "users/:user_id/teams/:team_id/channels/categories/:category_id",
1904
+ type: web_client_1.ContentType.JSON
1905
+ }),
1906
+ /**
1907
+ * @description Delete a sidebar category.
1908
+ */
1909
+ delete: bindApiCall(this, {
1910
+ method: "DELETE",
1911
+ path: "users/:user_id/teams/:team_id/channels/categories/:category_id",
1912
+ type: web_client_1.ContentType.URLEncoded
1913
+ }),
1914
+ /**
1915
+ * @description Get sidebar category order.
1916
+ */
1917
+ getOrder: bindApiCall(this, {
1918
+ method: "GET",
1919
+ path: "users/:user_id/teams/:team_id/channels/categories/order",
1920
+ type: web_client_1.ContentType.URLEncoded
1921
+ }),
1922
+ /**
1923
+ * @description Update sidebar category order.
1924
+ */
1925
+ updateOrder: bindApiCall(this, {
1926
+ method: "PUT",
1927
+ path: "users/:user_id/teams/:team_id/channels/categories/order",
1928
+ type: web_client_1.ContentType.JSON
1929
+ })
1930
+ }
1931
+ }
1932
+ },
1933
+ getGroups: this.groups.members.listForUser,
1934
+ /**
1935
+ * ============================================================================
1936
+ * @description Guest methods
1937
+ * ============================================================================
1938
+ */
1939
+ guest: {
1940
+ toUser: bindApiCall(this, {
1941
+ method: "POST",
1942
+ path: `users/:user_id/promote`,
1943
+ type: web_client_1.ContentType.URLEncoded
1944
+ }),
1945
+ fromUser: bindApiCall(this, {
1946
+ method: "post",
1947
+ path: `users/:user_id/demote`,
1948
+ type: web_client_1.ContentType.URLEncoded
1949
+ })
1950
+ },
1951
+ /**
1952
+ * ============================================================================
1953
+ * @description User profile methods
1954
+ * ============================================================================
1955
+ */
1956
+ profile: {
1957
+ get: {
1958
+ /**
1959
+ * @description Retrieve a user's profile information, including their custom status.
1960
+ */
1961
+ me: bindApiCallWithOptionalArg(this, {
1962
+ method: "GET",
1963
+ path: `users/:user_id`,
1964
+ type: web_client_1.ContentType.URLEncoded
1965
+ }),
1966
+ /**
1967
+ * @description Retrieve a user's profile information, including their custom status.
1968
+ */
1969
+ byId: bindApiCallWithOptionalArg(this, {
1970
+ method: "GET",
1971
+ path: `users/:user_id`,
1972
+ type: web_client_1.ContentType.URLEncoded
1973
+ }),
1974
+ /**
1975
+ * @description Find a user with an email address.
1976
+ */
1977
+ byEmail: bindApiCall(this, {
1978
+ method: "GET",
1979
+ path: `users/email/:email`,
1980
+ type: web_client_1.ContentType.URLEncoded
1981
+ }),
1982
+ /**
1983
+ * @description Find a user with an email address.
1984
+ */
1985
+ byUsername: bindApiCall(this, {
1986
+ method: "GET",
1987
+ path: `users/username/:username`,
1988
+ type: web_client_1.ContentType.URLEncoded
1989
+ })
1990
+ },
1991
+ /**
1992
+ * @description Set a user's profile information, including custom status.
1993
+ * @see {@link https://docs.slack.dev/reference/methods/users.profile.set `users.profile.set` API reference}.
1994
+ */
1995
+ patch: bindApiCall(this, {
1996
+ method: "PUT",
1997
+ path: `users/:user_id`,
1998
+ type: web_client_1.ContentType.JSON
1999
+ }),
2000
+ /**
2001
+ * @description Profile image methods
2002
+ */
2003
+ image: {
2004
+ /**
2005
+ * @description Set the user profile image.
2006
+ */
2007
+ set: bindApiCall(this, {
2008
+ method: "POST",
2009
+ path: `users/:user_id/image`,
2010
+ type: web_client_1.ContentType.URLEncoded
2011
+ }) /**
2012
+ * @description Delete the user profile image.
2013
+ */,
2014
+ delete: bindApiCallWithOptionalArg(this, {
2015
+ method: "DELETE",
2016
+ path: `users/:user_id/image`,
2017
+ type: web_client_1.ContentType.URLEncoded
2018
+ })
2019
+ }
2020
+ },
2021
+ search: bindApiCall(this, {
2022
+ method: "POST",
2023
+ path: "users/search",
2024
+ type: web_client_1.ContentType.JSON
2025
+ }),
2026
+ status: {
2027
+ /**
2028
+ * @description Gets status for user
2029
+ */
2030
+ get: bindApiCall(this, {
2031
+ method: "GET",
2032
+ path: `users/:user_id/status`,
2033
+ type: web_client_1.ContentType.URLEncoded
2034
+ }),
2035
+ /**
2036
+ * @description Update users status by id
2037
+ * Must have edit_other_users permission for the team.
2038
+ */
2039
+ set: bindApiCall(this, {
2040
+ method: "PUT",
2041
+ path: `users/:user_id/status`,
2042
+ type: web_client_1.ContentType.JSON
2043
+ }),
2044
+ setCustom: bindApiCall(this, {
2045
+ method: "PUT",
2046
+ path: `users/:user_id/status/custom`,
2047
+ type: web_client_1.ContentType.JSON
2048
+ }),
2049
+ unsetCustom: bindApiCall(this, {
2050
+ method: "DELETE",
2051
+ path: `users/:user_id/status/custom`,
2052
+ type: web_client_1.ContentType.URLEncoded
2053
+ })
2054
+ },
2055
+ preferences: {
2056
+ get: bindApiCall(this, {
2057
+ method: "GET",
2058
+ path: "users/:user_id/preferences",
2059
+ type: web_client_1.ContentType.URLEncoded
2060
+ }),
2061
+ save: bindApiCall(this, {
2062
+ method: "PUT",
2063
+ path: "users/:user_id/preferences",
2064
+ type: web_client_1.ContentType.JSON
2065
+ }),
2066
+ delete: bindApiCall(this, {
2067
+ method: "POST",
2068
+ path: "users/:user_id/preferences/delete",
2069
+ type: web_client_1.ContentType.JSON
2070
+ })
2071
+ },
2072
+ updateRoles: bindApiCall(this, {
2073
+ method: "PUT",
2074
+ path: `users/:user_id/roles`,
2075
+ type: web_client_1.ContentType.URLEncoded
2076
+ })
2077
+ };
2078
+ }
2079
+ exports.Methods = Methods;
2080
+ //# sourceMappingURL=methods.js.map