@ikatec/digisac-api-sdk 4.0.0 → 4.2.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 +34 -4
- package/dist/apis/authHistory/AuthHistoryApi.cjs +11 -17
- package/dist/apis/authHistory/AuthHistoryApi.cjs.map +1 -1
- package/dist/apis/authHistory/AuthHistoryApi.d.ts +10 -18
- package/dist/apis/authHistory/AuthHistoryApi.d.ts.map +1 -1
- package/dist/apis/authHistory/AuthHistoryApi.mjs +11 -15
- package/dist/apis/authHistory/AuthHistoryApi.mjs.map +1 -1
- package/dist/apis/authHistory/types.d.ts +4 -3
- package/dist/apis/authHistory/types.d.ts.map +1 -1
- package/dist/apis/clientFeedback/ClientFeedbackApi.cjs +2 -5
- package/dist/apis/clientFeedback/ClientFeedbackApi.cjs.map +1 -1
- package/dist/apis/clientFeedback/ClientFeedbackApi.d.ts +2 -4
- package/dist/apis/clientFeedback/ClientFeedbackApi.d.ts.map +1 -1
- package/dist/apis/clientFeedback/ClientFeedbackApi.mjs +3 -5
- package/dist/apis/clientFeedback/ClientFeedbackApi.mjs.map +1 -1
- package/dist/apis/contacts/ContactsApi.cjs +2 -2
- package/dist/apis/contacts/ContactsApi.cjs.map +1 -1
- package/dist/apis/contacts/ContactsApi.mjs +2 -2
- package/dist/apis/contacts/ContactsApi.mjs.map +1 -1
- package/dist/apis/customFields/types.d.ts +21 -19
- package/dist/apis/customFields/types.d.ts.map +1 -1
- package/dist/apis/dashboard/DashboardApi.cjs +19 -0
- package/dist/apis/dashboard/DashboardApi.cjs.map +1 -0
- package/dist/apis/dashboard/DashboardApi.d.ts +12 -0
- package/dist/apis/dashboard/DashboardApi.d.ts.map +1 -0
- package/dist/apis/dashboard/DashboardApi.mjs +18 -0
- package/dist/apis/dashboard/DashboardApi.mjs.map +1 -0
- package/dist/apis/dashboard/index.cjs +4 -0
- package/dist/apis/dashboard/index.d.ts +3 -0
- package/dist/apis/dashboard/index.d.ts.map +1 -0
- package/dist/apis/dashboard/index.mjs +3 -0
- package/dist/apis/dashboard/types.cjs +0 -0
- package/dist/apis/dashboard/types.d.ts +53 -0
- package/dist/apis/dashboard/types.d.ts.map +1 -0
- package/dist/apis/dashboard/types.mjs +0 -0
- package/dist/apis/holiday/types.d.ts +34 -8
- package/dist/apis/holiday/types.d.ts.map +1 -1
- package/dist/apis/index.cjs +6 -0
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.d.ts.map +1 -1
- package/dist/apis/index.mjs +5 -1
- package/dist/apis/me/MeApi.cjs +2 -5
- package/dist/apis/me/MeApi.cjs.map +1 -1
- package/dist/apis/me/MeApi.d.ts +2 -4
- package/dist/apis/me/MeApi.d.ts.map +1 -1
- package/dist/apis/me/MeApi.mjs +3 -5
- package/dist/apis/me/MeApi.mjs.map +1 -1
- package/dist/apis/now/NowApi.cjs +37 -0
- package/dist/apis/now/NowApi.cjs.map +1 -0
- package/dist/apis/now/NowApi.d.ts +26 -0
- package/dist/apis/now/NowApi.d.ts.map +1 -0
- package/dist/apis/now/NowApi.mjs +36 -0
- package/dist/apis/now/NowApi.mjs.map +1 -0
- package/dist/apis/now/index.cjs +4 -0
- package/dist/apis/now/index.d.ts +3 -0
- package/dist/apis/now/index.d.ts.map +1 -0
- package/dist/apis/now/index.mjs +3 -0
- package/dist/apis/now/types.cjs +0 -0
- package/dist/apis/now/types.d.ts +45 -0
- package/dist/apis/now/types.d.ts.map +1 -0
- package/dist/apis/now/types.mjs +0 -0
- package/dist/apis/people/types.d.ts +7 -2
- package/dist/apis/people/types.d.ts.map +1 -1
- package/dist/apis/permissions/PermissionsApi.cjs +6 -2
- package/dist/apis/permissions/PermissionsApi.cjs.map +1 -1
- package/dist/apis/permissions/PermissionsApi.d.ts +7 -3
- package/dist/apis/permissions/PermissionsApi.d.ts.map +1 -1
- package/dist/apis/permissions/PermissionsApi.mjs +6 -2
- package/dist/apis/permissions/PermissionsApi.mjs.map +1 -1
- package/dist/apis/permissions/types.d.ts +4 -14
- package/dist/apis/permissions/types.d.ts.map +1 -1
- package/dist/apis/personalAccessTokens/PersonalAccessTokensApi.cjs +5 -0
- package/dist/apis/personalAccessTokens/PersonalAccessTokensApi.cjs.map +1 -1
- package/dist/apis/personalAccessTokens/PersonalAccessTokensApi.d.ts +5 -0
- package/dist/apis/personalAccessTokens/PersonalAccessTokensApi.d.ts.map +1 -1
- package/dist/apis/personalAccessTokens/PersonalAccessTokensApi.mjs +5 -0
- package/dist/apis/personalAccessTokens/PersonalAccessTokensApi.mjs.map +1 -1
- package/dist/apis/personalAccessTokens/types.d.ts +23 -4
- package/dist/apis/personalAccessTokens/types.d.ts.map +1 -1
- package/dist/apis/roles/RolesApi.cjs.map +1 -1
- package/dist/apis/roles/RolesApi.d.ts +2 -2
- package/dist/apis/roles/RolesApi.d.ts.map +1 -1
- package/dist/apis/roles/RolesApi.mjs.map +1 -1
- package/dist/apis/roles/types.d.ts +27 -4
- package/dist/apis/roles/types.d.ts.map +1 -1
- package/dist/apis/serviceAccessManagement/ServiceAccessManagementApi.cjs +3 -9
- package/dist/apis/serviceAccessManagement/ServiceAccessManagementApi.cjs.map +1 -1
- package/dist/apis/serviceAccessManagement/ServiceAccessManagementApi.d.ts +3 -4
- package/dist/apis/serviceAccessManagement/ServiceAccessManagementApi.d.ts.map +1 -1
- package/dist/apis/serviceAccessManagement/ServiceAccessManagementApi.mjs +3 -7
- package/dist/apis/serviceAccessManagement/ServiceAccessManagementApi.mjs.map +1 -1
- package/dist/apis/stickerUsers/StickerUsersApi.cjs +3 -9
- package/dist/apis/stickerUsers/StickerUsersApi.cjs.map +1 -1
- package/dist/apis/stickerUsers/StickerUsersApi.d.ts +3 -4
- package/dist/apis/stickerUsers/StickerUsersApi.d.ts.map +1 -1
- package/dist/apis/stickerUsers/StickerUsersApi.mjs +3 -7
- package/dist/apis/stickerUsers/StickerUsersApi.mjs.map +1 -1
- package/dist/apis/terms/TermsApi.cjs +7 -13
- package/dist/apis/terms/TermsApi.cjs.map +1 -1
- package/dist/apis/terms/TermsApi.d.ts +6 -5
- package/dist/apis/terms/TermsApi.d.ts.map +1 -1
- package/dist/apis/terms/TermsApi.mjs +7 -11
- package/dist/apis/terms/TermsApi.mjs.map +1 -1
- package/dist/apis/timetable/types.d.ts +12 -7
- package/dist/apis/timetable/types.d.ts.map +1 -1
- package/dist/apis/transcripts/TranscriptsApi.cjs +2 -5
- package/dist/apis/transcripts/TranscriptsApi.cjs.map +1 -1
- package/dist/apis/transcripts/TranscriptsApi.d.ts +2 -4
- package/dist/apis/transcripts/TranscriptsApi.d.ts.map +1 -1
- package/dist/apis/transcripts/TranscriptsApi.mjs +3 -5
- package/dist/apis/transcripts/TranscriptsApi.mjs.map +1 -1
- package/dist/core/ApiClient.d.ts +3 -0
- package/dist/core/ApiClient.d.ts.map +1 -1
- package/dist/core/ArchivableCrudApi.cjs +0 -2
- package/dist/core/ArchivableCrudApi.cjs.map +1 -1
- package/dist/core/ArchivableCrudApi.d.ts.map +1 -1
- package/dist/core/ArchivableCrudApi.mjs +0 -2
- package/dist/core/ArchivableCrudApi.mjs.map +1 -1
- package/dist/core/BaseApi.cjs +34 -0
- package/dist/core/BaseApi.cjs.map +1 -0
- package/dist/core/BaseApi.d.ts +20 -0
- package/dist/core/BaseApi.d.ts.map +1 -0
- package/dist/core/BaseApi.mjs +33 -0
- package/dist/core/BaseApi.mjs.map +1 -0
- package/dist/core/BaseApiClient.cjs +4 -1
- package/dist/core/BaseApiClient.cjs.map +1 -1
- package/dist/core/BaseApiClient.d.ts +7 -1
- package/dist/core/BaseApiClient.d.ts.map +1 -1
- package/dist/core/BaseApiClient.mjs +4 -1
- package/dist/core/BaseApiClient.mjs.map +1 -1
- package/dist/core/BaseCrudApi.cjs +3 -40
- package/dist/core/BaseCrudApi.cjs.map +1 -1
- package/dist/core/BaseCrudApi.d.ts +4 -23
- package/dist/core/BaseCrudApi.d.ts.map +1 -1
- package/dist/core/BaseCrudApi.mjs +3 -38
- package/dist/core/BaseCrudApi.mjs.map +1 -1
- package/dist/core/BaseReadApi.cjs +44 -0
- package/dist/core/BaseReadApi.cjs.map +1 -0
- package/dist/core/BaseReadApi.d.ts +32 -0
- package/dist/core/BaseReadApi.d.ts.map +1 -0
- package/dist/core/BaseReadApi.mjs +43 -0
- package/dist/core/BaseReadApi.mjs.map +1 -0
- package/dist/core/bindMethods.cjs +24 -0
- package/dist/core/bindMethods.cjs.map +1 -0
- package/dist/core/bindMethods.d.ts +7 -0
- package/dist/core/bindMethods.d.ts.map +1 -0
- package/dist/core/bindMethods.mjs +22 -0
- package/dist/core/bindMethods.mjs.map +1 -0
- package/dist/core/index.cjs +4 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.mjs +3 -1
- package/dist/core/queryString.cjs +22 -0
- package/dist/core/queryString.cjs.map +1 -0
- package/dist/core/queryString.d.ts +14 -0
- package/dist/core/queryString.d.ts.map +1 -0
- package/dist/core/queryString.mjs +18 -0
- package/dist/core/queryString.mjs.map +1 -0
- package/dist/core/types.d.ts +2 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/withQueryFormat.cjs +42 -0
- package/dist/core/withQueryFormat.cjs.map +1 -0
- package/dist/core/withQueryFormat.d.ts +10 -0
- package/dist/core/withQueryFormat.d.ts.map +1 -0
- package/dist/core/withQueryFormat.mjs +40 -0
- package/dist/core/withQueryFormat.mjs.map +1 -0
- package/dist/index.cjs +4 -0
- package/dist/index.mjs +3 -1
- package/package.json +1 -1
- package/src/apis/authHistory/AuthHistoryApi.test.ts +11 -3
- package/src/apis/authHistory/AuthHistoryApi.ts +11 -37
- package/src/apis/authHistory/types.ts +4 -3
- package/src/apis/campaigns/CampaignsApi.test.ts +1 -1
- package/src/apis/clientFeedback/ClientFeedbackApi.ts +5 -7
- package/src/apis/contacts/ContactsApi.test.ts +1 -1
- package/src/apis/contacts/ContactsApi.ts +2 -2
- package/src/apis/customFields/types.ts +21 -25
- package/src/apis/dashboard/DashboardApi.test.ts +82 -0
- package/src/apis/dashboard/DashboardApi.ts +18 -0
- package/src/apis/dashboard/index.ts +2 -0
- package/src/apis/dashboard/types.ts +53 -0
- package/src/apis/holiday/types.ts +36 -8
- package/src/apis/index.ts +2 -0
- package/src/apis/me/MeApi.ts +2 -8
- package/src/apis/messages/MessagesApi.test.ts +2 -2
- package/src/apis/now/NowApi.test.ts +125 -0
- package/src/apis/now/NowApi.ts +59 -0
- package/src/apis/now/index.ts +2 -0
- package/src/apis/now/types.ts +47 -0
- package/src/apis/payloads.test-d.ts +39 -0
- package/src/apis/payloads.test.ts +81 -0
- package/src/apis/people/types.ts +7 -2
- package/src/apis/permissions/PermissionsApi.test.ts +93 -0
- package/src/apis/permissions/PermissionsApi.ts +7 -7
- package/src/apis/permissions/types.ts +4 -16
- package/src/apis/personalAccessTokens/PersonalAccessTokensApi.ts +5 -0
- package/src/apis/personalAccessTokens/types.ts +25 -4
- package/src/apis/queryFormat.test.ts +273 -0
- package/src/apis/roles/RolesApi.ts +7 -2
- package/src/apis/roles/types.ts +27 -4
- package/src/apis/serviceAccessManagement/ServiceAccessManagementApi.test.ts +2 -2
- package/src/apis/serviceAccessManagement/ServiceAccessManagementApi.ts +10 -10
- package/src/apis/stickerUsers/StickerUsersApi.test.ts +1 -1
- package/src/apis/stickerUsers/StickerUsersApi.ts +7 -10
- package/src/apis/terms/TermsApi.ts +7 -13
- package/src/apis/timetable/types.ts +13 -7
- package/src/apis/transcripts/TranscriptsApi.ts +2 -7
- package/src/core/ApiClient.ts +4 -0
- package/src/core/ArchivableCrudApi.ts +0 -2
- package/src/core/BaseApi.test.ts +164 -0
- package/src/core/BaseApi.ts +32 -0
- package/src/core/BaseApiClient.test.ts +10 -0
- package/src/core/BaseApiClient.ts +9 -1
- package/src/core/BaseCrudApi.test-d.ts +9 -0
- package/src/core/BaseCrudApi.test.ts +131 -60
- package/src/core/BaseCrudApi.ts +7 -63
- package/src/core/BaseReadApi.ts +70 -0
- package/src/core/bindMethods.ts +26 -0
- package/src/core/index.ts +4 -0
- package/src/core/queryString.test.ts +71 -0
- package/src/core/queryString.ts +30 -0
- package/src/core/types.ts +5 -0
- package/src/core/withQueryFormat.test.ts +136 -0
- package/src/core/withQueryFormat.ts +47 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filters of the service statistics (`/dashboard`). Every field is optional; the period defaults to
|
|
3
|
+
* the last 7 days.
|
|
4
|
+
*/
|
|
5
|
+
export type DashboardQuery = {
|
|
6
|
+
/** ISO date-time. Default: 7 days ago, 00:00. */
|
|
7
|
+
startPeriod?: string;
|
|
8
|
+
/** ISO date-time. Default: the end of the `startPeriod` day (or of today). */
|
|
9
|
+
endPeriod?: string;
|
|
10
|
+
/** Which ticket date the period filters: opening (default) or closing. */
|
|
11
|
+
periodType?: 'openDate' | 'closeDate';
|
|
12
|
+
/** Ticket status (`closed`, not `close`). */
|
|
13
|
+
status?: 'all' | 'open' | 'closed';
|
|
14
|
+
/**
|
|
15
|
+
* A department id, a list of ids, or `all`. Only applied together with `departmentParticipation`:
|
|
16
|
+
* without it the backend ignores `departmentId` and answers the totals of every department.
|
|
17
|
+
*/
|
|
18
|
+
departmentId?: string | string[];
|
|
19
|
+
/**
|
|
20
|
+
* Whether the department must be the ticket's last one or any one it went through. Required for
|
|
21
|
+
* `departmentId` to filter; sent WITHOUT `departmentId`, it filters the tickets with no department.
|
|
22
|
+
*/
|
|
23
|
+
departmentParticipation?: 'last' | 'middle';
|
|
24
|
+
/**
|
|
25
|
+
* A user id, a list of ids, or `all`. Only applied together with `userParticipation`: without it
|
|
26
|
+
* the backend ignores `userId` and answers the totals of every user.
|
|
27
|
+
*/
|
|
28
|
+
userId?: string | string[];
|
|
29
|
+
/**
|
|
30
|
+
* Whether the user must be the ticket's last one or any one it went through. Required for `userId`
|
|
31
|
+
* to filter; sent WITHOUT `userId`, it filters the tickets with no user.
|
|
32
|
+
*/
|
|
33
|
+
userParticipation?: 'last' | 'middle';
|
|
34
|
+
userStatus?: 'active' | 'archived' | 'all';
|
|
35
|
+
serviceId?: string | string[];
|
|
36
|
+
tagId?: string | string[];
|
|
37
|
+
ticketTopicId?: string | string[];
|
|
38
|
+
};
|
|
39
|
+
/** `GET /dashboard/general` — counts of the period. Times are in seconds. */
|
|
40
|
+
export type DashboardGeneral = {
|
|
41
|
+
sentMessagesCount: number;
|
|
42
|
+
receivedMessagesCount: number;
|
|
43
|
+
totalMessagesCount: number;
|
|
44
|
+
openedTicketsCount: number;
|
|
45
|
+
closedTicketsCount: number;
|
|
46
|
+
totalTicketsCount: number;
|
|
47
|
+
waitingTime: number;
|
|
48
|
+
waitingTimeAfterBot: number;
|
|
49
|
+
waitingTimeAvg: number;
|
|
50
|
+
ticketTime: number;
|
|
51
|
+
contactsCount: number;
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/dashboard/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,UAAU,GAAG,WAAW,CAAA;IACrC,6CAA6C;IAC7C,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAA;IAClC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAChC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IAC3C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IACrC,UAAU,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,KAAK,CAAA;IAC1C,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAClC,CAAA;AAED,6EAA6E;AAC7E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,iBAAiB,EAAE,MAAM,CAAA;IACzB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,iBAAiB,EAAE,MAAM,CAAA;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA"}
|
|
File without changes
|
|
@@ -1,24 +1,50 @@
|
|
|
1
|
+
import type { Account } from '../accounts/types';
|
|
2
|
+
import type { File } from '../files/types';
|
|
3
|
+
/**
|
|
4
|
+
* A holiday: the account's services answer `message` during the period `from`–`to`.
|
|
5
|
+
* Holidays are soft-deleted, but `deletedAt` is never returned.
|
|
6
|
+
*/
|
|
1
7
|
export type Holiday = {
|
|
2
8
|
id: string;
|
|
3
9
|
name: string;
|
|
4
10
|
from: string;
|
|
5
11
|
to: string;
|
|
6
12
|
message: string;
|
|
13
|
+
/** Whether the period is over. */
|
|
14
|
+
expired: boolean;
|
|
15
|
+
/** Number of attached files (computed on the listing, derived from `files` on the detail). */
|
|
16
|
+
filesCount: number;
|
|
17
|
+
/**
|
|
18
|
+
* Attached files — always an array. Only loaded on `getById` (or when listed with
|
|
19
|
+
* `include: ['files']`): `getMany` answers `[]` even when the holiday has files, so use
|
|
20
|
+
* `filesCount` there.
|
|
21
|
+
*/
|
|
22
|
+
files: File[];
|
|
7
23
|
accountId: string;
|
|
8
24
|
createdAt: string;
|
|
9
|
-
|
|
10
|
-
|
|
25
|
+
/** Virtual attribute of the model — may be absent. */
|
|
26
|
+
updatedAt?: string | null;
|
|
27
|
+
account?: Account;
|
|
28
|
+
};
|
|
29
|
+
export type HolidayRelationships = 'account' | 'files';
|
|
30
|
+
/** A file attached by id (up to 10 per holiday). */
|
|
31
|
+
export type HolidayFileRef = {
|
|
32
|
+
id: string;
|
|
11
33
|
};
|
|
12
34
|
export type CreateHolidayPayload = {
|
|
35
|
+
/** Up to 255 characters. */
|
|
13
36
|
name: string;
|
|
37
|
+
/** Date string. A period overlapping another holiday answers 402 "Holiday time already exists.". */
|
|
14
38
|
from: string;
|
|
39
|
+
/** Date string. */
|
|
15
40
|
to: string;
|
|
41
|
+
/** Up to 1024 characters. */
|
|
16
42
|
message: string;
|
|
43
|
+
files?: HolidayFileRef[];
|
|
17
44
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
45
|
+
/**
|
|
46
|
+
* The backend requires name, from, to and message on every update (same validator as the create).
|
|
47
|
+
* Omitting `files` keeps the current attachments.
|
|
48
|
+
*/
|
|
49
|
+
export type UpdateHolidayPayload = CreateHolidayPayload;
|
|
24
50
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/holiday/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/holiday/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,8FAA8F;IAC9F,UAAU,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEzB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,OAAO,CAAA;AAEtD,oDAAoD;AACpD,MAAM,MAAM,cAAc,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3C,MAAM,MAAM,oBAAoB,GAAG;IACjC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,oGAAoG;IACpG,IAAI,EAAE,MAAM,CAAA;IACZ,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,cAAc,EAAE,CAAA;CACzB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAA"}
|
package/dist/apis/index.cjs
CHANGED
|
@@ -34,6 +34,8 @@ const require_apis_creditMovements_CreditMovementsApi = require('./creditMovemen
|
|
|
34
34
|
require('./creditMovements/index.cjs');
|
|
35
35
|
const require_apis_customFields_CustomFieldsApi = require('./customFields/CustomFieldsApi.cjs');
|
|
36
36
|
require('./customFields/index.cjs');
|
|
37
|
+
const require_apis_dashboard_DashboardApi = require('./dashboard/DashboardApi.cjs');
|
|
38
|
+
require('./dashboard/index.cjs');
|
|
37
39
|
const require_apis_departments_DepartmentsApi = require('./departments/DepartmentsApi.cjs');
|
|
38
40
|
require('./departments/index.cjs');
|
|
39
41
|
const require_apis_distribution_DistributionApi = require('./distribution/DistributionApi.cjs');
|
|
@@ -62,6 +64,8 @@ const require_apis_messages_MessagesApi = require('./messages/MessagesApi.cjs');
|
|
|
62
64
|
require('./messages/index.cjs');
|
|
63
65
|
const require_apis_notifications_NotificationsApi = require('./notifications/NotificationsApi.cjs');
|
|
64
66
|
require('./notifications/index.cjs');
|
|
67
|
+
const require_apis_now_NowApi = require('./now/NowApi.cjs');
|
|
68
|
+
require('./now/index.cjs');
|
|
65
69
|
const require_apis_organizations_OrganizationsApi = require('./organizations/OrganizationsApi.cjs');
|
|
66
70
|
require('./organizations/index.cjs');
|
|
67
71
|
const require_apis_people_PeopleApi = require('./people/PeopleApi.cjs');
|
|
@@ -128,6 +132,7 @@ exports.ContactBlockListsControlsApi = require_apis_contactBlockListsControls_Co
|
|
|
128
132
|
exports.ContactsApi = require_apis_contacts_ContactsApi.ContactsApi;
|
|
129
133
|
exports.CreditMovementsApi = require_apis_creditMovements_CreditMovementsApi.CreditMovementsApi;
|
|
130
134
|
exports.CustomFieldsApi = require_apis_customFields_CustomFieldsApi.CustomFieldsApi;
|
|
135
|
+
exports.DashboardApi = require_apis_dashboard_DashboardApi.DashboardApi;
|
|
131
136
|
exports.DepartmentsApi = require_apis_departments_DepartmentsApi.DepartmentsApi;
|
|
132
137
|
exports.DistributionApi = require_apis_distribution_DistributionApi.DistributionApi;
|
|
133
138
|
exports.FilesApi = require_apis_files_FilesApi.FilesApi;
|
|
@@ -142,6 +147,7 @@ exports.KnowledgeBaseItemApi = require_apis_knowledgeBaseItem_KnowledgeBaseItemA
|
|
|
142
147
|
exports.MeApi = require_apis_me_MeApi.MeApi;
|
|
143
148
|
exports.MessagesApi = require_apis_messages_MessagesApi.MessagesApi;
|
|
144
149
|
exports.NotificationsApi = require_apis_notifications_NotificationsApi.NotificationsApi;
|
|
150
|
+
exports.NowApi = require_apis_now_NowApi.NowApi;
|
|
145
151
|
exports.OrganizationsApi = require_apis_organizations_OrganizationsApi.OrganizationsApi;
|
|
146
152
|
exports.PeopleApi = require_apis_people_PeopleApi.PeopleApi;
|
|
147
153
|
exports.PermissionsApi = require_apis_permissions_PermissionsApi.PermissionsApi;
|
package/dist/apis/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './contactBlockListsControls';
|
|
|
15
15
|
export * from './contacts';
|
|
16
16
|
export * from './creditMovements';
|
|
17
17
|
export * from './customFields';
|
|
18
|
+
export * from './dashboard';
|
|
18
19
|
export * from './departments';
|
|
19
20
|
export * from './distribution';
|
|
20
21
|
export * from './files';
|
|
@@ -29,6 +30,7 @@ export * from './knowledgeBaseItem';
|
|
|
29
30
|
export * from './me';
|
|
30
31
|
export * from './messages';
|
|
31
32
|
export * from './notifications';
|
|
33
|
+
export * from './now';
|
|
32
34
|
export * from './organizations';
|
|
33
35
|
export * from './people';
|
|
34
36
|
export * from './permissions';
|
package/dist/apis/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,q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,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,6BAA6B,CAAA"}
|
package/dist/apis/index.mjs
CHANGED
|
@@ -33,6 +33,8 @@ import { CreditMovementsApi } from "./creditMovements/CreditMovementsApi.mjs";
|
|
|
33
33
|
import "./creditMovements/index.mjs";
|
|
34
34
|
import { CustomFieldsApi } from "./customFields/CustomFieldsApi.mjs";
|
|
35
35
|
import "./customFields/index.mjs";
|
|
36
|
+
import { DashboardApi } from "./dashboard/DashboardApi.mjs";
|
|
37
|
+
import "./dashboard/index.mjs";
|
|
36
38
|
import { DepartmentsApi } from "./departments/DepartmentsApi.mjs";
|
|
37
39
|
import "./departments/index.mjs";
|
|
38
40
|
import { DistributionApi } from "./distribution/DistributionApi.mjs";
|
|
@@ -61,6 +63,8 @@ import { MessagesApi } from "./messages/MessagesApi.mjs";
|
|
|
61
63
|
import "./messages/index.mjs";
|
|
62
64
|
import { NotificationsApi } from "./notifications/NotificationsApi.mjs";
|
|
63
65
|
import "./notifications/index.mjs";
|
|
66
|
+
import { NowApi } from "./now/NowApi.mjs";
|
|
67
|
+
import "./now/index.mjs";
|
|
64
68
|
import { OrganizationsApi } from "./organizations/OrganizationsApi.mjs";
|
|
65
69
|
import "./organizations/index.mjs";
|
|
66
70
|
import { PeopleApi } from "./people/PeopleApi.mjs";
|
|
@@ -110,4 +114,4 @@ import "./webhooks/index.mjs";
|
|
|
110
114
|
import { WhatsappBusinessTemplatesApi } from "./whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.mjs";
|
|
111
115
|
import "./whatsappBusinessTemplates/index.mjs";
|
|
112
116
|
|
|
113
|
-
export { AbsenceApi, AcceptanceTermsApi, AccountsApi, ActivityLogApi, AnswersApi, AuthHistoryApi, BotVersionsApi, BotsApi, CampaignsApi, CardsApi, CategoriesApi, ClientFeedbackApi, ContactBlockListsApi, ContactBlockListsControlsApi, ContactsApi, CreditMovementsApi, CustomFieldsApi, DepartmentsApi, DistributionApi, FilesApi, HolidayApi, IntegrationsApi, InteractiveMessagesApi, KanbanBoardsApi, KanbanCardsApi, KanbanColumnsApi, KnowledgeBaseApi, KnowledgeBaseItemApi, MeApi, MessagesApi, NotificationsApi, OrganizationsApi, PeopleApi, PermissionsApi, PersonalAccessTokensApi, PipelineApi, PlanAiHistoryApi, QuestionsApi, QuickRepliesApi, RolesApi, ScheduleApi, ServiceAccessManagementApi, ServiceEventsApi, ServicesApi, StickerUsersApi, StickersApi, TagsApi, TermsApi, TicketTopicsApi, TicketsApi, TimetableApi, TranscriptsApi, UsersApi, WebhooksApi, WhatsappBusinessTemplatesApi, scopes_exports as scopes };
|
|
117
|
+
export { AbsenceApi, AcceptanceTermsApi, AccountsApi, ActivityLogApi, AnswersApi, AuthHistoryApi, BotVersionsApi, BotsApi, CampaignsApi, CardsApi, CategoriesApi, ClientFeedbackApi, ContactBlockListsApi, ContactBlockListsControlsApi, ContactsApi, CreditMovementsApi, CustomFieldsApi, DashboardApi, DepartmentsApi, DistributionApi, FilesApi, HolidayApi, IntegrationsApi, InteractiveMessagesApi, KanbanBoardsApi, KanbanCardsApi, KanbanColumnsApi, KnowledgeBaseApi, KnowledgeBaseItemApi, MeApi, MessagesApi, NotificationsApi, NowApi, OrganizationsApi, PeopleApi, PermissionsApi, PersonalAccessTokensApi, PipelineApi, PlanAiHistoryApi, QuestionsApi, QuickRepliesApi, RolesApi, ScheduleApi, ServiceAccessManagementApi, ServiceEventsApi, ServicesApi, StickerUsersApi, StickersApi, TagsApi, TermsApi, TicketTopicsApi, TicketsApi, TimetableApi, TranscriptsApi, UsersApi, WebhooksApi, WhatsappBusinessTemplatesApi, scopes_exports as scopes };
|
package/dist/apis/me/MeApi.cjs
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_core_BaseApi = require('../../core/BaseApi.cjs');
|
|
2
3
|
|
|
3
4
|
//#region src/apis/me/MeApi.ts
|
|
4
|
-
var MeApi = class {
|
|
5
|
-
client;
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
5
|
+
var MeApi = class extends require_core_BaseApi.BaseApi {
|
|
9
6
|
/**
|
|
10
7
|
* Returns the currently authenticated user, including their roles, departments, and timetable.
|
|
11
8
|
* @permissions users.view
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MeApi.cjs","names":[],"sources":["../../../src/apis/me/MeApi.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"MeApi.cjs","names":["BaseApi"],"sources":["../../../src/apis/me/MeApi.ts"],"sourcesContent":["import { BaseApi } from '../../core/BaseApi'\nimport type { Account } from '../accounts/types'\nimport type { User } from '../users/types'\nimport type {\n RegisterTokenPayload,\n SetOtpSecretKeyPayload,\n TakeoverPayload,\n UpdateMeAccountPayload,\n UpdateMePayload,\n UpdateMeStatusPayload,\n} from './types'\n\nexport class MeApi extends BaseApi {\n /**\n * Returns the currently authenticated user, including their roles, departments, and timetable.\n * @permissions users.view\n */\n getMe(headers?: Record<string, string>): Promise<User> {\n return this.client.get<User>('/me', headers)\n }\n\n /** Returns the account associated with the currently authenticated user. */\n getAccount(headers?: Record<string, string>): Promise<Account> {\n return this.client.get<Account>('/me/account', headers)\n }\n\n /**\n * Returns credit and usage amounts for the current account.\n * Excludes Digisac's own internal credit amounts.\n */\n getAccountAmounts(headers?: Record<string, string>): Promise<Record<string, unknown>> {\n return this.client.get<Record<string, unknown>>('/me/get-account-amounts', headers)\n }\n\n /**\n * Returns a URL to the Agnus billing/plan management page for the current account.\n * @permissions myAccount.myPlan\n */\n getAgnusMyPlanUrl(headers?: Record<string, string>): Promise<{ url: string }> {\n return this.client.get<{ url: string }>('/me/account/agnus-my-plan-url', headers)\n }\n\n /**\n * Updates the current user's profile fields such as name, language, and preferences.\n * If a new password is provided, it is validated against the last 6 password history entries\n * and all existing access tokens for the user are revoked.\n */\n updateMe(body: UpdateMePayload, headers?: Record<string, string>): Promise<User> {\n return this.client.put<User, UpdateMePayload>('/me', body, headers)\n }\n\n /** Updates account-level settings such as name, settings object, wizard progress, and default department. */\n updateAccount(body: UpdateMeAccountPayload, headers?: Record<string, string>): Promise<Account> {\n return this.client.put<Account, UpdateMeAccountPayload>('/me/account', body, headers)\n }\n\n /**\n * Updates the presence status of the current user (`online`, `offline`, or `away`).\n * If setting to `online`, validates the user's timetable first — if outside working hours,\n * the status is set to `offline` instead.\n */\n updateStatus(body: UpdateMeStatusPayload, headers?: Record<string, string>): Promise<User> {\n return this.client.put<User, UpdateMeStatusPayload>('/me/status', body, headers)\n }\n\n /**\n * Extends the grace period for the current account when it has expired or is about to expire.\n * Returns the updated account.\n */\n extendAccountGracePeriod(headers?: Record<string, string>): Promise<Account> {\n return this.client.post<Account>('/me/account/extend-grace-period', undefined, headers)\n }\n\n /**\n * Registers a OneSignal push notification token for the current user.\n * Used to enable push notifications on mobile/web clients.\n */\n registerToken(body: RegisterTokenPayload, headers?: Record<string, string>): Promise<void> {\n return this.client.post<void, RegisterTokenPayload>(\n '/me/one-signal/register-token',\n body,\n headers,\n )\n }\n\n /** Marks the current user's first login as complete by setting `isFirstLogin` to `false`. */\n reportFirstLogin(headers?: Record<string, string>): Promise<User> {\n return this.client.post<User>('/me/report-login', undefined, headers)\n }\n\n /**\n * Sets the current user's status to `online` for the given client and emits a takeover event,\n * which signals other connected sessions to yield control to this one.\n */\n takeover(body?: TakeoverPayload, headers?: Record<string, string>): Promise<void> {\n return this.client.post<void, TakeoverPayload>('/me/takeover', body, headers)\n }\n\n /**\n * Stores a 16-character OTP secret key on the current user.\n * This must be called before activating OTP authentication via `activateOtpAuth`.\n */\n setOtpSecretKey(body: SetOtpSecretKeyPayload, headers?: Record<string, string>): Promise<void> {\n return this.client.patch<void, SetOtpSecretKeyPayload>('/me/set-otp-secret-key', body, headers)\n }\n\n /**\n * Activates OTP (two-factor) authentication for the current user.\n * Requires the `x-digisac-otp` header with a valid TOTP token generated from the secret key\n * previously set via `setOtpSecretKey`.\n */\n activateOtpAuth(headers?: Record<string, string>): Promise<boolean> {\n return this.client.post<boolean>('/me/activate-otp-auth', undefined, headers)\n }\n}\n"],"mappings":";;;;AAYA,IAAa,QAAb,cAA2BA,6BAAQ;;;;;CAKjC,MAAM,SAAiD;AACrD,SAAO,KAAK,OAAO,IAAU,OAAO,QAAQ;;;CAI9C,WAAW,SAAoD;AAC7D,SAAO,KAAK,OAAO,IAAa,eAAe,QAAQ;;;;;;CAOzD,kBAAkB,SAAoE;AACpF,SAAO,KAAK,OAAO,IAA6B,2BAA2B,QAAQ;;;;;;CAOrF,kBAAkB,SAA4D;AAC5E,SAAO,KAAK,OAAO,IAAqB,iCAAiC,QAAQ;;;;;;;CAQnF,SAAS,MAAuB,SAAiD;AAC/E,SAAO,KAAK,OAAO,IAA2B,OAAO,MAAM,QAAQ;;;CAIrE,cAAc,MAA8B,SAAoD;AAC9F,SAAO,KAAK,OAAO,IAAqC,eAAe,MAAM,QAAQ;;;;;;;CAQvF,aAAa,MAA6B,SAAiD;AACzF,SAAO,KAAK,OAAO,IAAiC,cAAc,MAAM,QAAQ;;;;;;CAOlF,yBAAyB,SAAoD;AAC3E,SAAO,KAAK,OAAO,KAAc,mCAAmC,QAAW,QAAQ;;;;;;CAOzF,cAAc,MAA4B,SAAiD;AACzF,SAAO,KAAK,OAAO,KACjB,iCACA,MACA,QACD;;;CAIH,iBAAiB,SAAiD;AAChE,SAAO,KAAK,OAAO,KAAW,oBAAoB,QAAW,QAAQ;;;;;;CAOvE,SAAS,MAAwB,SAAiD;AAChF,SAAO,KAAK,OAAO,KAA4B,gBAAgB,MAAM,QAAQ;;;;;;CAO/E,gBAAgB,MAA8B,SAAiD;AAC7F,SAAO,KAAK,OAAO,MAAoC,0BAA0B,MAAM,QAAQ;;;;;;;CAQjG,gBAAgB,SAAoD;AAClE,SAAO,KAAK,OAAO,KAAc,yBAAyB,QAAW,QAAQ"}
|
package/dist/apis/me/MeApi.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BaseApi } from '../../core/BaseApi';
|
|
2
2
|
import type { Account } from '../accounts/types';
|
|
3
3
|
import type { User } from '../users/types';
|
|
4
4
|
import type { RegisterTokenPayload, SetOtpSecretKeyPayload, TakeoverPayload, UpdateMeAccountPayload, UpdateMePayload, UpdateMeStatusPayload } from './types';
|
|
5
|
-
export declare class MeApi {
|
|
6
|
-
protected readonly client: ApiClient;
|
|
7
|
-
constructor(client: ApiClient);
|
|
5
|
+
export declare class MeApi extends BaseApi {
|
|
8
6
|
/**
|
|
9
7
|
* Returns the currently authenticated user, including their roles, departments, and timetable.
|
|
10
8
|
* @permissions users.view
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MeApi.d.ts","sourceRoot":"","sources":["../../../src/apis/me/MeApi.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"MeApi.d.ts","sourceRoot":"","sources":["../../../src/apis/me/MeApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAEhB,qBAAa,KAAM,SAAQ,OAAO;IAChC;;;OAGG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAItD,4EAA4E;IAC5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ACH,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjF;;;OAGG;IACH,eAAe,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9F;;;;OAIG;IACH,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;CAGpE"}
|
package/dist/apis/me/MeApi.mjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { BaseApi } from "../../core/BaseApi.mjs";
|
|
2
|
+
|
|
1
3
|
//#region src/apis/me/MeApi.ts
|
|
2
|
-
var MeApi = class {
|
|
3
|
-
client;
|
|
4
|
-
constructor(client) {
|
|
5
|
-
this.client = client;
|
|
6
|
-
}
|
|
4
|
+
var MeApi = class extends BaseApi {
|
|
7
5
|
/**
|
|
8
6
|
* Returns the currently authenticated user, including their roles, departments, and timetable.
|
|
9
7
|
* @permissions users.view
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MeApi.mjs","names":[],"sources":["../../../src/apis/me/MeApi.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"MeApi.mjs","names":[],"sources":["../../../src/apis/me/MeApi.ts"],"sourcesContent":["import { BaseApi } from '../../core/BaseApi'\nimport type { Account } from '../accounts/types'\nimport type { User } from '../users/types'\nimport type {\n RegisterTokenPayload,\n SetOtpSecretKeyPayload,\n TakeoverPayload,\n UpdateMeAccountPayload,\n UpdateMePayload,\n UpdateMeStatusPayload,\n} from './types'\n\nexport class MeApi extends BaseApi {\n /**\n * Returns the currently authenticated user, including their roles, departments, and timetable.\n * @permissions users.view\n */\n getMe(headers?: Record<string, string>): Promise<User> {\n return this.client.get<User>('/me', headers)\n }\n\n /** Returns the account associated with the currently authenticated user. */\n getAccount(headers?: Record<string, string>): Promise<Account> {\n return this.client.get<Account>('/me/account', headers)\n }\n\n /**\n * Returns credit and usage amounts for the current account.\n * Excludes Digisac's own internal credit amounts.\n */\n getAccountAmounts(headers?: Record<string, string>): Promise<Record<string, unknown>> {\n return this.client.get<Record<string, unknown>>('/me/get-account-amounts', headers)\n }\n\n /**\n * Returns a URL to the Agnus billing/plan management page for the current account.\n * @permissions myAccount.myPlan\n */\n getAgnusMyPlanUrl(headers?: Record<string, string>): Promise<{ url: string }> {\n return this.client.get<{ url: string }>('/me/account/agnus-my-plan-url', headers)\n }\n\n /**\n * Updates the current user's profile fields such as name, language, and preferences.\n * If a new password is provided, it is validated against the last 6 password history entries\n * and all existing access tokens for the user are revoked.\n */\n updateMe(body: UpdateMePayload, headers?: Record<string, string>): Promise<User> {\n return this.client.put<User, UpdateMePayload>('/me', body, headers)\n }\n\n /** Updates account-level settings such as name, settings object, wizard progress, and default department. */\n updateAccount(body: UpdateMeAccountPayload, headers?: Record<string, string>): Promise<Account> {\n return this.client.put<Account, UpdateMeAccountPayload>('/me/account', body, headers)\n }\n\n /**\n * Updates the presence status of the current user (`online`, `offline`, or `away`).\n * If setting to `online`, validates the user's timetable first — if outside working hours,\n * the status is set to `offline` instead.\n */\n updateStatus(body: UpdateMeStatusPayload, headers?: Record<string, string>): Promise<User> {\n return this.client.put<User, UpdateMeStatusPayload>('/me/status', body, headers)\n }\n\n /**\n * Extends the grace period for the current account when it has expired or is about to expire.\n * Returns the updated account.\n */\n extendAccountGracePeriod(headers?: Record<string, string>): Promise<Account> {\n return this.client.post<Account>('/me/account/extend-grace-period', undefined, headers)\n }\n\n /**\n * Registers a OneSignal push notification token for the current user.\n * Used to enable push notifications on mobile/web clients.\n */\n registerToken(body: RegisterTokenPayload, headers?: Record<string, string>): Promise<void> {\n return this.client.post<void, RegisterTokenPayload>(\n '/me/one-signal/register-token',\n body,\n headers,\n )\n }\n\n /** Marks the current user's first login as complete by setting `isFirstLogin` to `false`. */\n reportFirstLogin(headers?: Record<string, string>): Promise<User> {\n return this.client.post<User>('/me/report-login', undefined, headers)\n }\n\n /**\n * Sets the current user's status to `online` for the given client and emits a takeover event,\n * which signals other connected sessions to yield control to this one.\n */\n takeover(body?: TakeoverPayload, headers?: Record<string, string>): Promise<void> {\n return this.client.post<void, TakeoverPayload>('/me/takeover', body, headers)\n }\n\n /**\n * Stores a 16-character OTP secret key on the current user.\n * This must be called before activating OTP authentication via `activateOtpAuth`.\n */\n setOtpSecretKey(body: SetOtpSecretKeyPayload, headers?: Record<string, string>): Promise<void> {\n return this.client.patch<void, SetOtpSecretKeyPayload>('/me/set-otp-secret-key', body, headers)\n }\n\n /**\n * Activates OTP (two-factor) authentication for the current user.\n * Requires the `x-digisac-otp` header with a valid TOTP token generated from the secret key\n * previously set via `setOtpSecretKey`.\n */\n activateOtpAuth(headers?: Record<string, string>): Promise<boolean> {\n return this.client.post<boolean>('/me/activate-otp-auth', undefined, headers)\n }\n}\n"],"mappings":";;;AAYA,IAAa,QAAb,cAA2B,QAAQ;;;;;CAKjC,MAAM,SAAiD;AACrD,SAAO,KAAK,OAAO,IAAU,OAAO,QAAQ;;;CAI9C,WAAW,SAAoD;AAC7D,SAAO,KAAK,OAAO,IAAa,eAAe,QAAQ;;;;;;CAOzD,kBAAkB,SAAoE;AACpF,SAAO,KAAK,OAAO,IAA6B,2BAA2B,QAAQ;;;;;;CAOrF,kBAAkB,SAA4D;AAC5E,SAAO,KAAK,OAAO,IAAqB,iCAAiC,QAAQ;;;;;;;CAQnF,SAAS,MAAuB,SAAiD;AAC/E,SAAO,KAAK,OAAO,IAA2B,OAAO,MAAM,QAAQ;;;CAIrE,cAAc,MAA8B,SAAoD;AAC9F,SAAO,KAAK,OAAO,IAAqC,eAAe,MAAM,QAAQ;;;;;;;CAQvF,aAAa,MAA6B,SAAiD;AACzF,SAAO,KAAK,OAAO,IAAiC,cAAc,MAAM,QAAQ;;;;;;CAOlF,yBAAyB,SAAoD;AAC3E,SAAO,KAAK,OAAO,KAAc,mCAAmC,QAAW,QAAQ;;;;;;CAOzF,cAAc,MAA4B,SAAiD;AACzF,SAAO,KAAK,OAAO,KACjB,iCACA,MACA,QACD;;;CAIH,iBAAiB,SAAiD;AAChE,SAAO,KAAK,OAAO,KAAW,oBAAoB,QAAW,QAAQ;;;;;;CAOvE,SAAS,MAAwB,SAAiD;AAChF,SAAO,KAAK,OAAO,KAA4B,gBAAgB,MAAM,QAAQ;;;;;;CAO/E,gBAAgB,MAA8B,SAAiD;AAC7F,SAAO,KAAK,OAAO,MAAoC,0BAA0B,MAAM,QAAQ;;;;;;;CAQjG,gBAAgB,SAAoD;AAClE,SAAO,KAAK,OAAO,KAAc,yBAAyB,QAAW,QAAQ"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_core_BaseApi = require('../../core/BaseApi.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/apis/now/NowApi.ts
|
|
5
|
+
/**
|
|
6
|
+
* The "Agora" (now) overview: live totals of tickets and attendants. Every route requires
|
|
7
|
+
* `overview.now.view.all` or `overview.now.view.departments` (the latter is scoped to the user's
|
|
8
|
+
* departments).
|
|
9
|
+
*/
|
|
10
|
+
var NowApi = class extends require_core_BaseApi.BaseApi {
|
|
11
|
+
basePath = "/now";
|
|
12
|
+
/**
|
|
13
|
+
* Account totals: open/queued tickets, attendants with/without attendance and online/offline/absent users.
|
|
14
|
+
* @permissions overview.now.view.all | overview.now.view.departments
|
|
15
|
+
*/
|
|
16
|
+
getResume(query, headers) {
|
|
17
|
+
return this.client.get(`${this.basePath}/resume${this.toQueryString(query)}`, headers);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Per-attendant totals (name, departments, status and open tickets).
|
|
21
|
+
* @permissions overview.now.view.all | overview.now.view.departments
|
|
22
|
+
*/
|
|
23
|
+
getAttendanceResume(query, headers) {
|
|
24
|
+
return this.client.get(`${this.basePath}/attendance-resume${this.toQueryString(query)}`, headers);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Per-department totals (online/offline/absent users, queued and open tickets).
|
|
28
|
+
* @permissions overview.now.view.all | overview.now.view.departments
|
|
29
|
+
*/
|
|
30
|
+
getDepartmentsResume(query, headers) {
|
|
31
|
+
return this.client.get(`${this.basePath}/departments-resume${this.toQueryString(query)}`, headers);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
exports.NowApi = NowApi;
|
|
37
|
+
//# sourceMappingURL=NowApi.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NowApi.cjs","names":["BaseApi"],"sources":["../../../src/apis/now/NowApi.ts"],"sourcesContent":["import { BaseApi } from '../../core/BaseApi'\nimport type {\n NowAttendanceResume,\n NowDepartmentResume,\n NowQuery,\n NowResponse,\n NowResumeTotals,\n} from './types'\n\n/**\n * The \"Agora\" (now) overview: live totals of tickets and attendants. Every route requires\n * `overview.now.view.all` or `overview.now.view.departments` (the latter is scoped to the user's\n * departments).\n */\nexport class NowApi extends BaseApi {\n public readonly basePath = '/now'\n\n /**\n * Account totals: open/queued tickets, attendants with/without attendance and online/offline/absent users.\n * @permissions overview.now.view.all | overview.now.view.departments\n */\n getResume(\n query?: NowQuery,\n headers?: Record<string, string>,\n ): Promise<NowResponse<NowResumeTotals>> {\n return this.client.get<NowResponse<NowResumeTotals>>(\n `${this.basePath}/resume${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Per-attendant totals (name, departments, status and open tickets).\n * @permissions overview.now.view.all | overview.now.view.departments\n */\n getAttendanceResume(\n query?: NowQuery,\n headers?: Record<string, string>,\n ): Promise<NowResponse<NowAttendanceResume[]>> {\n return this.client.get<NowResponse<NowAttendanceResume[]>>(\n `${this.basePath}/attendance-resume${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Per-department totals (online/offline/absent users, queued and open tickets).\n * @permissions overview.now.view.all | overview.now.view.departments\n */\n getDepartmentsResume(\n query?: NowQuery,\n headers?: Record<string, string>,\n ): Promise<NowResponse<NowDepartmentResume[]>> {\n return this.client.get<NowResponse<NowDepartmentResume[]>>(\n `${this.basePath}/departments-resume${this.toQueryString(query)}`,\n headers,\n )\n }\n}\n"],"mappings":";;;;;;;;;AAcA,IAAa,SAAb,cAA4BA,6BAAQ;CAClC,AAAgB,WAAW;;;;;CAM3B,UACE,OACA,SACuC;AACvC,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,SAAS,KAAK,cAAc,MAAM,IACnD,QACD;;;;;;CAOH,oBACE,OACA,SAC6C;AAC7C,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,oBAAoB,KAAK,cAAc,MAAM,IAC9D,QACD;;;;;;CAOH,qBACE,OACA,SAC6C;AAC7C,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,qBAAqB,KAAK,cAAc,MAAM,IAC/D,QACD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseApi } from '../../core/BaseApi';
|
|
2
|
+
import type { NowAttendanceResume, NowDepartmentResume, NowQuery, NowResponse, NowResumeTotals } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* The "Agora" (now) overview: live totals of tickets and attendants. Every route requires
|
|
5
|
+
* `overview.now.view.all` or `overview.now.view.departments` (the latter is scoped to the user's
|
|
6
|
+
* departments).
|
|
7
|
+
*/
|
|
8
|
+
export declare class NowApi extends BaseApi {
|
|
9
|
+
readonly basePath = "/now";
|
|
10
|
+
/**
|
|
11
|
+
* Account totals: open/queued tickets, attendants with/without attendance and online/offline/absent users.
|
|
12
|
+
* @permissions overview.now.view.all | overview.now.view.departments
|
|
13
|
+
*/
|
|
14
|
+
getResume(query?: NowQuery, headers?: Record<string, string>): Promise<NowResponse<NowResumeTotals>>;
|
|
15
|
+
/**
|
|
16
|
+
* Per-attendant totals (name, departments, status and open tickets).
|
|
17
|
+
* @permissions overview.now.view.all | overview.now.view.departments
|
|
18
|
+
*/
|
|
19
|
+
getAttendanceResume(query?: NowQuery, headers?: Record<string, string>): Promise<NowResponse<NowAttendanceResume[]>>;
|
|
20
|
+
/**
|
|
21
|
+
* Per-department totals (online/offline/absent users, queued and open tickets).
|
|
22
|
+
* @permissions overview.now.view.all | overview.now.view.departments
|
|
23
|
+
*/
|
|
24
|
+
getDepartmentsResume(query?: NowQuery, headers?: Record<string, string>): Promise<NowResponse<NowDepartmentResume[]>>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=NowApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NowApi.d.ts","sourceRoot":"","sources":["../../../src/apis/now/NowApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,eAAe,EAChB,MAAM,SAAS,CAAA;AAEhB;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,OAAO;IACjC,SAAgB,QAAQ,UAAS;IAEjC;;;OAGG;IACH,SAAS,CACP,KAAK,CAAC,EAAE,QAAQ,EAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAOxC;;;OAGG;IACH,mBAAmB,CACjB,KAAK,CAAC,EAAE,QAAQ,EAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,WAAW,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAO9C;;;OAGG;IACH,oBAAoB,CAClB,KAAK,CAAC,EAAE,QAAQ,EAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,WAAW,CAAC,mBAAmB,EAAE,CAAC,CAAC;CAM/C"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BaseApi } from "../../core/BaseApi.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/apis/now/NowApi.ts
|
|
4
|
+
/**
|
|
5
|
+
* The "Agora" (now) overview: live totals of tickets and attendants. Every route requires
|
|
6
|
+
* `overview.now.view.all` or `overview.now.view.departments` (the latter is scoped to the user's
|
|
7
|
+
* departments).
|
|
8
|
+
*/
|
|
9
|
+
var NowApi = class extends BaseApi {
|
|
10
|
+
basePath = "/now";
|
|
11
|
+
/**
|
|
12
|
+
* Account totals: open/queued tickets, attendants with/without attendance and online/offline/absent users.
|
|
13
|
+
* @permissions overview.now.view.all | overview.now.view.departments
|
|
14
|
+
*/
|
|
15
|
+
getResume(query, headers) {
|
|
16
|
+
return this.client.get(`${this.basePath}/resume${this.toQueryString(query)}`, headers);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Per-attendant totals (name, departments, status and open tickets).
|
|
20
|
+
* @permissions overview.now.view.all | overview.now.view.departments
|
|
21
|
+
*/
|
|
22
|
+
getAttendanceResume(query, headers) {
|
|
23
|
+
return this.client.get(`${this.basePath}/attendance-resume${this.toQueryString(query)}`, headers);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Per-department totals (online/offline/absent users, queued and open tickets).
|
|
27
|
+
* @permissions overview.now.view.all | overview.now.view.departments
|
|
28
|
+
*/
|
|
29
|
+
getDepartmentsResume(query, headers) {
|
|
30
|
+
return this.client.get(`${this.basePath}/departments-resume${this.toQueryString(query)}`, headers);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { NowApi };
|
|
36
|
+
//# sourceMappingURL=NowApi.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NowApi.mjs","names":[],"sources":["../../../src/apis/now/NowApi.ts"],"sourcesContent":["import { BaseApi } from '../../core/BaseApi'\nimport type {\n NowAttendanceResume,\n NowDepartmentResume,\n NowQuery,\n NowResponse,\n NowResumeTotals,\n} from './types'\n\n/**\n * The \"Agora\" (now) overview: live totals of tickets and attendants. Every route requires\n * `overview.now.view.all` or `overview.now.view.departments` (the latter is scoped to the user's\n * departments).\n */\nexport class NowApi extends BaseApi {\n public readonly basePath = '/now'\n\n /**\n * Account totals: open/queued tickets, attendants with/without attendance and online/offline/absent users.\n * @permissions overview.now.view.all | overview.now.view.departments\n */\n getResume(\n query?: NowQuery,\n headers?: Record<string, string>,\n ): Promise<NowResponse<NowResumeTotals>> {\n return this.client.get<NowResponse<NowResumeTotals>>(\n `${this.basePath}/resume${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Per-attendant totals (name, departments, status and open tickets).\n * @permissions overview.now.view.all | overview.now.view.departments\n */\n getAttendanceResume(\n query?: NowQuery,\n headers?: Record<string, string>,\n ): Promise<NowResponse<NowAttendanceResume[]>> {\n return this.client.get<NowResponse<NowAttendanceResume[]>>(\n `${this.basePath}/attendance-resume${this.toQueryString(query)}`,\n headers,\n )\n }\n\n /**\n * Per-department totals (online/offline/absent users, queued and open tickets).\n * @permissions overview.now.view.all | overview.now.view.departments\n */\n getDepartmentsResume(\n query?: NowQuery,\n headers?: Record<string, string>,\n ): Promise<NowResponse<NowDepartmentResume[]>> {\n return this.client.get<NowResponse<NowDepartmentResume[]>>(\n `${this.basePath}/departments-resume${this.toQueryString(query)}`,\n headers,\n )\n }\n}\n"],"mappings":";;;;;;;;AAcA,IAAa,SAAb,cAA4B,QAAQ;CAClC,AAAgB,WAAW;;;;;CAM3B,UACE,OACA,SACuC;AACvC,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,SAAS,KAAK,cAAc,MAAM,IACnD,QACD;;;;;;CAOH,oBACE,OACA,SAC6C;AAC7C,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,oBAAoB,KAAK,cAAc,MAAM,IAC9D,QACD;;;;;;CAOH,qBACE,OACA,SAC6C;AAC7C,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,qBAAqB,KAAK,cAAc,MAAM,IAC/D,QACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/apis/now/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,mBAAmB,SAAS,CAAA"}
|
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { User } from '../users/types';
|
|
2
|
+
/**
|
|
3
|
+
* Filters of the "Agora" (now) overview. Each accepts one id, an array or a comma-separated list.
|
|
4
|
+
* A user with only `overview.now.view.departments` gets 403 for departments/users outside their
|
|
5
|
+
* departments.
|
|
6
|
+
*/
|
|
7
|
+
export type NowQuery = {
|
|
8
|
+
departmentId?: string | string[];
|
|
9
|
+
userId?: string | string[];
|
|
10
|
+
};
|
|
11
|
+
/** Every `/now` route answers its data under `totals`. */
|
|
12
|
+
export type NowResponse<T> = {
|
|
13
|
+
totals: T;
|
|
14
|
+
};
|
|
15
|
+
export type NowResumeTotals = {
|
|
16
|
+
openTickets: number;
|
|
17
|
+
queueTickets: number;
|
|
18
|
+
usersWithAttendance: number;
|
|
19
|
+
usersWithoutAttendance: number;
|
|
20
|
+
/** Postgres `avg()` — a numeric string, or `0` when there is no data. */
|
|
21
|
+
averageOpenTicketsTime: number | string;
|
|
22
|
+
/** Postgres `avg()` — a numeric string, or `0` when there is no data. */
|
|
23
|
+
averageOpenTicketsWaitTime: number | string;
|
|
24
|
+
onlineUsersCount: number;
|
|
25
|
+
offlineUsersCount: number;
|
|
26
|
+
absentUsersCount: number;
|
|
27
|
+
};
|
|
28
|
+
/** One entry per department. */
|
|
29
|
+
export type NowDepartmentResume = {
|
|
30
|
+
name: string;
|
|
31
|
+
onlineUserCount: number;
|
|
32
|
+
offlineUserCount: number;
|
|
33
|
+
absentUserCount: number;
|
|
34
|
+
onQueueTicketCount: number;
|
|
35
|
+
openTicketCount: number;
|
|
36
|
+
};
|
|
37
|
+
/** One entry per attendant (user). */
|
|
38
|
+
export type NowAttendanceResume = {
|
|
39
|
+
name?: string;
|
|
40
|
+
/** Department names — `0` when the attendant has no department. */
|
|
41
|
+
departments: string[] | 0;
|
|
42
|
+
status?: User['status'];
|
|
43
|
+
ticketsOpenCount: number;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/now/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC3B,CAAA;AAED,0DAA0D;AAC1D,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAAA;AAE1C,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,sBAAsB,EAAE,MAAM,CAAA;IAC9B,yEAAyE;IACzE,sBAAsB,EAAE,MAAM,GAAG,MAAM,CAAA;IACvC,yEAAyE;IACzE,0BAA0B,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3C,gBAAgB,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,MAAM,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,gCAAgC;AAChC,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,eAAe,EAAE,MAAM,CAAA;IACvB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,eAAe,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,sCAAsC;AACtC,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,WAAW,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,MAAM,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAAA"}
|
|
File without changes
|
|
@@ -13,10 +13,15 @@ export type Person = {
|
|
|
13
13
|
export type PersonRelationships = 'organizations' | 'contacts';
|
|
14
14
|
export type CreatePersonPayload = {
|
|
15
15
|
name: string;
|
|
16
|
-
document?: string;
|
|
16
|
+
document?: string | null;
|
|
17
|
+
/** Organizations of the account to link the person to (400 if any belongs to another account). */
|
|
18
|
+
organizationIds?: string[];
|
|
17
19
|
};
|
|
18
20
|
export type UpdatePersonPayload = {
|
|
19
|
-
|
|
21
|
+
/** Required by the backend on every update (400 `required` otherwise). */
|
|
22
|
+
name: string;
|
|
20
23
|
document?: string | null;
|
|
24
|
+
/** Replaces the linked organizations: `[]` unlinks all, omitting it keeps them. */
|
|
25
|
+
organizationIds?: string[];
|
|
21
26
|
};
|
|
22
27
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/people/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAE1D,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,M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E,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B,CAAA"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_core_BaseReadApi = require('../../core/BaseReadApi.cjs');
|
|
3
3
|
|
|
4
4
|
//#region src/apis/permissions/PermissionsApi.ts
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The permission catalog used by roles. The backend only serves `GET /permissions` and
|
|
7
|
+
* `GET /permissions/:id` (guarded by `roles.view`), so there is no create/update/delete.
|
|
8
|
+
*/
|
|
9
|
+
var PermissionsApi = class extends require_core_BaseReadApi.BaseReadApi {
|
|
6
10
|
constructor(client) {
|
|
7
11
|
super(client, "/permissions");
|
|
8
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PermissionsApi.cjs","names":["
|
|
1
|
+
{"version":3,"file":"PermissionsApi.cjs","names":["BaseReadApi"],"sources":["../../../src/apis/permissions/PermissionsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseReadApi } from '../../core/BaseReadApi'\nimport type { Permission } from './types'\n\n/**\n * The permission catalog used by roles. The backend only serves `GET /permissions` and\n * `GET /permissions/:id` (guarded by `roles.view`), so there is no create/update/delete.\n */\nexport class PermissionsApi extends BaseReadApi<Permission> {\n constructor(client: ApiClient) {\n super(client, '/permissions')\n }\n}\n"],"mappings":";;;;;;;;AAQA,IAAa,iBAAb,cAAoCA,qCAAwB;CAC1D,YAAY,QAAmB;AAC7B,QAAM,QAAQ,eAAe"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { ApiClient } from '../../core/ApiClient';
|
|
2
|
-
import {
|
|
3
|
-
import type { Permission
|
|
4
|
-
|
|
2
|
+
import { BaseReadApi } from '../../core/BaseReadApi';
|
|
3
|
+
import type { Permission } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* The permission catalog used by roles. The backend only serves `GET /permissions` and
|
|
6
|
+
* `GET /permissions/:id` (guarded by `roles.view`), so there is no create/update/delete.
|
|
7
|
+
*/
|
|
8
|
+
export declare class PermissionsApi extends BaseReadApi<Permission> {
|
|
5
9
|
constructor(client: ApiClient);
|
|
6
10
|
}
|
|
7
11
|
//# sourceMappingURL=PermissionsApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PermissionsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/permissions/PermissionsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"PermissionsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/permissions/PermissionsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC;;;GAGG;AACH,qBAAa,cAAe,SAAQ,WAAW,CAAC,UAAU,CAAC;gBAC7C,MAAM,EAAE,SAAS;CAG9B"}
|