arky-sdk 0.3.21 → 0.3.24
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/README.md +277 -61
- package/dist/index.cjs +33 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -14
- package/dist/index.d.ts +6 -14
- package/dist/index.js +33 -55
- package/dist/index.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +13 -55
- package/dist/types.d.ts +13 -55
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UpdateUserProfileParams, RequestOptions, UpdateProfilePhoneParams, VerifyPhoneCodeParams, GetMeParams, SearchUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, LogoutParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, CreateSubscriptionParams, UpdateSubscriptionParams, CancelSubscriptionParams, ReactivateSubscriptionParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, SetProviderScheduleParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, CreateRoleParams, UpdateRoleParams, DeleteRoleParams, GetRoleParams, GetRolesParams, GetNotificationsParams, UpdateNotificationsParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, GetAnalyticsParams, GetAnalyticsHealthParams, SetupAnalyticsParams, CreateCollectionParams, UpdateCollectionParams, DeleteCollectionParams, GetCollectionParams, GetCollectionsParams, GenerateBlocksParams, GetEntriesParams, CreateEntryParams, UpdateEntryParams, DeleteCollectionEntryParams, GetCollectionEntryParams, SendEntryParams, GetVariableMetadataParams, 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,
|
|
1
|
+
import { UpdateUserProfileParams, RequestOptions, UpdateProfilePhoneParams, VerifyPhoneCodeParams, GetMeParams, SearchUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, LogoutParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, CreateSubscriptionParams, UpdateSubscriptionParams, CancelSubscriptionParams, ReactivateSubscriptionParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, SetProviderScheduleParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, CreateRoleParams, UpdateRoleParams, DeleteRoleParams, GetRoleParams, GetRolesParams, GetNotificationsParams, UpdateNotificationsParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, GetAnalyticsParams, GetAnalyticsHealthParams, SetupAnalyticsParams, 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';
|
|
2
2
|
export { ApiResponse, Block, Business, EshopCartItem, EshopStoreState, Price, ReservationCartPart, ReservationStoreState } from './types.cjs';
|
|
3
3
|
import { g as getGalleryThumbnail, a as getBlockLabel, b as getBlockTextValue, f as formatBlockValue, p as prepareBlocksForSubmission, e as extractBlockValues, c as getMarketPrice, d as getPriceAmount, h as formatPayment, i as formatMinor, j as createPaymentForCheckout, k as getCurrencySymbol, v as validatePhoneNumber, l as findTimeZone, s as slugify, m as humanize, n as categorify, o as formatDate, q as getSvgContentForAstro, r as fetchSvgContent, t as injectSvgIntoElement } from './svg-CFjyTGXu.cjs';
|
|
4
4
|
|
|
@@ -26,7 +26,7 @@ interface HttpClientConfig {
|
|
|
26
26
|
isAuthenticated?: () => boolean;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
declare const SDK_VERSION = "0.3.
|
|
29
|
+
declare const SDK_VERSION = "0.3.24";
|
|
30
30
|
declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
|
|
31
31
|
interface ApiConfig {
|
|
32
32
|
httpClient: any;
|
|
@@ -47,7 +47,7 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
47
47
|
verifyPhoneCode(params: VerifyPhoneCodeParams, options?: RequestOptions): Promise<any>;
|
|
48
48
|
getMe(params: GetMeParams, options?: RequestOptions): Promise<any>;
|
|
49
49
|
searchUsers(params: SearchUsersParams, options?: RequestOptions): Promise<any>;
|
|
50
|
-
|
|
50
|
+
setRole(params: SetRoleParams, options?: RequestOptions): Promise<any>;
|
|
51
51
|
loginUser(params: LoginUserParams, options?: RequestOptions): Promise<any>;
|
|
52
52
|
registerUser(params: RegisterUserParams, options?: RequestOptions): Promise<any>;
|
|
53
53
|
logout(params: LogoutParams, options?: RequestOptions): Promise<any>;
|
|
@@ -122,6 +122,9 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
122
122
|
getCollectionEntry(params: GetCollectionEntryParams, options?: RequestOptions): Promise<any>;
|
|
123
123
|
sendEntry(params: SendEntryParams, options?: RequestOptions): Promise<any>;
|
|
124
124
|
getVariableMetadata(params: GetVariableMetadataParams, options?: RequestOptions): Promise<any>;
|
|
125
|
+
getCollectionSubscribers(params: GetCollectionSubscribersParams, options?: RequestOptions): Promise<any>;
|
|
126
|
+
subscribeToCollection(params: SubscribeToCollectionParams, options?: RequestOptions): Promise<any>;
|
|
127
|
+
unsubscribeFromCollection(params: UnsubscribeFromCollectionParams, options?: RequestOptions): Promise<any>;
|
|
125
128
|
};
|
|
126
129
|
eshop: {
|
|
127
130
|
createProduct(params: CreateProductParams, options?: RequestOptions): Promise<any>;
|
|
@@ -160,17 +163,6 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
160
163
|
getProviders(params: GetProvidersParams, options?: RequestOptions): Promise<any>;
|
|
161
164
|
getProviderWorkingTime(params: GetBusinessServiceWorkingTimeParams, options?: RequestOptions): Promise<any>;
|
|
162
165
|
};
|
|
163
|
-
newsletter: {
|
|
164
|
-
find(params: NewsletterFindParams, options?: RequestOptions): Promise<any>;
|
|
165
|
-
get(params: NewsletterGetParams, options?: RequestOptions): Promise<any>;
|
|
166
|
-
create(params: CreateNewsletterParams, options?: RequestOptions): Promise<any>;
|
|
167
|
-
update(params: UpdateNewsletterParams, options?: RequestOptions): Promise<any>;
|
|
168
|
-
delete(params: DeleteNewsletterParams, options?: RequestOptions): Promise<any>;
|
|
169
|
-
getSubscribers(params: GetSubscribersParams, options?: RequestOptions): Promise<any>;
|
|
170
|
-
subscribe(params: NewsletterSubscribeParams, options?: RequestOptions): Promise<any>;
|
|
171
|
-
unsubscribe(params: UnsubscribeParams, options?: RequestOptions): Promise<any>;
|
|
172
|
-
unsubscribeWithToken(params: UnsubscribeParams, options?: RequestOptions): Promise<any>;
|
|
173
|
-
};
|
|
174
166
|
payment: {
|
|
175
167
|
handleStripeWebhook(params: HandleStripeWebhookParams, options?: RequestOptions): Promise<any>;
|
|
176
168
|
getBusinessMarkets(params: GetBusinessMarketsParams, options?: RequestOptions): Promise<any>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UpdateUserProfileParams, RequestOptions, UpdateProfilePhoneParams, VerifyPhoneCodeParams, GetMeParams, SearchUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, LogoutParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, CreateSubscriptionParams, UpdateSubscriptionParams, CancelSubscriptionParams, ReactivateSubscriptionParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, SetProviderScheduleParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, CreateRoleParams, UpdateRoleParams, DeleteRoleParams, GetRoleParams, GetRolesParams, GetNotificationsParams, UpdateNotificationsParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, GetAnalyticsParams, GetAnalyticsHealthParams, SetupAnalyticsParams, CreateCollectionParams, UpdateCollectionParams, DeleteCollectionParams, GetCollectionParams, GetCollectionsParams, GenerateBlocksParams, GetEntriesParams, CreateEntryParams, UpdateEntryParams, DeleteCollectionEntryParams, GetCollectionEntryParams, SendEntryParams, GetVariableMetadataParams, 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,
|
|
1
|
+
import { UpdateUserProfileParams, RequestOptions, UpdateProfilePhoneParams, VerifyPhoneCodeParams, GetMeParams, SearchUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, LogoutParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, CreateSubscriptionParams, UpdateSubscriptionParams, CancelSubscriptionParams, ReactivateSubscriptionParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, SetProviderScheduleParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, CreateRoleParams, UpdateRoleParams, DeleteRoleParams, GetRoleParams, GetRolesParams, GetNotificationsParams, UpdateNotificationsParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, GetAnalyticsParams, GetAnalyticsHealthParams, SetupAnalyticsParams, 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';
|
|
2
2
|
export { ApiResponse, Block, Business, EshopCartItem, EshopStoreState, Price, ReservationCartPart, ReservationStoreState } from './types.js';
|
|
3
3
|
import { g as getGalleryThumbnail, a as getBlockLabel, b as getBlockTextValue, f as formatBlockValue, p as prepareBlocksForSubmission, e as extractBlockValues, c as getMarketPrice, d as getPriceAmount, h as formatPayment, i as formatMinor, j as createPaymentForCheckout, k as getCurrencySymbol, v as validatePhoneNumber, l as findTimeZone, s as slugify, m as humanize, n as categorify, o as formatDate, q as getSvgContentForAstro, r as fetchSvgContent, t as injectSvgIntoElement } from './svg-BhIM4HZW.js';
|
|
4
4
|
|
|
@@ -26,7 +26,7 @@ interface HttpClientConfig {
|
|
|
26
26
|
isAuthenticated?: () => boolean;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
declare const SDK_VERSION = "0.3.
|
|
29
|
+
declare const SDK_VERSION = "0.3.24";
|
|
30
30
|
declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
|
|
31
31
|
interface ApiConfig {
|
|
32
32
|
httpClient: any;
|
|
@@ -47,7 +47,7 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
47
47
|
verifyPhoneCode(params: VerifyPhoneCodeParams, options?: RequestOptions): Promise<any>;
|
|
48
48
|
getMe(params: GetMeParams, options?: RequestOptions): Promise<any>;
|
|
49
49
|
searchUsers(params: SearchUsersParams, options?: RequestOptions): Promise<any>;
|
|
50
|
-
|
|
50
|
+
setRole(params: SetRoleParams, options?: RequestOptions): Promise<any>;
|
|
51
51
|
loginUser(params: LoginUserParams, options?: RequestOptions): Promise<any>;
|
|
52
52
|
registerUser(params: RegisterUserParams, options?: RequestOptions): Promise<any>;
|
|
53
53
|
logout(params: LogoutParams, options?: RequestOptions): Promise<any>;
|
|
@@ -122,6 +122,9 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
122
122
|
getCollectionEntry(params: GetCollectionEntryParams, options?: RequestOptions): Promise<any>;
|
|
123
123
|
sendEntry(params: SendEntryParams, options?: RequestOptions): Promise<any>;
|
|
124
124
|
getVariableMetadata(params: GetVariableMetadataParams, options?: RequestOptions): Promise<any>;
|
|
125
|
+
getCollectionSubscribers(params: GetCollectionSubscribersParams, options?: RequestOptions): Promise<any>;
|
|
126
|
+
subscribeToCollection(params: SubscribeToCollectionParams, options?: RequestOptions): Promise<any>;
|
|
127
|
+
unsubscribeFromCollection(params: UnsubscribeFromCollectionParams, options?: RequestOptions): Promise<any>;
|
|
125
128
|
};
|
|
126
129
|
eshop: {
|
|
127
130
|
createProduct(params: CreateProductParams, options?: RequestOptions): Promise<any>;
|
|
@@ -160,17 +163,6 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
160
163
|
getProviders(params: GetProvidersParams, options?: RequestOptions): Promise<any>;
|
|
161
164
|
getProviderWorkingTime(params: GetBusinessServiceWorkingTimeParams, options?: RequestOptions): Promise<any>;
|
|
162
165
|
};
|
|
163
|
-
newsletter: {
|
|
164
|
-
find(params: NewsletterFindParams, options?: RequestOptions): Promise<any>;
|
|
165
|
-
get(params: NewsletterGetParams, options?: RequestOptions): Promise<any>;
|
|
166
|
-
create(params: CreateNewsletterParams, options?: RequestOptions): Promise<any>;
|
|
167
|
-
update(params: UpdateNewsletterParams, options?: RequestOptions): Promise<any>;
|
|
168
|
-
delete(params: DeleteNewsletterParams, options?: RequestOptions): Promise<any>;
|
|
169
|
-
getSubscribers(params: GetSubscribersParams, options?: RequestOptions): Promise<any>;
|
|
170
|
-
subscribe(params: NewsletterSubscribeParams, options?: RequestOptions): Promise<any>;
|
|
171
|
-
unsubscribe(params: UnsubscribeParams, options?: RequestOptions): Promise<any>;
|
|
172
|
-
unsubscribeWithToken(params: UnsubscribeParams, options?: RequestOptions): Promise<any>;
|
|
173
|
-
};
|
|
174
166
|
payment: {
|
|
175
167
|
handleStripeWebhook(params: HandleStripeWebhookParams, options?: RequestOptions): Promise<any>;
|
|
176
168
|
getBusinessMarkets(params: GetBusinessMarketsParams, options?: RequestOptions): Promise<any>;
|
package/dist/index.js
CHANGED
|
@@ -204,7 +204,7 @@ var createUserApi = (apiConfig) => {
|
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
206
|
},
|
|
207
|
-
async
|
|
207
|
+
async setRole(params, options) {
|
|
208
208
|
return apiConfig.httpClient.put("/v1/users/set-role", params, options);
|
|
209
209
|
},
|
|
210
210
|
// ===== AUTHENTICATION =====
|
|
@@ -402,7 +402,11 @@ var createRoleApi = (apiConfig) => {
|
|
|
402
402
|
return apiConfig.httpClient.post(`/v1/roles`, params, options);
|
|
403
403
|
},
|
|
404
404
|
async updateRole(params, options) {
|
|
405
|
-
return apiConfig.httpClient.put(
|
|
405
|
+
return apiConfig.httpClient.put(
|
|
406
|
+
`/v1/roles/${params.id}`,
|
|
407
|
+
params,
|
|
408
|
+
options
|
|
409
|
+
);
|
|
406
410
|
},
|
|
407
411
|
async deleteRole(params, options) {
|
|
408
412
|
return apiConfig.httpClient.delete(`/v1/roles/${params.id}`, options);
|
|
@@ -414,7 +418,7 @@ var createRoleApi = (apiConfig) => {
|
|
|
414
418
|
return apiConfig.httpClient.get(`/v1/roles`, {
|
|
415
419
|
...options,
|
|
416
420
|
params: {
|
|
417
|
-
|
|
421
|
+
action: params.action,
|
|
418
422
|
businessId: apiConfig.businessId
|
|
419
423
|
}
|
|
420
424
|
});
|
|
@@ -610,7 +614,7 @@ var createCmsApi = (apiConfig) => {
|
|
|
610
614
|
{
|
|
611
615
|
businessId: apiConfig.businessId,
|
|
612
616
|
entryId,
|
|
613
|
-
scheduledAt: scheduledAt
|
|
617
|
+
scheduledAt: scheduledAt ?? Math.floor(Date.now() / 1e3)
|
|
614
618
|
},
|
|
615
619
|
options
|
|
616
620
|
);
|
|
@@ -621,6 +625,30 @@ var createCmsApi = (apiConfig) => {
|
|
|
621
625
|
`/v1/collections/entry-types/${params.entryType}/variables`,
|
|
622
626
|
options
|
|
623
627
|
);
|
|
628
|
+
},
|
|
629
|
+
// ===== COLLECTION SUBSCRIPTIONS =====
|
|
630
|
+
async getCollectionSubscribers(params, options) {
|
|
631
|
+
return apiConfig.httpClient.get(
|
|
632
|
+
`/v1/businesses/${apiConfig.businessId}/collections/${params.id}/subscribers`,
|
|
633
|
+
options
|
|
634
|
+
);
|
|
635
|
+
},
|
|
636
|
+
async subscribeToCollection(params, options) {
|
|
637
|
+
return apiConfig.httpClient.post(
|
|
638
|
+
`/v1/businesses/${apiConfig.businessId}/collections/${params.collectionId}/subscribe`,
|
|
639
|
+
{
|
|
640
|
+
email: params.email,
|
|
641
|
+
market: apiConfig.market,
|
|
642
|
+
planId: params.planId
|
|
643
|
+
},
|
|
644
|
+
options
|
|
645
|
+
);
|
|
646
|
+
},
|
|
647
|
+
async unsubscribeFromCollection(params, options) {
|
|
648
|
+
return apiConfig.httpClient.get(`/v1/businesses/${apiConfig.businessId}/collections/unsubscribe`, {
|
|
649
|
+
...options,
|
|
650
|
+
params
|
|
651
|
+
});
|
|
624
652
|
}
|
|
625
653
|
};
|
|
626
654
|
};
|
|
@@ -915,55 +943,6 @@ var createReservationApi = (apiConfig) => {
|
|
|
915
943
|
};
|
|
916
944
|
};
|
|
917
945
|
|
|
918
|
-
// src/api/newsletter.ts
|
|
919
|
-
var createNewsletterApi = (apiConfig) => {
|
|
920
|
-
return {
|
|
921
|
-
// ===== NEWSLETTERS =====
|
|
922
|
-
async find(params, options) {
|
|
923
|
-
return apiConfig.httpClient.get(`/v1/newsletters`, {
|
|
924
|
-
...options,
|
|
925
|
-
params: { businessId: apiConfig.businessId }
|
|
926
|
-
});
|
|
927
|
-
},
|
|
928
|
-
async get(params, options) {
|
|
929
|
-
return apiConfig.httpClient.get(`/v1/newsletters/${params.id}`, options);
|
|
930
|
-
},
|
|
931
|
-
async create(params, options) {
|
|
932
|
-
return apiConfig.httpClient.post(`/v1/newsletters`, params, options);
|
|
933
|
-
},
|
|
934
|
-
async update(params, options) {
|
|
935
|
-
return apiConfig.httpClient.put(`/v1/newsletters/${params.id}`, params, options);
|
|
936
|
-
},
|
|
937
|
-
async delete(params, options) {
|
|
938
|
-
return apiConfig.httpClient.delete(`/v1/newsletters/${params.id}`, options);
|
|
939
|
-
},
|
|
940
|
-
// ===== SUBSCRIBERS =====
|
|
941
|
-
async getSubscribers(params, options) {
|
|
942
|
-
return apiConfig.httpClient.get(`/v1/newsletters/${params.id}/subscribers`, options);
|
|
943
|
-
},
|
|
944
|
-
async subscribe(params, options) {
|
|
945
|
-
const payload = {
|
|
946
|
-
...params,
|
|
947
|
-
market: apiConfig.market
|
|
948
|
-
};
|
|
949
|
-
return apiConfig.httpClient.post(
|
|
950
|
-
`/v1/newsletters/${params.newsletterId}/subscribe`,
|
|
951
|
-
payload,
|
|
952
|
-
options
|
|
953
|
-
);
|
|
954
|
-
},
|
|
955
|
-
async unsubscribe(params, options) {
|
|
956
|
-
return apiConfig.httpClient.post(`/v1/newsletters/unsubscribe`, params, options);
|
|
957
|
-
},
|
|
958
|
-
async unsubscribeWithToken(params, options) {
|
|
959
|
-
return apiConfig.httpClient.get(`/v1/newsletters/unsubscribe`, {
|
|
960
|
-
...options,
|
|
961
|
-
params
|
|
962
|
-
});
|
|
963
|
-
}
|
|
964
|
-
};
|
|
965
|
-
};
|
|
966
|
-
|
|
967
946
|
// src/api/payment.ts
|
|
968
947
|
var createPaymentApi = (apiConfig) => {
|
|
969
948
|
return {
|
|
@@ -1515,7 +1494,7 @@ async function injectSvgIntoElement(mediaObject, targetElement, className) {
|
|
|
1515
1494
|
}
|
|
1516
1495
|
|
|
1517
1496
|
// src/index.ts
|
|
1518
|
-
var SDK_VERSION = "0.3.
|
|
1497
|
+
var SDK_VERSION = "0.3.24";
|
|
1519
1498
|
var SUPPORTED_FRAMEWORKS = [
|
|
1520
1499
|
"astro",
|
|
1521
1500
|
"react",
|
|
@@ -1551,7 +1530,6 @@ function createArkySDK(config) {
|
|
|
1551
1530
|
cms: createCmsApi(apiConfig),
|
|
1552
1531
|
eshop: createEshopApi(apiConfig),
|
|
1553
1532
|
reservation: createReservationApi(apiConfig),
|
|
1554
|
-
newsletter: createNewsletterApi(apiConfig),
|
|
1555
1533
|
payment: createPaymentApi(apiConfig),
|
|
1556
1534
|
setBusinessId: (businessId) => {
|
|
1557
1535
|
apiConfig.businessId = businessId;
|