@qite/tide-client 1.1.8 → 1.1.10
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/build/types/company/agent-print-action-request.d.ts +11 -0
- package/build/types/company/agent-print-action.d.ts +6 -0
- package/build/types/company/index.d.ts +2 -0
- package/build/types/enums/print-action-group.enum.d.ts +10 -0
- package/build/utils/web-agent-client.d.ts +27 -0
- package/package.json +1 -1
- package/src/types/company/agent-print-action-request.ts +11 -0
- package/src/types/company/agent-print-action.ts +7 -0
- package/src/types/company/index.ts +2 -0
- package/src/types/enums/print-action-group.enum.ts +10 -0
- package/src/utils/web-agent-client.ts +45 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TideClientConfig } from "../types";
|
|
2
|
+
import { AgentPrintAction, AgentPrintActionRequest } from "../types/company";
|
|
3
|
+
import { PrintActionGroup } from "../types/enums/print-action-group.enum";
|
|
4
|
+
/**
|
|
5
|
+
* api/web/agent/print-action/{print-action-group}
|
|
6
|
+
* @param config
|
|
7
|
+
* @param printActionGroup
|
|
8
|
+
* @param signal
|
|
9
|
+
* @returns print actions that are available for agents for given group.
|
|
10
|
+
*/
|
|
11
|
+
export declare const getPrintActions: (
|
|
12
|
+
config: TideClientConfig,
|
|
13
|
+
printActionGroup: PrintActionGroup,
|
|
14
|
+
signal?: AbortSignal | undefined
|
|
15
|
+
) => Promise<AgentPrintAction[]>;
|
|
16
|
+
/**
|
|
17
|
+
* api/web/agent/print-action
|
|
18
|
+
* @param config
|
|
19
|
+
* @param request
|
|
20
|
+
* @param signal
|
|
21
|
+
* @returns pdf as stream.
|
|
22
|
+
*/
|
|
23
|
+
export declare const print: (
|
|
24
|
+
config: TideClientConfig,
|
|
25
|
+
request: AgentPrintActionRequest,
|
|
26
|
+
signal?: AbortSignal | undefined
|
|
27
|
+
) => Promise<Response>;
|
package/package.json
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { TideClientConfig } from "../types";
|
|
2
|
+
import { AgentPrintAction, AgentPrintActionRequest } from "../types/company";
|
|
3
|
+
import { PrintActionGroup } from "../types/enums/print-action-group.enum";
|
|
4
|
+
import { get, post } from "./common-client";
|
|
5
|
+
|
|
6
|
+
const ENDPOINT = "/api/web/agent";
|
|
7
|
+
const ENDPOINT_GET_PRINT_ACTIONS = `${ENDPOINT}/print-action`;
|
|
8
|
+
const ENDPOINT_PRINT = `${ENDPOINT}/print-action`;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* api/web/agent/print-action/{print-action-group}
|
|
12
|
+
* @param config
|
|
13
|
+
* @param printActionGroup
|
|
14
|
+
* @param signal
|
|
15
|
+
* @returns print actions that are available for agents for given group.
|
|
16
|
+
*/
|
|
17
|
+
export const getPrintActions = (
|
|
18
|
+
config: TideClientConfig,
|
|
19
|
+
printActionGroup: PrintActionGroup,
|
|
20
|
+
signal?: AbortSignal
|
|
21
|
+
): Promise<AgentPrintAction[]> => {
|
|
22
|
+
const url = `${config.host}${ENDPOINT_GET_PRINT_ACTIONS}/${printActionGroup}`;
|
|
23
|
+
const apiKey = config.apiKey;
|
|
24
|
+
|
|
25
|
+
return get<AgentPrintAction[]>(url, apiKey, signal, true);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* api/web/agent/print-action
|
|
30
|
+
* @param config
|
|
31
|
+
* @param request
|
|
32
|
+
* @param signal
|
|
33
|
+
* @returns pdf as stream.
|
|
34
|
+
*/
|
|
35
|
+
export const print = (
|
|
36
|
+
config: TideClientConfig,
|
|
37
|
+
request: AgentPrintActionRequest,
|
|
38
|
+
signal?: AbortSignal
|
|
39
|
+
): Promise<Response> => {
|
|
40
|
+
const url = `${config.host}${ENDPOINT_PRINT}`;
|
|
41
|
+
const apiKey = config.apiKey;
|
|
42
|
+
const body = JSON.stringify(request);
|
|
43
|
+
|
|
44
|
+
return post(url, apiKey, body, signal, true);
|
|
45
|
+
};
|