@voyant-travel/storefront-sdk 0.120.1
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/LICENSE +201 -0
- package/README.md +66 -0
- package/dist/booking-engine.d.ts +498 -0
- package/dist/booking-engine.d.ts.map +1 -0
- package/dist/booking-engine.js +56 -0
- package/dist/client.d.ts +24 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +98 -0
- package/dist/engine-state.d.ts +21 -0
- package/dist/engine-state.d.ts.map +1 -0
- package/dist/engine-state.js +124 -0
- package/dist/errors.d.ts +41 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +50 -0
- package/dist/index.d.ts +2311 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +70 -0
- package/dist/operations.d.ts +1805 -0
- package/dist/operations.d.ts.map +1 -0
- package/dist/operations.js +92 -0
- package/dist/schemas.d.ts +2509 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +28 -0
- package/package.json +79 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EAGxB,2BAA2B,EAC3B,2BAA2B,EAC3B,2BAA2B,EAC3B,yBAAyB,EACzB,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAA4B,KAAK,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAC1F,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,EAC1B,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,EAKxB,wBAAwB,EACxB,gCA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AAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAGrD,MAAM,SACV,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC,CAAC,mBACtC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAG1D,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC,CAAC,CAAC,mBACvC,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIzE;AAED,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { bootstrapBookingEnginePayment, confirmBookingEngineSession, expireBookingEngineSession, getBookingEngineOverview, getBookingEngineProgress, getBookingEngineSessionSnapshot, previewBookingEnginePayment, repriceBookingEngineSession, reserveBookingEngineSession, startBookingEnginePayment, updateBookingEngineProgress, updateBookingEngineSession, updateBookingEngineTravelers, } from "./booking-engine.js";
|
|
2
|
+
import { defaultStorefrontFetcher } from "./client.js";
|
|
3
|
+
import { canRunBookingEngineAction, createBookingEngineSnapshot, deriveBookingEngineState, } from "./engine-state.js";
|
|
4
|
+
import { bootstrapBookingSession, bootstrapCheckoutCollection, confirmPublicBookingSession, createPublicBookingSession, createStorefrontLead, expirePublicBookingSession, getPublicBookingOverview, getPublicBookingSession, getPublicBookingSessionState, getStorefrontDeparture, getStorefrontDepartureItinerary, getStorefrontOfferBySlug, getStorefrontProductAvailability, getStorefrontSettings, initiateCheckoutCollection, listStorefrontProductDepartures, listStorefrontProductExtensions, listStorefrontProductOffers, previewCheckoutCollection, previewStorefrontDeparturePrice, repricePublicBookingSession, subscribeStorefrontNewsletter, updatePublicBookingSession, updatePublicBookingSessionState, } from "./operations.js";
|
|
5
|
+
export * from "./booking-engine.js";
|
|
6
|
+
export { defaultStorefrontFetcher, storefrontFetchWithValidation, VoyantStorefrontApiError, withStorefrontQueryParams, } from "./client.js";
|
|
7
|
+
export { bookingEngineActions, bookingEngineStates, canRunBookingEngineAction, createBookingEngineSnapshot, deriveBookingEngineState, getAllowedBookingEngineActions, } from "./engine-state.js";
|
|
8
|
+
export * from "./errors.js";
|
|
9
|
+
export * from "./operations.js";
|
|
10
|
+
export * from "./schemas.js";
|
|
11
|
+
export function createVoyantStorefrontClient(options) {
|
|
12
|
+
const client = {
|
|
13
|
+
baseUrl: options.baseUrl,
|
|
14
|
+
fetcher: options.fetcher ?? defaultStorefrontFetcher,
|
|
15
|
+
headers: options.headers,
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
storefront: {
|
|
19
|
+
getSettings: () => getStorefrontSettings(client),
|
|
20
|
+
createLead: (input, requestOptions) => createStorefrontLead(client, input, requestOptions),
|
|
21
|
+
subscribeNewsletter: (input, requestOptions) => subscribeStorefrontNewsletter(client, input, requestOptions),
|
|
22
|
+
getDeparture: (departureId) => getStorefrontDeparture(client, departureId),
|
|
23
|
+
listProductDepartures: (productId, query) => listStorefrontProductDepartures(client, productId, query),
|
|
24
|
+
getProductAvailability: (productId, query) => getStorefrontProductAvailability(client, productId, query),
|
|
25
|
+
previewDeparturePrice: (departureId, input, requestOptions) => previewStorefrontDeparturePrice(client, departureId, input, requestOptions),
|
|
26
|
+
listProductExtensions: (productId, query) => listStorefrontProductExtensions(client, productId, query),
|
|
27
|
+
getDepartureItinerary: (productId, departureId) => getStorefrontDepartureItinerary(client, productId, departureId),
|
|
28
|
+
listProductOffers: (productId, query) => listStorefrontProductOffers(client, productId, query),
|
|
29
|
+
getOfferBySlug: (slug, query) => getStorefrontOfferBySlug(client, slug, query),
|
|
30
|
+
},
|
|
31
|
+
booking: {
|
|
32
|
+
bootstrapSession: (input, requestOptions) => bootstrapBookingSession(client, input, requestOptions),
|
|
33
|
+
createSession: (input, requestOptions) => createPublicBookingSession(client, input, requestOptions),
|
|
34
|
+
getSession: (sessionId) => getPublicBookingSession(client, sessionId),
|
|
35
|
+
updateSession: (sessionId, input, requestOptions) => updatePublicBookingSession(client, sessionId, input, requestOptions),
|
|
36
|
+
getSessionState: (sessionId) => getPublicBookingSessionState(client, sessionId),
|
|
37
|
+
updateSessionState: (sessionId, input, requestOptions) => updatePublicBookingSessionState(client, sessionId, input, requestOptions),
|
|
38
|
+
reprice: (sessionId, input, requestOptions) => repricePublicBookingSession(client, sessionId, input, requestOptions),
|
|
39
|
+
confirm: (sessionId, input, requestOptions) => confirmPublicBookingSession(client, sessionId, input, requestOptions),
|
|
40
|
+
expire: (sessionId, input, requestOptions) => expirePublicBookingSession(client, sessionId, input, requestOptions),
|
|
41
|
+
getOverview: (query) => getPublicBookingOverview(client, query),
|
|
42
|
+
deriveState: deriveBookingEngineState,
|
|
43
|
+
createSnapshot: createBookingEngineSnapshot,
|
|
44
|
+
canRunAction: canRunBookingEngineAction,
|
|
45
|
+
},
|
|
46
|
+
bookingEngine: {
|
|
47
|
+
reserve: (input, requestOptions) => reserveBookingEngineSession(client, input, requestOptions),
|
|
48
|
+
getSnapshot: (sessionId) => getBookingEngineSessionSnapshot(client, sessionId),
|
|
49
|
+
updateSession: (sessionId, input, requestOptions) => updateBookingEngineSession(client, sessionId, input, requestOptions),
|
|
50
|
+
updateTravelers: (sessionId, input, requestOptions) => updateBookingEngineTravelers(client, sessionId, input, requestOptions),
|
|
51
|
+
getProgress: (sessionId) => getBookingEngineProgress(client, sessionId),
|
|
52
|
+
updateProgress: (sessionId, input, requestOptions) => updateBookingEngineProgress(client, sessionId, input, requestOptions),
|
|
53
|
+
reprice: (sessionId, input, requestOptions) => repriceBookingEngineSession(client, sessionId, input, requestOptions),
|
|
54
|
+
confirm: (sessionId, input, requestOptions) => confirmBookingEngineSession(client, sessionId, input, requestOptions),
|
|
55
|
+
expire: (sessionId, input, requestOptions) => expireBookingEngineSession(client, sessionId, input, requestOptions),
|
|
56
|
+
getOverview: (query) => getBookingEngineOverview(client, query),
|
|
57
|
+
previewPayment: (bookingId, input, requestOptions) => previewBookingEnginePayment(client, bookingId, input, requestOptions),
|
|
58
|
+
startPayment: (bookingId, input, requestOptions) => startBookingEnginePayment(client, bookingId, input, requestOptions),
|
|
59
|
+
bootstrapPayment: (input, requestOptions) => bootstrapBookingEnginePayment(client, input, requestOptions),
|
|
60
|
+
deriveState: deriveBookingEngineState,
|
|
61
|
+
createSnapshot: createBookingEngineSnapshot,
|
|
62
|
+
canRunAction: canRunBookingEngineAction,
|
|
63
|
+
},
|
|
64
|
+
checkout: {
|
|
65
|
+
previewCollection: (bookingId, input, requestOptions) => previewCheckoutCollection(client, bookingId, input, requestOptions),
|
|
66
|
+
initiateCollection: (bookingId, input, requestOptions) => initiateCheckoutCollection(client, bookingId, input, requestOptions),
|
|
67
|
+
bootstrapCollection: (input, requestOptions) => bootstrapCheckoutCollection(client, input, requestOptions),
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|