arky-sdk 0.3.79 → 0.3.81
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/index.cjs +19 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -2
- package/dist/index.d.ts +20 -2
- package/dist/index.js +19 -7
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -1027,13 +1027,11 @@ var createReservationApi = (apiConfig) => {
|
|
|
1027
1027
|
...params,
|
|
1028
1028
|
items
|
|
1029
1029
|
};
|
|
1030
|
-
|
|
1030
|
+
return apiConfig.httpClient.post(
|
|
1031
1031
|
`/v1/reservations/checkout`,
|
|
1032
1032
|
payload,
|
|
1033
1033
|
options
|
|
1034
1034
|
);
|
|
1035
|
-
cart = [];
|
|
1036
|
-
return result;
|
|
1037
1035
|
},
|
|
1038
1036
|
async getReservation(params, options) {
|
|
1039
1037
|
return apiConfig.httpClient.get(`/v1/reservations/${params.id}`, {
|
|
@@ -1347,6 +1345,21 @@ var createFeatureFlagsApi = (apiConfig) => {
|
|
|
1347
1345
|
};
|
|
1348
1346
|
};
|
|
1349
1347
|
|
|
1348
|
+
// src/api/location.ts
|
|
1349
|
+
var createLocationApi = (apiConfig) => {
|
|
1350
|
+
return {
|
|
1351
|
+
async getCountries(options) {
|
|
1352
|
+
return apiConfig.httpClient.get(`/v1/operations/location/countries`, options);
|
|
1353
|
+
},
|
|
1354
|
+
async getCountryStates(countryCode, options) {
|
|
1355
|
+
return apiConfig.httpClient.get(
|
|
1356
|
+
`/v1/operations/location/countries/${countryCode}/states`,
|
|
1357
|
+
options
|
|
1358
|
+
);
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
};
|
|
1362
|
+
|
|
1350
1363
|
// src/utils/currency.ts
|
|
1351
1364
|
function getCurrencySymbol(currency) {
|
|
1352
1365
|
const currencySymbols = {
|
|
@@ -1967,7 +1980,7 @@ var createReservationEngine = (api, config = {}) => {
|
|
|
1967
1980
|
if (!state.cart.length) throw new Error("Cart is empty");
|
|
1968
1981
|
store.setKey("loading", true);
|
|
1969
1982
|
try {
|
|
1970
|
-
|
|
1983
|
+
return api.checkout({
|
|
1971
1984
|
items: state.cart.map((s) => ({
|
|
1972
1985
|
serviceId: s.serviceId,
|
|
1973
1986
|
providerId: s.providerId,
|
|
@@ -1979,8 +1992,6 @@ var createReservationEngine = (api, config = {}) => {
|
|
|
1979
1992
|
promoCode: options.promoCode ?? null,
|
|
1980
1993
|
blocks: options.blocks || []
|
|
1981
1994
|
});
|
|
1982
|
-
store.setKey("cart", []);
|
|
1983
|
-
return result;
|
|
1984
1995
|
} finally {
|
|
1985
1996
|
store.setKey("loading", false);
|
|
1986
1997
|
}
|
|
@@ -2005,7 +2016,7 @@ var createReservationEngine = (api, config = {}) => {
|
|
|
2005
2016
|
};
|
|
2006
2017
|
|
|
2007
2018
|
// src/index.ts
|
|
2008
|
-
var SDK_VERSION = "0.3.
|
|
2019
|
+
var SDK_VERSION = "0.3.81";
|
|
2009
2020
|
var SUPPORTED_FRAMEWORKS = [
|
|
2010
2021
|
"astro",
|
|
2011
2022
|
"react",
|
|
@@ -2055,6 +2066,7 @@ async function createArkySDK(config) {
|
|
|
2055
2066
|
reservation: createReservationApi(apiConfig),
|
|
2056
2067
|
database: createDatabaseApi(apiConfig),
|
|
2057
2068
|
featureFlags: createFeatureFlagsApi(apiConfig),
|
|
2069
|
+
location: createLocationApi(apiConfig),
|
|
2058
2070
|
// High-level reservation engine
|
|
2059
2071
|
reservationEngine: (engineConfig) => {
|
|
2060
2072
|
const reservationApi = createReservationApi(apiConfig);
|