@ikatec/digisac-api-sdk 4.10.0 → 4.12.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 (104) hide show
  1. package/dist/apis/categories/types.d.ts +1 -0
  2. package/dist/apis/categories/types.d.ts.map +1 -1
  3. package/dist/apis/contactBlockLists/ContactBlockListsApi.cjs +28 -0
  4. package/dist/apis/contactBlockLists/ContactBlockListsApi.cjs.map +1 -1
  5. package/dist/apis/contactBlockLists/ContactBlockListsApi.d.ts +24 -0
  6. package/dist/apis/contactBlockLists/ContactBlockListsApi.d.ts.map +1 -1
  7. package/dist/apis/contactBlockLists/ContactBlockListsApi.mjs +28 -0
  8. package/dist/apis/contactBlockLists/ContactBlockListsApi.mjs.map +1 -1
  9. package/dist/apis/contactBlockLists/types.d.ts +6 -1
  10. package/dist/apis/contactBlockLists/types.d.ts.map +1 -1
  11. package/dist/apis/contactBlockListsControls/ContactBlockListsControlsApi.cjs +31 -1
  12. package/dist/apis/contactBlockListsControls/ContactBlockListsControlsApi.cjs.map +1 -1
  13. package/dist/apis/contactBlockListsControls/ContactBlockListsControlsApi.d.ts +28 -2
  14. package/dist/apis/contactBlockListsControls/ContactBlockListsControlsApi.d.ts.map +1 -1
  15. package/dist/apis/contactBlockListsControls/ContactBlockListsControlsApi.mjs +31 -1
  16. package/dist/apis/contactBlockListsControls/ContactBlockListsControlsApi.mjs.map +1 -1
  17. package/dist/apis/contactBlockListsControls/types.d.ts +7 -0
  18. package/dist/apis/contactBlockListsControls/types.d.ts.map +1 -1
  19. package/dist/apis/distribution/DistributionApi.cjs +25 -0
  20. package/dist/apis/distribution/DistributionApi.cjs.map +1 -1
  21. package/dist/apis/distribution/DistributionApi.d.ts +20 -1
  22. package/dist/apis/distribution/DistributionApi.d.ts.map +1 -1
  23. package/dist/apis/distribution/DistributionApi.mjs +25 -0
  24. package/dist/apis/distribution/DistributionApi.mjs.map +1 -1
  25. package/dist/apis/distribution/types.d.ts +18 -1
  26. package/dist/apis/distribution/types.d.ts.map +1 -1
  27. package/dist/apis/integrations/IntegrationsApi.cjs +17 -0
  28. package/dist/apis/integrations/IntegrationsApi.cjs.map +1 -1
  29. package/dist/apis/integrations/IntegrationsApi.d.ts +15 -2
  30. package/dist/apis/integrations/IntegrationsApi.d.ts.map +1 -1
  31. package/dist/apis/integrations/IntegrationsApi.mjs +17 -0
  32. package/dist/apis/integrations/IntegrationsApi.mjs.map +1 -1
  33. package/dist/apis/integrations/types.d.ts +15 -6
  34. package/dist/apis/integrations/types.d.ts.map +1 -1
  35. package/dist/apis/interactiveMessages/InteractiveMessagesApi.cjs +15 -0
  36. package/dist/apis/interactiveMessages/InteractiveMessagesApi.cjs.map +1 -1
  37. package/dist/apis/interactiveMessages/InteractiveMessagesApi.d.ts +13 -0
  38. package/dist/apis/interactiveMessages/InteractiveMessagesApi.d.ts.map +1 -1
  39. package/dist/apis/interactiveMessages/InteractiveMessagesApi.mjs +15 -0
  40. package/dist/apis/interactiveMessages/InteractiveMessagesApi.mjs.map +1 -1
  41. package/dist/apis/interactiveMessages/types.d.ts +8 -2
  42. package/dist/apis/interactiveMessages/types.d.ts.map +1 -1
  43. package/dist/apis/me/MeApi.cjs +36 -29
  44. package/dist/apis/me/MeApi.cjs.map +1 -1
  45. package/dist/apis/me/MeApi.d.ts +33 -22
  46. package/dist/apis/me/MeApi.d.ts.map +1 -1
  47. package/dist/apis/me/MeApi.mjs +36 -29
  48. package/dist/apis/me/MeApi.mjs.map +1 -1
  49. package/dist/apis/me/types.d.ts +67 -4
  50. package/dist/apis/me/types.d.ts.map +1 -1
  51. package/dist/apis/transcripts/TranscriptsApi.cjs +12 -2
  52. package/dist/apis/transcripts/TranscriptsApi.cjs.map +1 -1
  53. package/dist/apis/transcripts/TranscriptsApi.d.ts +11 -5
  54. package/dist/apis/transcripts/TranscriptsApi.d.ts.map +1 -1
  55. package/dist/apis/transcripts/TranscriptsApi.mjs +12 -2
  56. package/dist/apis/transcripts/TranscriptsApi.mjs.map +1 -1
  57. package/dist/apis/transcripts/types.d.ts +4 -0
  58. package/dist/apis/transcripts/types.d.ts.map +1 -1
  59. package/dist/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.cjs +52 -0
  60. package/dist/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.cjs.map +1 -1
  61. package/dist/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.d.ts +45 -2
  62. package/dist/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.d.ts.map +1 -1
  63. package/dist/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.mjs +52 -0
  64. package/dist/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.mjs.map +1 -1
  65. package/dist/apis/whatsappBusinessTemplates/types.d.ts +34 -1
  66. package/dist/apis/whatsappBusinessTemplates/types.d.ts.map +1 -1
  67. package/dist/core/BaseCrudApi.cjs +3 -1
  68. package/dist/core/BaseCrudApi.cjs.map +1 -1
  69. package/dist/core/BaseCrudApi.d.ts +6 -4
  70. package/dist/core/BaseCrudApi.d.ts.map +1 -1
  71. package/dist/core/BaseCrudApi.mjs +3 -1
  72. package/dist/core/BaseCrudApi.mjs.map +1 -1
  73. package/dist/core/types.d.ts +1 -1
  74. package/dist/core/types.d.ts.map +1 -1
  75. package/package.json +1 -1
  76. package/src/apis/categories/types.ts +1 -0
  77. package/src/apis/contactBlockLists/ContactBlockListsApi.test.ts +57 -0
  78. package/src/apis/contactBlockLists/ContactBlockListsApi.ts +44 -0
  79. package/src/apis/contactBlockLists/types.ts +6 -1
  80. package/src/apis/contactBlockListsControls/ContactBlockListsControlsApi.test.ts +48 -0
  81. package/src/apis/contactBlockListsControls/ContactBlockListsControlsApi.ts +49 -2
  82. package/src/apis/contactBlockListsControls/types.ts +7 -0
  83. package/src/apis/distribution/DistributionApi.test.ts +65 -0
  84. package/src/apis/distribution/DistributionApi.ts +39 -1
  85. package/src/apis/distribution/types.ts +17 -1
  86. package/src/apis/integrations/IntegrationsApi.test.ts +42 -0
  87. package/src/apis/integrations/IntegrationsApi.ts +35 -2
  88. package/src/apis/integrations/types.ts +25 -6
  89. package/src/apis/interactiveMessages/InteractiveMessagesApi.test.ts +59 -0
  90. package/src/apis/interactiveMessages/InteractiveMessagesApi.ts +26 -0
  91. package/src/apis/interactiveMessages/types.ts +8 -2
  92. package/src/apis/me/MeApi.test.ts +44 -0
  93. package/src/apis/me/MeApi.ts +83 -28
  94. package/src/apis/me/types.ts +75 -4
  95. package/src/apis/payloads.test-d.ts +94 -2
  96. package/src/apis/transcripts/TranscriptsApi.test.ts +14 -21
  97. package/src/apis/transcripts/TranscriptsApi.ts +15 -6
  98. package/src/apis/transcripts/types.ts +4 -0
  99. package/src/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.test.ts +86 -0
  100. package/src/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.ts +75 -1
  101. package/src/apis/whatsappBusinessTemplates/types.ts +38 -1
  102. package/src/core/BaseCrudApi.test-d.ts +11 -1
  103. package/src/core/BaseCrudApi.ts +15 -6
  104. package/src/core/types.ts +4 -2
@@ -9,6 +9,7 @@ export type Category = {
9
9
  export type CreateCategoryPayload = {
10
10
  title: string;
11
11
  };
12
+ /** The backend requires `title` on the update too (400 without it). */
12
13
  export type UpdateCategoryPayload = {
13
14
  title?: string;
14
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/categories/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/categories/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,uEAAuE;AACvE,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
@@ -2,11 +2,39 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_core_BaseCrudApi = require('../../core/BaseCrudApi.cjs');
3
3
 
4
4
  //#region src/apis/contactBlockLists/ContactBlockListsApi.ts
5
+ /**
6
+ * Lists of numbers to block. A list is processed in the background after it is created (`status`
7
+ * `ready` → `done` or `error`). `getById` answers `null` for an unknown id.
8
+ */
5
9
  var ContactBlockListsApi = class extends require_core_BaseCrudApi.BaseCrudApi {
6
10
  constructor(client) {
7
11
  super(client, "/contact-block-lists");
8
12
  }
9
13
  /**
14
+ * Counts the block lists matching the query.
15
+ * @permissions contacts.view OR contacts.block
16
+ */
17
+ count(query, headers) {
18
+ return this.client.get(`${this.basePath}/count${this.toQueryString(query)}`, headers);
19
+ }
20
+ /**
21
+ * Creates a block list from a CSV uploaded with `FilesApi.createToUpload` (`attachedType:
22
+ * 'contact_block_list.file'` — with any other type the list is never processed). The CSV is
23
+ * comma-separated with the columns `ddi,number` (an empty DDI takes `defaultDDI`); invalid numbers are
24
+ * skipped. Resolves the list with `status: 'ready'`.
25
+ * @permissions contacts.view OR contacts.block
26
+ */
27
+ create(body, headers) {
28
+ return super.create(body, headers);
29
+ }
30
+ /**
31
+ * Updates a block list. `name` is required by the backend (400 without it). An unknown id answers 500.
32
+ * @permissions contacts.view OR contacts.update OR contacts.block
33
+ */
34
+ updateById(id, body, headers) {
35
+ return super.updateById(id, body, headers);
36
+ }
37
+ /**
10
38
  * Deletes a block list and its numbers. Resolves the text `'OK'`; a list being processed (or with
11
39
  * a block/unblock in progress) answers 500.
12
40
  * @permissions contacts.view OR contacts.destroy OR contacts.block
@@ -1 +1 @@
1
- {"version":3,"file":"ContactBlockListsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/contactBlockLists/ContactBlockListsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n ContactBlockList,\n CreateContactBlockListPayload,\n UpdateContactBlockListPayload,\n} from './types'\n\nexport class ContactBlockListsApi extends BaseCrudApi<\n ContactBlockList,\n CreateContactBlockListPayload,\n UpdateContactBlockListPayload,\n ListQuery<ContactBlockList>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/contact-block-lists')\n }\n\n /**\n * Deletes a block list and its numbers. Resolves the text `'OK'`; a list being processed (or with\n * a block/unblock in progress) answers 500.\n * @permissions contacts.view OR contacts.destroy OR contacts.block\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;;AASA,IAAa,uBAAb,cAA0CA,qCAMxC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,uBAAuB;;;;;;;CAQvC,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ"}
1
+ {"version":3,"file":"ContactBlockListsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/contactBlockLists/ContactBlockListsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n ContactBlockList,\n CreateContactBlockListPayload,\n UpdateContactBlockListPayload,\n} from './types'\n\n/**\n * Lists of numbers to block. A list is processed in the background after it is created (`status`\n * `ready` → `done` or `error`). `getById` answers `null` for an unknown id.\n */\nexport class ContactBlockListsApi extends BaseCrudApi<\n ContactBlockList,\n CreateContactBlockListPayload,\n UpdateContactBlockListPayload,\n ListQuery<ContactBlockList>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/contact-block-lists')\n }\n\n /**\n * Counts the block lists matching the query.\n * @permissions contacts.view OR contacts.block\n */\n count(\n query?: ListQuery<ContactBlockList>,\n headers?: Record<string, string>,\n ): Promise<{ count: number }> {\n return this.client.get<{ count: number }>(\n `${this.basePath}/count${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Creates a block list from a CSV uploaded with `FilesApi.createToUpload` (`attachedType:\n * 'contact_block_list.file'` — with any other type the list is never processed). The CSV is\n * comma-separated with the columns `ddi,number` (an empty DDI takes `defaultDDI`); invalid numbers are\n * skipped. Resolves the list with `status: 'ready'`.\n * @permissions contacts.view OR contacts.block\n */\n override create(\n body: CreateContactBlockListPayload,\n headers?: Record<string, string>,\n ): Promise<ContactBlockList> {\n return super.create(body, headers)\n }\n\n /**\n * Updates a block list. `name` is required by the backend (400 without it). An unknown id answers 500.\n * @permissions contacts.view OR contacts.update OR contacts.block\n */\n override updateById(\n id: string,\n body: UpdateContactBlockListPayload,\n headers?: Record<string, string>,\n ): Promise<ContactBlockList> {\n return super.updateById(id, body, headers)\n }\n\n /**\n * Deletes a block list and its numbers. Resolves the text `'OK'`; a list being processed (or with\n * a block/unblock in progress) answers 500.\n * @permissions contacts.view OR contacts.destroy OR contacts.block\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;;;;;;AAaA,IAAa,uBAAb,cAA0CA,qCAMxC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,uBAAuB;;;;;;CAOvC,MACE,OACA,SAC4B;AAC5B,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,QAAQ,KAAK,cAAc,MAAM,IAClD,QACD;;;;;;;;;CAUH,AAAS,OACP,MACA,SAC2B;AAC3B,SAAO,MAAM,OAAO,MAAM,QAAQ;;;;;;CAOpC,AAAS,WACP,IACA,MACA,SAC2B;AAC3B,SAAO,MAAM,WAAW,IAAI,MAAM,QAAQ;;;;;;;CAQ5C,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ"}
@@ -2,8 +2,32 @@ import type { ApiClient } from '../../core/ApiClient';
2
2
  import type { ListQuery } from '../../core/types';
3
3
  import { BaseCrudApi } from '../../core/BaseCrudApi';
4
4
  import type { ContactBlockList, CreateContactBlockListPayload, UpdateContactBlockListPayload } from './types';
5
+ /**
6
+ * Lists of numbers to block. A list is processed in the background after it is created (`status`
7
+ * `ready` → `done` or `error`). `getById` answers `null` for an unknown id.
8
+ */
5
9
  export declare class ContactBlockListsApi extends BaseCrudApi<ContactBlockList, CreateContactBlockListPayload, UpdateContactBlockListPayload, ListQuery<ContactBlockList>, 'OK'> {
6
10
  constructor(client: ApiClient);
11
+ /**
12
+ * Counts the block lists matching the query.
13
+ * @permissions contacts.view OR contacts.block
14
+ */
15
+ count(query?: ListQuery<ContactBlockList>, headers?: Record<string, string>): Promise<{
16
+ count: number;
17
+ }>;
18
+ /**
19
+ * Creates a block list from a CSV uploaded with `FilesApi.createToUpload` (`attachedType:
20
+ * 'contact_block_list.file'` — with any other type the list is never processed). The CSV is
21
+ * comma-separated with the columns `ddi,number` (an empty DDI takes `defaultDDI`); invalid numbers are
22
+ * skipped. Resolves the list with `status: 'ready'`.
23
+ * @permissions contacts.view OR contacts.block
24
+ */
25
+ create(body: CreateContactBlockListPayload, headers?: Record<string, string>): Promise<ContactBlockList>;
26
+ /**
27
+ * Updates a block list. `name` is required by the backend (400 without it). An unknown id answers 500.
28
+ * @permissions contacts.view OR contacts.update OR contacts.block
29
+ */
30
+ updateById(id: string, body: UpdateContactBlockListPayload, headers?: Record<string, string>): Promise<ContactBlockList>;
7
31
  /**
8
32
  * Deletes a block list and its numbers. Resolves the text `'OK'`; a list being processed (or with
9
33
  * a block/unblock in progress) answers 500.
@@ -1 +1 @@
1
- {"version":3,"file":"ContactBlockListsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/contactBlockLists/ContactBlockListsApi.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,gBAAgB,EAChB,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,SAAS,CAAA;AAEhB,qBAAa,oBAAqB,SAAQ,WAAW,CACnD,gBAAgB,EAChB,6BAA6B,EAC7B,6BAA6B,EAC7B,SAAS,CAAC,gBAAgB,CAAC,EAC3B,IAAI,CACL;gBACa,MAAM,EAAE,SAAS;IAI7B;;;;OAIG;IACM,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAGjF"}
1
+ {"version":3,"file":"ContactBlockListsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/contactBlockLists/ContactBlockListsApi.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,gBAAgB,EAChB,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,SAAS,CAAA;AAEhB;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,WAAW,CACnD,gBAAgB,EAChB,6BAA6B,EAC7B,6BAA6B,EAC7B,SAAS,CAAC,gBAAgB,CAAC,EAC3B,IAAI,CACL;gBACa,MAAM,EAAE,SAAS;IAI7B;;;OAGG;IACH,KAAK,CACH,KAAK,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,EACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAO7B;;;;;;OAMG;IACM,MAAM,CACb,IAAI,EAAE,6BAA6B,EACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,gBAAgB,CAAC;IAI5B;;;OAGG;IACM,UAAU,CACjB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,6BAA6B,EACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,gBAAgB,CAAC;IAI5B;;;;OAIG;IACM,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAGjF"}
@@ -1,11 +1,39 @@
1
1
  import { BaseCrudApi } from "../../core/BaseCrudApi.mjs";
2
2
 
3
3
  //#region src/apis/contactBlockLists/ContactBlockListsApi.ts
4
+ /**
5
+ * Lists of numbers to block. A list is processed in the background after it is created (`status`
6
+ * `ready` → `done` or `error`). `getById` answers `null` for an unknown id.
7
+ */
4
8
  var ContactBlockListsApi = class extends BaseCrudApi {
5
9
  constructor(client) {
6
10
  super(client, "/contact-block-lists");
7
11
  }
8
12
  /**
13
+ * Counts the block lists matching the query.
14
+ * @permissions contacts.view OR contacts.block
15
+ */
16
+ count(query, headers) {
17
+ return this.client.get(`${this.basePath}/count${this.toQueryString(query)}`, headers);
18
+ }
19
+ /**
20
+ * Creates a block list from a CSV uploaded with `FilesApi.createToUpload` (`attachedType:
21
+ * 'contact_block_list.file'` — with any other type the list is never processed). The CSV is
22
+ * comma-separated with the columns `ddi,number` (an empty DDI takes `defaultDDI`); invalid numbers are
23
+ * skipped. Resolves the list with `status: 'ready'`.
24
+ * @permissions contacts.view OR contacts.block
25
+ */
26
+ create(body, headers) {
27
+ return super.create(body, headers);
28
+ }
29
+ /**
30
+ * Updates a block list. `name` is required by the backend (400 without it). An unknown id answers 500.
31
+ * @permissions contacts.view OR contacts.update OR contacts.block
32
+ */
33
+ updateById(id, body, headers) {
34
+ return super.updateById(id, body, headers);
35
+ }
36
+ /**
9
37
  * Deletes a block list and its numbers. Resolves the text `'OK'`; a list being processed (or with
10
38
  * a block/unblock in progress) answers 500.
11
39
  * @permissions contacts.view OR contacts.destroy OR contacts.block
@@ -1 +1 @@
1
- {"version":3,"file":"ContactBlockListsApi.mjs","names":[],"sources":["../../../src/apis/contactBlockLists/ContactBlockListsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n ContactBlockList,\n CreateContactBlockListPayload,\n UpdateContactBlockListPayload,\n} from './types'\n\nexport class ContactBlockListsApi extends BaseCrudApi<\n ContactBlockList,\n CreateContactBlockListPayload,\n UpdateContactBlockListPayload,\n ListQuery<ContactBlockList>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/contact-block-lists')\n }\n\n /**\n * Deletes a block list and its numbers. Resolves the text `'OK'`; a list being processed (or with\n * a block/unblock in progress) answers 500.\n * @permissions contacts.view OR contacts.destroy OR contacts.block\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;AASA,IAAa,uBAAb,cAA0C,YAMxC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,uBAAuB;;;;;;;CAQvC,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ"}
1
+ {"version":3,"file":"ContactBlockListsApi.mjs","names":[],"sources":["../../../src/apis/contactBlockLists/ContactBlockListsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n ContactBlockList,\n CreateContactBlockListPayload,\n UpdateContactBlockListPayload,\n} from './types'\n\n/**\n * Lists of numbers to block. A list is processed in the background after it is created (`status`\n * `ready` → `done` or `error`). `getById` answers `null` for an unknown id.\n */\nexport class ContactBlockListsApi extends BaseCrudApi<\n ContactBlockList,\n CreateContactBlockListPayload,\n UpdateContactBlockListPayload,\n ListQuery<ContactBlockList>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/contact-block-lists')\n }\n\n /**\n * Counts the block lists matching the query.\n * @permissions contacts.view OR contacts.block\n */\n count(\n query?: ListQuery<ContactBlockList>,\n headers?: Record<string, string>,\n ): Promise<{ count: number }> {\n return this.client.get<{ count: number }>(\n `${this.basePath}/count${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Creates a block list from a CSV uploaded with `FilesApi.createToUpload` (`attachedType:\n * 'contact_block_list.file'` — with any other type the list is never processed). The CSV is\n * comma-separated with the columns `ddi,number` (an empty DDI takes `defaultDDI`); invalid numbers are\n * skipped. Resolves the list with `status: 'ready'`.\n * @permissions contacts.view OR contacts.block\n */\n override create(\n body: CreateContactBlockListPayload,\n headers?: Record<string, string>,\n ): Promise<ContactBlockList> {\n return super.create(body, headers)\n }\n\n /**\n * Updates a block list. `name` is required by the backend (400 without it). An unknown id answers 500.\n * @permissions contacts.view OR contacts.update OR contacts.block\n */\n override updateById(\n id: string,\n body: UpdateContactBlockListPayload,\n headers?: Record<string, string>,\n ): Promise<ContactBlockList> {\n return super.updateById(id, body, headers)\n }\n\n /**\n * Deletes a block list and its numbers. Resolves the text `'OK'`; a list being processed (or with\n * a block/unblock in progress) answers 500.\n * @permissions contacts.view OR contacts.destroy OR contacts.block\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;;;;;AAaA,IAAa,uBAAb,cAA0C,YAMxC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,uBAAuB;;;;;;CAOvC,MACE,OACA,SAC4B;AAC5B,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,QAAQ,KAAK,cAAc,MAAM,IAClD,QACD;;;;;;;;;CAUH,AAAS,OACP,MACA,SAC2B;AAC3B,SAAO,MAAM,OAAO,MAAM,QAAQ;;;;;;CAOpC,AAAS,WACP,IACA,MACA,SAC2B;AAC3B,SAAO,MAAM,WAAW,IAAI,MAAM,QAAQ;;;;;;;CAQ5C,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ"}
@@ -1,3 +1,4 @@
1
+ import type { File } from '../files/types';
1
2
  import type { User } from '../users/types';
2
3
  export type ContactBlockListStatus = 'ready' | 'processing' | 'done' | 'error';
3
4
  export type ContactBlockList = {
@@ -14,8 +15,10 @@ export type ContactBlockList = {
14
15
  updatedAt: string;
15
16
  deletedAt: string | null;
16
17
  user?: User;
18
+ /** The uploaded CSV (`include: ['importFile']`). */
19
+ importFile?: File;
17
20
  };
18
- export type ContactBlockListRelationships = 'user';
21
+ export type ContactBlockListRelationships = 'user' | 'importFile';
19
22
  export type CreateContactBlockListPayload = {
20
23
  name: string;
21
24
  /** ID of an uploaded CSV file (POST /files/create-to-upload, attachedType 'contact_block_list.file'). */
@@ -23,7 +26,9 @@ export type CreateContactBlockListPayload = {
23
26
  defaultDDI?: string;
24
27
  };
25
28
  export type UpdateContactBlockListPayload = {
29
+ /** Required by the backend (400 without it), even to change only `defaultDDI`. */
26
30
  name?: string;
31
+ /** @deprecated Ignored by the backend: the numbers come only from the CSV of the create. */
27
32
  contacts?: string[];
28
33
  defaultDDI?: string | null;
29
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/contactBlockLists/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,CAAA;AAE9E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,sBAAsB,CAAA;IAC9B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IAExB,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAA;AAElD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,yGAAyG;IACzG,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,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AE,MAAM,GAAG,IAAI,CAAA;CAC3B,CAAA"}
@@ -2,12 +2,42 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_core_BaseCrudApi = require('../../core/BaseCrudApi.cjs');
3
3
 
4
4
  //#region src/apis/contactBlockListsControls/ContactBlockListsControlsApi.ts
5
+ /**
6
+ * Block/unblock runs of block lists over connections. A run blocks (or unblocks) the contacts of the
7
+ * connection whose numbers are in the list, in the background, and blocking closes their open tickets.
8
+ * `getById` answers `null` for an unknown id.
9
+ */
5
10
  var ContactBlockListsControlsApi = class extends require_core_BaseCrudApi.BaseCrudApi {
6
11
  constructor(client) {
7
12
  super(client, "/contact-block-lists-controls");
8
13
  }
9
14
  /**
10
- * Deletes a block/unblock run. Resolves the text `'OK'`.
15
+ * Counts the runs matching the query.
16
+ * @permissions contacts.view OR contacts.block
17
+ */
18
+ count(query, headers) {
19
+ return this.client.get(`${this.basePath}/count${this.toQueryString(query)}`, headers);
20
+ }
21
+ /**
22
+ * Starts the runs: one per connection × list of the body, all with the same `reason`. Resolves with no
23
+ * body — find the runs with `getMany` by `reason`.
24
+ * @permissions contacts.view OR contacts.block
25
+ */
26
+ create(body, headers) {
27
+ return super.create(body, headers);
28
+ }
29
+ /**
30
+ * Updates a run. The backend requires `reason`, `servicesIds`, `contactBlockListsIds` and `action` (400
31
+ * without them), but ignores the ids, and a new `action` does not run anything again. An unknown id
32
+ * answers 500.
33
+ * @permissions contacts.view OR contacts.update OR contacts.block
34
+ */
35
+ updateById(id, body, headers) {
36
+ return super.updateById(id, body, headers);
37
+ }
38
+ /**
39
+ * Deletes a block/unblock run. Resolves the text `'OK'`; it does not undo the contacts already
40
+ * blocked or unblocked.
11
41
  * @permissions contacts.view OR contacts.destroy OR contacts.block
12
42
  */
13
43
  deleteById(id, headers) {
@@ -1 +1 @@
1
- {"version":3,"file":"ContactBlockListsControlsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/contactBlockListsControls/ContactBlockListsControlsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n ContactBlockListsControl,\n CreateContactBlockListsControlPayload,\n UpdateContactBlockListsControlPayload,\n} from './types'\n\nexport class ContactBlockListsControlsApi extends BaseCrudApi<\n ContactBlockListsControl,\n CreateContactBlockListsControlPayload,\n UpdateContactBlockListsControlPayload,\n ListQuery<ContactBlockListsControl>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/contact-block-lists-controls')\n }\n\n /**\n * Deletes a block/unblock run. Resolves the text `'OK'`.\n * @permissions contacts.view OR contacts.destroy OR contacts.block\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;;AASA,IAAa,+BAAb,cAAkDA,qCAMhD;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gCAAgC;;;;;;CAOhD,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ"}
1
+ {"version":3,"file":"ContactBlockListsControlsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/contactBlockListsControls/ContactBlockListsControlsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n ContactBlockListsControl,\n CreateContactBlockListsControlPayload,\n UpdateContactBlockListsControlPayload,\n} from './types'\n\n/**\n * Block/unblock runs of block lists over connections. A run blocks (or unblocks) the contacts of the\n * connection whose numbers are in the list, in the background, and blocking closes their open tickets.\n * `getById` answers `null` for an unknown id.\n */\nexport class ContactBlockListsControlsApi extends BaseCrudApi<\n ContactBlockListsControl,\n CreateContactBlockListsControlPayload,\n UpdateContactBlockListsControlPayload,\n ListQuery<ContactBlockListsControl>,\n 'OK',\n void\n> {\n constructor(client: ApiClient) {\n super(client, '/contact-block-lists-controls')\n }\n\n /**\n * Counts the runs matching the query.\n * @permissions contacts.view OR contacts.block\n */\n count(\n query?: ListQuery<ContactBlockListsControl>,\n headers?: Record<string, string>,\n ): Promise<{ count: number }> {\n return this.client.get<{ count: number }>(\n `${this.basePath}/count${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Starts the runs: one per connection × list of the body, all with the same `reason`. Resolves with no\n * body — find the runs with `getMany` by `reason`.\n * @permissions contacts.view OR contacts.block\n */\n override create(\n body: CreateContactBlockListsControlPayload,\n headers?: Record<string, string>,\n ): Promise<void> {\n return super.create(body, headers)\n }\n\n /**\n * Updates a run. The backend requires `reason`, `servicesIds`, `contactBlockListsIds` and `action` (400\n * without them), but ignores the ids, and a new `action` does not run anything again. An unknown id\n * answers 500.\n * @permissions contacts.view OR contacts.update OR contacts.block\n */\n override updateById(\n id: string,\n body: UpdateContactBlockListsControlPayload,\n headers?: Record<string, string>,\n ): Promise<ContactBlockListsControl> {\n return super.updateById(id, body, headers)\n }\n\n /**\n * Deletes a block/unblock run. Resolves the text `'OK'`; it does not undo the contacts already\n * blocked or unblocked.\n * @permissions contacts.view OR contacts.destroy OR contacts.block\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;;;;;;;AAcA,IAAa,+BAAb,cAAkDA,qCAOhD;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gCAAgC;;;;;;CAOhD,MACE,OACA,SAC4B;AAC5B,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,QAAQ,KAAK,cAAc,MAAM,IAClD,QACD;;;;;;;CAQH,AAAS,OACP,MACA,SACe;AACf,SAAO,MAAM,OAAO,MAAM,QAAQ;;;;;;;;CASpC,AAAS,WACP,IACA,MACA,SACmC;AACnC,SAAO,MAAM,WAAW,IAAI,MAAM,QAAQ;;;;;;;CAQ5C,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ"}
@@ -2,10 +2,36 @@ import type { ApiClient } from '../../core/ApiClient';
2
2
  import type { ListQuery } from '../../core/types';
3
3
  import { BaseCrudApi } from '../../core/BaseCrudApi';
4
4
  import type { ContactBlockListsControl, CreateContactBlockListsControlPayload, UpdateContactBlockListsControlPayload } from './types';
5
- export declare class ContactBlockListsControlsApi extends BaseCrudApi<ContactBlockListsControl, CreateContactBlockListsControlPayload, UpdateContactBlockListsControlPayload, ListQuery<ContactBlockListsControl>, 'OK'> {
5
+ /**
6
+ * Block/unblock runs of block lists over connections. A run blocks (or unblocks) the contacts of the
7
+ * connection whose numbers are in the list, in the background, and blocking closes their open tickets.
8
+ * `getById` answers `null` for an unknown id.
9
+ */
10
+ export declare class ContactBlockListsControlsApi extends BaseCrudApi<ContactBlockListsControl, CreateContactBlockListsControlPayload, UpdateContactBlockListsControlPayload, ListQuery<ContactBlockListsControl>, 'OK', void> {
6
11
  constructor(client: ApiClient);
7
12
  /**
8
- * Deletes a block/unblock run. Resolves the text `'OK'`.
13
+ * Counts the runs matching the query.
14
+ * @permissions contacts.view OR contacts.block
15
+ */
16
+ count(query?: ListQuery<ContactBlockListsControl>, headers?: Record<string, string>): Promise<{
17
+ count: number;
18
+ }>;
19
+ /**
20
+ * Starts the runs: one per connection × list of the body, all with the same `reason`. Resolves with no
21
+ * body — find the runs with `getMany` by `reason`.
22
+ * @permissions contacts.view OR contacts.block
23
+ */
24
+ create(body: CreateContactBlockListsControlPayload, headers?: Record<string, string>): Promise<void>;
25
+ /**
26
+ * Updates a run. The backend requires `reason`, `servicesIds`, `contactBlockListsIds` and `action` (400
27
+ * without them), but ignores the ids, and a new `action` does not run anything again. An unknown id
28
+ * answers 500.
29
+ * @permissions contacts.view OR contacts.update OR contacts.block
30
+ */
31
+ updateById(id: string, body: UpdateContactBlockListsControlPayload, headers?: Record<string, string>): Promise<ContactBlockListsControl>;
32
+ /**
33
+ * Deletes a block/unblock run. Resolves the text `'OK'`; it does not undo the contacts already
34
+ * blocked or unblocked.
9
35
  * @permissions contacts.view OR contacts.destroy OR contacts.block
10
36
  */
11
37
  deleteById(id: string, headers?: Record<string, string>): Promise<'OK'>;
@@ -1 +1 @@
1
- {"version":3,"file":"ContactBlockListsControlsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/contactBlockListsControls/ContactBlockListsControlsApi.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,wBAAwB,EACxB,qCAAqC,EACrC,qCAAqC,EACtC,MAAM,SAAS,CAAA;AAEhB,qBAAa,4BAA6B,SAAQ,WAAW,CAC3D,wBAAwB,EACxB,qCAAqC,EACrC,qCAAqC,EACrC,SAAS,CAAC,wBAAwB,CAAC,EACnC,IAAI,CACL;gBACa,MAAM,EAAE,SAAS;IAI7B;;;OAGG;IACM,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAGjF"}
1
+ {"version":3,"file":"ContactBlockListsControlsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/contactBlockListsControls/ContactBlockListsControlsApi.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,wBAAwB,EACxB,qCAAqC,EACrC,qCAAqC,EACtC,MAAM,SAAS,CAAA;AAEhB;;;;GAIG;AACH,qBAAa,4BAA6B,SAAQ,WAAW,CAC3D,wBAAwB,EACxB,qCAAqC,EACrC,qCAAqC,EACrC,SAAS,CAAC,wBAAwB,CAAC,EACnC,IAAI,EACJ,IAAI,CACL;gBACa,MAAM,EAAE,SAAS;IAI7B;;;OAGG;IACH,KAAK,CACH,KAAK,CAAC,EAAE,SAAS,CAAC,wBAAwB,CAAC,EAC3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAO7B;;;;OAIG;IACM,MAAM,CACb,IAAI,EAAE,qCAAqC,EAC3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,IAAI,CAAC;IAIhB;;;;;OAKG;IACM,UAAU,CACjB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,qCAAqC,EAC3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,wBAAwB,CAAC;IAIpC;;;;OAIG;IACM,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAGjF"}
@@ -1,12 +1,42 @@
1
1
  import { BaseCrudApi } from "../../core/BaseCrudApi.mjs";
2
2
 
3
3
  //#region src/apis/contactBlockListsControls/ContactBlockListsControlsApi.ts
4
+ /**
5
+ * Block/unblock runs of block lists over connections. A run blocks (or unblocks) the contacts of the
6
+ * connection whose numbers are in the list, in the background, and blocking closes their open tickets.
7
+ * `getById` answers `null` for an unknown id.
8
+ */
4
9
  var ContactBlockListsControlsApi = class extends BaseCrudApi {
5
10
  constructor(client) {
6
11
  super(client, "/contact-block-lists-controls");
7
12
  }
8
13
  /**
9
- * Deletes a block/unblock run. Resolves the text `'OK'`.
14
+ * Counts the runs matching the query.
15
+ * @permissions contacts.view OR contacts.block
16
+ */
17
+ count(query, headers) {
18
+ return this.client.get(`${this.basePath}/count${this.toQueryString(query)}`, headers);
19
+ }
20
+ /**
21
+ * Starts the runs: one per connection × list of the body, all with the same `reason`. Resolves with no
22
+ * body — find the runs with `getMany` by `reason`.
23
+ * @permissions contacts.view OR contacts.block
24
+ */
25
+ create(body, headers) {
26
+ return super.create(body, headers);
27
+ }
28
+ /**
29
+ * Updates a run. The backend requires `reason`, `servicesIds`, `contactBlockListsIds` and `action` (400
30
+ * without them), but ignores the ids, and a new `action` does not run anything again. An unknown id
31
+ * answers 500.
32
+ * @permissions contacts.view OR contacts.update OR contacts.block
33
+ */
34
+ updateById(id, body, headers) {
35
+ return super.updateById(id, body, headers);
36
+ }
37
+ /**
38
+ * Deletes a block/unblock run. Resolves the text `'OK'`; it does not undo the contacts already
39
+ * blocked or unblocked.
10
40
  * @permissions contacts.view OR contacts.destroy OR contacts.block
11
41
  */
12
42
  deleteById(id, headers) {
@@ -1 +1 @@
1
- {"version":3,"file":"ContactBlockListsControlsApi.mjs","names":[],"sources":["../../../src/apis/contactBlockListsControls/ContactBlockListsControlsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n ContactBlockListsControl,\n CreateContactBlockListsControlPayload,\n UpdateContactBlockListsControlPayload,\n} from './types'\n\nexport class ContactBlockListsControlsApi extends BaseCrudApi<\n ContactBlockListsControl,\n CreateContactBlockListsControlPayload,\n UpdateContactBlockListsControlPayload,\n ListQuery<ContactBlockListsControl>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/contact-block-lists-controls')\n }\n\n /**\n * Deletes a block/unblock run. Resolves the text `'OK'`.\n * @permissions contacts.view OR contacts.destroy OR contacts.block\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;AASA,IAAa,+BAAb,cAAkD,YAMhD;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gCAAgC;;;;;;CAOhD,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ"}
1
+ {"version":3,"file":"ContactBlockListsControlsApi.mjs","names":[],"sources":["../../../src/apis/contactBlockListsControls/ContactBlockListsControlsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n ContactBlockListsControl,\n CreateContactBlockListsControlPayload,\n UpdateContactBlockListsControlPayload,\n} from './types'\n\n/**\n * Block/unblock runs of block lists over connections. A run blocks (or unblocks) the contacts of the\n * connection whose numbers are in the list, in the background, and blocking closes their open tickets.\n * `getById` answers `null` for an unknown id.\n */\nexport class ContactBlockListsControlsApi extends BaseCrudApi<\n ContactBlockListsControl,\n CreateContactBlockListsControlPayload,\n UpdateContactBlockListsControlPayload,\n ListQuery<ContactBlockListsControl>,\n 'OK',\n void\n> {\n constructor(client: ApiClient) {\n super(client, '/contact-block-lists-controls')\n }\n\n /**\n * Counts the runs matching the query.\n * @permissions contacts.view OR contacts.block\n */\n count(\n query?: ListQuery<ContactBlockListsControl>,\n headers?: Record<string, string>,\n ): Promise<{ count: number }> {\n return this.client.get<{ count: number }>(\n `${this.basePath}/count${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Starts the runs: one per connection × list of the body, all with the same `reason`. Resolves with no\n * body — find the runs with `getMany` by `reason`.\n * @permissions contacts.view OR contacts.block\n */\n override create(\n body: CreateContactBlockListsControlPayload,\n headers?: Record<string, string>,\n ): Promise<void> {\n return super.create(body, headers)\n }\n\n /**\n * Updates a run. The backend requires `reason`, `servicesIds`, `contactBlockListsIds` and `action` (400\n * without them), but ignores the ids, and a new `action` does not run anything again. An unknown id\n * answers 500.\n * @permissions contacts.view OR contacts.update OR contacts.block\n */\n override updateById(\n id: string,\n body: UpdateContactBlockListsControlPayload,\n headers?: Record<string, string>,\n ): Promise<ContactBlockListsControl> {\n return super.updateById(id, body, headers)\n }\n\n /**\n * Deletes a block/unblock run. Resolves the text `'OK'`; it does not undo the contacts already\n * blocked or unblocked.\n * @permissions contacts.view OR contacts.destroy OR contacts.block\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;;;;;;AAcA,IAAa,+BAAb,cAAkD,YAOhD;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gCAAgC;;;;;;CAOhD,MACE,OACA,SAC4B;AAC5B,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,QAAQ,KAAK,cAAc,MAAM,IAClD,QACD;;;;;;;CAQH,AAAS,OACP,MACA,SACe;AACf,SAAO,MAAM,OAAO,MAAM,QAAQ;;;;;;;;CASpC,AAAS,WACP,IACA,MACA,SACmC;AACnC,SAAO,MAAM,WAAW,IAAI,MAAM,QAAQ;;;;;;;CAQ5C,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ"}
@@ -25,11 +25,18 @@ export type ContactBlockListsControl = {
25
25
  };
26
26
  export type ContactBlockListsControlRelationships = 'contactBlockList' | 'user' | 'service';
27
27
  export type CreateContactBlockListsControlPayload = {
28
+ /** Unique in the account (409 when another run already has it). */
28
29
  reason: string;
29
30
  servicesIds: string[];
30
31
  contactBlockListsIds: string[];
31
32
  action: ContactBlockListsControlAction;
33
+ /**
34
+ * Applies the opposite action to the contacts of the connection that are NOT in the list: with `block`, it
35
+ * unblocks them; with `unblock`, it blocks all of them.
36
+ */
37
+ revertExceptions?: boolean;
32
38
  };
39
+ /** The backend requires the four fields (400 without them); the ids are ignored. */
33
40
  export type UpdateContactBlockListsControlPayload = {
34
41
  reason?: string;
35
42
  servicesIds?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/contactBlockListsControls/types.ts"],"names":[],"mappings":"AAAA,O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AE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,qCAAqC,GAAG,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAAA;AAE3F,MAAM,MAAM,qCAAqC,GAAG;IAClD,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,oBAAoB,EAAE,MAAM,EAAE,CAAA;IAC9B,MAAM,EAAE,8BAA8B,CAAA;IACtC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,oFAAoF;AACpF,MAAM,MAAM,qCAAqC,GAAG;IAClD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC/B,MAAM,CAAC,EAAE,8BAA8B,CAAA;CACxC,CAAA"}
@@ -2,11 +2,36 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_core_BaseCrudApi = require('../../core/BaseCrudApi.cjs');
3
3
 
4
4
  //#region src/apis/distribution/DistributionApi.ts
5
+ /**
6
+ * Ticket distribution rules. `getById` answers `null` for an unknown id and always includes `departments` and
7
+ * `roles` (the query is ignored).
8
+ */
5
9
  var DistributionApi = class extends require_core_BaseCrudApi.BaseCrudApi {
6
10
  constructor(client) {
7
11
  super(client, "/distribution");
8
12
  }
9
13
  /**
14
+ * Creates a distribution. Resolves the distribution (without `departments`/`roles`), or no body
15
+ * (`undefined`) when `departments` is sent — find it by name with `getMany` in that case.
16
+ * @permissions distribution.create
17
+ */
18
+ create(body, headers) {
19
+ return super.create(body, headers);
20
+ }
21
+ /**
22
+ * Updates a distribution. The backend reads the id from the body, so it is sent there too. It replaces
23
+ * the links: omitting `roles` or `departments` clears them. Resolves the stored distribution (with
24
+ * `deletedAt`, without the links) or, when `departments` is sent, the updated departments. An unknown id
25
+ * answers 500.
26
+ * @permissions distribution.view OR distribution.update
27
+ */
28
+ updateById(id, body, headers) {
29
+ return this.client.put(`${this.basePath}/${id}`, {
30
+ ...body,
31
+ id
32
+ }, headers);
33
+ }
34
+ /**
10
35
  * Deletes a distribution. Resolves with no body, also for an unknown id (200).
11
36
  * @permissions distribution.view OR distribution.destroy
12
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"DistributionApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/distribution/DistributionApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { Distribution, CreateDistributionPayload, UpdateDistributionPayload } from './types'\n\nexport class DistributionApi extends BaseCrudApi<\n Distribution,\n CreateDistributionPayload,\n UpdateDistributionPayload,\n ListQuery<Distribution>,\n void\n> {\n constructor(client: ApiClient) {\n super(client, '/distribution')\n }\n\n /**\n * Deletes a distribution. Resolves with no body, also for an unknown id (200).\n * @permissions distribution.view OR distribution.destroy\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<void> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;;AAKA,IAAa,kBAAb,cAAqCA,qCAMnC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gBAAgB;;;;;;CAOhC,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ"}
1
+ {"version":3,"file":"DistributionApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/distribution/DistributionApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { Department } from '../departments/types'\nimport type { Distribution, CreateDistributionPayload, UpdateDistributionPayload } from './types'\n\n/**\n * Ticket distribution rules. `getById` answers `null` for an unknown id and always includes `departments` and\n * `roles` (the query is ignored).\n */\nexport class DistributionApi extends BaseCrudApi<\n Distribution,\n CreateDistributionPayload,\n UpdateDistributionPayload,\n ListQuery<Distribution>,\n void,\n Distribution | undefined,\n Distribution | Department[]\n> {\n constructor(client: ApiClient) {\n super(client, '/distribution')\n }\n\n /**\n * Creates a distribution. Resolves the distribution (without `departments`/`roles`), or no body\n * (`undefined`) when `departments` is sent — find it by name with `getMany` in that case.\n * @permissions distribution.create\n */\n override create(\n body: CreateDistributionPayload,\n headers?: Record<string, string>,\n ): Promise<Distribution | undefined> {\n return super.create(body, headers)\n }\n\n /**\n * Updates a distribution. The backend reads the id from the body, so it is sent there too. It replaces\n * the links: omitting `roles` or `departments` clears them. Resolves the stored distribution (with\n * `deletedAt`, without the links) or, when `departments` is sent, the updated departments. An unknown id\n * answers 500.\n * @permissions distribution.view OR distribution.update\n */\n override updateById(\n id: string,\n body: UpdateDistributionPayload,\n headers?: Record<string, string>,\n ): Promise<Distribution | Department[]> {\n return this.client.put<Distribution | Department[], UpdateDistributionPayload & { id: string }>(\n `${this.basePath}/${id}`,\n { ...body, id },\n headers,\n )\n }\n\n /**\n * Deletes a distribution. Resolves with no body, also for an unknown id (200).\n * @permissions distribution.view OR distribution.destroy\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<void> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;;;;;;AAUA,IAAa,kBAAb,cAAqCA,qCAQnC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gBAAgB;;;;;;;CAQhC,AAAS,OACP,MACA,SACmC;AACnC,SAAO,MAAM,OAAO,MAAM,QAAQ;;;;;;;;;CAUpC,AAAS,WACP,IACA,MACA,SACsC;AACtC,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,GAAG,MACpB;GAAE,GAAG;GAAM;GAAI,EACf,QACD;;;;;;CAOH,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ"}
@@ -1,9 +1,28 @@
1
1
  import type { ApiClient } from '../../core/ApiClient';
2
2
  import type { ListQuery } from '../../core/types';
3
3
  import { BaseCrudApi } from '../../core/BaseCrudApi';
4
+ import type { Department } from '../departments/types';
4
5
  import type { Distribution, CreateDistributionPayload, UpdateDistributionPayload } from './types';
5
- export declare class DistributionApi extends BaseCrudApi<Distribution, CreateDistributionPayload, UpdateDistributionPayload, ListQuery<Distribution>, void> {
6
+ /**
7
+ * Ticket distribution rules. `getById` answers `null` for an unknown id and always includes `departments` and
8
+ * `roles` (the query is ignored).
9
+ */
10
+ export declare class DistributionApi extends BaseCrudApi<Distribution, CreateDistributionPayload, UpdateDistributionPayload, ListQuery<Distribution>, void, Distribution | undefined, Distribution | Department[]> {
6
11
  constructor(client: ApiClient);
12
+ /**
13
+ * Creates a distribution. Resolves the distribution (without `departments`/`roles`), or no body
14
+ * (`undefined`) when `departments` is sent — find it by name with `getMany` in that case.
15
+ * @permissions distribution.create
16
+ */
17
+ create(body: CreateDistributionPayload, headers?: Record<string, string>): Promise<Distribution | undefined>;
18
+ /**
19
+ * Updates a distribution. The backend reads the id from the body, so it is sent there too. It replaces
20
+ * the links: omitting `roles` or `departments` clears them. Resolves the stored distribution (with
21
+ * `deletedAt`, without the links) or, when `departments` is sent, the updated departments. An unknown id
22
+ * answers 500.
23
+ * @permissions distribution.view OR distribution.update
24
+ */
25
+ updateById(id: string, body: UpdateDistributionPayload, headers?: Record<string, string>): Promise<Distribution | Department[]>;
7
26
  /**
8
27
  * Deletes a distribution. Resolves with no body, also for an unknown id (200).
9
28
  * @permissions distribution.view OR distribution.destroy
@@ -1 +1 @@
1
- {"version":3,"file":"DistributionApi.d.ts","sourceRoot":"","sources":["../../../src/apis/distribution/DistributionApi.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,EAAE,YAAY,EAAE,yBAAyB,E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AAM,CAAC,GAC/B,OAAO,CAAC,YAAY,GAAG,UAAU,EAAE,CAAC;IAQvC;;;OAGG;IACM,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAGjF"}
@@ -1,11 +1,36 @@
1
1
  import { BaseCrudApi } from "../../core/BaseCrudApi.mjs";
2
2
 
3
3
  //#region src/apis/distribution/DistributionApi.ts
4
+ /**
5
+ * Ticket distribution rules. `getById` answers `null` for an unknown id and always includes `departments` and
6
+ * `roles` (the query is ignored).
7
+ */
4
8
  var DistributionApi = class extends BaseCrudApi {
5
9
  constructor(client) {
6
10
  super(client, "/distribution");
7
11
  }
8
12
  /**
13
+ * Creates a distribution. Resolves the distribution (without `departments`/`roles`), or no body
14
+ * (`undefined`) when `departments` is sent — find it by name with `getMany` in that case.
15
+ * @permissions distribution.create
16
+ */
17
+ create(body, headers) {
18
+ return super.create(body, headers);
19
+ }
20
+ /**
21
+ * Updates a distribution. The backend reads the id from the body, so it is sent there too. It replaces
22
+ * the links: omitting `roles` or `departments` clears them. Resolves the stored distribution (with
23
+ * `deletedAt`, without the links) or, when `departments` is sent, the updated departments. An unknown id
24
+ * answers 500.
25
+ * @permissions distribution.view OR distribution.update
26
+ */
27
+ updateById(id, body, headers) {
28
+ return this.client.put(`${this.basePath}/${id}`, {
29
+ ...body,
30
+ id
31
+ }, headers);
32
+ }
33
+ /**
9
34
  * Deletes a distribution. Resolves with no body, also for an unknown id (200).
10
35
  * @permissions distribution.view OR distribution.destroy
11
36
  */
@@ -1 +1 @@
1
- {"version":3,"file":"DistributionApi.mjs","names":[],"sources":["../../../src/apis/distribution/DistributionApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { Distribution, CreateDistributionPayload, UpdateDistributionPayload } from './types'\n\nexport class DistributionApi extends BaseCrudApi<\n Distribution,\n CreateDistributionPayload,\n UpdateDistributionPayload,\n ListQuery<Distribution>,\n void\n> {\n constructor(client: ApiClient) {\n super(client, '/distribution')\n }\n\n /**\n * Deletes a distribution. Resolves with no body, also for an unknown id (200).\n * @permissions distribution.view OR distribution.destroy\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<void> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;AAKA,IAAa,kBAAb,cAAqC,YAMnC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gBAAgB;;;;;;CAOhC,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ"}
1
+ {"version":3,"file":"DistributionApi.mjs","names":[],"sources":["../../../src/apis/distribution/DistributionApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { Department } from '../departments/types'\nimport type { Distribution, CreateDistributionPayload, UpdateDistributionPayload } from './types'\n\n/**\n * Ticket distribution rules. `getById` answers `null` for an unknown id and always includes `departments` and\n * `roles` (the query is ignored).\n */\nexport class DistributionApi extends BaseCrudApi<\n Distribution,\n CreateDistributionPayload,\n UpdateDistributionPayload,\n ListQuery<Distribution>,\n void,\n Distribution | undefined,\n Distribution | Department[]\n> {\n constructor(client: ApiClient) {\n super(client, '/distribution')\n }\n\n /**\n * Creates a distribution. Resolves the distribution (without `departments`/`roles`), or no body\n * (`undefined`) when `departments` is sent — find it by name with `getMany` in that case.\n * @permissions distribution.create\n */\n override create(\n body: CreateDistributionPayload,\n headers?: Record<string, string>,\n ): Promise<Distribution | undefined> {\n return super.create(body, headers)\n }\n\n /**\n * Updates a distribution. The backend reads the id from the body, so it is sent there too. It replaces\n * the links: omitting `roles` or `departments` clears them. Resolves the stored distribution (with\n * `deletedAt`, without the links) or, when `departments` is sent, the updated departments. An unknown id\n * answers 500.\n * @permissions distribution.view OR distribution.update\n */\n override updateById(\n id: string,\n body: UpdateDistributionPayload,\n headers?: Record<string, string>,\n ): Promise<Distribution | Department[]> {\n return this.client.put<Distribution | Department[], UpdateDistributionPayload & { id: string }>(\n `${this.basePath}/${id}`,\n { ...body, id },\n headers,\n )\n }\n\n /**\n * Deletes a distribution. Resolves with no body, also for an unknown id (200).\n * @permissions distribution.view OR distribution.destroy\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<void> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;;;;;AAUA,IAAa,kBAAb,cAAqC,YAQnC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gBAAgB;;;;;;;CAQhC,AAAS,OACP,MACA,SACmC;AACnC,SAAO,MAAM,OAAO,MAAM,QAAQ;;;;;;;;;CAUpC,AAAS,WACP,IACA,MACA,SACsC;AACtC,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,GAAG,MACpB;GAAE,GAAG;GAAM;GAAI,EACf,QACD;;;;;;CAOH,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ"}
@@ -10,13 +10,18 @@ export type Distribution = {
10
10
  distributeQueue: boolean;
11
11
  accountId: string;
12
12
  archivedAt: string | null;
13
- deletedAt: string | null;
13
+ /** Only in the answer of `updateById` (the stored model, not transformed). */
14
+ deletedAt?: string | null;
14
15
  createdAt: string;
15
16
  updatedAt: string;
16
17
  departments?: Department[];
17
18
  roles?: Role[];
18
19
  };
19
20
  export type DistributionRelationships = 'departments' | 'roles';
21
+ /** A department or a role linked to a distribution (only the id is read). */
22
+ export type DistributionLink = {
23
+ id: string;
24
+ };
20
25
  export type CreateDistributionPayload = {
21
26
  name: string;
22
27
  maxNum: number;
@@ -24,7 +29,16 @@ export type CreateDistributionPayload = {
24
29
  timeToRedistribute?: number;
25
30
  redistributeAssignedTickets?: boolean;
26
31
  distributeQueue?: boolean;
32
+ /** An archived distribution is skipped by the distribution crons. */
33
+ archivedAt?: string | null;
34
+ /** Departments to distribute; a department has at most one distribution. */
35
+ departments?: DistributionLink[];
36
+ roles?: DistributionLink[];
27
37
  };
38
+ /**
39
+ * The update replaces the links: send `departments` and `roles` again to keep them — omitting them
40
+ * clears them.
41
+ */
28
42
  export type UpdateDistributionPayload = {
29
43
  name?: string;
30
44
  maxNum?: number;
@@ -32,5 +46,8 @@ export type UpdateDistributionPayload = {
32
46
  timeToRedistribute?: number;
33
47
  redistributeAssignedTickets?: boolean;
34
48
  distributeQueue?: boolean;
49
+ archivedAt?: string | null;
50
+ departments?: DistributionLink[];
51
+ roles?: DistributionLink[];
35
52
  };
36
53
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/distribution/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,kBAAkB,EAAE,MAAM,CAAA;IAC1B,eAAe,EAAE,OAAO,CAAA;IACxB,2BAA2B,EAAE,OAAO,CAAA;IACpC,eAAe,EAAE,OAAO,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;IAC1B,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;CACf,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,aAAa,GAAG,OAAO,CAAA;AAE/D,MAAM,MAAM,yBAA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MAAM,yBAAyB,GAAG,aAAa,GAAG,OAAO,CAAA;AAE/D,6EAA6E;AAC7E,MAAM,MAAM,gBAAgB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7C,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,eAAe,EAAE,OAAO,CAAA;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,2BAA2B,CAAC,EAAE,OAAO,CAAA;IACrC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,4EAA4E;IAC5E,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAChC,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAA;CAC3B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,2BAA2B,CAAC,EAAE,OAAO,CAAA;IACrC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAChC,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAA;CAC3B,CAAA"}
@@ -2,11 +2,28 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_core_BaseCrudApi = require('../../core/BaseCrudApi.cjs');
3
3
 
4
4
  //#region src/apis/integrations/IntegrationsApi.ts
5
+ /** Integrations of the account (buttons and events of the UI). `getById` answers `null` for an unknown id. */
5
6
  var IntegrationsApi = class extends require_core_BaseCrudApi.BaseCrudApi {
6
7
  constructor(client) {
7
8
  super(client, "/integrations");
8
9
  }
9
10
  /**
11
+ * Creates an integration. Resolves `{}` — also when the type is unique (`event_ticket_transfer`,
12
+ * `event_ticket_closed`), already exists in the account and nothing is created. Find the integration with
13
+ * `getMany` (e.g. by `text`).
14
+ * @permissions integrations.create
15
+ */
16
+ create(body, headers) {
17
+ return super.create(body, headers);
18
+ }
19
+ /**
20
+ * Updates an integration. Resolves `{}`; read it again with `getById`. An unknown id answers 500.
21
+ * @permissions integrations.view OR integrations.update
22
+ */
23
+ updateById(id, body, headers) {
24
+ return super.updateById(id, body, headers);
25
+ }
26
+ /**
10
27
  * Deletes an integration. Resolves the text `'OK'`; an unknown id answers 500.
11
28
  * @permissions integrations.view OR integrations.destroy
12
29
  */