@qite/tide-client 1.1.7 → 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.
@@ -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";
@@ -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
+ }
@@ -2,6 +2,7 @@ import { BookingPackageAllotmentInfo } from "./booking-package-allotment-info";
2
2
  export interface BookingPackageItem {
3
3
  accommodationCode: string;
4
4
  accommodationName?: string;
5
+ externalAccommodationCode?: string;
5
6
  airportCode?: string;
6
7
  allotment: BookingPackageAllotmentInfo;
7
8
  averagePricePerPerson: number;
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-client",
3
- "version": "1.1.7",
3
+ "version": "1.1.10",
4
4
  "description": "Frontend client for Tide",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -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";
@@ -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
+ }
@@ -3,6 +3,7 @@ import { BookingPackageAllotmentInfo } from "./booking-package-allotment-info";
3
3
  export interface BookingPackageItem {
4
4
  accommodationCode: string;
5
5
  accommodationName?: string;
6
+ externalAccommodationCode?: string;
6
7
  airportCode?: string;
7
8
  allotment: BookingPackageAllotmentInfo;
8
9
  averagePricePerPerson: number;
@@ -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
+ };