arky-sdk 0.3.39 → 0.3.41
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 +35 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -9
- package/dist/index.d.ts +3 -9
- package/dist/index.js +35 -46
- package/dist/index.js.map +1 -1
- package/dist/types.d.cts +4 -15
- package/dist/types.d.ts +4 -15
- package/package.json +1 -1
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,
|
|
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, 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 } 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.
|
|
25
|
+
declare const SDK_VERSION = "0.3.41";
|
|
26
26
|
declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
|
|
27
27
|
interface ApiConfig {
|
|
28
28
|
httpClient: any;
|
|
@@ -65,8 +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
|
-
|
|
69
|
-
cancelSubscription(params: CancelSubscriptionParams, options?: RequestOptions): Promise<any>;
|
|
68
|
+
subscribe(params: SubscribeParams, options?: RequestOptions): Promise<any>;
|
|
70
69
|
createPortalSession(params: CreatePortalSessionParams, options?: RequestOptions): Promise<any>;
|
|
71
70
|
inviteUser(params: InviteUserParams, options?: RequestOptions): Promise<any>;
|
|
72
71
|
handleInvitation(params: HandleInvitationParams, options?: RequestOptions): Promise<any>;
|
|
@@ -156,11 +155,6 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
156
155
|
getProviders(params: GetProvidersParams, options?: RequestOptions): Promise<any>;
|
|
157
156
|
getProviderWorkingTime(params: GetBusinessServiceWorkingTimeParams, options?: RequestOptions): Promise<any>;
|
|
158
157
|
};
|
|
159
|
-
payment: {
|
|
160
|
-
handleStripeWebhook(params: HandleStripeWebhookParams, options?: RequestOptions): Promise<any>;
|
|
161
|
-
getBusinessMarkets(params: GetBusinessMarketsParams, options?: RequestOptions): Promise<any>;
|
|
162
|
-
getBusinessMarket(params: GetBusinessMarketParams, options?: RequestOptions): Promise<any>;
|
|
163
|
-
};
|
|
164
158
|
setBusinessId: (businessId: string) => void;
|
|
165
159
|
getBusinessId: () => string;
|
|
166
160
|
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,
|
|
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, 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 } 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.
|
|
25
|
+
declare const SDK_VERSION = "0.3.41";
|
|
26
26
|
declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
|
|
27
27
|
interface ApiConfig {
|
|
28
28
|
httpClient: any;
|
|
@@ -65,8 +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
|
-
|
|
69
|
-
cancelSubscription(params: CancelSubscriptionParams, options?: RequestOptions): Promise<any>;
|
|
68
|
+
subscribe(params: SubscribeParams, options?: RequestOptions): Promise<any>;
|
|
70
69
|
createPortalSession(params: CreatePortalSessionParams, options?: RequestOptions): Promise<any>;
|
|
71
70
|
inviteUser(params: InviteUserParams, options?: RequestOptions): Promise<any>;
|
|
72
71
|
handleInvitation(params: HandleInvitationParams, options?: RequestOptions): Promise<any>;
|
|
@@ -156,11 +155,6 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
156
155
|
getProviders(params: GetProvidersParams, options?: RequestOptions): Promise<any>;
|
|
157
156
|
getProviderWorkingTime(params: GetBusinessServiceWorkingTimeParams, options?: RequestOptions): Promise<any>;
|
|
158
157
|
};
|
|
159
|
-
payment: {
|
|
160
|
-
handleStripeWebhook(params: HandleStripeWebhookParams, options?: RequestOptions): Promise<any>;
|
|
161
|
-
getBusinessMarkets(params: GetBusinessMarketsParams, options?: RequestOptions): Promise<any>;
|
|
162
|
-
getBusinessMarket(params: GetBusinessMarketParams, options?: RequestOptions): Promise<any>;
|
|
163
|
-
};
|
|
164
158
|
setBusinessId: (businessId: string) => void;
|
|
165
159
|
getBusinessId: () => string;
|
|
166
160
|
setMarket: (market: string) => void;
|
package/dist/index.js
CHANGED
|
@@ -274,42 +274,56 @@ 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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
315
|
+
return apiConfig.httpClient.get(
|
|
316
|
+
`/v1/businesses/${apiConfig.businessId}/subscription`,
|
|
317
|
+
options
|
|
318
|
+
);
|
|
299
319
|
},
|
|
300
|
-
async
|
|
320
|
+
async subscribe(params, options) {
|
|
301
321
|
return apiConfig.httpClient.put(
|
|
302
|
-
`/v1/businesses/${apiConfig.businessId}/
|
|
322
|
+
`/v1/businesses/${apiConfig.businessId}/subscribe`,
|
|
303
323
|
params,
|
|
304
324
|
options
|
|
305
325
|
);
|
|
306
326
|
},
|
|
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
327
|
async createPortalSession(params, options) {
|
|
314
328
|
return apiConfig.httpClient.post(
|
|
315
329
|
`/v1/businesses/${apiConfig.businessId}/subscription/portal`,
|
|
@@ -339,16 +353,13 @@ var createBusinessApi = (apiConfig) => {
|
|
|
339
353
|
);
|
|
340
354
|
},
|
|
341
355
|
async getBusinessMedia(params, options) {
|
|
342
|
-
return apiConfig.httpClient.get(
|
|
343
|
-
|
|
344
|
-
{
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
cursor: params.cursor,
|
|
348
|
-
limit: params.limit || 20
|
|
349
|
-
}
|
|
356
|
+
return apiConfig.httpClient.get(`/v1/businesses/${params.id}/media`, {
|
|
357
|
+
...options,
|
|
358
|
+
params: {
|
|
359
|
+
cursor: params.cursor,
|
|
360
|
+
limit: params.limit || 20
|
|
350
361
|
}
|
|
351
|
-
);
|
|
362
|
+
});
|
|
352
363
|
},
|
|
353
364
|
async setProviderSchedule(params, options) {
|
|
354
365
|
const { id, ...payload } = params;
|
|
@@ -1171,27 +1182,6 @@ var createReservationApi = (apiConfig) => {
|
|
|
1171
1182
|
};
|
|
1172
1183
|
};
|
|
1173
1184
|
|
|
1174
|
-
// src/api/payment.ts
|
|
1175
|
-
var createPaymentApi = (apiConfig) => {
|
|
1176
|
-
return {
|
|
1177
|
-
async handleStripeWebhook(params, options) {
|
|
1178
|
-
return apiConfig.httpClient.post(`/v1/payments/webhooks/stripe`, params, options);
|
|
1179
|
-
},
|
|
1180
|
-
async getBusinessMarkets(params, options) {
|
|
1181
|
-
return apiConfig.httpClient.get(
|
|
1182
|
-
`/v1/payments/businesses/${apiConfig.businessId}/markets`,
|
|
1183
|
-
options
|
|
1184
|
-
);
|
|
1185
|
-
},
|
|
1186
|
-
async getBusinessMarket(params, options) {
|
|
1187
|
-
return apiConfig.httpClient.get(
|
|
1188
|
-
`/v1/payments/businesses/${apiConfig.businessId}/markets/${params.marketId}`,
|
|
1189
|
-
options
|
|
1190
|
-
);
|
|
1191
|
-
}
|
|
1192
|
-
};
|
|
1193
|
-
};
|
|
1194
|
-
|
|
1195
1185
|
// src/utils/currency.ts
|
|
1196
1186
|
function getCurrencySymbol(currency) {
|
|
1197
1187
|
const currencySymbols = {
|
|
@@ -1540,7 +1530,7 @@ async function injectSvgIntoElement(mediaObject, targetElement, className) {
|
|
|
1540
1530
|
}
|
|
1541
1531
|
|
|
1542
1532
|
// src/index.ts
|
|
1543
|
-
var SDK_VERSION = "0.3.
|
|
1533
|
+
var SDK_VERSION = "0.3.41";
|
|
1544
1534
|
var SUPPORTED_FRAMEWORKS = [
|
|
1545
1535
|
"astro",
|
|
1546
1536
|
"react",
|
|
@@ -1578,7 +1568,6 @@ function createArkySDK(config) {
|
|
|
1578
1568
|
cms: createCmsApi(apiConfig),
|
|
1579
1569
|
eshop: createEshopApi(apiConfig),
|
|
1580
1570
|
reservation: createReservationApi(apiConfig),
|
|
1581
|
-
payment: createPaymentApi(apiConfig),
|
|
1582
1571
|
setBusinessId: (businessId) => {
|
|
1583
1572
|
apiConfig.businessId = businessId;
|
|
1584
1573
|
},
|