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.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { UpdateUserProfileParams, RequestOptions, DeleteUserParams, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, LogoutParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, UserSubscribeParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, SetProviderScheduleParams, ProcessRefundParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, CreateRoleParams, UpdateRoleParams, DeleteRoleParams, GetRoleParams, GetRolesParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, GetAnalyticsParams, CreateCollectionParams, UpdateCollectionParams, DeleteCollectionParams, GetCollectionParams, GetCollectionsParams, GenerateBlocksParams, GetEntriesParams, CreateEntryParams, UpdateEntryParams, DeleteCollectionEntryParams, GetCollectionEntryParams, SendEntryParams, GetVariableMetadataParams, GetCollectionSubscribersParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, UpdateOrderStatusParams, UpdateOrderPaymentStatusParams, GetQuoteParams, CheckoutParams, Slot, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, SearchReservationsParams, SearchMyReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, GetServiceProvidersParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams, CreateFeatureFlagParams, FeatureFlag, GetFeatureFlagParams, GetFeatureFlagsParams, UpdateFeatureFlagParams, DeleteFeatureFlagParams, GetFeatureFlagResultsParams, FlagResults, GetVariantParams, GetVariantResponse, TrackEventParams, TrackEventResponse } from './types.cjs';
2
2
  export { ApiResponse, Block, Business, BusinessConfig, DayAvailability, EshopCartItem, EshopStoreState, GetAvailabilityParams, GetSlotsForDateParams, Language, Location, Market, Media, MediaResolution, PaginatedResponse, Payment, PaymentMethod, PaymentMethodType, PaymentProviderConfig, Price, PromoCodeValidation, ProviderWithTimeline, Quote, QuoteLineItem, ReservationCartItem, ReservationStoreState, Seo, ShippingMethod, ShippingWeightTier, Zone } from './types.cjs';
3
- import { e as extractBlockValues, g as getBlockLabel, a as getBlockTextValue, f as formatBlockValue, p as prepareBlocksForSubmission, b as getMarketPrice, c as getPriceAmount, d as formatPayment, h as formatMinor, i as createPaymentForCheckout, j as getCurrencySymbol, v as validatePhoneNumber, k as findTimeZone, s as slugify, l as humanize, m as categorify, n as formatDate, o as getSvgContentForAstro, q as fetchSvgContent, r as injectSvgIntoElement, t as formatTime, u as formatSlotTime, w as getTzOffset, x as toUtcTimestamp, y as formatDateDisplay, z as getIsoDate, A as parseIsoDate, B as computeSlotsForDate, C as hasAvailableSlots, D as buildCalendar, E as getMonthYear, F as getTotalDuration, G as isBlocked, H as getWorkingHoursForDate } from './time-DPOc8E1C.cjs';
4
- export { L as AvailableSlot, Q as BuildCalendarOptions, N as CalendarDay, M as ComputeSlotsOptions, O as OutcastDate, S as ServiceDuration, P as SlotProviderWithTimeline, J as SpecificDate, T as TimelinePoint, I as WorkingDay, W as WorkingHours, K as WorkingTime } from './time-DPOc8E1C.cjs';
3
+ import { e as extractBlockValues, g as getBlockLabel, a as getBlockTextValue, f as formatBlockValue, p as prepareBlocksForSubmission, b as getMarketPrice, c as getPriceAmount, d as formatPayment, h as formatMinor, i as createPaymentForCheckout, j as getCurrencySymbol, v as validatePhoneNumber, k as findTimeZone, s as slugify, l as humanize, m as categorify, n as formatDate, o as getSvgContentForAstro, q as fetchSvgContent, r as injectSvgIntoElement, t as formatTime, u as formatSlotTime, w as getTzOffset, x as toUtcTimestamp, y as formatDateDisplay, z as getIsoDate, A as parseIsoDate, B as computeSlotsForDate, C as hasAvailableSlots, D as buildCalendar, E as getMonthYear, F as getTotalDuration, G as isBlocked, H as getWorkingHoursForDate, I as mapQuoteError } from './promo-CZi1KfyM.cjs';
4
+ export { M as AvailableSlot, R as BuildCalendarOptions, Q as CalendarDay, N as ComputeSlotsOptions, O as OutcastDate, S as ServiceDuration, P as SlotProviderWithTimeline, K as SpecificDate, T as TimelinePoint, J as WorkingDay, W as WorkingHours, L as WorkingTime } from './promo-CZi1KfyM.cjs';
5
5
 
6
6
  interface AuthTokens {
7
7
  accessToken: string;
@@ -59,7 +59,7 @@ interface RunScriptResponse {
59
59
  message: string;
60
60
  }
61
61
 
62
- declare const SDK_VERSION = "0.3.85";
62
+ declare const SDK_VERSION = "0.3.86";
63
63
  declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
64
64
  interface ApiConfig {
65
65
  httpClient: any;
@@ -283,6 +283,7 @@ declare function createArkySDK(config: HttpClientConfig & {
283
283
  getTotalDuration: typeof getTotalDuration;
284
284
  isBlocked: typeof isBlocked;
285
285
  getWorkingHoursForDate: typeof getWorkingHoursForDate;
286
+ mapQuoteError: typeof mapQuoteError;
286
287
  };
287
288
  }>;
288
289
 
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { UpdateUserProfileParams, RequestOptions, DeleteUserParams, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, LogoutParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, UserSubscribeParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, SetProviderScheduleParams, ProcessRefundParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, CreateRoleParams, UpdateRoleParams, DeleteRoleParams, GetRoleParams, GetRolesParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, GetAnalyticsParams, CreateCollectionParams, UpdateCollectionParams, DeleteCollectionParams, GetCollectionParams, GetCollectionsParams, GenerateBlocksParams, GetEntriesParams, CreateEntryParams, UpdateEntryParams, DeleteCollectionEntryParams, GetCollectionEntryParams, SendEntryParams, GetVariableMetadataParams, GetCollectionSubscribersParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, UpdateOrderStatusParams, UpdateOrderPaymentStatusParams, GetQuoteParams, CheckoutParams, Slot, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, SearchReservationsParams, SearchMyReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, GetServiceProvidersParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams, CreateFeatureFlagParams, FeatureFlag, GetFeatureFlagParams, GetFeatureFlagsParams, UpdateFeatureFlagParams, DeleteFeatureFlagParams, GetFeatureFlagResultsParams, FlagResults, GetVariantParams, GetVariantResponse, TrackEventParams, TrackEventResponse } from './types.js';
2
2
  export { ApiResponse, Block, Business, BusinessConfig, DayAvailability, EshopCartItem, EshopStoreState, GetAvailabilityParams, GetSlotsForDateParams, Language, Location, Market, Media, MediaResolution, PaginatedResponse, Payment, PaymentMethod, PaymentMethodType, PaymentProviderConfig, Price, PromoCodeValidation, ProviderWithTimeline, Quote, QuoteLineItem, ReservationCartItem, ReservationStoreState, Seo, ShippingMethod, ShippingWeightTier, Zone } from './types.js';
3
- import { e as extractBlockValues, g as getBlockLabel, a as getBlockTextValue, f as formatBlockValue, p as prepareBlocksForSubmission, b as getMarketPrice, c as getPriceAmount, d as formatPayment, h as formatMinor, i as createPaymentForCheckout, j as getCurrencySymbol, v as validatePhoneNumber, k as findTimeZone, s as slugify, l as humanize, m as categorify, n as formatDate, o as getSvgContentForAstro, q as fetchSvgContent, r as injectSvgIntoElement, t as formatTime, u as formatSlotTime, w as getTzOffset, x as toUtcTimestamp, y as formatDateDisplay, z as getIsoDate, A as parseIsoDate, B as computeSlotsForDate, C as hasAvailableSlots, D as buildCalendar, E as getMonthYear, F as getTotalDuration, G as isBlocked, H as getWorkingHoursForDate } from './time-DAeZRwPk.js';
4
- export { L as AvailableSlot, Q as BuildCalendarOptions, N as CalendarDay, M as ComputeSlotsOptions, O as OutcastDate, S as ServiceDuration, P as SlotProviderWithTimeline, J as SpecificDate, T as TimelinePoint, I as WorkingDay, W as WorkingHours, K as WorkingTime } from './time-DAeZRwPk.js';
3
+ import { e as extractBlockValues, g as getBlockLabel, a as getBlockTextValue, f as formatBlockValue, p as prepareBlocksForSubmission, b as getMarketPrice, c as getPriceAmount, d as formatPayment, h as formatMinor, i as createPaymentForCheckout, j as getCurrencySymbol, v as validatePhoneNumber, k as findTimeZone, s as slugify, l as humanize, m as categorify, n as formatDate, o as getSvgContentForAstro, q as fetchSvgContent, r as injectSvgIntoElement, t as formatTime, u as formatSlotTime, w as getTzOffset, x as toUtcTimestamp, y as formatDateDisplay, z as getIsoDate, A as parseIsoDate, B as computeSlotsForDate, C as hasAvailableSlots, D as buildCalendar, E as getMonthYear, F as getTotalDuration, G as isBlocked, H as getWorkingHoursForDate, I as mapQuoteError } from './promo-gWLL0twu.js';
4
+ export { M as AvailableSlot, R as BuildCalendarOptions, Q as CalendarDay, N as ComputeSlotsOptions, O as OutcastDate, S as ServiceDuration, P as SlotProviderWithTimeline, K as SpecificDate, T as TimelinePoint, J as WorkingDay, W as WorkingHours, L as WorkingTime } from './promo-gWLL0twu.js';
5
5
 
6
6
  interface AuthTokens {
7
7
  accessToken: string;
@@ -59,7 +59,7 @@ interface RunScriptResponse {
59
59
  message: string;
60
60
  }
61
61
 
62
- declare const SDK_VERSION = "0.3.85";
62
+ declare const SDK_VERSION = "0.3.86";
63
63
  declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
64
64
  interface ApiConfig {
65
65
  httpClient: any;
@@ -283,6 +283,7 @@ declare function createArkySDK(config: HttpClientConfig & {
283
283
  getTotalDuration: typeof getTotalDuration;
284
284
  isBlocked: typeof isBlocked;
285
285
  getWorkingHoursForDate: typeof getWorkingHoursForDate;
286
+ mapQuoteError: typeof mapQuoteError;
286
287
  };
287
288
  }>;
288
289
 
package/dist/index.js CHANGED
@@ -1866,8 +1866,30 @@ function getMonthYear(date) {
1866
1866
  return date.toLocaleDateString("en-US", { month: "long", year: "numeric" });
1867
1867
  }
1868
1868
 
1869
+ // src/utils/promo.ts
1870
+ function mapQuoteError(code, fallback) {
1871
+ switch (code) {
1872
+ case "PROMO.MIN_ORDER":
1873
+ return fallback || "Promo requires a higher minimum order.";
1874
+ case "PROMO.NOT_ACTIVE":
1875
+ return "Promo code is not active.";
1876
+ case "PROMO.NOT_YET_VALID":
1877
+ return "Promo code is not yet valid.";
1878
+ case "PROMO.EXPIRED":
1879
+ return "Promo code has expired.";
1880
+ case "PROMO.MAX_USES":
1881
+ return "Promo code usage limit exceeded.";
1882
+ case "PROMO.MAX_USES_PER_USER":
1883
+ return "You have already used this promo code.";
1884
+ case "PROMO.NOT_FOUND":
1885
+ return "Promo code not found.";
1886
+ default:
1887
+ return fallback || "Failed to fetch quote.";
1888
+ }
1889
+ }
1890
+
1869
1891
  // src/index.ts
1870
- var SDK_VERSION = "0.3.85";
1892
+ var SDK_VERSION = "0.3.86";
1871
1893
  var SUPPORTED_FRAMEWORKS = [
1872
1894
  "astro",
1873
1895
  "react",
@@ -1984,7 +2006,9 @@ async function createArkySDK(config) {
1984
2006
  getMonthYear,
1985
2007
  getTotalDuration,
1986
2008
  isBlocked,
1987
- getWorkingHoursForDate
2009
+ getWorkingHoursForDate,
2010
+ // Promo utilities
2011
+ mapQuoteError
1988
2012
  }
1989
2013
  };
1990
2014
  return sdk;