@ikatec/digisac-api-sdk 4.12.0 → 4.14.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 (114) hide show
  1. package/dist/apis/absence/AbsenceApi.cjs +46 -2
  2. package/dist/apis/absence/AbsenceApi.cjs.map +1 -1
  3. package/dist/apis/absence/AbsenceApi.d.ts +38 -4
  4. package/dist/apis/absence/AbsenceApi.d.ts.map +1 -1
  5. package/dist/apis/absence/AbsenceApi.mjs +46 -2
  6. package/dist/apis/absence/AbsenceApi.mjs.map +1 -1
  7. package/dist/apis/absence/types.d.ts +51 -2
  8. package/dist/apis/absence/types.d.ts.map +1 -1
  9. package/dist/apis/activityLog/ActivityLogApi.cjs +10 -1
  10. package/dist/apis/activityLog/ActivityLogApi.cjs.map +1 -1
  11. package/dist/apis/activityLog/ActivityLogApi.d.ts +10 -3
  12. package/dist/apis/activityLog/ActivityLogApi.d.ts.map +1 -1
  13. package/dist/apis/activityLog/ActivityLogApi.mjs +10 -1
  14. package/dist/apis/activityLog/ActivityLogApi.mjs.map +1 -1
  15. package/dist/apis/activityLog/types.d.ts +48 -8
  16. package/dist/apis/activityLog/types.d.ts.map +1 -1
  17. package/dist/apis/creditMovements/CreditMovementsApi.cjs +31 -2
  18. package/dist/apis/creditMovements/CreditMovementsApi.cjs.map +1 -1
  19. package/dist/apis/creditMovements/CreditMovementsApi.d.ts +21 -3
  20. package/dist/apis/creditMovements/CreditMovementsApi.d.ts.map +1 -1
  21. package/dist/apis/creditMovements/CreditMovementsApi.mjs +31 -2
  22. package/dist/apis/creditMovements/CreditMovementsApi.mjs.map +1 -1
  23. package/dist/apis/creditMovements/types.d.ts +73 -2
  24. package/dist/apis/creditMovements/types.d.ts.map +1 -1
  25. package/dist/apis/knowledgeBase/KnowledgeBaseApi.cjs +27 -0
  26. package/dist/apis/knowledgeBase/KnowledgeBaseApi.cjs.map +1 -1
  27. package/dist/apis/knowledgeBase/KnowledgeBaseApi.d.ts +22 -1
  28. package/dist/apis/knowledgeBase/KnowledgeBaseApi.d.ts.map +1 -1
  29. package/dist/apis/knowledgeBase/KnowledgeBaseApi.mjs +27 -0
  30. package/dist/apis/knowledgeBase/KnowledgeBaseApi.mjs.map +1 -1
  31. package/dist/apis/knowledgeBase/types.d.ts +56 -2
  32. package/dist/apis/knowledgeBase/types.d.ts.map +1 -1
  33. package/dist/apis/knowledgeBaseItem/KnowledgeBaseItemApi.cjs +26 -0
  34. package/dist/apis/knowledgeBaseItem/KnowledgeBaseItemApi.cjs.map +1 -1
  35. package/dist/apis/knowledgeBaseItem/KnowledgeBaseItemApi.d.ts +24 -0
  36. package/dist/apis/knowledgeBaseItem/KnowledgeBaseItemApi.d.ts.map +1 -1
  37. package/dist/apis/knowledgeBaseItem/KnowledgeBaseItemApi.mjs +26 -0
  38. package/dist/apis/knowledgeBaseItem/KnowledgeBaseItemApi.mjs.map +1 -1
  39. package/dist/apis/knowledgeBaseItem/types.d.ts +23 -6
  40. package/dist/apis/knowledgeBaseItem/types.d.ts.map +1 -1
  41. package/dist/apis/notifications/NotificationsApi.cjs +50 -2
  42. package/dist/apis/notifications/NotificationsApi.cjs.map +1 -1
  43. package/dist/apis/notifications/NotificationsApi.d.ts +41 -3
  44. package/dist/apis/notifications/NotificationsApi.d.ts.map +1 -1
  45. package/dist/apis/notifications/NotificationsApi.mjs +50 -2
  46. package/dist/apis/notifications/NotificationsApi.mjs.map +1 -1
  47. package/dist/apis/notifications/types.d.ts +57 -8
  48. package/dist/apis/notifications/types.d.ts.map +1 -1
  49. package/dist/apis/serviceAccessManagement/ServiceAccessManagementApi.cjs.map +1 -1
  50. package/dist/apis/serviceAccessManagement/ServiceAccessManagementApi.d.ts +4 -1
  51. package/dist/apis/serviceAccessManagement/ServiceAccessManagementApi.d.ts.map +1 -1
  52. package/dist/apis/serviceAccessManagement/ServiceAccessManagementApi.mjs.map +1 -1
  53. package/dist/apis/serviceAccessManagement/types.d.ts +3 -0
  54. package/dist/apis/serviceAccessManagement/types.d.ts.map +1 -1
  55. package/dist/apis/services/ServicesApi.cjs +10 -0
  56. package/dist/apis/services/ServicesApi.cjs.map +1 -1
  57. package/dist/apis/services/ServicesApi.d.ts +9 -1
  58. package/dist/apis/services/ServicesApi.d.ts.map +1 -1
  59. package/dist/apis/services/ServicesApi.mjs +10 -0
  60. package/dist/apis/services/ServicesApi.mjs.map +1 -1
  61. package/dist/apis/services/types.d.ts +10 -0
  62. package/dist/apis/services/types.d.ts.map +1 -1
  63. package/dist/apis/stickerUsers/StickerUsersApi.cjs.map +1 -1
  64. package/dist/apis/stickerUsers/StickerUsersApi.d.ts +3 -1
  65. package/dist/apis/stickerUsers/StickerUsersApi.d.ts.map +1 -1
  66. package/dist/apis/stickerUsers/StickerUsersApi.mjs.map +1 -1
  67. package/dist/apis/stickerUsers/types.d.ts +4 -0
  68. package/dist/apis/stickerUsers/types.d.ts.map +1 -1
  69. package/dist/apis/stickers/StickersApi.cjs +27 -3
  70. package/dist/apis/stickers/StickersApi.cjs.map +1 -1
  71. package/dist/apis/stickers/StickersApi.d.ts +24 -4
  72. package/dist/apis/stickers/StickersApi.d.ts.map +1 -1
  73. package/dist/apis/stickers/StickersApi.mjs +27 -3
  74. package/dist/apis/stickers/StickersApi.mjs.map +1 -1
  75. package/dist/apis/stickers/types.d.ts +31 -4
  76. package/dist/apis/stickers/types.d.ts.map +1 -1
  77. package/dist/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.cjs +1 -2
  78. package/dist/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.cjs.map +1 -1
  79. package/dist/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.d.ts +1 -2
  80. package/dist/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.d.ts.map +1 -1
  81. package/dist/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.mjs +1 -2
  82. package/dist/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.mjs.map +1 -1
  83. package/package.json +1 -1
  84. package/src/apis/absence/AbsenceApi.test.ts +65 -0
  85. package/src/apis/absence/AbsenceApi.ts +77 -4
  86. package/src/apis/absence/types.ts +53 -2
  87. package/src/apis/activityLog/ActivityLogApi.test.ts +44 -0
  88. package/src/apis/activityLog/ActivityLogApi.ts +22 -3
  89. package/src/apis/activityLog/types.ts +47 -8
  90. package/src/apis/creditMovements/CreditMovementsApi.test.ts +88 -0
  91. package/src/apis/creditMovements/CreditMovementsApi.ts +73 -2
  92. package/src/apis/creditMovements/types.ts +74 -2
  93. package/src/apis/knowledgeBase/KnowledgeBaseApi.test.ts +54 -0
  94. package/src/apis/knowledgeBase/KnowledgeBaseApi.ts +61 -1
  95. package/src/apis/knowledgeBase/types.ts +62 -2
  96. package/src/apis/knowledgeBaseItem/KnowledgeBaseItemApi.test.ts +57 -0
  97. package/src/apis/knowledgeBaseItem/KnowledgeBaseItemApi.ts +45 -0
  98. package/src/apis/knowledgeBaseItem/types.ts +23 -6
  99. package/src/apis/me/MeApi.test.ts +1 -1
  100. package/src/apis/notifications/NotificationsApi.test.ts +74 -0
  101. package/src/apis/notifications/NotificationsApi.ts +88 -3
  102. package/src/apis/notifications/types.ts +68 -7
  103. package/src/apis/payloads.test-d.ts +66 -0
  104. package/src/apis/serviceAccessManagement/ServiceAccessManagementApi.ts +4 -1
  105. package/src/apis/serviceAccessManagement/types.ts +3 -0
  106. package/src/apis/services/ServicesApi.test.ts +11 -0
  107. package/src/apis/services/ServicesApi.ts +21 -0
  108. package/src/apis/services/types.ts +12 -0
  109. package/src/apis/stickerUsers/StickerUsersApi.ts +3 -1
  110. package/src/apis/stickerUsers/types.ts +4 -0
  111. package/src/apis/stickers/StickersApi.test.ts +58 -0
  112. package/src/apis/stickers/StickersApi.ts +46 -4
  113. package/src/apis/stickers/types.ts +32 -4
  114. package/src/apis/whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.ts +1 -2
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","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,UAAU,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IACnD,eAAe,EAAE,MAAM,CAAA;IACvB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,sGAAsG;AACtG,MAAM,MAAM,8BAA8B,GAAG;IAC3C,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB,CAAA"}
@@ -2,17 +2,65 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_core_BaseCrudApi = require('../../core/BaseCrudApi.cjs');
3
3
 
4
4
  //#region src/apis/notifications/NotificationsApi.ts
5
+ /**
6
+ * Notifications of the current user (all of the account with `notification.view.all`). Some types open a modal in the web app as soon as they arrive (`announcement`, `credits-90`,
7
+ * `credits-100`, `smart-summary`, `warn-service-reconnect`).
8
+ */
5
9
  var NotificationsApi = class extends require_core_BaseCrudApi.BaseCrudApi {
6
10
  constructor(client) {
7
11
  super(client, "/notifications");
8
12
  }
9
13
  /**
10
- * Deletes a notification. Resolves the text `'OK'`; an unknown id answers 500. The route checks
11
- * no permission.
14
+ * Deletes a notification. Resolves the text `'OK'`; an unknown id answers 500.
12
15
  */
13
16
  deleteById(id, headers) {
14
17
  return super.deleteById(id, headers);
15
18
  }
19
+ /**
20
+ * Counts the notifications the user sees: `{ count: { total, read, unread } }`, as TEXT.
21
+ */
22
+ count(headers) {
23
+ return this.client.post(`${this.basePath}/count`, void 0, headers);
24
+ }
25
+ /**
26
+ * Marks a notification as read for the current user and resolves the new counts. An unknown id answers
27
+ * 400 `Notification not found.`.
28
+ */
29
+ read(id, headers) {
30
+ return this.client.put(`${this.basePath}/${id}/read`, void 0, headers);
31
+ }
32
+ /**
33
+ * Marks a notification as unread for the current user and resolves the new counts. An unknown id
34
+ * answers 400 `Notification not found.`.
35
+ */
36
+ unread(id, headers) {
37
+ return this.client.put(`${this.basePath}/${id}/unread`, void 0, headers);
38
+ }
39
+ /**
40
+ * Marks the notifications of `ids` as read. Resolves with no body; a body that is not an array answers
41
+ * 500 `Body must be an array of notification IDs`.
42
+ */
43
+ readMany(ids, headers) {
44
+ return this.client.post(`${this.basePath}/read-many`, ids, headers);
45
+ }
46
+ /**
47
+ * Marks every notification the user sees as read (a GET that writes: it recreates the read receipts of
48
+ * the user) and resolves the counts, as numbers.
49
+ */
50
+ readAll(headers) {
51
+ return this.client.get(`${this.basePath}/read-all`, headers);
52
+ }
53
+ /** Clears the push badge counter of the current user. Resolves `{ success: true }`. */
54
+ resetBadgeCount(headers) {
55
+ return this.client.post(`${this.basePath}/reset-badge-count`, void 0, headers);
56
+ }
57
+ /**
58
+ * SENDS an announcement (`type: 'announcement'`, which opens a modal in the web app) to every user of
59
+ * the account, or only to the admins with `to: 'admin'`. Resolves `{ message: 'Notificações enviadas' }` before the notifications are created.
60
+ */
61
+ sendAll(body, headers) {
62
+ return this.client.post(`${this.basePath}/send-all`, body, headers);
63
+ }
16
64
  };
17
65
 
18
66
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/notifications/NotificationsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { Notification, CreateNotificationPayload, UpdateNotificationPayload } from './types'\n\nexport class NotificationsApi extends BaseCrudApi<\n Notification,\n CreateNotificationPayload,\n UpdateNotificationPayload,\n ListQuery<Notification>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/notifications')\n }\n\n /**\n * Deletes a notification. Resolves the text `'OK'`; an unknown id answers 500. The route checks\n * no permission.\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;;AAKA,IAAa,mBAAb,cAAsCA,qCAMpC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,iBAAiB;;;;;;CAOjC,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ"}
1
+ {"version":3,"file":"NotificationsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/notifications/NotificationsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n Notification,\n CreateNotificationPayload,\n UpdateNotificationPayload,\n NotificationCountsResponse,\n NotificationReadAllResponse,\n SendAllNotificationsPayload,\n} from './types'\n\n/**\n * Notifications of the current user (all of the account with `notification.view.all`). Some types open a modal in the web app as soon as they arrive (`announcement`, `credits-90`,\n * `credits-100`, `smart-summary`, `warn-service-reconnect`).\n */\nexport class NotificationsApi extends BaseCrudApi<\n Notification,\n CreateNotificationPayload,\n UpdateNotificationPayload,\n ListQuery<Notification>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/notifications')\n }\n\n /**\n * Deletes a notification. Resolves the text `'OK'`; an unknown id answers 500.\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Counts the notifications the user sees: `{ count: { total, read, unread } }`, as TEXT.\n */\n count(headers?: Record<string, string>): Promise<NotificationCountsResponse> {\n return this.client.post<NotificationCountsResponse>(\n `${this.basePath}/count`,\n undefined,\n headers,\n )\n }\n\n /**\n * Marks a notification as read for the current user and resolves the new counts. An unknown id answers\n * 400 `Notification not found.`.\n */\n read(id: string, headers?: Record<string, string>): Promise<NotificationCountsResponse> {\n return this.client.put<NotificationCountsResponse>(\n `${this.basePath}/${id}/read`,\n undefined,\n headers,\n )\n }\n\n /**\n * Marks a notification as unread for the current user and resolves the new counts. An unknown id\n * answers 400 `Notification not found.`.\n */\n unread(id: string, headers?: Record<string, string>): Promise<NotificationCountsResponse> {\n return this.client.put<NotificationCountsResponse>(\n `${this.basePath}/${id}/unread`,\n undefined,\n headers,\n )\n }\n\n /**\n * Marks the notifications of `ids` as read. Resolves with no body; a body that is not an array answers\n * 500 `Body must be an array of notification IDs`.\n */\n readMany(ids: string[], headers?: Record<string, string>): Promise<void> {\n return this.client.post<void, string[]>(`${this.basePath}/read-many`, ids, headers)\n }\n\n /**\n * Marks every notification the user sees as read (a GET that writes: it recreates the read receipts of\n * the user) and resolves the counts, as numbers.\n */\n readAll(headers?: Record<string, string>): Promise<NotificationReadAllResponse> {\n return this.client.get<NotificationReadAllResponse>(`${this.basePath}/read-all`, headers)\n }\n\n /** Clears the push badge counter of the current user. Resolves `{ success: true }`. */\n resetBadgeCount(headers?: Record<string, string>): Promise<{ success: true }> {\n return this.client.post<{ success: true }>(\n `${this.basePath}/reset-badge-count`,\n undefined,\n headers,\n )\n }\n\n /**\n * SENDS an announcement (`type: 'announcement'`, which opens a modal in the web app) to every user of\n * the account, or only to the admins with `to: 'admin'`. Resolves `{ message: 'Notificações enviadas' }` before the notifications are created.\n */\n sendAll(\n body: SendAllNotificationsPayload,\n headers?: Record<string, string>,\n ): Promise<{ message: string }> {\n return this.client.post<{ message: string }, SendAllNotificationsPayload>(\n `${this.basePath}/send-all`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;;;;;;AAgBA,IAAa,mBAAb,cAAsCA,qCAMpC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,iBAAiB;;;;;CAMjC,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;CAMtC,MAAM,SAAuE;AAC3E,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,SACjB,QACA,QACD;;;;;;CAOH,KAAK,IAAY,SAAuE;AACtF,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,GAAG,GAAG,QACvB,QACA,QACD;;;;;;CAOH,OAAO,IAAY,SAAuE;AACxF,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,GAAG,GAAG,UACvB,QACA,QACD;;;;;;CAOH,SAAS,KAAe,SAAiD;AACvE,SAAO,KAAK,OAAO,KAAqB,GAAG,KAAK,SAAS,aAAa,KAAK,QAAQ;;;;;;CAOrF,QAAQ,SAAwE;AAC9E,SAAO,KAAK,OAAO,IAAiC,GAAG,KAAK,SAAS,YAAY,QAAQ;;;CAI3F,gBAAgB,SAA8D;AAC5E,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,qBACjB,QACA,QACD;;;;;;CAOH,QACE,MACA,SAC8B;AAC9B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,YACjB,MACA,QACD"}
@@ -1,13 +1,51 @@
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 { Notification, CreateNotificationPayload, UpdateNotificationPayload } from './types';
4
+ import type { Notification, CreateNotificationPayload, UpdateNotificationPayload, NotificationCountsResponse, NotificationReadAllResponse, SendAllNotificationsPayload } from './types';
5
+ /**
6
+ * Notifications of the current user (all of the account with `notification.view.all`). Some types open a modal in the web app as soon as they arrive (`announcement`, `credits-90`,
7
+ * `credits-100`, `smart-summary`, `warn-service-reconnect`).
8
+ */
5
9
  export declare class NotificationsApi extends BaseCrudApi<Notification, CreateNotificationPayload, UpdateNotificationPayload, ListQuery<Notification>, 'OK'> {
6
10
  constructor(client: ApiClient);
7
11
  /**
8
- * Deletes a notification. Resolves the text `'OK'`; an unknown id answers 500. The route checks
9
- * no permission.
12
+ * Deletes a notification. Resolves the text `'OK'`; an unknown id answers 500.
10
13
  */
11
14
  deleteById(id: string, headers?: Record<string, string>): Promise<'OK'>;
15
+ /**
16
+ * Counts the notifications the user sees: `{ count: { total, read, unread } }`, as TEXT.
17
+ */
18
+ count(headers?: Record<string, string>): Promise<NotificationCountsResponse>;
19
+ /**
20
+ * Marks a notification as read for the current user and resolves the new counts. An unknown id answers
21
+ * 400 `Notification not found.`.
22
+ */
23
+ read(id: string, headers?: Record<string, string>): Promise<NotificationCountsResponse>;
24
+ /**
25
+ * Marks a notification as unread for the current user and resolves the new counts. An unknown id
26
+ * answers 400 `Notification not found.`.
27
+ */
28
+ unread(id: string, headers?: Record<string, string>): Promise<NotificationCountsResponse>;
29
+ /**
30
+ * Marks the notifications of `ids` as read. Resolves with no body; a body that is not an array answers
31
+ * 500 `Body must be an array of notification IDs`.
32
+ */
33
+ readMany(ids: string[], headers?: Record<string, string>): Promise<void>;
34
+ /**
35
+ * Marks every notification the user sees as read (a GET that writes: it recreates the read receipts of
36
+ * the user) and resolves the counts, as numbers.
37
+ */
38
+ readAll(headers?: Record<string, string>): Promise<NotificationReadAllResponse>;
39
+ /** Clears the push badge counter of the current user. Resolves `{ success: true }`. */
40
+ resetBadgeCount(headers?: Record<string, string>): Promise<{
41
+ success: true;
42
+ }>;
43
+ /**
44
+ * SENDS an announcement (`type: 'announcement'`, which opens a modal in the web app) to every user of
45
+ * the account, or only to the admins with `to: 'admin'`. Resolves `{ message: 'Notificações enviadas' }` before the notifications are created.
46
+ */
47
+ sendAll(body: SendAllNotificationsPayload, headers?: Record<string, string>): Promise<{
48
+ message: string;
49
+ }>;
12
50
  }
13
51
  //# sourceMappingURL=NotificationsApi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/notifications/NotificationsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD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AAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAQ5E;;;OAGG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAQvF;;;OAGG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAQzF;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxE;;;OAGG;IACH,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAI/E,uFAAuF;IACvF,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,CAAA;KAAE,CAAC;IAQ7E;;;OAGG;IACH,OAAO,CACL,IAAI,EAAE,2BAA2B,EACjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAOhC"}
@@ -1,17 +1,65 @@
1
1
  import { BaseCrudApi } from "../../core/BaseCrudApi.mjs";
2
2
 
3
3
  //#region src/apis/notifications/NotificationsApi.ts
4
+ /**
5
+ * Notifications of the current user (all of the account with `notification.view.all`). Some types open a modal in the web app as soon as they arrive (`announcement`, `credits-90`,
6
+ * `credits-100`, `smart-summary`, `warn-service-reconnect`).
7
+ */
4
8
  var NotificationsApi = class extends BaseCrudApi {
5
9
  constructor(client) {
6
10
  super(client, "/notifications");
7
11
  }
8
12
  /**
9
- * Deletes a notification. Resolves the text `'OK'`; an unknown id answers 500. The route checks
10
- * no permission.
13
+ * Deletes a notification. Resolves the text `'OK'`; an unknown id answers 500.
11
14
  */
12
15
  deleteById(id, headers) {
13
16
  return super.deleteById(id, headers);
14
17
  }
18
+ /**
19
+ * Counts the notifications the user sees: `{ count: { total, read, unread } }`, as TEXT.
20
+ */
21
+ count(headers) {
22
+ return this.client.post(`${this.basePath}/count`, void 0, headers);
23
+ }
24
+ /**
25
+ * Marks a notification as read for the current user and resolves the new counts. An unknown id answers
26
+ * 400 `Notification not found.`.
27
+ */
28
+ read(id, headers) {
29
+ return this.client.put(`${this.basePath}/${id}/read`, void 0, headers);
30
+ }
31
+ /**
32
+ * Marks a notification as unread for the current user and resolves the new counts. An unknown id
33
+ * answers 400 `Notification not found.`.
34
+ */
35
+ unread(id, headers) {
36
+ return this.client.put(`${this.basePath}/${id}/unread`, void 0, headers);
37
+ }
38
+ /**
39
+ * Marks the notifications of `ids` as read. Resolves with no body; a body that is not an array answers
40
+ * 500 `Body must be an array of notification IDs`.
41
+ */
42
+ readMany(ids, headers) {
43
+ return this.client.post(`${this.basePath}/read-many`, ids, headers);
44
+ }
45
+ /**
46
+ * Marks every notification the user sees as read (a GET that writes: it recreates the read receipts of
47
+ * the user) and resolves the counts, as numbers.
48
+ */
49
+ readAll(headers) {
50
+ return this.client.get(`${this.basePath}/read-all`, headers);
51
+ }
52
+ /** Clears the push badge counter of the current user. Resolves `{ success: true }`. */
53
+ resetBadgeCount(headers) {
54
+ return this.client.post(`${this.basePath}/reset-badge-count`, void 0, headers);
55
+ }
56
+ /**
57
+ * SENDS an announcement (`type: 'announcement'`, which opens a modal in the web app) to every user of
58
+ * the account, or only to the admins with `to: 'admin'`. Resolves `{ message: 'Notificações enviadas' }` before the notifications are created.
59
+ */
60
+ sendAll(body, headers) {
61
+ return this.client.post(`${this.basePath}/send-all`, body, headers);
62
+ }
15
63
  };
16
64
 
17
65
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsApi.mjs","names":[],"sources":["../../../src/apis/notifications/NotificationsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { Notification, CreateNotificationPayload, UpdateNotificationPayload } from './types'\n\nexport class NotificationsApi extends BaseCrudApi<\n Notification,\n CreateNotificationPayload,\n UpdateNotificationPayload,\n ListQuery<Notification>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/notifications')\n }\n\n /**\n * Deletes a notification. Resolves the text `'OK'`; an unknown id answers 500. The route checks\n * no permission.\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;AAKA,IAAa,mBAAb,cAAsC,YAMpC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,iBAAiB;;;;;;CAOjC,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ"}
1
+ {"version":3,"file":"NotificationsApi.mjs","names":[],"sources":["../../../src/apis/notifications/NotificationsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery } from '../../core/types'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n Notification,\n CreateNotificationPayload,\n UpdateNotificationPayload,\n NotificationCountsResponse,\n NotificationReadAllResponse,\n SendAllNotificationsPayload,\n} from './types'\n\n/**\n * Notifications of the current user (all of the account with `notification.view.all`). Some types open a modal in the web app as soon as they arrive (`announcement`, `credits-90`,\n * `credits-100`, `smart-summary`, `warn-service-reconnect`).\n */\nexport class NotificationsApi extends BaseCrudApi<\n Notification,\n CreateNotificationPayload,\n UpdateNotificationPayload,\n ListQuery<Notification>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/notifications')\n }\n\n /**\n * Deletes a notification. Resolves the text `'OK'`; an unknown id answers 500.\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Counts the notifications the user sees: `{ count: { total, read, unread } }`, as TEXT.\n */\n count(headers?: Record<string, string>): Promise<NotificationCountsResponse> {\n return this.client.post<NotificationCountsResponse>(\n `${this.basePath}/count`,\n undefined,\n headers,\n )\n }\n\n /**\n * Marks a notification as read for the current user and resolves the new counts. An unknown id answers\n * 400 `Notification not found.`.\n */\n read(id: string, headers?: Record<string, string>): Promise<NotificationCountsResponse> {\n return this.client.put<NotificationCountsResponse>(\n `${this.basePath}/${id}/read`,\n undefined,\n headers,\n )\n }\n\n /**\n * Marks a notification as unread for the current user and resolves the new counts. An unknown id\n * answers 400 `Notification not found.`.\n */\n unread(id: string, headers?: Record<string, string>): Promise<NotificationCountsResponse> {\n return this.client.put<NotificationCountsResponse>(\n `${this.basePath}/${id}/unread`,\n undefined,\n headers,\n )\n }\n\n /**\n * Marks the notifications of `ids` as read. Resolves with no body; a body that is not an array answers\n * 500 `Body must be an array of notification IDs`.\n */\n readMany(ids: string[], headers?: Record<string, string>): Promise<void> {\n return this.client.post<void, string[]>(`${this.basePath}/read-many`, ids, headers)\n }\n\n /**\n * Marks every notification the user sees as read (a GET that writes: it recreates the read receipts of\n * the user) and resolves the counts, as numbers.\n */\n readAll(headers?: Record<string, string>): Promise<NotificationReadAllResponse> {\n return this.client.get<NotificationReadAllResponse>(`${this.basePath}/read-all`, headers)\n }\n\n /** Clears the push badge counter of the current user. Resolves `{ success: true }`. */\n resetBadgeCount(headers?: Record<string, string>): Promise<{ success: true }> {\n return this.client.post<{ success: true }>(\n `${this.basePath}/reset-badge-count`,\n undefined,\n headers,\n )\n }\n\n /**\n * SENDS an announcement (`type: 'announcement'`, which opens a modal in the web app) to every user of\n * the account, or only to the admins with `to: 'admin'`. Resolves `{ message: 'Notificações enviadas' }` before the notifications are created.\n */\n sendAll(\n body: SendAllNotificationsPayload,\n headers?: Record<string, string>,\n ): Promise<{ message: string }> {\n return this.client.post<{ message: string }, SendAllNotificationsPayload>(\n `${this.basePath}/send-all`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;;;;;AAgBA,IAAa,mBAAb,cAAsC,YAMpC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,iBAAiB;;;;;CAMjC,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;CAMtC,MAAM,SAAuE;AAC3E,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,SACjB,QACA,QACD;;;;;;CAOH,KAAK,IAAY,SAAuE;AACtF,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,GAAG,GAAG,QACvB,QACA,QACD;;;;;;CAOH,OAAO,IAAY,SAAuE;AACxF,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,GAAG,GAAG,UACvB,QACA,QACD;;;;;;CAOH,SAAS,KAAe,SAAiD;AACvE,SAAO,KAAK,OAAO,KAAqB,GAAG,KAAK,SAAS,aAAa,KAAK,QAAQ;;;;;;CAOrF,QAAQ,SAAwE;AAC9E,SAAO,KAAK,OAAO,IAAiC,GAAG,KAAK,SAAS,YAAY,QAAQ;;;CAI3F,gBAAgB,SAA8D;AAC5E,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,qBACjB,QACA,QACD;;;;;;CAOH,QACE,MACA,SAC8B;AAC9B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,YACjB,MACA,QACD"}
@@ -1,42 +1,91 @@
1
1
  import type { Contact } from '../contacts/types';
2
2
  import type { Schedule } from '../schedule/types';
3
3
  import type { User } from '../users/types';
4
- export type NotificationType = 'schedule' | 'distribution' | 'info' | 'warn' | 'error' | 'announcement' | 'copilot' | 'undefined' | 'waba-health-warning' | 'waba-health-block';
5
- /** Present on pipeline-related notifications. */
4
+ export type NotificationType = 'schedule' | 'distribution' | 'info' | 'warn' | 'error' | 'announcement' | 'copilot' | 'undefined' | 'waba-health-warning' | 'waba-health-block' | 'kanban-board-initialized' | 'users-bulk-archive-blocked' | 'user-import' | 'credits-90' | 'credits-100' | 'smart-summary' | 'warn-service-reconnect';
5
+ /** Extra data of the notification; the pipeline notifications carry the pipeline ids. */
6
6
  export type NotificationConfig = {
7
- pipelineId: string;
8
- pipelineAutomationId: string;
7
+ pipelineId?: string;
8
+ pipelineAutomationId?: string;
9
+ [key: string]: unknown;
10
+ };
11
+ /** The read receipt of a notification for the current user. */
12
+ export type NotificationRead = {
13
+ id: string;
14
+ notificationId: string;
15
+ userId: string;
16
+ readAt: string | null;
17
+ createdAt: string;
18
+ updatedAt: string;
19
+ };
20
+ /**
21
+ * Counts of the notifications the user sees (all of the account with `notification.view.all`).
22
+ * They come as TEXT: the backend answers the `COUNT` of the database as is (e.g. `"43"`).
23
+ */
24
+ export type NotificationCounts = {
25
+ total: string;
26
+ read: string;
27
+ unread: string;
28
+ };
29
+ /** What `read`, `unread` and `count` answer. */
30
+ export type NotificationCountsResponse = {
31
+ count: NotificationCounts;
32
+ };
33
+ /** What `readAll` answers: the counts after marking everything as read, as numbers. */
34
+ export type NotificationReadAllResponse = {
35
+ total: number;
36
+ read: number;
37
+ unread: number;
38
+ };
39
+ /** The body of `sendAll`: `to: 'admin'` sends only to the admins; any other value sends to every user. */
40
+ export type SendAllNotificationsPayload = {
41
+ /** Up to 255 characters. */
42
+ text: string;
43
+ to: 'admin' | 'all' | (string & {});
44
+ image?: string;
9
45
  };
10
46
  export type Notification = {
11
47
  id: string;
12
48
  text: string;
13
49
  type: NotificationType | null;
14
- read: boolean;
50
+ /** `null` on the announcements of `sendAll` until they are read. */
51
+ read: boolean | null;
15
52
  image: string | null;
16
53
  label: string | null;
17
54
  config: NotificationConfig | null;
18
55
  attachedType: string | null;
56
+ /** @deprecated Not answered: the model has no such column, so the transformer never sends it. */
57
+ attachedId?: string | null;
58
+ /** @deprecated Not answered: the model has no such column, so the transformer never sends it. */
59
+ notificationReadId?: string | null;
19
60
  contactId: string | null;
20
61
  userId: string;
21
62
  accountId: string;
22
63
  scheduleId: string | null;
23
64
  createdAt: string;
24
65
  updatedAt: string;
25
- deletedAt: string | null;
66
+ /** @deprecated Not answered: the transformer of the backend does not send it. */
67
+ deletedAt?: string | null;
26
68
  user?: User;
27
69
  schedule?: Schedule | null;
70
+ /** @deprecated Not served: the model has no such association, so it never comes. */
28
71
  contact?: Contact | null;
72
+ /** The read receipts of the notification (a list: `[]` while it was never read). */
73
+ notificationRead?: NotificationRead[];
29
74
  };
30
- export type NotificationRelationships = 'user' | 'schedule' | 'contact';
75
+ /** The backend serves `user`, `schedule` and `notificationRead` (`contact` is never answered). */
76
+ export type NotificationRelationships = 'user' | 'schedule' | 'contact' | 'notificationRead';
31
77
  export type CreateNotificationPayload = {
78
+ /** Up to 255 characters. */
32
79
  text: string;
33
- userId: string;
80
+ /** Ignored: the backend creates the notification for the current user. */
81
+ userId?: string;
34
82
  type?: NotificationType;
35
83
  label?: string;
36
84
  config?: NotificationConfig;
37
85
  attachedType?: string;
38
86
  contactId?: string;
39
87
  scheduleId?: string;
88
+ image?: string;
40
89
  };
41
90
  export type UpdateNotificationPayload = {
42
91
  text?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/notifications/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,cAAc,GACd,MAAM,GACN,MAAM,GACN,OAAO,GACP,cAAc,GACd,SAAS,GACT,WAAW,GACX,qBAAqB,GACrB,mBAAmB,CAAA;AAEvB,iDAAiD;AACjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE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E,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/notifications/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,cAAc,GACd,MAAM,GACN,MAAM,GACN,OAAO,GACP,cAAc,GACd,SAAS,GACT,WAAW,GACX,qBAAqB,GACrB,mBAAmB,GACnB,0BAA0B,GAC1B,4BAA4B,GAC5B,aAAa,GACb,YAAY,GACZ,aAAa,GACb,eAAe,GACf,wBAAwB,CAAA;AAE5B,yFAAyF;AACzF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB,CAAA;AAED,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,gDAAgD;AAChD,MAAM,MAAM,0BAA0B,GAAG;IACvC,KA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IAAI,CAAA;IAC1B,oFAAoF;IACpF,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IACxB,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAA;CACtC,CAAA;AAED,kGAAkG;AAClG,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,kBAAkB,CAAA;AAE5F,MAAM,MAAM,yBAAyB,GAAG;IACtC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,kBAAkB,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceAccessManagementApi.cjs","names":["BaseApi"],"sources":["../../../src/apis/serviceAccessManagement/ServiceAccessManagementApi.ts"],"sourcesContent":["import { BaseApi } from '../../core/BaseApi'\nimport type { ListQuery, Paginated, HasGetMany } from '../../core/types'\nimport type { ServiceAccessManagement } from './types'\n\nexport class ServiceAccessManagementApi\n extends BaseApi\n implements HasGetMany<ServiceAccessManagement>\n{\n /** Returns a paginated list of which users have access to which services. */\n getMany(\n query: ListQuery<ServiceAccessManagement> & { paginate: false },\n headers?: Record<string, string>,\n ): Promise<ServiceAccessManagement[]>\n getMany(\n query?: ListQuery<ServiceAccessManagement> & { paginate?: true },\n headers?: Record<string, string>,\n ): Promise<Paginated<ServiceAccessManagement>>\n getMany(\n query?: ListQuery<ServiceAccessManagement>,\n headers?: Record<string, string>,\n ): Promise<Paginated<ServiceAccessManagement> | ServiceAccessManagement[]>\n getMany(\n query?: ListQuery<ServiceAccessManagement>,\n headers?: Record<string, string>,\n ): Promise<Paginated<ServiceAccessManagement> | ServiceAccessManagement[]> {\n const queryString = this.toQueryString(query)\n return this.client.get<Paginated<ServiceAccessManagement> | ServiceAccessManagement[]>(\n `/service-access-management${queryString}`,\n headers,\n )\n }\n}\n"],"mappings":";;;;AAIA,IAAa,6BAAb,cACUA,6BAEV;CAcE,QACE,OACA,SACyE;EACzE,MAAM,cAAc,KAAK,cAAc,MAAM;AAC7C,SAAO,KAAK,OAAO,IACjB,6BAA6B,eAC7B,QACD"}
1
+ {"version":3,"file":"ServiceAccessManagementApi.cjs","names":["BaseApi"],"sources":["../../../src/apis/serviceAccessManagement/ServiceAccessManagementApi.ts"],"sourcesContent":["import { BaseApi } from '../../core/BaseApi'\nimport type { ListQuery, Paginated, HasGetMany } from '../../core/types'\nimport type { ServiceAccessManagement } from './types'\n\nexport class ServiceAccessManagementApi\n extends BaseApi\n implements HasGetMany<ServiceAccessManagement>\n{\n /**\n * The connections denied to each user (one row per user × connection, written by\n * `POST /services/:id/access-management`), raw. Filter by the `serviceId` or `userId` you want.\n */\n getMany(\n query: ListQuery<ServiceAccessManagement> & { paginate: false },\n headers?: Record<string, string>,\n ): Promise<ServiceAccessManagement[]>\n getMany(\n query?: ListQuery<ServiceAccessManagement> & { paginate?: true },\n headers?: Record<string, string>,\n ): Promise<Paginated<ServiceAccessManagement>>\n getMany(\n query?: ListQuery<ServiceAccessManagement>,\n headers?: Record<string, string>,\n ): Promise<Paginated<ServiceAccessManagement> | ServiceAccessManagement[]>\n getMany(\n query?: ListQuery<ServiceAccessManagement>,\n headers?: Record<string, string>,\n ): Promise<Paginated<ServiceAccessManagement> | ServiceAccessManagement[]> {\n const queryString = this.toQueryString(query)\n return this.client.get<Paginated<ServiceAccessManagement> | ServiceAccessManagement[]>(\n `/service-access-management${queryString}`,\n headers,\n )\n }\n}\n"],"mappings":";;;;AAIA,IAAa,6BAAb,cACUA,6BAEV;CAiBE,QACE,OACA,SACyE;EACzE,MAAM,cAAc,KAAK,cAAc,MAAM;AAC7C,SAAO,KAAK,OAAO,IACjB,6BAA6B,eAC7B,QACD"}
@@ -2,7 +2,10 @@ import { BaseApi } from '../../core/BaseApi';
2
2
  import type { ListQuery, Paginated, HasGetMany } from '../../core/types';
3
3
  import type { ServiceAccessManagement } from './types';
4
4
  export declare class ServiceAccessManagementApi extends BaseApi implements HasGetMany<ServiceAccessManagement> {
5
- /** Returns a paginated list of which users have access to which services. */
5
+ /**
6
+ * The connections denied to each user (one row per user × connection, written by
7
+ * `POST /services/:id/access-management`), raw. Filter by the `serviceId` or `userId` you want.
8
+ */
6
9
  getMany(query: ListQuery<ServiceAccessManagement> & {
7
10
  paginate: false;
8
11
  }, headers?: Record<string, string>): Promise<ServiceAccessManagement[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceAccessManagementApi.d.ts","sourceRoot":"","sources":["../../../src/apis/serviceAccessManagement/ServiceAccessManagementApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAEtD,qBAAa,0BACX,SAAQ,OACR,YAAW,UAAU,CAAC,uBAAuB,CAAC;IAE9C,6EAA6E;IAC7E,OAAO,CACL,KAAK,EAAE,SAAS,CAAC,uBAAuB,CAAC,GAAG;QAAE,QAAQ,EAAE,KAAK,CAAA;KAAE,EAC/D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,uB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B,CAAC,CAAC;IAC9C,OAAO,CACL,KAAK,CAAC,EAAE,SAAS,CAAC,uBAAuB,CAAC,EAC1C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,SAAS,CAAC,uBAAuB,CAAC,GAAG,uBAAuB,EAAE,CAAC;CAW3E"}
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceAccessManagementApi.mjs","names":[],"sources":["../../../src/apis/serviceAccessManagement/ServiceAccessManagementApi.ts"],"sourcesContent":["import { BaseApi } from '../../core/BaseApi'\nimport type { ListQuery, Paginated, HasGetMany } from '../../core/types'\nimport type { ServiceAccessManagement } from './types'\n\nexport class ServiceAccessManagementApi\n extends BaseApi\n implements HasGetMany<ServiceAccessManagement>\n{\n /** Returns a paginated list of which users have access to which services. */\n getMany(\n query: ListQuery<ServiceAccessManagement> & { paginate: false },\n headers?: Record<string, string>,\n ): Promise<ServiceAccessManagement[]>\n getMany(\n query?: ListQuery<ServiceAccessManagement> & { paginate?: true },\n headers?: Record<string, string>,\n ): Promise<Paginated<ServiceAccessManagement>>\n getMany(\n query?: ListQuery<ServiceAccessManagement>,\n headers?: Record<string, string>,\n ): Promise<Paginated<ServiceAccessManagement> | ServiceAccessManagement[]>\n getMany(\n query?: ListQuery<ServiceAccessManagement>,\n headers?: Record<string, string>,\n ): Promise<Paginated<ServiceAccessManagement> | ServiceAccessManagement[]> {\n const queryString = this.toQueryString(query)\n return this.client.get<Paginated<ServiceAccessManagement> | ServiceAccessManagement[]>(\n `/service-access-management${queryString}`,\n headers,\n )\n }\n}\n"],"mappings":";;;AAIA,IAAa,6BAAb,cACU,QAEV;CAcE,QACE,OACA,SACyE;EACzE,MAAM,cAAc,KAAK,cAAc,MAAM;AAC7C,SAAO,KAAK,OAAO,IACjB,6BAA6B,eAC7B,QACD"}
1
+ {"version":3,"file":"ServiceAccessManagementApi.mjs","names":[],"sources":["../../../src/apis/serviceAccessManagement/ServiceAccessManagementApi.ts"],"sourcesContent":["import { BaseApi } from '../../core/BaseApi'\nimport type { ListQuery, Paginated, HasGetMany } from '../../core/types'\nimport type { ServiceAccessManagement } from './types'\n\nexport class ServiceAccessManagementApi\n extends BaseApi\n implements HasGetMany<ServiceAccessManagement>\n{\n /**\n * The connections denied to each user (one row per user × connection, written by\n * `POST /services/:id/access-management`), raw. Filter by the `serviceId` or `userId` you want.\n */\n getMany(\n query: ListQuery<ServiceAccessManagement> & { paginate: false },\n headers?: Record<string, string>,\n ): Promise<ServiceAccessManagement[]>\n getMany(\n query?: ListQuery<ServiceAccessManagement> & { paginate?: true },\n headers?: Record<string, string>,\n ): Promise<Paginated<ServiceAccessManagement>>\n getMany(\n query?: ListQuery<ServiceAccessManagement>,\n headers?: Record<string, string>,\n ): Promise<Paginated<ServiceAccessManagement> | ServiceAccessManagement[]>\n getMany(\n query?: ListQuery<ServiceAccessManagement>,\n headers?: Record<string, string>,\n ): Promise<Paginated<ServiceAccessManagement> | ServiceAccessManagement[]> {\n const queryString = this.toQueryString(query)\n return this.client.get<Paginated<ServiceAccessManagement> | ServiceAccessManagement[]>(\n `/service-access-management${queryString}`,\n headers,\n )\n }\n}\n"],"mappings":";;;AAIA,IAAa,6BAAb,cACU,QAEV;CAiBE,QACE,OACA,SACyE;EACzE,MAAM,cAAc,KAAK,cAAc,MAAM;AAC7C,SAAO,KAAK,OAAO,IACjB,6BAA6B,eAC7B,QACD"}
@@ -4,8 +4,11 @@ export type ServiceAccessManagement = {
4
4
  userId: string;
5
5
  serviceId: string;
6
6
  createdAt: string;
7
+ /** @deprecated Not served: the backend drops every include of this route. */
7
8
  user?: User;
9
+ /** @deprecated Not served: the backend drops every include of this route. */
8
10
  service?: Service;
9
11
  };
12
+ /** None is served: the backend drops every include of this route. */
10
13
  export type ServiceAccessManagementRelationships = 'user' | 'service';
11
14
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/serviceAccessManagement/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,oCAAoC,GAAG,MAAM,GAAG,SAAS,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/serviceAccessManagement/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,6EAA6E;IAC7E,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,qEAAqE;AACrE,MAAM,MAAM,oCAAoC,GAAG,MAAM,GAAG,SAAS,CAAA"}
@@ -82,6 +82,16 @@ var ServicesApi = class extends require_core_ArchivableCrudApi.ArchivableCrudApi
82
82
  restart(id, headers) {
83
83
  return this.client.post(`${this.basePath}/${id}/restart`, void 0, headers);
84
84
  }
85
+ /**
86
+ * Denies the connection to users (`deny: true`) or gives it back (`deny: false`); the admins are skipped. Denying
87
+ * transfers the open tickets of those users in the connection. The rows are read with
88
+ * `ServiceAccessManagementApi.getMany`. An unknown connection answers 404 `Service not found.`; a missing
89
+ * `userIds` or a `deny` that is not a boolean answers 400.
90
+ * @permissions users.update AND services.operate
91
+ */
92
+ accessManagement(id, body, headers) {
93
+ return this.client.post(`${this.basePath}/${id}/access-management`, body, headers);
94
+ }
85
95
  };
86
96
 
87
97
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ServicesApi.cjs","names":["ArchivableCrudApi"],"sources":["../../../src/apis/services/ServicesApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { ArchivableCrudApi } from '../../core/ArchivableCrudApi'\nimport type {\n Service,\n CreateServicePayload,\n ServiceLimits,\n UpdateServicePayload,\n ArchiveServicePayload,\n} from './types'\n\nexport class ServicesApi extends ArchivableCrudApi<\n Service,\n CreateServicePayload,\n UpdateServicePayload\n> {\n constructor(client: ApiClient) {\n super(client, '/services')\n }\n\n /**\n * Returns, for each connection type of the account plan, how many connections are used,\n * allowed and still available.\n * @permissions services.view\n */\n getLimits(headers?: Record<string, string>): Promise<ServiceLimits> {\n return this.client.get<ServiceLimits>(`${this.basePath}/limits`, headers)\n }\n\n /**\n * @deprecated The backend does not archive a connection by `PUT { archivedAt }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override archive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.archive(id, headers)\n }\n\n /**\n * @deprecated The backend does not restore a connection by `PUT { archivedAt: null }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override unarchive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.unarchive(id, headers)\n }\n\n /**\n * Archives (`archive: true`) or restores (`archive: false`) a connection through the route used\n * by the UI. Archiving shuts the connection down, closes its open tickets, marks its schedules\n * as done and cancels its campaigns; restoring checks the plan limit of the `type` (400 when it\n * is full).\n *\n * Resolves `{}` before the work is done (the route does not await it): poll `getById` until\n * `archivedAt` changes. Send the `type` of the connection: without it the request is never\n * answered.\n * @permissions services.disabled\n */\n archiveWithValidation(\n id: string,\n body: ArchiveServicePayload,\n headers?: Record<string, string>,\n ): Promise<Record<string, never>> {\n return this.client.post<Record<string, never>, ArchiveServicePayload>(\n `${this.basePath}/${id}/archive`,\n body,\n headers,\n )\n }\n\n /**\n * Takes the session of the connection over to this server. Resolves the text `'OK'`; an\n * unknown id answers 404 `Service not found.`.\n * @permissions services.operate\n */\n takeover(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/takeover`, undefined, headers)\n }\n\n /**\n * Logs the connection out of the messaging service. Resolves the text `'OK'`; an unknown id\n * answers 404 `Service not found.`.\n * @permissions services.operate\n */\n logout(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/logout`, undefined, headers)\n }\n\n /**\n * Shuts the connection down. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n shutdown(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/shutdown`, undefined, headers)\n }\n\n /**\n * Starts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n start(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/start`, undefined, headers)\n }\n\n /**\n * Restarts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n restart(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/restart`, undefined, headers)\n }\n}\n"],"mappings":";;;;AAUA,IAAa,cAAb,cAAiCA,iDAI/B;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,YAAY;;;;;;;CAQ5B,UAAU,SAA0D;AAClE,SAAO,KAAK,OAAO,IAAmB,GAAG,KAAK,SAAS,UAAU,QAAQ;;;;;;CAO3E,AAAS,QAAQ,IAAY,SAAoD;AAC/E,SAAO,MAAM,QAAQ,IAAI,QAAQ;;;;;;CAOnC,AAAS,UAAU,IAAY,SAAoD;AACjF,SAAO,MAAM,UAAU,IAAI,QAAQ;;;;;;;;;;;;;CAcrC,sBACE,IACA,MACA,SACgC;AAChC,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD;;;;;;;CAQH,SAAS,IAAY,SAAiD;AACpE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,YAAY,QAAW,QAAQ;;;;;;;CAQtF,OAAO,IAAY,SAAiD;AAClE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,UAAU,QAAW,QAAQ;;;;;;;CAQpF,SAAS,IAAY,SAAiD;AACpE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,YAAY,QAAW,QAAQ;;;;;;;CAQtF,MAAM,IAAY,SAAiD;AACjE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,SAAS,QAAW,QAAQ;;;;;;;CAQnF,QAAQ,IAAY,SAAiD;AACnE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,WAAW,QAAW,QAAQ"}
1
+ {"version":3,"file":"ServicesApi.cjs","names":["ArchivableCrudApi"],"sources":["../../../src/apis/services/ServicesApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { ArchivableCrudApi } from '../../core/ArchivableCrudApi'\nimport type {\n Service,\n CreateServicePayload,\n ServiceLimits,\n UpdateServicePayload,\n ArchiveServicePayload,\n ServiceAccessManagementPayload,\n ServiceAccessManagementResponse,\n} from './types'\n\nexport class ServicesApi extends ArchivableCrudApi<\n Service,\n CreateServicePayload,\n UpdateServicePayload\n> {\n constructor(client: ApiClient) {\n super(client, '/services')\n }\n\n /**\n * Returns, for each connection type of the account plan, how many connections are used,\n * allowed and still available.\n * @permissions services.view\n */\n getLimits(headers?: Record<string, string>): Promise<ServiceLimits> {\n return this.client.get<ServiceLimits>(`${this.basePath}/limits`, headers)\n }\n\n /**\n * @deprecated The backend does not archive a connection by `PUT { archivedAt }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override archive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.archive(id, headers)\n }\n\n /**\n * @deprecated The backend does not restore a connection by `PUT { archivedAt: null }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override unarchive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.unarchive(id, headers)\n }\n\n /**\n * Archives (`archive: true`) or restores (`archive: false`) a connection through the route used\n * by the UI. Archiving shuts the connection down, closes its open tickets, marks its schedules\n * as done and cancels its campaigns; restoring checks the plan limit of the `type` (400 when it\n * is full).\n *\n * Resolves `{}` before the work is done (the route does not await it): poll `getById` until\n * `archivedAt` changes. Send the `type` of the connection: without it the request is never\n * answered.\n * @permissions services.disabled\n */\n archiveWithValidation(\n id: string,\n body: ArchiveServicePayload,\n headers?: Record<string, string>,\n ): Promise<Record<string, never>> {\n return this.client.post<Record<string, never>, ArchiveServicePayload>(\n `${this.basePath}/${id}/archive`,\n body,\n headers,\n )\n }\n\n /**\n * Takes the session of the connection over to this server. Resolves the text `'OK'`; an\n * unknown id answers 404 `Service not found.`.\n * @permissions services.operate\n */\n takeover(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/takeover`, undefined, headers)\n }\n\n /**\n * Logs the connection out of the messaging service. Resolves the text `'OK'`; an unknown id\n * answers 404 `Service not found.`.\n * @permissions services.operate\n */\n logout(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/logout`, undefined, headers)\n }\n\n /**\n * Shuts the connection down. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n shutdown(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/shutdown`, undefined, headers)\n }\n\n /**\n * Starts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n start(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/start`, undefined, headers)\n }\n\n /**\n * Restarts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n restart(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/restart`, undefined, headers)\n }\n\n /**\n * Denies the connection to users (`deny: true`) or gives it back (`deny: false`); the admins are skipped. Denying\n * transfers the open tickets of those users in the connection. The rows are read with\n * `ServiceAccessManagementApi.getMany`. An unknown connection answers 404 `Service not found.`; a missing\n * `userIds` or a `deny` that is not a boolean answers 400.\n * @permissions users.update AND services.operate\n */\n accessManagement(\n id: string,\n body: ServiceAccessManagementPayload,\n headers?: Record<string, string>,\n ): Promise<ServiceAccessManagementResponse> {\n return this.client.post<ServiceAccessManagementResponse, ServiceAccessManagementPayload>(\n `${this.basePath}/${id}/access-management`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;;AAYA,IAAa,cAAb,cAAiCA,iDAI/B;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,YAAY;;;;;;;CAQ5B,UAAU,SAA0D;AAClE,SAAO,KAAK,OAAO,IAAmB,GAAG,KAAK,SAAS,UAAU,QAAQ;;;;;;CAO3E,AAAS,QAAQ,IAAY,SAAoD;AAC/E,SAAO,MAAM,QAAQ,IAAI,QAAQ;;;;;;CAOnC,AAAS,UAAU,IAAY,SAAoD;AACjF,SAAO,MAAM,UAAU,IAAI,QAAQ;;;;;;;;;;;;;CAcrC,sBACE,IACA,MACA,SACgC;AAChC,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD;;;;;;;CAQH,SAAS,IAAY,SAAiD;AACpE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,YAAY,QAAW,QAAQ;;;;;;;CAQtF,OAAO,IAAY,SAAiD;AAClE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,UAAU,QAAW,QAAQ;;;;;;;CAQpF,SAAS,IAAY,SAAiD;AACpE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,YAAY,QAAW,QAAQ;;;;;;;CAQtF,MAAM,IAAY,SAAiD;AACjE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,SAAS,QAAW,QAAQ;;;;;;;CAQnF,QAAQ,IAAY,SAAiD;AACnE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,WAAW,QAAW,QAAQ;;;;;;;;;CAUrF,iBACE,IACA,MACA,SAC0C;AAC1C,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,GAAG,GAAG,qBACvB,MACA,QACD"}
@@ -1,6 +1,6 @@
1
1
  import type { ApiClient } from '../../core/ApiClient';
2
2
  import { ArchivableCrudApi } from '../../core/ArchivableCrudApi';
3
- import type { Service, CreateServicePayload, ServiceLimits, UpdateServicePayload, ArchiveServicePayload } from './types';
3
+ import type { Service, CreateServicePayload, ServiceLimits, UpdateServicePayload, ArchiveServicePayload, ServiceAccessManagementPayload, ServiceAccessManagementResponse } from './types';
4
4
  export declare class ServicesApi extends ArchivableCrudApi<Service, CreateServicePayload, UpdateServicePayload> {
5
5
  constructor(client: ApiClient);
6
6
  /**
@@ -61,5 +61,13 @@ export declare class ServicesApi extends ArchivableCrudApi<Service, CreateServic
61
61
  * @permissions services.operate
62
62
  */
63
63
  restart(id: string, headers?: Record<string, string>): Promise<'OK'>;
64
+ /**
65
+ * Denies the connection to users (`deny: true`) or gives it back (`deny: false`); the admins are skipped. Denying
66
+ * transfers the open tickets of those users in the connection. The rows are read with
67
+ * `ServiceAccessManagementApi.getMany`. An unknown connection answers 404 `Service not found.`; a missing
68
+ * `userIds` or a `deny` that is not a boolean answers 400.
69
+ * @permissions users.update AND services.operate
70
+ */
71
+ accessManagement(id: string, body: ServiceAccessManagementPayload, headers?: Record<string, string>): Promise<ServiceAccessManagementResponse>;
64
72
  }
65
73
  //# sourceMappingURL=ServicesApi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ServicesApi.d.ts","sourceRoot":"","sources":["../../../src/apis/services/ServicesApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,KAAK,EACV,OAAO,EACP,oBAAoB,EACpB,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAEhB,qBAAa,WAAY,SAAQ,iBAAiB,CAChD,OAAO,EACP,oBAAoB,EACpB,oBAAoB,CACrB;gBACa,MAAM,EAAE,SAAS;IAI7B;;;;OAIG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAInE;;;OAGG;IACM,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIhF;;;OAGG;IACM,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIlF;;;;;;;;;;OAUG;IACH,qBAAqB,CACnB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,qBAAqB,EAC3B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,MAA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M,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE;;;;;;OAMG;IACH,gBAAgB,CACd,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,8BAA8B,EACpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,+BAA+B,CAAC;CAO5C"}
@@ -81,6 +81,16 @@ var ServicesApi = class extends ArchivableCrudApi {
81
81
  restart(id, headers) {
82
82
  return this.client.post(`${this.basePath}/${id}/restart`, void 0, headers);
83
83
  }
84
+ /**
85
+ * Denies the connection to users (`deny: true`) or gives it back (`deny: false`); the admins are skipped. Denying
86
+ * transfers the open tickets of those users in the connection. The rows are read with
87
+ * `ServiceAccessManagementApi.getMany`. An unknown connection answers 404 `Service not found.`; a missing
88
+ * `userIds` or a `deny` that is not a boolean answers 400.
89
+ * @permissions users.update AND services.operate
90
+ */
91
+ accessManagement(id, body, headers) {
92
+ return this.client.post(`${this.basePath}/${id}/access-management`, body, headers);
93
+ }
84
94
  };
85
95
 
86
96
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ServicesApi.mjs","names":[],"sources":["../../../src/apis/services/ServicesApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { ArchivableCrudApi } from '../../core/ArchivableCrudApi'\nimport type {\n Service,\n CreateServicePayload,\n ServiceLimits,\n UpdateServicePayload,\n ArchiveServicePayload,\n} from './types'\n\nexport class ServicesApi extends ArchivableCrudApi<\n Service,\n CreateServicePayload,\n UpdateServicePayload\n> {\n constructor(client: ApiClient) {\n super(client, '/services')\n }\n\n /**\n * Returns, for each connection type of the account plan, how many connections are used,\n * allowed and still available.\n * @permissions services.view\n */\n getLimits(headers?: Record<string, string>): Promise<ServiceLimits> {\n return this.client.get<ServiceLimits>(`${this.basePath}/limits`, headers)\n }\n\n /**\n * @deprecated The backend does not archive a connection by `PUT { archivedAt }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override archive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.archive(id, headers)\n }\n\n /**\n * @deprecated The backend does not restore a connection by `PUT { archivedAt: null }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override unarchive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.unarchive(id, headers)\n }\n\n /**\n * Archives (`archive: true`) or restores (`archive: false`) a connection through the route used\n * by the UI. Archiving shuts the connection down, closes its open tickets, marks its schedules\n * as done and cancels its campaigns; restoring checks the plan limit of the `type` (400 when it\n * is full).\n *\n * Resolves `{}` before the work is done (the route does not await it): poll `getById` until\n * `archivedAt` changes. Send the `type` of the connection: without it the request is never\n * answered.\n * @permissions services.disabled\n */\n archiveWithValidation(\n id: string,\n body: ArchiveServicePayload,\n headers?: Record<string, string>,\n ): Promise<Record<string, never>> {\n return this.client.post<Record<string, never>, ArchiveServicePayload>(\n `${this.basePath}/${id}/archive`,\n body,\n headers,\n )\n }\n\n /**\n * Takes the session of the connection over to this server. Resolves the text `'OK'`; an\n * unknown id answers 404 `Service not found.`.\n * @permissions services.operate\n */\n takeover(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/takeover`, undefined, headers)\n }\n\n /**\n * Logs the connection out of the messaging service. Resolves the text `'OK'`; an unknown id\n * answers 404 `Service not found.`.\n * @permissions services.operate\n */\n logout(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/logout`, undefined, headers)\n }\n\n /**\n * Shuts the connection down. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n shutdown(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/shutdown`, undefined, headers)\n }\n\n /**\n * Starts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n start(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/start`, undefined, headers)\n }\n\n /**\n * Restarts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n restart(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/restart`, undefined, headers)\n }\n}\n"],"mappings":";;;AAUA,IAAa,cAAb,cAAiC,kBAI/B;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,YAAY;;;;;;;CAQ5B,UAAU,SAA0D;AAClE,SAAO,KAAK,OAAO,IAAmB,GAAG,KAAK,SAAS,UAAU,QAAQ;;;;;;CAO3E,AAAS,QAAQ,IAAY,SAAoD;AAC/E,SAAO,MAAM,QAAQ,IAAI,QAAQ;;;;;;CAOnC,AAAS,UAAU,IAAY,SAAoD;AACjF,SAAO,MAAM,UAAU,IAAI,QAAQ;;;;;;;;;;;;;CAcrC,sBACE,IACA,MACA,SACgC;AAChC,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD;;;;;;;CAQH,SAAS,IAAY,SAAiD;AACpE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,YAAY,QAAW,QAAQ;;;;;;;CAQtF,OAAO,IAAY,SAAiD;AAClE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,UAAU,QAAW,QAAQ;;;;;;;CAQpF,SAAS,IAAY,SAAiD;AACpE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,YAAY,QAAW,QAAQ;;;;;;;CAQtF,MAAM,IAAY,SAAiD;AACjE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,SAAS,QAAW,QAAQ;;;;;;;CAQnF,QAAQ,IAAY,SAAiD;AACnE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,WAAW,QAAW,QAAQ"}
1
+ {"version":3,"file":"ServicesApi.mjs","names":[],"sources":["../../../src/apis/services/ServicesApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { ArchivableCrudApi } from '../../core/ArchivableCrudApi'\nimport type {\n Service,\n CreateServicePayload,\n ServiceLimits,\n UpdateServicePayload,\n ArchiveServicePayload,\n ServiceAccessManagementPayload,\n ServiceAccessManagementResponse,\n} from './types'\n\nexport class ServicesApi extends ArchivableCrudApi<\n Service,\n CreateServicePayload,\n UpdateServicePayload\n> {\n constructor(client: ApiClient) {\n super(client, '/services')\n }\n\n /**\n * Returns, for each connection type of the account plan, how many connections are used,\n * allowed and still available.\n * @permissions services.view\n */\n getLimits(headers?: Record<string, string>): Promise<ServiceLimits> {\n return this.client.get<ServiceLimits>(`${this.basePath}/limits`, headers)\n }\n\n /**\n * @deprecated The backend does not archive a connection by `PUT { archivedAt }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override archive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.archive(id, headers)\n }\n\n /**\n * @deprecated The backend does not restore a connection by `PUT { archivedAt: null }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override unarchive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.unarchive(id, headers)\n }\n\n /**\n * Archives (`archive: true`) or restores (`archive: false`) a connection through the route used\n * by the UI. Archiving shuts the connection down, closes its open tickets, marks its schedules\n * as done and cancels its campaigns; restoring checks the plan limit of the `type` (400 when it\n * is full).\n *\n * Resolves `{}` before the work is done (the route does not await it): poll `getById` until\n * `archivedAt` changes. Send the `type` of the connection: without it the request is never\n * answered.\n * @permissions services.disabled\n */\n archiveWithValidation(\n id: string,\n body: ArchiveServicePayload,\n headers?: Record<string, string>,\n ): Promise<Record<string, never>> {\n return this.client.post<Record<string, never>, ArchiveServicePayload>(\n `${this.basePath}/${id}/archive`,\n body,\n headers,\n )\n }\n\n /**\n * Takes the session of the connection over to this server. Resolves the text `'OK'`; an\n * unknown id answers 404 `Service not found.`.\n * @permissions services.operate\n */\n takeover(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/takeover`, undefined, headers)\n }\n\n /**\n * Logs the connection out of the messaging service. Resolves the text `'OK'`; an unknown id\n * answers 404 `Service not found.`.\n * @permissions services.operate\n */\n logout(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/logout`, undefined, headers)\n }\n\n /**\n * Shuts the connection down. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n shutdown(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/shutdown`, undefined, headers)\n }\n\n /**\n * Starts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n start(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/start`, undefined, headers)\n }\n\n /**\n * Restarts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n restart(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/restart`, undefined, headers)\n }\n\n /**\n * Denies the connection to users (`deny: true`) or gives it back (`deny: false`); the admins are skipped. Denying\n * transfers the open tickets of those users in the connection. The rows are read with\n * `ServiceAccessManagementApi.getMany`. An unknown connection answers 404 `Service not found.`; a missing\n * `userIds` or a `deny` that is not a boolean answers 400.\n * @permissions users.update AND services.operate\n */\n accessManagement(\n id: string,\n body: ServiceAccessManagementPayload,\n headers?: Record<string, string>,\n ): Promise<ServiceAccessManagementResponse> {\n return this.client.post<ServiceAccessManagementResponse, ServiceAccessManagementPayload>(\n `${this.basePath}/${id}/access-management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plan, by connection type. */
277
277
  export type ServiceLimits = Partial<Record<ServiceType, ServiceLimit>>;
278
+ /** The body of `accessManagement`: the users to deny (or give back) the connection to. */
279
+ export type ServiceAccessManagementPayload = {
280
+ userIds: string[];
281
+ /** `true` denies the connection to the users (their open tickets in it are transferred); `false` gives it back. */
282
+ deny: boolean;
283
+ };
284
+ /** What `accessManagement` answers: how many users were denied or given back the connection (no admin is counted). */
285
+ export type ServiceAccessManagementResponse = {
286
+ message: `${number} users denied access.` | `${number} users allowed access.`;
287
+ };
278
288
  //# sourceMappingURL=types.d.ts.map