@ikatec/digisac-api-sdk 4.14.0 → 4.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -3
- package/dist/apis/absence/AbsenceApi.cjs +2 -2
- package/dist/apis/absence/AbsenceApi.cjs.map +1 -1
- package/dist/apis/absence/AbsenceApi.d.ts +2 -2
- package/dist/apis/absence/AbsenceApi.mjs +2 -2
- package/dist/apis/absence/AbsenceApi.mjs.map +1 -1
- package/dist/apis/absence/types.d.ts +1 -1
- package/dist/apis/answers/AnswersApi.cjs +23 -2
- package/dist/apis/answers/AnswersApi.cjs.map +1 -1
- package/dist/apis/answers/AnswersApi.d.ts +16 -2
- package/dist/apis/answers/AnswersApi.d.ts.map +1 -1
- package/dist/apis/answers/AnswersApi.mjs +23 -2
- package/dist/apis/answers/AnswersApi.mjs.map +1 -1
- package/dist/apis/answers/types.d.ts +1 -2
- package/dist/apis/answers/types.d.ts.map +1 -1
- package/dist/apis/authHistory/AuthHistoryApi.cjs +9 -2
- package/dist/apis/authHistory/AuthHistoryApi.cjs.map +1 -1
- package/dist/apis/authHistory/AuthHistoryApi.d.ts +7 -2
- package/dist/apis/authHistory/AuthHistoryApi.d.ts.map +1 -1
- package/dist/apis/authHistory/AuthHistoryApi.mjs +9 -2
- package/dist/apis/authHistory/AuthHistoryApi.mjs.map +1 -1
- package/dist/apis/authHistory/types.d.ts +6 -1
- package/dist/apis/authHistory/types.d.ts.map +1 -1
- package/dist/apis/bots/BotsApi.cjs +16 -7
- package/dist/apis/bots/BotsApi.cjs.map +1 -1
- package/dist/apis/bots/BotsApi.d.ts +13 -7
- package/dist/apis/bots/BotsApi.d.ts.map +1 -1
- package/dist/apis/bots/BotsApi.mjs +16 -7
- package/dist/apis/bots/BotsApi.mjs.map +1 -1
- package/dist/apis/bots/types.d.ts +12 -2
- package/dist/apis/bots/types.d.ts.map +1 -1
- package/dist/apis/campaigns/CampaignsApi.cjs +25 -1
- package/dist/apis/campaigns/CampaignsApi.cjs.map +1 -1
- package/dist/apis/campaigns/CampaignsApi.d.ts +16 -1
- package/dist/apis/campaigns/CampaignsApi.d.ts.map +1 -1
- package/dist/apis/campaigns/CampaignsApi.mjs +25 -1
- package/dist/apis/campaigns/CampaignsApi.mjs.map +1 -1
- package/dist/apis/campaigns/types.d.ts +98 -6
- package/dist/apis/campaigns/types.d.ts.map +1 -1
- package/dist/apis/cards/types.d.ts +5 -5
- package/dist/apis/categories/CategoriesApi.cjs +1 -2
- package/dist/apis/categories/CategoriesApi.cjs.map +1 -1
- package/dist/apis/categories/CategoriesApi.d.ts +1 -2
- package/dist/apis/categories/CategoriesApi.d.ts.map +1 -1
- package/dist/apis/categories/CategoriesApi.mjs +1 -2
- package/dist/apis/categories/CategoriesApi.mjs.map +1 -1
- package/dist/apis/clientFeedback/ClientFeedbackApi.cjs +2 -3
- package/dist/apis/clientFeedback/ClientFeedbackApi.cjs.map +1 -1
- package/dist/apis/clientFeedback/ClientFeedbackApi.d.ts +2 -3
- package/dist/apis/clientFeedback/ClientFeedbackApi.d.ts.map +1 -1
- package/dist/apis/clientFeedback/ClientFeedbackApi.mjs +2 -3
- package/dist/apis/clientFeedback/ClientFeedbackApi.mjs.map +1 -1
- package/dist/apis/contacts/ContactsApi.cjs +20 -6
- package/dist/apis/contacts/ContactsApi.cjs.map +1 -1
- package/dist/apis/contacts/ContactsApi.d.ts +28 -4
- package/dist/apis/contacts/ContactsApi.d.ts.map +1 -1
- package/dist/apis/contacts/ContactsApi.mjs +20 -6
- package/dist/apis/contacts/ContactsApi.mjs.map +1 -1
- package/dist/apis/contacts/types.d.ts +101 -2
- package/dist/apis/contacts/types.d.ts.map +1 -1
- package/dist/apis/customFields/types.d.ts +4 -4
- package/dist/apis/dashboard/DashboardApi.cjs +3 -3
- package/dist/apis/dashboard/DashboardApi.cjs.map +1 -1
- package/dist/apis/dashboard/DashboardApi.d.ts +3 -3
- package/dist/apis/dashboard/DashboardApi.mjs +3 -3
- package/dist/apis/dashboard/DashboardApi.mjs.map +1 -1
- package/dist/apis/dashboard/types.d.ts +11 -4
- package/dist/apis/dashboard/types.d.ts.map +1 -1
- package/dist/apis/departments/DepartmentsApi.cjs +5 -5
- package/dist/apis/departments/DepartmentsApi.cjs.map +1 -1
- package/dist/apis/departments/DepartmentsApi.d.ts +5 -5
- package/dist/apis/departments/DepartmentsApi.mjs +5 -5
- package/dist/apis/departments/DepartmentsApi.mjs.map +1 -1
- package/dist/apis/departments/types.d.ts +6 -0
- package/dist/apis/departments/types.d.ts.map +1 -1
- package/dist/apis/distribution/DistributionApi.cjs +3 -4
- package/dist/apis/distribution/DistributionApi.cjs.map +1 -1
- package/dist/apis/distribution/DistributionApi.d.ts +3 -4
- package/dist/apis/distribution/DistributionApi.d.ts.map +1 -1
- package/dist/apis/distribution/DistributionApi.mjs +3 -4
- package/dist/apis/distribution/DistributionApi.mjs.map +1 -1
- package/dist/apis/files/FilesApi.cjs +13 -1
- package/dist/apis/files/FilesApi.cjs.map +1 -1
- package/dist/apis/files/FilesApi.d.ts +12 -2
- package/dist/apis/files/FilesApi.d.ts.map +1 -1
- package/dist/apis/files/FilesApi.mjs +13 -1
- package/dist/apis/files/FilesApi.mjs.map +1 -1
- package/dist/apis/files/types.d.ts +19 -1
- package/dist/apis/files/types.d.ts.map +1 -1
- package/dist/apis/kanbanCards/KanbanCardsApi.cjs +32 -0
- package/dist/apis/kanbanCards/KanbanCardsApi.cjs.map +1 -1
- package/dist/apis/kanbanCards/KanbanCardsApi.d.ts +27 -1
- package/dist/apis/kanbanCards/KanbanCardsApi.d.ts.map +1 -1
- package/dist/apis/kanbanCards/KanbanCardsApi.mjs +32 -0
- package/dist/apis/kanbanCards/KanbanCardsApi.mjs.map +1 -1
- package/dist/apis/kanbanCards/types.d.ts +1 -1
- package/dist/apis/kanbanCards/types.d.ts.map +1 -1
- package/dist/apis/kanbanColumns/KanbanColumnsApi.cjs +19 -0
- package/dist/apis/kanbanColumns/KanbanColumnsApi.cjs.map +1 -1
- package/dist/apis/kanbanColumns/KanbanColumnsApi.d.ts +16 -1
- package/dist/apis/kanbanColumns/KanbanColumnsApi.d.ts.map +1 -1
- package/dist/apis/kanbanColumns/KanbanColumnsApi.mjs +19 -0
- package/dist/apis/kanbanColumns/KanbanColumnsApi.mjs.map +1 -1
- package/dist/apis/kanbanColumns/types.d.ts +4 -0
- package/dist/apis/kanbanColumns/types.d.ts.map +1 -1
- package/dist/apis/messages/MessagesApi.cjs +13 -4
- package/dist/apis/messages/MessagesApi.cjs.map +1 -1
- package/dist/apis/messages/MessagesApi.d.ts +13 -4
- package/dist/apis/messages/MessagesApi.d.ts.map +1 -1
- package/dist/apis/messages/MessagesApi.mjs +13 -4
- package/dist/apis/messages/MessagesApi.mjs.map +1 -1
- package/dist/apis/messages/types.d.ts +5 -0
- package/dist/apis/messages/types.d.ts.map +1 -1
- package/dist/apis/pipeline/types.d.ts +7 -8
- package/dist/apis/pipeline/types.d.ts.map +1 -1
- package/dist/apis/quickReplies/types.d.ts +4 -1
- package/dist/apis/quickReplies/types.d.ts.map +1 -1
- package/dist/apis/schedule/types.d.ts +41 -10
- package/dist/apis/schedule/types.d.ts.map +1 -1
- package/dist/apis/terms/TermsApi.cjs +2 -2
- package/dist/apis/terms/TermsApi.cjs.map +1 -1
- package/dist/apis/terms/TermsApi.d.ts +2 -2
- package/dist/apis/terms/TermsApi.mjs +2 -2
- package/dist/apis/terms/TermsApi.mjs.map +1 -1
- package/dist/apis/tickets/TicketsApi.cjs +18 -8
- package/dist/apis/tickets/TicketsApi.cjs.map +1 -1
- package/dist/apis/tickets/TicketsApi.d.ts +15 -8
- package/dist/apis/tickets/TicketsApi.d.ts.map +1 -1
- package/dist/apis/tickets/TicketsApi.mjs +18 -8
- package/dist/apis/tickets/TicketsApi.mjs.map +1 -1
- package/dist/apis/tickets/types.d.ts +4 -1
- package/dist/apis/tickets/types.d.ts.map +1 -1
- package/dist/apis/timetable/TimetableApi.cjs +6 -0
- package/dist/apis/timetable/TimetableApi.cjs.map +1 -1
- package/dist/apis/timetable/TimetableApi.d.ts +6 -0
- package/dist/apis/timetable/TimetableApi.d.ts.map +1 -1
- package/dist/apis/timetable/TimetableApi.mjs +6 -0
- package/dist/apis/timetable/TimetableApi.mjs.map +1 -1
- package/dist/apis/timetable/types.d.ts +8 -0
- package/dist/apis/timetable/types.d.ts.map +1 -1
- package/dist/apis/users/UsersApi.cjs +11 -3
- package/dist/apis/users/UsersApi.cjs.map +1 -1
- package/dist/apis/users/UsersApi.d.ts +10 -4
- package/dist/apis/users/UsersApi.d.ts.map +1 -1
- package/dist/apis/users/UsersApi.mjs +11 -3
- package/dist/apis/users/UsersApi.mjs.map +1 -1
- package/dist/apis/users/types.d.ts +26 -0
- package/dist/apis/users/types.d.ts.map +1 -1
- package/dist/apis/webhooks/types.d.ts +51 -6
- package/dist/apis/webhooks/types.d.ts.map +1 -1
- package/dist/core/BaseReadApi.cjs +2 -2
- package/dist/core/BaseReadApi.cjs.map +1 -1
- package/dist/core/BaseReadApi.d.ts +2 -2
- package/dist/core/BaseReadApi.mjs +2 -2
- package/dist/core/BaseReadApi.mjs.map +1 -1
- package/dist/core/errors.cjs +4 -1
- package/dist/core/errors.cjs.map +1 -1
- package/dist/core/errors.d.ts +4 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.mjs +4 -1
- package/dist/core/errors.mjs.map +1 -1
- package/package.json +1 -1
- package/src/apis/absence/AbsenceApi.ts +2 -2
- package/src/apis/absence/types.ts +1 -1
- package/src/apis/answers/AnswersApi.test.ts +32 -0
- package/src/apis/answers/AnswersApi.ts +38 -2
- package/src/apis/answers/types.ts +1 -2
- package/src/apis/authHistory/AuthHistoryApi.test.ts +16 -0
- package/src/apis/authHistory/AuthHistoryApi.ts +10 -2
- package/src/apis/authHistory/types.ts +6 -1
- package/src/apis/bots/BotsApi.test.ts +16 -0
- package/src/apis/bots/BotsApi.ts +25 -7
- package/src/apis/bots/types.ts +12 -2
- package/src/apis/campaigns/CampaignsApi.test.ts +48 -0
- package/src/apis/campaigns/CampaignsApi.ts +31 -2
- package/src/apis/campaigns/types.ts +101 -3
- package/src/apis/cards/types.ts +5 -5
- package/src/apis/categories/CategoriesApi.ts +1 -2
- package/src/apis/clientFeedback/ClientFeedbackApi.ts +2 -3
- package/src/apis/contacts/ContactsApi.test.ts +49 -2
- package/src/apis/contacts/ContactsApi.ts +64 -4
- package/src/apis/contacts/types.ts +111 -1
- package/src/apis/creditMovements/CreditMovementsApi.test.ts +1 -1
- package/src/apis/customFields/types.ts +4 -4
- package/src/apis/dashboard/DashboardApi.test-d.ts +9 -0
- package/src/apis/dashboard/DashboardApi.ts +3 -3
- package/src/apis/dashboard/types.ts +11 -4
- package/src/apis/departments/DepartmentsApi.ts +5 -5
- package/src/apis/departments/types.ts +13 -0
- package/src/apis/distribution/DistributionApi.ts +3 -4
- package/src/apis/files/FilesApi.test.ts +21 -0
- package/src/apis/files/FilesApi.ts +19 -1
- package/src/apis/files/types.ts +20 -1
- package/src/apis/kanbanCards/KanbanCardsApi.test.ts +21 -0
- package/src/apis/kanbanCards/KanbanCardsApi.ts +47 -1
- package/src/apis/kanbanCards/types.ts +1 -1
- package/src/apis/kanbanColumns/KanbanColumnsApi.test.ts +26 -0
- package/src/apis/kanbanColumns/KanbanColumnsApi.ts +31 -0
- package/src/apis/kanbanColumns/types.ts +5 -0
- package/src/apis/messages/MessagesApi.ts +13 -4
- package/src/apis/messages/types.ts +5 -0
- package/src/apis/payloads.test-d.ts +245 -5
- package/src/apis/pipeline/types.ts +7 -8
- package/src/apis/queryFormat.test.ts +13 -0
- package/src/apis/quickReplies/types.ts +4 -1
- package/src/apis/schedule/types.ts +42 -10
- package/src/apis/terms/TermsApi.ts +2 -2
- package/src/apis/tickets/TicketsApi.ts +28 -8
- package/src/apis/tickets/types.ts +4 -1
- package/src/apis/timetable/TimetableApi.ts +6 -0
- package/src/apis/timetable/types.ts +9 -0
- package/src/apis/users/UsersApi.test.ts +17 -0
- package/src/apis/users/UsersApi.ts +21 -3
- package/src/apis/users/types.ts +28 -0
- package/src/apis/webhooks/types.ts +53 -6
- package/src/core/BaseReadApi.ts +2 -2
- package/src/core/errors.ts +4 -1
package/README.md
CHANGED
|
@@ -84,14 +84,14 @@ Available resources:
|
|
|
84
84
|
| Accounts (deprecated: the backend serves no `/accounts`; use `MeApi.getAccount`) | `AccountsApi` | `/accounts` |
|
|
85
85
|
| Activity Log | `ActivityLogApi` | `/log` |
|
|
86
86
|
| Answers | `AnswersApi` | `/answers` |
|
|
87
|
-
| Auth History (
|
|
87
|
+
| Auth History (reads and `registerLogout`) | `AuthHistoryApi` | `/auth-history` |
|
|
88
88
|
| Bot Simulators | `BotSimulatorsApi` | `/bot-simulators` |
|
|
89
89
|
| Bot Versions (read-only; the write methods are deprecated) | `BotVersionsApi` | `/bot-versions` |
|
|
90
90
|
| Bots | `BotsApi` | `/bots` |
|
|
91
91
|
| Campaigns | `CampaignsApi` | `/campaigns` |
|
|
92
92
|
| Cards | `CardsApi` | `/cards` |
|
|
93
93
|
| Categories | `CategoriesApi` | `/categories` |
|
|
94
|
-
| Client Feedback (deprecated: the
|
|
94
|
+
| Client Feedback (deprecated: send the rating of the AI summary with `ContactsApi.closeTicket`) | `ClientFeedbackApi` | `/client-feedback` |
|
|
95
95
|
| Contact Block Lists | `ContactBlockListsApi` | `/contact-block-lists` |
|
|
96
96
|
| Contact Block Lists Controls | `ContactBlockListsControlsApi` | `/contact-block-lists-controls` |
|
|
97
97
|
| Contacts | `ContactsApi` | `/contacts` |
|
|
@@ -100,7 +100,7 @@ Available resources:
|
|
|
100
100
|
| Dashboard | `DashboardApi` | `/dashboard` |
|
|
101
101
|
| Departments | `DepartmentsApi` | `/departments` |
|
|
102
102
|
| Distribution | `DistributionApi` | `/distribution` |
|
|
103
|
-
| Files (`createToUpload` + `upload`, `create`, `deleteById`; the reads and the update are deprecated) | `FilesApi` | `/files` |
|
|
103
|
+
| Files (`createToUpload` + `upload`, `create`, `duplicateFile`, `deleteById`; the reads and the update are deprecated) | `FilesApi` | `/files` |
|
|
104
104
|
| Holidays | `HolidayApi` | `/holiday` |
|
|
105
105
|
| Integrations | `IntegrationsApi` | `/integrations` |
|
|
106
106
|
| Interactive Messages | `InteractiveMessagesApi` | `/interactive-messages` |
|
|
@@ -365,6 +365,8 @@ response.headers.get('Content-Type') // 'application/pdf'
|
|
|
365
365
|
const pdf = await response.arrayBuffer()
|
|
366
366
|
```
|
|
367
367
|
|
|
368
|
+
The methods built on it need a client that implements `requestRaw`: `CreditMovementsApi.exportXlsx` and `BotsApi.exportErrors` (xlsx as an `ArrayBuffer`), and `AnswersApi.exportCsvRaw` / `exportTxtRaw` (the whole `Response`).
|
|
369
|
+
|
|
368
370
|
## Uploading files
|
|
369
371
|
|
|
370
372
|
The content of a file goes straight to the storage, through a signed URL. `upload` sends it with `client.requestExternal`, which leaves out the base URL and the access token (the storage refuses an `Authorization` header), so a `BaseApiClient` subclass can intercept it by overriding that method:
|
|
@@ -375,6 +377,11 @@ import { FilesApi } from '@ikatec/digisac-api-sdk/files'
|
|
|
375
377
|
const files = new FilesApi(client)
|
|
376
378
|
const file = await files.createToUpload({ name: 'contacts.csv', mimetype: 'text/csv', attachedType: 'campaign.file' })
|
|
377
379
|
await files.upload(file.urlToUpload!, csvContent, 'text/csv') // no API token: the storage refuses it
|
|
380
|
+
|
|
381
|
+
// A copy of the content: in a new record, or in a record created to receive it
|
|
382
|
+
const copyId = await files.duplicateFile({ fileId: file.id })
|
|
383
|
+
const slot = await files.createToUpload({ name: 'copy.csv', mimetype: 'text/csv' })
|
|
384
|
+
await files.duplicateFile({ fileId: file.id, urlToUpload: slot.urlToUpload! }) // resolves file.id; the copy is slot.id
|
|
378
385
|
```
|
|
379
386
|
|
|
380
387
|
## Development
|
|
@@ -13,8 +13,8 @@ var AbsenceApi = class extends require_core_BaseCrudApi.BaseCrudApi {
|
|
|
13
13
|
super(client, "/absence");
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* The absence report of the account (`GET /absence`), always paginated, with its own query (
|
|
17
|
-
*
|
|
16
|
+
* The absence report of the account (`GET /absence`), always paginated, with its own query (see
|
|
17
|
+
* `AbsenceReportItem`). Prefer it to `getMany`, whose `where`/`include`/`paginate` the backend
|
|
18
18
|
* ignores. Requires both permissions, always: without them it answers 403
|
|
19
19
|
* `MISSING_ABSENCE_REPORT_PERMISSION`.
|
|
20
20
|
* @permissions overview.absence.view AND myAccount.absence
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbsenceApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/absence/AbsenceApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { GetByIdQuery, Paginated } from '../../core/types'\nimport type {\n Absence,\n AbsenceReportItem,\n AbsenceReportQuery,\n CreateAbsencePayload,\n UnlockAbsencePayload,\n UnlockAbsenceResponse,\n UpdateAbsencePayload,\n} from './types'\n\n/**\n * Absences of the users. The backend serves the report (`GET /absence`, `GET /absence/export-csv`),\n * `GET /absence/find-open-absence`, `POST /absence`, `POST /absence/unlock` and `PUT /absence/:id`; there is\n * no read by id nor delete. Creating an absence sets the status of the user to `away` and `unlock` sets it\n * back to `online` (both emit `user.updated` to the webhooks).\n */\nexport class AbsenceApi extends BaseCrudApi<Absence, CreateAbsencePayload, UpdateAbsencePayload> {\n constructor(client: ApiClient) {\n super(client, '/absence')\n }\n\n /**\n * The absence report of the account (`GET /absence`), always paginated, with its own query (
|
|
1
|
+
{"version":3,"file":"AbsenceApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/absence/AbsenceApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { GetByIdQuery, Paginated } from '../../core/types'\nimport type {\n Absence,\n AbsenceReportItem,\n AbsenceReportQuery,\n CreateAbsencePayload,\n UnlockAbsencePayload,\n UnlockAbsenceResponse,\n UpdateAbsencePayload,\n} from './types'\n\n/**\n * Absences of the users. The backend serves the report (`GET /absence`, `GET /absence/export-csv`),\n * `GET /absence/find-open-absence`, `POST /absence`, `POST /absence/unlock` and `PUT /absence/:id`; there is\n * no read by id nor delete. Creating an absence sets the status of the user to `away` and `unlock` sets it\n * back to `online` (both emit `user.updated` to the webhooks).\n */\nexport class AbsenceApi extends BaseCrudApi<Absence, CreateAbsencePayload, UpdateAbsencePayload> {\n constructor(client: ApiClient) {\n super(client, '/absence')\n }\n\n /**\n * The absence report of the account (`GET /absence`), always paginated, with its own query (see\n * `AbsenceReportItem`). Prefer it to `getMany`, whose `where`/`include`/`paginate` the backend\n * ignores. Requires both permissions, always: without them it answers 403\n * `MISSING_ABSENCE_REPORT_PERMISSION`.\n * @permissions overview.absence.view AND myAccount.absence\n */\n report(\n query?: AbsenceReportQuery,\n headers?: Record<string, string>,\n ): Promise<Paginated<AbsenceReportItem>> {\n return this.client.get<Paginated<AbsenceReportItem>>(\n `${this.basePath}${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Creates an absence for the current user (whatever `userId` says) and sets the user `away`. Resolves the\n * stored absence (raw, without `user`).\n * @permissions myAccount.absence\n */\n override create(body: CreateAbsencePayload, headers?: Record<string, string>): Promise<Absence> {\n return super.create(body, headers)\n }\n\n /**\n * The open absence of the current user, or `null` — also `null` while `settings.absence.enabled` is off.\n * @permissions myAccount.absence\n */\n findOpenAbsence(headers?: Record<string, string>): Promise<AbsenceReportItem | null> {\n return this.client.get<AbsenceReportItem | null>(`${this.basePath}/find-open-absence`, headers)\n }\n\n /**\n * Ends an absence (the open one of the user when `id` is absent) and sets the user `online`. The refusals\n * of `settings.absence` come with status 200 (`INVALID_REASON`, `INVALID_PASSWORD`); without an open\n * absence it answers 500.\n * @permissions myAccount.absence\n */\n unlock(\n body: UnlockAbsencePayload,\n headers?: Record<string, string>,\n ): Promise<UnlockAbsenceResponse> {\n return this.client.post<UnlockAbsenceResponse, UnlockAbsencePayload>(\n `${this.basePath}/unlock`,\n body,\n headers,\n )\n }\n\n /**\n * Exports the report as CSV (`Usuário, De, Até, Motivo`; an open absence shows `Em andamento`), sent as\n * the attachment `<yyyy-MM-dd>_absence-control.csv`.\n * @permissions overview.absence.view AND myAccount.absence\n */\n exportCsv(query?: AbsenceReportQuery, headers?: Record<string, string>): Promise<string> {\n return this.client.get<string>(\n `${this.basePath}/export-csv${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /** @deprecated Not served: the backend has no GET /absence/:id, so this route answers 404. */\n override getById(\n id: string,\n query?: GetByIdQuery<Absence>,\n headers?: Record<string, string>,\n ): Promise<Absence> {\n return super.getById(id, query, headers)\n }\n\n /** @deprecated Not served: the backend has no DELETE /absence/:id, so this route answers 404. */\n override deleteById(id: string, headers?: Record<string, string>): Promise<Absence> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;;;;;;;;AAmBA,IAAa,aAAb,cAAgCA,qCAAiE;CAC/F,YAAY,QAAmB;AAC7B,QAAM,QAAQ,WAAW;;;;;;;;;CAU3B,OACE,OACA,SACuC;AACvC,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,WAAW,KAAK,cAAc,MAAM,IAC5C,QACD;;;;;;;CAQH,AAAS,OAAO,MAA4B,SAAoD;AAC9F,SAAO,MAAM,OAAO,MAAM,QAAQ;;;;;;CAOpC,gBAAgB,SAAqE;AACnF,SAAO,KAAK,OAAO,IAA8B,GAAG,KAAK,SAAS,qBAAqB,QAAQ;;;;;;;;CASjG,OACE,MACA,SACgC;AAChC,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,UACjB,MACA,QACD;;;;;;;CAQH,UAAU,OAA4B,SAAmD;AACvF,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,aAAa,KAAK,cAAc,MAAM,IACvD,QACD;;;CAIH,AAAS,QACP,IACA,OACA,SACkB;AAClB,SAAO,MAAM,QAAQ,IAAI,OAAO,QAAQ;;;CAI1C,AAAS,WAAW,IAAY,SAAoD;AAClF,SAAO,MAAM,WAAW,IAAI,QAAQ"}
|
|
@@ -11,8 +11,8 @@ import type { Absence, AbsenceReportItem, AbsenceReportQuery, CreateAbsencePaylo
|
|
|
11
11
|
export declare class AbsenceApi extends BaseCrudApi<Absence, CreateAbsencePayload, UpdateAbsencePayload> {
|
|
12
12
|
constructor(client: ApiClient);
|
|
13
13
|
/**
|
|
14
|
-
* The absence report of the account (`GET /absence`), always paginated, with its own query (
|
|
15
|
-
*
|
|
14
|
+
* The absence report of the account (`GET /absence`), always paginated, with its own query (see
|
|
15
|
+
* `AbsenceReportItem`). Prefer it to `getMany`, whose `where`/`include`/`paginate` the backend
|
|
16
16
|
* ignores. Requires both permissions, always: without them it answers 403
|
|
17
17
|
* `MISSING_ABSENCE_REPORT_PERMISSION`.
|
|
18
18
|
* @permissions overview.absence.view AND myAccount.absence
|
|
@@ -12,8 +12,8 @@ var AbsenceApi = class extends BaseCrudApi {
|
|
|
12
12
|
super(client, "/absence");
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* The absence report of the account (`GET /absence`), always paginated, with its own query (
|
|
16
|
-
*
|
|
15
|
+
* The absence report of the account (`GET /absence`), always paginated, with its own query (see
|
|
16
|
+
* `AbsenceReportItem`). Prefer it to `getMany`, whose `where`/`include`/`paginate` the backend
|
|
17
17
|
* ignores. Requires both permissions, always: without them it answers 403
|
|
18
18
|
* `MISSING_ABSENCE_REPORT_PERMISSION`.
|
|
19
19
|
* @permissions overview.absence.view AND myAccount.absence
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbsenceApi.mjs","names":[],"sources":["../../../src/apis/absence/AbsenceApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { GetByIdQuery, Paginated } from '../../core/types'\nimport type {\n Absence,\n AbsenceReportItem,\n AbsenceReportQuery,\n CreateAbsencePayload,\n UnlockAbsencePayload,\n UnlockAbsenceResponse,\n UpdateAbsencePayload,\n} from './types'\n\n/**\n * Absences of the users. The backend serves the report (`GET /absence`, `GET /absence/export-csv`),\n * `GET /absence/find-open-absence`, `POST /absence`, `POST /absence/unlock` and `PUT /absence/:id`; there is\n * no read by id nor delete. Creating an absence sets the status of the user to `away` and `unlock` sets it\n * back to `online` (both emit `user.updated` to the webhooks).\n */\nexport class AbsenceApi extends BaseCrudApi<Absence, CreateAbsencePayload, UpdateAbsencePayload> {\n constructor(client: ApiClient) {\n super(client, '/absence')\n }\n\n /**\n * The absence report of the account (`GET /absence`), always paginated, with its own query (
|
|
1
|
+
{"version":3,"file":"AbsenceApi.mjs","names":[],"sources":["../../../src/apis/absence/AbsenceApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { GetByIdQuery, Paginated } from '../../core/types'\nimport type {\n Absence,\n AbsenceReportItem,\n AbsenceReportQuery,\n CreateAbsencePayload,\n UnlockAbsencePayload,\n UnlockAbsenceResponse,\n UpdateAbsencePayload,\n} from './types'\n\n/**\n * Absences of the users. The backend serves the report (`GET /absence`, `GET /absence/export-csv`),\n * `GET /absence/find-open-absence`, `POST /absence`, `POST /absence/unlock` and `PUT /absence/:id`; there is\n * no read by id nor delete. Creating an absence sets the status of the user to `away` and `unlock` sets it\n * back to `online` (both emit `user.updated` to the webhooks).\n */\nexport class AbsenceApi extends BaseCrudApi<Absence, CreateAbsencePayload, UpdateAbsencePayload> {\n constructor(client: ApiClient) {\n super(client, '/absence')\n }\n\n /**\n * The absence report of the account (`GET /absence`), always paginated, with its own query (see\n * `AbsenceReportItem`). Prefer it to `getMany`, whose `where`/`include`/`paginate` the backend\n * ignores. Requires both permissions, always: without them it answers 403\n * `MISSING_ABSENCE_REPORT_PERMISSION`.\n * @permissions overview.absence.view AND myAccount.absence\n */\n report(\n query?: AbsenceReportQuery,\n headers?: Record<string, string>,\n ): Promise<Paginated<AbsenceReportItem>> {\n return this.client.get<Paginated<AbsenceReportItem>>(\n `${this.basePath}${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Creates an absence for the current user (whatever `userId` says) and sets the user `away`. Resolves the\n * stored absence (raw, without `user`).\n * @permissions myAccount.absence\n */\n override create(body: CreateAbsencePayload, headers?: Record<string, string>): Promise<Absence> {\n return super.create(body, headers)\n }\n\n /**\n * The open absence of the current user, or `null` — also `null` while `settings.absence.enabled` is off.\n * @permissions myAccount.absence\n */\n findOpenAbsence(headers?: Record<string, string>): Promise<AbsenceReportItem | null> {\n return this.client.get<AbsenceReportItem | null>(`${this.basePath}/find-open-absence`, headers)\n }\n\n /**\n * Ends an absence (the open one of the user when `id` is absent) and sets the user `online`. The refusals\n * of `settings.absence` come with status 200 (`INVALID_REASON`, `INVALID_PASSWORD`); without an open\n * absence it answers 500.\n * @permissions myAccount.absence\n */\n unlock(\n body: UnlockAbsencePayload,\n headers?: Record<string, string>,\n ): Promise<UnlockAbsenceResponse> {\n return this.client.post<UnlockAbsenceResponse, UnlockAbsencePayload>(\n `${this.basePath}/unlock`,\n body,\n headers,\n )\n }\n\n /**\n * Exports the report as CSV (`Usuário, De, Até, Motivo`; an open absence shows `Em andamento`), sent as\n * the attachment `<yyyy-MM-dd>_absence-control.csv`.\n * @permissions overview.absence.view AND myAccount.absence\n */\n exportCsv(query?: AbsenceReportQuery, headers?: Record<string, string>): Promise<string> {\n return this.client.get<string>(\n `${this.basePath}/export-csv${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /** @deprecated Not served: the backend has no GET /absence/:id, so this route answers 404. */\n override getById(\n id: string,\n query?: GetByIdQuery<Absence>,\n headers?: Record<string, string>,\n ): Promise<Absence> {\n return super.getById(id, query, headers)\n }\n\n /** @deprecated Not served: the backend has no DELETE /absence/:id, so this route answers 404. */\n override deleteById(id: string, headers?: Record<string, string>): Promise<Absence> {\n return super.deleteById(id, headers)\n }\n}\n"],"mappings":";;;;;;;;;AAmBA,IAAa,aAAb,cAAgC,YAAiE;CAC/F,YAAY,QAAmB;AAC7B,QAAM,QAAQ,WAAW;;;;;;;;;CAU3B,OACE,OACA,SACuC;AACvC,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,WAAW,KAAK,cAAc,MAAM,IAC5C,QACD;;;;;;;CAQH,AAAS,OAAO,MAA4B,SAAoD;AAC9F,SAAO,MAAM,OAAO,MAAM,QAAQ;;;;;;CAOpC,gBAAgB,SAAqE;AACnF,SAAO,KAAK,OAAO,IAA8B,GAAG,KAAK,SAAS,qBAAqB,QAAQ;;;;;;;;CASjG,OACE,MACA,SACgC;AAChC,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,UACjB,MACA,QACD;;;;;;;CAQH,UAAU,OAA4B,SAAmD;AACvF,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,aAAa,KAAK,cAAc,MAAM,IACvD,QACD;;;CAIH,AAAS,QACP,IACA,OACA,SACkB;AAClB,SAAO,MAAM,QAAQ,IAAI,OAAO,QAAQ;;;CAI1C,AAAS,WAAW,IAAY,SAAoD;AAClF,SAAO,MAAM,WAAW,IAAI,QAAQ"}
|
|
@@ -48,7 +48,7 @@ export type AbsenceReportQuery = {
|
|
|
48
48
|
timezone?: string;
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
|
-
* A row of the report: the stored absence with its user
|
|
51
|
+
* A row of the report: the stored absence with its `user`.
|
|
52
52
|
*/
|
|
53
53
|
export type AbsenceReportItem = Omit<Absence, 'deletedAt' | 'user'> & {
|
|
54
54
|
user?: Record<string, unknown>;
|
|
@@ -3,8 +3,7 @@ const require_core_BaseCrudApi = require('../../core/BaseCrudApi.cjs');
|
|
|
3
3
|
|
|
4
4
|
//#region src/apis/answers/AnswersApi.ts
|
|
5
5
|
/**
|
|
6
|
-
* Answers of the evaluation questions. They are written by the bot flow (`SEND_QUESTION`)
|
|
7
|
-
* CRUD routes exist but validate nothing.
|
|
6
|
+
* Answers of the evaluation questions. They are written by the bot flow (`SEND_QUESTION`).
|
|
8
7
|
*
|
|
9
8
|
* Permissions: `evaluation.view` to read, `evaluation.create`/`update`/`destroy` to write.
|
|
10
9
|
*/
|
|
@@ -44,6 +43,28 @@ var AnswersApi = class extends require_core_BaseCrudApi.BaseCrudApi {
|
|
|
44
43
|
exportTxt(query, headers) {
|
|
45
44
|
return this.client.get(`${this.basePath}/exportation-txt${this.toQueryString(query)}`, headers);
|
|
46
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* The {@link exportCsv} export as the whole `Response`, to read its headers (`Content-Type`,
|
|
48
|
+
* `Content-Disposition`) as well as the body. Needs a client with `requestRaw`. Errors are thrown
|
|
49
|
+
* as in `exportCsv`.
|
|
50
|
+
* @permissions overview.evaluation.view
|
|
51
|
+
*/
|
|
52
|
+
exportCsvRaw(query, headers) {
|
|
53
|
+
return this.exportResponse("exportation-csv", "exportCsvRaw", query, headers);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The {@link exportTxt} export as the whole `Response`, to read its headers (`Content-Type`,
|
|
57
|
+
* `Content-Disposition`) as well as the body. The Content-Type is `plain/text` (not
|
|
58
|
+
* `text/plain`). Needs a client with `requestRaw`. Errors are thrown as in `exportTxt`.
|
|
59
|
+
* @permissions overview.evaluation.view
|
|
60
|
+
*/
|
|
61
|
+
exportTxtRaw(query, headers) {
|
|
62
|
+
return this.exportResponse("exportation-txt", "exportTxtRaw", query, headers);
|
|
63
|
+
}
|
|
64
|
+
async exportResponse(route, method, query, headers) {
|
|
65
|
+
if (!this.client.requestRaw) throw new Error(`${method} needs a client with requestRaw (the answer is read as a Response)`);
|
|
66
|
+
return this.client.requestRaw("GET", `${this.basePath}/${route}${this.toQueryString(query)}`, void 0, headers);
|
|
67
|
+
}
|
|
47
68
|
};
|
|
48
69
|
|
|
49
70
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnswersApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/answers/AnswersApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { ListQuery } from '../../core/types'\nimport type {\n Answer,\n AnswersOverview,\n AnswersReportQuery,\n CreateAnswerPayload,\n UpdateAnswerPayload,\n} from './types'\n\n/**\n * Answers of the evaluation questions. They are written by the bot flow (`SEND_QUESTION`)
|
|
1
|
+
{"version":3,"file":"AnswersApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/answers/AnswersApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { ListQuery } from '../../core/types'\nimport type {\n Answer,\n AnswersOverview,\n AnswersReportQuery,\n CreateAnswerPayload,\n UpdateAnswerPayload,\n} from './types'\n\n/**\n * Answers of the evaluation questions. They are written by the bot flow (`SEND_QUESTION`).\n *\n * Permissions: `evaluation.view` to read, `evaluation.create`/`update`/`destroy` to write.\n */\nexport class AnswersApi extends BaseCrudApi<\n Answer,\n CreateAnswerPayload,\n UpdateAnswerPayload,\n ListQuery<Answer>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/answers')\n }\n\n /**\n * Deletes an answer (soft delete). Resolves to `'OK'`.\n * @permissions evaluation.destroy\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Counts the NPS and CSAT answers of closed tickets. An error answers 500 with a string body.\n * @permissions overview.evaluation.view\n */\n overview(query?: AnswersReportQuery, headers?: Record<string, string>): Promise<AnswersOverview> {\n return this.client.get<AnswersOverview>(\n `${this.basePath}/overview${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Exports the answers as CSV (`,`, header in the language of the user, dates in the timezone of\n * the account), sent as the attachment `evaluation-reports.csv`. An unknown `type` answers 400\n * `{ error: 'Tipo de consulta inválido' }`.\n * @permissions overview.evaluation.view\n */\n exportCsv(query?: AnswersReportQuery, headers?: Record<string, string>): Promise<string> {\n return this.client.get<string>(\n `${this.basePath}/exportation-csv${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Exports the answers as text, one block per answer and the count of unanswered ones at the\n * end, sent as the attachment `evaluation-reports.txt` (Content-Type `plain/text`). An unknown\n * `type` answers 400 `{ error: 'Tipo de consulta inválido' }`.\n * @permissions overview.evaluation.view\n */\n exportTxt(query?: AnswersReportQuery, headers?: Record<string, string>): Promise<string> {\n return this.client.get<string>(\n `${this.basePath}/exportation-txt${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * The {@link exportCsv} export as the whole `Response`, to read its headers (`Content-Type`,\n * `Content-Disposition`) as well as the body. Needs a client with `requestRaw`. Errors are thrown\n * as in `exportCsv`.\n * @permissions overview.evaluation.view\n */\n exportCsvRaw(query?: AnswersReportQuery, headers?: Record<string, string>): Promise<Response> {\n return this.exportResponse('exportation-csv', 'exportCsvRaw', query, headers)\n }\n\n /**\n * The {@link exportTxt} export as the whole `Response`, to read its headers (`Content-Type`,\n * `Content-Disposition`) as well as the body. The Content-Type is `plain/text` (not\n * `text/plain`). Needs a client with `requestRaw`. Errors are thrown as in `exportTxt`.\n * @permissions overview.evaluation.view\n */\n exportTxtRaw(query?: AnswersReportQuery, headers?: Record<string, string>): Promise<Response> {\n return this.exportResponse('exportation-txt', 'exportTxtRaw', query, headers)\n }\n\n private async exportResponse(\n route: 'exportation-csv' | 'exportation-txt',\n method: 'exportCsvRaw' | 'exportTxtRaw',\n query?: AnswersReportQuery,\n headers?: Record<string, string>,\n ): Promise<Response> {\n if (!this.client.requestRaw) {\n throw new Error(`${method} needs a client with requestRaw (the answer is read as a Response)`)\n }\n return this.client.requestRaw(\n 'GET',\n `${this.basePath}/${route}${this.toQueryString(query)}`,\n undefined,\n headers,\n )\n }\n}\n"],"mappings":";;;;;;;;;AAgBA,IAAa,aAAb,cAAgCA,qCAM9B;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,WAAW;;;;;;CAO3B,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;;CAOtC,SAAS,OAA4B,SAA4D;AAC/F,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,WAAW,KAAK,cAAc,MAAM,IACrD,QACD;;;;;;;;CASH,UAAU,OAA4B,SAAmD;AACvF,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,kBAAkB,KAAK,cAAc,MAAM,IAC5D,QACD;;;;;;;;CASH,UAAU,OAA4B,SAAmD;AACvF,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,kBAAkB,KAAK,cAAc,MAAM,IAC5D,QACD;;;;;;;;CASH,aAAa,OAA4B,SAAqD;AAC5F,SAAO,KAAK,eAAe,mBAAmB,gBAAgB,OAAO,QAAQ;;;;;;;;CAS/E,aAAa,OAA4B,SAAqD;AAC5F,SAAO,KAAK,eAAe,mBAAmB,gBAAgB,OAAO,QAAQ;;CAG/E,MAAc,eACZ,OACA,QACA,OACA,SACmB;AACnB,MAAI,CAAC,KAAK,OAAO,WACf,OAAM,IAAI,MAAM,GAAG,OAAO,oEAAoE;AAEhG,SAAO,KAAK,OAAO,WACjB,OACA,GAAG,KAAK,SAAS,GAAG,QAAQ,KAAK,cAAc,MAAM,IACrD,QACA,QACD"}
|
|
@@ -3,8 +3,7 @@ import { BaseCrudApi } from '../../core/BaseCrudApi';
|
|
|
3
3
|
import type { ListQuery } from '../../core/types';
|
|
4
4
|
import type { Answer, AnswersOverview, AnswersReportQuery, CreateAnswerPayload, UpdateAnswerPayload } from './types';
|
|
5
5
|
/**
|
|
6
|
-
* Answers of the evaluation questions. They are written by the bot flow (`SEND_QUESTION`)
|
|
7
|
-
* CRUD routes exist but validate nothing.
|
|
6
|
+
* Answers of the evaluation questions. They are written by the bot flow (`SEND_QUESTION`).
|
|
8
7
|
*
|
|
9
8
|
* Permissions: `evaluation.view` to read, `evaluation.create`/`update`/`destroy` to write.
|
|
10
9
|
*/
|
|
@@ -34,5 +33,20 @@ export declare class AnswersApi extends BaseCrudApi<Answer, CreateAnswerPayload,
|
|
|
34
33
|
* @permissions overview.evaluation.view
|
|
35
34
|
*/
|
|
36
35
|
exportTxt(query?: AnswersReportQuery, headers?: Record<string, string>): Promise<string>;
|
|
36
|
+
/**
|
|
37
|
+
* The {@link exportCsv} export as the whole `Response`, to read its headers (`Content-Type`,
|
|
38
|
+
* `Content-Disposition`) as well as the body. Needs a client with `requestRaw`. Errors are thrown
|
|
39
|
+
* as in `exportCsv`.
|
|
40
|
+
* @permissions overview.evaluation.view
|
|
41
|
+
*/
|
|
42
|
+
exportCsvRaw(query?: AnswersReportQuery, headers?: Record<string, string>): Promise<Response>;
|
|
43
|
+
/**
|
|
44
|
+
* The {@link exportTxt} export as the whole `Response`, to read its headers (`Content-Type`,
|
|
45
|
+
* `Content-Disposition`) as well as the body. The Content-Type is `plain/text` (not
|
|
46
|
+
* `text/plain`). Needs a client with `requestRaw`. Errors are thrown as in `exportTxt`.
|
|
47
|
+
* @permissions overview.evaluation.view
|
|
48
|
+
*/
|
|
49
|
+
exportTxtRaw(query?: AnswersReportQuery, headers?: Record<string, string>): Promise<Response>;
|
|
50
|
+
private exportResponse;
|
|
37
51
|
}
|
|
38
52
|
//# sourceMappingURL=AnswersApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnswersApi.d.ts","sourceRoot":"","sources":["../../../src/apis/answers/AnswersApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EACV,MAAM,EACN,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,SAAS,CAAA;AAEhB
|
|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C,GAAG,OAAO,CAAC,QAAQ,CAAC;IAI7F;;;;;OAKG;IACH,YAAY,CAAC,KAAK,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC;YAI/E,cAAc;CAgB7B"}
|
|
@@ -2,8 +2,7 @@ import { BaseCrudApi } from "../../core/BaseCrudApi.mjs";
|
|
|
2
2
|
|
|
3
3
|
//#region src/apis/answers/AnswersApi.ts
|
|
4
4
|
/**
|
|
5
|
-
* Answers of the evaluation questions. They are written by the bot flow (`SEND_QUESTION`)
|
|
6
|
-
* CRUD routes exist but validate nothing.
|
|
5
|
+
* Answers of the evaluation questions. They are written by the bot flow (`SEND_QUESTION`).
|
|
7
6
|
*
|
|
8
7
|
* Permissions: `evaluation.view` to read, `evaluation.create`/`update`/`destroy` to write.
|
|
9
8
|
*/
|
|
@@ -43,6 +42,28 @@ var AnswersApi = class extends BaseCrudApi {
|
|
|
43
42
|
exportTxt(query, headers) {
|
|
44
43
|
return this.client.get(`${this.basePath}/exportation-txt${this.toQueryString(query)}`, headers);
|
|
45
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* The {@link exportCsv} export as the whole `Response`, to read its headers (`Content-Type`,
|
|
47
|
+
* `Content-Disposition`) as well as the body. Needs a client with `requestRaw`. Errors are thrown
|
|
48
|
+
* as in `exportCsv`.
|
|
49
|
+
* @permissions overview.evaluation.view
|
|
50
|
+
*/
|
|
51
|
+
exportCsvRaw(query, headers) {
|
|
52
|
+
return this.exportResponse("exportation-csv", "exportCsvRaw", query, headers);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The {@link exportTxt} export as the whole `Response`, to read its headers (`Content-Type`,
|
|
56
|
+
* `Content-Disposition`) as well as the body. The Content-Type is `plain/text` (not
|
|
57
|
+
* `text/plain`). Needs a client with `requestRaw`. Errors are thrown as in `exportTxt`.
|
|
58
|
+
* @permissions overview.evaluation.view
|
|
59
|
+
*/
|
|
60
|
+
exportTxtRaw(query, headers) {
|
|
61
|
+
return this.exportResponse("exportation-txt", "exportTxtRaw", query, headers);
|
|
62
|
+
}
|
|
63
|
+
async exportResponse(route, method, query, headers) {
|
|
64
|
+
if (!this.client.requestRaw) throw new Error(`${method} needs a client with requestRaw (the answer is read as a Response)`);
|
|
65
|
+
return this.client.requestRaw("GET", `${this.basePath}/${route}${this.toQueryString(query)}`, void 0, headers);
|
|
66
|
+
}
|
|
46
67
|
};
|
|
47
68
|
|
|
48
69
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnswersApi.mjs","names":[],"sources":["../../../src/apis/answers/AnswersApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { ListQuery } from '../../core/types'\nimport type {\n Answer,\n AnswersOverview,\n AnswersReportQuery,\n CreateAnswerPayload,\n UpdateAnswerPayload,\n} from './types'\n\n/**\n * Answers of the evaluation questions. They are written by the bot flow (`SEND_QUESTION`)
|
|
1
|
+
{"version":3,"file":"AnswersApi.mjs","names":[],"sources":["../../../src/apis/answers/AnswersApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { ListQuery } from '../../core/types'\nimport type {\n Answer,\n AnswersOverview,\n AnswersReportQuery,\n CreateAnswerPayload,\n UpdateAnswerPayload,\n} from './types'\n\n/**\n * Answers of the evaluation questions. They are written by the bot flow (`SEND_QUESTION`).\n *\n * Permissions: `evaluation.view` to read, `evaluation.create`/`update`/`destroy` to write.\n */\nexport class AnswersApi extends BaseCrudApi<\n Answer,\n CreateAnswerPayload,\n UpdateAnswerPayload,\n ListQuery<Answer>,\n 'OK'\n> {\n constructor(client: ApiClient) {\n super(client, '/answers')\n }\n\n /**\n * Deletes an answer (soft delete). Resolves to `'OK'`.\n * @permissions evaluation.destroy\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Counts the NPS and CSAT answers of closed tickets. An error answers 500 with a string body.\n * @permissions overview.evaluation.view\n */\n overview(query?: AnswersReportQuery, headers?: Record<string, string>): Promise<AnswersOverview> {\n return this.client.get<AnswersOverview>(\n `${this.basePath}/overview${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Exports the answers as CSV (`,`, header in the language of the user, dates in the timezone of\n * the account), sent as the attachment `evaluation-reports.csv`. An unknown `type` answers 400\n * `{ error: 'Tipo de consulta inválido' }`.\n * @permissions overview.evaluation.view\n */\n exportCsv(query?: AnswersReportQuery, headers?: Record<string, string>): Promise<string> {\n return this.client.get<string>(\n `${this.basePath}/exportation-csv${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Exports the answers as text, one block per answer and the count of unanswered ones at the\n * end, sent as the attachment `evaluation-reports.txt` (Content-Type `plain/text`). An unknown\n * `type` answers 400 `{ error: 'Tipo de consulta inválido' }`.\n * @permissions overview.evaluation.view\n */\n exportTxt(query?: AnswersReportQuery, headers?: Record<string, string>): Promise<string> {\n return this.client.get<string>(\n `${this.basePath}/exportation-txt${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * The {@link exportCsv} export as the whole `Response`, to read its headers (`Content-Type`,\n * `Content-Disposition`) as well as the body. Needs a client with `requestRaw`. Errors are thrown\n * as in `exportCsv`.\n * @permissions overview.evaluation.view\n */\n exportCsvRaw(query?: AnswersReportQuery, headers?: Record<string, string>): Promise<Response> {\n return this.exportResponse('exportation-csv', 'exportCsvRaw', query, headers)\n }\n\n /**\n * The {@link exportTxt} export as the whole `Response`, to read its headers (`Content-Type`,\n * `Content-Disposition`) as well as the body. The Content-Type is `plain/text` (not\n * `text/plain`). Needs a client with `requestRaw`. Errors are thrown as in `exportTxt`.\n * @permissions overview.evaluation.view\n */\n exportTxtRaw(query?: AnswersReportQuery, headers?: Record<string, string>): Promise<Response> {\n return this.exportResponse('exportation-txt', 'exportTxtRaw', query, headers)\n }\n\n private async exportResponse(\n route: 'exportation-csv' | 'exportation-txt',\n method: 'exportCsvRaw' | 'exportTxtRaw',\n query?: AnswersReportQuery,\n headers?: Record<string, string>,\n ): Promise<Response> {\n if (!this.client.requestRaw) {\n throw new Error(`${method} needs a client with requestRaw (the answer is read as a Response)`)\n }\n return this.client.requestRaw(\n 'GET',\n `${this.basePath}/${route}${this.toQueryString(query)}`,\n undefined,\n headers,\n )\n }\n}\n"],"mappings":";;;;;;;;AAgBA,IAAa,aAAb,cAAgC,YAM9B;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,WAAW;;;;;;CAO3B,AAAS,WAAW,IAAY,SAAiD;AAC/E,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;;CAOtC,SAAS,OAA4B,SAA4D;AAC/F,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,WAAW,KAAK,cAAc,MAAM,IACrD,QACD;;;;;;;;CASH,UAAU,OAA4B,SAAmD;AACvF,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,kBAAkB,KAAK,cAAc,MAAM,IAC5D,QACD;;;;;;;;CASH,UAAU,OAA4B,SAAmD;AACvF,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,kBAAkB,KAAK,cAAc,MAAM,IAC5D,QACD;;;;;;;;CASH,aAAa,OAA4B,SAAqD;AAC5F,SAAO,KAAK,eAAe,mBAAmB,gBAAgB,OAAO,QAAQ;;;;;;;;CAS/E,aAAa,OAA4B,SAAqD;AAC5F,SAAO,KAAK,eAAe,mBAAmB,gBAAgB,OAAO,QAAQ;;CAG/E,MAAc,eACZ,OACA,QACA,OACA,SACmB;AACnB,MAAI,CAAC,KAAK,OAAO,WACf,OAAM,IAAI,MAAM,GAAG,OAAO,oEAAoE;AAEhG,SAAO,KAAK,OAAO,WACjB,OACA,GAAG,KAAK,SAAS,GAAG,QAAQ,KAAK,cAAc,MAAM,IACrD,QACA,QACD"}
|
|
@@ -23,8 +23,7 @@ export type Answer = {
|
|
|
23
23
|
/** @deprecated The route drops every `include` (empty whitelist). */
|
|
24
24
|
export type AnswerRelationships = 'question' | 'ticket';
|
|
25
25
|
/**
|
|
26
|
-
* The
|
|
27
|
-
* saved even for an open ticket.
|
|
26
|
+
* The answer of a question of the account to a ticket of the account (an open ticket included).
|
|
28
27
|
*/
|
|
29
28
|
export type CreateAnswerPayload = {
|
|
30
29
|
text: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/answers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,MAAM,CAAA;IACV;;;OAGG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,qEAAqE;AACrE,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,QAAQ,CAAA;AAEvD
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/answers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAo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AM,CAAA;IACX,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gCAAgC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,gBAAgB,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,uGAAuG;AACvG,MAAM,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,CAAA;AAE9E,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACrD,IAAI,EAAE;QACJ,GAAG,EAAE,kBAAkB,CAAA;QACvB,mCAAmC;QACnC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QACjD,2EAA2E;QAC3E,uBAAuB,CAAC,EAAE,OAAO,CAAA;QACjC,mEAAmE;QACnE,MAAM,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;KACrD,CAAA;CACF,CAAA"}
|
|
@@ -3,8 +3,8 @@ const require_core_BaseReadApi = require('../../core/BaseReadApi.cjs');
|
|
|
3
3
|
|
|
4
4
|
//#region src/apis/authHistory/AuthHistoryApi.ts
|
|
5
5
|
/**
|
|
6
|
-
* Authentication events (auth, password_change, logout), read
|
|
7
|
-
* `authHistory.view
|
|
6
|
+
* Authentication events (auth, password_change, logout, 2fa_disabled), read with
|
|
7
|
+
* `authHistory.view`. Non-admin users can only see and access their own records.
|
|
8
8
|
*
|
|
9
9
|
* Since 4.2 `getById` has the base signature `(id, query?, headers?)`: a call written as
|
|
10
10
|
* `getById(id, headers)` with the headers in a variable still compiles, but the headers are sent
|
|
@@ -14,6 +14,13 @@ var AuthHistoryApi = class extends require_core_BaseReadApi.BaseReadApi {
|
|
|
14
14
|
constructor(client) {
|
|
15
15
|
super(client, "/auth-history");
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Records the `logout` event of the current session, as the web app does before revoking its
|
|
19
|
+
* token (revoke the token apart: this call does not). Resolves with no body.
|
|
20
|
+
*/
|
|
21
|
+
registerLogout(headers) {
|
|
22
|
+
return this.client.post(this.basePath, {}, headers);
|
|
23
|
+
}
|
|
17
24
|
};
|
|
18
25
|
|
|
19
26
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthHistoryApi.cjs","names":["BaseReadApi"],"sources":["../../../src/apis/authHistory/AuthHistoryApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseReadApi } from '../../core/BaseReadApi'\nimport type { AuthHistory } from './types'\n\n/**\n * Authentication events (auth, password_change, logout), read
|
|
1
|
+
{"version":3,"file":"AuthHistoryApi.cjs","names":["BaseReadApi"],"sources":["../../../src/apis/authHistory/AuthHistoryApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseReadApi } from '../../core/BaseReadApi'\nimport type { AuthHistory } from './types'\n\n/**\n * Authentication events (auth, password_change, logout, 2fa_disabled), read with\n * `authHistory.view`. Non-admin users can only see and access their own records.\n *\n * Since 4.2 `getById` has the base signature `(id, query?, headers?)`: a call written as\n * `getById(id, headers)` with the headers in a variable still compiles, but the headers are sent\n * as the query string — move them to the third argument.\n */\nexport class AuthHistoryApi extends BaseReadApi<AuthHistory> {\n constructor(client: ApiClient) {\n super(client, '/auth-history')\n }\n\n /**\n * Records the `logout` event of the current session, as the web app does before revoking its\n * token (revoke the token apart: this call does not). Resolves with no body.\n */\n registerLogout(headers?: Record<string, string>): Promise<void> {\n return this.client.post<void, Record<string, never>>(this.basePath, {}, headers)\n }\n}\n"],"mappings":";;;;;;;;;;;;AAYA,IAAa,iBAAb,cAAoCA,qCAAyB;CAC3D,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gBAAgB;;;;;;CAOhC,eAAe,SAAiD;AAC9D,SAAO,KAAK,OAAO,KAAkC,KAAK,UAAU,EAAE,EAAE,QAAQ"}
|
|
@@ -2,8 +2,8 @@ import type { ApiClient } from '../../core/ApiClient';
|
|
|
2
2
|
import { BaseReadApi } from '../../core/BaseReadApi';
|
|
3
3
|
import type { AuthHistory } from './types';
|
|
4
4
|
/**
|
|
5
|
-
* Authentication events (auth, password_change, logout), read
|
|
6
|
-
* `authHistory.view
|
|
5
|
+
* Authentication events (auth, password_change, logout, 2fa_disabled), read with
|
|
6
|
+
* `authHistory.view`. Non-admin users can only see and access their own records.
|
|
7
7
|
*
|
|
8
8
|
* Since 4.2 `getById` has the base signature `(id, query?, headers?)`: a call written as
|
|
9
9
|
* `getById(id, headers)` with the headers in a variable still compiles, but the headers are sent
|
|
@@ -11,5 +11,10 @@ import type { AuthHistory } from './types';
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class AuthHistoryApi extends BaseReadApi<AuthHistory> {
|
|
13
13
|
constructor(client: ApiClient);
|
|
14
|
+
/**
|
|
15
|
+
* Records the `logout` event of the current session, as the web app does before revoking its
|
|
16
|
+
* token (revoke the token apart: this call does not). Resolves with no body.
|
|
17
|
+
*/
|
|
18
|
+
registerLogout(headers?: Record<string, string>): Promise<void>;
|
|
14
19
|
}
|
|
15
20
|
//# sourceMappingURL=AuthHistoryApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthHistoryApi.d.ts","sourceRoot":"","sources":["../../../src/apis/authHistory/AuthHistoryApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,WAAW,CAAC,WAAW,CAAC;gBAC9C,MAAM,EAAE,SAAS;
|
|
1
|
+
{"version":3,"file":"AuthHistoryApi.d.ts","sourceRoot":"","sources":["../../../src/apis/authHistory/AuthHistoryApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,WAAW,CAAC,WAAW,CAAC;gBAC9C,MAAM,EAAE,SAAS;IAI7B;;;OAGG;IACH,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAGhE"}
|
|
@@ -2,8 +2,8 @@ import { BaseReadApi } from "../../core/BaseReadApi.mjs";
|
|
|
2
2
|
|
|
3
3
|
//#region src/apis/authHistory/AuthHistoryApi.ts
|
|
4
4
|
/**
|
|
5
|
-
* Authentication events (auth, password_change, logout), read
|
|
6
|
-
* `authHistory.view
|
|
5
|
+
* Authentication events (auth, password_change, logout, 2fa_disabled), read with
|
|
6
|
+
* `authHistory.view`. Non-admin users can only see and access their own records.
|
|
7
7
|
*
|
|
8
8
|
* Since 4.2 `getById` has the base signature `(id, query?, headers?)`: a call written as
|
|
9
9
|
* `getById(id, headers)` with the headers in a variable still compiles, but the headers are sent
|
|
@@ -13,6 +13,13 @@ var AuthHistoryApi = class extends BaseReadApi {
|
|
|
13
13
|
constructor(client) {
|
|
14
14
|
super(client, "/auth-history");
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Records the `logout` event of the current session, as the web app does before revoking its
|
|
18
|
+
* token (revoke the token apart: this call does not). Resolves with no body.
|
|
19
|
+
*/
|
|
20
|
+
registerLogout(headers) {
|
|
21
|
+
return this.client.post(this.basePath, {}, headers);
|
|
22
|
+
}
|
|
16
23
|
};
|
|
17
24
|
|
|
18
25
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthHistoryApi.mjs","names":[],"sources":["../../../src/apis/authHistory/AuthHistoryApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseReadApi } from '../../core/BaseReadApi'\nimport type { AuthHistory } from './types'\n\n/**\n * Authentication events (auth, password_change, logout), read
|
|
1
|
+
{"version":3,"file":"AuthHistoryApi.mjs","names":[],"sources":["../../../src/apis/authHistory/AuthHistoryApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseReadApi } from '../../core/BaseReadApi'\nimport type { AuthHistory } from './types'\n\n/**\n * Authentication events (auth, password_change, logout, 2fa_disabled), read with\n * `authHistory.view`. Non-admin users can only see and access their own records.\n *\n * Since 4.2 `getById` has the base signature `(id, query?, headers?)`: a call written as\n * `getById(id, headers)` with the headers in a variable still compiles, but the headers are sent\n * as the query string — move them to the third argument.\n */\nexport class AuthHistoryApi extends BaseReadApi<AuthHistory> {\n constructor(client: ApiClient) {\n super(client, '/auth-history')\n }\n\n /**\n * Records the `logout` event of the current session, as the web app does before revoking its\n * token (revoke the token apart: this call does not). Resolves with no body.\n */\n registerLogout(headers?: Record<string, string>): Promise<void> {\n return this.client.post<void, Record<string, never>>(this.basePath, {}, headers)\n }\n}\n"],"mappings":";;;;;;;;;;;AAYA,IAAa,iBAAb,cAAoC,YAAyB;CAC3D,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gBAAgB;;;;;;CAOhC,eAAe,SAAiD;AAC9D,SAAO,KAAK,OAAO,KAAkC,KAAK,UAAU,EAAE,EAAE,QAAQ"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { Account } from '../accounts/types';
|
|
2
2
|
import type { User } from '../users/types';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* `auth`: a login (after the second factor, when active); `password_change`: by the user, by an
|
|
5
|
+
* admin or by the password reset; `logout`: recorded by `AuthHistoryApi.registerLogout`;
|
|
6
|
+
* `2fa_disabled`: the second factor turned off, by the user or by an admin.
|
|
7
|
+
*/
|
|
8
|
+
export type AuthHistoryEvent = 'auth' | 'password_change' | 'logout' | '2fa_disabled';
|
|
4
9
|
export type AuthHistory = {
|
|
5
10
|
id: string;
|
|
6
11
|
event: AuthHistoryEvent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/authHistory/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,gBAAgB,GAAG,MAAM,GAAG,iBAAiB,GAAG,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/authHistory/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,iBAAiB,GAAG,QAAQ,GAAG,cAAc,CAAA;AAErF,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,gBAAgB,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,MAAM,CAAA"}
|
|
@@ -6,9 +6,6 @@ const require_core_BaseApi = require('../../core/BaseApi.cjs');
|
|
|
6
6
|
* Bots. The list route always paginates (`paginate: false` is ignored), so this class does not
|
|
7
7
|
* extend `BaseCrudApi`. The contexts travel as a list (`BotContextInput` / `BotParsedContext`),
|
|
8
8
|
* not as the stored map that `BotVersionsApi` serves.
|
|
9
|
-
*
|
|
10
|
-
* `GET /bots/:id/errors/export` is not exposed: it answers a binary xlsx, and `ApiClient` only
|
|
11
|
-
* handles JSON/text bodies.
|
|
12
9
|
*/
|
|
13
10
|
var BotsApi = class extends require_core_BaseApi.BaseApi {
|
|
14
11
|
basePath = "/bots";
|
|
@@ -74,9 +71,22 @@ var BotsApi = class extends require_core_BaseApi.BaseApi {
|
|
|
74
71
|
return this.client.get(`${this.basePath}/${id}/errors${this.toQueryString(query)}`, headers);
|
|
75
72
|
}
|
|
76
73
|
/**
|
|
74
|
+
* Exports the failed steps of the bot runs of the last 30 days as an xlsx workbook (binary).
|
|
75
|
+
* Needs a client with `requestRaw`. A period without errors answers 400 `No errors found to
|
|
76
|
+
* export`; an unknown bot answers 404.
|
|
77
|
+
* @permissions bots.view
|
|
78
|
+
*/
|
|
79
|
+
async exportErrors(id, headers) {
|
|
80
|
+
if (!this.client.requestRaw) throw new Error("exportErrors needs a client with requestRaw (the answer is a binary xlsx)");
|
|
81
|
+
return (await this.client.requestRaw("GET", `${this.basePath}/${id}/errors/export`, void 0, headers)).arrayBuffer();
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
77
84
|
* Fires the `API_SIGNAL` trigger of the bot for the contact, with an optional `flag` (read by
|
|
78
85
|
* the `api_signal_flag` condition). Asynchronous: always resolves with no content, and the
|
|
79
|
-
* worker only runs it when the contact has an open ticket.
|
|
86
|
+
* worker only runs it when the contact has an open ticket. The worker runs the flow of `botId`
|
|
87
|
+
* on the engine of the bot of the contact's connection (see `BotSettings.botCreatedVersion`; when
|
|
88
|
+
* the connection has no bot, the engine of the `botId` bot). `triggerSignal` does not reach the
|
|
89
|
+
* bot simulator (there the `API_SIGNAL` path is picked by hand, with no `flag`).
|
|
80
90
|
* @permissions bots.view
|
|
81
91
|
*/
|
|
82
92
|
triggerSignal(botId, contactId, flag, headers) {
|
|
@@ -94,9 +104,8 @@ var BotsApi = class extends require_core_BaseApi.BaseApi {
|
|
|
94
104
|
}
|
|
95
105
|
/**
|
|
96
106
|
* Generates a prompt for an AI agent of the bot. COSTS one AI agent credit of the account and
|
|
97
|
-
* calls OpenAI.
|
|
98
|
-
*
|
|
99
|
-
* (`Agent limit reached`), answers 500.
|
|
107
|
+
* calls OpenAI. A missing field answers 400; an option outside the lists, or the AI agent limit
|
|
108
|
+
* of the account reached (`Agent limit reached`), answers 500.
|
|
100
109
|
*/
|
|
101
110
|
suggestAgentPrompt(body, headers) {
|
|
102
111
|
return this.client.post(`${this.basePath}/suggest-agent-prompt`, body, headers);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BotsApi.cjs","names":["BaseApi"],"sources":["../../../src/apis/bots/BotsApi.ts"],"sourcesContent":["import { BaseApi } from '../../core/BaseApi'\nimport type {\n GetByIdQuery,\n HasCreate,\n HasDeleteById,\n HasGetById,\n HasUpdateById,\n ListQuery,\n Paginated,\n} from '../../core/types'\nimport type {\n Bot,\n BotErrorsQuery,\n BotHistory,\n CreateBotPayload,\n SuggestAgentPromptPayload,\n UpdateBotPayload,\n} from './types'\n\n/**\n * Bots. The list route always paginates (`paginate: false` is ignored), so this class does not\n * extend `BaseCrudApi`. The contexts travel as a list (`BotContextInput` / `BotParsedContext`),\n * not as the stored map that `BotVersionsApi` serves.\n
|
|
1
|
+
{"version":3,"file":"BotsApi.cjs","names":["BaseApi"],"sources":["../../../src/apis/bots/BotsApi.ts"],"sourcesContent":["import { BaseApi } from '../../core/BaseApi'\nimport type {\n GetByIdQuery,\n HasCreate,\n HasDeleteById,\n HasGetById,\n HasUpdateById,\n ListQuery,\n Paginated,\n} from '../../core/types'\nimport type {\n Bot,\n BotErrorsQuery,\n BotHistory,\n CreateBotPayload,\n SuggestAgentPromptPayload,\n UpdateBotPayload,\n} from './types'\n\n/**\n * Bots. The list route always paginates (`paginate: false` is ignored), so this class does not\n * extend `BaseCrudApi`. The contexts travel as a list (`BotContextInput` / `BotParsedContext`),\n * not as the stored map that `BotVersionsApi` serves.\n */\nexport class BotsApi\n extends BaseApi\n implements\n HasGetById<Bot>,\n HasCreate<Bot, CreateBotPayload>,\n HasUpdateById<Bot, UpdateBotPayload>,\n HasDeleteById<'OK' | false>\n{\n public readonly basePath = '/bots'\n\n /**\n * Lists the bots of the account. Always paginated, even with `paginate: false`.\n * @permissions bots.view\n */\n getMany(query?: ListQuery<Bot>, headers?: Record<string, string>): Promise<Paginated<Bot>> {\n return this.client.get<Paginated<Bot>>(`${this.basePath}${this.toQueryString(query)}`, headers)\n }\n\n /**\n * Returns the first bot matching the query, or `null` when none match.\n * @permissions bots.view\n */\n async getOne(query?: ListQuery<Bot>, headers?: Record<string, string>): Promise<Bot | null> {\n const page = await this.getMany({ ...query, perPage: 1, page: 1 }, headers)\n return page?.data?.[0] ?? null\n }\n\n /**\n * Returns a bot by ID, with `defaultContexts` (the stored map, as a JSON string). An unknown id\n * answers 500, not an empty body.\n * @permissions bots.view\n */\n getById(id: string, query?: GetByIdQuery<Bot>, headers?: Record<string, string>): Promise<Bot> {\n return this.client.get<Bot>(`${this.basePath}/${id}${this.toQueryString(query)}`, headers)\n }\n\n /**\n * Creates a bot and its first version (published, or a draft with `isDraft`). A duplicate name\n * answers 409, unless the account allows duplicate names. Send `flowJson` with `edges`, or the\n * bot never sends a message (SD-2323).\n * @permissions bots.create\n */\n create(body: CreateBotPayload, headers?: Record<string, string>): Promise<Bot> {\n return this.client.post<Bot, CreateBotPayload>(this.basePath, body, headers)\n }\n\n /**\n * Saves the flow (publishing a version, or into the draft with `isDraft`), or only renames the\n * bot with `onlyUpdateBotName`. Resolves to the bot with `defaultContexts` as an object.\n * @permissions bots.view OR bots.update\n */\n updateById(id: string, body: UpdateBotPayload, headers?: Record<string, string>): Promise<Bot> {\n return this.client.put<Bot, UpdateBotPayload>(`${this.basePath}/${id}`, body, headers)\n }\n\n /**\n * Deletes a bot and its versions (hard delete). Today resolves to `false` even when the bot was\n * deleted (the backend destroy returns nothing); it becomes `'OK'` once the destroy returns the\n * bot, as in the other routes. Do not read the result as success or failure. An unknown id\n * answers 500.\n * @permissions bots.view OR bots.destroy\n */\n deleteById(id: string, headers?: Record<string, string>): Promise<'OK' | false> {\n return this.client.delete<'OK' | false>(`${this.basePath}/${id}`, headers)\n }\n\n /**\n * Lists the failed steps of the bot runs, newest first by default. An unknown bot answers an\n * empty page.\n * @permissions bots.view\n */\n getErrors(\n id: string,\n query?: BotErrorsQuery,\n headers?: Record<string, string>,\n ): Promise<Paginated<BotHistory>> {\n return this.client.get<Paginated<BotHistory>>(\n `${this.basePath}/${id}/errors${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Exports the failed steps of the bot runs of the last 30 days as an xlsx workbook (binary).\n * Needs a client with `requestRaw`. A period without errors answers 400 `No errors found to\n * export`; an unknown bot answers 404.\n * @permissions bots.view\n */\n async exportErrors(id: string, headers?: Record<string, string>): Promise<ArrayBuffer> {\n if (!this.client.requestRaw) {\n throw new Error('exportErrors needs a client with requestRaw (the answer is a binary xlsx)')\n }\n const response = await this.client.requestRaw(\n 'GET',\n `${this.basePath}/${id}/errors/export`,\n undefined,\n headers,\n )\n return response.arrayBuffer()\n }\n\n /**\n * Fires the `API_SIGNAL` trigger of the bot for the contact, with an optional `flag` (read by\n * the `api_signal_flag` condition). Asynchronous: always resolves with no content, and the\n * worker only runs it when the contact has an open ticket. The worker runs the flow of `botId`\n * on the engine of the bot of the contact's connection (see `BotSettings.botCreatedVersion`; when\n * the connection has no bot, the engine of the `botId` bot). `triggerSignal` does not reach the\n * bot simulator (there the `API_SIGNAL` path is picked by hand, with no `flag`).\n * @permissions bots.view\n */\n triggerSignal(\n botId: string,\n contactId: string,\n flag?: string,\n headers?: Record<string, string>,\n ): Promise<void> {\n return this.client.post<void, { flag: string } | undefined>(\n `${this.basePath}/${botId}/trigger-signal/${contactId}`,\n flag === undefined ? undefined : { flag },\n headers,\n )\n }\n\n /**\n * Answers a pending asynchronous `HTTP_REQUEST` action: `body` becomes the response the bot\n * reads. Resolves with no content. An unknown history answers 404; a history that is not\n * `PENDING`, or of another bot, answers 400. JSON bodies only (the route also takes text, XML\n * and CSV), up to 250 KB.\n * @permissions bots.view\n */\n requestCallback(\n id: string,\n pendingRequestId: string,\n body: unknown,\n headers?: Record<string, string>,\n ): Promise<void> {\n return this.client.post<void, unknown>(\n `${this.basePath}/${id}/request-callback/${pendingRequestId}`,\n body,\n headers,\n )\n }\n\n /**\n * Generates a prompt for an AI agent of the bot. COSTS one AI agent credit of the account and\n * calls OpenAI. A missing field answers 400; an option outside the lists, or the AI agent limit\n * of the account reached (`Agent limit reached`), answers 500.\n */\n suggestAgentPrompt(\n body: SuggestAgentPromptPayload,\n headers?: Record<string, string>,\n ): Promise<string> {\n return this.client.post<string, SuggestAgentPromptPayload>(\n `${this.basePath}/suggest-agent-prompt`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;;;;;;;AAwBA,IAAa,UAAb,cACUA,6BAMV;CACE,AAAgB,WAAW;;;;;CAM3B,QAAQ,OAAwB,SAA2D;AACzF,SAAO,KAAK,OAAO,IAAoB,GA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GAAG,oBAAoB,oBAC3C,MACA,QACD;;;;;;;CAQH,mBACE,MACA,SACiB;AACjB,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,wBACjB,MACA,QACD"}
|
|
@@ -5,9 +5,6 @@ import type { Bot, BotErrorsQuery, BotHistory, CreateBotPayload, SuggestAgentPro
|
|
|
5
5
|
* Bots. The list route always paginates (`paginate: false` is ignored), so this class does not
|
|
6
6
|
* extend `BaseCrudApi`. The contexts travel as a list (`BotContextInput` / `BotParsedContext`),
|
|
7
7
|
* not as the stored map that `BotVersionsApi` serves.
|
|
8
|
-
*
|
|
9
|
-
* `GET /bots/:id/errors/export` is not exposed: it answers a binary xlsx, and `ApiClient` only
|
|
10
|
-
* handles JSON/text bodies.
|
|
11
8
|
*/
|
|
12
9
|
export declare class BotsApi extends BaseApi implements HasGetById<Bot>, HasCreate<Bot, CreateBotPayload>, HasUpdateById<Bot, UpdateBotPayload>, HasDeleteById<'OK' | false> {
|
|
13
10
|
readonly basePath = "/bots";
|
|
@@ -54,10 +51,20 @@ export declare class BotsApi extends BaseApi implements HasGetById<Bot>, HasCrea
|
|
|
54
51
|
* @permissions bots.view
|
|
55
52
|
*/
|
|
56
53
|
getErrors(id: string, query?: BotErrorsQuery, headers?: Record<string, string>): Promise<Paginated<BotHistory>>;
|
|
54
|
+
/**
|
|
55
|
+
* Exports the failed steps of the bot runs of the last 30 days as an xlsx workbook (binary).
|
|
56
|
+
* Needs a client with `requestRaw`. A period without errors answers 400 `No errors found to
|
|
57
|
+
* export`; an unknown bot answers 404.
|
|
58
|
+
* @permissions bots.view
|
|
59
|
+
*/
|
|
60
|
+
exportErrors(id: string, headers?: Record<string, string>): Promise<ArrayBuffer>;
|
|
57
61
|
/**
|
|
58
62
|
* Fires the `API_SIGNAL` trigger of the bot for the contact, with an optional `flag` (read by
|
|
59
63
|
* the `api_signal_flag` condition). Asynchronous: always resolves with no content, and the
|
|
60
|
-
* worker only runs it when the contact has an open ticket.
|
|
64
|
+
* worker only runs it when the contact has an open ticket. The worker runs the flow of `botId`
|
|
65
|
+
* on the engine of the bot of the contact's connection (see `BotSettings.botCreatedVersion`; when
|
|
66
|
+
* the connection has no bot, the engine of the `botId` bot). `triggerSignal` does not reach the
|
|
67
|
+
* bot simulator (there the `API_SIGNAL` path is picked by hand, with no `flag`).
|
|
61
68
|
* @permissions bots.view
|
|
62
69
|
*/
|
|
63
70
|
triggerSignal(botId: string, contactId: string, flag?: string, headers?: Record<string, string>): Promise<void>;
|
|
@@ -71,9 +78,8 @@ export declare class BotsApi extends BaseApi implements HasGetById<Bot>, HasCrea
|
|
|
71
78
|
requestCallback(id: string, pendingRequestId: string, body: unknown, headers?: Record<string, string>): Promise<void>;
|
|
72
79
|
/**
|
|
73
80
|
* Generates a prompt for an AI agent of the bot. COSTS one AI agent credit of the account and
|
|
74
|
-
* calls OpenAI.
|
|
75
|
-
*
|
|
76
|
-
* (`Agent limit reached`), answers 500.
|
|
81
|
+
* calls OpenAI. A missing field answers 400; an option outside the lists, or the AI agent limit
|
|
82
|
+
* of the account reached (`Agent limit reached`), answers 500.
|
|
77
83
|
*/
|
|
78
84
|
suggestAgentPrompt(body: SuggestAgentPromptPayload, headers?: Record<string, string>): Promise<string>;
|
|
79
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BotsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/bots/BotsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,aAAa,EACb,SAAS,EACT,SAAS,EACV,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EACV,GAAG,EACH,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,yBAAyB,EACzB,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAEhB
|
|
1
|
+
{"version":3,"file":"BotsApi.d.ts","sourceRoot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