arky-sdk 0.3.85 → 0.3.86
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 +26 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +26 -2
- package/dist/index.js.map +1 -1
- package/dist/{time-DPOc8E1C.d.cts → promo-CZi1KfyM.d.cts} +6 -1
- package/dist/{time-DAeZRwPk.d.ts → promo-gWLL0twu.d.ts} +6 -1
- package/dist/utils.cjs +23 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +23 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1868,8 +1868,30 @@ function getMonthYear(date) {
|
|
|
1868
1868
|
return date.toLocaleDateString("en-US", { month: "long", year: "numeric" });
|
|
1869
1869
|
}
|
|
1870
1870
|
|
|
1871
|
+
// src/utils/promo.ts
|
|
1872
|
+
function mapQuoteError(code, fallback) {
|
|
1873
|
+
switch (code) {
|
|
1874
|
+
case "PROMO.MIN_ORDER":
|
|
1875
|
+
return fallback || "Promo requires a higher minimum order.";
|
|
1876
|
+
case "PROMO.NOT_ACTIVE":
|
|
1877
|
+
return "Promo code is not active.";
|
|
1878
|
+
case "PROMO.NOT_YET_VALID":
|
|
1879
|
+
return "Promo code is not yet valid.";
|
|
1880
|
+
case "PROMO.EXPIRED":
|
|
1881
|
+
return "Promo code has expired.";
|
|
1882
|
+
case "PROMO.MAX_USES":
|
|
1883
|
+
return "Promo code usage limit exceeded.";
|
|
1884
|
+
case "PROMO.MAX_USES_PER_USER":
|
|
1885
|
+
return "You have already used this promo code.";
|
|
1886
|
+
case "PROMO.NOT_FOUND":
|
|
1887
|
+
return "Promo code not found.";
|
|
1888
|
+
default:
|
|
1889
|
+
return fallback || "Failed to fetch quote.";
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1871
1893
|
// src/index.ts
|
|
1872
|
-
var SDK_VERSION = "0.3.
|
|
1894
|
+
var SDK_VERSION = "0.3.86";
|
|
1873
1895
|
var SUPPORTED_FRAMEWORKS = [
|
|
1874
1896
|
"astro",
|
|
1875
1897
|
"react",
|
|
@@ -1986,7 +2008,9 @@ async function createArkySDK(config) {
|
|
|
1986
2008
|
getMonthYear,
|
|
1987
2009
|
getTotalDuration,
|
|
1988
2010
|
isBlocked,
|
|
1989
|
-
getWorkingHoursForDate
|
|
2011
|
+
getWorkingHoursForDate,
|
|
2012
|
+
// Promo utilities
|
|
2013
|
+
mapQuoteError
|
|
1990
2014
|
}
|
|
1991
2015
|
};
|
|
1992
2016
|
return sdk;
|