arky-sdk 0.2.0 → 0.3.0

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/stores.d.cts DELETED
@@ -1,214 +0,0 @@
1
- import { A as ArkyConfig } from './config-B7Oy_bdX.cjs';
2
- import * as nanostores from 'nanostores';
3
- import { Business, Market, Zone, ShippingMethod, PaymentProviderConfig, EshopCartItem, Payment, Quote, Block, PaymentMethod, Price, ReservationCartPart } from './types.cjs';
4
-
5
- declare const businessStore: nanostores.DeepMapStore<{
6
- data: Business | null;
7
- loading: boolean;
8
- error: string | null;
9
- initialized: boolean;
10
- }>;
11
- declare const selectedMarket: nanostores.ReadableAtom<Market>;
12
- declare const currency: nanostores.ReadableAtom<string>;
13
- declare const currencySymbol: nanostores.ReadableAtom<string>;
14
- declare const markets: nanostores.ReadableAtom<Market[]>;
15
- declare const zones: nanostores.ReadableAtom<Zone[]>;
16
- declare const getZoneByCountry: (countryCode: string) => Zone | null;
17
- declare const getShippingMethodsForCountry: (countryCode: string) => ShippingMethod[];
18
- declare const paymentMethods: nanostores.ReadableAtom<any[]>;
19
- declare const paymentConfig: nanostores.ReadableAtom<{
20
- provider: PaymentProviderConfig;
21
- enabled: boolean;
22
- }>;
23
- declare const orderBlocks: nanostores.ReadableAtom<any[]>;
24
- declare const reservationBlocks: nanostores.ReadableAtom<any[]>;
25
- declare const businessActions: {
26
- init(): Promise<void>;
27
- reset(): void;
28
- getBusiness(): Promise<Business | null>;
29
- };
30
-
31
- declare const cartItems: nanostores.WritableAtom<EshopCartItem[]>;
32
- declare const promoCodeAtom: nanostores.PreinitializedWritableAtom<string> & object;
33
- declare const quoteAtom: nanostores.PreinitializedWritableAtom<Quote> & object;
34
- declare const store$1: nanostores.DeepMapStore<{
35
- selectedShippingMethodId: any;
36
- shippingLocation: any;
37
- userToken: any;
38
- processingCheckout: boolean;
39
- loading: boolean;
40
- error: any;
41
- phoneNumber: string;
42
- phoneError: any;
43
- verificationCode: string;
44
- verifyError: any;
45
- fetchingQuote: boolean;
46
- quoteError: any;
47
- }>;
48
- declare const cartTotal: nanostores.ReadableAtom<Payment>;
49
- declare const cartItemCount: nanostores.ReadableAtom<number>;
50
-
51
- declare const allowedPaymentMethods: nanostores.ReadableAtom<any[]>;
52
- declare const actions$1: {
53
- addItem(product: any, variant: any, quantity?: number): void;
54
- updateQuantity(itemId: string, newQuantity: number): void;
55
- removeItem(itemId: string): void;
56
- clearCart(): void;
57
- getGuestToken(): Promise<string>;
58
- prepareOrderItems(): {
59
- productId: string;
60
- variantId: string;
61
- quantity: number;
62
- }[];
63
- getOrderInfoBlocks(): Block[];
64
- checkout(paymentMethod?: PaymentMethod, orderInfoBlocks?: Block[], promoCode?: string | null): Promise<{
65
- success: boolean;
66
- error: string;
67
- data?: undefined;
68
- } | {
69
- success: boolean;
70
- data: {
71
- orderId: any;
72
- orderNumber: any;
73
- clientSecret: any;
74
- };
75
- error?: undefined;
76
- }>;
77
- updateProfilePhone(): Promise<boolean>;
78
- verifyPhoneCode(): Promise<boolean>;
79
- formatPrice(priceOrPayment: Price | Payment): string;
80
- getCartPayment(): Payment;
81
- getAvailablePaymentMethods(): PaymentMethod[];
82
- getShippingMethodsForCountry(countryCode: string): ShippingMethod[];
83
- fetchQuote(promoCode?: string | null): Promise<void>;
84
- applyPromoCode(code: string): Promise<void>;
85
- removePromoCode(): Promise<void>;
86
- };
87
- declare function initEshopStore(): void;
88
-
89
- declare const cartParts: nanostores.WritableAtom<ReservationCartPart[]>;
90
- declare const store: nanostores.DeepMapStore<{
91
- currentStep: number;
92
- totalSteps: number;
93
- steps: {
94
- 1: {
95
- name: string;
96
- labelKey: string;
97
- };
98
- 2: {
99
- name: string;
100
- labelKey: string;
101
- };
102
- 3: {
103
- name: string;
104
- labelKey: string;
105
- };
106
- 4: {
107
- name: string;
108
- labelKey: string;
109
- };
110
- };
111
- weekdays: string[];
112
- monthYear: string;
113
- days: any[];
114
- current: Date;
115
- selectedDate: any;
116
- slots: any[];
117
- selectedSlot: any;
118
- selectedMethod: any;
119
- selectedProvider: any;
120
- providers: any[];
121
- loading: boolean;
122
- startDate: any;
123
- endDate: any;
124
- isMultiDay: boolean;
125
- phoneNumber: string;
126
- phoneError: any;
127
- phoneSuccess: any;
128
- verificationCode: string;
129
- verifyError: any;
130
- isPhoneVerified: boolean;
131
- isSendingCode: boolean;
132
- isVerifying: boolean;
133
- codeSentAt: any;
134
- canResendAt: any;
135
- fetchingQuote: boolean;
136
- quote: any;
137
- quoteError: any;
138
- guestToken: any;
139
- service: any;
140
- timezone: string;
141
- tzGroups: {
142
- label: string;
143
- zones: {
144
- label: string;
145
- value: string;
146
- }[];
147
- }[];
148
- parts: any[];
149
- }>;
150
- declare const currentStepName: nanostores.ReadableAtom<any>;
151
- declare const canProceed: nanostores.ReadableAtom<boolean>;
152
- declare const actions: {
153
- updateCalendarGrid(): void;
154
- updateCalendar(): void;
155
- prevMonth(): void;
156
- nextMonth(): void;
157
- setService(service: any): void;
158
- determineTotalSteps(): number;
159
- getGuestToken(): Promise<string>;
160
- getStepNumberByName(name: string): number | null;
161
- nextStep(): void;
162
- prevStep(): void;
163
- clearCurrentStepState(): void;
164
- goToStep(step: number): void;
165
- handleMethodSelection(method: string, advance?: boolean): Promise<void>;
166
- handleOrderMethod(): void;
167
- loadProviders(): Promise<void>;
168
- selectProvider(provider: any): void;
169
- fetchAvailability(type: string, date?: string | Date | null): Promise<void>;
170
- findFirstAvailable(): void;
171
- selectDate(cell: any): void;
172
- createMultiDaySlot(): void;
173
- resetDateSelection(): void;
174
- selectTimeSlot(slot: any): void;
175
- setSelectedTimeZone(zone: string): void;
176
- isAvailable(cell: any): boolean;
177
- isSelectedDay(cell: any): boolean;
178
- isInSelectedRange(cell: any): boolean;
179
- formatDateDisplay(ds: string | null): string;
180
- addToCart(slot: any): void;
181
- removePart(id: string): void;
182
- validatePhoneNumber(phone: string): boolean;
183
- updateProfilePhone(): Promise<boolean>;
184
- verifyPhoneCode(): Promise<boolean>;
185
- checkout(paymentMethod?: PaymentMethod, reservationBlocks?: Block[], promoCode?: string): Promise<{
186
- success: boolean;
187
- data: {
188
- reservationId: any;
189
- clientSecret: any;
190
- };
191
- error?: undefined;
192
- } | {
193
- success: boolean;
194
- error: any;
195
- data?: undefined;
196
- }>;
197
- fetchQuote(paymentMethod?: PaymentMethod, promoCode?: string): Promise<void>;
198
- getLabel(block: any, locale?: string): string;
199
- getServicePrice(): string;
200
- getReservationPayment(): Payment;
201
- };
202
- declare function initReservationStore(): void;
203
-
204
- declare const totalCartItems: nanostores.ReadableAtom<number>;
205
- declare const hasEshopItems: nanostores.ReadableAtom<boolean>;
206
- declare const hasReservationItems: nanostores.ReadableAtom<boolean>;
207
- declare const isCartEmpty: nanostores.ReadableAtom<boolean>;
208
- declare const showEshopSection: nanostores.ReadableAtom<boolean>;
209
- declare const showReservationSection: nanostores.ReadableAtom<boolean>;
210
- declare const showBothSections: nanostores.ReadableAtom<boolean>;
211
-
212
- declare function initArky(config: ArkyConfig): ArkyConfig;
213
-
214
- export { allowedPaymentMethods, businessActions, businessStore, canProceed, cartItemCount, cartItems, cartParts, cartTotal, currency, currencySymbol, currentStepName, actions$1 as eshopActions, store$1 as eshopStore, getShippingMethodsForCountry, getZoneByCountry, hasEshopItems, hasReservationItems, initArky, initEshopStore, initReservationStore, isCartEmpty, markets, orderBlocks, paymentConfig, paymentMethods, promoCodeAtom, quoteAtom, actions as reservationActions, reservationBlocks, store as reservationStore, selectedMarket, showBothSections, showEshopSection, showReservationSection, totalCartItems, zones };
package/dist/stores.d.ts DELETED
@@ -1,214 +0,0 @@
1
- import { A as ArkyConfig } from './config-B7Oy_bdX.js';
2
- import * as nanostores from 'nanostores';
3
- import { Business, Market, Zone, ShippingMethod, PaymentProviderConfig, EshopCartItem, Payment, Quote, Block, PaymentMethod, Price, ReservationCartPart } from './types.js';
4
-
5
- declare const businessStore: nanostores.DeepMapStore<{
6
- data: Business | null;
7
- loading: boolean;
8
- error: string | null;
9
- initialized: boolean;
10
- }>;
11
- declare const selectedMarket: nanostores.ReadableAtom<Market>;
12
- declare const currency: nanostores.ReadableAtom<string>;
13
- declare const currencySymbol: nanostores.ReadableAtom<string>;
14
- declare const markets: nanostores.ReadableAtom<Market[]>;
15
- declare const zones: nanostores.ReadableAtom<Zone[]>;
16
- declare const getZoneByCountry: (countryCode: string) => Zone | null;
17
- declare const getShippingMethodsForCountry: (countryCode: string) => ShippingMethod[];
18
- declare const paymentMethods: nanostores.ReadableAtom<any[]>;
19
- declare const paymentConfig: nanostores.ReadableAtom<{
20
- provider: PaymentProviderConfig;
21
- enabled: boolean;
22
- }>;
23
- declare const orderBlocks: nanostores.ReadableAtom<any[]>;
24
- declare const reservationBlocks: nanostores.ReadableAtom<any[]>;
25
- declare const businessActions: {
26
- init(): Promise<void>;
27
- reset(): void;
28
- getBusiness(): Promise<Business | null>;
29
- };
30
-
31
- declare const cartItems: nanostores.WritableAtom<EshopCartItem[]>;
32
- declare const promoCodeAtom: nanostores.PreinitializedWritableAtom<string> & object;
33
- declare const quoteAtom: nanostores.PreinitializedWritableAtom<Quote> & object;
34
- declare const store$1: nanostores.DeepMapStore<{
35
- selectedShippingMethodId: any;
36
- shippingLocation: any;
37
- userToken: any;
38
- processingCheckout: boolean;
39
- loading: boolean;
40
- error: any;
41
- phoneNumber: string;
42
- phoneError: any;
43
- verificationCode: string;
44
- verifyError: any;
45
- fetchingQuote: boolean;
46
- quoteError: any;
47
- }>;
48
- declare const cartTotal: nanostores.ReadableAtom<Payment>;
49
- declare const cartItemCount: nanostores.ReadableAtom<number>;
50
-
51
- declare const allowedPaymentMethods: nanostores.ReadableAtom<any[]>;
52
- declare const actions$1: {
53
- addItem(product: any, variant: any, quantity?: number): void;
54
- updateQuantity(itemId: string, newQuantity: number): void;
55
- removeItem(itemId: string): void;
56
- clearCart(): void;
57
- getGuestToken(): Promise<string>;
58
- prepareOrderItems(): {
59
- productId: string;
60
- variantId: string;
61
- quantity: number;
62
- }[];
63
- getOrderInfoBlocks(): Block[];
64
- checkout(paymentMethod?: PaymentMethod, orderInfoBlocks?: Block[], promoCode?: string | null): Promise<{
65
- success: boolean;
66
- error: string;
67
- data?: undefined;
68
- } | {
69
- success: boolean;
70
- data: {
71
- orderId: any;
72
- orderNumber: any;
73
- clientSecret: any;
74
- };
75
- error?: undefined;
76
- }>;
77
- updateProfilePhone(): Promise<boolean>;
78
- verifyPhoneCode(): Promise<boolean>;
79
- formatPrice(priceOrPayment: Price | Payment): string;
80
- getCartPayment(): Payment;
81
- getAvailablePaymentMethods(): PaymentMethod[];
82
- getShippingMethodsForCountry(countryCode: string): ShippingMethod[];
83
- fetchQuote(promoCode?: string | null): Promise<void>;
84
- applyPromoCode(code: string): Promise<void>;
85
- removePromoCode(): Promise<void>;
86
- };
87
- declare function initEshopStore(): void;
88
-
89
- declare const cartParts: nanostores.WritableAtom<ReservationCartPart[]>;
90
- declare const store: nanostores.DeepMapStore<{
91
- currentStep: number;
92
- totalSteps: number;
93
- steps: {
94
- 1: {
95
- name: string;
96
- labelKey: string;
97
- };
98
- 2: {
99
- name: string;
100
- labelKey: string;
101
- };
102
- 3: {
103
- name: string;
104
- labelKey: string;
105
- };
106
- 4: {
107
- name: string;
108
- labelKey: string;
109
- };
110
- };
111
- weekdays: string[];
112
- monthYear: string;
113
- days: any[];
114
- current: Date;
115
- selectedDate: any;
116
- slots: any[];
117
- selectedSlot: any;
118
- selectedMethod: any;
119
- selectedProvider: any;
120
- providers: any[];
121
- loading: boolean;
122
- startDate: any;
123
- endDate: any;
124
- isMultiDay: boolean;
125
- phoneNumber: string;
126
- phoneError: any;
127
- phoneSuccess: any;
128
- verificationCode: string;
129
- verifyError: any;
130
- isPhoneVerified: boolean;
131
- isSendingCode: boolean;
132
- isVerifying: boolean;
133
- codeSentAt: any;
134
- canResendAt: any;
135
- fetchingQuote: boolean;
136
- quote: any;
137
- quoteError: any;
138
- guestToken: any;
139
- service: any;
140
- timezone: string;
141
- tzGroups: {
142
- label: string;
143
- zones: {
144
- label: string;
145
- value: string;
146
- }[];
147
- }[];
148
- parts: any[];
149
- }>;
150
- declare const currentStepName: nanostores.ReadableAtom<any>;
151
- declare const canProceed: nanostores.ReadableAtom<boolean>;
152
- declare const actions: {
153
- updateCalendarGrid(): void;
154
- updateCalendar(): void;
155
- prevMonth(): void;
156
- nextMonth(): void;
157
- setService(service: any): void;
158
- determineTotalSteps(): number;
159
- getGuestToken(): Promise<string>;
160
- getStepNumberByName(name: string): number | null;
161
- nextStep(): void;
162
- prevStep(): void;
163
- clearCurrentStepState(): void;
164
- goToStep(step: number): void;
165
- handleMethodSelection(method: string, advance?: boolean): Promise<void>;
166
- handleOrderMethod(): void;
167
- loadProviders(): Promise<void>;
168
- selectProvider(provider: any): void;
169
- fetchAvailability(type: string, date?: string | Date | null): Promise<void>;
170
- findFirstAvailable(): void;
171
- selectDate(cell: any): void;
172
- createMultiDaySlot(): void;
173
- resetDateSelection(): void;
174
- selectTimeSlot(slot: any): void;
175
- setSelectedTimeZone(zone: string): void;
176
- isAvailable(cell: any): boolean;
177
- isSelectedDay(cell: any): boolean;
178
- isInSelectedRange(cell: any): boolean;
179
- formatDateDisplay(ds: string | null): string;
180
- addToCart(slot: any): void;
181
- removePart(id: string): void;
182
- validatePhoneNumber(phone: string): boolean;
183
- updateProfilePhone(): Promise<boolean>;
184
- verifyPhoneCode(): Promise<boolean>;
185
- checkout(paymentMethod?: PaymentMethod, reservationBlocks?: Block[], promoCode?: string): Promise<{
186
- success: boolean;
187
- data: {
188
- reservationId: any;
189
- clientSecret: any;
190
- };
191
- error?: undefined;
192
- } | {
193
- success: boolean;
194
- error: any;
195
- data?: undefined;
196
- }>;
197
- fetchQuote(paymentMethod?: PaymentMethod, promoCode?: string): Promise<void>;
198
- getLabel(block: any, locale?: string): string;
199
- getServicePrice(): string;
200
- getReservationPayment(): Payment;
201
- };
202
- declare function initReservationStore(): void;
203
-
204
- declare const totalCartItems: nanostores.ReadableAtom<number>;
205
- declare const hasEshopItems: nanostores.ReadableAtom<boolean>;
206
- declare const hasReservationItems: nanostores.ReadableAtom<boolean>;
207
- declare const isCartEmpty: nanostores.ReadableAtom<boolean>;
208
- declare const showEshopSection: nanostores.ReadableAtom<boolean>;
209
- declare const showReservationSection: nanostores.ReadableAtom<boolean>;
210
- declare const showBothSections: nanostores.ReadableAtom<boolean>;
211
-
212
- declare function initArky(config: ArkyConfig): ArkyConfig;
213
-
214
- export { allowedPaymentMethods, businessActions, businessStore, canProceed, cartItemCount, cartItems, cartParts, cartTotal, currency, currencySymbol, currentStepName, actions$1 as eshopActions, store$1 as eshopStore, getShippingMethodsForCountry, getZoneByCountry, hasEshopItems, hasReservationItems, initArky, initEshopStore, initReservationStore, isCartEmpty, markets, orderBlocks, paymentConfig, paymentMethods, promoCodeAtom, quoteAtom, actions as reservationActions, reservationBlocks, store as reservationStore, selectedMarket, showBothSections, showEshopSection, showReservationSection, totalCartItems, zones };