@ikatec/digisac-api-sdk 4.3.0 → 4.4.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/dist/apis/contacts/ContactsApi.cjs +70 -0
- package/dist/apis/contacts/ContactsApi.cjs.map +1 -1
- package/dist/apis/contacts/ContactsApi.d.ts +51 -1
- package/dist/apis/contacts/ContactsApi.d.ts.map +1 -1
- package/dist/apis/contacts/ContactsApi.mjs +70 -0
- package/dist/apis/contacts/ContactsApi.mjs.map +1 -1
- package/dist/apis/contacts/types.d.ts +141 -1
- package/dist/apis/contacts/types.d.ts.map +1 -1
- package/dist/apis/services/ServicesApi.cjs +8 -0
- package/dist/apis/services/ServicesApi.cjs.map +1 -1
- package/dist/apis/services/ServicesApi.d.ts +7 -1
- package/dist/apis/services/ServicesApi.d.ts.map +1 -1
- package/dist/apis/services/ServicesApi.mjs +8 -0
- package/dist/apis/services/ServicesApi.mjs.map +1 -1
- package/dist/apis/services/types.d.ts +7 -0
- package/dist/apis/services/types.d.ts.map +1 -1
- package/dist/apis/tags/TagsApi.cjs +23 -0
- package/dist/apis/tags/TagsApi.cjs.map +1 -1
- package/dist/apis/tags/TagsApi.d.ts +19 -1
- package/dist/apis/tags/TagsApi.d.ts.map +1 -1
- package/dist/apis/tags/TagsApi.mjs +23 -0
- package/dist/apis/tags/TagsApi.mjs.map +1 -1
- package/dist/apis/tags/types.d.ts +8 -0
- package/dist/apis/tags/types.d.ts.map +1 -1
- package/dist/apis/users/UsersApi.cjs +77 -0
- package/dist/apis/users/UsersApi.cjs.map +1 -1
- package/dist/apis/users/UsersApi.d.ts +59 -1
- package/dist/apis/users/UsersApi.d.ts.map +1 -1
- package/dist/apis/users/UsersApi.mjs +77 -0
- package/dist/apis/users/UsersApi.mjs.map +1 -1
- package/dist/apis/users/types.d.ts +102 -0
- package/dist/apis/users/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/apis/acceptanceTerms/AcceptanceTermsApi.test.ts +1 -1
- package/src/apis/authHistory/AuthHistoryApi.test.ts +1 -1
- package/src/apis/campaigns/CampaignsApi.test.ts +1 -1
- package/src/apis/contacts/ContactsApi.test.ts +182 -5
- package/src/apis/contacts/ContactsApi.ts +128 -0
- package/src/apis/contacts/types.ts +154 -1
- package/src/apis/messages/MessagesApi.test.ts +3 -3
- package/src/apis/payloads.test-d.ts +26 -0
- package/src/apis/queryFormat.test.ts +27 -3
- package/src/apis/serviceAccessManagement/ServiceAccessManagementApi.test.ts +2 -2
- package/src/apis/services/ServicesApi.test.ts +49 -0
- package/src/apis/services/ServicesApi.ts +10 -1
- package/src/apis/services/types.ts +9 -0
- package/src/apis/stickerUsers/StickerUsersApi.test.ts +1 -1
- package/src/apis/tags/TagsApi.test.ts +79 -0
- package/src/apis/tags/TagsApi.ts +57 -1
- package/src/apis/tags/types.ts +9 -0
- package/src/apis/terms/TermsApi.test.ts +1 -1
- package/src/apis/users/UsersApi.test.ts +228 -0
- package/src/apis/users/UsersApi.ts +152 -1
- package/src/apis/users/types.ts +121 -0
|
@@ -6,6 +6,29 @@ var TagsApi = class extends require_core_BaseCrudApi.BaseCrudApi {
|
|
|
6
6
|
constructor(client) {
|
|
7
7
|
super(client, "/tags");
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Adds the tag to every contact of the account that matches the selection. Resolves to `'OK'`.
|
|
11
|
+
* @permissions tags.view
|
|
12
|
+
*/
|
|
13
|
+
attachContacts(id, body, headers) {
|
|
14
|
+
return this.client.post(`${this.basePath}/${id}/contacts`, body, headers);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Removes the tag from every contact of the account that matches the selection. Resolves to
|
|
18
|
+
* `'OK'`.
|
|
19
|
+
* @permissions tags.view OR tags.destroy
|
|
20
|
+
*/
|
|
21
|
+
detachContacts(id, body, headers) {
|
|
22
|
+
return this.client.request("DELETE", `${this.basePath}/${id}/contacts`, body, headers);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Links several tags to the given departments. Resolves to `'OK'`. A tag without departments
|
|
26
|
+
* is already available to all of them and is left unchanged.
|
|
27
|
+
* @permissions tags.view
|
|
28
|
+
*/
|
|
29
|
+
attachManyToDepartments(body, headers) {
|
|
30
|
+
return this.client.post(`${this.basePath}/attach-many-departments`, body, headers);
|
|
31
|
+
}
|
|
9
32
|
};
|
|
10
33
|
|
|
11
34
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/tags/TagsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {
|
|
1
|
+
{"version":3,"file":"TagsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/tags/TagsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { ContactsSelection } from '../contacts/types'\nimport type {\n AttachTagsToDepartmentsPayload,\n CreateTagPayload,\n Tag,\n UpdateTagPayload,\n} from './types'\n\nexport class TagsApi extends BaseCrudApi<Tag, CreateTagPayload, UpdateTagPayload> {\n constructor(client: ApiClient) {\n super(client, '/tags')\n }\n\n /**\n * Adds the tag to every contact of the account that matches the selection. Resolves to `'OK'`.\n * @permissions tags.view\n */\n attachContacts(\n id: string,\n body: ContactsSelection,\n headers?: Record<string, string>,\n ): Promise<string> {\n return this.client.post<string, ContactsSelection>(\n `${this.basePath}/${id}/contacts`,\n body,\n headers,\n )\n }\n\n /**\n * Removes the tag from every contact of the account that matches the selection. Resolves to\n * `'OK'`.\n * @permissions tags.view OR tags.destroy\n */\n detachContacts(\n id: string,\n body: ContactsSelection,\n headers?: Record<string, string>,\n ): Promise<string> {\n return this.client.request<string, ContactsSelection>(\n 'DELETE',\n `${this.basePath}/${id}/contacts`,\n body,\n headers,\n )\n }\n\n /**\n * Links several tags to the given departments. Resolves to `'OK'`. A tag without departments\n * is already available to all of them and is left unchanged.\n * @permissions tags.view\n */\n attachManyToDepartments(\n body: AttachTagsToDepartmentsPayload,\n headers?: Record<string, string>,\n ): Promise<string> {\n return this.client.post<string, AttachTagsToDepartmentsPayload>(\n `${this.basePath}/attach-many-departments`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;;AAUA,IAAa,UAAb,cAA6BA,qCAAqD;CAChF,YAAY,QAAmB;AAC7B,QAAM,QAAQ,QAAQ;;;;;;CAOxB,eACE,IACA,MACA,SACiB;AACjB,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,GAAG,GAAG,YACvB,MACA,QACD;;;;;;;CAQH,eACE,IACA,MACA,SACiB;AACjB,SAAO,KAAK,OAAO,QACjB,UACA,GAAG,KAAK,SAAS,GAAG,GAAG,YACvB,MACA,QACD;;;;;;;CAQH,wBACE,MACA,SACiB;AACjB,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,2BACjB,MACA,QACD"}
|
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import type { ApiClient } from '../../core/ApiClient';
|
|
2
2
|
import { BaseCrudApi } from '../../core/BaseCrudApi';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ContactsSelection } from '../contacts/types';
|
|
4
|
+
import type { AttachTagsToDepartmentsPayload, CreateTagPayload, Tag, UpdateTagPayload } from './types';
|
|
4
5
|
export declare class TagsApi extends BaseCrudApi<Tag, CreateTagPayload, UpdateTagPayload> {
|
|
5
6
|
constructor(client: ApiClient);
|
|
7
|
+
/**
|
|
8
|
+
* Adds the tag to every contact of the account that matches the selection. Resolves to `'OK'`.
|
|
9
|
+
* @permissions tags.view
|
|
10
|
+
*/
|
|
11
|
+
attachContacts(id: string, body: ContactsSelection, headers?: Record<string, string>): Promise<string>;
|
|
12
|
+
/**
|
|
13
|
+
* Removes the tag from every contact of the account that matches the selection. Resolves to
|
|
14
|
+
* `'OK'`.
|
|
15
|
+
* @permissions tags.view OR tags.destroy
|
|
16
|
+
*/
|
|
17
|
+
detachContacts(id: string, body: ContactsSelection, headers?: Record<string, string>): Promise<string>;
|
|
18
|
+
/**
|
|
19
|
+
* Links several tags to the given departments. Resolves to `'OK'`. A tag without departments
|
|
20
|
+
* is already available to all of them and is left unchanged.
|
|
21
|
+
* @permissions tags.view
|
|
22
|
+
*/
|
|
23
|
+
attachManyToDepartments(body: AttachTagsToDepartmentsPayload, headers?: Record<string, string>): Promise<string>;
|
|
6
24
|
}
|
|
7
25
|
//# sourceMappingURL=TagsApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/tags/TagsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"TagsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/tags/TagsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EACV,8BAA8B,EAC9B,gBAAgB,EAChB,GAAG,EACH,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAEhB,qBAAa,OAAQ,SAAQ,WAAW,CAAC,GAAG,EAAE,gBAAgB,EAAE,gBAAgB,CAAC;gBACnE,MAAM,EAAE,SAAS;IAI7B;;;OAGG;IACH,cAAc,CACZ,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,iBAAiB,EACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,MAAM,CAAC;IAQlB;;;;OAIG;IACH,cAAc,CACZ,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,iBAAiB,EACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,MAAM,CAAC;IASlB;;;;OAIG;IACH,uBAAuB,CACrB,IAAI,EAAE,8BAA8B,EACpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,MAAM,CAAC;CAOnB"}
|
|
@@ -5,6 +5,29 @@ var TagsApi = class extends BaseCrudApi {
|
|
|
5
5
|
constructor(client) {
|
|
6
6
|
super(client, "/tags");
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Adds the tag to every contact of the account that matches the selection. Resolves to `'OK'`.
|
|
10
|
+
* @permissions tags.view
|
|
11
|
+
*/
|
|
12
|
+
attachContacts(id, body, headers) {
|
|
13
|
+
return this.client.post(`${this.basePath}/${id}/contacts`, body, headers);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Removes the tag from every contact of the account that matches the selection. Resolves to
|
|
17
|
+
* `'OK'`.
|
|
18
|
+
* @permissions tags.view OR tags.destroy
|
|
19
|
+
*/
|
|
20
|
+
detachContacts(id, body, headers) {
|
|
21
|
+
return this.client.request("DELETE", `${this.basePath}/${id}/contacts`, body, headers);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Links several tags to the given departments. Resolves to `'OK'`. A tag without departments
|
|
25
|
+
* is already available to all of them and is left unchanged.
|
|
26
|
+
* @permissions tags.view
|
|
27
|
+
*/
|
|
28
|
+
attachManyToDepartments(body, headers) {
|
|
29
|
+
return this.client.post(`${this.basePath}/attach-many-departments`, body, headers);
|
|
30
|
+
}
|
|
8
31
|
};
|
|
9
32
|
|
|
10
33
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagsApi.mjs","names":[],"sources":["../../../src/apis/tags/TagsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {
|
|
1
|
+
{"version":3,"file":"TagsApi.mjs","names":[],"sources":["../../../src/apis/tags/TagsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type { ContactsSelection } from '../contacts/types'\nimport type {\n AttachTagsToDepartmentsPayload,\n CreateTagPayload,\n Tag,\n UpdateTagPayload,\n} from './types'\n\nexport class TagsApi extends BaseCrudApi<Tag, CreateTagPayload, UpdateTagPayload> {\n constructor(client: ApiClient) {\n super(client, '/tags')\n }\n\n /**\n * Adds the tag to every contact of the account that matches the selection. Resolves to `'OK'`.\n * @permissions tags.view\n */\n attachContacts(\n id: string,\n body: ContactsSelection,\n headers?: Record<string, string>,\n ): Promise<string> {\n return this.client.post<string, ContactsSelection>(\n `${this.basePath}/${id}/contacts`,\n body,\n headers,\n )\n }\n\n /**\n * Removes the tag from every contact of the account that matches the selection. Resolves to\n * `'OK'`.\n * @permissions tags.view OR tags.destroy\n */\n detachContacts(\n id: string,\n body: ContactsSelection,\n headers?: Record<string, string>,\n ): Promise<string> {\n return this.client.request<string, ContactsSelection>(\n 'DELETE',\n `${this.basePath}/${id}/contacts`,\n body,\n headers,\n )\n }\n\n /**\n * Links several tags to the given departments. Resolves to `'OK'`. A tag without departments\n * is already available to all of them and is left unchanged.\n * @permissions tags.view\n */\n attachManyToDepartments(\n body: AttachTagsToDepartmentsPayload,\n headers?: Record<string, string>,\n ): Promise<string> {\n return this.client.post<string, AttachTagsToDepartmentsPayload>(\n `${this.basePath}/attach-many-departments`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;AAUA,IAAa,UAAb,cAA6B,YAAqD;CAChF,YAAY,QAAmB;AAC7B,QAAM,QAAQ,QAAQ;;;;;;CAOxB,eACE,IACA,MACA,SACiB;AACjB,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,GAAG,GAAG,YACvB,MACA,QACD;;;;;;;CAQH,eACE,IACA,MACA,SACiB;AACjB,SAAO,KAAK,OAAO,QACjB,UACA,GAAG,KAAK,SAAS,GAAG,GAAG,YACvB,MACA,QACD;;;;;;;CAQH,wBACE,MACA,SACiB;AACjB,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,2BACjB,MACA,QACD"}
|
|
@@ -22,4 +22,12 @@ export type UpdateTagPayload = {
|
|
|
22
22
|
label?: string;
|
|
23
23
|
backgroundColor?: string | null;
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Body for `POST /tags/attach-many-departments`. An empty `departmentIds` makes the tags
|
|
27
|
+
* available to every department.
|
|
28
|
+
*/
|
|
29
|
+
export type AttachTagsToDepartmentsPayload = {
|
|
30
|
+
ids: string[];
|
|
31
|
+
departmentIds: string[];
|
|
32
|
+
};
|
|
25
33
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/tags/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,MAAM,GAAG,GAAG;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IAExB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;IACpB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,aAAa,CAAA;AAEzD,MAA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8B,GAAG;IAC3C,GAAG,EAAE,MAAM,EAAE,CAAA;IACb,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB,CAAA"}
|
|
@@ -6,6 +6,83 @@ var UsersApi = class extends require_core_ArchivableCrudApi.ArchivableCrudApi {
|
|
|
6
6
|
constructor(client) {
|
|
7
7
|
super(client, "/users");
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Archives or restores a user through the dedicated route used by the UI, which also
|
|
11
|
+
* sets the user offline and ends its sessions. The route enforces the business rules that
|
|
12
|
+
* {@link archive}/{@link unarchive} (a plain `PUT { archivedAt }`) skip:
|
|
13
|
+
* - archiving refuses (403) a user referenced by a bot or with open tickets;
|
|
14
|
+
* - restoring refuses (402) when the plan has no free user slot.
|
|
15
|
+
* @permissions users.view OR users.archive
|
|
16
|
+
*/
|
|
17
|
+
archiveWithValidation(id, body, headers) {
|
|
18
|
+
return this.client.post(`${this.basePath}/${id}/archive`, body, headers);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Previews a bulk archive/unarchive without changing anything.
|
|
22
|
+
* @permissions users.archive
|
|
23
|
+
*/
|
|
24
|
+
previewBulkStatus(body, headers) {
|
|
25
|
+
return this.client.post(`${this.basePath}/bulk-status/preview`, body, headers);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Archives or unarchives up to 100 users at once.
|
|
29
|
+
* @permissions users.archive
|
|
30
|
+
*/
|
|
31
|
+
bulkStatus(body, headers) {
|
|
32
|
+
return this.client.post(`${this.basePath}/bulk-status`, body, headers);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Exports the users of the account as CSV. Resolves to the CSV text.
|
|
36
|
+
* @permissions users.export
|
|
37
|
+
*/
|
|
38
|
+
exportCsv(body, headers) {
|
|
39
|
+
return this.client.post(`${this.basePath}/export`, body, headers);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Validates a CSV file previously uploaded through `FilesApi` before importing it.
|
|
43
|
+
* @permissions users.create
|
|
44
|
+
*/
|
|
45
|
+
validateImport(body, headers) {
|
|
46
|
+
return this.client.post(`${this.basePath}/import/validate`, body, headers);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Starts the import of a CSV file previously uploaded through `FilesApi`. The import runs
|
|
50
|
+
* in the background (the route answers `202 Accepted`).
|
|
51
|
+
* @permissions users.create
|
|
52
|
+
*/
|
|
53
|
+
startImport(body, headers) {
|
|
54
|
+
return this.client.post(`${this.basePath}/import`, body, headers);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Turns off the two-factor authentication (OTP) of a user.
|
|
58
|
+
* @permissions users.update AND myAccount.update
|
|
59
|
+
*/
|
|
60
|
+
disableOtpAuth(id, headers) {
|
|
61
|
+
return this.client.post(`${this.basePath}/${id}/disable-otp-auth`, void 0, headers);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Clears the login throttling of a user blocked by too many failed attempts.
|
|
65
|
+
* @permissions users.update
|
|
66
|
+
*/
|
|
67
|
+
enableAccess(id, headers) {
|
|
68
|
+
return this.client.post(`${this.basePath}/${id}/enable-access`, void 0, headers);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Returns the contacts pinned by the logged user.
|
|
72
|
+
* @permissions contacts.pin
|
|
73
|
+
*/
|
|
74
|
+
getPinnedContacts(headers) {
|
|
75
|
+
return this.client.get(`${this.basePath}/pin`, headers);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Pins the contact for the logged user, or unpins it when already pinned. A user can pin
|
|
79
|
+
* up to 3 contacts. Resolves to the created link rows when pinning, or to the number of
|
|
80
|
+
* removed links when unpinning.
|
|
81
|
+
* @permissions contacts.pin
|
|
82
|
+
*/
|
|
83
|
+
togglePinContact(body, headers) {
|
|
84
|
+
return this.client.patch(`${this.basePath}/pin`, body, headers);
|
|
85
|
+
}
|
|
9
86
|
};
|
|
10
87
|
|
|
11
88
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsersApi.cjs","names":["ArchivableCrudApi"],"sources":["../../../src/apis/users/UsersApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { ArchivableCrudApi } from '../../core/ArchivableCrudApi'\nimport type {
|
|
1
|
+
{"version":3,"file":"UsersApi.cjs","names":["ArchivableCrudApi"],"sources":["../../../src/apis/users/UsersApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { ArchivableCrudApi } from '../../core/ArchivableCrudApi'\nimport type { Contact } from '../contacts/types'\nimport type {\n ArchiveUserPayload,\n BulkUsersStatusPayload,\n BulkUsersStatusPreview,\n BulkUsersStatusResult,\n CreateUserPayload,\n EnableUserAccessResult,\n ExportUsersPayload,\n ImportUsersPayload,\n ImportUsersResult,\n TogglePinContactPayload,\n TogglePinContactResult,\n UpdateUserPayload,\n User,\n ValidateUserImportPayload,\n ValidateUserImportResult,\n} from './types'\n\nexport class UsersApi extends ArchivableCrudApi<User, CreateUserPayload, UpdateUserPayload> {\n constructor(client: ApiClient) {\n super(client, '/users')\n }\n\n /**\n * Archives or restores a user through the dedicated route used by the UI, which also\n * sets the user offline and ends its sessions. The route enforces the business rules that\n * {@link archive}/{@link unarchive} (a plain `PUT { archivedAt }`) skip:\n * - archiving refuses (403) a user referenced by a bot or with open tickets;\n * - restoring refuses (402) when the plan has no free user slot.\n * @permissions users.view OR users.archive\n */\n archiveWithValidation(\n id: string,\n body: ArchiveUserPayload,\n headers?: Record<string, string>,\n ): Promise<User> {\n return this.client.post<User, ArchiveUserPayload>(\n `${this.basePath}/${id}/archive`,\n body,\n headers,\n )\n }\n\n /**\n * Previews a bulk archive/unarchive without changing anything.\n * @permissions users.archive\n */\n previewBulkStatus(\n body: BulkUsersStatusPayload,\n headers?: Record<string, string>,\n ): Promise<BulkUsersStatusPreview> {\n return this.client.post<BulkUsersStatusPreview, BulkUsersStatusPayload>(\n `${this.basePath}/bulk-status/preview`,\n body,\n headers,\n )\n }\n\n /**\n * Archives or unarchives up to 100 users at once.\n * @permissions users.archive\n */\n bulkStatus(\n body: BulkUsersStatusPayload,\n headers?: Record<string, string>,\n ): Promise<BulkUsersStatusResult> {\n return this.client.post<BulkUsersStatusResult, BulkUsersStatusPayload>(\n `${this.basePath}/bulk-status`,\n body,\n headers,\n )\n }\n\n /**\n * Exports the users of the account as CSV. Resolves to the CSV text.\n * @permissions users.export\n */\n exportCsv(body: ExportUsersPayload, headers?: Record<string, string>): Promise<string> {\n return this.client.post<string, ExportUsersPayload>(`${this.basePath}/export`, body, headers)\n }\n\n /**\n * Validates a CSV file previously uploaded through `FilesApi` before importing it.\n * @permissions users.create\n */\n validateImport(\n body: ValidateUserImportPayload,\n headers?: Record<string, string>,\n ): Promise<ValidateUserImportResult> {\n return this.client.post<ValidateUserImportResult, ValidateUserImportPayload>(\n `${this.basePath}/import/validate`,\n body,\n headers,\n )\n }\n\n /**\n * Starts the import of a CSV file previously uploaded through `FilesApi`. The import runs\n * in the background (the route answers `202 Accepted`).\n * @permissions users.create\n */\n startImport(\n body: ImportUsersPayload,\n headers?: Record<string, string>,\n ): Promise<ImportUsersResult> {\n return this.client.post<ImportUsersResult, ImportUsersPayload>(\n `${this.basePath}/import`,\n body,\n headers,\n )\n }\n\n /**\n * Turns off the two-factor authentication (OTP) of a user.\n * @permissions users.update AND myAccount.update\n */\n disableOtpAuth(id: string, headers?: Record<string, string>): Promise<User> {\n return this.client.post<User>(`${this.basePath}/${id}/disable-otp-auth`, undefined, headers)\n }\n\n /**\n * Clears the login throttling of a user blocked by too many failed attempts.\n * @permissions users.update\n */\n enableAccess(id: string, headers?: Record<string, string>): Promise<EnableUserAccessResult> {\n return this.client.post<EnableUserAccessResult>(\n `${this.basePath}/${id}/enable-access`,\n undefined,\n headers,\n )\n }\n\n /**\n * Returns the contacts pinned by the logged user.\n * @permissions contacts.pin\n */\n getPinnedContacts(headers?: Record<string, string>): Promise<Contact[]> {\n return this.client.get<Contact[]>(`${this.basePath}/pin`, headers)\n }\n\n /**\n * Pins the contact for the logged user, or unpins it when already pinned. A user can pin\n * up to 3 contacts. Resolves to the created link rows when pinning, or to the number of\n * removed links when unpinning.\n * @permissions contacts.pin\n */\n togglePinContact(\n body: TogglePinContactPayload,\n headers?: Record<string, string>,\n ): Promise<TogglePinContactResult> {\n return this.client.patch<TogglePinContactResult, TogglePinContactPayload>(\n `${this.basePath}/pin`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;;AAqBA,IAAa,WAAb,cAA8BA,iDAA8D;CAC1F,YAAY,QAAmB;AAC7B,QAAM,QAAQ,SAAS;;;;;;;;;;CAWzB,sBACE,IACA,MACA,SACe;AACf,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD;;;;;;CAOH,kBACE,MACA,SACiC;AACjC,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,uBACjB,MACA,QACD;;;;;;CAOH,WACE,MACA,SACgC;AAChC,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,eACjB,MACA,QACD;;;;;;CAOH,UAAU,MAA0B,SAAmD;AACrF,SAAO,KAAK,OAAO,KAAiC,GAAG,KAAK,SAAS,UAAU,MAAM,QAAQ;;;;;;CAO/F,eACE,MACA,SACmC;AACnC,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,mBACjB,MACA,QACD;;;;;;;CAQH,YACE,MACA,SAC4B;AAC5B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,UACjB,MACA,QACD;;;;;;CAOH,eAAe,IAAY,SAAiD;AAC1E,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,oBAAoB,QAAW,QAAQ;;;;;;CAO9F,aAAa,IAAY,SAAmE;AAC1F,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,GAAG,GAAG,iBACvB,QACA,QACD;;;;;;CAOH,kBAAkB,SAAsD;AACtE,SAAO,KAAK,OAAO,IAAe,GAAG,KAAK,SAAS,OAAO,QAAQ;;;;;;;;CASpE,iBACE,MACA,SACiC;AACjC,SAAO,KAAK,OAAO,MACjB,GAAG,KAAK,SAAS,OACjB,MACA,QACD"}
|
|
@@ -1,7 +1,65 @@
|
|
|
1
1
|
import type { ApiClient } from '../../core/ApiClient';
|
|
2
2
|
import { ArchivableCrudApi } from '../../core/ArchivableCrudApi';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Contact } from '../contacts/types';
|
|
4
|
+
import type { ArchiveUserPayload, BulkUsersStatusPayload, BulkUsersStatusPreview, BulkUsersStatusResult, CreateUserPayload, EnableUserAccessResult, ExportUsersPayload, ImportUsersPayload, ImportUsersResult, TogglePinContactPayload, TogglePinContactResult, UpdateUserPayload, User, ValidateUserImportPayload, ValidateUserImportResult } from './types';
|
|
4
5
|
export declare class UsersApi extends ArchivableCrudApi<User, CreateUserPayload, UpdateUserPayload> {
|
|
5
6
|
constructor(client: ApiClient);
|
|
7
|
+
/**
|
|
8
|
+
* Archives or restores a user through the dedicated route used by the UI, which also
|
|
9
|
+
* sets the user offline and ends its sessions. The route enforces the business rules that
|
|
10
|
+
* {@link archive}/{@link unarchive} (a plain `PUT { archivedAt }`) skip:
|
|
11
|
+
* - archiving refuses (403) a user referenced by a bot or with open tickets;
|
|
12
|
+
* - restoring refuses (402) when the plan has no free user slot.
|
|
13
|
+
* @permissions users.view OR users.archive
|
|
14
|
+
*/
|
|
15
|
+
archiveWithValidation(id: string, body: ArchiveUserPayload, headers?: Record<string, string>): Promise<User>;
|
|
16
|
+
/**
|
|
17
|
+
* Previews a bulk archive/unarchive without changing anything.
|
|
18
|
+
* @permissions users.archive
|
|
19
|
+
*/
|
|
20
|
+
previewBulkStatus(body: BulkUsersStatusPayload, headers?: Record<string, string>): Promise<BulkUsersStatusPreview>;
|
|
21
|
+
/**
|
|
22
|
+
* Archives or unarchives up to 100 users at once.
|
|
23
|
+
* @permissions users.archive
|
|
24
|
+
*/
|
|
25
|
+
bulkStatus(body: BulkUsersStatusPayload, headers?: Record<string, string>): Promise<BulkUsersStatusResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Exports the users of the account as CSV. Resolves to the CSV text.
|
|
28
|
+
* @permissions users.export
|
|
29
|
+
*/
|
|
30
|
+
exportCsv(body: ExportUsersPayload, headers?: Record<string, string>): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Validates a CSV file previously uploaded through `FilesApi` before importing it.
|
|
33
|
+
* @permissions users.create
|
|
34
|
+
*/
|
|
35
|
+
validateImport(body: ValidateUserImportPayload, headers?: Record<string, string>): Promise<ValidateUserImportResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Starts the import of a CSV file previously uploaded through `FilesApi`. The import runs
|
|
38
|
+
* in the background (the route answers `202 Accepted`).
|
|
39
|
+
* @permissions users.create
|
|
40
|
+
*/
|
|
41
|
+
startImport(body: ImportUsersPayload, headers?: Record<string, string>): Promise<ImportUsersResult>;
|
|
42
|
+
/**
|
|
43
|
+
* Turns off the two-factor authentication (OTP) of a user.
|
|
44
|
+
* @permissions users.update AND myAccount.update
|
|
45
|
+
*/
|
|
46
|
+
disableOtpAuth(id: string, headers?: Record<string, string>): Promise<User>;
|
|
47
|
+
/**
|
|
48
|
+
* Clears the login throttling of a user blocked by too many failed attempts.
|
|
49
|
+
* @permissions users.update
|
|
50
|
+
*/
|
|
51
|
+
enableAccess(id: string, headers?: Record<string, string>): Promise<EnableUserAccessResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Returns the contacts pinned by the logged user.
|
|
54
|
+
* @permissions contacts.pin
|
|
55
|
+
*/
|
|
56
|
+
getPinnedContacts(headers?: Record<string, string>): Promise<Contact[]>;
|
|
57
|
+
/**
|
|
58
|
+
* Pins the contact for the logged user, or unpins it when already pinned. A user can pin
|
|
59
|
+
* up to 3 contacts. Resolves to the created link rows when pinning, or to the number of
|
|
60
|
+
* removed links when unpinning.
|
|
61
|
+
* @permissions contacts.pin
|
|
62
|
+
*/
|
|
63
|
+
togglePinContact(body: TogglePinContactPayload, headers?: Record<string, string>): Promise<TogglePinContactResult>;
|
|
6
64
|
}
|
|
7
65
|
//# sourceMappingURL=UsersApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsersApi.d.ts","sourceRoot":"","sources":["../../../src/apis/users/UsersApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"UsersApi.d.ts","sourceRoot":"","sources":["../../../src/apis/users/UsersApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,IAAI,EACJ,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,SAAS,CAAA;AAEhB,qBAAa,QAAS,SAAQ,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;gBAC7E,MAAM,EAAE,SAAS;IAI7B;;;;;;;OAOG;IACH,qBAAqB,CACnB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,kBAAkB,EACxB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,IAAI,CAAC;IAQhB;;;OAGG;IACH,iBAAiB,CACf,IAAI,EAAE,s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C,sBAAsB,CAAC;CAOnC"}
|
|
@@ -5,6 +5,83 @@ var UsersApi = class extends ArchivableCrudApi {
|
|
|
5
5
|
constructor(client) {
|
|
6
6
|
super(client, "/users");
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Archives or restores a user through the dedicated route used by the UI, which also
|
|
10
|
+
* sets the user offline and ends its sessions. The route enforces the business rules that
|
|
11
|
+
* {@link archive}/{@link unarchive} (a plain `PUT { archivedAt }`) skip:
|
|
12
|
+
* - archiving refuses (403) a user referenced by a bot or with open tickets;
|
|
13
|
+
* - restoring refuses (402) when the plan has no free user slot.
|
|
14
|
+
* @permissions users.view OR users.archive
|
|
15
|
+
*/
|
|
16
|
+
archiveWithValidation(id, body, headers) {
|
|
17
|
+
return this.client.post(`${this.basePath}/${id}/archive`, body, headers);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Previews a bulk archive/unarchive without changing anything.
|
|
21
|
+
* @permissions users.archive
|
|
22
|
+
*/
|
|
23
|
+
previewBulkStatus(body, headers) {
|
|
24
|
+
return this.client.post(`${this.basePath}/bulk-status/preview`, body, headers);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Archives or unarchives up to 100 users at once.
|
|
28
|
+
* @permissions users.archive
|
|
29
|
+
*/
|
|
30
|
+
bulkStatus(body, headers) {
|
|
31
|
+
return this.client.post(`${this.basePath}/bulk-status`, body, headers);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Exports the users of the account as CSV. Resolves to the CSV text.
|
|
35
|
+
* @permissions users.export
|
|
36
|
+
*/
|
|
37
|
+
exportCsv(body, headers) {
|
|
38
|
+
return this.client.post(`${this.basePath}/export`, body, headers);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Validates a CSV file previously uploaded through `FilesApi` before importing it.
|
|
42
|
+
* @permissions users.create
|
|
43
|
+
*/
|
|
44
|
+
validateImport(body, headers) {
|
|
45
|
+
return this.client.post(`${this.basePath}/import/validate`, body, headers);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Starts the import of a CSV file previously uploaded through `FilesApi`. The import runs
|
|
49
|
+
* in the background (the route answers `202 Accepted`).
|
|
50
|
+
* @permissions users.create
|
|
51
|
+
*/
|
|
52
|
+
startImport(body, headers) {
|
|
53
|
+
return this.client.post(`${this.basePath}/import`, body, headers);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Turns off the two-factor authentication (OTP) of a user.
|
|
57
|
+
* @permissions users.update AND myAccount.update
|
|
58
|
+
*/
|
|
59
|
+
disableOtpAuth(id, headers) {
|
|
60
|
+
return this.client.post(`${this.basePath}/${id}/disable-otp-auth`, void 0, headers);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Clears the login throttling of a user blocked by too many failed attempts.
|
|
64
|
+
* @permissions users.update
|
|
65
|
+
*/
|
|
66
|
+
enableAccess(id, headers) {
|
|
67
|
+
return this.client.post(`${this.basePath}/${id}/enable-access`, void 0, headers);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Returns the contacts pinned by the logged user.
|
|
71
|
+
* @permissions contacts.pin
|
|
72
|
+
*/
|
|
73
|
+
getPinnedContacts(headers) {
|
|
74
|
+
return this.client.get(`${this.basePath}/pin`, headers);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Pins the contact for the logged user, or unpins it when already pinned. A user can pin
|
|
78
|
+
* up to 3 contacts. Resolves to the created link rows when pinning, or to the number of
|
|
79
|
+
* removed links when unpinning.
|
|
80
|
+
* @permissions contacts.pin
|
|
81
|
+
*/
|
|
82
|
+
togglePinContact(body, headers) {
|
|
83
|
+
return this.client.patch(`${this.basePath}/pin`, body, headers);
|
|
84
|
+
}
|
|
8
85
|
};
|
|
9
86
|
|
|
10
87
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsersApi.mjs","names":[],"sources":["../../../src/apis/users/UsersApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { ArchivableCrudApi } from '../../core/ArchivableCrudApi'\nimport type {
|
|
1
|
+
{"version":3,"file":"UsersApi.mjs","names":[],"sources":["../../../src/apis/users/UsersApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { ArchivableCrudApi } from '../../core/ArchivableCrudApi'\nimport type { Contact } from '../contacts/types'\nimport type {\n ArchiveUserPayload,\n BulkUsersStatusPayload,\n BulkUsersStatusPreview,\n BulkUsersStatusResult,\n CreateUserPayload,\n EnableUserAccessResult,\n ExportUsersPayload,\n ImportUsersPayload,\n ImportUsersResult,\n TogglePinContactPayload,\n TogglePinContactResult,\n UpdateUserPayload,\n User,\n ValidateUserImportPayload,\n ValidateUserImportResult,\n} from './types'\n\nexport class UsersApi extends ArchivableCrudApi<User, CreateUserPayload, UpdateUserPayload> {\n constructor(client: ApiClient) {\n super(client, '/users')\n }\n\n /**\n * Archives or restores a user through the dedicated route used by the UI, which also\n * sets the user offline and ends its sessions. The route enforces the business rules that\n * {@link archive}/{@link unarchive} (a plain `PUT { archivedAt }`) skip:\n * - archiving refuses (403) a user referenced by a bot or with open tickets;\n * - restoring refuses (402) when the plan has no free user slot.\n * @permissions users.view OR users.archive\n */\n archiveWithValidation(\n id: string,\n body: ArchiveUserPayload,\n headers?: Record<string, string>,\n ): Promise<User> {\n return this.client.post<User, ArchiveUserPayload>(\n `${this.basePath}/${id}/archive`,\n body,\n headers,\n )\n }\n\n /**\n * Previews a bulk archive/unarchive without changing anything.\n * @permissions users.archive\n */\n previewBulkStatus(\n body: BulkUsersStatusPayload,\n headers?: Record<string, string>,\n ): Promise<BulkUsersStatusPreview> {\n return this.client.post<BulkUsersStatusPreview, BulkUsersStatusPayload>(\n `${this.basePath}/bulk-status/preview`,\n body,\n headers,\n )\n }\n\n /**\n * Archives or unarchives up to 100 users at once.\n * @permissions users.archive\n */\n bulkStatus(\n body: BulkUsersStatusPayload,\n headers?: Record<string, string>,\n ): Promise<BulkUsersStatusResult> {\n return this.client.post<BulkUsersStatusResult, BulkUsersStatusPayload>(\n `${this.basePath}/bulk-status`,\n body,\n headers,\n )\n }\n\n /**\n * Exports the users of the account as CSV. Resolves to the CSV text.\n * @permissions users.export\n */\n exportCsv(body: ExportUsersPayload, headers?: Record<string, string>): Promise<string> {\n return this.client.post<string, ExportUsersPayload>(`${this.basePath}/export`, body, headers)\n }\n\n /**\n * Validates a CSV file previously uploaded through `FilesApi` before importing it.\n * @permissions users.create\n */\n validateImport(\n body: ValidateUserImportPayload,\n headers?: Record<string, string>,\n ): Promise<ValidateUserImportResult> {\n return this.client.post<ValidateUserImportResult, ValidateUserImportPayload>(\n `${this.basePath}/import/validate`,\n body,\n headers,\n )\n }\n\n /**\n * Starts the import of a CSV file previously uploaded through `FilesApi`. The import runs\n * in the background (the route answers `202 Accepted`).\n * @permissions users.create\n */\n startImport(\n body: ImportUsersPayload,\n headers?: Record<string, string>,\n ): Promise<ImportUsersResult> {\n return this.client.post<ImportUsersResult, ImportUsersPayload>(\n `${this.basePath}/import`,\n body,\n headers,\n )\n }\n\n /**\n * Turns off the two-factor authentication (OTP) of a user.\n * @permissions users.update AND myAccount.update\n */\n disableOtpAuth(id: string, headers?: Record<string, string>): Promise<User> {\n return this.client.post<User>(`${this.basePath}/${id}/disable-otp-auth`, undefined, headers)\n }\n\n /**\n * Clears the login throttling of a user blocked by too many failed attempts.\n * @permissions users.update\n */\n enableAccess(id: string, headers?: Record<string, string>): Promise<EnableUserAccessResult> {\n return this.client.post<EnableUserAccessResult>(\n `${this.basePath}/${id}/enable-access`,\n undefined,\n headers,\n )\n }\n\n /**\n * Returns the contacts pinned by the logged user.\n * @permissions contacts.pin\n */\n getPinnedContacts(headers?: Record<string, string>): Promise<Contact[]> {\n return this.client.get<Contact[]>(`${this.basePath}/pin`, headers)\n }\n\n /**\n * Pins the contact for the logged user, or unpins it when already pinned. A user can pin\n * up to 3 contacts. Resolves to the created link rows when pinning, or to the number of\n * removed links when unpinning.\n * @permissions contacts.pin\n */\n togglePinContact(\n body: TogglePinContactPayload,\n headers?: Record<string, string>,\n ): Promise<TogglePinContactResult> {\n return this.client.patch<TogglePinContactResult, TogglePinContactPayload>(\n `${this.basePath}/pin`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;AAqBA,IAAa,WAAb,cAA8B,kBAA8D;CAC1F,YAAY,QAAmB;AAC7B,QAAM,QAAQ,SAAS;;;;;;;;;;CAWzB,sBACE,IACA,MACA,SACe;AACf,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD;;;;;;CAOH,kBACE,MACA,SACiC;AACjC,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,uBACjB,MACA,QACD;;;;;;CAOH,WACE,MACA,SACgC;AAChC,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,eACjB,MACA,QACD;;;;;;CAOH,UAAU,MAA0B,SAAmD;AACrF,SAAO,KAAK,OAAO,KAAiC,GAAG,KAAK,SAAS,UAAU,MAAM,QAAQ;;;;;;CAO/F,eACE,MACA,SACmC;AACnC,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,mBACjB,MACA,QACD;;;;;;;CAQH,YACE,MACA,SAC4B;AAC5B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,UACjB,MACA,QACD;;;;;;CAOH,eAAe,IAAY,SAAiD;AAC1E,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,oBAAoB,QAAW,QAAQ;;;;;;CAO9F,aAAa,IAAY,SAAmE;AAC1F,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,GAAG,GAAG,iBACvB,QACA,QACD;;;;;;CAOH,kBAAkB,SAAsD;AACtE,SAAO,KAAK,OAAO,IAAe,GAAG,KAAK,SAAS,OAAO,QAAQ;;;;;;;;CASpE,iBACE,MACA,SACiC;AACjC,SAAO,KAAK,OAAO,MACjB,GAAG,KAAK,SAAS,OACjB,MACA,QACD"}
|
|
@@ -62,4 +62,106 @@ export type UpdateUserPayload = {
|
|
|
62
62
|
language?: string;
|
|
63
63
|
archivedAt?: string | null;
|
|
64
64
|
};
|
|
65
|
+
/** Body for `POST /users/:id/archive`. */
|
|
66
|
+
export type ArchiveUserPayload = {
|
|
67
|
+
/** `true` archives the user; `false` restores it. */
|
|
68
|
+
archive: boolean;
|
|
69
|
+
};
|
|
70
|
+
/** Body for `POST /users/bulk-status` and `POST /users/bulk-status/preview` (1 to 100 IDs). */
|
|
71
|
+
export type BulkUsersStatusPayload = {
|
|
72
|
+
ids: string[];
|
|
73
|
+
archive: boolean;
|
|
74
|
+
};
|
|
75
|
+
export type BulkUsersStatusScenario = 'emptySelection' | 'noneEligible' | 'allEligible' | 'partiallyBlocked' | 'onlySelfBlocked' | 'planLimitExceeded';
|
|
76
|
+
/** Read-only preview of a bulk status change: nothing is written. */
|
|
77
|
+
export type BulkUsersStatusPreview = {
|
|
78
|
+
scenario: BulkUsersStatusScenario;
|
|
79
|
+
totalSelected: number;
|
|
80
|
+
/** Users already in the target status. */
|
|
81
|
+
noop: number;
|
|
82
|
+
eligible: number;
|
|
83
|
+
/** Users that cannot change (e.g. referenced by a bot, or the acting user). */
|
|
84
|
+
blocked: number;
|
|
85
|
+
blockedSelf: boolean;
|
|
86
|
+
/** Free plan slots when unarchiving; `null` when archiving. */
|
|
87
|
+
planSlotsAvailable: number | null;
|
|
88
|
+
};
|
|
89
|
+
export type BulkUsersStatusResult = {
|
|
90
|
+
changed: number;
|
|
91
|
+
noop: number;
|
|
92
|
+
blocked: number;
|
|
93
|
+
failed: number;
|
|
94
|
+
changedIds: string[];
|
|
95
|
+
/** IDs of the batch that no longer exist in the account. */
|
|
96
|
+
missingIds: string[];
|
|
97
|
+
};
|
|
98
|
+
/** Body for `POST /users/export`. */
|
|
99
|
+
export type ExportUsersPayload = {
|
|
100
|
+
filter: 'all' | 'active' | 'archived';
|
|
101
|
+
};
|
|
102
|
+
/** A file previously uploaded through `FilesApi`. */
|
|
103
|
+
export type UserImportFile = {
|
|
104
|
+
id: string;
|
|
105
|
+
name: string;
|
|
106
|
+
mimetype: string;
|
|
107
|
+
url?: string;
|
|
108
|
+
urlToUpload?: string;
|
|
109
|
+
};
|
|
110
|
+
/** Body for `POST /users/import/validate`. */
|
|
111
|
+
export type ValidateUserImportPayload = {
|
|
112
|
+
file: UserImportFile;
|
|
113
|
+
};
|
|
114
|
+
export type UserImportRowsSummary = {
|
|
115
|
+
total: number;
|
|
116
|
+
valid: number;
|
|
117
|
+
invalid: number;
|
|
118
|
+
hasInvalid: boolean;
|
|
119
|
+
};
|
|
120
|
+
export type ValidateUserImportResult = {
|
|
121
|
+
licenses: {
|
|
122
|
+
requestedRows: number;
|
|
123
|
+
available: number;
|
|
124
|
+
exceeded: boolean;
|
|
125
|
+
};
|
|
126
|
+
columns: {
|
|
127
|
+
required: {
|
|
128
|
+
name: string;
|
|
129
|
+
found: boolean;
|
|
130
|
+
}[];
|
|
131
|
+
missingRequired: string[];
|
|
132
|
+
optionalFound: string[];
|
|
133
|
+
};
|
|
134
|
+
rows: UserImportRowsSummary;
|
|
135
|
+
/** Same rows validated with the optional columns applied. */
|
|
136
|
+
rowsWithOptionalColumns: UserImportRowsSummary;
|
|
137
|
+
};
|
|
138
|
+
/** Body for `POST /users/import`. */
|
|
139
|
+
export type ImportUsersPayload = {
|
|
140
|
+
file: UserImportFile;
|
|
141
|
+
useOptionalColumns?: boolean;
|
|
142
|
+
};
|
|
143
|
+
/** The import runs in the background (the route answers `202 Accepted`). */
|
|
144
|
+
export type ImportUsersResult = {
|
|
145
|
+
importId: string;
|
|
146
|
+
};
|
|
147
|
+
export type EnableUserAccessResult = {
|
|
148
|
+
success: boolean;
|
|
149
|
+
message: string;
|
|
150
|
+
};
|
|
151
|
+
/** Body for `PATCH /users/pin`: toggles the pin of a contact for the logged user (max. 3). */
|
|
152
|
+
export type TogglePinContactPayload = {
|
|
153
|
+
contactId: string;
|
|
154
|
+
};
|
|
155
|
+
/** Link row returned by `PATCH /users/pin` when the contact gets pinned. */
|
|
156
|
+
export type UserPinnedContactLink = {
|
|
157
|
+
userId: string;
|
|
158
|
+
contactId: string;
|
|
159
|
+
createdAt: string;
|
|
160
|
+
updatedAt: string;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Result of `PATCH /users/pin`: the created link rows when the contact gets pinned, or the
|
|
164
|
+
* number of removed links when it gets unpinned.
|
|
165
|
+
*/
|
|
166
|
+
export type TogglePinContactResult = UserPinnedContactLink[] | number;
|
|
65
167
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/users/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAA;AAEtD,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IACrB,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,OAAO,CAAA;IACrB,MAAM,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/C,CAAA;AAED,qCAAqC;AACrC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,cAAc,CAAA;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B,CAAA;AAED,4EAA4E;AAC5E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,8FAA8F;AAC9F,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,4EAA4E;AAC5E,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,EAAE,GAAG,MAAM,CAAA"}
|
package/package.json
CHANGED
|
@@ -87,7 +87,7 @@ describe('AcceptanceTermsApi', () => {
|
|
|
87
87
|
it('includes the file relationship', async () => {
|
|
88
88
|
vi.mocked(client.get).mockResolvedValue({ ...term, file: null })
|
|
89
89
|
const result = await api.getById('at-1', { include: ['file'] })
|
|
90
|
-
const url = vi.mocked(client.get).mock.calls[0][0] as string
|
|
90
|
+
const url = vi.mocked(client.get).mock.calls[0]?.[0] as string
|
|
91
91
|
expect(url).toContain('/acceptance-terms/at-1?')
|
|
92
92
|
expect(url).toContain('include')
|
|
93
93
|
expect(result.file).toBeNull()
|
|
@@ -66,7 +66,7 @@ describe('AuthHistoryApi', () => {
|
|
|
66
66
|
it('serializes query parameters', async () => {
|
|
67
67
|
vi.mocked(client.get).mockResolvedValue(paginated)
|
|
68
68
|
await api.getMany({ page: 2, perPage: 5 })
|
|
69
|
-
const url = vi.mocked(client.get).mock.calls[0][0] as string
|
|
69
|
+
const url = vi.mocked(client.get).mock.calls[0]?.[0] as string
|
|
70
70
|
expect(url).toContain('/auth-history?')
|
|
71
71
|
expect(decodeURIComponent(url)).toContain('"page":2')
|
|
72
72
|
})
|
|
@@ -94,7 +94,7 @@ describe('CampaignsApi', () => {
|
|
|
94
94
|
it('serializes query parameters', async () => {
|
|
95
95
|
vi.mocked(client.get).mockResolvedValue(paginated)
|
|
96
96
|
await api.getMany({ page: 2, perPage: 5 })
|
|
97
|
-
const url = vi.mocked(client.get).mock.calls[0][0] as string
|
|
97
|
+
const url = vi.mocked(client.get).mock.calls[0]?.[0] as string
|
|
98
98
|
expect(url).toContain('/campaigns?')
|
|
99
99
|
expect(decodeURIComponent(url)).toContain('"page":2')
|
|
100
100
|
})
|