@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.
- package/README.md +33 -0
- package/dist/client.d.ts +22 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +92 -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/index.d.ts +1280 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/operations.d.ts +1263 -0
- package/dist/operations.d.ts.map +1 -0
- package/dist/operations.js +80 -0
- package/dist/schemas.d.ts +1190 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +20 -0
- package/package.json +77 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAE7B,KAAK,6BAA6B,EAEnC,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,KAAK,gCAAgC,EAIrC,KAAK,+BAA+B,EAGpC,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACpC,KAAK,oCAAoC,EAYzC,KAAK,4BAA4B,EACjC,KAAK,oCAAoC,EACzC,KAAK,yCAAyC,EAC9C,KAAK,gCAAgC,EACrC,KAAK,mCAAmC,EAezC,MAAM,cAAc,CAAA;AAErB,KAAK,qBAAqB,GAAG,QAAQ,CAAC,IAAI,CAAC,6BAA6B,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC,GAC/F,IAAI,CAAC,6BAA6B,EAAE,SAAS,CAAC,CAAA;AAEhD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GASnC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { requestHeaders, storefrontFetchWithValidation, withStorefrontQueryParams, } from "./client.js";
|
|
2
|
+
import { bootstrapCheckoutCollectionSchema, bootstrappedCheckoutCollectionResponseSchema, checkoutCollectionPlanResponseSchema, initiateCheckoutCollectionSchema, initiatedCheckoutCollectionResponseSchema, previewCheckoutCollectionSchema, publicBookingOverviewLookupQuerySchema, publicBookingOverviewResponseSchema, publicBookingSessionMutationSchema, publicBookingSessionRepriceResponseSchema, publicBookingSessionResponseSchema, publicBookingSessionStateResponseSchema, publicCreateBookingSessionSchema, publicRepriceBookingSessionSchema, publicUpdateBookingSessionSchema, publicUpsertBookingSessionStateSchema, storefrontDepartureItineraryResponseSchema, storefrontDepartureListQuerySchema, storefrontDepartureListResponseSchema, storefrontDeparturePricePreviewInputSchema, storefrontDeparturePricePreviewResponseSchema, storefrontDepartureResponseSchema, storefrontProductAvailabilitySummaryQuerySchema, storefrontProductAvailabilitySummaryResponseSchema, storefrontProductExtensionsQuerySchema, storefrontProductExtensionsResponseSchema, storefrontPromotionalOfferListQuerySchema, storefrontPromotionalOfferListResponseSchema, storefrontPromotionalOfferResponseSchema, storefrontSettingsResponseSchema, } from "./schemas.js";
|
|
3
|
+
export function getStorefrontSettings(client) {
|
|
4
|
+
return storefrontFetchWithValidation("/v1/public/settings", storefrontSettingsResponseSchema, client).then((response) => response.data);
|
|
5
|
+
}
|
|
6
|
+
export function getStorefrontDeparture(client, departureId) {
|
|
7
|
+
return storefrontFetchWithValidation(`/v1/public/departures/${encodeURIComponent(departureId)}`, storefrontDepartureResponseSchema, client).then((response) => response.data);
|
|
8
|
+
}
|
|
9
|
+
export function listStorefrontProductDepartures(client, productId, query) {
|
|
10
|
+
const parsed = query ? storefrontDepartureListQuerySchema.parse(query) : undefined;
|
|
11
|
+
return storefrontFetchWithValidation(withStorefrontQueryParams(`/v1/public/products/${encodeURIComponent(productId)}/departures`, parsed), storefrontDepartureListResponseSchema, client);
|
|
12
|
+
}
|
|
13
|
+
export function getStorefrontProductAvailability(client, productId, query) {
|
|
14
|
+
const parsed = query ? storefrontProductAvailabilitySummaryQuerySchema.parse(query) : undefined;
|
|
15
|
+
return storefrontFetchWithValidation(withStorefrontQueryParams(`/v1/public/products/${encodeURIComponent(productId)}/availability`, parsed), storefrontProductAvailabilitySummaryResponseSchema, client).then((response) => response.data);
|
|
16
|
+
}
|
|
17
|
+
export function previewStorefrontDeparturePrice(client, departureId, input, options) {
|
|
18
|
+
const parsed = storefrontDeparturePricePreviewInputSchema.parse(input);
|
|
19
|
+
return storefrontFetchWithValidation(`/v1/public/departures/${encodeURIComponent(departureId)}/price`, storefrontDeparturePricePreviewResponseSchema, client, { method: "POST", headers: requestHeaders(options), body: JSON.stringify(parsed) }).then((response) => response.data);
|
|
20
|
+
}
|
|
21
|
+
export function listStorefrontProductExtensions(client, productId, query) {
|
|
22
|
+
const parsed = query ? storefrontProductExtensionsQuerySchema.parse(query) : undefined;
|
|
23
|
+
return storefrontFetchWithValidation(withStorefrontQueryParams(`/v1/public/products/${encodeURIComponent(productId)}/extensions`, parsed), storefrontProductExtensionsResponseSchema, client);
|
|
24
|
+
}
|
|
25
|
+
export function getStorefrontDepartureItinerary(client, productId, departureId) {
|
|
26
|
+
return storefrontFetchWithValidation(`/v1/public/products/${encodeURIComponent(productId)}/departures/${encodeURIComponent(departureId)}/itinerary`, storefrontDepartureItineraryResponseSchema, client).then((response) => response.data);
|
|
27
|
+
}
|
|
28
|
+
export function listStorefrontProductOffers(client, productId, query) {
|
|
29
|
+
const parsed = query ? storefrontPromotionalOfferListQuerySchema.parse(query) : undefined;
|
|
30
|
+
return storefrontFetchWithValidation(withStorefrontQueryParams(`/v1/public/products/${encodeURIComponent(productId)}/offers`, parsed), storefrontPromotionalOfferListResponseSchema, client).then((response) => response.data);
|
|
31
|
+
}
|
|
32
|
+
export function getStorefrontOfferBySlug(client, slug, query) {
|
|
33
|
+
return storefrontFetchWithValidation(withStorefrontQueryParams(`/v1/public/offers/${encodeURIComponent(slug)}`, query), storefrontPromotionalOfferResponseSchema, client).then((response) => response.data);
|
|
34
|
+
}
|
|
35
|
+
export function createPublicBookingSession(client, input, options) {
|
|
36
|
+
const parsed = publicCreateBookingSessionSchema.parse(input);
|
|
37
|
+
return storefrontFetchWithValidation("/v1/public/bookings/sessions", publicBookingSessionResponseSchema, client, { method: "POST", headers: requestHeaders(options), body: JSON.stringify(parsed) }).then((response) => response.data);
|
|
38
|
+
}
|
|
39
|
+
export function getPublicBookingSession(client, sessionId) {
|
|
40
|
+
return storefrontFetchWithValidation(`/v1/public/bookings/sessions/${encodeURIComponent(sessionId)}`, publicBookingSessionResponseSchema, client).then((response) => response.data);
|
|
41
|
+
}
|
|
42
|
+
export function updatePublicBookingSession(client, sessionId, input, options) {
|
|
43
|
+
const parsed = publicUpdateBookingSessionSchema.parse(input);
|
|
44
|
+
return storefrontFetchWithValidation(`/v1/public/bookings/sessions/${encodeURIComponent(sessionId)}`, publicBookingSessionResponseSchema, client, { method: "PATCH", headers: requestHeaders(options), body: JSON.stringify(parsed) }).then((response) => response.data);
|
|
45
|
+
}
|
|
46
|
+
export function getPublicBookingSessionState(client, sessionId) {
|
|
47
|
+
return storefrontFetchWithValidation(`/v1/public/bookings/sessions/${encodeURIComponent(sessionId)}/state`, publicBookingSessionStateResponseSchema, client).then((response) => response.data);
|
|
48
|
+
}
|
|
49
|
+
export function updatePublicBookingSessionState(client, sessionId, input, options) {
|
|
50
|
+
const parsed = publicUpsertBookingSessionStateSchema.parse(input);
|
|
51
|
+
return storefrontFetchWithValidation(`/v1/public/bookings/sessions/${encodeURIComponent(sessionId)}/state`, publicBookingSessionStateResponseSchema, client, { method: "PUT", headers: requestHeaders(options), body: JSON.stringify(parsed) }).then((response) => response.data);
|
|
52
|
+
}
|
|
53
|
+
export function repricePublicBookingSession(client, sessionId, input, options) {
|
|
54
|
+
const parsed = publicRepriceBookingSessionSchema.parse(input);
|
|
55
|
+
return storefrontFetchWithValidation(`/v1/public/bookings/sessions/${encodeURIComponent(sessionId)}/reprice`, publicBookingSessionRepriceResponseSchema, client, { method: "POST", headers: requestHeaders(options), body: JSON.stringify(parsed) }).then((response) => response.data);
|
|
56
|
+
}
|
|
57
|
+
export function confirmPublicBookingSession(client, sessionId, input = {}, options) {
|
|
58
|
+
const parsed = publicBookingSessionMutationSchema.parse(input);
|
|
59
|
+
return storefrontFetchWithValidation(`/v1/public/bookings/sessions/${encodeURIComponent(sessionId)}/confirm`, publicBookingSessionResponseSchema, client, { method: "POST", headers: requestHeaders(options), body: JSON.stringify(parsed) }).then((response) => response.data);
|
|
60
|
+
}
|
|
61
|
+
export function expirePublicBookingSession(client, sessionId, input = {}, options) {
|
|
62
|
+
const parsed = publicBookingSessionMutationSchema.parse(input);
|
|
63
|
+
return storefrontFetchWithValidation(`/v1/public/bookings/sessions/${encodeURIComponent(sessionId)}/expire`, publicBookingSessionResponseSchema, client, { method: "POST", headers: requestHeaders(options), body: JSON.stringify(parsed) }).then((response) => response.data);
|
|
64
|
+
}
|
|
65
|
+
export function getPublicBookingOverview(client, query) {
|
|
66
|
+
const parsed = publicBookingOverviewLookupQuerySchema.parse(query);
|
|
67
|
+
return storefrontFetchWithValidation(withStorefrontQueryParams("/v1/public/bookings/overview", parsed), publicBookingOverviewResponseSchema, client).then((response) => response.data);
|
|
68
|
+
}
|
|
69
|
+
export function previewCheckoutCollection(client, bookingId, input, options) {
|
|
70
|
+
const parsed = previewCheckoutCollectionSchema.parse(input);
|
|
71
|
+
return storefrontFetchWithValidation(`/v1/public/checkout/bookings/${encodeURIComponent(bookingId)}/collection-plan`, checkoutCollectionPlanResponseSchema, client, { method: "POST", headers: requestHeaders(options), body: JSON.stringify(parsed) }).then((response) => response.data);
|
|
72
|
+
}
|
|
73
|
+
export function initiateCheckoutCollection(client, bookingId, input, options) {
|
|
74
|
+
const parsed = initiateCheckoutCollectionSchema.parse(input);
|
|
75
|
+
return storefrontFetchWithValidation(`/v1/public/checkout/bookings/${encodeURIComponent(bookingId)}/initiate-collection`, initiatedCheckoutCollectionResponseSchema, client, { method: "POST", headers: requestHeaders(options), body: JSON.stringify(parsed) }).then((response) => response.data);
|
|
76
|
+
}
|
|
77
|
+
export function bootstrapCheckoutCollection(client, input, options) {
|
|
78
|
+
const parsed = bootstrapCheckoutCollectionSchema.parse(input);
|
|
79
|
+
return storefrontFetchWithValidation("/v1/public/checkout/collections/bootstrap", bootstrappedCheckoutCollectionResponseSchema, client, { method: "POST", headers: requestHeaders(options), body: JSON.stringify(parsed) }).then((response) => response.data);
|
|
80
|
+
}
|