@ikatec/digisac-api-sdk 4.14.0 → 4.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/README.md +10 -3
  2. package/dist/apis/absence/AbsenceApi.cjs +2 -2
  3. package/dist/apis/absence/AbsenceApi.cjs.map +1 -1
  4. package/dist/apis/absence/AbsenceApi.d.ts +2 -2
  5. package/dist/apis/absence/AbsenceApi.mjs +2 -2
  6. package/dist/apis/absence/AbsenceApi.mjs.map +1 -1
  7. package/dist/apis/absence/types.d.ts +1 -1
  8. package/dist/apis/answers/AnswersApi.cjs +23 -2
  9. package/dist/apis/answers/AnswersApi.cjs.map +1 -1
  10. package/dist/apis/answers/AnswersApi.d.ts +16 -2
  11. package/dist/apis/answers/AnswersApi.d.ts.map +1 -1
  12. package/dist/apis/answers/AnswersApi.mjs +23 -2
  13. package/dist/apis/answers/AnswersApi.mjs.map +1 -1
  14. package/dist/apis/answers/types.d.ts +1 -2
  15. package/dist/apis/answers/types.d.ts.map +1 -1
  16. package/dist/apis/authHistory/AuthHistoryApi.cjs +9 -2
  17. package/dist/apis/authHistory/AuthHistoryApi.cjs.map +1 -1
  18. package/dist/apis/authHistory/AuthHistoryApi.d.ts +7 -2
  19. package/dist/apis/authHistory/AuthHistoryApi.d.ts.map +1 -1
  20. package/dist/apis/authHistory/AuthHistoryApi.mjs +9 -2
  21. package/dist/apis/authHistory/AuthHistoryApi.mjs.map +1 -1
  22. package/dist/apis/authHistory/types.d.ts +6 -1
  23. package/dist/apis/authHistory/types.d.ts.map +1 -1
  24. package/dist/apis/bots/BotsApi.cjs +16 -7
  25. package/dist/apis/bots/BotsApi.cjs.map +1 -1
  26. package/dist/apis/bots/BotsApi.d.ts +13 -7
  27. package/dist/apis/bots/BotsApi.d.ts.map +1 -1
  28. package/dist/apis/bots/BotsApi.mjs +16 -7
  29. package/dist/apis/bots/BotsApi.mjs.map +1 -1
  30. package/dist/apis/bots/types.d.ts +12 -2
  31. package/dist/apis/bots/types.d.ts.map +1 -1
  32. package/dist/apis/campaigns/CampaignsApi.cjs +25 -1
  33. package/dist/apis/campaigns/CampaignsApi.cjs.map +1 -1
  34. package/dist/apis/campaigns/CampaignsApi.d.ts +16 -1
  35. package/dist/apis/campaigns/CampaignsApi.d.ts.map +1 -1
  36. package/dist/apis/campaigns/CampaignsApi.mjs +25 -1
  37. package/dist/apis/campaigns/CampaignsApi.mjs.map +1 -1
  38. package/dist/apis/campaigns/types.d.ts +98 -6
  39. package/dist/apis/campaigns/types.d.ts.map +1 -1
  40. package/dist/apis/cards/types.d.ts +5 -5
  41. package/dist/apis/categories/CategoriesApi.cjs +1 -2
  42. package/dist/apis/categories/CategoriesApi.cjs.map +1 -1
  43. package/dist/apis/categories/CategoriesApi.d.ts +1 -2
  44. package/dist/apis/categories/CategoriesApi.d.ts.map +1 -1
  45. package/dist/apis/categories/CategoriesApi.mjs +1 -2
  46. package/dist/apis/categories/CategoriesApi.mjs.map +1 -1
  47. package/dist/apis/clientFeedback/ClientFeedbackApi.cjs +2 -3
  48. package/dist/apis/clientFeedback/ClientFeedbackApi.cjs.map +1 -1
  49. package/dist/apis/clientFeedback/ClientFeedbackApi.d.ts +2 -3
  50. package/dist/apis/clientFeedback/ClientFeedbackApi.d.ts.map +1 -1
  51. package/dist/apis/clientFeedback/ClientFeedbackApi.mjs +2 -3
  52. package/dist/apis/clientFeedback/ClientFeedbackApi.mjs.map +1 -1
  53. package/dist/apis/contacts/ContactsApi.cjs +20 -6
  54. package/dist/apis/contacts/ContactsApi.cjs.map +1 -1
  55. package/dist/apis/contacts/ContactsApi.d.ts +28 -4
  56. package/dist/apis/contacts/ContactsApi.d.ts.map +1 -1
  57. package/dist/apis/contacts/ContactsApi.mjs +20 -6
  58. package/dist/apis/contacts/ContactsApi.mjs.map +1 -1
  59. package/dist/apis/contacts/types.d.ts +101 -2
  60. package/dist/apis/contacts/types.d.ts.map +1 -1
  61. package/dist/apis/customFields/types.d.ts +4 -4
  62. package/dist/apis/dashboard/DashboardApi.cjs +3 -3
  63. package/dist/apis/dashboard/DashboardApi.cjs.map +1 -1
  64. package/dist/apis/dashboard/DashboardApi.d.ts +3 -3
  65. package/dist/apis/dashboard/DashboardApi.mjs +3 -3
  66. package/dist/apis/dashboard/DashboardApi.mjs.map +1 -1
  67. package/dist/apis/dashboard/types.d.ts +11 -4
  68. package/dist/apis/dashboard/types.d.ts.map +1 -1
  69. package/dist/apis/departments/DepartmentsApi.cjs +5 -5
  70. package/dist/apis/departments/DepartmentsApi.cjs.map +1 -1
  71. package/dist/apis/departments/DepartmentsApi.d.ts +5 -5
  72. package/dist/apis/departments/DepartmentsApi.mjs +5 -5
  73. package/dist/apis/departments/DepartmentsApi.mjs.map +1 -1
  74. package/dist/apis/departments/types.d.ts +6 -0
  75. package/dist/apis/departments/types.d.ts.map +1 -1
  76. package/dist/apis/distribution/DistributionApi.cjs +3 -4
  77. package/dist/apis/distribution/DistributionApi.cjs.map +1 -1
  78. package/dist/apis/distribution/DistributionApi.d.ts +3 -4
  79. package/dist/apis/distribution/DistributionApi.d.ts.map +1 -1
  80. package/dist/apis/distribution/DistributionApi.mjs +3 -4
  81. package/dist/apis/distribution/DistributionApi.mjs.map +1 -1
  82. package/dist/apis/files/FilesApi.cjs +13 -1
  83. package/dist/apis/files/FilesApi.cjs.map +1 -1
  84. package/dist/apis/files/FilesApi.d.ts +12 -2
  85. package/dist/apis/files/FilesApi.d.ts.map +1 -1
  86. package/dist/apis/files/FilesApi.mjs +13 -1
  87. package/dist/apis/files/FilesApi.mjs.map +1 -1
  88. package/dist/apis/files/types.d.ts +19 -1
  89. package/dist/apis/files/types.d.ts.map +1 -1
  90. package/dist/apis/kanbanCards/KanbanCardsApi.cjs +32 -0
  91. package/dist/apis/kanbanCards/KanbanCardsApi.cjs.map +1 -1
  92. package/dist/apis/kanbanCards/KanbanCardsApi.d.ts +27 -1
  93. package/dist/apis/kanbanCards/KanbanCardsApi.d.ts.map +1 -1
  94. package/dist/apis/kanbanCards/KanbanCardsApi.mjs +32 -0
  95. package/dist/apis/kanbanCards/KanbanCardsApi.mjs.map +1 -1
  96. package/dist/apis/kanbanCards/types.d.ts +1 -1
  97. package/dist/apis/kanbanCards/types.d.ts.map +1 -1
  98. package/dist/apis/kanbanColumns/KanbanColumnsApi.cjs +19 -0
  99. package/dist/apis/kanbanColumns/KanbanColumnsApi.cjs.map +1 -1
  100. package/dist/apis/kanbanColumns/KanbanColumnsApi.d.ts +16 -1
  101. package/dist/apis/kanbanColumns/KanbanColumnsApi.d.ts.map +1 -1
  102. package/dist/apis/kanbanColumns/KanbanColumnsApi.mjs +19 -0
  103. package/dist/apis/kanbanColumns/KanbanColumnsApi.mjs.map +1 -1
  104. package/dist/apis/kanbanColumns/types.d.ts +4 -0
  105. package/dist/apis/kanbanColumns/types.d.ts.map +1 -1
  106. package/dist/apis/messages/MessagesApi.cjs +13 -4
  107. package/dist/apis/messages/MessagesApi.cjs.map +1 -1
  108. package/dist/apis/messages/MessagesApi.d.ts +13 -4
  109. package/dist/apis/messages/MessagesApi.d.ts.map +1 -1
  110. package/dist/apis/messages/MessagesApi.mjs +13 -4
  111. package/dist/apis/messages/MessagesApi.mjs.map +1 -1
  112. package/dist/apis/messages/types.d.ts +5 -0
  113. package/dist/apis/messages/types.d.ts.map +1 -1
  114. package/dist/apis/pipeline/types.d.ts +7 -8
  115. package/dist/apis/pipeline/types.d.ts.map +1 -1
  116. package/dist/apis/quickReplies/types.d.ts +4 -1
  117. package/dist/apis/quickReplies/types.d.ts.map +1 -1
  118. package/dist/apis/schedule/types.d.ts +41 -10
  119. package/dist/apis/schedule/types.d.ts.map +1 -1
  120. package/dist/apis/terms/TermsApi.cjs +2 -2
  121. package/dist/apis/terms/TermsApi.cjs.map +1 -1
  122. package/dist/apis/terms/TermsApi.d.ts +2 -2
  123. package/dist/apis/terms/TermsApi.mjs +2 -2
  124. package/dist/apis/terms/TermsApi.mjs.map +1 -1
  125. package/dist/apis/tickets/TicketsApi.cjs +18 -8
  126. package/dist/apis/tickets/TicketsApi.cjs.map +1 -1
  127. package/dist/apis/tickets/TicketsApi.d.ts +15 -8
  128. package/dist/apis/tickets/TicketsApi.d.ts.map +1 -1
  129. package/dist/apis/tickets/TicketsApi.mjs +18 -8
  130. package/dist/apis/tickets/TicketsApi.mjs.map +1 -1
  131. package/dist/apis/tickets/types.d.ts +4 -1
  132. package/dist/apis/tickets/types.d.ts.map +1 -1
  133. package/dist/apis/timetable/TimetableApi.cjs +6 -0
  134. package/dist/apis/timetable/TimetableApi.cjs.map +1 -1
  135. package/dist/apis/timetable/TimetableApi.d.ts +6 -0
  136. package/dist/apis/timetable/TimetableApi.d.ts.map +1 -1
  137. package/dist/apis/timetable/TimetableApi.mjs +6 -0
  138. package/dist/apis/timetable/TimetableApi.mjs.map +1 -1
  139. package/dist/apis/timetable/types.d.ts +8 -0
  140. package/dist/apis/timetable/types.d.ts.map +1 -1
  141. package/dist/apis/users/UsersApi.cjs +11 -3
  142. package/dist/apis/users/UsersApi.cjs.map +1 -1
  143. package/dist/apis/users/UsersApi.d.ts +10 -4
  144. package/dist/apis/users/UsersApi.d.ts.map +1 -1
  145. package/dist/apis/users/UsersApi.mjs +11 -3
  146. package/dist/apis/users/UsersApi.mjs.map +1 -1
  147. package/dist/apis/users/types.d.ts +26 -0
  148. package/dist/apis/users/types.d.ts.map +1 -1
  149. package/dist/apis/webhooks/types.d.ts +51 -6
  150. package/dist/apis/webhooks/types.d.ts.map +1 -1
  151. package/dist/core/BaseReadApi.cjs +2 -2
  152. package/dist/core/BaseReadApi.cjs.map +1 -1
  153. package/dist/core/BaseReadApi.d.ts +2 -2
  154. package/dist/core/BaseReadApi.mjs +2 -2
  155. package/dist/core/BaseReadApi.mjs.map +1 -1
  156. package/dist/core/errors.cjs +4 -1
  157. package/dist/core/errors.cjs.map +1 -1
  158. package/dist/core/errors.d.ts +4 -1
  159. package/dist/core/errors.d.ts.map +1 -1
  160. package/dist/core/errors.mjs +4 -1
  161. package/dist/core/errors.mjs.map +1 -1
  162. package/package.json +1 -1
  163. package/src/apis/absence/AbsenceApi.ts +2 -2
  164. package/src/apis/absence/types.ts +1 -1
  165. package/src/apis/answers/AnswersApi.test.ts +32 -0
  166. package/src/apis/answers/AnswersApi.ts +38 -2
  167. package/src/apis/answers/types.ts +1 -2
  168. package/src/apis/authHistory/AuthHistoryApi.test.ts +16 -0
  169. package/src/apis/authHistory/AuthHistoryApi.ts +10 -2
  170. package/src/apis/authHistory/types.ts +6 -1
  171. package/src/apis/bots/BotsApi.test.ts +16 -0
  172. package/src/apis/bots/BotsApi.ts +25 -7
  173. package/src/apis/bots/types.ts +12 -2
  174. package/src/apis/campaigns/CampaignsApi.test.ts +48 -0
  175. package/src/apis/campaigns/CampaignsApi.ts +31 -2
  176. package/src/apis/campaigns/types.ts +101 -3
  177. package/src/apis/cards/types.ts +5 -5
  178. package/src/apis/categories/CategoriesApi.ts +1 -2
  179. package/src/apis/clientFeedback/ClientFeedbackApi.ts +2 -3
  180. package/src/apis/contacts/ContactsApi.test.ts +49 -2
  181. package/src/apis/contacts/ContactsApi.ts +64 -4
  182. package/src/apis/contacts/types.ts +111 -1
  183. package/src/apis/creditMovements/CreditMovementsApi.test.ts +1 -1
  184. package/src/apis/customFields/types.ts +4 -4
  185. package/src/apis/dashboard/DashboardApi.test-d.ts +9 -0
  186. package/src/apis/dashboard/DashboardApi.ts +3 -3
  187. package/src/apis/dashboard/types.ts +11 -4
  188. package/src/apis/departments/DepartmentsApi.ts +5 -5
  189. package/src/apis/departments/types.ts +13 -0
  190. package/src/apis/distribution/DistributionApi.ts +3 -4
  191. package/src/apis/files/FilesApi.test.ts +21 -0
  192. package/src/apis/files/FilesApi.ts +19 -1
  193. package/src/apis/files/types.ts +20 -1
  194. package/src/apis/kanbanCards/KanbanCardsApi.test.ts +21 -0
  195. package/src/apis/kanbanCards/KanbanCardsApi.ts +47 -1
  196. package/src/apis/kanbanCards/types.ts +1 -1
  197. package/src/apis/kanbanColumns/KanbanColumnsApi.test.ts +26 -0
  198. package/src/apis/kanbanColumns/KanbanColumnsApi.ts +31 -0
  199. package/src/apis/kanbanColumns/types.ts +5 -0
  200. package/src/apis/messages/MessagesApi.ts +13 -4
  201. package/src/apis/messages/types.ts +5 -0
  202. package/src/apis/payloads.test-d.ts +245 -5
  203. package/src/apis/pipeline/types.ts +7 -8
  204. package/src/apis/queryFormat.test.ts +13 -0
  205. package/src/apis/quickReplies/types.ts +4 -1
  206. package/src/apis/schedule/types.ts +42 -10
  207. package/src/apis/terms/TermsApi.ts +2 -2
  208. package/src/apis/tickets/TicketsApi.ts +28 -8
  209. package/src/apis/tickets/types.ts +4 -1
  210. package/src/apis/timetable/TimetableApi.ts +6 -0
  211. package/src/apis/timetable/types.ts +9 -0
  212. package/src/apis/users/UsersApi.test.ts +17 -0
  213. package/src/apis/users/UsersApi.ts +21 -3
  214. package/src/apis/users/types.ts +28 -0
  215. package/src/apis/webhooks/types.ts +53 -6
  216. package/src/core/BaseReadApi.ts +2 -2
  217. package/src/core/errors.ts +4 -1
@@ -1 +1 @@
1
- {"version":3,"file":"FilesApi.cjs","names":["BaseCrudApi","requestExternal"],"sources":["../../../src/apis/files/FilesApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport { requestExternal } from '../../core/requestExternal'\nimport type { GetByIdQuery, ListQuery, Paginated } from '../../core/types'\nimport type {\n File,\n CreateFilePayload,\n UpdateFilePayload,\n CreateToUploadPayload,\n CreateToUploadResult,\n DeleteFileResult,\n} from './types'\n\n/**\n * Files of the account. The backend serves `POST /files` (the record only, no content),\n * `POST /files/create-to-upload` (record + signed URL to upload the content), `POST\n * /files/duplicate-file`, `DELETE /files/:id` and the signed download `GET\n * /files/:accountId/:filename`; there is no list, read by id nor update.\n */\nexport class FilesApi extends BaseCrudApi<\n File,\n CreateFilePayload,\n UpdateFilePayload,\n ListQuery<File>,\n DeleteFileResult\n> {\n constructor(client: ApiClient) {\n super(client, '/files')\n }\n\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query: ListQuery<File> & { paginate: false },\n headers?: Record<string, string>,\n ): Promise<File[]>\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query?: ListQuery<File> & { paginate?: true },\n headers?: Record<string, string>,\n ): Promise<Paginated<File>>\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query?: ListQuery<File>,\n headers?: Record<string, string>,\n ): Promise<Paginated<File> | File[]>\n override getMany(\n query?: ListQuery<File>,\n headers?: Record<string, string>,\n ): Promise<Paginated<File> | File[]> {\n return super.getMany(query, headers)\n }\n\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getOne(query?: ListQuery<File>, headers?: Record<string, string>): Promise<File | null> {\n return super.getOne(query, headers)\n }\n\n /** @deprecated Not served: the backend has no GET /files/:id, so this route answers 404. */\n override getById(\n id: string,\n query?: GetByIdQuery<File>,\n headers?: Record<string, string>,\n ): Promise<File> {\n return super.getById(id, query, headers)\n }\n\n /** @deprecated Not served: the backend has no PUT /files/:id, so this route answers 404. */\n override updateById(\n id: string,\n body: UpdateFilePayload,\n headers?: Record<string, string>,\n ): Promise<File> {\n return super.updateById(id, body, headers)\n }\n\n /**\n * Deletes a file. Resolves `{ success: true }`, also for an unknown id; a file of another\n * account answers 403.\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<DeleteFileResult> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Creates the record of a file and returns the signed URL to upload its content: send the\n * content with {@link upload}. An audio that must be converted (a voice message for the\n * connection) is sent in `base64` instead, and then no `urlToUpload` is returned. `name` and\n * `mimetype` are required (500 without them; an audio without `name` is named `recording`).\n */\n createToUpload(\n body: CreateToUploadPayload,\n headers?: Record<string, string>,\n ): Promise<CreateToUploadResult> {\n return this.client.post<CreateToUploadResult, CreateToUploadPayload>(\n `${this.basePath}/create-to-upload`,\n body,\n headers,\n )\n }\n\n /**\n * Uploads the content of a file to the `urlToUpload` returned by {@link createToUpload}. The URL\n * is signed by the storage, so the request goes straight to it, without the API token (the\n * storage refuses an `Authorization` header). `mimetype` must be the one sent to\n * `createToUpload`. Sent through `client.requestExternal` (the global `fetch` for a client\n * without it). A non-2xx answer of the storage throws `ApiError`.\n */\n async upload(urlToUpload: string, content: BodyInit, mimetype: string): Promise<void> {\n const headers = { 'Content-Type': mimetype }\n await (this.client.requestExternal\n ? this.client.requestExternal('PUT', urlToUpload, content, headers)\n : requestExternal('PUT', urlToUpload, content, headers))\n }\n}\n"],"mappings":";;;;;;;;;;;AAmBA,IAAa,WAAb,cAA8BA,qCAM5B;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,SAAS;;CAkBzB,AAAS,QACP,OACA,SACmC;AACnC,SAAO,MAAM,QAAQ,OAAO,QAAQ;;;CAItC,AAAS,OAAO,OAAyB,SAAwD;AAC/F,SAAO,MAAM,OAAO,OAAO,QAAQ;;;CAIrC,AAAS,QACP,IACA,OACA,SACe;AACf,SAAO,MAAM,QAAQ,IAAI,OAAO,QAAQ;;;CAI1C,AAAS,WACP,IACA,MACA,SACe;AACf,SAAO,MAAM,WAAW,IAAI,MAAM,QAAQ;;;;;;CAO5C,AAAS,WAAW,IAAY,SAA6D;AAC3F,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;;;;CAStC,eACE,MACA,SAC+B;AAC/B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,oBACjB,MACA,QACD;;;;;;;;;CAUH,MAAM,OAAO,aAAqB,SAAmB,UAAiC;EACpF,MAAM,UAAU,EAAE,gBAAgB,UAAU;AAC5C,SAAO,KAAK,OAAO,kBACf,KAAK,OAAO,gBAAgB,OAAO,aAAa,SAAS,QAAQ,GACjEC,6CAAgB,OAAO,aAAa,SAAS,QAAQ"}
1
+ {"version":3,"file":"FilesApi.cjs","names":["BaseCrudApi","requestExternal"],"sources":["../../../src/apis/files/FilesApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport { requestExternal } from '../../core/requestExternal'\nimport type { GetByIdQuery, ListQuery, Paginated } from '../../core/types'\nimport type {\n File,\n CreateFilePayload,\n UpdateFilePayload,\n CreateToUploadPayload,\n CreateToUploadResult,\n DeleteFileResult,\n DuplicateFilePayload,\n} from './types'\n\n/**\n * Files of the account. The backend serves `POST /files` (the record only, no content),\n * `POST /files/create-to-upload` (record + signed URL to upload the content), `POST\n * /files/duplicate-file`, `DELETE /files/:id` and the signed download `GET\n * /files/:accountId/:filename`; there is no list, read by id nor update.\n */\nexport class FilesApi extends BaseCrudApi<\n File,\n CreateFilePayload,\n UpdateFilePayload,\n ListQuery<File>,\n DeleteFileResult\n> {\n constructor(client: ApiClient) {\n super(client, '/files')\n }\n\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query: ListQuery<File> & { paginate: false },\n headers?: Record<string, string>,\n ): Promise<File[]>\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query?: ListQuery<File> & { paginate?: true },\n headers?: Record<string, string>,\n ): Promise<Paginated<File>>\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query?: ListQuery<File>,\n headers?: Record<string, string>,\n ): Promise<Paginated<File> | File[]>\n override getMany(\n query?: ListQuery<File>,\n headers?: Record<string, string>,\n ): Promise<Paginated<File> | File[]> {\n return super.getMany(query, headers)\n }\n\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getOne(query?: ListQuery<File>, headers?: Record<string, string>): Promise<File | null> {\n return super.getOne(query, headers)\n }\n\n /** @deprecated Not served: the backend has no GET /files/:id, so this route answers 404. */\n override getById(\n id: string,\n query?: GetByIdQuery<File>,\n headers?: Record<string, string>,\n ): Promise<File> {\n return super.getById(id, query, headers)\n }\n\n /** @deprecated Not served: the backend has no PUT /files/:id, so this route answers 404. */\n override updateById(\n id: string,\n body: UpdateFilePayload,\n headers?: Record<string, string>,\n ): Promise<File> {\n return super.updateById(id, body, headers)\n }\n\n /**\n * Deletes a file. Resolves `{ success: true }`, also for an unknown id; a file of another\n * account answers 403.\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<DeleteFileResult> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Creates the record of a file and returns the signed URL to upload its content: send the\n * content with {@link upload}. An audio that must be converted (a voice message for the\n * connection) is sent in `base64` instead, and then no `urlToUpload` is returned. `name` and\n * `mimetype` are required (500 without them; an audio without `name` is named `recording`). With\n * `serviceId`, an extension the account blocks for the type of the connection answers 403.\n */\n createToUpload(\n body: CreateToUploadPayload,\n headers?: Record<string, string>,\n ): Promise<CreateToUploadResult> {\n return this.client.post<CreateToUploadResult, CreateToUploadPayload>(\n `${this.basePath}/create-to-upload`,\n body,\n headers,\n )\n }\n\n /**\n * Copies the content of a file. With `urlToUpload` (the signed URL of a record created by\n * {@link createToUpload} with the same `mimetype` as the file copied), the content is sent to that\n * record and the answer is the `fileId` given; without it, a new record (`attachedType`\n * `'message.file'`) is created with the copied content and its id is the answer, and with\n * `serviceId` an extension the account blocks for the type of the connection answers 403. An\n * unknown `fileId` answers 500.\n */\n duplicateFile(body: DuplicateFilePayload, headers?: Record<string, string>): Promise<string> {\n return this.client.post<string, DuplicateFilePayload>(\n `${this.basePath}/duplicate-file`,\n body,\n headers,\n )\n }\n\n /**\n * Uploads the content of a file to the `urlToUpload` returned by {@link createToUpload}. The URL\n * is signed by the storage, so the request goes straight to it, without the API token (the\n * storage refuses an `Authorization` header). `mimetype` must be the one sent to\n * `createToUpload`. Sent through `client.requestExternal` (the global `fetch` for a client\n * without it). A non-2xx answer of the storage throws `ApiError`.\n */\n async upload(urlToUpload: string, content: BodyInit, mimetype: string): Promise<void> {\n const headers = { 'Content-Type': mimetype }\n await (this.client.requestExternal\n ? this.client.requestExternal('PUT', urlToUpload, content, headers)\n : requestExternal('PUT', urlToUpload, content, headers))\n }\n}\n"],"mappings":";;;;;;;;;;;AAoBA,IAAa,WAAb,cAA8BA,qCAM5B;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,SAAS;;CAkBzB,AAAS,QACP,OACA,SACmC;AACnC,SAAO,MAAM,QAAQ,OAAO,QAAQ;;;CAItC,AAAS,OAAO,OAAyB,SAAwD;AAC/F,SAAO,MAAM,OAAO,OAAO,QAAQ;;;CAIrC,AAAS,QACP,IACA,OACA,SACe;AACf,SAAO,MAAM,QAAQ,IAAI,OAAO,QAAQ;;;CAI1C,AAAS,WACP,IACA,MACA,SACe;AACf,SAAO,MAAM,WAAW,IAAI,MAAM,QAAQ;;;;;;CAO5C,AAAS,WAAW,IAAY,SAA6D;AAC3F,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;;;;;CAUtC,eACE,MACA,SAC+B;AAC/B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,oBACjB,MACA,QACD;;;;;;;;;;CAWH,cAAc,MAA4B,SAAmD;AAC3F,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,kBACjB,MACA,QACD;;;;;;;;;CAUH,MAAM,OAAO,aAAqB,SAAmB,UAAiC;EACpF,MAAM,UAAU,EAAE,gBAAgB,UAAU;AAC5C,SAAO,KAAK,OAAO,kBACf,KAAK,OAAO,gBAAgB,OAAO,aAAa,SAAS,QAAQ,GACjEC,6CAAgB,OAAO,aAAa,SAAS,QAAQ"}
@@ -1,7 +1,7 @@
1
1
  import type { ApiClient } from '../../core/ApiClient';
2
2
  import { BaseCrudApi } from '../../core/BaseCrudApi';
3
3
  import type { GetByIdQuery, ListQuery, Paginated } from '../../core/types';
4
- import type { File, CreateFilePayload, UpdateFilePayload, CreateToUploadPayload, CreateToUploadResult, DeleteFileResult } from './types';
4
+ import type { File, CreateFilePayload, UpdateFilePayload, CreateToUploadPayload, CreateToUploadResult, DeleteFileResult, DuplicateFilePayload } from './types';
5
5
  /**
6
6
  * Files of the account. The backend serves `POST /files` (the record only, no content),
7
7
  * `POST /files/create-to-upload` (record + signed URL to upload the content), `POST
@@ -35,9 +35,19 @@ export declare class FilesApi extends BaseCrudApi<File, CreateFilePayload, Updat
35
35
  * Creates the record of a file and returns the signed URL to upload its content: send the
36
36
  * content with {@link upload}. An audio that must be converted (a voice message for the
37
37
  * connection) is sent in `base64` instead, and then no `urlToUpload` is returned. `name` and
38
- * `mimetype` are required (500 without them; an audio without `name` is named `recording`).
38
+ * `mimetype` are required (500 without them; an audio without `name` is named `recording`). With
39
+ * `serviceId`, an extension the account blocks for the type of the connection answers 403.
39
40
  */
40
41
  createToUpload(body: CreateToUploadPayload, headers?: Record<string, string>): Promise<CreateToUploadResult>;
42
+ /**
43
+ * Copies the content of a file. With `urlToUpload` (the signed URL of a record created by
44
+ * {@link createToUpload} with the same `mimetype` as the file copied), the content is sent to that
45
+ * record and the answer is the `fileId` given; without it, a new record (`attachedType`
46
+ * `'message.file'`) is created with the copied content and its id is the answer, and with
47
+ * `serviceId` an extension the account blocks for the type of the connection answers 403. An
48
+ * unknown `fileId` answers 500.
49
+ */
50
+ duplicateFile(body: DuplicateFilePayload, headers?: Record<string, string>): Promise<string>;
41
51
  /**
42
52
  * Uploads the content of a file to the `urlToUpload` returned by {@link createToUpload}. The URL
43
53
  * is signed by the storage, so the request goes straight to it, without the API token (the
@@ -1 +1 @@
1
- {"version":3,"file":"FilesApi.d.ts","sourceRoot":"","sources":["../../../src/apis/files/FilesApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC1E,OAAO,KAAK,EACV,IAAI,EACJ,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM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BAAgB,CAAC;IAI5F;;;;;;OAMG;IACH,cAAc,CACZ,IAAI,EAAE,qBAAqB,EAC3B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,oBAAoB,CAAC;IAQhC;;;;;;;OAOG;IACH,aAAa,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ5F;;;;;;OAMG;IACG,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAMtF"}
@@ -38,12 +38,24 @@ var FilesApi = class extends BaseCrudApi {
38
38
  * Creates the record of a file and returns the signed URL to upload its content: send the
39
39
  * content with {@link upload}. An audio that must be converted (a voice message for the
40
40
  * connection) is sent in `base64` instead, and then no `urlToUpload` is returned. `name` and
41
- * `mimetype` are required (500 without them; an audio without `name` is named `recording`).
41
+ * `mimetype` are required (500 without them; an audio without `name` is named `recording`). With
42
+ * `serviceId`, an extension the account blocks for the type of the connection answers 403.
42
43
  */
43
44
  createToUpload(body, headers) {
44
45
  return this.client.post(`${this.basePath}/create-to-upload`, body, headers);
45
46
  }
46
47
  /**
48
+ * Copies the content of a file. With `urlToUpload` (the signed URL of a record created by
49
+ * {@link createToUpload} with the same `mimetype` as the file copied), the content is sent to that
50
+ * record and the answer is the `fileId` given; without it, a new record (`attachedType`
51
+ * `'message.file'`) is created with the copied content and its id is the answer, and with
52
+ * `serviceId` an extension the account blocks for the type of the connection answers 403. An
53
+ * unknown `fileId` answers 500.
54
+ */
55
+ duplicateFile(body, headers) {
56
+ return this.client.post(`${this.basePath}/duplicate-file`, body, headers);
57
+ }
58
+ /**
47
59
  * Uploads the content of a file to the `urlToUpload` returned by {@link createToUpload}. The URL
48
60
  * is signed by the storage, so the request goes straight to it, without the API token (the
49
61
  * storage refuses an `Authorization` header). `mimetype` must be the one sent to
@@ -1 +1 @@
1
- {"version":3,"file":"FilesApi.mjs","names":[],"sources":["../../../src/apis/files/FilesApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport { requestExternal } from '../../core/requestExternal'\nimport type { GetByIdQuery, ListQuery, Paginated } from '../../core/types'\nimport type {\n File,\n CreateFilePayload,\n UpdateFilePayload,\n CreateToUploadPayload,\n CreateToUploadResult,\n DeleteFileResult,\n} from './types'\n\n/**\n * Files of the account. The backend serves `POST /files` (the record only, no content),\n * `POST /files/create-to-upload` (record + signed URL to upload the content), `POST\n * /files/duplicate-file`, `DELETE /files/:id` and the signed download `GET\n * /files/:accountId/:filename`; there is no list, read by id nor update.\n */\nexport class FilesApi extends BaseCrudApi<\n File,\n CreateFilePayload,\n UpdateFilePayload,\n ListQuery<File>,\n DeleteFileResult\n> {\n constructor(client: ApiClient) {\n super(client, '/files')\n }\n\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query: ListQuery<File> & { paginate: false },\n headers?: Record<string, string>,\n ): Promise<File[]>\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query?: ListQuery<File> & { paginate?: true },\n headers?: Record<string, string>,\n ): Promise<Paginated<File>>\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query?: ListQuery<File>,\n headers?: Record<string, string>,\n ): Promise<Paginated<File> | File[]>\n override getMany(\n query?: ListQuery<File>,\n headers?: Record<string, string>,\n ): Promise<Paginated<File> | File[]> {\n return super.getMany(query, headers)\n }\n\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getOne(query?: ListQuery<File>, headers?: Record<string, string>): Promise<File | null> {\n return super.getOne(query, headers)\n }\n\n /** @deprecated Not served: the backend has no GET /files/:id, so this route answers 404. */\n override getById(\n id: string,\n query?: GetByIdQuery<File>,\n headers?: Record<string, string>,\n ): Promise<File> {\n return super.getById(id, query, headers)\n }\n\n /** @deprecated Not served: the backend has no PUT /files/:id, so this route answers 404. */\n override updateById(\n id: string,\n body: UpdateFilePayload,\n headers?: Record<string, string>,\n ): Promise<File> {\n return super.updateById(id, body, headers)\n }\n\n /**\n * Deletes a file. Resolves `{ success: true }`, also for an unknown id; a file of another\n * account answers 403.\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<DeleteFileResult> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Creates the record of a file and returns the signed URL to upload its content: send the\n * content with {@link upload}. An audio that must be converted (a voice message for the\n * connection) is sent in `base64` instead, and then no `urlToUpload` is returned. `name` and\n * `mimetype` are required (500 without them; an audio without `name` is named `recording`).\n */\n createToUpload(\n body: CreateToUploadPayload,\n headers?: Record<string, string>,\n ): Promise<CreateToUploadResult> {\n return this.client.post<CreateToUploadResult, CreateToUploadPayload>(\n `${this.basePath}/create-to-upload`,\n body,\n headers,\n )\n }\n\n /**\n * Uploads the content of a file to the `urlToUpload` returned by {@link createToUpload}. The URL\n * is signed by the storage, so the request goes straight to it, without the API token (the\n * storage refuses an `Authorization` header). `mimetype` must be the one sent to\n * `createToUpload`. Sent through `client.requestExternal` (the global `fetch` for a client\n * without it). A non-2xx answer of the storage throws `ApiError`.\n */\n async upload(urlToUpload: string, content: BodyInit, mimetype: string): Promise<void> {\n const headers = { 'Content-Type': mimetype }\n await (this.client.requestExternal\n ? this.client.requestExternal('PUT', urlToUpload, content, headers)\n : requestExternal('PUT', urlToUpload, content, headers))\n }\n}\n"],"mappings":";;;;;;;;;;AAmBA,IAAa,WAAb,cAA8B,YAM5B;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,SAAS;;CAkBzB,AAAS,QACP,OACA,SACmC;AACnC,SAAO,MAAM,QAAQ,OAAO,QAAQ;;;CAItC,AAAS,OAAO,OAAyB,SAAwD;AAC/F,SAAO,MAAM,OAAO,OAAO,QAAQ;;;CAIrC,AAAS,QACP,IACA,OACA,SACe;AACf,SAAO,MAAM,QAAQ,IAAI,OAAO,QAAQ;;;CAI1C,AAAS,WACP,IACA,MACA,SACe;AACf,SAAO,MAAM,WAAW,IAAI,MAAM,QAAQ;;;;;;CAO5C,AAAS,WAAW,IAAY,SAA6D;AAC3F,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;;;;CAStC,eACE,MACA,SAC+B;AAC/B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,oBACjB,MACA,QACD;;;;;;;;;CAUH,MAAM,OAAO,aAAqB,SAAmB,UAAiC;EACpF,MAAM,UAAU,EAAE,gBAAgB,UAAU;AAC5C,SAAO,KAAK,OAAO,kBACf,KAAK,OAAO,gBAAgB,OAAO,aAAa,SAAS,QAAQ,GACjE,gBAAgB,OAAO,aAAa,SAAS,QAAQ"}
1
+ {"version":3,"file":"FilesApi.mjs","names":[],"sources":["../../../src/apis/files/FilesApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport { requestExternal } from '../../core/requestExternal'\nimport type { GetByIdQuery, ListQuery, Paginated } from '../../core/types'\nimport type {\n File,\n CreateFilePayload,\n UpdateFilePayload,\n CreateToUploadPayload,\n CreateToUploadResult,\n DeleteFileResult,\n DuplicateFilePayload,\n} from './types'\n\n/**\n * Files of the account. The backend serves `POST /files` (the record only, no content),\n * `POST /files/create-to-upload` (record + signed URL to upload the content), `POST\n * /files/duplicate-file`, `DELETE /files/:id` and the signed download `GET\n * /files/:accountId/:filename`; there is no list, read by id nor update.\n */\nexport class FilesApi extends BaseCrudApi<\n File,\n CreateFilePayload,\n UpdateFilePayload,\n ListQuery<File>,\n DeleteFileResult\n> {\n constructor(client: ApiClient) {\n super(client, '/files')\n }\n\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query: ListQuery<File> & { paginate: false },\n headers?: Record<string, string>,\n ): Promise<File[]>\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query?: ListQuery<File> & { paginate?: true },\n headers?: Record<string, string>,\n ): Promise<Paginated<File>>\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query?: ListQuery<File>,\n headers?: Record<string, string>,\n ): Promise<Paginated<File> | File[]>\n override getMany(\n query?: ListQuery<File>,\n headers?: Record<string, string>,\n ): Promise<Paginated<File> | File[]> {\n return super.getMany(query, headers)\n }\n\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getOne(query?: ListQuery<File>, headers?: Record<string, string>): Promise<File | null> {\n return super.getOne(query, headers)\n }\n\n /** @deprecated Not served: the backend has no GET /files/:id, so this route answers 404. */\n override getById(\n id: string,\n query?: GetByIdQuery<File>,\n headers?: Record<string, string>,\n ): Promise<File> {\n return super.getById(id, query, headers)\n }\n\n /** @deprecated Not served: the backend has no PUT /files/:id, so this route answers 404. */\n override updateById(\n id: string,\n body: UpdateFilePayload,\n headers?: Record<string, string>,\n ): Promise<File> {\n return super.updateById(id, body, headers)\n }\n\n /**\n * Deletes a file. Resolves `{ success: true }`, also for an unknown id; a file of another\n * account answers 403.\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<DeleteFileResult> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Creates the record of a file and returns the signed URL to upload its content: send the\n * content with {@link upload}. An audio that must be converted (a voice message for the\n * connection) is sent in `base64` instead, and then no `urlToUpload` is returned. `name` and\n * `mimetype` are required (500 without them; an audio without `name` is named `recording`). With\n * `serviceId`, an extension the account blocks for the type of the connection answers 403.\n */\n createToUpload(\n body: CreateToUploadPayload,\n headers?: Record<string, string>,\n ): Promise<CreateToUploadResult> {\n return this.client.post<CreateToUploadResult, CreateToUploadPayload>(\n `${this.basePath}/create-to-upload`,\n body,\n headers,\n )\n }\n\n /**\n * Copies the content of a file. With `urlToUpload` (the signed URL of a record created by\n * {@link createToUpload} with the same `mimetype` as the file copied), the content is sent to that\n * record and the answer is the `fileId` given; without it, a new record (`attachedType`\n * `'message.file'`) is created with the copied content and its id is the answer, and with\n * `serviceId` an extension the account blocks for the type of the connection answers 403. An\n * unknown `fileId` answers 500.\n */\n duplicateFile(body: DuplicateFilePayload, headers?: Record<string, string>): Promise<string> {\n return this.client.post<string, DuplicateFilePayload>(\n `${this.basePath}/duplicate-file`,\n body,\n headers,\n )\n }\n\n /**\n * Uploads the content of a file to the `urlToUpload` returned by {@link createToUpload}. The URL\n * is signed by the storage, so the request goes straight to it, without the API token (the\n * storage refuses an `Authorization` header). `mimetype` must be the one sent to\n * `createToUpload`. Sent through `client.requestExternal` (the global `fetch` for a client\n * without it). A non-2xx answer of the storage throws `ApiError`.\n */\n async upload(urlToUpload: string, content: BodyInit, mimetype: string): Promise<void> {\n const headers = { 'Content-Type': mimetype }\n await (this.client.requestExternal\n ? this.client.requestExternal('PUT', urlToUpload, content, headers)\n : requestExternal('PUT', urlToUpload, content, headers))\n }\n}\n"],"mappings":";;;;;;;;;;AAoBA,IAAa,WAAb,cAA8B,YAM5B;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,SAAS;;CAkBzB,AAAS,QACP,OACA,SACmC;AACnC,SAAO,MAAM,QAAQ,OAAO,QAAQ;;;CAItC,AAAS,OAAO,OAAyB,SAAwD;AAC/F,SAAO,MAAM,OAAO,OAAO,QAAQ;;;CAIrC,AAAS,QACP,IACA,OACA,SACe;AACf,SAAO,MAAM,QAAQ,IAAI,OAAO,QAAQ;;;CAI1C,AAAS,WACP,IACA,MACA,SACe;AACf,SAAO,MAAM,WAAW,IAAI,MAAM,QAAQ;;;;;;CAO5C,AAAS,WAAW,IAAY,SAA6D;AAC3F,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;;;;;CAUtC,eACE,MACA,SAC+B;AAC/B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,oBACjB,MACA,QACD;;;;;;;;;;CAWH,cAAc,MAA4B,SAAmD;AAC3F,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,kBACjB,MACA,QACD;;;;;;;;;CAUH,MAAM,OAAO,aAAqB,SAAmB,UAAiC;EACpF,MAAM,UAAU,EAAE,gBAAgB,UAAU;AAC5C,SAAO,KAAK,OAAO,kBACf,KAAK,OAAO,gBAAgB,OAAO,aAAa,SAAS,QAAQ,GACjE,gBAAgB,OAAO,aAAa,SAAS,QAAQ"}
@@ -60,7 +60,10 @@ export type CreateToUploadPayload = {
60
60
  mimetype: string;
61
61
  /** What the file is attached to, e.g. `'message.file'` (default), `'campaign.file'`, `'quickreply.file'`. */
62
62
  attachedType?: string;
63
- /** Connection that will send the file (used to decide the audio conversion). */
63
+ /**
64
+ * Connection that will send the file: used to decide the audio conversion and to apply the
65
+ * extensions the account blocks for its type (403).
66
+ */
64
67
  serviceId?: string;
65
68
  /** Audio sent as a voice message (default `true`). */
66
69
  isPtt?: boolean;
@@ -77,6 +80,21 @@ export type CreateToUploadResult = {
77
80
  name: string;
78
81
  mimetype: string;
79
82
  };
83
+ /** Body of `FilesApi.duplicateFile`. */
84
+ export type DuplicateFilePayload = {
85
+ /** The file whose content is copied. */
86
+ fileId: string;
87
+ /**
88
+ * Signed URL of a record created by `FilesApi.createToUpload`, with the same `mimetype` as the file
89
+ * copied, to receive the content. Without it, a new record is created with the copied content.
90
+ */
91
+ urlToUpload?: string;
92
+ /**
93
+ * Connection that will send the new record (used only without `urlToUpload`): the extensions the
94
+ * account blocks for its type apply.
95
+ */
96
+ serviceId?: string;
97
+ };
80
98
  /** Result of `FilesApi.deleteById`. */
81
99
  export type DeleteFileResult = {
82
100
  success: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/files/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAA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AAM,CAAA;CACnB,CAAA;AAED,uCAAuC;AACvC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA"}
@@ -2,11 +2,43 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_core_BaseCrudApi = require('../../core/BaseCrudApi.cjs');
3
3
 
4
4
  //#region src/apis/kanbanCards/KanbanCardsApi.ts
5
+ /**
6
+ * Cards of the kanban boards: one per ticket in each board. The reads need `kanban.boards.view`
7
+ * and the writes `kanban.cards.move`. `getMany` takes the column in `where.columnId`. The errors of
8
+ * the writes (unknown column or ticket, ticket of a department not linked to the board, a second
9
+ * card of the ticket in the board, an update by a user outside the department of the ticket)
10
+ * answer 500.
11
+ */
5
12
  var KanbanCardsApi = class extends require_core_BaseCrudApi.BaseCrudApi {
6
13
  constructor(client) {
7
14
  super(client, "/kanban-cards");
8
15
  }
9
16
  /**
17
+ * Returns a card by ID. An unknown id answers 404 `Kanban card not found.`.
18
+ * @permissions kanban.boards.view
19
+ */
20
+ getById(id, query, headers) {
21
+ return super.getById(id, query, headers);
22
+ }
23
+ /**
24
+ * Creates the card of a ticket in a column. The ticket must be of a department linked to the
25
+ * board and have no card in it yet.
26
+ * @permissions kanban.cards.move
27
+ */
28
+ create(body, headers) {
29
+ return super.create(body, headers);
30
+ }
31
+ /**
32
+ * Updates a card. To move it, use {@link reorder}: `updateById` does not recalculate the
33
+ * `position` and does not close or reopen the ticket. The user must belong to the
34
+ * department of the card's ticket (of the new `ticketId` when sent), or have
35
+ * `tickets.transfer.all`, or be admin; otherwise 500.
36
+ * @permissions kanban.cards.move
37
+ */
38
+ updateById(id, body, headers) {
39
+ return super.updateById(id, body, headers);
40
+ }
41
+ /**
10
42
  * Deletes a card. Resolves the text `'OK'`.
11
43
  * @permissions kanban.cards.move
12
44
  */
@@ -1 +1 @@
1
- {"version":3,"file":"KanbanCardsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/kanbanCards/KanbanCardsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n KanbanCard,\n CreateKanbanCardPayload,\n ReorderKanbanCardPayload,\n UpdateKanbanCardPayload,\n} from './types'\n\nexport class KanbanCardsApi extends BaseCrudApi<\n KanbanCard,\n CreateKanbanCardPayload,\n UpdateKanbanCardPayload,\n ListQuery<KanbanCard>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/kanban-cards')\n }\n\n /**\n * Deletes a card. Resolves the text `'OK'`.\n * @permissions kanban.cards.move\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Moves a card within its column or to another column (see {@link ReorderKanbanCardPayload}).\n * Resolves to the card with its new `position` and `columnId`.\n * @permissions kanban.cards.move\n */\n reorder(\n id: string,\n body: ReorderKanbanCardPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanCard> {\n return this.client.patch<KanbanCard, ReorderKanbanCardPayload>(\n `${this.basePath}/${id}/reorder`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;;AAUA,IAAa,iBAAb,cAAoCA,qCAMlC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gBAAgB;;;;;;CAOhC,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;;;CAQtC,QACE,IACA,MACA,SACqB;AACrB,SAAO,KAAK,OAAO,MACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD"}
1
+ {"version":3,"file":"KanbanCardsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/kanbanCards/KanbanCardsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { GetByIdQuery, ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n KanbanCard,\n CreateKanbanCardPayload,\n ReorderKanbanCardPayload,\n UpdateKanbanCardPayload,\n} from './types'\n\n/**\n * Cards of the kanban boards: one per ticket in each board. The reads need `kanban.boards.view`\n * and the writes `kanban.cards.move`. `getMany` takes the column in `where.columnId`. The errors of\n * the writes (unknown column or ticket, ticket of a department not linked to the board, a second\n * card of the ticket in the board, an update by a user outside the department of the ticket)\n * answer 500.\n */\nexport class KanbanCardsApi extends BaseCrudApi<\n KanbanCard,\n CreateKanbanCardPayload,\n UpdateKanbanCardPayload,\n ListQuery<KanbanCard>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/kanban-cards')\n }\n\n /**\n * Returns a card by ID. An unknown id answers 404 `Kanban card not found.`.\n * @permissions kanban.boards.view\n */\n override getById(\n id: string,\n query?: GetByIdQuery<KanbanCard>,\n headers?: Record<string, string>,\n ): Promise<KanbanCard> {\n return super.getById(id, query, headers)\n }\n\n /**\n * Creates the card of a ticket in a column. The ticket must be of a department linked to the\n * board and have no card in it yet.\n * @permissions kanban.cards.move\n */\n override create(\n body: CreateKanbanCardPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanCard> {\n return super.create(body, headers)\n }\n\n /**\n * Updates a card. To move it, use {@link reorder}: `updateById` does not recalculate the\n * `position` and does not close or reopen the ticket. The user must belong to the\n * department of the card's ticket (of the new `ticketId` when sent), or have\n * `tickets.transfer.all`, or be admin; otherwise 500.\n * @permissions kanban.cards.move\n */\n override updateById(\n id: string,\n body: UpdateKanbanCardPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanCard> {\n return super.updateById(id, body, headers)\n }\n\n /**\n * Deletes a card. Resolves the text `'OK'`.\n * @permissions kanban.cards.move\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Moves a card within its column or to another column (see {@link ReorderKanbanCardPayload}).\n * Resolves to the card with its new `position` and `columnId`.\n * @permissions kanban.cards.move\n */\n reorder(\n id: string,\n body: ReorderKanbanCardPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanCard> {\n return this.client.patch<KanbanCard, ReorderKanbanCardPayload>(\n `${this.basePath}/${id}/reorder`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;;;;;;;;;AAiBA,IAAa,iBAAb,cAAoCA,qCAMlC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gBAAgB;;;;;;CAOhC,AAAS,QACP,IACA,OACA,SACqB;AACrB,SAAO,MAAM,QAAQ,IAAI,OAAO,QAAQ;;;;;;;CAQ1C,AAAS,OACP,MACA,SACqB;AACrB,SAAO,MAAM,OAAO,MAAM,QAAQ;;;;;;;;;CAUpC,AAAS,WACP,IACA,MACA,SACqB;AACrB,SAAO,MAAM,WAAW,IAAI,MAAM,QAAQ;;;;;;CAO5C,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;;;CAQtC,QACE,IACA,MACA,SACqB;AACrB,SAAO,KAAK,OAAO,MACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD"}
@@ -1,9 +1,35 @@
1
1
  import type { ApiClient } from '../../core/ApiClient';
2
- import type { ListQuery } from '../../core/types';
2
+ import type { GetByIdQuery, ListQuery } from '../../core/types';
3
3
  import { BaseCrudApi } from '../../core/BaseCrudApi';
4
4
  import type { KanbanCard, CreateKanbanCardPayload, ReorderKanbanCardPayload, UpdateKanbanCardPayload } from './types';
5
+ /**
6
+ * Cards of the kanban boards: one per ticket in each board. The reads need `kanban.boards.view`
7
+ * and the writes `kanban.cards.move`. `getMany` takes the column in `where.columnId`. The errors of
8
+ * the writes (unknown column or ticket, ticket of a department not linked to the board, a second
9
+ * card of the ticket in the board, an update by a user outside the department of the ticket)
10
+ * answer 500.
11
+ */
5
12
  export declare class KanbanCardsApi extends BaseCrudApi<KanbanCard, CreateKanbanCardPayload, UpdateKanbanCardPayload, ListQuery<KanbanCard>, 'OK'> {
6
13
  constructor(client: ApiClient);
14
+ /**
15
+ * Returns a card by ID. An unknown id answers 404 `Kanban card not found.`.
16
+ * @permissions kanban.boards.view
17
+ */
18
+ getById(id: string, query?: GetByIdQuery<KanbanCard>, headers?: Record<string, string>): Promise<KanbanCard>;
19
+ /**
20
+ * Creates the card of a ticket in a column. The ticket must be of a department linked to the
21
+ * board and have no card in it yet.
22
+ * @permissions kanban.cards.move
23
+ */
24
+ create(body: CreateKanbanCardPayload, headers?: Record<string, string>): Promise<KanbanCard>;
25
+ /**
26
+ * Updates a card. To move it, use {@link reorder}: `updateById` does not recalculate the
27
+ * `position` and does not close or reopen the ticket. The user must belong to the
28
+ * department of the card's ticket (of the new `ticketId` when sent), or have
29
+ * `tickets.transfer.all`, or be admin; otherwise 500.
30
+ * @permissions kanban.cards.move
31
+ */
32
+ updateById(id: string, body: UpdateKanbanCardPayload, headers?: Record<string, string>): Promise<KanbanCard>;
7
33
  /**
8
34
  * Deletes a card. Resolves the text `'OK'`.
9
35
  * @permissions kanban.cards.move
@@ -1 +1 @@
1
- {"version":3,"file":"KanbanCardsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/kanbanCards/KanbanCardsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EACV,UAAU,EACV,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAEhB,qBAAa,cAAe,SAAQ,WAAW,CAC7C,UAAU,EACV,uBAAuB,EACvB,uBAAuB,EACvB,SAAS,CAAC,UAAU,CAAC,EACrB,IAAI,CACL;gBACa,MAAM,EAAE,SAAS;IAI7B;;;OAGG;IACM,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,M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AAO,CAAC,UAAU,CAAC;IAItB;;;OAGG;IACM,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhF;;;;OAIG;IACH,OAAO,CACL,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,UAAU,CAAC;CAOvB"}
@@ -1,11 +1,43 @@
1
1
  import { BaseCrudApi } from "../../core/BaseCrudApi.mjs";
2
2
 
3
3
  //#region src/apis/kanbanCards/KanbanCardsApi.ts
4
+ /**
5
+ * Cards of the kanban boards: one per ticket in each board. The reads need `kanban.boards.view`
6
+ * and the writes `kanban.cards.move`. `getMany` takes the column in `where.columnId`. The errors of
7
+ * the writes (unknown column or ticket, ticket of a department not linked to the board, a second
8
+ * card of the ticket in the board, an update by a user outside the department of the ticket)
9
+ * answer 500.
10
+ */
4
11
  var KanbanCardsApi = class extends BaseCrudApi {
5
12
  constructor(client) {
6
13
  super(client, "/kanban-cards");
7
14
  }
8
15
  /**
16
+ * Returns a card by ID. An unknown id answers 404 `Kanban card not found.`.
17
+ * @permissions kanban.boards.view
18
+ */
19
+ getById(id, query, headers) {
20
+ return super.getById(id, query, headers);
21
+ }
22
+ /**
23
+ * Creates the card of a ticket in a column. The ticket must be of a department linked to the
24
+ * board and have no card in it yet.
25
+ * @permissions kanban.cards.move
26
+ */
27
+ create(body, headers) {
28
+ return super.create(body, headers);
29
+ }
30
+ /**
31
+ * Updates a card. To move it, use {@link reorder}: `updateById` does not recalculate the
32
+ * `position` and does not close or reopen the ticket. The user must belong to the
33
+ * department of the card's ticket (of the new `ticketId` when sent), or have
34
+ * `tickets.transfer.all`, or be admin; otherwise 500.
35
+ * @permissions kanban.cards.move
36
+ */
37
+ updateById(id, body, headers) {
38
+ return super.updateById(id, body, headers);
39
+ }
40
+ /**
9
41
  * Deletes a card. Resolves the text `'OK'`.
10
42
  * @permissions kanban.cards.move
11
43
  */
@@ -1 +1 @@
1
- {"version":3,"file":"KanbanCardsApi.mjs","names":[],"sources":["../../../src/apis/kanbanCards/KanbanCardsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n KanbanCard,\n CreateKanbanCardPayload,\n ReorderKanbanCardPayload,\n UpdateKanbanCardPayload,\n} from './types'\n\nexport class KanbanCardsApi extends BaseCrudApi<\n KanbanCard,\n CreateKanbanCardPayload,\n UpdateKanbanCardPayload,\n ListQuery<KanbanCard>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/kanban-cards')\n }\n\n /**\n * Deletes a card. Resolves the text `'OK'`.\n * @permissions kanban.cards.move\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Moves a card within its column or to another column (see {@link ReorderKanbanCardPayload}).\n * Resolves to the card with its new `position` and `columnId`.\n * @permissions kanban.cards.move\n */\n reorder(\n id: string,\n body: ReorderKanbanCardPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanCard> {\n return this.client.patch<KanbanCard, ReorderKanbanCardPayload>(\n `${this.basePath}/${id}/reorder`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;AAUA,IAAa,iBAAb,cAAoC,YAMlC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gBAAgB;;;;;;CAOhC,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;;;CAQtC,QACE,IACA,MACA,SACqB;AACrB,SAAO,KAAK,OAAO,MACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD"}
1
+ {"version":3,"file":"KanbanCardsApi.mjs","names":[],"sources":["../../../src/apis/kanbanCards/KanbanCardsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { GetByIdQuery, ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n KanbanCard,\n CreateKanbanCardPayload,\n ReorderKanbanCardPayload,\n UpdateKanbanCardPayload,\n} from './types'\n\n/**\n * Cards of the kanban boards: one per ticket in each board. The reads need `kanban.boards.view`\n * and the writes `kanban.cards.move`. `getMany` takes the column in `where.columnId`. The errors of\n * the writes (unknown column or ticket, ticket of a department not linked to the board, a second\n * card of the ticket in the board, an update by a user outside the department of the ticket)\n * answer 500.\n */\nexport class KanbanCardsApi extends BaseCrudApi<\n KanbanCard,\n CreateKanbanCardPayload,\n UpdateKanbanCardPayload,\n ListQuery<KanbanCard>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/kanban-cards')\n }\n\n /**\n * Returns a card by ID. An unknown id answers 404 `Kanban card not found.`.\n * @permissions kanban.boards.view\n */\n override getById(\n id: string,\n query?: GetByIdQuery<KanbanCard>,\n headers?: Record<string, string>,\n ): Promise<KanbanCard> {\n return super.getById(id, query, headers)\n }\n\n /**\n * Creates the card of a ticket in a column. The ticket must be of a department linked to the\n * board and have no card in it yet.\n * @permissions kanban.cards.move\n */\n override create(\n body: CreateKanbanCardPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanCard> {\n return super.create(body, headers)\n }\n\n /**\n * Updates a card. To move it, use {@link reorder}: `updateById` does not recalculate the\n * `position` and does not close or reopen the ticket. The user must belong to the\n * department of the card's ticket (of the new `ticketId` when sent), or have\n * `tickets.transfer.all`, or be admin; otherwise 500.\n * @permissions kanban.cards.move\n */\n override updateById(\n id: string,\n body: UpdateKanbanCardPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanCard> {\n return super.updateById(id, body, headers)\n }\n\n /**\n * Deletes a card. Resolves the text `'OK'`.\n * @permissions kanban.cards.move\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Moves a card within its column or to another column (see {@link ReorderKanbanCardPayload}).\n * Resolves to the card with its new `position` and `columnId`.\n * @permissions kanban.cards.move\n */\n reorder(\n id: string,\n body: ReorderKanbanCardPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanCard> {\n return this.client.patch<KanbanCard, ReorderKanbanCardPayload>(\n `${this.basePath}/${id}/reorder`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;;;;;;;;AAiBA,IAAa,iBAAb,cAAoC,YAMlC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gBAAgB;;;;;;CAOhC,AAAS,QACP,IACA,OACA,SACqB;AACrB,SAAO,MAAM,QAAQ,IAAI,OAAO,QAAQ;;;;;;;CAQ1C,AAAS,OACP,MACA,SACqB;AACrB,SAAO,MAAM,OAAO,MAAM,QAAQ;;;;;;;;;CAUpC,AAAS,WACP,IACA,MACA,SACqB;AACrB,SAAO,MAAM,WAAW,IAAI,MAAM,QAAQ;;;;;;CAO5C,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;;;CAQtC,QACE,IACA,MACA,SACqB;AACrB,SAAO,KAAK,OAAO,MACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD"}
@@ -22,7 +22,7 @@ export type CreateKanbanCardPayload = {
22
22
  export type UpdateKanbanCardPayload = {
23
23
  columnId?: string;
24
24
  position?: string;
25
- /** The caller must share a department with the ticket (or transfer to all / be admin). */
25
+ /** Moves the card to another ticket (see `KanbanCardsApi.updateById` for who can update it). */
26
26
  ticketId?: string;
27
27
  };
28
28
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/kanbanCards/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,C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MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEzD,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;CACzB,CAAA"}
@@ -7,6 +7,25 @@ var KanbanColumnsApi = class extends require_core_BaseCrudApi.BaseCrudApi {
7
7
  super(client, "/kanban-columns");
8
8
  }
9
9
  /**
10
+ * Deletes a column and its cards (their tickets are kept as they are). The `'initial'` and
11
+ * `'final'` columns cannot be deleted (500). Resolves to the deleted column. To keep the cards,
12
+ * use {@link deleteMovingCards}.
13
+ * @permissions kanban.columns.destroy
14
+ */
15
+ deleteById(id, headers) {
16
+ return super.deleteById(id, headers);
17
+ }
18
+ /**
19
+ * Deletes a column after moving its cards to the top of another column of the board, in their
20
+ * order. The cards move as `KanbanCardsApi.reorder` moves them: to the `'final'` column,
21
+ * their open tickets are closed. The `'initial'` and `'final'` columns cannot be deleted (500).
22
+ * Resolves to the deleted column.
23
+ * @permissions kanban.columns.destroy
24
+ */
25
+ deleteMovingCards(id, body, headers) {
26
+ return this.client.request("DELETE", `${this.basePath}/${id}`, body, headers);
27
+ }
28
+ /**
10
29
  * Moves a column between two neighbours of the same board. Both the column and a neighbour
11
30
  * must be draggable; swapped neighbours (`before` after `after`) fail with 500. Resolves to the
12
31
  * column with its new `position`.
@@ -1 +1 @@
1
- {"version":3,"file":"KanbanColumnsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/kanbanColumns/KanbanColumnsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n KanbanColumn,\n CreateKanbanColumnPayload,\n ReorderKanbanColumnPayload,\n UpdateKanbanColumnPayload,\n} from './types'\n\nexport class KanbanColumnsApi extends BaseCrudApi<\n KanbanColumn,\n CreateKanbanColumnPayload,\n UpdateKanbanColumnPayload\n> {\n constructor(client: ApiClient) {\n super(client, '/kanban-columns')\n }\n\n /**\n * Moves a column between two neighbours of the same board. Both the column and a neighbour\n * must be draggable; swapped neighbours (`before` after `after`) fail with 500. Resolves to the\n * column with its new `position`.\n * @permissions kanban.columns.update\n */\n reorder(\n id: string,\n body: ReorderKanbanColumnPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanColumn> {\n return this.client.patch<KanbanColumn, ReorderKanbanColumnPayload>(\n `${this.basePath}/${id}/reorder`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;;AASA,IAAa,mBAAb,cAAsCA,qCAIpC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,kBAAkB;;;;;;;;CASlC,QACE,IACA,MACA,SACuB;AACvB,SAAO,KAAK,OAAO,MACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD"}
1
+ {"version":3,"file":"KanbanColumnsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/kanbanColumns/KanbanColumnsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n KanbanColumn,\n CreateKanbanColumnPayload,\n DeleteKanbanColumnPayload,\n ReorderKanbanColumnPayload,\n UpdateKanbanColumnPayload,\n} from './types'\n\nexport class KanbanColumnsApi extends BaseCrudApi<\n KanbanColumn,\n CreateKanbanColumnPayload,\n UpdateKanbanColumnPayload\n> {\n constructor(client: ApiClient) {\n super(client, '/kanban-columns')\n }\n\n /**\n * Deletes a column and its cards (their tickets are kept as they are). The `'initial'` and\n * `'final'` columns cannot be deleted (500). Resolves to the deleted column. To keep the cards,\n * use {@link deleteMovingCards}.\n * @permissions kanban.columns.destroy\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<KanbanColumn> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Deletes a column after moving its cards to the top of another column of the board, in their\n * order. The cards move as `KanbanCardsApi.reorder` moves them: to the `'final'` column,\n * their open tickets are closed. The `'initial'` and `'final'` columns cannot be deleted (500).\n * Resolves to the deleted column.\n * @permissions kanban.columns.destroy\n */\n deleteMovingCards(\n id: string,\n body: DeleteKanbanColumnPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanColumn> {\n return this.client.request<KanbanColumn, DeleteKanbanColumnPayload>(\n 'DELETE',\n `${this.basePath}/${id}`,\n body,\n headers,\n )\n }\n\n /**\n * Moves a column between two neighbours of the same board. Both the column and a neighbour\n * must be draggable; swapped neighbours (`before` after `after`) fail with 500. Resolves to the\n * column with its new `position`.\n * @permissions kanban.columns.update\n */\n reorder(\n id: string,\n body: ReorderKanbanColumnPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanColumn> {\n return this.client.patch<KanbanColumn, ReorderKanbanColumnPayload>(\n `${this.basePath}/${id}/reorder`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;;AAUA,IAAa,mBAAb,cAAsCA,qCAIpC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,kBAAkB;;;;;;;;CASlC,AAAS,WAAW,IAAY,SAAyD;AACvF,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;;;;;CAUtC,kBACE,IACA,MACA,SACuB;AACvB,SAAO,KAAK,OAAO,QACjB,UACA,GAAG,KAAK,SAAS,GAAG,MACpB,MACA,QACD;;;;;;;;CASH,QACE,IACA,MACA,SACuB;AACvB,SAAO,KAAK,OAAO,MACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD"}
@@ -1,8 +1,23 @@
1
1
  import type { ApiClient } from '../../core/ApiClient';
2
2
  import { BaseCrudApi } from '../../core/BaseCrudApi';
3
- import type { KanbanColumn, CreateKanbanColumnPayload, ReorderKanbanColumnPayload, UpdateKanbanColumnPayload } from './types';
3
+ import type { KanbanColumn, CreateKanbanColumnPayload, DeleteKanbanColumnPayload, ReorderKanbanColumnPayload, UpdateKanbanColumnPayload } from './types';
4
4
  export declare class KanbanColumnsApi extends BaseCrudApi<KanbanColumn, CreateKanbanColumnPayload, UpdateKanbanColumnPayload> {
5
5
  constructor(client: ApiClient);
6
+ /**
7
+ * Deletes a column and its cards (their tickets are kept as they are). The `'initial'` and
8
+ * `'final'` columns cannot be deleted (500). Resolves to the deleted column. To keep the cards,
9
+ * use {@link deleteMovingCards}.
10
+ * @permissions kanban.columns.destroy
11
+ */
12
+ deleteById(id: string, headers?: Record<string, string>): Promise<KanbanColumn>;
13
+ /**
14
+ * Deletes a column after moving its cards to the top of another column of the board, in their
15
+ * order. The cards move as `KanbanCardsApi.reorder` moves them: to the `'final'` column,
16
+ * their open tickets are closed. The `'initial'` and `'final'` columns cannot be deleted (500).
17
+ * Resolves to the deleted column.
18
+ * @permissions kanban.columns.destroy
19
+ */
20
+ deleteMovingCards(id: string, body: DeleteKanbanColumnPayload, headers?: Record<string, string>): Promise<KanbanColumn>;
6
21
  /**
7
22
  * Moves a column between two neighbours of the same board. Both the column and a neighbour
8
23
  * must be draggable; swapped neighbours (`before` after `after`) fail with 500. Resolves to the
@@ -1 +1 @@
1
- {"version":3,"file":"KanbanColumnsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/kanbanColumns/KanbanColumnsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EACV,YAAY,EACZ,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,SAAS,CAAA;AAEhB,qBAAa,gBAAiB,SAAQ,WAAW,CAC/C,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,CAC1B;gBACa,MAAM,EAAE,SAAS;IAI7B;;;;;OAKG;IACH,OAAO,CACL,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,0BAA0B,EAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,YAAY,CAAC;CAOzB"}
1
+ {"version":3,"file":"KanbanColumnsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/kanbanColumns/KanbanColumnsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EACV,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,SAAS,CAAA;AAEhB,qBAAa,gBAAiB,SAAQ,WAAW,CAC/C,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,CAC1B;gBACa,MAAM,EAAE,SAAS;IAI7B;;;;;OAKG;IACM,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;IAIxF;;;;;;OAMG;IACH,iBAAiB,CACf,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,YAAY,CAAC;IASxB;;;;;OAKG;IACH,OAAO,CACL,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,0BAA0B,EAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,YAAY,CAAC;CAOzB"}
@@ -6,6 +6,25 @@ var KanbanColumnsApi = class extends BaseCrudApi {
6
6
  super(client, "/kanban-columns");
7
7
  }
8
8
  /**
9
+ * Deletes a column and its cards (their tickets are kept as they are). The `'initial'` and
10
+ * `'final'` columns cannot be deleted (500). Resolves to the deleted column. To keep the cards,
11
+ * use {@link deleteMovingCards}.
12
+ * @permissions kanban.columns.destroy
13
+ */
14
+ deleteById(id, headers) {
15
+ return super.deleteById(id, headers);
16
+ }
17
+ /**
18
+ * Deletes a column after moving its cards to the top of another column of the board, in their
19
+ * order. The cards move as `KanbanCardsApi.reorder` moves them: to the `'final'` column,
20
+ * their open tickets are closed. The `'initial'` and `'final'` columns cannot be deleted (500).
21
+ * Resolves to the deleted column.
22
+ * @permissions kanban.columns.destroy
23
+ */
24
+ deleteMovingCards(id, body, headers) {
25
+ return this.client.request("DELETE", `${this.basePath}/${id}`, body, headers);
26
+ }
27
+ /**
9
28
  * Moves a column between two neighbours of the same board. Both the column and a neighbour
10
29
  * must be draggable; swapped neighbours (`before` after `after`) fail with 500. Resolves to the
11
30
  * column with its new `position`.
@@ -1 +1 @@
1
- {"version":3,"file":"KanbanColumnsApi.mjs","names":[],"sources":["../../../src/apis/kanbanColumns/KanbanColumnsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n KanbanColumn,\n CreateKanbanColumnPayload,\n ReorderKanbanColumnPayload,\n UpdateKanbanColumnPayload,\n} from './types'\n\nexport class KanbanColumnsApi extends BaseCrudApi<\n KanbanColumn,\n CreateKanbanColumnPayload,\n UpdateKanbanColumnPayload\n> {\n constructor(client: ApiClient) {\n super(client, '/kanban-columns')\n }\n\n /**\n * Moves a column between two neighbours of the same board. Both the column and a neighbour\n * must be draggable; swapped neighbours (`before` after `after`) fail with 500. Resolves to the\n * column with its new `position`.\n * @permissions kanban.columns.update\n */\n reorder(\n id: string,\n body: ReorderKanbanColumnPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanColumn> {\n return this.client.patch<KanbanColumn, ReorderKanbanColumnPayload>(\n `${this.basePath}/${id}/reorder`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;AASA,IAAa,mBAAb,cAAsC,YAIpC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,kBAAkB;;;;;;;;CASlC,QACE,IACA,MACA,SACuB;AACvB,SAAO,KAAK,OAAO,MACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD"}
1
+ {"version":3,"file":"KanbanColumnsApi.mjs","names":[],"sources":["../../../src/apis/kanbanColumns/KanbanColumnsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n KanbanColumn,\n CreateKanbanColumnPayload,\n DeleteKanbanColumnPayload,\n ReorderKanbanColumnPayload,\n UpdateKanbanColumnPayload,\n} from './types'\n\nexport class KanbanColumnsApi extends BaseCrudApi<\n KanbanColumn,\n CreateKanbanColumnPayload,\n UpdateKanbanColumnPayload\n> {\n constructor(client: ApiClient) {\n super(client, '/kanban-columns')\n }\n\n /**\n * Deletes a column and its cards (their tickets are kept as they are). The `'initial'` and\n * `'final'` columns cannot be deleted (500). Resolves to the deleted column. To keep the cards,\n * use {@link deleteMovingCards}.\n * @permissions kanban.columns.destroy\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<KanbanColumn> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Deletes a column after moving its cards to the top of another column of the board, in their\n * order. The cards move as `KanbanCardsApi.reorder` moves them: to the `'final'` column,\n * their open tickets are closed. The `'initial'` and `'final'` columns cannot be deleted (500).\n * Resolves to the deleted column.\n * @permissions kanban.columns.destroy\n */\n deleteMovingCards(\n id: string,\n body: DeleteKanbanColumnPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanColumn> {\n return this.client.request<KanbanColumn, DeleteKanbanColumnPayload>(\n 'DELETE',\n `${this.basePath}/${id}`,\n body,\n headers,\n )\n }\n\n /**\n * Moves a column between two neighbours of the same board. Both the column and a neighbour\n * must be draggable; swapped neighbours (`before` after `after`) fail with 500. Resolves to the\n * column with its new `position`.\n * @permissions kanban.columns.update\n */\n reorder(\n id: string,\n body: ReorderKanbanColumnPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanColumn> {\n return this.client.patch<KanbanColumn, ReorderKanbanColumnPayload>(\n `${this.basePath}/${id}/reorder`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;AAUA,IAAa,mBAAb,cAAsC,YAIpC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,kBAAkB;;;;;;;;CASlC,AAAS,WAAW,IAAY,SAAyD;AACvF,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;;;;;CAUtC,kBACE,IACA,MACA,SACuB;AACvB,SAAO,KAAK,OAAO,QACjB,UACA,GAAG,KAAK,SAAS,GAAG,MACpB,MACA,QACD;;;;;;;;CASH,QACE,IACA,MACA,SACuB;AACvB,SAAO,KAAK,OAAO,MACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD"}
@@ -43,4 +43,8 @@ export type ReorderKanbanColumnPayload = {
43
43
  /** The column that ends up on the right. */
44
44
  afterColumnId?: string;
45
45
  };
46
+ export type DeleteKanbanColumnPayload = {
47
+ /** The column of the same board that receives the cards of the deleted one. */
48
+ cardsDestinationColumnId: string;
49
+ };
46
50
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/kanbanColumns/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAA;AAE9D,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,gBAAgB,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC,WAAW,EAAE,OAAO,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IAC1B,KAAK,CAAC,EAAE,UAAU,EAAE,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAA;AAE/C,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;IACrB,iFAAiF;IACjF,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB;;;OAGG;IACH,QAAQ,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A;AAED,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAA;AAE/C,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;IACrB,iFAAiF;IACjF,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrC,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,2FAA2F;AAC3F,MAAM,MAAM,0BAA0B,GAAG;IACvC,2CAA2C;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,4CAA4C;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,+EAA+E;IAC/E,wBAAwB,EAAE,MAAM,CAAA;CACjC,CAAA"}
@@ -10,10 +10,19 @@ var MessagesApi = class extends require_core_BaseCrudApi.BaseCrudApi {
10
10
  super(client, "/messages");
11
11
  }
12
12
  /**
13
- * Edits the text (or the file) of a message sent by the account, up to 15 minutes after it was
14
- * sent (403 `Cannot edit message` after that). `contactId` is required (without it the route
15
- * answers 500), and `text` or `file` (400 without both). Sent as `PATCH /messages/:id`.
16
- * @permissions messages.update
13
+ * Edits the text of a message sent by the account, up to 15 minutes after it was sent. Sent as
14
+ * `PATCH /messages/:id`. `contactId` is required: without it the route answers 500, and an
15
+ * unknown or blocked contact answers 400 `The given data was invalid.` (the error comes in
16
+ * `contactId`). So is `text`: `text: ''` alone answers 400 (`At least one field (text or file)
17
+ * must be provided`), and a `text` with only spaces answers 400 `Text cannot be empty`. Only the
18
+ * text is edited: `file` is not sent to the connection. A message received, or sent more than
19
+ * 15 minutes ago, answers 403 `Cannot edit message`; an unknown message answers 404
20
+ * `Message not found`. The message passes to the user who edited it.
21
+ *
22
+ * The message is answered once the edit is sent to the connection, before the connection
23
+ * confirms it: read it again until `text` changes (`data.edited` is set to `true` when the
24
+ * connection reports the edit). On WhatsApp Business and Telegram connections the route answers
25
+ * the result of the edit job, not the message: read it again with `getById`.
17
26
  */
18
27
  updateById(id, body, headers) {
19
28
  return this.client.patch(`${this.basePath}/${id}`, body, headers);
@@ -1 +1 @@
1
- {"version":3,"file":"MessagesApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/messages/MessagesApi.ts"],"sourcesContent":["import qs from 'qs'\nimport type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n Message,\n CreateMessagePayload,\n UpdateMessagePayload,\n ForwardMessagesPayload,\n ForwardMessagesResult,\n SendVcardsPayload,\n SendReactionPayload,\n MagicTextPayload,\n MagicTextResult,\n CheckSummaryPayload,\n CheckSummaryResult,\n BulkDestroyPayload,\n OutOfRangeResult,\n LoadAroundQuery,\n} from './types'\n\nexport class MessagesApi extends BaseCrudApi<Message, CreateMessagePayload, UpdateMessagePayload> {\n constructor(client: ApiClient) {\n super(client, '/messages')\n }\n\n /**\n * Edits the text (or the file) of a message sent by the account, up to 15 minutes after it was\n * sent (403 `Cannot edit message` after that). `contactId` is required (without it the route\n * answers 500), and `text` or `file` (400 without both). Sent as `PATCH /messages/:id`.\n * @permissions messages.update\n */\n override updateById(\n id: string,\n body: UpdateMessagePayload,\n headers?: Record<string, string>,\n ): Promise<Message> {\n return this.client.patch<Message, UpdateMessagePayload>(`${this.basePath}/${id}`, body, headers)\n }\n\n /**\n * @deprecated Not served: the backend has no DELETE /messages/:id, so this route answers 404.\n * Use {@link bulkDestroy}.\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<Message> {\n return super.deleteById(id, headers)\n }\n\n /** Forwards one or more messages to one or more contacts (max 20 messages to 5 contacts). */\n forward(\n body: ForwardMessagesPayload,\n headers?: Record<string, string>,\n ): Promise<ForwardMessagesResult> {\n return this.client.post<ForwardMessagesResult, ForwardMessagesPayload>(\n `${this.basePath}/forward`,\n body,\n headers,\n )\n }\n\n /** Revokes (soft-deletes) a sent message so it is no longer visible to the recipient. */\n revoke(id: string, headers?: Record<string, string>): Promise<Message> {\n return this.client.post<Message>(`${this.basePath}/${id}/revoke`, undefined, headers)\n }\n\n /** Removes a previously sent reaction from a message. */\n revokeReaction(id: string, headers?: Record<string, string>): Promise<boolean> {\n return this.client.put<boolean>(`${this.basePath}/${id}/revoke-reaction`, undefined, headers)\n }\n\n /** Sends one or more contacts as vCard messages to a given contact. */\n sendVcards(body: SendVcardsPayload, headers?: Record<string, string>): Promise<Message> {\n return this.client.post<Message, SendVcardsPayload>(\n `${this.basePath}/send-vcards`,\n body,\n headers,\n )\n }\n\n /** Sends an emoji reaction to a message. */\n sendReaction(\n id: string,\n body: SendReactionPayload,\n headers?: Record<string, string>,\n ): Promise<boolean> {\n return this.client.post<boolean, SendReactionPayload>(\n `${this.basePath}/${id}/send-reaction`,\n body,\n headers,\n )\n }\n\n /** Uses AI to rewrite or correct a message text with a given tone (e.g. \"correct\", \"professional\", \"casual\"). */\n magicText(body: MagicTextPayload, headers?: Record<string, string>): Promise<MagicTextResult> {\n return this.client.post<MagicTextResult, MagicTextPayload>(\n `${this.basePath}/magic-text`,\n body,\n headers,\n )\n }\n\n /** Checks whether an AI-generated summary already exists for a given ticket. */\n checkSummary(\n body: CheckSummaryPayload,\n headers?: Record<string, string>,\n ): Promise<CheckSummaryResult> {\n return this.client.post<CheckSummaryResult, CheckSummaryPayload>(\n `${this.basePath}/check-summary`,\n body,\n headers,\n )\n }\n\n /**\n * Deletes multiple messages matching the given where clause.\n * @permissions messages.destroy\n */\n bulkDestroy(body: BulkDestroyPayload, headers?: Record<string, string>): Promise<boolean> {\n return this.client.request<boolean, BulkDestroyPayload>(\n 'DELETE',\n `${this.basePath}/many`,\n body,\n headers,\n )\n }\n\n /**\n * Regenerates an existing AI summary: `id` is the id of the message of `type: 'summary'`. When\n * there is no such message (or the AI limit was reached) nothing is done and it still resolves\n * `'OK'`. To summarize the open ticket of a contact, use `ContactsApi.summarizeTicket`.\n */\n summarize(id: string, headers?: Record<string, string>): Promise<string> {\n return this.client.post<string>(`${this.basePath}/${id}/summarize`, undefined, headers)\n }\n\n /** Checks whether a message is out of the visible range (i.e. there are more than `limit` messages after it). */\n outOfRange(\n id: string,\n limit?: number,\n headers?: Record<string, string>,\n ): Promise<OutOfRangeResult> {\n const queryString = limit ? `?${qs.stringify({ limit })}` : ''\n return this.client.get<OutOfRangeResult>(\n `${this.basePath}/${id}/out-of-range${queryString}`,\n headers,\n )\n }\n\n /**\n * Re-downloads and syncs the file attachment for a message from the messaging service. Resolves\n * what the driver answers; an unknown message answers 500.\n */\n syncFile(id: string, headers?: Record<string, string>): Promise<unknown> {\n return this.client.post<unknown>(`${this.basePath}/${id}/sync-file`, undefined, headers)\n }\n\n /** Loads messages surrounding a target message (N before and N after), useful for jumping to a specific point in a conversation. */\n around(\n id: string,\n query?: LoadAroundQuery,\n headers?: Record<string, string>,\n ): Promise<Message[]> {\n const queryString = query ? `?${qs.stringify(query)}` : ''\n return this.client.get<Message[]>(`${this.basePath}/${id}/around${queryString}`, headers)\n }\n}\n"],"mappings":";;;;;;;AAoBA,IAAa,cAAb,cAAiCA,qCAAiE;CAChG,YAAY,QAAmB;AAC7B,QAAM,QAAQ,YAAY;;;;;;;;CAS5B,AAAS,WACP,IACA,MACA,SACkB;AAClB,SAAO,KAAK,OAAO,MAAqC,GAAG,KAAK,SAAS,GAAG,MAAM,MAAM,QAAQ;;;;;;CAOlG,AAAS,WAAW,IAAY,SAAoD;AAClF,SAAO,MAAM,WAAW,IAAI,QA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B,MAAM,cAAc,QAAQ,IAAI,WAAG,UAAU,MAAM,KAAK;AACxD,SAAO,KAAK,OAAO,IAAe,GAAG,KAAK,SAAS,GAAG,GAAG,SAAS,eAAe,QAAQ"}
1
+ {"version":3,"file":"MessagesApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/messages/MessagesApi.ts"],"sourcesContent":["import qs from 'qs'\nimport type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n Message,\n CreateMessagePayload,\n UpdateMessagePayload,\n ForwardMessagesPayload,\n ForwardMessagesResult,\n SendVcardsPayload,\n SendReactionPayload,\n MagicTextPayload,\n MagicTextResult,\n CheckSummaryPayload,\n CheckSummaryResult,\n BulkDestroyPayload,\n OutOfRangeResult,\n LoadAroundQuery,\n} from './types'\n\nexport class MessagesApi extends BaseCrudApi<Message, CreateMessagePayload, UpdateMessagePayload> {\n constructor(client: ApiClient) {\n super(client, '/messages')\n }\n\n /**\n * Edits the text of a message sent by the account, up to 15 minutes after it was sent. Sent as\n * `PATCH /messages/:id`. `contactId` is required: without it the route answers 500, and an\n * unknown or blocked contact answers 400 `The given data was invalid.` (the error comes in\n * `contactId`). So is `text`: `text: ''` alone answers 400 (`At least one field (text or file)\n * must be provided`), and a `text` with only spaces answers 400 `Text cannot be empty`. Only the\n * text is edited: `file` is not sent to the connection. A message received, or sent more than\n * 15 minutes ago, answers 403 `Cannot edit message`; an unknown message answers 404\n * `Message not found`. The message passes to the user who edited it.\n *\n * The message is answered once the edit is sent to the connection, before the connection\n * confirms it: read it again until `text` changes (`data.edited` is set to `true` when the\n * connection reports the edit). On WhatsApp Business and Telegram connections the route answers\n * the result of the edit job, not the message: read it again with `getById`.\n */\n override updateById(\n id: string,\n body: UpdateMessagePayload,\n headers?: Record<string, string>,\n ): Promise<Message> {\n return this.client.patch<Message, UpdateMessagePayload>(`${this.basePath}/${id}`, body, headers)\n }\n\n /**\n * @deprecated Not served: the backend has no DELETE /messages/:id, so this route answers 404.\n * Use {@link bulkDestroy}.\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<Message> {\n return super.deleteById(id, headers)\n }\n\n /** Forwards one or more messages to one or more contacts (max 20 messages to 5 contacts). */\n forward(\n body: ForwardMessagesPayload,\n headers?: Record<string, string>,\n ): Promise<ForwardMessagesResult> {\n return this.client.post<ForwardMessagesResult, ForwardMessagesPayload>(\n `${this.basePath}/forward`,\n body,\n headers,\n )\n }\n\n /** Revokes (soft-deletes) a sent message so it is no longer visible to the recipient. */\n revoke(id: string, headers?: Record<string, string>): Promise<Message> {\n return this.client.post<Message>(`${this.basePath}/${id}/revoke`, undefined, headers)\n }\n\n /** Removes a previously sent reaction from a message. */\n revokeReaction(id: string, headers?: Record<string, string>): Promise<boolean> {\n return this.client.put<boolean>(`${this.basePath}/${id}/revoke-reaction`, undefined, headers)\n }\n\n /** Sends one or more contacts as vCard messages to a given contact. */\n sendVcards(body: SendVcardsPayload, headers?: Record<string, string>): Promise<Message> {\n return this.client.post<Message, SendVcardsPayload>(\n `${this.basePath}/send-vcards`,\n body,\n headers,\n )\n }\n\n /** Sends an emoji reaction to a message. */\n sendReaction(\n id: string,\n body: SendReactionPayload,\n headers?: Record<string, string>,\n ): Promise<boolean> {\n return this.client.post<boolean, SendReactionPayload>(\n `${this.basePath}/${id}/send-reaction`,\n body,\n headers,\n )\n }\n\n /** Uses AI to rewrite or correct a message text with a given tone (e.g. \"correct\", \"professional\", \"casual\"). */\n magicText(body: MagicTextPayload, headers?: Record<string, string>): Promise<MagicTextResult> {\n return this.client.post<MagicTextResult, MagicTextPayload>(\n `${this.basePath}/magic-text`,\n body,\n headers,\n )\n }\n\n /** Checks whether an AI-generated summary already exists for a given ticket. */\n checkSummary(\n body: CheckSummaryPayload,\n headers?: Record<string, string>,\n ): Promise<CheckSummaryResult> {\n return this.client.post<CheckSummaryResult, CheckSummaryPayload>(\n `${this.basePath}/check-summary`,\n body,\n headers,\n )\n }\n\n /**\n * Deletes multiple messages matching the given where clause.\n * @permissions messages.destroy\n */\n bulkDestroy(body: BulkDestroyPayload, headers?: Record<string, string>): Promise<boolean> {\n return this.client.request<boolean, BulkDestroyPayload>(\n 'DELETE',\n `${this.basePath}/many`,\n body,\n headers,\n )\n }\n\n /**\n * Regenerates an existing AI summary: `id` is the id of the message of `type: 'summary'`. When\n * there is no such message (or the AI limit was reached) nothing is done and it still resolves\n * `'OK'`. To summarize the open ticket of a contact, use `ContactsApi.summarizeTicket`.\n */\n summarize(id: string, headers?: Record<string, string>): Promise<string> {\n return this.client.post<string>(`${this.basePath}/${id}/summarize`, undefined, headers)\n }\n\n /** Checks whether a message is out of the visible range (i.e. there are more than `limit` messages after it). */\n outOfRange(\n id: string,\n limit?: number,\n headers?: Record<string, string>,\n ): Promise<OutOfRangeResult> {\n const queryString = limit ? `?${qs.stringify({ limit })}` : ''\n return this.client.get<OutOfRangeResult>(\n `${this.basePath}/${id}/out-of-range${queryString}`,\n headers,\n )\n }\n\n /**\n * Re-downloads and syncs the file attachment for a message from the messaging service. Resolves\n * what the driver answers; an unknown message answers 500.\n */\n syncFile(id: string, headers?: Record<string, string>): Promise<unknown> {\n return this.client.post<unknown>(`${this.basePath}/${id}/sync-file`, undefined, headers)\n }\n\n /** Loads messages surrounding a target message (N before and N after), useful for jumping to a specific point in a conversation. */\n around(\n id: string,\n query?: LoadAroundQuery,\n headers?: Record<string, string>,\n ): Promise<Message[]> {\n const queryString = query ? `?${qs.stringify(query)}` : ''\n return this.client.get<Message[]>(`${this.basePath}/${id}/around${queryString}`, headers)\n }\n}\n"],"mappings":";;;;;;;AAoBA,IAAa,cAAb,cAAiCA,qCAAiE;CAChG,YAAY,QAAmB;AAC7B,QAAM,QAAQ,YAAY;;;;;;;;;;;;;;;;;CAkB5B,AAAS,WACP,IACA,MACA,SACkB;AAClB,SAAO,KAAK,OAAO,MAAqC,GAAG,KAAK,SAAS,GAAG,MAAM,MAAM,QAAQ;;;;;;CAOlG,AAAS,WAAW,IAAY,SA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Q;;;CAI1F,OACE,IACA,OACA,SACoB;EACpB,MAAM,cAAc,QAAQ,IAAI,WAAG,UAAU,MAAM,KAAK;AACxD,SAAO,KAAK,OAAO,IAAe,GAAG,KAAK,SAAS,GAAG,GAAG,SAAS,eAAe,QAAQ"}
@@ -4,10 +4,19 @@ import type { Message, CreateMessagePayload, UpdateMessagePayload, ForwardMessag
4
4
  export declare class MessagesApi extends BaseCrudApi<Message, CreateMessagePayload, UpdateMessagePayload> {
5
5
  constructor(client: ApiClient);
6
6
  /**
7
- * Edits the text (or the file) of a message sent by the account, up to 15 minutes after it was
8
- * sent (403 `Cannot edit message` after that). `contactId` is required (without it the route
9
- * answers 500), and `text` or `file` (400 without both). Sent as `PATCH /messages/:id`.
10
- * @permissions messages.update
7
+ * Edits the text of a message sent by the account, up to 15 minutes after it was sent. Sent as
8
+ * `PATCH /messages/:id`. `contactId` is required: without it the route answers 500, and an
9
+ * unknown or blocked contact answers 400 `The given data was invalid.` (the error comes in
10
+ * `contactId`). So is `text`: `text: ''` alone answers 400 (`At least one field (text or file)
11
+ * must be provided`), and a `text` with only spaces answers 400 `Text cannot be empty`. Only the
12
+ * text is edited: `file` is not sent to the connection. A message received, or sent more than
13
+ * 15 minutes ago, answers 403 `Cannot edit message`; an unknown message answers 404
14
+ * `Message not found`. The message passes to the user who edited it.
15
+ *
16
+ * The message is answered once the edit is sent to the connection, before the connection
17
+ * confirms it: read it again until `text` changes (`data.edited` is set to `true` when the
18
+ * connection reports the edit). On WhatsApp Business and Telegram connections the route answers
19
+ * the result of the edit job, not the message: read it again with `getById`.
11
20
  */
12
21
  updateById(id: string, body: UpdateMessagePayload, headers?: Record<string, string>): Promise<Message>;
13
22
  /**