@ikatec/digisac-api-sdk 4.13.0 → 4.15.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 +7 -2
- package/dist/apis/authHistory/AuthHistoryApi.cjs +9 -2
- package/dist/apis/authHistory/AuthHistoryApi.cjs.map +1 -1
- package/dist/apis/authHistory/AuthHistoryApi.d.ts +7 -2
- package/dist/apis/authHistory/AuthHistoryApi.d.ts.map +1 -1
- package/dist/apis/authHistory/AuthHistoryApi.mjs +9 -2
- package/dist/apis/authHistory/AuthHistoryApi.mjs.map +1 -1
- package/dist/apis/authHistory/types.d.ts +6 -1
- package/dist/apis/authHistory/types.d.ts.map +1 -1
- package/dist/apis/contacts/ContactsApi.cjs +10 -0
- package/dist/apis/contacts/ContactsApi.cjs.map +1 -1
- package/dist/apis/contacts/ContactsApi.d.ts +10 -2
- package/dist/apis/contacts/ContactsApi.d.ts.map +1 -1
- package/dist/apis/contacts/ContactsApi.mjs +10 -0
- package/dist/apis/contacts/ContactsApi.mjs.map +1 -1
- package/dist/apis/contacts/types.d.ts +76 -2
- package/dist/apis/contacts/types.d.ts.map +1 -1
- package/dist/apis/files/FilesApi.cjs +13 -1
- package/dist/apis/files/FilesApi.cjs.map +1 -1
- package/dist/apis/files/FilesApi.d.ts +12 -2
- package/dist/apis/files/FilesApi.d.ts.map +1 -1
- package/dist/apis/files/FilesApi.mjs +13 -1
- package/dist/apis/files/FilesApi.mjs.map +1 -1
- package/dist/apis/files/types.d.ts +19 -1
- package/dist/apis/files/types.d.ts.map +1 -1
- package/dist/apis/notifications/types.d.ts +6 -3
- package/dist/apis/notifications/types.d.ts.map +1 -1
- package/dist/apis/services/ServicesApi.cjs +10 -0
- package/dist/apis/services/ServicesApi.cjs.map +1 -1
- package/dist/apis/services/ServicesApi.d.ts +9 -1
- package/dist/apis/services/ServicesApi.d.ts.map +1 -1
- package/dist/apis/services/ServicesApi.mjs +10 -0
- package/dist/apis/services/ServicesApi.mjs.map +1 -1
- package/dist/apis/services/types.d.ts +10 -0
- package/dist/apis/services/types.d.ts.map +1 -1
- package/dist/apis/stickers/types.d.ts +3 -0
- package/dist/apis/stickers/types.d.ts.map +1 -1
- package/dist/core/BaseReadApi.cjs +2 -2
- package/dist/core/BaseReadApi.cjs.map +1 -1
- package/dist/core/BaseReadApi.d.ts +2 -2
- package/dist/core/BaseReadApi.mjs +2 -2
- package/dist/core/BaseReadApi.mjs.map +1 -1
- package/package.json +1 -1
- package/src/apis/authHistory/AuthHistoryApi.test.ts +16 -0
- package/src/apis/authHistory/AuthHistoryApi.ts +10 -2
- package/src/apis/authHistory/types.ts +6 -1
- package/src/apis/contacts/ContactsApi.test.ts +13 -0
- package/src/apis/contacts/ContactsApi.ts +23 -1
- package/src/apis/contacts/types.ts +83 -1
- package/src/apis/files/FilesApi.test.ts +21 -0
- package/src/apis/files/FilesApi.ts +19 -1
- package/src/apis/files/types.ts +20 -1
- package/src/apis/notifications/types.ts +6 -3
- package/src/apis/payloads.test-d.ts +60 -2
- package/src/apis/services/ServicesApi.test.ts +11 -0
- package/src/apis/services/ServicesApi.ts +21 -0
- package/src/apis/services/types.ts +12 -0
- package/src/apis/stickers/types.ts +3 -0
- package/src/core/BaseReadApi.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilesApi.d.ts","sourceRoot":"","sources":["../../../src/apis/files/FilesApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC1E,OAAO,KAAK,EACV,IAAI,EACJ,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"FilesApi.d.ts","sourceR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CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAIhG,4FAA4F;IACnF,OAAO,CACd,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,EAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,IAAI,CAAC;IAIhB,4FAA4F;IACnF,UAAU,CACjB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,iBAAiB,EACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,IAAI,CAAC;IAIhB;;;OAGG;IACM,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAI5F;;;;;;OAMG;IACH,cAAc,CACZ,IAAI,EAAE,qBAAqB,EAC3B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,oBAAoB,CAAC;IAQhC;;;;;;;OAOG;IACH,aAAa,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ5F;;;;;;OAMG;IACG,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAMtF"}
|
|
@@ -38,12 +38,24 @@ var FilesApi = class extends BaseCrudApi {
|
|
|
38
38
|
* Creates the record of a file and returns the signed URL to upload its content: send the
|
|
39
39
|
* content with {@link upload}. An audio that must be converted (a voice message for the
|
|
40
40
|
* connection) is sent in `base64` instead, and then no `urlToUpload` is returned. `name` and
|
|
41
|
-
* `mimetype` are required (500 without them; an audio without `name` is named `recording`).
|
|
41
|
+
* `mimetype` are required (500 without them; an audio without `name` is named `recording`). With
|
|
42
|
+
* `serviceId`, an extension the account blocks for the type of the connection answers 403.
|
|
42
43
|
*/
|
|
43
44
|
createToUpload(body, headers) {
|
|
44
45
|
return this.client.post(`${this.basePath}/create-to-upload`, body, headers);
|
|
45
46
|
}
|
|
46
47
|
/**
|
|
48
|
+
* Copies the content of a file. With `urlToUpload` (the signed URL of a record created by
|
|
49
|
+
* {@link createToUpload} with the same `mimetype` as the file copied), the content is sent to that
|
|
50
|
+
* record and the answer is the `fileId` given; without it, a new record (`attachedType`
|
|
51
|
+
* `'message.file'`) is created with the copied content and its id is the answer, and with
|
|
52
|
+
* `serviceId` an extension the account blocks for the type of the connection answers 403. An
|
|
53
|
+
* unknown `fileId` answers 500.
|
|
54
|
+
*/
|
|
55
|
+
duplicateFile(body, headers) {
|
|
56
|
+
return this.client.post(`${this.basePath}/duplicate-file`, body, headers);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
47
59
|
* Uploads the content of a file to the `urlToUpload` returned by {@link createToUpload}. The URL
|
|
48
60
|
* is signed by the storage, so the request goes straight to it, without the API token (the
|
|
49
61
|
* storage refuses an `Authorization` header). `mimetype` must be the one sent to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilesApi.mjs","names":[],"sources":["../../../src/apis/files/FilesApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport { requestExternal } from '../../core/requestExternal'\nimport type { GetByIdQuery, ListQuery, Paginated } from '../../core/types'\nimport type {\n File,\n CreateFilePayload,\n UpdateFilePayload,\n CreateToUploadPayload,\n CreateToUploadResult,\n DeleteFileResult,\n} from './types'\n\n/**\n * Files of the account. The backend serves `POST /files` (the record only, no content),\n * `POST /files/create-to-upload` (record + signed URL to upload the content), `POST\n * /files/duplicate-file`, `DELETE /files/:id` and the signed download `GET\n * /files/:accountId/:filename`; there is no list, read by id nor update.\n */\nexport class FilesApi extends BaseCrudApi<\n File,\n CreateFilePayload,\n UpdateFilePayload,\n ListQuery<File>,\n DeleteFileResult\n> {\n constructor(client: ApiClient) {\n super(client, '/files')\n }\n\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query: ListQuery<File> & { paginate: false },\n headers?: Record<string, string>,\n ): Promise<File[]>\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query?: ListQuery<File> & { paginate?: true },\n headers?: Record<string, string>,\n ): Promise<Paginated<File>>\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query?: ListQuery<File>,\n headers?: Record<string, string>,\n ): Promise<Paginated<File> | File[]>\n override getMany(\n query?: ListQuery<File>,\n headers?: Record<string, string>,\n ): Promise<Paginated<File> | File[]> {\n return super.getMany(query, headers)\n }\n\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getOne(query?: ListQuery<File>, headers?: Record<string, string>): Promise<File | null> {\n return super.getOne(query, headers)\n }\n\n /** @deprecated Not served: the backend has no GET /files/:id, so this route answers 404. */\n override getById(\n id: string,\n query?: GetByIdQuery<File>,\n headers?: Record<string, string>,\n ): Promise<File> {\n return super.getById(id, query, headers)\n }\n\n /** @deprecated Not served: the backend has no PUT /files/:id, so this route answers 404. */\n override updateById(\n id: string,\n body: UpdateFilePayload,\n headers?: Record<string, string>,\n ): Promise<File> {\n return super.updateById(id, body, headers)\n }\n\n /**\n * Deletes a file. Resolves `{ success: true }`, also for an unknown id; a file of another\n * account answers 403.\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<DeleteFileResult> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Creates the record of a file and returns the signed URL to upload its content: send the\n * content with {@link upload}. An audio that must be converted (a voice message for the\n * connection) is sent in `base64` instead, and then no `urlToUpload` is returned. `name` and\n * `mimetype` are required (500 without them; an audio without `name` is named `recording`).\n */\n createToUpload(\n body: CreateToUploadPayload,\n headers?: Record<string, string>,\n ): Promise<CreateToUploadResult> {\n return this.client.post<CreateToUploadResult, CreateToUploadPayload>(\n `${this.basePath}/create-to-upload`,\n body,\n headers,\n )\n }\n\n /**\n * Uploads the content of a file to the `urlToUpload` returned by {@link createToUpload}. The URL\n * is signed by the storage, so the request goes straight to it, without the API token (the\n * storage refuses an `Authorization` header). `mimetype` must be the one sent to\n * `createToUpload`. Sent through `client.requestExternal` (the global `fetch` for a client\n * without it). A non-2xx answer of the storage throws `ApiError`.\n */\n async upload(urlToUpload: string, content: BodyInit, mimetype: string): Promise<void> {\n const headers = { 'Content-Type': mimetype }\n await (this.client.requestExternal\n ? this.client.requestExternal('PUT', urlToUpload, content, headers)\n : requestExternal('PUT', urlToUpload, content, headers))\n }\n}\n"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"FilesApi.mjs","names":[],"sources":["../../../src/apis/files/FilesApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport { requestExternal } from '../../core/requestExternal'\nimport type { GetByIdQuery, ListQuery, Paginated } from '../../core/types'\nimport type {\n File,\n CreateFilePayload,\n UpdateFilePayload,\n CreateToUploadPayload,\n CreateToUploadResult,\n DeleteFileResult,\n DuplicateFilePayload,\n} from './types'\n\n/**\n * Files of the account. The backend serves `POST /files` (the record only, no content),\n * `POST /files/create-to-upload` (record + signed URL to upload the content), `POST\n * /files/duplicate-file`, `DELETE /files/:id` and the signed download `GET\n * /files/:accountId/:filename`; there is no list, read by id nor update.\n */\nexport class FilesApi extends BaseCrudApi<\n File,\n CreateFilePayload,\n UpdateFilePayload,\n ListQuery<File>,\n DeleteFileResult\n> {\n constructor(client: ApiClient) {\n super(client, '/files')\n }\n\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query: ListQuery<File> & { paginate: false },\n headers?: Record<string, string>,\n ): Promise<File[]>\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query?: ListQuery<File> & { paginate?: true },\n headers?: Record<string, string>,\n ): Promise<Paginated<File>>\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getMany(\n query?: ListQuery<File>,\n headers?: Record<string, string>,\n ): Promise<Paginated<File> | File[]>\n override getMany(\n query?: ListQuery<File>,\n headers?: Record<string, string>,\n ): Promise<Paginated<File> | File[]> {\n return super.getMany(query, headers)\n }\n\n /** @deprecated Not served: the backend has no GET /files, so this route answers 404. */\n override getOne(query?: ListQuery<File>, headers?: Record<string, string>): Promise<File | null> {\n return super.getOne(query, headers)\n }\n\n /** @deprecated Not served: the backend has no GET /files/:id, so this route answers 404. */\n override getById(\n id: string,\n query?: GetByIdQuery<File>,\n headers?: Record<string, string>,\n ): Promise<File> {\n return super.getById(id, query, headers)\n }\n\n /** @deprecated Not served: the backend has no PUT /files/:id, so this route answers 404. */\n override updateById(\n id: string,\n body: UpdateFilePayload,\n headers?: Record<string, string>,\n ): Promise<File> {\n return super.updateById(id, body, headers)\n }\n\n /**\n * Deletes a file. Resolves `{ success: true }`, also for an unknown id; a file of another\n * account answers 403.\n */\n override deleteById(id: string, headers?: Record<string, string>): Promise<DeleteFileResult> {\n return super.deleteById(id, headers)\n }\n\n /**\n * Creates the record of a file and returns the signed URL to upload its content: send the\n * content with {@link upload}. An audio that must be converted (a voice message for the\n * connection) is sent in `base64` instead, and then no `urlToUpload` is returned. `name` and\n * `mimetype` are required (500 without them; an audio without `name` is named `recording`). With\n * `serviceId`, an extension the account blocks for the type of the connection answers 403.\n */\n createToUpload(\n body: CreateToUploadPayload,\n headers?: Record<string, string>,\n ): Promise<CreateToUploadResult> {\n return this.client.post<CreateToUploadResult, CreateToUploadPayload>(\n `${this.basePath}/create-to-upload`,\n body,\n headers,\n )\n }\n\n /**\n * Copies the content of a file. With `urlToUpload` (the signed URL of a record created by\n * {@link createToUpload} with the same `mimetype` as the file copied), the content is sent to that\n * record and the answer is the `fileId` given; without it, a new record (`attachedType`\n * `'message.file'`) is created with the copied content and its id is the answer, and with\n * `serviceId` an extension the account blocks for the type of the connection answers 403. An\n * unknown `fileId` answers 500.\n */\n duplicateFile(body: DuplicateFilePayload, headers?: Record<string, string>): Promise<string> {\n return this.client.post<string, DuplicateFilePayload>(\n `${this.basePath}/duplicate-file`,\n body,\n headers,\n )\n }\n\n /**\n * Uploads the content of a file to the `urlToUpload` returned by {@link createToUpload}. The URL\n * is signed by the storage, so the request goes straight to it, without the API token (the\n * storage refuses an `Authorization` header). `mimetype` must be the one sent to\n * `createToUpload`. Sent through `client.requestExternal` (the global `fetch` for a client\n * without it). A non-2xx answer of the storage throws `ApiError`.\n */\n async upload(urlToUpload: string, content: BodyInit, mimetype: string): Promise<void> {\n const headers = { 'Content-Type': mimetype }\n await (this.client.requestExternal\n ? this.client.requestExternal('PUT', urlToUpload, content, headers)\n : requestExternal('PUT', urlToUpload, content, headers))\n }\n}\n"],"mappings":";;;;;;;;;;AAoBA,IAAa,WAAb,cAA8B,YAM5B;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,SAAS;;CAkBzB,AAAS,QACP,OACA,SACmC;AACnC,SAAO,MAAM,QAAQ,OAAO,QAAQ;;;CAItC,AAAS,OAAO,OAAyB,SAAwD;AAC/F,SAAO,MAAM,OAAO,OAAO,QAAQ;;;CAIrC,AAAS,QACP,IACA,OACA,SACe;AACf,SAAO,MAAM,QAAQ,IAAI,OAAO,QAAQ;;;CAI1C,AAAS,WACP,IACA,MACA,SACe;AACf,SAAO,MAAM,WAAW,IAAI,MAAM,QAAQ;;;;;;CAO5C,AAAS,WAAW,IAAY,SAA6D;AAC3F,SAAO,MAAM,WAAW,IAAI,QAAQ;;;;;;;;;CAUtC,eACE,MACA,SAC+B;AAC/B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,oBACjB,MACA,QACD;;;;;;;;;;CAWH,cAAc,MAA4B,SAAmD;AAC3F,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,kBACjB,MACA,QACD;;;;;;;;;CAUH,MAAM,OAAO,aAAqB,SAAmB,UAAiC;EACpF,MAAM,UAAU,EAAE,gBAAgB,UAAU;AAC5C,SAAO,KAAK,OAAO,kBACf,KAAK,OAAO,gBAAgB,OAAO,aAAa,SAAS,QAAQ,GACjE,gBAAgB,OAAO,aAAa,SAAS,QAAQ"}
|
|
@@ -60,7 +60,10 @@ export type CreateToUploadPayload = {
|
|
|
60
60
|
mimetype: string;
|
|
61
61
|
/** What the file is attached to, e.g. `'message.file'` (default), `'campaign.file'`, `'quickreply.file'`. */
|
|
62
62
|
attachedType?: string;
|
|
63
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Connection that will send the file: used to decide the audio conversion and to apply the
|
|
65
|
+
* extensions the account blocks for its type (403).
|
|
66
|
+
*/
|
|
64
67
|
serviceId?: string;
|
|
65
68
|
/** Audio sent as a voice message (default `true`). */
|
|
66
69
|
isPtt?: boolean;
|
|
@@ -77,6 +80,21 @@ export type CreateToUploadResult = {
|
|
|
77
80
|
name: string;
|
|
78
81
|
mimetype: string;
|
|
79
82
|
};
|
|
83
|
+
/** Body of `FilesApi.duplicateFile`. */
|
|
84
|
+
export type DuplicateFilePayload = {
|
|
85
|
+
/** The file whose content is copied. */
|
|
86
|
+
fileId: string;
|
|
87
|
+
/**
|
|
88
|
+
* Signed URL of a record created by `FilesApi.createToUpload`, with the same `mimetype` as the file
|
|
89
|
+
* copied, to receive the content. Without it, a new record is created with the copied content.
|
|
90
|
+
*/
|
|
91
|
+
urlToUpload?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Connection that will send the new record (used only without `urlToUpload`): the extensions the
|
|
94
|
+
* account blocks for its type apply.
|
|
95
|
+
*/
|
|
96
|
+
serviceId?: string;
|
|
97
|
+
};
|
|
80
98
|
/** Result of `FilesApi.deleteById`. */
|
|
81
99
|
export type DeleteFileResult = {
|
|
82
100
|
success: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/files/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,aAAa,CAAC,EAAE,iBAAiB,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,WAAW,GACnB,IAAI,GACJ,QAAQ,GACR,IAAI,GACJ,gBAAgB,GAChB,QAAQ,GACR,iBAAiB,GACjB,WAAW,GACX,MAAM,CAAA;AAEV,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,0CAA0C;IAC1C,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,4DAA4D;IAC5D,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,QAAQ,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,sEAAsE;IACtE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,sEAAsE;IACtE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,sEAAsE;IACtE,YAAY,CAA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null;
|
|
55
55
|
attachedType: string | null;
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
/** @deprecated Not answered: the model has no such column, so the transformer never sends it. */
|
|
57
|
+
attachedId?: string | null;
|
|
58
|
+
/** @deprecated Not answered: the model has no such column, so the transformer never sends it. */
|
|
59
|
+
notificationReadId?: string | null;
|
|
58
60
|
contactId: string | null;
|
|
59
61
|
userId: string;
|
|
60
62
|
accountId: string;
|
|
@@ -67,7 +69,8 @@ export type Notification = {
|
|
|
67
69
|
schedule?: Schedule | null;
|
|
68
70
|
/** @deprecated Not served: the model has no such association, so it never comes. */
|
|
69
71
|
contact?: Contact | null;
|
|
70
|
-
|
|
72
|
+
/** The read receipts of the notification (a list: `[]` while it was never read). */
|
|
73
|
+
notificationRead?: NotificationRead[];
|
|
71
74
|
};
|
|
72
75
|
/** The backend serves `user`, `schedule` and `notificationRead` (`contact` is never answered). */
|
|
73
76
|
export type NotificationRelationships = 'user' | 'schedule' | 'contact' | 'notificationRead';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/notifications/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,cAAc,GACd,MAAM,GACN,MAAM,GACN,OAAO,GACP,cAAc,GACd,SAAS,GACT,WAAW,GACX,qBAAqB,GACrB,mBAAmB,GACnB,0BAA0B,GAC1B,4BAA4B,GAC5B,aAAa,GACb,YAAY,GACZ,aAAa,GACb,eAAe,GACf,wBAAwB,CAAA;AAE5B,yFAAyF;AACzF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oBAAoB,CAA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G,IAAI,CAAA;IAC1B,oFAAoF;IACpF,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IACxB,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAA;CACtC,CAAA;AAED,kGAAkG;AAClG,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,kBAAkB,CAAA;AAE5F,MAAM,MAAM,yBAAyB,GAAG;IACtC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,kBAAkB,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB,CAAA"}
|
|
@@ -82,6 +82,16 @@ var ServicesApi = class extends require_core_ArchivableCrudApi.ArchivableCrudApi
|
|
|
82
82
|
restart(id, headers) {
|
|
83
83
|
return this.client.post(`${this.basePath}/${id}/restart`, void 0, headers);
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Denies the connection to users (`deny: true`) or gives it back (`deny: false`); the admins are skipped. Denying
|
|
87
|
+
* transfers the open tickets of those users in the connection. The rows are read with
|
|
88
|
+
* `ServiceAccessManagementApi.getMany`. An unknown connection answers 404 `Service not found.`; a missing
|
|
89
|
+
* `userIds` or a `deny` that is not a boolean answers 400.
|
|
90
|
+
* @permissions users.update AND services.operate
|
|
91
|
+
*/
|
|
92
|
+
accessManagement(id, body, headers) {
|
|
93
|
+
return this.client.post(`${this.basePath}/${id}/access-management`, body, headers);
|
|
94
|
+
}
|
|
85
95
|
};
|
|
86
96
|
|
|
87
97
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServicesApi.cjs","names":["ArchivableCrudApi"],"sources":["../../../src/apis/services/ServicesApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { ArchivableCrudApi } from '../../core/ArchivableCrudApi'\nimport type {\n Service,\n CreateServicePayload,\n ServiceLimits,\n UpdateServicePayload,\n ArchiveServicePayload,\n} from './types'\n\nexport class ServicesApi extends ArchivableCrudApi<\n Service,\n CreateServicePayload,\n UpdateServicePayload\n> {\n constructor(client: ApiClient) {\n super(client, '/services')\n }\n\n /**\n * Returns, for each connection type of the account plan, how many connections are used,\n * allowed and still available.\n * @permissions services.view\n */\n getLimits(headers?: Record<string, string>): Promise<ServiceLimits> {\n return this.client.get<ServiceLimits>(`${this.basePath}/limits`, headers)\n }\n\n /**\n * @deprecated The backend does not archive a connection by `PUT { archivedAt }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override archive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.archive(id, headers)\n }\n\n /**\n * @deprecated The backend does not restore a connection by `PUT { archivedAt: null }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override unarchive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.unarchive(id, headers)\n }\n\n /**\n * Archives (`archive: true`) or restores (`archive: false`) a connection through the route used\n * by the UI. Archiving shuts the connection down, closes its open tickets, marks its schedules\n * as done and cancels its campaigns; restoring checks the plan limit of the `type` (400 when it\n * is full).\n *\n * Resolves `{}` before the work is done (the route does not await it): poll `getById` until\n * `archivedAt` changes. Send the `type` of the connection: without it the request is never\n * answered.\n * @permissions services.disabled\n */\n archiveWithValidation(\n id: string,\n body: ArchiveServicePayload,\n headers?: Record<string, string>,\n ): Promise<Record<string, never>> {\n return this.client.post<Record<string, never>, ArchiveServicePayload>(\n `${this.basePath}/${id}/archive`,\n body,\n headers,\n )\n }\n\n /**\n * Takes the session of the connection over to this server. Resolves the text `'OK'`; an\n * unknown id answers 404 `Service not found.`.\n * @permissions services.operate\n */\n takeover(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/takeover`, undefined, headers)\n }\n\n /**\n * Logs the connection out of the messaging service. Resolves the text `'OK'`; an unknown id\n * answers 404 `Service not found.`.\n * @permissions services.operate\n */\n logout(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/logout`, undefined, headers)\n }\n\n /**\n * Shuts the connection down. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n shutdown(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/shutdown`, undefined, headers)\n }\n\n /**\n * Starts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n start(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/start`, undefined, headers)\n }\n\n /**\n * Restarts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n restart(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/restart`, undefined, headers)\n }\n}\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"ServicesApi.cjs","names":["ArchivableCrudApi"],"sources":["../../../src/apis/services/ServicesApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { ArchivableCrudApi } from '../../core/ArchivableCrudApi'\nimport type {\n Service,\n CreateServicePayload,\n ServiceLimits,\n UpdateServicePayload,\n ArchiveServicePayload,\n ServiceAccessManagementPayload,\n ServiceAccessManagementResponse,\n} from './types'\n\nexport class ServicesApi extends ArchivableCrudApi<\n Service,\n CreateServicePayload,\n UpdateServicePayload\n> {\n constructor(client: ApiClient) {\n super(client, '/services')\n }\n\n /**\n * Returns, for each connection type of the account plan, how many connections are used,\n * allowed and still available.\n * @permissions services.view\n */\n getLimits(headers?: Record<string, string>): Promise<ServiceLimits> {\n return this.client.get<ServiceLimits>(`${this.basePath}/limits`, headers)\n }\n\n /**\n * @deprecated The backend does not archive a connection by `PUT { archivedAt }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override archive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.archive(id, headers)\n }\n\n /**\n * @deprecated The backend does not restore a connection by `PUT { archivedAt: null }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override unarchive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.unarchive(id, headers)\n }\n\n /**\n * Archives (`archive: true`) or restores (`archive: false`) a connection through the route used\n * by the UI. Archiving shuts the connection down, closes its open tickets, marks its schedules\n * as done and cancels its campaigns; restoring checks the plan limit of the `type` (400 when it\n * is full).\n *\n * Resolves `{}` before the work is done (the route does not await it): poll `getById` until\n * `archivedAt` changes. Send the `type` of the connection: without it the request is never\n * answered.\n * @permissions services.disabled\n */\n archiveWithValidation(\n id: string,\n body: ArchiveServicePayload,\n headers?: Record<string, string>,\n ): Promise<Record<string, never>> {\n return this.client.post<Record<string, never>, ArchiveServicePayload>(\n `${this.basePath}/${id}/archive`,\n body,\n headers,\n )\n }\n\n /**\n * Takes the session of the connection over to this server. Resolves the text `'OK'`; an\n * unknown id answers 404 `Service not found.`.\n * @permissions services.operate\n */\n takeover(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/takeover`, undefined, headers)\n }\n\n /**\n * Logs the connection out of the messaging service. Resolves the text `'OK'`; an unknown id\n * answers 404 `Service not found.`.\n * @permissions services.operate\n */\n logout(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/logout`, undefined, headers)\n }\n\n /**\n * Shuts the connection down. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n shutdown(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/shutdown`, undefined, headers)\n }\n\n /**\n * Starts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n start(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/start`, undefined, headers)\n }\n\n /**\n * Restarts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n restart(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/restart`, undefined, headers)\n }\n\n /**\n * Denies the connection to users (`deny: true`) or gives it back (`deny: false`); the admins are skipped. Denying\n * transfers the open tickets of those users in the connection. The rows are read with\n * `ServiceAccessManagementApi.getMany`. An unknown connection answers 404 `Service not found.`; a missing\n * `userIds` or a `deny` that is not a boolean answers 400.\n * @permissions users.update AND services.operate\n */\n accessManagement(\n id: string,\n body: ServiceAccessManagementPayload,\n headers?: Record<string, string>,\n ): Promise<ServiceAccessManagementResponse> {\n return this.client.post<ServiceAccessManagementResponse, ServiceAccessManagementPayload>(\n `${this.basePath}/${id}/access-management`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;;AAYA,IAAa,cAAb,cAAiCA,iDAI/B;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,YAAY;;;;;;;CAQ5B,UAAU,SAA0D;AAClE,SAAO,KAAK,OAAO,IAAmB,GAAG,KAAK,SAAS,UAAU,QAAQ;;;;;;CAO3E,AAAS,QAAQ,IAAY,SAAoD;AAC/E,SAAO,MAAM,QAAQ,IAAI,QAAQ;;;;;;CAOnC,AAAS,UAAU,IAAY,SAAoD;AACjF,SAAO,MAAM,UAAU,IAAI,QAAQ;;;;;;;;;;;;;CAcrC,sBACE,IACA,MACA,SACgC;AAChC,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD;;;;;;;CAQH,SAAS,IAAY,SAAiD;AACpE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,YAAY,QAAW,QAAQ;;;;;;;CAQtF,OAAO,IAAY,SAAiD;AAClE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,UAAU,QAAW,QAAQ;;;;;;;CAQpF,SAAS,IAAY,SAAiD;AACpE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,YAAY,QAAW,QAAQ;;;;;;;CAQtF,MAAM,IAAY,SAAiD;AACjE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,SAAS,QAAW,QAAQ;;;;;;;CAQnF,QAAQ,IAAY,SAAiD;AACnE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,WAAW,QAAW,QAAQ;;;;;;;;;CAUrF,iBACE,IACA,MACA,SAC0C;AAC1C,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,GAAG,GAAG,qBACvB,MACA,QACD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ApiClient } from '../../core/ApiClient';
|
|
2
2
|
import { ArchivableCrudApi } from '../../core/ArchivableCrudApi';
|
|
3
|
-
import type { Service, CreateServicePayload, ServiceLimits, UpdateServicePayload, ArchiveServicePayload } from './types';
|
|
3
|
+
import type { Service, CreateServicePayload, ServiceLimits, UpdateServicePayload, ArchiveServicePayload, ServiceAccessManagementPayload, ServiceAccessManagementResponse } from './types';
|
|
4
4
|
export declare class ServicesApi extends ArchivableCrudApi<Service, CreateServicePayload, UpdateServicePayload> {
|
|
5
5
|
constructor(client: ApiClient);
|
|
6
6
|
/**
|
|
@@ -61,5 +61,13 @@ export declare class ServicesApi extends ArchivableCrudApi<Service, CreateServic
|
|
|
61
61
|
* @permissions services.operate
|
|
62
62
|
*/
|
|
63
63
|
restart(id: string, headers?: Record<string, string>): Promise<'OK'>;
|
|
64
|
+
/**
|
|
65
|
+
* Denies the connection to users (`deny: true`) or gives it back (`deny: false`); the admins are skipped. Denying
|
|
66
|
+
* transfers the open tickets of those users in the connection. The rows are read with
|
|
67
|
+
* `ServiceAccessManagementApi.getMany`. An unknown connection answers 404 `Service not found.`; a missing
|
|
68
|
+
* `userIds` or a `deny` that is not a boolean answers 400.
|
|
69
|
+
* @permissions users.update AND services.operate
|
|
70
|
+
*/
|
|
71
|
+
accessManagement(id: string, body: ServiceAccessManagementPayload, headers?: Record<string, string>): Promise<ServiceAccessManagementResponse>;
|
|
64
72
|
}
|
|
65
73
|
//# sourceMappingURL=ServicesApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServicesApi.d.ts","sourceRoot":"","sources":["../../../src/apis/services/ServicesApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,KAAK,EACV,OAAO,EACP,oBAAoB,EACpB,aAAa,EACb,oBAAoB,EACpB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ServicesApi.d.ts","sourceRoot":"","sources":["../../../src/apis/services/ServicesApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,KAAK,EACV,OAAO,EACP,oBAAoB,EACpB,aAAa,EACb,oBAAoB,EACpB,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AAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlE;;;;OAIG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE;;;;;;OAMG;IACH,gBAAgB,CACd,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,8BAA8B,EACpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,+BAA+B,CAAC;CAO5C"}
|
|
@@ -81,6 +81,16 @@ var ServicesApi = class extends ArchivableCrudApi {
|
|
|
81
81
|
restart(id, headers) {
|
|
82
82
|
return this.client.post(`${this.basePath}/${id}/restart`, void 0, headers);
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Denies the connection to users (`deny: true`) or gives it back (`deny: false`); the admins are skipped. Denying
|
|
86
|
+
* transfers the open tickets of those users in the connection. The rows are read with
|
|
87
|
+
* `ServiceAccessManagementApi.getMany`. An unknown connection answers 404 `Service not found.`; a missing
|
|
88
|
+
* `userIds` or a `deny` that is not a boolean answers 400.
|
|
89
|
+
* @permissions users.update AND services.operate
|
|
90
|
+
*/
|
|
91
|
+
accessManagement(id, body, headers) {
|
|
92
|
+
return this.client.post(`${this.basePath}/${id}/access-management`, body, headers);
|
|
93
|
+
}
|
|
84
94
|
};
|
|
85
95
|
|
|
86
96
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServicesApi.mjs","names":[],"sources":["../../../src/apis/services/ServicesApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { ArchivableCrudApi } from '../../core/ArchivableCrudApi'\nimport type {\n Service,\n CreateServicePayload,\n ServiceLimits,\n UpdateServicePayload,\n ArchiveServicePayload,\n} from './types'\n\nexport class ServicesApi extends ArchivableCrudApi<\n Service,\n CreateServicePayload,\n UpdateServicePayload\n> {\n constructor(client: ApiClient) {\n super(client, '/services')\n }\n\n /**\n * Returns, for each connection type of the account plan, how many connections are used,\n * allowed and still available.\n * @permissions services.view\n */\n getLimits(headers?: Record<string, string>): Promise<ServiceLimits> {\n return this.client.get<ServiceLimits>(`${this.basePath}/limits`, headers)\n }\n\n /**\n * @deprecated The backend does not archive a connection by `PUT { archivedAt }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override archive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.archive(id, headers)\n }\n\n /**\n * @deprecated The backend does not restore a connection by `PUT { archivedAt: null }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override unarchive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.unarchive(id, headers)\n }\n\n /**\n * Archives (`archive: true`) or restores (`archive: false`) a connection through the route used\n * by the UI. Archiving shuts the connection down, closes its open tickets, marks its schedules\n * as done and cancels its campaigns; restoring checks the plan limit of the `type` (400 when it\n * is full).\n *\n * Resolves `{}` before the work is done (the route does not await it): poll `getById` until\n * `archivedAt` changes. Send the `type` of the connection: without it the request is never\n * answered.\n * @permissions services.disabled\n */\n archiveWithValidation(\n id: string,\n body: ArchiveServicePayload,\n headers?: Record<string, string>,\n ): Promise<Record<string, never>> {\n return this.client.post<Record<string, never>, ArchiveServicePayload>(\n `${this.basePath}/${id}/archive`,\n body,\n headers,\n )\n }\n\n /**\n * Takes the session of the connection over to this server. Resolves the text `'OK'`; an\n * unknown id answers 404 `Service not found.`.\n * @permissions services.operate\n */\n takeover(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/takeover`, undefined, headers)\n }\n\n /**\n * Logs the connection out of the messaging service. Resolves the text `'OK'`; an unknown id\n * answers 404 `Service not found.`.\n * @permissions services.operate\n */\n logout(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/logout`, undefined, headers)\n }\n\n /**\n * Shuts the connection down. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n shutdown(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/shutdown`, undefined, headers)\n }\n\n /**\n * Starts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n start(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/start`, undefined, headers)\n }\n\n /**\n * Restarts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n restart(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/restart`, undefined, headers)\n }\n}\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ServicesApi.mjs","names":[],"sources":["../../../src/apis/services/ServicesApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { ArchivableCrudApi } from '../../core/ArchivableCrudApi'\nimport type {\n Service,\n CreateServicePayload,\n ServiceLimits,\n UpdateServicePayload,\n ArchiveServicePayload,\n ServiceAccessManagementPayload,\n ServiceAccessManagementResponse,\n} from './types'\n\nexport class ServicesApi extends ArchivableCrudApi<\n Service,\n CreateServicePayload,\n UpdateServicePayload\n> {\n constructor(client: ApiClient) {\n super(client, '/services')\n }\n\n /**\n * Returns, for each connection type of the account plan, how many connections are used,\n * allowed and still available.\n * @permissions services.view\n */\n getLimits(headers?: Record<string, string>): Promise<ServiceLimits> {\n return this.client.get<ServiceLimits>(`${this.basePath}/limits`, headers)\n }\n\n /**\n * @deprecated The backend does not archive a connection by `PUT { archivedAt }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override archive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.archive(id, headers)\n }\n\n /**\n * @deprecated The backend does not restore a connection by `PUT { archivedAt: null }`: the PUT\n * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.\n */\n override unarchive(id: string, headers?: Record<string, string>): Promise<Service> {\n return super.unarchive(id, headers)\n }\n\n /**\n * Archives (`archive: true`) or restores (`archive: false`) a connection through the route used\n * by the UI. Archiving shuts the connection down, closes its open tickets, marks its schedules\n * as done and cancels its campaigns; restoring checks the plan limit of the `type` (400 when it\n * is full).\n *\n * Resolves `{}` before the work is done (the route does not await it): poll `getById` until\n * `archivedAt` changes. Send the `type` of the connection: without it the request is never\n * answered.\n * @permissions services.disabled\n */\n archiveWithValidation(\n id: string,\n body: ArchiveServicePayload,\n headers?: Record<string, string>,\n ): Promise<Record<string, never>> {\n return this.client.post<Record<string, never>, ArchiveServicePayload>(\n `${this.basePath}/${id}/archive`,\n body,\n headers,\n )\n }\n\n /**\n * Takes the session of the connection over to this server. Resolves the text `'OK'`; an\n * unknown id answers 404 `Service not found.`.\n * @permissions services.operate\n */\n takeover(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/takeover`, undefined, headers)\n }\n\n /**\n * Logs the connection out of the messaging service. Resolves the text `'OK'`; an unknown id\n * answers 404 `Service not found.`.\n * @permissions services.operate\n */\n logout(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/logout`, undefined, headers)\n }\n\n /**\n * Shuts the connection down. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n shutdown(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/shutdown`, undefined, headers)\n }\n\n /**\n * Starts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n start(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/start`, undefined, headers)\n }\n\n /**\n * Restarts the connection. Resolves the text `'OK'`; an unknown id answers 404\n * `Service not found.`.\n * @permissions services.operate\n */\n restart(id: string, headers?: Record<string, string>): Promise<'OK'> {\n return this.client.post<'OK'>(`${this.basePath}/${id}/restart`, undefined, headers)\n }\n\n /**\n * Denies the connection to users (`deny: true`) or gives it back (`deny: false`); the admins are skipped. Denying\n * transfers the open tickets of those users in the connection. The rows are read with\n * `ServiceAccessManagementApi.getMany`. An unknown connection answers 404 `Service not found.`; a missing\n * `userIds` or a `deny` that is not a boolean answers 400.\n * @permissions users.update AND services.operate\n */\n accessManagement(\n id: string,\n body: ServiceAccessManagementPayload,\n headers?: Record<string, string>,\n ): Promise<ServiceAccessManagementResponse> {\n return this.client.post<ServiceAccessManagementResponse, ServiceAccessManagementPayload>(\n `${this.basePath}/${id}/access-management`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;AAYA,IAAa,cAAb,cAAiC,kBAI/B;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,YAAY;;;;;;;CAQ5B,UAAU,SAA0D;AAClE,SAAO,KAAK,OAAO,IAAmB,GAAG,KAAK,SAAS,UAAU,QAAQ;;;;;;CAO3E,AAAS,QAAQ,IAAY,SAAoD;AAC/E,SAAO,MAAM,QAAQ,IAAI,QAAQ;;;;;;CAOnC,AAAS,UAAU,IAAY,SAAoD;AACjF,SAAO,MAAM,UAAU,IAAI,QAAQ;;;;;;;;;;;;;CAcrC,sBACE,IACA,MACA,SACgC;AAChC,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD;;;;;;;CAQH,SAAS,IAAY,SAAiD;AACpE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,YAAY,QAAW,QAAQ;;;;;;;CAQtF,OAAO,IAAY,SAAiD;AAClE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,UAAU,QAAW,QAAQ;;;;;;;CAQpF,SAAS,IAAY,SAAiD;AACpE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,YAAY,QAAW,QAAQ;;;;;;;CAQtF,MAAM,IAAY,SAAiD;AACjE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,SAAS,QAAW,QAAQ;;;;;;;CAQnF,QAAQ,IAAY,SAAiD;AACnE,SAAO,KAAK,OAAO,KAAW,GAAG,KAAK,SAAS,GAAG,GAAG,WAAW,QAAW,QAAQ;;;;;;;;;CAUrF,iBACE,IACA,MACA,SAC0C;AAC1C,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,GAAG,GAAG,qBACvB,MACA,QACD"}
|
|
@@ -275,4 +275,14 @@ export type ServiceLimit = {
|
|
|
275
275
|
};
|
|
276
276
|
/** Connections used and allowed by the account plan, by connection type. */
|
|
277
277
|
export type ServiceLimits = Partial<Record<ServiceType, ServiceLimit>>;
|
|
278
|
+
/** The body of `accessManagement`: the users to deny (or give back) the connection to. */
|
|
279
|
+
export type ServiceAccessManagementPayload = {
|
|
280
|
+
userIds: string[];
|
|
281
|
+
/** `true` denies the connection to the users (their open tickets in it are transferred); `false` gives it back. */
|
|
282
|
+
deny: boolean;
|
|
283
|
+
};
|
|
284
|
+
/** What `accessManagement` answers: how many users were denied or given back the connection (no admin is counted). */
|
|
285
|
+
export type ServiceAccessManagementResponse = {
|
|
286
|
+
message: `${number} users denied access.` | `${number} users allowed access.`;
|
|
287
|
+
};
|
|
278
288
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/services/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,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AAE,MAAM,GAAG,IAAI,CAAA;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B,CAAA;AAED,mDAAmD;AACnD,MAAM,MAAM,qBAAqB,GAAG;IAClC,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAA;IAChB,+FAA+F;IAC/F,IAAI,EAAE,WAAW,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,4EAA4E;AAC5E,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC,CAAA;AAEtE,0FAA0F;AAC1F,MAAM,MAAM,8BAA8B,GAAG;IAC3C,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,mHAAmH;IACnH,IAAI,EAAE,OAAO,CAAA;CACd,CAAA;AAED,sHAAsH;AACtH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,OAAO,EAAE,GAAG,MAAM,uBAAuB,GAAG,GAAG,MAAM,wBAAwB,CAAA;CAC9E,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { File } from '../files/types';
|
|
2
|
+
import type { Message } from '../messages/types';
|
|
2
3
|
import type { User } from '../users/types';
|
|
3
4
|
/** A sticker of the account (every user of the account sees it). */
|
|
4
5
|
export type Sticker = {
|
|
@@ -17,6 +18,8 @@ export type Sticker = {
|
|
|
17
18
|
user?: User;
|
|
18
19
|
/** The image (webp) of the sticker. */
|
|
19
20
|
file?: File;
|
|
21
|
+
/** The message the sticker came from (`add`); `null` on a sticker uploaded with `create`. */
|
|
22
|
+
originMessage?: Message | null;
|
|
20
23
|
};
|
|
21
24
|
/** The backend serves only `file` (`user` is dropped). */
|
|
22
25
|
export type StickerRelationships = 'user' | 'file';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/stickers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,oEAAoE;AACpE,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,2FAA2F;IAC3F,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IACzC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEzB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,uCAAuC;IACvC,IAAI,CAAC,EAAE,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/stickers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,oEAAoE;AACpE,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,2FAA2F;IAC3F,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,C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5
|
/**
|
|
6
6
|
* Generic read-only resource: `getMany`, `getOne` and `getById` under `basePath`. Base of
|
|
7
|
-
* `BaseCrudApi`, and of the resources the backend
|
|
8
|
-
* auth history).
|
|
7
|
+
* `BaseCrudApi`, and of the resources the backend serves for reading, plus their own actions (e.g.
|
|
8
|
+
* permissions, auth history).
|
|
9
9
|
*/
|
|
10
10
|
var BaseReadApi = class extends require_core_BaseApi.BaseApi {
|
|
11
11
|
basePath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseReadApi.cjs","names":["BaseApi"],"sources":["../../src/core/BaseReadApi.ts"],"sourcesContent":["import type { ApiClient } from './ApiClient'\nimport { BaseApi } from './BaseApi'\nimport type { GetByIdQuery, HasGetById, HasGetMany, ListQuery, Paginated } from './types'\n\n/**\n * Generic read-only resource: `getMany`, `getOne` and `getById` under `basePath`. Base of\n * `BaseCrudApi`, and of the resources the backend
|
|
1
|
+
{"version":3,"file":"BaseReadApi.cjs","names":["BaseApi"],"sources":["../../src/core/BaseReadApi.ts"],"sourcesContent":["import type { ApiClient } from './ApiClient'\nimport { BaseApi } from './BaseApi'\nimport type { GetByIdQuery, HasGetById, HasGetMany, ListQuery, Paginated } from './types'\n\n/**\n * Generic read-only resource: `getMany`, `getOne` and `getById` under `basePath`. Base of\n * `BaseCrudApi`, and of the resources the backend serves for reading, plus their own actions (e.g.\n * permissions, auth history).\n */\nexport class BaseReadApi<TResponse, TQuery extends ListQuery<TResponse> = ListQuery<TResponse>>\n extends BaseApi\n implements HasGetMany<TResponse, TQuery>, HasGetById<TResponse>\n{\n public readonly basePath: string\n\n constructor(client: ApiClient, basePath: string) {\n super(client)\n this.basePath = basePath.replace(/\\/$/, '')\n }\n\n getMany(\n query: TQuery & { paginate: false },\n headers?: Record<string, string>,\n ): Promise<TResponse[]>\n getMany(\n query?: TQuery & { paginate?: true },\n headers?: Record<string, string>,\n ): Promise<Paginated<TResponse>>\n getMany(\n query?: TQuery,\n headers?: Record<string, string>,\n ): Promise<Paginated<TResponse> | TResponse[]>\n getMany(\n query?: TQuery,\n headers?: Record<string, string>,\n ): Promise<Paginated<TResponse> | TResponse[]> {\n const queryString = this.toQueryString(query)\n return this.client.get<Paginated<TResponse> | TResponse[]>(\n `${this.basePath}${queryString}`,\n headers,\n )\n }\n\n /**\n * Returns the first resource matching the query, or `null` when none match.\n * Convenience over `getMany` with `limit: 1`.\n * @permissions $resourceName.view\n */\n async getOne(query?: TQuery, headers?: Record<string, string>): Promise<TResponse | null> {\n const results = await this.getMany(\n { ...query, limit: 1, paginate: false } as TQuery & { paginate: false },\n headers,\n )\n // An empty response body resolves to `undefined`.\n return results?.[0] ?? null\n }\n\n /**\n * Returns a single resource by ID. When it does not exist most routes answer 200 with an empty\n * body, which resolves to `undefined`.\n * @permissions $resourceName.view\n */\n getById(\n id: string,\n query?: GetByIdQuery<TResponse>,\n headers?: Record<string, string>,\n ): Promise<TResponse> {\n return this.client.get<TResponse>(`${this.basePath}/${id}${this.toQueryString(query)}`, headers)\n }\n}\n"],"mappings":";;;;;;;;;AASA,IAAa,cAAb,cACUA,6BAEV;CACE,AAAgB;CAEhB,YAAY,QAAmB,UAAkB;AAC/C,QAAM,OAAO;AACb,OAAK,WAAW,SAAS,QAAQ,OAAO,GAAG;;CAe7C,QACE,OACA,SAC6C;EAC7C,MAAM,cAAc,KAAK,cAAc,MAAM;AAC7C,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,WAAW,eACnB,QACD;;;;;;;CAQH,MAAM,OAAO,OAAgB,SAA6D;AAMxF,UALgB,MAAM,KAAK,QACzB;GAAE,GAAG;GAAO,OAAO;GAAG,UAAU;GAAO,EACvC,QACD,IAEgB,MAAM;;;;;;;CAQzB,QACE,IACA,OACA,SACoB;AACpB,SAAO,KAAK,OAAO,IAAe,GAAG,KAAK,SAAS,GAAG,KAAK,KAAK,cAAc,MAAM,IAAI,QAAQ"}
|
|
@@ -3,8 +3,8 @@ import { BaseApi } from './BaseApi';
|
|
|
3
3
|
import type { GetByIdQuery, HasGetById, HasGetMany, ListQuery, Paginated } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* Generic read-only resource: `getMany`, `getOne` and `getById` under `basePath`. Base of
|
|
6
|
-
* `BaseCrudApi`, and of the resources the backend
|
|
7
|
-
* auth history).
|
|
6
|
+
* `BaseCrudApi`, and of the resources the backend serves for reading, plus their own actions (e.g.
|
|
7
|
+
* permissions, auth history).
|
|
8
8
|
*/
|
|
9
9
|
export declare class BaseReadApi<TResponse, TQuery extends ListQuery<TResponse> = ListQuery<TResponse>> extends BaseApi implements HasGetMany<TResponse, TQuery>, HasGetById<TResponse> {
|
|
10
10
|
readonly basePath: string;
|
|
@@ -3,8 +3,8 @@ import { BaseApi } from "./BaseApi.mjs";
|
|
|
3
3
|
//#region src/core/BaseReadApi.ts
|
|
4
4
|
/**
|
|
5
5
|
* Generic read-only resource: `getMany`, `getOne` and `getById` under `basePath`. Base of
|
|
6
|
-
* `BaseCrudApi`, and of the resources the backend
|
|
7
|
-
* auth history).
|
|
6
|
+
* `BaseCrudApi`, and of the resources the backend serves for reading, plus their own actions (e.g.
|
|
7
|
+
* permissions, auth history).
|
|
8
8
|
*/
|
|
9
9
|
var BaseReadApi = class extends BaseApi {
|
|
10
10
|
basePath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseReadApi.mjs","names":[],"sources":["../../src/core/BaseReadApi.ts"],"sourcesContent":["import type { ApiClient } from './ApiClient'\nimport { BaseApi } from './BaseApi'\nimport type { GetByIdQuery, HasGetById, HasGetMany, ListQuery, Paginated } from './types'\n\n/**\n * Generic read-only resource: `getMany`, `getOne` and `getById` under `basePath`. Base of\n * `BaseCrudApi`, and of the resources the backend
|
|
1
|
+
{"version":3,"file":"BaseReadApi.mjs","names":[],"sources":["../../src/core/BaseReadApi.ts"],"sourcesContent":["import type { ApiClient } from './ApiClient'\nimport { BaseApi } from './BaseApi'\nimport type { GetByIdQuery, HasGetById, HasGetMany, ListQuery, Paginated } from './types'\n\n/**\n * Generic read-only resource: `getMany`, `getOne` and `getById` under `basePath`. Base of\n * `BaseCrudApi`, and of the resources the backend serves for reading, plus their own actions (e.g.\n * permissions, auth history).\n */\nexport class BaseReadApi<TResponse, TQuery extends ListQuery<TResponse> = ListQuery<TResponse>>\n extends BaseApi\n implements HasGetMany<TResponse, TQuery>, HasGetById<TResponse>\n{\n public readonly basePath: string\n\n constructor(client: ApiClient, basePath: string) {\n super(client)\n this.basePath = basePath.replace(/\\/$/, '')\n }\n\n getMany(\n query: TQuery & { paginate: false },\n headers?: Record<string, string>,\n ): Promise<TResponse[]>\n getMany(\n query?: TQuery & { paginate?: true },\n headers?: Record<string, string>,\n ): Promise<Paginated<TResponse>>\n getMany(\n query?: TQuery,\n headers?: Record<string, string>,\n ): Promise<Paginated<TResponse> | TResponse[]>\n getMany(\n query?: TQuery,\n headers?: Record<string, string>,\n ): Promise<Paginated<TResponse> | TResponse[]> {\n const queryString = this.toQueryString(query)\n return this.client.get<Paginated<TResponse> | TResponse[]>(\n `${this.basePath}${queryString}`,\n headers,\n )\n }\n\n /**\n * Returns the first resource matching the query, or `null` when none match.\n * Convenience over `getMany` with `limit: 1`.\n * @permissions $resourceName.view\n */\n async getOne(query?: TQuery, headers?: Record<string, string>): Promise<TResponse | null> {\n const results = await this.getMany(\n { ...query, limit: 1, paginate: false } as TQuery & { paginate: false },\n headers,\n )\n // An empty response body resolves to `undefined`.\n return results?.[0] ?? null\n }\n\n /**\n * Returns a single resource by ID. When it does not exist most routes answer 200 with an empty\n * body, which resolves to `undefined`.\n * @permissions $resourceName.view\n */\n getById(\n id: string,\n query?: GetByIdQuery<TResponse>,\n headers?: Record<string, string>,\n ): Promise<TResponse> {\n return this.client.get<TResponse>(`${this.basePath}/${id}${this.toQueryString(query)}`, headers)\n }\n}\n"],"mappings":";;;;;;;;AASA,IAAa,cAAb,cACU,QAEV;CACE,AAAgB;CAEhB,YAAY,QAAmB,UAAkB;AAC/C,QAAM,OAAO;AACb,OAAK,WAAW,SAAS,QAAQ,OAAO,GAAG;;CAe7C,QACE,OACA,SAC6C;EAC7C,MAAM,cAAc,KAAK,cAAc,MAAM;AAC7C,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,WAAW,eACnB,QACD;;;;;;;CAQH,MAAM,OAAO,OAAgB,SAA6D;AAMxF,UALgB,MAAM,KAAK,QACzB;GAAE,GAAG;GAAO,OAAO;GAAG,UAAU;GAAO,EACvC,QACD,IAEgB,MAAM;;;;;;;CAQzB,QACE,IACA,OACA,SACoB;AACpB,SAAO,KAAK,OAAO,IAAe,GAAG,KAAK,SAAS,GAAG,KAAK,KAAK,cAAc,MAAM,IAAI,QAAQ"}
|
package/package.json
CHANGED
|
@@ -115,4 +115,20 @@ describe('AuthHistoryApi', () => {
|
|
|
115
115
|
await expect(api.getById('missing')).rejects.toThrow('Not found')
|
|
116
116
|
})
|
|
117
117
|
})
|
|
118
|
+
|
|
119
|
+
describe('registerLogout', () => {
|
|
120
|
+
it('calls client.post with /auth-history and an empty body', async () => {
|
|
121
|
+
vi.mocked(client.post).mockResolvedValue(undefined)
|
|
122
|
+
const result = await api.registerLogout()
|
|
123
|
+
expect(client.post).toHaveBeenCalledWith('/auth-history', {}, undefined)
|
|
124
|
+
expect(result).toBeUndefined()
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
it('forwards custom headers', async () => {
|
|
128
|
+
vi.mocked(client.post).mockResolvedValue(undefined)
|
|
129
|
+
const headers = { 'X-Req': 'r-1' }
|
|
130
|
+
await api.registerLogout(headers)
|
|
131
|
+
expect(client.post).toHaveBeenCalledWith('/auth-history', {}, headers)
|
|
132
|
+
})
|
|
133
|
+
})
|
|
118
134
|
})
|
|
@@ -3,8 +3,8 @@ import { BaseReadApi } from '../../core/BaseReadApi'
|
|
|
3
3
|
import type { AuthHistory } from './types'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Authentication events (auth, password_change, logout), read
|
|
7
|
-
* `authHistory.view
|
|
6
|
+
* Authentication events (auth, password_change, logout, 2fa_disabled), read with
|
|
7
|
+
* `authHistory.view`. Non-admin users can only see and access their own records.
|
|
8
8
|
*
|
|
9
9
|
* Since 4.2 `getById` has the base signature `(id, query?, headers?)`: a call written as
|
|
10
10
|
* `getById(id, headers)` with the headers in a variable still compiles, but the headers are sent
|
|
@@ -14,4 +14,12 @@ export class AuthHistoryApi extends BaseReadApi<AuthHistory> {
|
|
|
14
14
|
constructor(client: ApiClient) {
|
|
15
15
|
super(client, '/auth-history')
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Records the `logout` event of the current session, as the web app does before revoking its
|
|
20
|
+
* token (revoke the token apart: this call does not). Resolves with no body.
|
|
21
|
+
*/
|
|
22
|
+
registerLogout(headers?: Record<string, string>): Promise<void> {
|
|
23
|
+
return this.client.post<void, Record<string, never>>(this.basePath, {}, headers)
|
|
24
|
+
}
|
|
17
25
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { Account } from '../accounts/types'
|
|
2
2
|
import type { User } from '../users/types'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* `auth`: a login (after the second factor, when active); `password_change`: by the user, by an
|
|
6
|
+
* admin or by the password reset; `logout`: recorded by `AuthHistoryApi.registerLogout`;
|
|
7
|
+
* `2fa_disabled`: the second factor turned off, by the user or by an admin.
|
|
8
|
+
*/
|
|
9
|
+
export type AuthHistoryEvent = 'auth' | 'password_change' | 'logout' | '2fa_disabled'
|
|
5
10
|
|
|
6
11
|
export type AuthHistory = {
|
|
7
12
|
id: string
|
|
@@ -138,6 +138,19 @@ describe('ContactsApi', () => {
|
|
|
138
138
|
await api.getById('cnt-1', undefined, headers)
|
|
139
139
|
expect(client.get).toHaveBeenCalledWith('/contacts/cnt-1', headers)
|
|
140
140
|
})
|
|
141
|
+
|
|
142
|
+
it('sends formatCustomFields and the include of the custom fields in the query', async () => {
|
|
143
|
+
vi.mocked(client.get).mockResolvedValue(contact)
|
|
144
|
+
const query = {
|
|
145
|
+
include: [{ model: 'customFieldValues' as const, include: ['customField' as const] }],
|
|
146
|
+
formatCustomFields: true,
|
|
147
|
+
}
|
|
148
|
+
await api.getById('cnt-1', query)
|
|
149
|
+
expect(client.get).toHaveBeenCalledWith(
|
|
150
|
+
`/contacts/cnt-1?query=${encodeURIComponent(JSON.stringify(query))}`,
|
|
151
|
+
undefined,
|
|
152
|
+
)
|
|
153
|
+
})
|
|
141
154
|
})
|
|
142
155
|
|
|
143
156
|
// ── create ───────────────────────────────────────────────────────
|
|
@@ -7,6 +7,8 @@ import type {
|
|
|
7
7
|
BulkTransferTicketsPayload,
|
|
8
8
|
BulkTransferTicketsResult,
|
|
9
9
|
Contact,
|
|
10
|
+
ContactGetByIdQuery,
|
|
11
|
+
ContactListQuery,
|
|
10
12
|
ContactMediaPage,
|
|
11
13
|
ContactMediaQuery,
|
|
12
14
|
ContactsSelection,
|
|
@@ -24,11 +26,31 @@ import type {
|
|
|
24
26
|
SummarizeTicketResult,
|
|
25
27
|
} from './types'
|
|
26
28
|
|
|
27
|
-
export class ContactsApi extends BaseCrudApi<
|
|
29
|
+
export class ContactsApi extends BaseCrudApi<
|
|
30
|
+
Contact,
|
|
31
|
+
CreateContactPayload,
|
|
32
|
+
UpdateContactPayload,
|
|
33
|
+
ContactListQuery
|
|
34
|
+
> {
|
|
28
35
|
constructor(client: ApiClient) {
|
|
29
36
|
super(client, '/contacts')
|
|
30
37
|
}
|
|
31
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Returns a contact by ID. When it does not exist the route answers 200 with an empty body, which
|
|
41
|
+
* resolves to `undefined`. With `formatCustomFields: true` (and the include
|
|
42
|
+
* `{ model: 'customFieldValues', include: ['customField'] }`), the custom fields come keyed by name
|
|
43
|
+
* in `customFields`.
|
|
44
|
+
* @permissions contacts.view
|
|
45
|
+
*/
|
|
46
|
+
override getById(
|
|
47
|
+
id: string,
|
|
48
|
+
query?: ContactGetByIdQuery,
|
|
49
|
+
headers?: Record<string, string>,
|
|
50
|
+
): Promise<Contact> {
|
|
51
|
+
return super.getById(id, query, headers)
|
|
52
|
+
}
|
|
53
|
+
|
|
32
54
|
/**
|
|
33
55
|
* Downloads the CSV template (`;`-separated header line, in the language of the user) for
|
|
34
56
|
* importing contacts, with columns based on the service type. Answered with no Content-Type.
|