arky-sdk 0.3.40 → 0.3.42

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, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, LogoutParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, UpdateSubscriptionParams, CancelSubscriptionParams, CancelScheduledDowngradeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, SetProviderScheduleParams, 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, SubscribeToCollectionParams, UnsubscribeFromCollectionParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, UpdateOrderStatusParams, UpdateOrderPaymentStatusParams, GetQuoteParams, CheckoutParams, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, GetReservationPartsParams, SearchReservationsParams, SearchMyReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, GetAvailableSlotsParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams, HandleStripeWebhookParams, GetBusinessMarketsParams, GetBusinessMarketParams } from './types.cjs';
1
+ import { UpdateUserProfileParams, RequestOptions, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, LogoutParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, SetProviderScheduleParams, 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, SubscribeToCollectionParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, UpdateOrderStatusParams, UpdateOrderPaymentStatusParams, GetQuoteParams, CheckoutParams, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, GetReservationPartsParams, SearchReservationsParams, SearchMyReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, GetAvailableSlotsParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams } from './types.cjs';
2
2
  export { ApiResponse, Block, Business, EshopCartItem, EshopStoreState, Price, ReservationCartPart, ReservationStoreState } from './types.cjs';
3
3
  import { g as getBlockLabel, a as getBlockTextValue, f as formatBlockValue, p as prepareBlocksForSubmission, e as extractBlockValues, 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-DKAX97qt.cjs';
4
4
 
@@ -22,7 +22,7 @@ interface HttpClientConfig {
22
22
  isAuthenticated?: () => boolean;
23
23
  }
24
24
 
25
- declare const SDK_VERSION = "0.3.30";
25
+ declare const SDK_VERSION = "0.3.42";
26
26
  declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
27
27
  interface ApiConfig {
28
28
  httpClient: any;
@@ -65,9 +65,7 @@ declare function createArkySDK(config: HttpClientConfig & {
65
65
  triggerBuilds(params: TriggerBuildsParams, options?: RequestOptions): Promise<any>;
66
66
  getSubscriptionPlans(params: GetSubscriptionPlansParams, options?: RequestOptions): Promise<any>;
67
67
  getSubscription(params: GetSubscriptionParams, options?: RequestOptions): Promise<any>;
68
- updateSubscription(params: UpdateSubscriptionParams, options?: RequestOptions): Promise<any>;
69
- cancelSubscription(params: CancelSubscriptionParams, options?: RequestOptions): Promise<any>;
70
- cancelScheduledDowngrade(params: CancelScheduledDowngradeParams, options?: RequestOptions): Promise<any>;
68
+ subscribe(params: SubscribeParams, options?: RequestOptions): Promise<any>;
71
69
  createPortalSession(params: CreatePortalSessionParams, options?: RequestOptions): Promise<any>;
72
70
  inviteUser(params: InviteUserParams, options?: RequestOptions): Promise<any>;
73
71
  handleInvitation(params: HandleInvitationParams, options?: RequestOptions): Promise<any>;
@@ -118,7 +116,6 @@ declare function createArkySDK(config: HttpClientConfig & {
118
116
  getVariableMetadata(params: GetVariableMetadataParams, options?: RequestOptions): Promise<any>;
119
117
  getCollectionSubscribers(params: GetCollectionSubscribersParams, options?: RequestOptions): Promise<any>;
120
118
  subscribeToCollection(params: SubscribeToCollectionParams, options?: RequestOptions): Promise<any>;
121
- unsubscribeFromCollection(params: UnsubscribeFromCollectionParams, options?: RequestOptions): Promise<any>;
122
119
  };
123
120
  eshop: {
124
121
  createProduct(params: CreateProductParams, options?: RequestOptions): Promise<any>;
@@ -157,11 +154,6 @@ declare function createArkySDK(config: HttpClientConfig & {
157
154
  getProviders(params: GetProvidersParams, options?: RequestOptions): Promise<any>;
158
155
  getProviderWorkingTime(params: GetBusinessServiceWorkingTimeParams, options?: RequestOptions): Promise<any>;
159
156
  };
160
- payment: {
161
- handleStripeWebhook(params: HandleStripeWebhookParams, options?: RequestOptions): Promise<any>;
162
- getBusinessMarkets(params: GetBusinessMarketsParams, options?: RequestOptions): Promise<any>;
163
- getBusinessMarket(params: GetBusinessMarketParams, options?: RequestOptions): Promise<any>;
164
- };
165
157
  setBusinessId: (businessId: string) => void;
166
158
  getBusinessId: () => string;
167
159
  setMarket: (market: string) => void;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { UpdateUserProfileParams, RequestOptions, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, LogoutParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, UpdateSubscriptionParams, CancelSubscriptionParams, CancelScheduledDowngradeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, SetProviderScheduleParams, 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, SubscribeToCollectionParams, UnsubscribeFromCollectionParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, UpdateOrderStatusParams, UpdateOrderPaymentStatusParams, GetQuoteParams, CheckoutParams, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, GetReservationPartsParams, SearchReservationsParams, SearchMyReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, GetAvailableSlotsParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams, HandleStripeWebhookParams, GetBusinessMarketsParams, GetBusinessMarketParams } from './types.js';
1
+ import { UpdateUserProfileParams, RequestOptions, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, LogoutParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, SetProviderScheduleParams, 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, SubscribeToCollectionParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, UpdateOrderStatusParams, UpdateOrderPaymentStatusParams, GetQuoteParams, CheckoutParams, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, GetReservationPartsParams, SearchReservationsParams, SearchMyReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, GetAvailableSlotsParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams } from './types.js';
2
2
  export { ApiResponse, Block, Business, EshopCartItem, EshopStoreState, Price, ReservationCartPart, ReservationStoreState } from './types.js';
3
3
  import { g as getBlockLabel, a as getBlockTextValue, f as formatBlockValue, p as prepareBlocksForSubmission, e as extractBlockValues, 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-CR0zPGOt.js';
4
4
 
@@ -22,7 +22,7 @@ interface HttpClientConfig {
22
22
  isAuthenticated?: () => boolean;
23
23
  }
24
24
 
25
- declare const SDK_VERSION = "0.3.30";
25
+ declare const SDK_VERSION = "0.3.42";
26
26
  declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
27
27
  interface ApiConfig {
28
28
  httpClient: any;
@@ -65,9 +65,7 @@ declare function createArkySDK(config: HttpClientConfig & {
65
65
  triggerBuilds(params: TriggerBuildsParams, options?: RequestOptions): Promise<any>;
66
66
  getSubscriptionPlans(params: GetSubscriptionPlansParams, options?: RequestOptions): Promise<any>;
67
67
  getSubscription(params: GetSubscriptionParams, options?: RequestOptions): Promise<any>;
68
- updateSubscription(params: UpdateSubscriptionParams, options?: RequestOptions): Promise<any>;
69
- cancelSubscription(params: CancelSubscriptionParams, options?: RequestOptions): Promise<any>;
70
- cancelScheduledDowngrade(params: CancelScheduledDowngradeParams, options?: RequestOptions): Promise<any>;
68
+ subscribe(params: SubscribeParams, options?: RequestOptions): Promise<any>;
71
69
  createPortalSession(params: CreatePortalSessionParams, options?: RequestOptions): Promise<any>;
72
70
  inviteUser(params: InviteUserParams, options?: RequestOptions): Promise<any>;
73
71
  handleInvitation(params: HandleInvitationParams, options?: RequestOptions): Promise<any>;
@@ -118,7 +116,6 @@ declare function createArkySDK(config: HttpClientConfig & {
118
116
  getVariableMetadata(params: GetVariableMetadataParams, options?: RequestOptions): Promise<any>;
119
117
  getCollectionSubscribers(params: GetCollectionSubscribersParams, options?: RequestOptions): Promise<any>;
120
118
  subscribeToCollection(params: SubscribeToCollectionParams, options?: RequestOptions): Promise<any>;
121
- unsubscribeFromCollection(params: UnsubscribeFromCollectionParams, options?: RequestOptions): Promise<any>;
122
119
  };
123
120
  eshop: {
124
121
  createProduct(params: CreateProductParams, options?: RequestOptions): Promise<any>;
@@ -157,11 +154,6 @@ declare function createArkySDK(config: HttpClientConfig & {
157
154
  getProviders(params: GetProvidersParams, options?: RequestOptions): Promise<any>;
158
155
  getProviderWorkingTime(params: GetBusinessServiceWorkingTimeParams, options?: RequestOptions): Promise<any>;
159
156
  };
160
- payment: {
161
- handleStripeWebhook(params: HandleStripeWebhookParams, options?: RequestOptions): Promise<any>;
162
- getBusinessMarkets(params: GetBusinessMarketsParams, options?: RequestOptions): Promise<any>;
163
- getBusinessMarket(params: GetBusinessMarketParams, options?: RequestOptions): Promise<any>;
164
- };
165
157
  setBusinessId: (businessId: string) => void;
166
158
  getBusinessId: () => string;
167
159
  setMarket: (market: string) => void;
package/dist/index.js CHANGED
@@ -274,46 +274,53 @@ var createBusinessApi = (apiConfig) => {
274
274
  return apiConfig.httpClient.post(`/v1/businesses`, params, options);
275
275
  },
276
276
  async updateBusiness(params, options) {
277
- return apiConfig.httpClient.put(`/v1/businesses/${params.id}`, params, options);
277
+ return apiConfig.httpClient.put(
278
+ `/v1/businesses/${params.id}`,
279
+ params,
280
+ options
281
+ );
278
282
  },
279
283
  async deleteBusiness(params, options) {
280
- return apiConfig.httpClient.delete(`/v1/businesses/${params.id}`, options);
284
+ return apiConfig.httpClient.delete(
285
+ `/v1/businesses/${params.id}`,
286
+ options
287
+ );
281
288
  },
282
289
  async getBusiness(params, options) {
283
- return apiConfig.httpClient.get(`/v1/businesses/${apiConfig.businessId}`, options);
290
+ return apiConfig.httpClient.get(
291
+ `/v1/businesses/${apiConfig.businessId}`,
292
+ options
293
+ );
284
294
  },
285
295
  async getBusinesses(params, options) {
286
296
  return apiConfig.httpClient.get(`/v1/businesses`, options);
287
297
  },
288
298
  async getBusinessParents(params, options) {
289
- return apiConfig.httpClient.get(`/v1/businesses/${apiConfig.businessId}/parents`, options);
299
+ return apiConfig.httpClient.get(
300
+ `/v1/businesses/${apiConfig.businessId}/parents`,
301
+ options
302
+ );
290
303
  },
291
304
  async triggerBuilds(params, options) {
292
- return apiConfig.httpClient.post(`/v1/businesses/${params.id}/trigger-builds`, {}, options);
305
+ return apiConfig.httpClient.post(
306
+ `/v1/businesses/${params.id}/trigger-builds`,
307
+ {},
308
+ options
309
+ );
293
310
  },
294
311
  async getSubscriptionPlans(params, options) {
295
312
  return apiConfig.httpClient.get("/v1/businesses/plans", options);
296
313
  },
297
314
  async getSubscription(params, options) {
298
- return apiConfig.httpClient.get(`/v1/businesses/${apiConfig.businessId}/subscription`, options);
299
- },
300
- async updateSubscription(params, options) {
301
- return apiConfig.httpClient.put(
315
+ return apiConfig.httpClient.get(
302
316
  `/v1/businesses/${apiConfig.businessId}/subscription`,
303
- params,
304
317
  options
305
318
  );
306
319
  },
307
- async cancelSubscription(params, options) {
308
- return apiConfig.httpClient.delete(`/v1/businesses/${apiConfig.businessId}/subscription`, {
309
- ...options,
310
- params: { immediately: params.immediately || false }
311
- });
312
- },
313
- async cancelScheduledDowngrade(params, options) {
314
- return apiConfig.httpClient.post(
315
- `/v1/businesses/${apiConfig.businessId}/subscription/cancel-downgrade`,
316
- {},
320
+ async subscribe(params, options) {
321
+ return apiConfig.httpClient.put(
322
+ `/v1/businesses/${apiConfig.businessId}/subscribe`,
323
+ params,
317
324
  options
318
325
  );
319
326
  },
@@ -346,16 +353,13 @@ var createBusinessApi = (apiConfig) => {
346
353
  );
347
354
  },
348
355
  async getBusinessMedia(params, options) {
349
- return apiConfig.httpClient.get(
350
- `/v1/businesses/${params.id}/media`,
351
- {
352
- ...options,
353
- params: {
354
- cursor: params.cursor,
355
- limit: params.limit || 20
356
- }
356
+ return apiConfig.httpClient.get(`/v1/businesses/${params.id}/media`, {
357
+ ...options,
358
+ params: {
359
+ cursor: params.cursor,
360
+ limit: params.limit || 20
357
361
  }
358
- );
362
+ });
359
363
  },
360
364
  async setProviderSchedule(params, options) {
361
365
  const { id, ...payload } = params;
@@ -853,15 +857,6 @@ var createCmsApi = (apiConfig) => {
853
857
  },
854
858
  options
855
859
  );
856
- },
857
- async unsubscribeFromCollection(params, options) {
858
- return apiConfig.httpClient.get(
859
- `/v1/businesses/${apiConfig.businessId}/collections/unsubscribe`,
860
- {
861
- ...options,
862
- params
863
- }
864
- );
865
860
  }
866
861
  };
867
862
  };
@@ -1178,27 +1173,6 @@ var createReservationApi = (apiConfig) => {
1178
1173
  };
1179
1174
  };
1180
1175
 
1181
- // src/api/payment.ts
1182
- var createPaymentApi = (apiConfig) => {
1183
- return {
1184
- async handleStripeWebhook(params, options) {
1185
- return apiConfig.httpClient.post(`/v1/payments/webhooks/stripe`, params, options);
1186
- },
1187
- async getBusinessMarkets(params, options) {
1188
- return apiConfig.httpClient.get(
1189
- `/v1/payments/businesses/${apiConfig.businessId}/markets`,
1190
- options
1191
- );
1192
- },
1193
- async getBusinessMarket(params, options) {
1194
- return apiConfig.httpClient.get(
1195
- `/v1/payments/businesses/${apiConfig.businessId}/markets/${params.marketId}`,
1196
- options
1197
- );
1198
- }
1199
- };
1200
- };
1201
-
1202
1176
  // src/utils/currency.ts
1203
1177
  function getCurrencySymbol(currency) {
1204
1178
  const currencySymbols = {
@@ -1547,7 +1521,7 @@ async function injectSvgIntoElement(mediaObject, targetElement, className) {
1547
1521
  }
1548
1522
 
1549
1523
  // src/index.ts
1550
- var SDK_VERSION = "0.3.30";
1524
+ var SDK_VERSION = "0.3.42";
1551
1525
  var SUPPORTED_FRAMEWORKS = [
1552
1526
  "astro",
1553
1527
  "react",
@@ -1585,7 +1559,6 @@ function createArkySDK(config) {
1585
1559
  cms: createCmsApi(apiConfig),
1586
1560
  eshop: createEshopApi(apiConfig),
1587
1561
  reservation: createReservationApi(apiConfig),
1588
- payment: createPaymentApi(apiConfig),
1589
1562
  setBusinessId: (businessId) => {
1590
1563
  apiConfig.businessId = businessId;
1591
1564
  },