arky-sdk 0.3.109 → 0.3.111

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,4 +1,4 @@
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, 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';
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, GetQuoteParams, OrderCheckoutParams, Slot, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, SearchReservationsParams, 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, PaymentRefund, Price, PromoCodeValidation, ProviderWithTimeline, Quote, ReservationCartItem, ReservationStoreState, Seo, ShippingMethod, ShippingWeightTier, Zone } from './types.cjs';
3
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 } from './svg-3F_m7296.cjs';
4
4
 
@@ -165,7 +165,7 @@ declare function createArkySDK(config: HttpClientConfig & {
165
165
  getOrder(params: GetOrderParams, options?: RequestOptions): Promise<any>;
166
166
  getOrders(params: GetOrdersParams, options?: RequestOptions): Promise<any>;
167
167
  getQuote(params: GetQuoteParams, options?: RequestOptions): Promise<any>;
168
- checkout(params: CheckoutParams, options?: RequestOptions): Promise<any>;
168
+ checkout(params: OrderCheckoutParams, options?: RequestOptions): Promise<any>;
169
169
  };
170
170
  reservation: {
171
171
  addToCart(slot: Slot): void;
@@ -177,7 +177,6 @@ declare function createArkySDK(config: HttpClientConfig & {
177
177
  checkout(params?: Partial<ReservationCheckoutParams>, options?: RequestOptions): Promise<any>;
178
178
  getReservation(params: GetReservationParams, options?: RequestOptions): Promise<any>;
179
179
  searchReservations(params: SearchReservationsParams, options?: RequestOptions): Promise<any>;
180
- searchMyReservations(params: SearchMyReservationsParams, options?: RequestOptions): Promise<any>;
181
180
  getQuote(params: GetReservationQuoteParams, options?: RequestOptions): Promise<any>;
182
181
  createService(params: CreateServiceParams, options?: RequestOptions): Promise<any>;
183
182
  updateService(params: UpdateServiceParams, options?: RequestOptions): Promise<any>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
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, 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';
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, GetQuoteParams, OrderCheckoutParams, Slot, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, SearchReservationsParams, 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, PaymentRefund, Price, PromoCodeValidation, ProviderWithTimeline, Quote, ReservationCartItem, ReservationStoreState, Seo, ShippingMethod, ShippingWeightTier, Zone } from './types.js';
3
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 } from './svg-4hIdMU6f.js';
4
4
 
@@ -165,7 +165,7 @@ declare function createArkySDK(config: HttpClientConfig & {
165
165
  getOrder(params: GetOrderParams, options?: RequestOptions): Promise<any>;
166
166
  getOrders(params: GetOrdersParams, options?: RequestOptions): Promise<any>;
167
167
  getQuote(params: GetQuoteParams, options?: RequestOptions): Promise<any>;
168
- checkout(params: CheckoutParams, options?: RequestOptions): Promise<any>;
168
+ checkout(params: OrderCheckoutParams, options?: RequestOptions): Promise<any>;
169
169
  };
170
170
  reservation: {
171
171
  addToCart(slot: Slot): void;
@@ -177,7 +177,6 @@ declare function createArkySDK(config: HttpClientConfig & {
177
177
  checkout(params?: Partial<ReservationCheckoutParams>, options?: RequestOptions): Promise<any>;
178
178
  getReservation(params: GetReservationParams, options?: RequestOptions): Promise<any>;
179
179
  searchReservations(params: SearchReservationsParams, options?: RequestOptions): Promise<any>;
180
- searchMyReservations(params: SearchMyReservationsParams, options?: RequestOptions): Promise<any>;
181
180
  getQuote(params: GetReservationQuoteParams, options?: RequestOptions): Promise<any>;
182
181
  createService(params: CreateServiceParams, options?: RequestOptions): Promise<any>;
183
182
  updateService(params: UpdateServiceParams, options?: RequestOptions): Promise<any>;
package/dist/index.js CHANGED
@@ -451,29 +451,41 @@ var createMediaApi = (apiConfig) => {
451
451
  var createRoleApi = (apiConfig) => {
452
452
  return {
453
453
  async createRole(params, options) {
454
- return apiConfig.httpClient.post(`/v1/roles`, params, options);
454
+ return apiConfig.httpClient.post(
455
+ `/v1/businesses/${apiConfig.businessId}/roles`,
456
+ params,
457
+ options
458
+ );
455
459
  },
456
460
  async updateRole(params, options) {
457
461
  return apiConfig.httpClient.put(
458
- `/v1/roles/${params.id}`,
462
+ `/v1/businesses/${apiConfig.businessId}/roles/${params.id}`,
459
463
  params,
460
464
  options
461
465
  );
462
466
  },
463
467
  async deleteRole(params, options) {
464
- return apiConfig.httpClient.delete(`/v1/roles/${params.id}`, options);
468
+ return apiConfig.httpClient.delete(
469
+ `/v1/businesses/${apiConfig.businessId}/roles/${params.id}`,
470
+ options
471
+ );
465
472
  },
466
473
  async getRole(params, options) {
467
- return apiConfig.httpClient.get(`/v1/roles/${params.id}`, options);
474
+ return apiConfig.httpClient.get(
475
+ `/v1/businesses/${apiConfig.businessId}/roles/${params.id}`,
476
+ options
477
+ );
468
478
  },
469
479
  async getRoles(params, options) {
470
- return apiConfig.httpClient.get(`/v1/roles`, {
471
- ...options,
472
- params: {
473
- action: params.action,
474
- businessId: apiConfig.businessId
480
+ return apiConfig.httpClient.get(
481
+ `/v1/businesses/${apiConfig.businessId}/roles`,
482
+ {
483
+ ...options,
484
+ params: {
485
+ action: params.action
486
+ }
475
487
  }
476
- });
488
+ );
477
489
  }
478
490
  };
479
491
  };
@@ -834,7 +846,7 @@ var createCmsApi = (apiConfig) => {
834
846
  // ===== VARIABLES / METADATA =====
835
847
  async getVariableMetadata(params, options) {
836
848
  return apiConfig.httpClient.get(
837
- `/v1/collections/entry-types/${params.entryType}/variables`,
849
+ `/v1/businesses/${apiConfig.businessId}/collections/types/${params.entryType}/variables`,
838
850
  options
839
851
  );
840
852
  },
@@ -910,7 +922,7 @@ var createEshopApi = (apiConfig) => {
910
922
  },
911
923
  async updateOrder(params, options) {
912
924
  return apiConfig.httpClient.put(
913
- `/v1/businesses/${apiConfig.businessId}/orders/update`,
925
+ `/v1/businesses/${apiConfig.businessId}/orders/${params.id}`,
914
926
  params,
915
927
  options
916
928
  );
@@ -933,11 +945,14 @@ var createEshopApi = (apiConfig) => {
933
945
  // ===== PAYMENTS =====
934
946
  async getQuote(params, options) {
935
947
  const payload = {
936
- businessId: apiConfig.businessId,
937
948
  market: apiConfig.market,
938
949
  ...params
939
950
  };
940
- return apiConfig.httpClient.post(`/v1/orders/quote`, payload, options);
951
+ return apiConfig.httpClient.post(
952
+ `/v1/businesses/${apiConfig.businessId}/orders/quote`,
953
+ payload,
954
+ options
955
+ );
941
956
  },
942
957
  async checkout(params, options) {
943
958
  const payload = {
@@ -974,16 +989,19 @@ var createReservationApi = (apiConfig) => {
974
989
  // ===== RESERVATIONS =====
975
990
  async createReservation(params, options) {
976
991
  const payload = {
977
- businessId: apiConfig.businessId,
978
992
  market: apiConfig.market,
979
993
  ...params
980
994
  };
981
- return apiConfig.httpClient.post(`/v1/reservations`, payload, options);
995
+ return apiConfig.httpClient.post(
996
+ `/v1/businesses/${apiConfig.businessId}/reservations`,
997
+ payload,
998
+ options
999
+ );
982
1000
  },
983
1001
  async updateReservation(params, options) {
984
1002
  const { id, ...payload } = params;
985
1003
  return apiConfig.httpClient.put(
986
- `/v1/reservations/${id}`,
1004
+ `/v1/businesses/${apiConfig.businessId}/reservations/${id}`,
987
1005
  payload,
988
1006
  options
989
1007
  );
@@ -996,46 +1014,42 @@ var createReservationApi = (apiConfig) => {
996
1014
  to: s.to
997
1015
  }));
998
1016
  const payload = {
999
- businessId: apiConfig.businessId,
1000
1017
  market: apiConfig.market,
1001
1018
  ...params,
1002
1019
  items
1003
1020
  };
1004
1021
  return apiConfig.httpClient.post(
1005
- `/v1/reservations/checkout`,
1022
+ `/v1/businesses/${apiConfig.businessId}/reservations/checkout`,
1006
1023
  payload,
1007
1024
  options
1008
1025
  );
1009
1026
  },
1010
1027
  async getReservation(params, options) {
1011
- return apiConfig.httpClient.get(`/v1/reservations/${params.id}`, {
1012
- ...options,
1013
- params: { businessId: apiConfig.businessId }
1014
- });
1028
+ return apiConfig.httpClient.get(
1029
+ `/v1/businesses/${apiConfig.businessId}/reservations/${params.id}`,
1030
+ options
1031
+ );
1015
1032
  },
1016
1033
  async searchReservations(params, options) {
1017
- return apiConfig.httpClient.get(`/v1/reservations/search`, {
1018
- ...options,
1019
- params: {
1020
- ...params,
1021
- businessId: apiConfig.businessId
1034
+ return apiConfig.httpClient.get(
1035
+ `/v1/businesses/${apiConfig.businessId}/reservations`,
1036
+ {
1037
+ ...options,
1038
+ params
1022
1039
  }
1023
- });
1024
- },
1025
- async searchMyReservations(params, options) {
1026
- return apiConfig.httpClient.get(`/v1/reservations`, {
1027
- ...options,
1028
- params
1029
- });
1040
+ );
1030
1041
  },
1031
1042
  // ===== QUOTES =====
1032
1043
  async getQuote(params, options) {
1033
1044
  const payload = {
1034
- businessId: apiConfig.businessId,
1035
1045
  market: apiConfig.market,
1036
1046
  ...params
1037
1047
  };
1038
- return apiConfig.httpClient.post(`/v1/reservations/quote`, payload, options);
1048
+ return apiConfig.httpClient.post(
1049
+ `/v1/businesses/${apiConfig.businessId}/reservations/quote`,
1050
+ payload,
1051
+ options
1052
+ );
1039
1053
  },
1040
1054
  // ===== SERVICES =====
1041
1055
  async createService(params, options) {