@voyantjs/storefront-sdk 0.31.3

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 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAC1F,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,EAC1B,wBAAwB,EAKxB,wBAAwB,EACxB,gCAAgC,EAEhC,0BAA0B,EAC1B,+BAA+B,EAC/B,+BAA+B,EAC/B,2BAA2B,EAC3B,yBAAyB,EACzB,+BAA+B,EAC/B,2BAA2B,EAC3B,0BAA0B,EAC1B,+BAA+B,EAChC,MAAM,iBAAiB,CAAA;AAExB,YAAY,EACV,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,mBAAmB,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAE5B,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAUjD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;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OAAO,yBAAyB,CAAC,CAAC,CAAC,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,46 @@
1
+ import { defaultStorefrontFetcher } from "./client.js";
2
+ import { canRunBookingEngineAction, createBookingEngineSnapshot, deriveBookingEngineState, } from "./engine-state.js";
3
+ import { bootstrapCheckoutCollection, confirmPublicBookingSession, createPublicBookingSession, expirePublicBookingSession, getPublicBookingOverview, getPublicBookingSession, getPublicBookingSessionState, getStorefrontDeparture, getStorefrontDepartureItinerary, getStorefrontOfferBySlug, getStorefrontProductAvailability, getStorefrontSettings, initiateCheckoutCollection, listStorefrontProductDepartures, listStorefrontProductExtensions, listStorefrontProductOffers, previewCheckoutCollection, previewStorefrontDeparturePrice, repricePublicBookingSession, updatePublicBookingSession, updatePublicBookingSessionState, } from "./operations.js";
4
+ export { defaultStorefrontFetcher, storefrontFetchWithValidation, VoyantStorefrontApiError, withStorefrontQueryParams, } from "./client.js";
5
+ export { bookingEngineActions, bookingEngineStates, canRunBookingEngineAction, createBookingEngineSnapshot, deriveBookingEngineState, getAllowedBookingEngineActions, } from "./engine-state.js";
6
+ export * from "./operations.js";
7
+ export * from "./schemas.js";
8
+ export function createVoyantStorefrontClient(options) {
9
+ const client = {
10
+ baseUrl: options.baseUrl,
11
+ fetcher: options.fetcher ?? defaultStorefrontFetcher,
12
+ headers: options.headers,
13
+ };
14
+ return {
15
+ storefront: {
16
+ getSettings: () => getStorefrontSettings(client),
17
+ getDeparture: (departureId) => getStorefrontDeparture(client, departureId),
18
+ listProductDepartures: (productId, query) => listStorefrontProductDepartures(client, productId, query),
19
+ getProductAvailability: (productId, query) => getStorefrontProductAvailability(client, productId, query),
20
+ previewDeparturePrice: (departureId, input, requestOptions) => previewStorefrontDeparturePrice(client, departureId, input, requestOptions),
21
+ listProductExtensions: (productId, query) => listStorefrontProductExtensions(client, productId, query),
22
+ getDepartureItinerary: (productId, departureId) => getStorefrontDepartureItinerary(client, productId, departureId),
23
+ listProductOffers: (productId, query) => listStorefrontProductOffers(client, productId, query),
24
+ getOfferBySlug: (slug, query) => getStorefrontOfferBySlug(client, slug, query),
25
+ },
26
+ booking: {
27
+ createSession: (input, requestOptions) => createPublicBookingSession(client, input, requestOptions),
28
+ getSession: (sessionId) => getPublicBookingSession(client, sessionId),
29
+ updateSession: (sessionId, input, requestOptions) => updatePublicBookingSession(client, sessionId, input, requestOptions),
30
+ getSessionState: (sessionId) => getPublicBookingSessionState(client, sessionId),
31
+ updateSessionState: (sessionId, input, requestOptions) => updatePublicBookingSessionState(client, sessionId, input, requestOptions),
32
+ reprice: (sessionId, input, requestOptions) => repricePublicBookingSession(client, sessionId, input, requestOptions),
33
+ confirm: (sessionId, input, requestOptions) => confirmPublicBookingSession(client, sessionId, input, requestOptions),
34
+ expire: (sessionId, input, requestOptions) => expirePublicBookingSession(client, sessionId, input, requestOptions),
35
+ getOverview: (query) => getPublicBookingOverview(client, query),
36
+ deriveState: deriveBookingEngineState,
37
+ createSnapshot: createBookingEngineSnapshot,
38
+ canRunAction: canRunBookingEngineAction,
39
+ },
40
+ checkout: {
41
+ previewCollection: (bookingId, input, requestOptions) => previewCheckoutCollection(client, bookingId, input, requestOptions),
42
+ initiateCollection: (bookingId, input, requestOptions) => initiateCheckoutCollection(client, bookingId, input, requestOptions),
43
+ bootstrapCollection: (input, requestOptions) => bootstrapCheckoutCollection(client, input, requestOptions),
44
+ },
45
+ };
46
+ }