@voyantjs/travel-composer-react 0.104.1 → 0.105.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/hooks/use-trip-components.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/operations.d.ts +66 -4
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +16 -1
- package/dist/query-options.d.ts +4 -4
- package/dist/schemas.d.ts +36 -1
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +3 -0
- package/package.json +6 -6
|
@@ -22,8 +22,8 @@ export declare function useTripComponents(envelopeId: string | null | undefined,
|
|
|
22
22
|
supplierRef: string | null;
|
|
23
23
|
title: string | null;
|
|
24
24
|
kind: "catalog_booking" | "manual_placeholder" | "flight_placeholder" | "flight_order" | "external_order";
|
|
25
|
-
envelopeId: string;
|
|
26
25
|
sequence: number;
|
|
26
|
+
envelopeId: string;
|
|
27
27
|
warningCodes: string[];
|
|
28
28
|
bookingDraftId: string | null;
|
|
29
29
|
catalogQuoteId: string | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { writePriceTripCache, writeReserveTripCache, writeTripCache, writeTripCheckoutCache, } from "./cache.js";
|
|
2
2
|
export { defaultFetcher, fetchWithValidation, VoyantApiError, type VoyantFetcher, } from "./client.js";
|
|
3
3
|
export * from "./hooks/index.js";
|
|
4
|
-
export { type AddTripComponentBody, addTripComponent, type CancelTripComponentsBody, type CreateTripBody, cancelTripComponents, createTrip, getTrip, type ListTripsParams, listTrips, type PreviewTripCancellationBody, type PriceTripBody, previewTripCancellation, priceTrip, type ReserveTripBody, removeTripComponent, reserveTrip, type StartTripCheckoutBody, startTripCheckout, type UpdateTripComponentBody, updateTripComponent, } from "./operations.js";
|
|
4
|
+
export { type AddTripComponentBody, addTripComponent, type CancelTripComponentsBody, type CreateTripBody, type CreateTripSnapshotBody, cancelTripComponents, createTrip, freezeTripSnapshot, freezeTripSnapshotForQuoteVersion, getTrip, getTripSnapshot, type ListTripsParams, listTripSnapshots, listTrips, type PreviewTripCancellationBody, type PriceTripBody, previewTripCancellation, priceTrip, type ReserveTripBody, removeTripComponent, reserveTrip, type StartTripCheckoutBody, startTripCheckout, type UpdateTripComponentBody, updateTripComponent, } from "./operations.js";
|
|
5
5
|
export { useVoyantTravelComposerContext, type VoyantTravelComposerContextValue, VoyantTravelComposerProvider, type VoyantTravelComposerProviderProps, } from "./provider.js";
|
|
6
6
|
export { travelComposerQueryKeys } from "./query-keys.js";
|
|
7
7
|
export { getTripComponentsQueryOptions, getTripQueryOptions, listTripsQueryOptions, } from "./query-options.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,sBAAsB,GACvB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AACpB,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,KAAK,oBAAoB,EACzB,gBAAgB,EAChB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,oBAAoB,EACpB,UAAU,EACV,OAAO,EACP,KAAK,eAAe,EACpB,SAAS,EACT,KAAK,2BAA2B,EAChC,KAAK,aAAa,EAClB,uBAAuB,EACvB,SAAS,EACT,KAAK,eAAe,EACpB,mBAAmB,EACnB,WAAW,EACX,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,KAAK,uBAAuB,EAC5B,mBAAmB,GACpB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,8BAA8B,EAC9B,KAAK,gCAAgC,EACrC,4BAA4B,EAC5B,KAAK,iCAAiC,GACvC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,oBAAoB,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,sBAAsB,GACvB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AACpB,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,KAAK,oBAAoB,EACzB,gBAAgB,EAChB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,iCAAiC,EACjC,OAAO,EACP,eAAe,EACf,KAAK,eAAe,EACpB,iBAAiB,EACjB,SAAS,EACT,KAAK,2BAA2B,EAChC,KAAK,aAAa,EAClB,uBAAuB,EACvB,SAAS,EACT,KAAK,eAAe,EACpB,mBAAmB,EACnB,WAAW,EACX,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,KAAK,uBAAuB,EAC5B,mBAAmB,GACpB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,8BAA8B,EAC9B,KAAK,gCAAgC,EACrC,4BAA4B,EAC5B,KAAK,iCAAiC,GACvC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,oBAAoB,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { writePriceTripCache, writeReserveTripCache, writeTripCache, writeTripCheckoutCache, } from "./cache.js";
|
|
2
2
|
export { defaultFetcher, fetchWithValidation, VoyantApiError, } from "./client.js";
|
|
3
3
|
export * from "./hooks/index.js";
|
|
4
|
-
export { addTripComponent, cancelTripComponents, createTrip, getTrip, listTrips, previewTripCancellation, priceTrip, removeTripComponent, reserveTrip, startTripCheckout, updateTripComponent, } from "./operations.js";
|
|
4
|
+
export { addTripComponent, cancelTripComponents, createTrip, freezeTripSnapshot, freezeTripSnapshotForQuoteVersion, getTrip, getTripSnapshot, listTripSnapshots, listTrips, previewTripCancellation, priceTrip, removeTripComponent, reserveTrip, startTripCheckout, updateTripComponent, } from "./operations.js";
|
|
5
5
|
export { useVoyantTravelComposerContext, VoyantTravelComposerProvider, } from "./provider.js";
|
|
6
6
|
export { travelComposerQueryKeys } from "./query-keys.js";
|
|
7
7
|
export { getTripComponentsQueryOptions, getTripQueryOptions, listTripsQueryOptions, } from "./query-options.js";
|
package/dist/operations.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CancelTripComponentsInput, CreateTripComponentBodyInput, CreateTripEnvelopeInput, PreviewTripCancellationInput, PriceTripInput, ReserveTripInput, StartTripCheckoutInput, TripEnvelopeStatus, TripsListSortDir, TripsListSortField } from "@voyantjs/travel-composer";
|
|
1
|
+
import type { CancelTripComponentsInput, CreateTripComponentBodyInput, CreateTripEnvelopeInput, CreateTripSnapshotInput, PreviewTripCancellationInput, PriceTripInput, ReserveTripInput, StartTripCheckoutInput, TripEnvelopeStatus, TripsListSortDir, TripsListSortField } from "@voyantjs/travel-composer";
|
|
2
2
|
import { type FetchWithValidationOptions } from "./client.js";
|
|
3
3
|
export type ListTripsParams = {
|
|
4
4
|
status?: TripEnvelopeStatus;
|
|
@@ -31,9 +31,71 @@ export type ReserveTripBody = Omit<ReserveTripInput, "envelopeId">;
|
|
|
31
31
|
export type StartTripCheckoutBody = Omit<StartTripCheckoutInput, "envelopeId">;
|
|
32
32
|
export type PreviewTripCancellationBody = Omit<PreviewTripCancellationInput, "envelopeId" | "request"> & Partial<Pick<PreviewTripCancellationInput, "request">>;
|
|
33
33
|
export type CancelTripComponentsBody = Omit<CancelTripComponentsInput, "envelopeId" | "request"> & Partial<Pick<CancelTripComponentsInput, "request">>;
|
|
34
|
+
export type CreateTripSnapshotBody = Omit<CreateTripSnapshotInput, "envelopeId">;
|
|
34
35
|
export declare function listTrips(client: FetchWithValidationOptions, params?: ListTripsParams): Promise<import("@voyantjs/travel-composer").TripListResult>;
|
|
35
36
|
export declare function createTrip(client: FetchWithValidationOptions, input: CreateTripBody): Promise<import("@voyantjs/travel-composer").Trip>;
|
|
36
37
|
export declare function getTrip(client: FetchWithValidationOptions, envelopeId: string): Promise<import("@voyantjs/travel-composer").Trip>;
|
|
38
|
+
export declare function listTripSnapshots(client: FetchWithValidationOptions, envelopeId: string): Promise<{
|
|
39
|
+
id: string;
|
|
40
|
+
createdAt: Date;
|
|
41
|
+
createdBy: string | null;
|
|
42
|
+
currency: string;
|
|
43
|
+
subtotalAmountCents: number;
|
|
44
|
+
taxAmountCents: number;
|
|
45
|
+
totalAmountCents: number;
|
|
46
|
+
componentCount: number;
|
|
47
|
+
pricedComponentCount: number;
|
|
48
|
+
envelopeId: string;
|
|
49
|
+
sourceEnvelopeUpdatedAt: Date;
|
|
50
|
+
titleSnapshot: string | null;
|
|
51
|
+
descriptionSnapshot: string | null;
|
|
52
|
+
travelerPartySnapshot: Record<string, unknown>;
|
|
53
|
+
constraintsSnapshot: Record<string, unknown>;
|
|
54
|
+
frozenEnvelope: Record<string, unknown>;
|
|
55
|
+
frozenComponents: Record<string, unknown>[];
|
|
56
|
+
proposal: import("@voyantjs/travel-composer").TripSnapshotProposal;
|
|
57
|
+
}[]>;
|
|
58
|
+
export declare function getTripSnapshot(client: FetchWithValidationOptions, snapshotId: string): Promise<{
|
|
59
|
+
id: string;
|
|
60
|
+
createdAt: Date;
|
|
61
|
+
createdBy: string | null;
|
|
62
|
+
currency: string;
|
|
63
|
+
subtotalAmountCents: number;
|
|
64
|
+
taxAmountCents: number;
|
|
65
|
+
totalAmountCents: number;
|
|
66
|
+
componentCount: number;
|
|
67
|
+
pricedComponentCount: number;
|
|
68
|
+
envelopeId: string;
|
|
69
|
+
sourceEnvelopeUpdatedAt: Date;
|
|
70
|
+
titleSnapshot: string | null;
|
|
71
|
+
descriptionSnapshot: string | null;
|
|
72
|
+
travelerPartySnapshot: Record<string, unknown>;
|
|
73
|
+
constraintsSnapshot: Record<string, unknown>;
|
|
74
|
+
frozenEnvelope: Record<string, unknown>;
|
|
75
|
+
frozenComponents: Record<string, unknown>[];
|
|
76
|
+
proposal: import("@voyantjs/travel-composer").TripSnapshotProposal;
|
|
77
|
+
}>;
|
|
78
|
+
export declare function freezeTripSnapshot(client: FetchWithValidationOptions, envelopeId: string, input?: CreateTripSnapshotBody): Promise<{
|
|
79
|
+
id: string;
|
|
80
|
+
createdAt: Date;
|
|
81
|
+
createdBy: string | null;
|
|
82
|
+
currency: string;
|
|
83
|
+
subtotalAmountCents: number;
|
|
84
|
+
taxAmountCents: number;
|
|
85
|
+
totalAmountCents: number;
|
|
86
|
+
componentCount: number;
|
|
87
|
+
pricedComponentCount: number;
|
|
88
|
+
envelopeId: string;
|
|
89
|
+
sourceEnvelopeUpdatedAt: Date;
|
|
90
|
+
titleSnapshot: string | null;
|
|
91
|
+
descriptionSnapshot: string | null;
|
|
92
|
+
travelerPartySnapshot: Record<string, unknown>;
|
|
93
|
+
constraintsSnapshot: Record<string, unknown>;
|
|
94
|
+
frozenEnvelope: Record<string, unknown>;
|
|
95
|
+
frozenComponents: Record<string, unknown>[];
|
|
96
|
+
proposal: import("@voyantjs/travel-composer").TripSnapshotProposal;
|
|
97
|
+
}>;
|
|
98
|
+
export declare function freezeTripSnapshotForQuoteVersion(client: FetchWithValidationOptions, envelopeId: string, quoteVersionId: string, input?: CreateTripSnapshotBody): Promise<import("./schemas.js").QuoteVersionSnapshotApplyResult>;
|
|
37
99
|
export declare function addTripComponent(client: FetchWithValidationOptions, envelopeId: string, input: AddTripComponentBody): Promise<{
|
|
38
100
|
metadata: Record<string, unknown>;
|
|
39
101
|
id: string;
|
|
@@ -55,8 +117,8 @@ export declare function addTripComponent(client: FetchWithValidationOptions, env
|
|
|
55
117
|
supplierRef: string | null;
|
|
56
118
|
title: string | null;
|
|
57
119
|
kind: "catalog_booking" | "manual_placeholder" | "flight_placeholder" | "flight_order" | "external_order";
|
|
58
|
-
envelopeId: string;
|
|
59
120
|
sequence: number;
|
|
121
|
+
envelopeId: string;
|
|
60
122
|
warningCodes: string[];
|
|
61
123
|
bookingDraftId: string | null;
|
|
62
124
|
catalogQuoteId: string | null;
|
|
@@ -91,8 +153,8 @@ export declare function removeTripComponent(client: FetchWithValidationOptions,
|
|
|
91
153
|
supplierRef: string | null;
|
|
92
154
|
title: string | null;
|
|
93
155
|
kind: "catalog_booking" | "manual_placeholder" | "flight_placeholder" | "flight_order" | "external_order";
|
|
94
|
-
envelopeId: string;
|
|
95
156
|
sequence: number;
|
|
157
|
+
envelopeId: string;
|
|
96
158
|
warningCodes: string[];
|
|
97
159
|
bookingDraftId: string | null;
|
|
98
160
|
catalogQuoteId: string | null;
|
|
@@ -127,8 +189,8 @@ export declare function updateTripComponent(client: FetchWithValidationOptions,
|
|
|
127
189
|
supplierRef: string | null;
|
|
128
190
|
title: string | null;
|
|
129
191
|
kind: "catalog_booking" | "manual_placeholder" | "flight_placeholder" | "flight_order" | "external_order";
|
|
130
|
-
envelopeId: string;
|
|
131
192
|
sequence: number;
|
|
193
|
+
envelopeId: string;
|
|
132
194
|
warningCodes: string[];
|
|
133
195
|
bookingDraftId: string | null;
|
|
134
196
|
catalogQuoteId: string | null;
|
package/dist/operations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,yBAAyB,EACzB,4BAA4B,EA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0BAA0B,EAClC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,qBAAqB,oEAQ7B;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,0BAA0B,EAClC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,2BAA2B,8EAQnC;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,0BAA0B,EAClC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,wBAAwB,2EAQhC"}
|
package/dist/operations.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { fetchWithValidation } from "./client.js";
|
|
3
|
-
import { cancelTripComponentsResponseSchema, previewTripCancellationResponseSchema, priceTripResponseSchema, reserveTripResponseSchema, startTripCheckoutResponseSchema, tripComponentResponseSchema, tripListResponseSchema, tripResponseSchema, } from "./schemas.js";
|
|
3
|
+
import { cancelTripComponentsResponseSchema, previewTripCancellationResponseSchema, priceTripResponseSchema, quoteVersionSnapshotApplyResponseSchema, reserveTripResponseSchema, startTripCheckoutResponseSchema, tripComponentResponseSchema, tripListResponseSchema, tripResponseSchema, tripSnapshotResponseSchema, tripSnapshotsResponseSchema, } from "./schemas.js";
|
|
4
4
|
function composerPath(client, path) {
|
|
5
5
|
return `/v1/${client.surface ?? "admin"}/travel-composer${path}`;
|
|
6
6
|
}
|
|
7
|
+
function adminComposerPath(path) {
|
|
8
|
+
return `/v1/admin/travel-composer${path}`;
|
|
9
|
+
}
|
|
7
10
|
function withQuery(path, params = {}) {
|
|
8
11
|
const search = new URLSearchParams();
|
|
9
12
|
if (params.status)
|
|
@@ -51,6 +54,18 @@ export function createTrip(client, input) {
|
|
|
51
54
|
export function getTrip(client, envelopeId) {
|
|
52
55
|
return fetchWithValidation(composerPath(client, `/trips/${encodeURIComponent(envelopeId)}`), tripResponseSchema, client).then((response) => response.data);
|
|
53
56
|
}
|
|
57
|
+
export function listTripSnapshots(client, envelopeId) {
|
|
58
|
+
return fetchWithValidation(composerPath(client, `/trips/${encodeURIComponent(envelopeId)}/snapshots`), tripSnapshotsResponseSchema, client).then((response) => response.data);
|
|
59
|
+
}
|
|
60
|
+
export function getTripSnapshot(client, snapshotId) {
|
|
61
|
+
return fetchWithValidation(composerPath(client, `/trip-snapshots/${encodeURIComponent(snapshotId)}`), tripSnapshotResponseSchema, client).then((response) => response.data);
|
|
62
|
+
}
|
|
63
|
+
export function freezeTripSnapshot(client, envelopeId, input = {}) {
|
|
64
|
+
return fetchWithValidation(composerPath(client, `/trips/${encodeURIComponent(envelopeId)}/snapshots`), tripSnapshotResponseSchema, client, { method: "POST", body: JSON.stringify(input) }).then((response) => response.data);
|
|
65
|
+
}
|
|
66
|
+
export function freezeTripSnapshotForQuoteVersion(client, envelopeId, quoteVersionId, input = {}) {
|
|
67
|
+
return fetchWithValidation(adminComposerPath(`/trips/${encodeURIComponent(envelopeId)}/quote-versions/${encodeURIComponent(quoteVersionId)}/snapshot`), quoteVersionSnapshotApplyResponseSchema, client, { method: "POST", body: JSON.stringify(input) }).then((response) => response.data);
|
|
68
|
+
}
|
|
54
69
|
export function addTripComponent(client, envelopeId, input) {
|
|
55
70
|
return fetchWithValidation(composerPath(client, `/trips/${encodeURIComponent(envelopeId)}/components`), tripComponentResponseSchema, client, { method: "POST", body: JSON.stringify(input) }).then((response) => response.data);
|
|
56
71
|
}
|
package/dist/query-options.d.ts
CHANGED
|
@@ -37,8 +37,8 @@ export declare function getTripComponentsQueryOptions(client: FetchWithValidatio
|
|
|
37
37
|
supplierRef: string | null;
|
|
38
38
|
title: string | null;
|
|
39
39
|
kind: "catalog_booking" | "manual_placeholder" | "flight_placeholder" | "flight_order" | "external_order";
|
|
40
|
-
envelopeId: string;
|
|
41
40
|
sequence: number;
|
|
41
|
+
envelopeId: string;
|
|
42
42
|
warningCodes: string[];
|
|
43
43
|
bookingDraftId: string | null;
|
|
44
44
|
catalogQuoteId: string | null;
|
|
@@ -72,8 +72,8 @@ export declare function getTripComponentsQueryOptions(client: FetchWithValidatio
|
|
|
72
72
|
supplierRef: string | null;
|
|
73
73
|
title: string | null;
|
|
74
74
|
kind: "catalog_booking" | "manual_placeholder" | "flight_placeholder" | "flight_order" | "external_order";
|
|
75
|
-
envelopeId: string;
|
|
76
75
|
sequence: number;
|
|
76
|
+
envelopeId: string;
|
|
77
77
|
warningCodes: string[];
|
|
78
78
|
bookingDraftId: string | null;
|
|
79
79
|
catalogQuoteId: string | null;
|
|
@@ -108,8 +108,8 @@ export declare function getTripComponentsQueryOptions(client: FetchWithValidatio
|
|
|
108
108
|
supplierRef: string | null;
|
|
109
109
|
title: string | null;
|
|
110
110
|
kind: "catalog_booking" | "manual_placeholder" | "flight_placeholder" | "flight_order" | "external_order";
|
|
111
|
-
envelopeId: string;
|
|
112
111
|
sequence: number;
|
|
112
|
+
envelopeId: string;
|
|
113
113
|
warningCodes: string[];
|
|
114
114
|
bookingDraftId: string | null;
|
|
115
115
|
catalogQuoteId: string | null;
|
|
@@ -146,8 +146,8 @@ export declare function getTripComponentsQueryOptions(client: FetchWithValidatio
|
|
|
146
146
|
supplierRef: string | null;
|
|
147
147
|
title: string | null;
|
|
148
148
|
kind: "catalog_booking" | "manual_placeholder" | "flight_placeholder" | "flight_order" | "external_order";
|
|
149
|
-
envelopeId: string;
|
|
150
149
|
sequence: number;
|
|
150
|
+
envelopeId: string;
|
|
151
151
|
warningCodes: string[];
|
|
152
152
|
bookingDraftId: string | null;
|
|
153
153
|
catalogQuoteId: string | null;
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
|
-
import type { CancelTripComponentsResult, PriceTripResult, ReserveTripResult, StartCheckoutResult, Trip, TripCancellationPreviewResult, TripComponent, TripEnvelope, TripListResult } from "@voyantjs/travel-composer";
|
|
1
|
+
import type { CancelTripComponentsResult, PriceTripResult, ReserveTripResult, StartCheckoutResult, Trip, TripCancellationPreviewResult, TripComponent, TripEnvelope, TripListResult, TripSnapshot } from "@voyantjs/travel-composer";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
export type QuoteVersionSnapshotApplyResult = {
|
|
4
|
+
snapshot: TripSnapshot;
|
|
5
|
+
quoteVersion: {
|
|
6
|
+
id: string;
|
|
7
|
+
quoteId: string;
|
|
8
|
+
status: string;
|
|
9
|
+
tripSnapshotId: string | null;
|
|
10
|
+
currency: string;
|
|
11
|
+
subtotalAmountCents: number;
|
|
12
|
+
taxAmountCents: number;
|
|
13
|
+
totalAmountCents: number;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
};
|
|
16
|
+
lines: Array<{
|
|
17
|
+
id: string;
|
|
18
|
+
quoteVersionId: string;
|
|
19
|
+
productId: string | null;
|
|
20
|
+
supplierServiceId: string | null;
|
|
21
|
+
description: string;
|
|
22
|
+
quantity: number;
|
|
23
|
+
unitPriceAmountCents: number;
|
|
24
|
+
totalAmountCents: number;
|
|
25
|
+
currency: string;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
3
29
|
export declare const singleEnvelope: <T extends z.ZodTypeAny>(item: T) => z.ZodObject<{
|
|
4
30
|
data: T;
|
|
5
31
|
}, z.core.$strip>;
|
|
@@ -16,6 +42,15 @@ export declare const tripComponentResponseSchema: z.ZodType<{
|
|
|
16
42
|
export declare const tripComponentsResponseSchema: z.ZodType<{
|
|
17
43
|
data: Trip["components"];
|
|
18
44
|
}>;
|
|
45
|
+
export declare const tripSnapshotResponseSchema: z.ZodType<{
|
|
46
|
+
data: TripSnapshot;
|
|
47
|
+
}>;
|
|
48
|
+
export declare const tripSnapshotsResponseSchema: z.ZodType<{
|
|
49
|
+
data: TripSnapshot[];
|
|
50
|
+
}>;
|
|
51
|
+
export declare const quoteVersionSnapshotApplyResponseSchema: z.ZodType<{
|
|
52
|
+
data: QuoteVersionSnapshotApplyResult;
|
|
53
|
+
}>;
|
|
19
54
|
export declare const priceTripResponseSchema: z.ZodType<{
|
|
20
55
|
data: PriceTripResult;
|
|
21
56
|
}>;
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,IAAI,EACJ,6BAA6B,EAC7B,aAAa,EACb,YAAY,EACZ,cAAc,
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,IAAI,EACJ,6BAA6B,EAC7B,aAAa,EACb,YAAY,EACZ,cAAc,EACd,YAAY,EACb,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,MAAM,+BAA+B,GAAG;IAC5C,QAAQ,EAAE,YAAY,CAAA;IACtB,YAAY,EAAE;QACZ,EAAE,EAAE,MAAM,CAAA;QACV,OAAO,EAAE,MAAM,CAAA;QACf,MAAM,EAAE,MAAM,CAAA;QACd,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;QAC7B,QAAQ,EAAE,MAAM,CAAA;QAChB,mBAAmB,EAAE,MAAM,CAAA;QAC3B,cAAc,EAAE,MAAM,CAAA;QACtB,gBAAgB,EAAE,MAAM,CAAA;QACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KACvB,CAAA;IACD,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAA;QACV,cAAc,EAAE,MAAM,CAAA;QACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;QACxB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;QAChC,WAAW,EAAE,MAAM,CAAA;QACnB,QAAQ,EAAE,MAAM,CAAA;QAChB,oBAAoB,EAAE,MAAM,CAAA;QAC5B,gBAAgB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,EAAE,iBAAiB,CAAA;CACxB,CAAC,CAAA;AACF,eAAO,MAAM,+BAA+B,EAAkC,CAAC,CAAC,OAAO,CAAC;IACtF,IAAI,EAAE,mBAAmB,CAAA;CAC1B,CAAC,CAAA;AACF,eAAO,MAAM,qCAAqC,EAAkC,CAAC,CAAC,OAAO,CAAC;IAC5F,IAAI,EAAE,6BAA6B,CAAA;CACpC,CAAC,CAAA;AACF,eAAO,MAAM,kCAAkC,EAAkC,CAAC,CAAC,OAAO,CAAC;IACzF,IAAI,EAAE,0BAA0B,CAAA;CACjC,CAAC,CAAA"}
|
package/dist/schemas.js
CHANGED
|
@@ -6,6 +6,9 @@ export const tripListResponseSchema = unknownData;
|
|
|
6
6
|
export const tripEnvelopeResponseSchema = singleEnvelope(unknownData);
|
|
7
7
|
export const tripComponentResponseSchema = singleEnvelope(unknownData);
|
|
8
8
|
export const tripComponentsResponseSchema = singleEnvelope(unknownData);
|
|
9
|
+
export const tripSnapshotResponseSchema = singleEnvelope(unknownData);
|
|
10
|
+
export const tripSnapshotsResponseSchema = singleEnvelope(unknownData);
|
|
11
|
+
export const quoteVersionSnapshotApplyResponseSchema = singleEnvelope(unknownData);
|
|
9
12
|
export const priceTripResponseSchema = singleEnvelope(unknownData);
|
|
10
13
|
export const reserveTripResponseSchema = singleEnvelope(unknownData);
|
|
11
14
|
export const startTripCheckoutResponseSchema = singleEnvelope(unknownData);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/travel-composer-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.105.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"react": "^19.0.0",
|
|
42
42
|
"react-dom": "^19.0.0",
|
|
43
43
|
"zod": "^4.0.0",
|
|
44
|
-
"@voyantjs/travel-composer": "0.
|
|
44
|
+
"@voyantjs/travel-composer": "^0.105.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@tanstack/react-query": "^5.100.11",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"typescript": "^6.0.2",
|
|
53
53
|
"vitest": "^4.1.2",
|
|
54
54
|
"zod": "^4.3.6",
|
|
55
|
-
"@voyantjs/react": "0.104.1",
|
|
56
|
-
"@voyantjs/travel-composer": "0.
|
|
57
|
-
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
55
|
+
"@voyantjs/react": "^0.104.1",
|
|
56
|
+
"@voyantjs/travel-composer": "^0.105.0",
|
|
57
|
+
"@voyantjs/voyant-typescript-config": "^0.1.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@voyantjs/react": "0.104.1"
|
|
60
|
+
"@voyantjs/react": "^0.104.1"
|
|
61
61
|
},
|
|
62
62
|
"files": [
|
|
63
63
|
"dist"
|