arky-sdk 0.3.61 → 0.3.63
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 +12 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +12 -25
- package/dist/index.js.map +1 -1
- package/dist/{svg-D_ajyHnG.d.cts → svg-3F_m7296.d.cts} +1 -1
- package/dist/{svg-WKQadzp2.d.ts → svg-4hIdMU6f.d.ts} +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +3 -2
- package/dist/types.d.ts +3 -2
- package/dist/types.js.map +1 -1
- package/dist/utils.cjs +6 -20
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +6 -20
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UpdateUserProfileParams, RequestOptions, 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, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, SearchReservationsParams, SearchMyReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, GetAvailableSlotsParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams } 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, UpdateOrderStatusParams, UpdateOrderPaymentStatusParams, GetQuoteParams, CheckoutParams, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, 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, ReservationCartItem, ReservationStoreState } from './types.cjs';
|
|
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-
|
|
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-3F_m7296.cjs';
|
|
4
4
|
|
|
5
5
|
interface AuthTokens {
|
|
6
6
|
accessToken: string;
|
|
@@ -12,7 +12,6 @@ interface AuthTokens {
|
|
|
12
12
|
}
|
|
13
13
|
interface HttpClientConfig {
|
|
14
14
|
baseUrl: string;
|
|
15
|
-
storageUrl?: string;
|
|
16
15
|
businessId: string;
|
|
17
16
|
getToken: () => Promise<AuthTokens> | AuthTokens;
|
|
18
17
|
setToken: (tokens: AuthTokens) => void;
|
|
@@ -23,12 +22,11 @@ interface HttpClientConfig {
|
|
|
23
22
|
isAuthenticated?: () => boolean;
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
declare const SDK_VERSION = "0.3.
|
|
25
|
+
declare const SDK_VERSION = "0.3.63";
|
|
27
26
|
declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
|
|
28
27
|
interface ApiConfig {
|
|
29
28
|
httpClient: any;
|
|
30
29
|
businessId: string;
|
|
31
|
-
storageUrl: string;
|
|
32
30
|
baseUrl: string;
|
|
33
31
|
market: string;
|
|
34
32
|
locale: string;
|
|
@@ -42,6 +40,7 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
42
40
|
}): {
|
|
43
41
|
user: {
|
|
44
42
|
updateUser(params: UpdateUserProfileParams, options?: RequestOptions): Promise<any>;
|
|
43
|
+
deleteUser(params: DeleteUserParams, options?: RequestOptions): Promise<any>;
|
|
45
44
|
addPhoneNumber(params: AddPhoneNumberParams, options?: RequestOptions): Promise<any>;
|
|
46
45
|
phoneNumberConfirm(params: PhoneNumberConfirmParams, options?: RequestOptions): Promise<any>;
|
|
47
46
|
getMe(params: GetMeParams, options?: RequestOptions): Promise<any>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UpdateUserProfileParams, RequestOptions, 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, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, SearchReservationsParams, SearchMyReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, GetAvailableSlotsParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams } 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, UpdateOrderStatusParams, UpdateOrderPaymentStatusParams, GetQuoteParams, CheckoutParams, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, 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, ReservationCartItem, ReservationStoreState } from './types.js';
|
|
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-
|
|
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-4hIdMU6f.js';
|
|
4
4
|
|
|
5
5
|
interface AuthTokens {
|
|
6
6
|
accessToken: string;
|
|
@@ -12,7 +12,6 @@ interface AuthTokens {
|
|
|
12
12
|
}
|
|
13
13
|
interface HttpClientConfig {
|
|
14
14
|
baseUrl: string;
|
|
15
|
-
storageUrl?: string;
|
|
16
15
|
businessId: string;
|
|
17
16
|
getToken: () => Promise<AuthTokens> | AuthTokens;
|
|
18
17
|
setToken: (tokens: AuthTokens) => void;
|
|
@@ -23,12 +22,11 @@ interface HttpClientConfig {
|
|
|
23
22
|
isAuthenticated?: () => boolean;
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
declare const SDK_VERSION = "0.3.
|
|
25
|
+
declare const SDK_VERSION = "0.3.63";
|
|
27
26
|
declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
|
|
28
27
|
interface ApiConfig {
|
|
29
28
|
httpClient: any;
|
|
30
29
|
businessId: string;
|
|
31
|
-
storageUrl: string;
|
|
32
30
|
baseUrl: string;
|
|
33
31
|
market: string;
|
|
34
32
|
locale: string;
|
|
@@ -42,6 +40,7 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
42
40
|
}): {
|
|
43
41
|
user: {
|
|
44
42
|
updateUser(params: UpdateUserProfileParams, options?: RequestOptions): Promise<any>;
|
|
43
|
+
deleteUser(params: DeleteUserParams, options?: RequestOptions): Promise<any>;
|
|
45
44
|
addPhoneNumber(params: AddPhoneNumberParams, options?: RequestOptions): Promise<any>;
|
|
46
45
|
phoneNumberConfirm(params: PhoneNumberConfirmParams, options?: RequestOptions): Promise<any>;
|
|
47
46
|
getMe(params: GetMeParams, options?: RequestOptions): Promise<any>;
|
package/dist/index.js
CHANGED
|
@@ -214,6 +214,9 @@ var createUserApi = (apiConfig) => {
|
|
|
214
214
|
if (params.apiTokens !== void 0) payload.apiTokens = params.apiTokens;
|
|
215
215
|
return apiConfig.httpClient.put("/v1/users", payload, options);
|
|
216
216
|
},
|
|
217
|
+
async deleteUser(params, options) {
|
|
218
|
+
return apiConfig.httpClient.delete("/v1/users", options);
|
|
219
|
+
},
|
|
217
220
|
async addPhoneNumber(params, options) {
|
|
218
221
|
return apiConfig.httpClient.post("/v1/users/phone-number", params, options);
|
|
219
222
|
},
|
|
@@ -680,44 +683,30 @@ var getBlockFromArray = (entry, blockKey, locale = "en") => {
|
|
|
680
683
|
return acc;
|
|
681
684
|
});
|
|
682
685
|
};
|
|
683
|
-
var getImageUrl = (imageBlock, isBlock = true
|
|
686
|
+
var getImageUrl = (imageBlock, isBlock = true) => {
|
|
684
687
|
if (!imageBlock) return null;
|
|
685
|
-
const isExternalUrl = (url) => {
|
|
686
|
-
return url.startsWith("http://") || url.startsWith("https://");
|
|
687
|
-
};
|
|
688
688
|
if (imageBlock.type === "RELATIONSHIP" && Array.isArray(imageBlock.value)) {
|
|
689
689
|
const mediaValue = imageBlock.value[0];
|
|
690
690
|
if (mediaValue && mediaValue.mimeType) {
|
|
691
691
|
if (mediaValue.resolutions && mediaValue.resolutions.original && mediaValue.resolutions.original.url) {
|
|
692
|
-
|
|
693
|
-
return isExternalUrl(url) ? url : `${storageUrl}/${url}`;
|
|
692
|
+
return mediaValue.resolutions.original.url;
|
|
694
693
|
}
|
|
695
694
|
if (mediaValue.url) {
|
|
696
|
-
return
|
|
695
|
+
return mediaValue.url;
|
|
697
696
|
}
|
|
698
697
|
}
|
|
699
698
|
return null;
|
|
700
699
|
}
|
|
701
700
|
if (isBlock) {
|
|
702
701
|
if (typeof imageBlock === "string") {
|
|
703
|
-
|
|
704
|
-
return imageBlock;
|
|
705
|
-
}
|
|
706
|
-
return `${storageUrl}/${imageBlock}`;
|
|
702
|
+
return imageBlock;
|
|
707
703
|
}
|
|
708
704
|
if (imageBlock.url) {
|
|
709
|
-
|
|
710
|
-
return imageBlock.url;
|
|
711
|
-
}
|
|
712
|
-
return `${storageUrl}/${imageBlock.url}`;
|
|
705
|
+
return imageBlock.url;
|
|
713
706
|
}
|
|
714
707
|
}
|
|
715
708
|
if (imageBlock.resolutions && imageBlock.resolutions.original && imageBlock.resolutions.original.url) {
|
|
716
|
-
|
|
717
|
-
if (isExternalUrl(url)) {
|
|
718
|
-
return url;
|
|
719
|
-
}
|
|
720
|
-
return `${storageUrl}/${url}`;
|
|
709
|
+
return imageBlock.resolutions.original.url;
|
|
721
710
|
}
|
|
722
711
|
return null;
|
|
723
712
|
};
|
|
@@ -762,7 +751,7 @@ var createCmsApi = (apiConfig) => {
|
|
|
762
751
|
},
|
|
763
752
|
getImage(key) {
|
|
764
753
|
const block = getBlockFromArray(response, key, apiConfig.locale);
|
|
765
|
-
return getImageUrl(block, true
|
|
754
|
+
return getImageUrl(block, true);
|
|
766
755
|
}
|
|
767
756
|
};
|
|
768
757
|
},
|
|
@@ -1523,7 +1512,7 @@ async function injectSvgIntoElement(mediaObject, targetElement, className) {
|
|
|
1523
1512
|
}
|
|
1524
1513
|
|
|
1525
1514
|
// src/index.ts
|
|
1526
|
-
var SDK_VERSION = "0.3.
|
|
1515
|
+
var SDK_VERSION = "0.3.63";
|
|
1527
1516
|
var SUPPORTED_FRAMEWORKS = [
|
|
1528
1517
|
"astro",
|
|
1529
1518
|
"react",
|
|
@@ -1537,11 +1526,9 @@ function createArkySDK(config) {
|
|
|
1537
1526
|
`[Arky SDK v${SDK_VERSION}] Initializing with market: ${config.market}, businessId: ${config.businessId}, locale: ${locale}`
|
|
1538
1527
|
);
|
|
1539
1528
|
const httpClient = createHttpClient(config);
|
|
1540
|
-
const storageUrl = config.storageUrl || "https://storage.arky.io/dev";
|
|
1541
1529
|
const apiConfig = {
|
|
1542
1530
|
httpClient,
|
|
1543
1531
|
businessId: config.businessId,
|
|
1544
|
-
storageUrl,
|
|
1545
1532
|
baseUrl: config.baseUrl,
|
|
1546
1533
|
market: config.market,
|
|
1547
1534
|
locale,
|
|
@@ -1578,7 +1565,7 @@ function createArkySDK(config) {
|
|
|
1578
1565
|
setToken: config.setToken,
|
|
1579
1566
|
utils: {
|
|
1580
1567
|
// Block utilities
|
|
1581
|
-
getImageUrl: (imageBlock, isBlock = true) => getImageUrl(imageBlock, isBlock
|
|
1568
|
+
getImageUrl: (imageBlock, isBlock = true) => getImageUrl(imageBlock, isBlock),
|
|
1582
1569
|
getBlockValue,
|
|
1583
1570
|
getBlockValues,
|
|
1584
1571
|
getBlockLabel,
|