@qite/tide-client 1.1.8 → 1.1.11

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.
@@ -0,0 +1,11 @@
1
+ export interface AgentPrintActionRequest {
2
+ id: number;
3
+ invoiceId?: number;
4
+ dossierId?: number;
5
+ dossierNumber: string;
6
+ allotmentId?: number;
7
+ entryLineId?: number;
8
+ productId?: number;
9
+ entryId?: number;
10
+ languageId?: number;
11
+ }
@@ -0,0 +1,6 @@
1
+ import { EntryStatus } from "../enums";
2
+ export interface AgentPrintAction {
3
+ id: number;
4
+ label: string;
5
+ validEntryStatuses: typeof EntryStatus[];
6
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./agent-print-action";
2
+ export * from "./agent-print-action-request";
@@ -9,6 +9,7 @@ export * from "./gender";
9
9
  export * from "./meta-data-type";
10
10
  export * from "./payment-type";
11
11
  export * from "./price-chart-type";
12
+ export * from "./print-action-group";
12
13
  export * from "./requirement-type";
13
14
  export * from "./room-type";
14
15
  export * from "./sale-type";
@@ -0,0 +1,10 @@
1
+ export declare enum PrintActionGroup {
2
+ Dossier = 0,
3
+ Offer = 1,
4
+ Invoice = 2,
5
+ CreditNote = 3,
6
+ Allotment = 4,
7
+ Product = 5,
8
+ EntryLine = 6,
9
+ SelfBillingInvoice = 7,
10
+ }
@@ -0,0 +1,10 @@
1
+ export declare enum PrintActionGroup {
2
+ Dossier = 0,
3
+ Offer = 1,
4
+ Invoice = 2,
5
+ CreditNote = 3,
6
+ Allotment = 4,
7
+ Product = 5,
8
+ EntryLine = 6,
9
+ SelfBillingInvoice = 7,
10
+ }
@@ -1,4 +1,5 @@
1
1
  export * from "./tide-client-config";
2
+ export * from "./company";
2
3
  export * from "./enums";
3
4
  export * from "./offer";
4
5
  export {
@@ -0,0 +1,30 @@
1
+ import {
2
+ AgentPrintAction,
3
+ AgentPrintActionRequest,
4
+ PrintActionGroup,
5
+ TideClientConfig,
6
+ } from "../types";
7
+ /**
8
+ * api/web/agent/print-action/{print-action-group}
9
+ * @param config
10
+ * @param printActionGroup
11
+ * @param signal
12
+ * @returns print actions that are available for agents for given group.
13
+ */
14
+ export declare const getPrintActions: (
15
+ config: TideClientConfig,
16
+ printActionGroup: PrintActionGroup,
17
+ signal?: AbortSignal | undefined
18
+ ) => Promise<AgentPrintAction[]>;
19
+ /**
20
+ * api/web/agent/print-action
21
+ * @param config
22
+ * @param request
23
+ * @param signal
24
+ * @returns pdf as stream.
25
+ */
26
+ export declare const print: (
27
+ config: TideClientConfig,
28
+ request: AgentPrintActionRequest,
29
+ signal?: AbortSignal | undefined
30
+ ) => Promise<Response>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-client",
3
- "version": "1.1.8",
3
+ "version": "1.1.11",
4
4
  "description": "Frontend client for Tide",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -63,6 +63,7 @@ export * from "./utils/booking-v2-client";
63
63
  export * from "./utils/member-client";
64
64
  export * from "./utils/mollie-client";
65
65
  export * from "./utils/search-client";
66
+ export * from "./utils/web-agent-client";
66
67
  export * from "./utils/web-client";
67
68
  export * from "./utils/web-contact-client";
68
69
  export * from "./utils/web-file";
@@ -0,0 +1,11 @@
1
+ export interface AgentPrintActionRequest {
2
+ id: number;
3
+ invoiceId?: number;
4
+ dossierId?: number;
5
+ dossierNumber: string;
6
+ allotmentId?: number;
7
+ entryLineId?: number;
8
+ productId?: number;
9
+ entryId?: number;
10
+ languageId?: number;
11
+ }
@@ -0,0 +1,7 @@
1
+ import { EntryStatus } from "../enums";
2
+
3
+ export interface AgentPrintAction {
4
+ id: number;
5
+ label: string;
6
+ validEntryStatuses: typeof EntryStatus[];
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./agent-print-action";
2
+ export * from "./agent-print-action-request";
@@ -9,6 +9,7 @@ export * from "./gender";
9
9
  export * from "./meta-data-type";
10
10
  export * from "./payment-type";
11
11
  export * from "./price-chart-type";
12
+ export * from "./print-action-group";
12
13
  export * from "./requirement-type";
13
14
  export * from "./room-type";
14
15
  export * from "./sale-type";
@@ -0,0 +1,10 @@
1
+ export enum PrintActionGroup {
2
+ Dossier,
3
+ Offer,
4
+ Invoice,
5
+ CreditNote,
6
+ Allotment,
7
+ Product,
8
+ EntryLine,
9
+ SelfBillingInvoice,
10
+ }
@@ -1,9 +1,7 @@
1
1
  export * from "./tide-client-config";
2
-
2
+ export * from "./company";
3
3
  export * from "./enums";
4
-
5
4
  export * from "./offer";
6
-
7
5
  export {
8
6
  AccommodationOccupancy,
9
7
  AccommodationWithAvailablePlaces,
@@ -0,0 +1,48 @@
1
+ import {
2
+ AgentPrintAction,
3
+ AgentPrintActionRequest,
4
+ PrintActionGroup,
5
+ TideClientConfig,
6
+ } from "../types";
7
+ import { get, post } from "./common-client";
8
+
9
+ const ENDPOINT = "/api/web/agent";
10
+ const ENDPOINT_GET_PRINT_ACTIONS = `${ENDPOINT}/print-action`;
11
+ const ENDPOINT_PRINT = `${ENDPOINT}/print-action`;
12
+
13
+ /**
14
+ * api/web/agent/print-action/{print-action-group}
15
+ * @param config
16
+ * @param printActionGroup
17
+ * @param signal
18
+ * @returns print actions that are available for agents for given group.
19
+ */
20
+ export const getPrintActions = (
21
+ config: TideClientConfig,
22
+ printActionGroup: PrintActionGroup,
23
+ signal?: AbortSignal
24
+ ): Promise<AgentPrintAction[]> => {
25
+ const url = `${config.host}${ENDPOINT_GET_PRINT_ACTIONS}/${printActionGroup}`;
26
+ const apiKey = config.apiKey;
27
+
28
+ return get<AgentPrintAction[]>(url, apiKey, signal, true);
29
+ };
30
+
31
+ /**
32
+ * api/web/agent/print-action
33
+ * @param config
34
+ * @param request
35
+ * @param signal
36
+ * @returns pdf as stream.
37
+ */
38
+ export const print = (
39
+ config: TideClientConfig,
40
+ request: AgentPrintActionRequest,
41
+ signal?: AbortSignal
42
+ ): Promise<Response> => {
43
+ const url = `${config.host}${ENDPOINT_PRINT}`;
44
+ const apiKey = config.apiKey;
45
+ const body = JSON.stringify(request);
46
+
47
+ return post(url, apiKey, body, signal, true);
48
+ };