arky-sdk 0.2.0 → 0.3.1

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,268 +1,412 @@
1
- import { A as ArkyConfig } from './config-B7Oy_bdX.cjs';
2
- export { g as getGlobalConfig, s as setGlobalConfig } from './config-B7Oy_bdX.cjs';
3
- import { ApiResponse, Quote, PaginatedResponse, Newsletter, Payment } from './types.cjs';
4
- export { Block, Business, BusinessConfig, BusinessPaymentMethod, EshopCartItem, EshopStoreState, Location, Market, MarketConfigClient, PaymentMethod, PaymentProviderConfig, Price, PromoCodeValidation, QuoteLineItem, ReservationCartPart, ReservationStoreState, ShippingMethod, Zone } from './types.cjs';
5
- export { C as Collection, w as CollectionEntry, E as ERROR_CODES, u as ERROR_CONSTANTS, R as RequestError, S as ServerError, V as ValidationError, W as ValidationResult, m as categorify, H as convertServerErrorToRequestError, J as convertToMajor, K as convertToMinor, U as createPaymentForCheckout, I as errors, z as extractBlockValues, i as fetchSvgContent, o as findTimeZone, x as formatBlockValue, N as formatCurrencyAmount, n as formatDate, O as formatMinor, P as formatPayment, B as getBlockFromArray, g as getBlockLabel, A as getBlockObjectValues, d as getBlockTextValue, e as getBlockValue, f as getBlockValues, M as getCurrencyFromMarket, q as getErrorMessage, D as getGalleryThumbnail, h as getImageUrl, Q as getMarketPrice, T as getPriceAmount, j as getSvgContentForAstro, L as getSymbol, l as humanize, k as injectSvgIntoElement, r as isErrorCode, y as prepareBlocksForSubmission, s as slugify, t as thumbnailUrl, G as transformErrors, F as translateMap, p as tzGroups, a as validateEmail, v as validatePhoneNumber, c as validateRequired, b as validateVerificationCode } from './validation-C9UAYKke.cjs';
1
+ import { CreateCollectionParams, RequestOptions, UpdateCollectionParams, DeleteCollectionParams, GetCollectionParams, GetCollectionsParams, GetEntriesParams, CreateEntryParams, UpdateEntryParams, DeleteCollectionEntryParams, GetCollectionEntryParams, SendEntryParams, GetVariableMetadataParams, CreateProductParams, UpdateProductParams, GetProductParams, GetProductsParams, GetProductBySlugParams, 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, NewsletterFindParams, NewsletterGetParams, CreateNewsletterParams, UpdateNewsletterParams, DeleteNewsletterParams, GetSubscribersParams, NewsletterSubscribeParams, UnsubscribeParams, UpdateUserProfileParams, UpdateProfilePhoneParams, VerifyPhoneCodeParams, GetUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionParams, CreateSubscriptionParams, UpdateSubscriptionParams, CancelSubscriptionParams, ReactivateSubscriptionParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, CreateRoleParams, UpdateRoleParams, DeleteRoleParams, GetRoleParams, GetRolesParams, GetNotificationsParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, GetAnalyticsParams, GetAnalyticsHealthParams, SetupAnalyticsParams, HandleStripeWebhookParams, GetBusinessMarketsParams, GetBusinessMarketParams } from './types.cjs';
2
+ export { ApiResponse, ApplyPromoCodeParams, Block, Business, BusinessConfig, BusinessPaymentMethod, CreateCollectionEntryParams, DeleteEntryParams, DeleteProductParams, EshopCartItem, EshopItem, EshopStoreState, GenerateBlocksParams, GetAllProductsParams, GetAllServicesParams, GetCollectionEntriesParams, GetEntryParams, GetInvoiceParams, GetPermissionsParams, GetPromoCodeByCodeParams, GetProvidersByServiceParams, GetRoleParentsParams, GetUserLocationParams, Location, LogoutParams, Market, MarketConfigClient, Newsletter, OAuthLoginParams, PaginatedResponse, Payment, PaymentMethod, PaymentProviderConfig, Price, PromoCodeValidation, Quote, QuoteLineItem, ReservationCartPart, ReservationConfirmParams, ReservationStoreState, ScheduleSetParams, SearchAvailableSlotsParams, ShippingMethod, UpdatePromoCodeStatusParams, UpdateUserParams, ValidatePromoCodeParams, Zone } from './types.cjs';
3
+ import { g as getGalleryThumbnail, a as getMarketPrice, b as getPriceAmount, f as formatPayment, c as formatMinor, d as createPaymentForCheckout, e as getCurrencySymbol, v as validatePhoneNumber, h as findTimeZone } from './index-DOEos-hV.cjs';
4
+ export { C as Collection, i as CollectionEntry, E as ERROR_CODES, x as ERROR_CONSTANTS, R as RequestError, S as SYMBOL_AFTER_CURRENCIES, y as ServerError, V as ValidationError, U as ValidationResult, P as categorify, D as convertServerErrorToRequestError, G as convertToMajor, H as convertToMinor, F as errors, l as extractBlockValues, K as fetchSvgContent, k as formatBlockValue, J as formatCurrencyAmount, Q as formatDate, r as getBlockFromArray, j as getBlockLabel, q as getBlockObjectValues, m as getBlockTextValue, n as getBlockValue, o as getBlockValues, I as getCurrencyFromMarket, z as getErrorMessage, s as getImageUrl, L as getSvgContentForAstro, O as humanize, M as injectSvgIntoElement, A as isErrorCode, w as isSymbolAfterCurrency, p as prepareBlocksForSubmission, N as slugify, t as thumbnailUrl, B as transformErrors, u as translateMap, T as tzGroups, W as validateEmail, Y as validateRequired, X as validateVerificationCode } from './index-DOEos-hV.cjs';
6
5
 
7
- /**
8
- * Query parameter builder utility that maintains exact backward compatibility
9
- * with existing API parameter encoding patterns
10
- */
11
- interface QueryParams {
12
- [key: string]: string | number | boolean | string[] | number[] | null | undefined;
13
- }
6
+ declare const createCmsApi: (apiConfig: ApiConfig) => {
7
+ createCollection(params: CreateCollectionParams, options?: RequestOptions): Promise<any>;
8
+ updateCollection(params: UpdateCollectionParams, options?: RequestOptions): Promise<any>;
9
+ deleteCollection(params: DeleteCollectionParams, options?: RequestOptions): Promise<any>;
10
+ getCollection(params: GetCollectionParams, options?: RequestOptions): Promise<any>;
11
+ getCollections(params?: GetCollectionsParams, options?: RequestOptions): Promise<any>;
12
+ generateBlocks(params: any, options?: RequestOptions): Promise<any>;
13
+ getCollectionEntries(params?: GetEntriesParams, options?: RequestOptions): Promise<any>;
14
+ createCollectionEntry(params: CreateEntryParams, options?: RequestOptions): Promise<any>;
15
+ updateCollectionEntry(params: UpdateEntryParams, options?: RequestOptions): Promise<any>;
16
+ deleteCollectionEntry(params: DeleteCollectionEntryParams, options?: RequestOptions): Promise<any>;
17
+ getCollectionEntry(params: GetCollectionEntryParams, options?: RequestOptions): Promise<any>;
18
+ sendEntry(params: SendEntryParams, options?: RequestOptions): Promise<any>;
19
+ getVariableMetadata(params: GetVariableMetadataParams, options?: RequestOptions): Promise<any>;
20
+ };
14
21
 
15
- interface HttpOptions {
16
- successMessage?: string;
17
- errorMessage?: string;
18
- schema?: any;
19
- params?: QueryParams;
20
- }
21
- interface HttpResponse<T = any> {
22
- value: T;
23
- success: boolean;
24
- error?: string;
25
- }
26
- declare function get<T = any>(url: string, options?: HttpOptions): Promise<HttpResponse<T>>;
27
- declare function post<T = any>(url: string, data: any, options?: HttpOptions): Promise<HttpResponse<T>>;
28
- declare const httpClient: {
29
- get: typeof get;
30
- post: typeof post;
22
+ declare const createEshopApi: (apiConfig: ApiConfig) => {
23
+ createProduct(params: CreateProductParams, options?: RequestOptions): Promise<any>;
24
+ updateProduct(params: UpdateProductParams, options?: RequestOptions): Promise<any>;
25
+ deleteProduct(id: string, options?: RequestOptions): Promise<any>;
26
+ getProduct(params: GetProductParams, options?: RequestOptions): Promise<any>;
27
+ getProducts(params?: GetProductsParams, options?: RequestOptions): Promise<any>;
28
+ getProductBySlug(params: GetProductBySlugParams, options?: RequestOptions): Promise<any>;
29
+ createOrder(params: CreateOrderParams, options?: RequestOptions): Promise<any>;
30
+ updateOrder(params: UpdateOrderParams, options?: RequestOptions): Promise<any>;
31
+ getOrder(params: GetOrderParams, options?: RequestOptions): Promise<any>;
32
+ getOrders(params?: GetOrdersParams, options?: RequestOptions): Promise<any>;
33
+ updateOrderStatus(params: UpdateOrderStatusParams, options?: RequestOptions): Promise<any>;
34
+ updateOrderPaymentStatus(params: UpdateOrderPaymentStatusParams, options?: RequestOptions): Promise<any>;
35
+ getQuote(params: GetQuoteParams, options?: RequestOptions): Promise<any>;
36
+ checkout(params: CheckoutParams, options?: RequestOptions): Promise<any>;
31
37
  };
32
38
 
33
- declare const cmsApi: {
34
- getCollection: (id: string) => Promise<any>;
35
- getCollections: ({ name, ids }: {
36
- name?: string | null;
37
- ids?: string[] | null;
38
- }) => Promise<any>;
39
- getCollectionEntries: ({ collectionId, limit, cursor, ids }: {
40
- collectionId: string;
39
+ declare const createReservationApi: (apiConfig: ApiConfig) => {
40
+ createReservation(params: CreateReservationParams, options?: RequestOptions): Promise<any>;
41
+ updateReservation(params: UpdateReservationParams, options?: RequestOptions): Promise<any>;
42
+ checkout(params: ReservationCheckoutParams, options?: RequestOptions): Promise<any>;
43
+ getReservation(params: GetReservationParams, options?: RequestOptions): Promise<any>;
44
+ getReservationParts(params?: GetReservationPartsParams, options?: RequestOptions): Promise<any>;
45
+ searchReservations(params: SearchReservationsParams, options?: RequestOptions): Promise<any>;
46
+ searchMyReservations(params?: SearchMyReservationsParams, options?: RequestOptions): Promise<any>;
47
+ getQuote(params: GetReservationQuoteParams, options?: RequestOptions): Promise<any>;
48
+ createService(params: CreateServiceParams, options?: RequestOptions): Promise<any>;
49
+ updateService(params: UpdateServiceParams, options?: RequestOptions): Promise<any>;
50
+ deleteService(params: DeleteServiceParams, options?: RequestOptions): Promise<any>;
51
+ getService(params: GetServiceParams, options?: RequestOptions): Promise<any>;
52
+ getServices(params?: GetServicesParams, options?: RequestOptions): Promise<any>;
53
+ getAvailableSlots(params: GetAvailableSlotsParams, options?: RequestOptions): Promise<any>;
54
+ createProvider(params: CreateProviderParams, options?: RequestOptions): Promise<any>;
55
+ updateProvider(params: UpdateProviderParams, options?: RequestOptions): Promise<any>;
56
+ deleteProvider(params: DeleteProviderParams, options?: RequestOptions): Promise<any>;
57
+ getProvider(params: GetProviderParams, options?: RequestOptions): Promise<any>;
58
+ getProviders(params: GetProvidersParams, options?: RequestOptions): Promise<any>;
59
+ getProviderWorkingTime(params: GetBusinessServiceWorkingTimeParams, options?: RequestOptions): Promise<any>;
60
+ };
61
+
62
+ declare const createNewsletterApi: (apiConfig: ApiConfig) => {
63
+ find(params: NewsletterFindParams, options?: RequestOptions): Promise<any>;
64
+ get(params: NewsletterGetParams, options?: RequestOptions): Promise<any>;
65
+ create(params: CreateNewsletterParams, options?: RequestOptions): Promise<any>;
66
+ update(params: UpdateNewsletterParams, options?: RequestOptions): Promise<any>;
67
+ delete(params: DeleteNewsletterParams, options?: RequestOptions): Promise<any>;
68
+ getSubscribers(params: GetSubscribersParams, options?: RequestOptions): Promise<any>;
69
+ subscribe(params: NewsletterSubscribeParams, options?: RequestOptions): Promise<any>;
70
+ unsubscribe(params: UnsubscribeParams, options?: RequestOptions): Promise<any>;
71
+ unsubscribeWithToken(params: UnsubscribeParams, options?: RequestOptions): Promise<any>;
72
+ };
73
+
74
+ declare const createUserApi: (apiConfig: ApiConfig) => {
75
+ updateUser(params: UpdateUserProfileParams, options?: RequestOptions): Promise<any>;
76
+ updateProfilePhone(params: UpdateProfilePhoneParams, options?: RequestOptions): Promise<any>;
77
+ verifyPhoneCode(params: VerifyPhoneCodeParams, options?: RequestOptions): Promise<any>;
78
+ getUserLocation(options?: RequestOptions): Promise<any>;
79
+ getMe(options?: RequestOptions): Promise<any>;
80
+ searchUsers(params: GetUsersParams, options?: RequestOptions): Promise<any>;
81
+ setUserRole(params: SetRoleParams, options?: RequestOptions): Promise<any>;
82
+ loginUser(params: LoginUserParams, options?: RequestOptions): Promise<any>;
83
+ registerUser(params: RegisterUserParams, options?: RequestOptions): Promise<any>;
84
+ logout(options?: RequestOptions): Promise<any>;
85
+ confirmUser(params: ConfirmUserParams, options?: RequestOptions): Promise<any>;
86
+ getLoginUrl(params: GetLoginUrlParams, options?: RequestOptions): Promise<any>;
87
+ getGuestToken(params: {
88
+ existingToken?: string;
89
+ }, options?: RequestOptions): Promise<string>;
90
+ forgotPassword(params: ForgotPasswordParams, options?: RequestOptions): Promise<any>;
91
+ resetForgotPassword(params: ResetForgotPasswordParams, options?: RequestOptions): Promise<any>;
92
+ resetPassword(params: ResetPasswordParams, options?: RequestOptions): Promise<any>;
93
+ };
94
+
95
+ declare const createBusinessApi: (apiConfig: ApiConfig) => {
96
+ createBusiness(params: CreateBusinessParams, options?: RequestOptions): Promise<any>;
97
+ updateBusiness(params: UpdateBusinessParams, options?: RequestOptions): Promise<any>;
98
+ deleteBusiness(params: DeleteBusinessParams, options?: RequestOptions): Promise<any>;
99
+ getBusiness(params: GetBusinessParams, options?: RequestOptions): Promise<any>;
100
+ getBusinesses(options?: RequestOptions): Promise<any>;
101
+ getBusinessParents(params: GetBusinessParentsParams, options?: RequestOptions): Promise<any>;
102
+ triggerBuilds(params: TriggerBuildsParams, options?: RequestOptions): Promise<any>;
103
+ getSubscriptionPlans(options?: RequestOptions): Promise<any>;
104
+ getSubscription(params: GetSubscriptionParams, options?: RequestOptions): Promise<any>;
105
+ createSubscription(params: CreateSubscriptionParams, options?: RequestOptions): Promise<any>;
106
+ updateSubscription(params: UpdateSubscriptionParams, options?: RequestOptions): Promise<any>;
107
+ cancelSubscription(params: CancelSubscriptionParams, options?: RequestOptions): Promise<any>;
108
+ reactivateSubscription(params: ReactivateSubscriptionParams, options?: RequestOptions): Promise<any>;
109
+ createPortalSession(params: CreatePortalSessionParams, options?: RequestOptions): Promise<any>;
110
+ inviteUser(params: InviteUserParams, options?: RequestOptions): Promise<any>;
111
+ handleInvitation(params: HandleInvitationParams, options?: RequestOptions): Promise<any>;
112
+ testWebhook(params: TestWebhookParams, options?: RequestOptions): Promise<any>;
113
+ getBusinessMedia(params: {
114
+ id: string;
115
+ cursor?: string | null;
41
116
  limit?: number;
42
- cursor?: string;
43
- ids?: string[] | null;
44
- }) => Promise<any>;
45
- getCollectionEntry: ({ collectionId, id }: {
46
- collectionId: string;
117
+ }, options?: RequestOptions): Promise<any>;
118
+ setProviderSchedule(params: {
47
119
  id: string;
48
- }) => Promise<HttpResponse<any>>;
49
- createCollectionEntry: (collectionEntryData: any) => Promise<HttpResponse<any>>;
120
+ workingTime: any;
121
+ serviceIds: string[];
122
+ providerIds: string[];
123
+ }, options?: RequestOptions): Promise<any>;
50
124
  };
51
125
 
52
- declare const eshopApi: {
53
- getProducts({ businessId, categoryIds, status, limit, cursor }: {
54
- businessId: string;
55
- categoryIds?: string[] | null;
56
- status?: string;
57
- limit?: number;
58
- cursor?: string | null;
59
- }): Promise<{
60
- success: boolean;
61
- data: any;
62
- cursor: any;
63
- total: any;
64
- error?: undefined;
65
- } | {
66
- success: boolean;
67
- error: string;
68
- data: any[];
69
- cursor?: undefined;
70
- total?: undefined;
71
- }>;
72
- getProductBySlug({ businessId, slug }: {
73
- businessId: string;
74
- slug: string;
75
- }): Promise<{
76
- success: boolean;
77
- data: any;
78
- error?: undefined;
79
- } | {
80
- success: boolean;
81
- error: any;
82
- data: any;
83
- }>;
84
- getQuote({ token, businessId, items, market, currency, userId, paymentMethod, shippingMethodId, promoCode }: {
85
- token: string;
86
- businessId: string;
87
- items: {
88
- productId: string;
89
- variantId: string;
90
- quantity: number;
91
- }[];
92
- market: string;
93
- currency: string;
94
- userId: string;
95
- paymentMethod: string;
96
- shippingMethodId?: string;
97
- promoCode?: string;
98
- }): Promise<ApiResponse<Quote>>;
99
- checkout({ token, businessId, items, paymentMethod, blocks, market, shippingMethodId, promoCode, paymentIntentId }: {
100
- token: string;
101
- businessId: string;
102
- items: any[];
103
- paymentMethod: string;
104
- blocks: any[];
105
- market?: string;
106
- shippingMethodId?: string;
107
- promoCode?: string;
108
- paymentIntentId?: string | null;
109
- }): Promise<{
110
- success: boolean;
111
- error: any;
112
- code: any;
113
- data?: undefined;
114
- } | {
115
- success: boolean;
116
- data: any;
117
- error?: undefined;
118
- code?: undefined;
119
- } | {
120
- success: boolean;
121
- error: any;
122
- code?: undefined;
123
- data?: undefined;
124
- }>;
125
- createPaymentIntent({ amount, currency, businessId }: {
126
- amount: number;
127
- currency: string;
128
- businessId: string;
129
- }): Promise<{
130
- success: boolean;
131
- data: any;
132
- error?: undefined;
133
- } | {
134
- success: boolean;
135
- error: any;
136
- data?: undefined;
137
- }>;
126
+ declare const createMediaApi: (apiConfig: ApiConfig) => {
127
+ uploadBusinessMedia(params: UploadBusinessMediaParams): Promise<any>;
128
+ deleteBusinessMedia(params: DeleteBusinessMediaParams, options?: RequestOptions): Promise<any>;
129
+ getBusinessMedia(params: GetBusinessMediaParams): Promise<any>;
138
130
  };
139
131
 
140
- declare const reservationApi: {
141
- getQuote({ token, businessId, market, currency, userId, parts, paymentMethod, promoCode, }: {
142
- token: string;
143
- businessId: string;
144
- market: string;
145
- currency: string;
146
- userId: string;
147
- parts: any[];
148
- paymentMethod?: string;
149
- promoCode?: string;
150
- }): Promise<ApiResponse<Quote>>;
151
- getAvailableSlots({ businessId, serviceId, from, to, limit, providerId, }: {
152
- businessId: string;
153
- serviceId: string;
154
- from: number;
155
- to: number;
156
- limit?: number;
157
- providerId?: string | null;
158
- }): Promise<{
159
- success: boolean;
160
- data: any;
161
- error?: undefined;
162
- } | {
163
- success: boolean;
164
- error: string;
165
- data: any[];
166
- }>;
167
- getProviders({ businessId, serviceId, limit }: {
168
- businessId: string;
169
- serviceId: string;
170
- limit?: number;
171
- }): Promise<{
172
- success: boolean;
173
- data: any;
174
- error?: undefined;
175
- } | {
176
- success: boolean;
177
- error: string;
178
- data: any[];
179
- }>;
180
- getGuestToken(): Promise<ApiResponse<{
181
- token: string;
182
- }>>;
183
- updateProfilePhone({ token, phoneNumber }: {
184
- token: string;
185
- phoneNumber: string;
186
- }): Promise<{
187
- success: boolean;
188
- error?: undefined;
189
- } | {
190
- success: boolean;
191
- error: any;
192
- }>;
193
- verifyPhoneCode({ token, phoneNumber, code }: {
194
- token: string;
195
- phoneNumber: string;
196
- code: string;
197
- }): Promise<{
198
- success: boolean;
199
- error?: undefined;
200
- } | {
201
- success: boolean;
202
- error: any;
203
- }>;
204
- checkout({ token, businessId, parts, paymentMethod, blocks, market, promoCode }: {
205
- token: string;
206
- businessId: string;
207
- parts: any[];
208
- paymentMethod?: string;
209
- blocks?: any[];
210
- market?: string;
211
- promoCode?: string;
212
- }): Promise<{
213
- success: boolean;
214
- data: any;
215
- error?: undefined;
216
- } | {
217
- success: boolean;
218
- error: any;
219
- data?: undefined;
220
- }>;
132
+ declare const createRoleApi: (apiConfig: ApiConfig) => {
133
+ createRole(params: CreateRoleParams, options?: RequestOptions): Promise<void>;
134
+ updateRole(params: UpdateRoleParams, options?: RequestOptions): Promise<any>;
135
+ deleteRole(params: DeleteRoleParams, options?: RequestOptions): Promise<any>;
136
+ getRole(params: GetRoleParams, options?: RequestOptions): Promise<any>;
137
+ getRoles(params?: GetRolesParams, options?: RequestOptions): Promise<any>;
221
138
  };
222
139
 
223
- interface NewsletterFindPayload {
224
- business_id: string;
225
- }
226
- interface NewsletterSubscribePayload {
227
- newsletterId: string;
228
- email: string;
229
- customerId?: string;
230
- payment?: Payment;
231
- }
232
- declare const newsletterApi: {
233
- find(payload: NewsletterFindPayload): Promise<PaginatedResponse<Newsletter>>;
234
- get(id: string): Promise<Newsletter>;
235
- subscribe(payload: NewsletterSubscribePayload): Promise<{
236
- success: boolean;
237
- data: any;
238
- error?: undefined;
239
- } | {
240
- success: boolean;
241
- error: string;
242
- data?: undefined;
243
- }>;
140
+ declare const createNotificationApi: (apiConfig: ApiConfig) => {
141
+ getNotifications(params: GetNotificationsParams, options?: RequestOptions): Promise<any>;
142
+ updateNotifications(options?: RequestOptions): Promise<any>;
143
+ trackEmailOpen(params: TrackEmailOpenParams, options?: RequestOptions): Promise<any>;
144
+ getDeliveryStats(params: GetDeliveryStatsParams, options?: RequestOptions): Promise<any>;
244
145
  };
245
146
 
246
- declare function getGuestToken(currentToken?: string | null): Promise<string>;
247
- declare function updateProfilePhone(token: string, phoneNumber: string): Promise<{
248
- success: boolean;
249
- }>;
250
- declare function verifyPhoneCode(token: string, phoneNumber: string, code: string): Promise<{
251
- success: boolean;
252
- }>;
253
- declare function getBusinessConfig(businessId: string): Promise<{
254
- success: boolean;
255
- data: any;
256
- error?: undefined;
257
- } | {
258
- success: boolean;
259
- error: any;
260
- data?: undefined;
261
- }>;
147
+ declare const createPromoCodeApi: (apiConfig: ApiConfig) => {
148
+ createPromoCode(params: CreatePromoCodeParams, options?: RequestOptions): Promise<any>;
149
+ updatePromoCode(params: UpdatePromoCodeParams, options?: RequestOptions): Promise<any>;
150
+ deletePromoCode(params: DeletePromoCodeParams, options?: RequestOptions): Promise<any>;
151
+ getPromoCode(params: GetPromoCodeParams, options?: RequestOptions): Promise<any>;
152
+ getPromoCodes(params: GetPromoCodesParams, options?: RequestOptions): Promise<any>;
153
+ };
154
+
155
+ declare const createAnalyticsApi: (apiConfig: ApiConfig) => {
156
+ getAnalytics(params: GetAnalyticsParams, options?: RequestOptions): Promise<any>;
157
+ getAnalyticsHealth(params: GetAnalyticsHealthParams, options?: RequestOptions): Promise<any>;
158
+ setupAnalytics(params: SetupAnalyticsParams, options?: RequestOptions): Promise<any>;
159
+ };
160
+
161
+ declare const createPaymentApi: (apiConfig: ApiConfig) => {
162
+ handleStripeWebhook(params: HandleStripeWebhookParams, options?: RequestOptions): Promise<any>;
163
+ getBusinessMarkets(params: GetBusinessMarketsParams, options?: RequestOptions): Promise<any>;
164
+ getBusinessMarket(params: GetBusinessMarketParams, options?: RequestOptions): Promise<any>;
165
+ };
166
+
167
+ declare function setDefaultLocale(locale: string): void;
168
+ declare function getLocale(): string;
169
+ declare function getLocaleFromUrl(url: URL): string;
170
+ declare function getLocalizedString(value: any, locale?: string): string;
171
+
172
+ /**
173
+ * Query parameter builder utility that maintains exact backward compatibility
174
+ * with existing API parameter encoding patterns
175
+ */
176
+ interface QueryParams {
177
+ [key: string]: string | number | boolean | string[] | number[] | null | undefined;
178
+ }
179
+ /**
180
+ * Builds a query string from parameters following the exact encoding patterns
181
+ * used by the existing API implementation:
182
+ * - Arrays: JSON.stringify then encodeURIComponent
183
+ * - Strings: encodeURIComponent
184
+ * - Numbers: No encoding
185
+ * - Null/undefined: Skip
186
+ */
187
+ declare function buildQueryString(params: QueryParams): string;
188
+ /**
189
+ * Appends query string to a URL
190
+ */
191
+ declare function appendQueryString(url: string, params: QueryParams): string;
262
192
 
263
- declare const SDK_VERSION = "0.2.0";
193
+ interface AuthTokens {
194
+ accessToken: string;
195
+ refreshToken?: string;
196
+ provider?: string;
197
+ expiresAt?: number;
198
+ userId?: string;
199
+ }
200
+ interface HttpClientConfig {
201
+ baseUrl: string;
202
+ storageUrl?: string;
203
+ businessId: string;
204
+ getTokens: () => Promise<AuthTokens> | AuthTokens;
205
+ setTokens: (tokens: AuthTokens) => void;
206
+ autoGuest?: boolean;
207
+ onAuthFailure: () => void;
208
+ navigate?: (path: string) => void;
209
+ loginFallbackPath?: string;
210
+ notify?: (opts: {
211
+ message: string;
212
+ type: 'error' | 'success';
213
+ }) => void;
214
+ isAuthenticated?: () => boolean;
215
+ logout?: () => void;
216
+ setUserToken?: (userToken: any) => void;
217
+ }
218
+
219
+ declare const SDK_VERSION = "0.3.1";
264
220
  declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
221
+ interface ApiConfig {
222
+ httpClient: any;
223
+ businessId: string;
224
+ storageUrl: string;
225
+ baseUrl: string;
226
+ market: string;
227
+ setTokens: (tokens: any) => void;
228
+ getTokens: () => Promise<any> | any;
229
+ }
265
230
 
266
- declare function initArky(config: ArkyConfig): ArkyConfig;
231
+ declare function createArkySDK(config: HttpClientConfig & {
232
+ market?: string;
233
+ }): {
234
+ user: {
235
+ updateUser(params: UpdateUserProfileParams, options?: RequestOptions): Promise<any>;
236
+ updateProfilePhone(params: UpdateProfilePhoneParams, options?: RequestOptions): Promise<any>;
237
+ verifyPhoneCode(params: VerifyPhoneCodeParams, options?: RequestOptions): Promise<any>;
238
+ getUserLocation(options?: RequestOptions): Promise<any>;
239
+ getMe(options?: RequestOptions): Promise<any>;
240
+ searchUsers(params: GetUsersParams, options?: RequestOptions): Promise<any>;
241
+ setUserRole(params: SetRoleParams, options?: RequestOptions): Promise<any>;
242
+ loginUser(params: LoginUserParams, options?: RequestOptions): Promise<any>;
243
+ registerUser(params: RegisterUserParams, options?: RequestOptions): Promise<any>;
244
+ logout(options?: RequestOptions): Promise<any>;
245
+ confirmUser(params: ConfirmUserParams, options?: RequestOptions): Promise<any>;
246
+ getLoginUrl(params: GetLoginUrlParams, options?: RequestOptions): Promise<any>;
247
+ getGuestToken(params: {
248
+ existingToken?: string;
249
+ }, options?: RequestOptions): Promise<string>;
250
+ forgotPassword(params: ForgotPasswordParams, options?: RequestOptions): Promise<any>;
251
+ resetForgotPassword(params: ResetForgotPasswordParams, options?: RequestOptions): Promise<any>;
252
+ resetPassword(params: ResetPasswordParams, options?: RequestOptions): Promise<any>;
253
+ };
254
+ business: {
255
+ createBusiness(params: CreateBusinessParams, options?: RequestOptions): Promise<any>;
256
+ updateBusiness(params: UpdateBusinessParams, options?: RequestOptions): Promise<any>;
257
+ deleteBusiness(params: DeleteBusinessParams, options?: RequestOptions): Promise<any>;
258
+ getBusiness(params: GetBusinessParams, options?: RequestOptions): Promise<any>;
259
+ getBusinesses(options?: RequestOptions): Promise<any>;
260
+ getBusinessParents(params: GetBusinessParentsParams, options?: RequestOptions): Promise<any>;
261
+ triggerBuilds(params: TriggerBuildsParams, options?: RequestOptions): Promise<any>;
262
+ getSubscriptionPlans(options?: RequestOptions): Promise<any>;
263
+ getSubscription(params: GetSubscriptionParams, options?: RequestOptions): Promise<any>;
264
+ createSubscription(params: CreateSubscriptionParams, options?: RequestOptions): Promise<any>;
265
+ updateSubscription(params: UpdateSubscriptionParams, options?: RequestOptions): Promise<any>;
266
+ cancelSubscription(params: CancelSubscriptionParams, options?: RequestOptions): Promise<any>;
267
+ reactivateSubscription(params: ReactivateSubscriptionParams, options?: RequestOptions): Promise<any>;
268
+ createPortalSession(params: CreatePortalSessionParams, options?: RequestOptions): Promise<any>;
269
+ inviteUser(params: InviteUserParams, options?: RequestOptions): Promise<any>;
270
+ handleInvitation(params: HandleInvitationParams, options?: RequestOptions): Promise<any>;
271
+ testWebhook(params: TestWebhookParams, options?: RequestOptions): Promise<any>;
272
+ getBusinessMedia(params: {
273
+ id: string;
274
+ cursor?: string | null;
275
+ limit?: number;
276
+ }, options?: RequestOptions): Promise<any>;
277
+ setProviderSchedule(params: {
278
+ id: string;
279
+ workingTime: any;
280
+ serviceIds: string[];
281
+ providerIds: string[];
282
+ }, options?: RequestOptions): Promise<any>;
283
+ };
284
+ media: {
285
+ uploadBusinessMedia(params: UploadBusinessMediaParams): Promise<any>;
286
+ deleteBusinessMedia(params: DeleteBusinessMediaParams, options?: RequestOptions): Promise<any>;
287
+ getBusinessMedia(params: GetBusinessMediaParams): Promise<any>;
288
+ };
289
+ role: {
290
+ createRole(params: CreateRoleParams, options?: RequestOptions): Promise<void>;
291
+ updateRole(params: UpdateRoleParams, options?: RequestOptions): Promise<any>;
292
+ deleteRole(params: DeleteRoleParams, options?: RequestOptions): Promise<any>;
293
+ getRole(params: GetRoleParams, options?: RequestOptions): Promise<any>;
294
+ getRoles(params?: GetRolesParams, options?: RequestOptions): Promise<any>;
295
+ };
296
+ notification: {
297
+ getNotifications(params: GetNotificationsParams, options?: RequestOptions): Promise<any>;
298
+ updateNotifications(options?: RequestOptions): Promise<any>;
299
+ trackEmailOpen(params: TrackEmailOpenParams, options?: RequestOptions): Promise<any>;
300
+ getDeliveryStats(params: GetDeliveryStatsParams, options?: RequestOptions): Promise<any>;
301
+ };
302
+ promoCode: {
303
+ createPromoCode(params: CreatePromoCodeParams, options?: RequestOptions): Promise<any>;
304
+ updatePromoCode(params: UpdatePromoCodeParams, options?: RequestOptions): Promise<any>;
305
+ deletePromoCode(params: DeletePromoCodeParams, options?: RequestOptions): Promise<any>;
306
+ getPromoCode(params: GetPromoCodeParams, options?: RequestOptions): Promise<any>;
307
+ getPromoCodes(params: GetPromoCodesParams, options?: RequestOptions): Promise<any>;
308
+ };
309
+ analytics: {
310
+ getAnalytics(params: GetAnalyticsParams, options?: RequestOptions): Promise<any>;
311
+ getAnalyticsHealth(params: GetAnalyticsHealthParams, options?: RequestOptions): Promise<any>;
312
+ setupAnalytics(params: SetupAnalyticsParams, options?: RequestOptions): Promise<any>;
313
+ };
314
+ cms: {
315
+ createCollection(params: CreateCollectionParams, options?: RequestOptions): Promise<any>;
316
+ updateCollection(params: UpdateCollectionParams, options?: RequestOptions): Promise<any>;
317
+ deleteCollection(params: DeleteCollectionParams, options?: RequestOptions): Promise<any>;
318
+ getCollection(params: GetCollectionParams, options?: RequestOptions): Promise<any>;
319
+ getCollections(params?: GetCollectionsParams, options?: RequestOptions): Promise<any>;
320
+ generateBlocks(params: any, options?: RequestOptions): Promise<any>;
321
+ getCollectionEntries(params?: GetEntriesParams, options?: RequestOptions): Promise<any>;
322
+ createCollectionEntry(params: CreateEntryParams, options?: RequestOptions): Promise<any>;
323
+ updateCollectionEntry(params: UpdateEntryParams, options?: RequestOptions): Promise<any>;
324
+ deleteCollectionEntry(params: DeleteCollectionEntryParams, options?: RequestOptions): Promise<any>;
325
+ getCollectionEntry(params: GetCollectionEntryParams, options?: RequestOptions): Promise<any>;
326
+ sendEntry(params: SendEntryParams, options?: RequestOptions): Promise<any>;
327
+ getVariableMetadata(params: GetVariableMetadataParams, options?: RequestOptions): Promise<any>;
328
+ };
329
+ eshop: {
330
+ createProduct(params: CreateProductParams, options?: RequestOptions): Promise<any>;
331
+ updateProduct(params: UpdateProductParams, options?: RequestOptions): Promise<any>;
332
+ deleteProduct(id: string, options?: RequestOptions): Promise<any>;
333
+ getProduct(params: GetProductParams, options?: RequestOptions): Promise<any>;
334
+ getProducts(params?: GetProductsParams, options?: RequestOptions): Promise<any>;
335
+ getProductBySlug(params: GetProductBySlugParams, options?: RequestOptions): Promise<any>;
336
+ createOrder(params: CreateOrderParams, options?: RequestOptions): Promise<any>;
337
+ updateOrder(params: UpdateOrderParams, options?: RequestOptions): Promise<any>;
338
+ getOrder(params: GetOrderParams, options?: RequestOptions): Promise<any>;
339
+ getOrders(params?: GetOrdersParams, options?: RequestOptions): Promise<any>;
340
+ updateOrderStatus(params: UpdateOrderStatusParams, options?: RequestOptions): Promise<any>;
341
+ updateOrderPaymentStatus(params: UpdateOrderPaymentStatusParams, options?: RequestOptions): Promise<any>;
342
+ getQuote(params: GetQuoteParams, options?: RequestOptions): Promise<any>;
343
+ checkout(params: CheckoutParams, options?: RequestOptions): Promise<any>;
344
+ };
345
+ reservation: {
346
+ createReservation(params: CreateReservationParams, options?: RequestOptions): Promise<any>;
347
+ updateReservation(params: UpdateReservationParams, options?: RequestOptions): Promise<any>;
348
+ checkout(params: ReservationCheckoutParams, options?: RequestOptions): Promise<any>;
349
+ getReservation(params: GetReservationParams, options?: RequestOptions): Promise<any>;
350
+ getReservationParts(params?: GetReservationPartsParams, options?: RequestOptions): Promise<any>;
351
+ searchReservations(params: SearchReservationsParams, options?: RequestOptions): Promise<any>;
352
+ searchMyReservations(params?: SearchMyReservationsParams, options?: RequestOptions): Promise<any>;
353
+ getQuote(params: GetReservationQuoteParams, options?: RequestOptions): Promise<any>;
354
+ createService(params: CreateServiceParams, options?: RequestOptions): Promise<any>;
355
+ updateService(params: UpdateServiceParams, options?: RequestOptions): Promise<any>;
356
+ deleteService(params: DeleteServiceParams, options?: RequestOptions): Promise<any>;
357
+ getService(params: GetServiceParams, options?: RequestOptions): Promise<any>;
358
+ getServices(params?: GetServicesParams, options?: RequestOptions): Promise<any>;
359
+ getAvailableSlots(params: GetAvailableSlotsParams, options?: RequestOptions): Promise<any>;
360
+ createProvider(params: CreateProviderParams, options?: RequestOptions): Promise<any>;
361
+ updateProvider(params: UpdateProviderParams, options?: RequestOptions): Promise<any>;
362
+ deleteProvider(params: DeleteProviderParams, options?: RequestOptions): Promise<any>;
363
+ getProvider(params: GetProviderParams, options?: RequestOptions): Promise<any>;
364
+ getProviders(params: GetProvidersParams, options?: RequestOptions): Promise<any>;
365
+ getProviderWorkingTime(params: GetBusinessServiceWorkingTimeParams, options?: RequestOptions): Promise<any>;
366
+ };
367
+ newsletter: {
368
+ find(params: NewsletterFindParams, options?: RequestOptions): Promise<any>;
369
+ get(params: NewsletterGetParams, options?: RequestOptions): Promise<any>;
370
+ create(params: CreateNewsletterParams, options?: RequestOptions): Promise<any>;
371
+ update(params: UpdateNewsletterParams, options?: RequestOptions): Promise<any>;
372
+ delete(params: DeleteNewsletterParams, options?: RequestOptions): Promise<any>;
373
+ getSubscribers(params: GetSubscribersParams, options?: RequestOptions): Promise<any>;
374
+ subscribe(params: NewsletterSubscribeParams, options?: RequestOptions): Promise<any>;
375
+ unsubscribe(params: UnsubscribeParams, options?: RequestOptions): Promise<any>;
376
+ unsubscribeWithToken(params: UnsubscribeParams, options?: RequestOptions): Promise<any>;
377
+ };
378
+ payment: {
379
+ handleStripeWebhook(params: HandleStripeWebhookParams, options?: RequestOptions): Promise<any>;
380
+ getBusinessMarkets(params: GetBusinessMarketsParams, options?: RequestOptions): Promise<any>;
381
+ getBusinessMarket(params: GetBusinessMarketParams, options?: RequestOptions): Promise<any>;
382
+ };
383
+ setBusinessId: (businessId: string) => void;
384
+ getBusinessId: () => string;
385
+ auth: {
386
+ isAuthenticated: () => boolean;
387
+ logout: () => void;
388
+ setUserToken: (userToken: any) => void;
389
+ };
390
+ utils: {
391
+ getImageUrl: (imageBlock: any, isBlock?: boolean) => any;
392
+ thumbnailUrl: (service: any) => string;
393
+ getGalleryThumbnail: typeof getGalleryThumbnail;
394
+ getMarketPrice: typeof getMarketPrice;
395
+ getPriceAmount: typeof getPriceAmount;
396
+ formatPayment: typeof formatPayment;
397
+ formatMinor: typeof formatMinor;
398
+ createPaymentForCheckout: typeof createPaymentForCheckout;
399
+ getCurrencySymbol: typeof getCurrencySymbol;
400
+ validatePhoneNumber: typeof validatePhoneNumber;
401
+ tzGroups: {
402
+ label: string;
403
+ zones: {
404
+ label: string;
405
+ value: string;
406
+ }[];
407
+ }[];
408
+ findTimeZone: typeof findTimeZone;
409
+ };
410
+ };
267
411
 
268
- export { ApiResponse, ArkyConfig, Newsletter, PaginatedResponse, Payment, Quote, SDK_VERSION, SUPPORTED_FRAMEWORKS, cmsApi, eshopApi, getBusinessConfig, getGuestToken, httpClient, initArky, newsletterApi, reservationApi, updateProfilePhone, verifyPhoneCode };
412
+ export { type ApiConfig, CancelSubscriptionParams, CheckoutParams, ConfirmUserParams, CreateBusinessParams, CreateCollectionParams, CreateEntryParams, CreateNewsletterParams, CreateOrderParams, CreatePortalSessionParams, CreateProductParams, CreatePromoCodeParams, CreateProviderParams, CreateReservationParams, CreateRoleParams, CreateServiceParams, CreateSubscriptionParams, DeleteBusinessMediaParams, DeleteBusinessParams, DeleteCollectionEntryParams, DeleteCollectionParams, DeleteNewsletterParams, DeletePromoCodeParams, DeleteProviderParams, DeleteRoleParams, DeleteServiceParams, ForgotPasswordParams, GetAnalyticsHealthParams, GetAnalyticsParams, GetAvailableSlotsParams, GetBusinessMarketParams, GetBusinessMarketsParams, GetBusinessMediaParams, GetBusinessParams, GetBusinessParentsParams, GetBusinessServiceWorkingTimeParams, GetCollectionEntryParams, GetCollectionParams, GetCollectionsParams, GetDeliveryStatsParams, GetEntriesParams, GetLoginUrlParams, GetNotificationsParams, GetOrderParams, GetOrdersParams, GetProductBySlugParams, GetProductParams, GetProductsParams, GetPromoCodeParams, GetPromoCodesParams, GetProviderParams, GetProvidersParams, GetQuoteParams, GetReservationParams, GetReservationPartsParams, GetReservationQuoteParams, GetRoleParams, GetRolesParams, GetServiceParams, GetServicesParams, GetSubscribersParams, GetSubscriptionParams, GetUsersParams, GetVariableMetadataParams, HandleInvitationParams, HandleStripeWebhookParams, type HttpClientConfig, InviteUserParams, LoginUserParams, NewsletterFindParams, NewsletterGetParams, NewsletterSubscribeParams, type QueryParams, ReactivateSubscriptionParams, RegisterUserParams, RequestOptions, ReservationCheckoutParams, ResetForgotPasswordParams, ResetPasswordParams, SDK_VERSION, SUPPORTED_FRAMEWORKS, SearchMyReservationsParams, SearchReservationsParams, SendEntryParams, SetRoleParams, SetupAnalyticsParams, TestWebhookParams, TrackEmailOpenParams, TriggerBuildsParams, UnsubscribeParams, UpdateBusinessParams, UpdateCollectionParams, UpdateEntryParams, UpdateNewsletterParams, UpdateOrderParams, UpdateOrderPaymentStatusParams, UpdateOrderStatusParams, UpdateProductParams, UpdateProfilePhoneParams, UpdatePromoCodeParams, UpdateProviderParams, UpdateReservationParams, UpdateRoleParams, UpdateServiceParams, UpdateSubscriptionParams, UpdateUserProfileParams, UploadBusinessMediaParams, VerifyPhoneCodeParams, appendQueryString, buildQueryString, createAnalyticsApi, createArkySDK, createBusinessApi, createCmsApi, createEshopApi, createMediaApi, createNewsletterApi, createNotificationApi, createPaymentApi, createPaymentForCheckout, createPromoCodeApi, createReservationApi, createRoleApi, createUserApi, findTimeZone, formatMinor, formatPayment, getCurrencySymbol, getGalleryThumbnail, getLocale, getLocaleFromUrl, getLocalizedString, getMarketPrice, getPriceAmount, setDefaultLocale, validatePhoneNumber };