@zenky/storefront-vue 0.9.32
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/LICENSE.md +21 -0
- package/README.md +15 -0
- package/dist/cjs/index.js +1913 -0
- package/dist/esm/index.js +1849 -0
- package/dist/zenky.d.ts +1167 -0
- package/package.json +43 -0
package/dist/zenky.d.ts
ADDED
|
@@ -0,0 +1,1167 @@
|
|
|
1
|
+
import { Ref, ComputedRef } from 'vue';
|
|
2
|
+
import * as _zenky_api from '@zenky/api';
|
|
3
|
+
import { PaginationRequest, Pagination, PaginatedResponse, ResourceRequest, Address, City, NestedCategory, ProductsCollection, Feature, FeaturesGroupContainer, Article, ArticleCategory, Customer, AuthenticationPhone, Order, OrderCredentials, CustomerPaymentMethod, Medium, Image, Product, ProductsPricesRange, ProductsPaginationRequest, Schedule, Stock, Store, StoreSettings } from '@zenky/api';
|
|
4
|
+
import * as pinia from 'pinia';
|
|
5
|
+
|
|
6
|
+
declare type ApiErrorHandler = (e: any) => any;
|
|
7
|
+
declare type OptionalApiErrorHandler = ApiErrorHandler | null | undefined;
|
|
8
|
+
declare function getApiErrorHandler(providedHandler: OptionalApiErrorHandler, defaultHandler: ApiErrorHandler): ApiErrorHandler;
|
|
9
|
+
|
|
10
|
+
interface DataDestroyer {
|
|
11
|
+
destroying: Ref<boolean>;
|
|
12
|
+
destroy: (id: string) => Promise<boolean>;
|
|
13
|
+
}
|
|
14
|
+
interface ConfirmableDataDestroyer extends DataDestroyer {
|
|
15
|
+
confirm: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare type DataDestroyerHandler = (id: string) => any;
|
|
18
|
+
declare function useDataDestroyer(destroyer: DataDestroyerHandler, errorHandler: ApiErrorHandler): DataDestroyer;
|
|
19
|
+
|
|
20
|
+
declare enum ZenkyInjection {
|
|
21
|
+
ProductsSource = "zenky:products:source",
|
|
22
|
+
Category = "zenky:category",
|
|
23
|
+
CategoryNotFound = "zenky:category:notFound",
|
|
24
|
+
Collection = "zenky:collection",
|
|
25
|
+
CollectionNotFound = "zenky:collection:notFound"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface LoaderState {
|
|
29
|
+
loading: boolean;
|
|
30
|
+
loaded: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface StateDataLoaderState<T> extends LoaderState {
|
|
33
|
+
data: T;
|
|
34
|
+
}
|
|
35
|
+
declare type StateDataLoader = () => any;
|
|
36
|
+
declare function useStateDataLoader<T>(state: ComputedRef<StateDataLoaderState<T>>, loader: StateDataLoader): Promise<T>;
|
|
37
|
+
interface PaginatedLoaderState extends LoaderState {
|
|
38
|
+
waiting: boolean;
|
|
39
|
+
}
|
|
40
|
+
interface PaginatedLoader<T, R = PaginationRequest> {
|
|
41
|
+
state: Ref<PaginatedLoaderState>;
|
|
42
|
+
pagination: Ref<Pagination | null>;
|
|
43
|
+
items: Ref<T[]>;
|
|
44
|
+
load: (request: R, reset: boolean) => Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
declare type PaginatedItemsProvider<T, R = PaginationRequest> = (request: R) => Promise<PaginatedResponse<T>>;
|
|
47
|
+
declare function usePaginatedLoader<T, R = PaginationRequest>(provider: PaginatedItemsProvider<T, R>, errorHandler: ApiErrorHandler): PaginatedLoader<T, R>;
|
|
48
|
+
interface ListLoader<T, R = ResourceRequest> {
|
|
49
|
+
state: Ref<LoaderState>;
|
|
50
|
+
items: Ref<T[]>;
|
|
51
|
+
load: (request?: R) => Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
declare type ListProvider<T, R = ResourceRequest> = (request?: R) => Promise<T[]>;
|
|
54
|
+
declare function useListLoader<T, R = ResourceRequest>(provider: ListProvider<T, R>, errorHandler: ApiErrorHandler): ListLoader<T, R>;
|
|
55
|
+
interface ItemLoader<T, I = string, R = ResourceRequest> {
|
|
56
|
+
state: Ref<LoaderState>;
|
|
57
|
+
item: Ref<T | null>;
|
|
58
|
+
load: (id: I, request?: R) => Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
declare type ItemProvider<T, I = string, R = ResourceRequest> = (id: I, request?: R) => Promise<T | null>;
|
|
61
|
+
declare function useItemLoader<T, I = string, R = ResourceRequest>(provider: ItemProvider<T, I, R>, errorHandler: ApiErrorHandler): ItemLoader<T, I, R>;
|
|
62
|
+
interface DataLoader<T> {
|
|
63
|
+
state: Ref<LoaderState>;
|
|
64
|
+
data: Ref<T | null>;
|
|
65
|
+
load: () => Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
declare type DataProvider<T> = () => Promise<T>;
|
|
68
|
+
declare function useDataLoader<T>(provider: DataProvider<T>, errorHandler: ApiErrorHandler): DataLoader<T>;
|
|
69
|
+
|
|
70
|
+
interface ZenkyStorage {
|
|
71
|
+
get(key: string, defaultValue?: any): any;
|
|
72
|
+
set(key: string, value: any): void;
|
|
73
|
+
delete(key: string): void;
|
|
74
|
+
}
|
|
75
|
+
declare const createStorage: (storeId: string) => ZenkyStorage;
|
|
76
|
+
declare const getStorage: () => ZenkyStorage;
|
|
77
|
+
|
|
78
|
+
interface AddressForm {
|
|
79
|
+
id?: string;
|
|
80
|
+
name?: string;
|
|
81
|
+
suggestion?: any | null;
|
|
82
|
+
city: string;
|
|
83
|
+
street: string;
|
|
84
|
+
house: string;
|
|
85
|
+
block: string;
|
|
86
|
+
address: string;
|
|
87
|
+
apartment: string;
|
|
88
|
+
entrance: string;
|
|
89
|
+
floor: string;
|
|
90
|
+
has_intercom: boolean;
|
|
91
|
+
}
|
|
92
|
+
declare const getAddressForm: () => AddressForm;
|
|
93
|
+
interface AddressFormValue {
|
|
94
|
+
address?: string;
|
|
95
|
+
city?: string;
|
|
96
|
+
street?: string;
|
|
97
|
+
house?: string;
|
|
98
|
+
block?: string;
|
|
99
|
+
apartment: string;
|
|
100
|
+
entrance: string;
|
|
101
|
+
floor: string;
|
|
102
|
+
has_intercom: boolean;
|
|
103
|
+
}
|
|
104
|
+
interface AddressFormValueProvider {
|
|
105
|
+
errors: string[];
|
|
106
|
+
data: AddressFormValue;
|
|
107
|
+
}
|
|
108
|
+
declare function useAddressFormValue(form: AddressForm, resolver: string, address?: Address | null): AddressFormValueProvider;
|
|
109
|
+
|
|
110
|
+
interface DadataProvider {
|
|
111
|
+
query: Ref<string | null>;
|
|
112
|
+
loading: Ref<boolean>;
|
|
113
|
+
results: Ref<any[]>;
|
|
114
|
+
}
|
|
115
|
+
declare function useDadata(): DadataProvider;
|
|
116
|
+
declare function useSuggestionsRestrictedToCity(city?: City): {
|
|
117
|
+
restricted: ComputedRef<boolean>;
|
|
118
|
+
};
|
|
119
|
+
declare function getSelectedAddress(suggestion: any, house: string, block?: string | null): string | null;
|
|
120
|
+
declare function getSelectedAddressDisplayValue(suggestion: any): {
|
|
121
|
+
short: string | null;
|
|
122
|
+
full: string | null;
|
|
123
|
+
};
|
|
124
|
+
declare function getExistedAddressDisplayValue(address: Address, restrictedToCity: boolean): string;
|
|
125
|
+
declare function getExistedAddress(address: Address, house?: string | null, block?: string | null): string;
|
|
126
|
+
|
|
127
|
+
declare type CategoriesState = {
|
|
128
|
+
loading: boolean;
|
|
129
|
+
loaded: boolean;
|
|
130
|
+
tree: NestedCategory[];
|
|
131
|
+
flatTree: FlattenNestedCategory[] | null;
|
|
132
|
+
};
|
|
133
|
+
interface CategoriesProvider {
|
|
134
|
+
categories: Ref<NestedCategory[]>;
|
|
135
|
+
load: (ids: string[]) => void;
|
|
136
|
+
}
|
|
137
|
+
interface CategoryProvider {
|
|
138
|
+
category: Ref<NestedCategory | null>;
|
|
139
|
+
load: (id: string) => void;
|
|
140
|
+
}
|
|
141
|
+
interface FlattenNestedCategory extends NestedCategory {
|
|
142
|
+
original_name: string | null;
|
|
143
|
+
}
|
|
144
|
+
interface FlatCategoriesTreeProvider {
|
|
145
|
+
tree: Ref<FlattenNestedCategory[]>;
|
|
146
|
+
load: Function;
|
|
147
|
+
}
|
|
148
|
+
interface ReversedTreeProvider {
|
|
149
|
+
tree: Ref<NestedCategory[]>;
|
|
150
|
+
load: (id: string) => void;
|
|
151
|
+
}
|
|
152
|
+
interface SplittedCategoriesTreeProvider {
|
|
153
|
+
visible: Ref<NestedCategory[]>;
|
|
154
|
+
hidden: Ref<NestedCategory[]>;
|
|
155
|
+
load: (split: number | Ref<number>) => void;
|
|
156
|
+
}
|
|
157
|
+
interface CategoriesTreeProvider {
|
|
158
|
+
tree: Ref<NestedCategory[]>;
|
|
159
|
+
load: Function;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
declare function useCategories(): CategoriesProvider;
|
|
163
|
+
declare function useCategory(): CategoryProvider;
|
|
164
|
+
|
|
165
|
+
declare function useFlatCategoriesTree(): FlatCategoriesTreeProvider;
|
|
166
|
+
|
|
167
|
+
declare function useReversedTree(): ReversedTreeProvider;
|
|
168
|
+
|
|
169
|
+
declare function useSplittedCategoriesTree(): SplittedCategoriesTreeProvider;
|
|
170
|
+
|
|
171
|
+
declare function useCategoriesTree(): CategoriesTreeProvider;
|
|
172
|
+
|
|
173
|
+
declare const useCategoriesStore: pinia.StoreDefinition<"zenky:storefront:categories", CategoriesState, {}, {
|
|
174
|
+
load(): Promise<void>;
|
|
175
|
+
setFlatTree(flatTree: FlattenNestedCategory[]): void;
|
|
176
|
+
}>;
|
|
177
|
+
|
|
178
|
+
declare type CollectionsState = {
|
|
179
|
+
loading: boolean;
|
|
180
|
+
loaded: boolean;
|
|
181
|
+
collections: ProductsCollection[];
|
|
182
|
+
};
|
|
183
|
+
interface ProductsCollectionsProvider {
|
|
184
|
+
collections: Ref<ProductsCollection[]>;
|
|
185
|
+
load: (ids: string[] | null) => Promise<void>;
|
|
186
|
+
}
|
|
187
|
+
interface ProductsCollectionProvider {
|
|
188
|
+
collection: Ref<ProductsCollection | null>;
|
|
189
|
+
load: (id: string) => Promise<void>;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
declare function useCollections(): ProductsCollectionsProvider;
|
|
193
|
+
declare function useCollection(): ProductsCollectionProvider;
|
|
194
|
+
|
|
195
|
+
declare const useCollectionsStore: pinia.StoreDefinition<"zenky:storefront:collections", CollectionsState, {}, {
|
|
196
|
+
load(): Promise<void>;
|
|
197
|
+
}>;
|
|
198
|
+
|
|
199
|
+
declare function useCategoryFeaturesList(categoryId: string | null, errorHandler?: OptionalApiErrorHandler): ListLoader<Feature>;
|
|
200
|
+
declare function useCategoryFeaturesGroupsList(categoryId: string | null, errorHandler?: OptionalApiErrorHandler): ListLoader<FeaturesGroupContainer>;
|
|
201
|
+
|
|
202
|
+
declare function useArticlesList(errorHandler?: OptionalApiErrorHandler): PaginatedLoader<Article>;
|
|
203
|
+
declare function useArticleCategoriesList(errorHandler?: OptionalApiErrorHandler): PaginatedLoader<ArticleCategory>;
|
|
204
|
+
declare function useArticleItem(errorHandler?: OptionalApiErrorHandler): ItemLoader<Article>;
|
|
205
|
+
|
|
206
|
+
declare enum AuthenticationStage {
|
|
207
|
+
Check = "check",
|
|
208
|
+
Login = "login",
|
|
209
|
+
Register = "register",
|
|
210
|
+
Confirmation = "confirmation"
|
|
211
|
+
}
|
|
212
|
+
declare enum AuthenticationEvent {
|
|
213
|
+
Stage = "stage",
|
|
214
|
+
Completed = "completed"
|
|
215
|
+
}
|
|
216
|
+
declare enum AuthenticationResultType {
|
|
217
|
+
Pending = "pending",
|
|
218
|
+
Validation = "validation",
|
|
219
|
+
Failed = "failed",
|
|
220
|
+
Completed = "completed",
|
|
221
|
+
Stage = "stage"
|
|
222
|
+
}
|
|
223
|
+
declare type EmitAuthenticationEvent = (e: AuthenticationEvent, payload?: any) => void;
|
|
224
|
+
declare type CustomerStore = {
|
|
225
|
+
inclusions: string;
|
|
226
|
+
loading: boolean;
|
|
227
|
+
loaded: boolean;
|
|
228
|
+
token: string | null;
|
|
229
|
+
customer: Customer | null;
|
|
230
|
+
};
|
|
231
|
+
interface AuthenticationForm {
|
|
232
|
+
phone: AuthenticationPhone;
|
|
233
|
+
password: string;
|
|
234
|
+
confirmation_code: string;
|
|
235
|
+
}
|
|
236
|
+
interface AuthenticationFormProvider {
|
|
237
|
+
form: Ref<AuthenticationForm>;
|
|
238
|
+
stage: Ref<AuthenticationStage>;
|
|
239
|
+
reset: () => void;
|
|
240
|
+
}
|
|
241
|
+
interface AuthenticationResult {
|
|
242
|
+
type: AuthenticationResultType;
|
|
243
|
+
data?: any;
|
|
244
|
+
}
|
|
245
|
+
interface AuthenticationStatusCheckerProvider {
|
|
246
|
+
active: Ref<boolean>;
|
|
247
|
+
check: () => Promise<AuthenticationResult>;
|
|
248
|
+
}
|
|
249
|
+
interface LoginProvider {
|
|
250
|
+
active: Ref<boolean>;
|
|
251
|
+
login: () => Promise<AuthenticationResult>;
|
|
252
|
+
}
|
|
253
|
+
interface RegistrationProvider {
|
|
254
|
+
active: Ref<boolean>;
|
|
255
|
+
register: () => Promise<AuthenticationResult>;
|
|
256
|
+
}
|
|
257
|
+
interface LogoutProvider {
|
|
258
|
+
logout: () => void;
|
|
259
|
+
}
|
|
260
|
+
interface PasswordResetProvider {
|
|
261
|
+
active: Ref<boolean>;
|
|
262
|
+
sent: Ref<boolean>;
|
|
263
|
+
seconds: Ref<number>;
|
|
264
|
+
label: ComputedRef<string>;
|
|
265
|
+
request: () => Promise<AuthenticationResult>;
|
|
266
|
+
reset: () => Promise<AuthenticationResult>;
|
|
267
|
+
}
|
|
268
|
+
interface ConfirmationProvider {
|
|
269
|
+
active: Ref<boolean>;
|
|
270
|
+
seconds: Ref<number>;
|
|
271
|
+
label: ComputedRef<string>;
|
|
272
|
+
start: () => void;
|
|
273
|
+
resend: () => Promise<AuthenticationResult>;
|
|
274
|
+
confirm: (withPassword: boolean) => Promise<AuthenticationResult>;
|
|
275
|
+
}
|
|
276
|
+
interface EditAddressFormProvider {
|
|
277
|
+
form: Ref<AddressForm>;
|
|
278
|
+
saving: Ref<boolean>;
|
|
279
|
+
save: () => Promise<boolean>;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
declare function useAuthenticationStatusChecker(form: Ref<AuthenticationForm>, emit: EmitAuthenticationEvent): AuthenticationStatusCheckerProvider;
|
|
283
|
+
|
|
284
|
+
declare function useAuthenticationForm(): AuthenticationFormProvider;
|
|
285
|
+
|
|
286
|
+
declare function useLogin(form: Ref<AuthenticationForm>, emit: EmitAuthenticationEvent): LoginProvider;
|
|
287
|
+
|
|
288
|
+
declare function useLogout(): LogoutProvider;
|
|
289
|
+
|
|
290
|
+
declare function usePasswordReset(form: Ref<AuthenticationForm>, emit: EmitAuthenticationEvent): PasswordResetProvider;
|
|
291
|
+
|
|
292
|
+
declare function useRegistration(form: Ref<AuthenticationForm>, emit: EmitAuthenticationEvent): RegistrationProvider;
|
|
293
|
+
|
|
294
|
+
declare const usePhoneConfirmation: (form: Ref<AuthenticationForm>, emit: EmitAuthenticationEvent) => ConfirmationProvider;
|
|
295
|
+
|
|
296
|
+
declare function useDeliveryAddressesList(errorHandler?: OptionalApiErrorHandler): PaginatedLoader<Address>;
|
|
297
|
+
declare function useDeliveryAddressDestroyer(errorHandler?: OptionalApiErrorHandler): DataDestroyer;
|
|
298
|
+
declare function useEditAddressForm(address: Address): EditAddressFormProvider;
|
|
299
|
+
|
|
300
|
+
declare function useCustomer(): {
|
|
301
|
+
customer: ComputedRef<Customer | null>;
|
|
302
|
+
loaded: ComputedRef<boolean>;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
declare function useOrdersList(errorHandler?: OptionalApiErrorHandler): PaginatedLoader<Order>;
|
|
306
|
+
declare function useOrderItem(errorHandler?: OptionalApiErrorHandler): ItemLoader<Order, OrderCredentials>;
|
|
307
|
+
|
|
308
|
+
declare function usePaymentMethodsList(errorHandler?: OptionalApiErrorHandler): PaginatedLoader<CustomerPaymentMethod>;
|
|
309
|
+
declare function usePaymentMethodDestroyer(errorHandler?: OptionalApiErrorHandler): DataDestroyer;
|
|
310
|
+
|
|
311
|
+
declare const useCustomerStore: pinia.StoreDefinition<"zenky:storefront:customer", CustomerStore, {}, {
|
|
312
|
+
initialize(inclusions: string): Promise<{
|
|
313
|
+
id: string;
|
|
314
|
+
store_profile_id: string;
|
|
315
|
+
first_name: string | null;
|
|
316
|
+
last_name: string | null;
|
|
317
|
+
full_name: string | null;
|
|
318
|
+
phone: {
|
|
319
|
+
country: string;
|
|
320
|
+
e164: string;
|
|
321
|
+
international: string;
|
|
322
|
+
national: string;
|
|
323
|
+
};
|
|
324
|
+
email: string | null;
|
|
325
|
+
gender: {
|
|
326
|
+
id: string;
|
|
327
|
+
name: string;
|
|
328
|
+
};
|
|
329
|
+
media?: {
|
|
330
|
+
avatar: {
|
|
331
|
+
id: string;
|
|
332
|
+
images: {
|
|
333
|
+
placeholder?: {
|
|
334
|
+
type: string;
|
|
335
|
+
url: string;
|
|
336
|
+
height: number;
|
|
337
|
+
width: number;
|
|
338
|
+
} | null | undefined;
|
|
339
|
+
placeholder_webp?: {
|
|
340
|
+
type: string;
|
|
341
|
+
url: string;
|
|
342
|
+
height: number;
|
|
343
|
+
width: number;
|
|
344
|
+
} | null | undefined;
|
|
345
|
+
thumb?: {
|
|
346
|
+
type: string;
|
|
347
|
+
url: string;
|
|
348
|
+
height: number;
|
|
349
|
+
width: number;
|
|
350
|
+
} | null | undefined;
|
|
351
|
+
thumb_webp?: {
|
|
352
|
+
type: string;
|
|
353
|
+
url: string;
|
|
354
|
+
height: number;
|
|
355
|
+
width: number;
|
|
356
|
+
} | null | undefined;
|
|
357
|
+
medium?: {
|
|
358
|
+
type: string;
|
|
359
|
+
url: string;
|
|
360
|
+
height: number;
|
|
361
|
+
width: number;
|
|
362
|
+
} | null | undefined;
|
|
363
|
+
medium_webp?: {
|
|
364
|
+
type: string;
|
|
365
|
+
url: string;
|
|
366
|
+
height: number;
|
|
367
|
+
width: number;
|
|
368
|
+
} | null | undefined;
|
|
369
|
+
large?: {
|
|
370
|
+
type: string;
|
|
371
|
+
url: string;
|
|
372
|
+
height: number;
|
|
373
|
+
width: number;
|
|
374
|
+
} | null | undefined;
|
|
375
|
+
large_webp?: {
|
|
376
|
+
type: string;
|
|
377
|
+
url: string;
|
|
378
|
+
height: number;
|
|
379
|
+
width: number;
|
|
380
|
+
} | null | undefined;
|
|
381
|
+
xlarge?: {
|
|
382
|
+
type: string;
|
|
383
|
+
url: string;
|
|
384
|
+
height: number;
|
|
385
|
+
width: number;
|
|
386
|
+
} | null | undefined;
|
|
387
|
+
xlarge_webp?: {
|
|
388
|
+
type: string;
|
|
389
|
+
url: string;
|
|
390
|
+
height: number;
|
|
391
|
+
width: number;
|
|
392
|
+
} | null | undefined;
|
|
393
|
+
hd?: {
|
|
394
|
+
type: string;
|
|
395
|
+
url: string;
|
|
396
|
+
height: number;
|
|
397
|
+
width: number;
|
|
398
|
+
} | null | undefined;
|
|
399
|
+
hd_webp?: {
|
|
400
|
+
type: string;
|
|
401
|
+
url: string;
|
|
402
|
+
height: number;
|
|
403
|
+
width: number;
|
|
404
|
+
} | null | undefined;
|
|
405
|
+
};
|
|
406
|
+
} | null;
|
|
407
|
+
} | null | undefined;
|
|
408
|
+
loyalty: {
|
|
409
|
+
balance?: {
|
|
410
|
+
currency: {
|
|
411
|
+
code: string;
|
|
412
|
+
decimals_separator: string;
|
|
413
|
+
name: string;
|
|
414
|
+
prefix: string | null;
|
|
415
|
+
suffix: string | null;
|
|
416
|
+
symbol: string;
|
|
417
|
+
thousands_separator: string;
|
|
418
|
+
};
|
|
419
|
+
full: string;
|
|
420
|
+
short: string;
|
|
421
|
+
trimmed: string;
|
|
422
|
+
value: number;
|
|
423
|
+
} | null | undefined;
|
|
424
|
+
bonuses_level?: {
|
|
425
|
+
id: string;
|
|
426
|
+
name: string;
|
|
427
|
+
expenses: {
|
|
428
|
+
currency: {
|
|
429
|
+
code: string;
|
|
430
|
+
decimals_separator: string;
|
|
431
|
+
name: string;
|
|
432
|
+
prefix: string | null;
|
|
433
|
+
suffix: string | null;
|
|
434
|
+
symbol: string;
|
|
435
|
+
thousands_separator: string;
|
|
436
|
+
};
|
|
437
|
+
full: string;
|
|
438
|
+
short: string;
|
|
439
|
+
trimmed: string;
|
|
440
|
+
value: number;
|
|
441
|
+
};
|
|
442
|
+
cashback_rate: {
|
|
443
|
+
value: number;
|
|
444
|
+
percentage: number;
|
|
445
|
+
};
|
|
446
|
+
payment_rate: {
|
|
447
|
+
value: number;
|
|
448
|
+
percentage: number;
|
|
449
|
+
};
|
|
450
|
+
cashier_reward_rate: {
|
|
451
|
+
value: number;
|
|
452
|
+
percentage: number;
|
|
453
|
+
};
|
|
454
|
+
created_at: {
|
|
455
|
+
date: string;
|
|
456
|
+
datetime: string;
|
|
457
|
+
datetime_at: string;
|
|
458
|
+
datetime_utc: string;
|
|
459
|
+
diff: string;
|
|
460
|
+
iso: string;
|
|
461
|
+
iso_utc: string;
|
|
462
|
+
timestamp: number;
|
|
463
|
+
timezone: string;
|
|
464
|
+
} | null;
|
|
465
|
+
updated_at: {
|
|
466
|
+
date: string;
|
|
467
|
+
datetime: string;
|
|
468
|
+
datetime_at: string;
|
|
469
|
+
datetime_utc: string;
|
|
470
|
+
diff: string;
|
|
471
|
+
iso: string;
|
|
472
|
+
iso_utc: string;
|
|
473
|
+
timestamp: number;
|
|
474
|
+
timezone: string;
|
|
475
|
+
} | null;
|
|
476
|
+
} | null | undefined;
|
|
477
|
+
expenses?: {
|
|
478
|
+
currency: {
|
|
479
|
+
code: string;
|
|
480
|
+
decimals_separator: string;
|
|
481
|
+
name: string;
|
|
482
|
+
prefix: string | null;
|
|
483
|
+
suffix: string | null;
|
|
484
|
+
symbol: string;
|
|
485
|
+
thousands_separator: string;
|
|
486
|
+
};
|
|
487
|
+
full: string;
|
|
488
|
+
short: string;
|
|
489
|
+
trimmed: string;
|
|
490
|
+
value: number;
|
|
491
|
+
} | null | undefined;
|
|
492
|
+
rates?: {
|
|
493
|
+
cashback: {
|
|
494
|
+
value: number;
|
|
495
|
+
percentage: number;
|
|
496
|
+
};
|
|
497
|
+
cashier_reward: {
|
|
498
|
+
value: number;
|
|
499
|
+
percentage: number;
|
|
500
|
+
};
|
|
501
|
+
payment: {
|
|
502
|
+
value: number;
|
|
503
|
+
percentage: number;
|
|
504
|
+
};
|
|
505
|
+
} | undefined;
|
|
506
|
+
referral_program: {
|
|
507
|
+
code: string;
|
|
508
|
+
invite_url: string;
|
|
509
|
+
join_url: string;
|
|
510
|
+
} | null;
|
|
511
|
+
} | null;
|
|
512
|
+
birth_date: {
|
|
513
|
+
date: string;
|
|
514
|
+
datetime: string;
|
|
515
|
+
datetime_at: string;
|
|
516
|
+
datetime_utc: string;
|
|
517
|
+
diff: string;
|
|
518
|
+
iso: string;
|
|
519
|
+
iso_utc: string;
|
|
520
|
+
timestamp: number;
|
|
521
|
+
timezone: string;
|
|
522
|
+
} | null;
|
|
523
|
+
registered_at: {
|
|
524
|
+
date: string;
|
|
525
|
+
datetime: string;
|
|
526
|
+
datetime_at: string;
|
|
527
|
+
datetime_utc: string;
|
|
528
|
+
diff: string;
|
|
529
|
+
iso: string;
|
|
530
|
+
iso_utc: string;
|
|
531
|
+
timestamp: number;
|
|
532
|
+
timezone: string;
|
|
533
|
+
} | null;
|
|
534
|
+
created_at: {
|
|
535
|
+
date: string;
|
|
536
|
+
datetime: string;
|
|
537
|
+
datetime_at: string;
|
|
538
|
+
datetime_utc: string;
|
|
539
|
+
diff: string;
|
|
540
|
+
iso: string;
|
|
541
|
+
iso_utc: string;
|
|
542
|
+
timestamp: number;
|
|
543
|
+
timezone: string;
|
|
544
|
+
} | null;
|
|
545
|
+
updated_at: {
|
|
546
|
+
date: string;
|
|
547
|
+
datetime: string;
|
|
548
|
+
datetime_at: string;
|
|
549
|
+
datetime_utc: string;
|
|
550
|
+
diff: string;
|
|
551
|
+
iso: string;
|
|
552
|
+
iso_utc: string;
|
|
553
|
+
timestamp: number;
|
|
554
|
+
timezone: string;
|
|
555
|
+
} | null;
|
|
556
|
+
} | null | undefined>;
|
|
557
|
+
load(): Promise<{
|
|
558
|
+
id: string;
|
|
559
|
+
store_profile_id: string;
|
|
560
|
+
first_name: string | null;
|
|
561
|
+
last_name: string | null;
|
|
562
|
+
full_name: string | null;
|
|
563
|
+
phone: {
|
|
564
|
+
country: string;
|
|
565
|
+
e164: string;
|
|
566
|
+
international: string;
|
|
567
|
+
national: string;
|
|
568
|
+
};
|
|
569
|
+
email: string | null;
|
|
570
|
+
gender: {
|
|
571
|
+
id: string;
|
|
572
|
+
name: string;
|
|
573
|
+
};
|
|
574
|
+
media?: {
|
|
575
|
+
avatar: {
|
|
576
|
+
id: string;
|
|
577
|
+
images: {
|
|
578
|
+
placeholder?: {
|
|
579
|
+
type: string;
|
|
580
|
+
url: string;
|
|
581
|
+
height: number;
|
|
582
|
+
width: number;
|
|
583
|
+
} | null | undefined;
|
|
584
|
+
placeholder_webp?: {
|
|
585
|
+
type: string;
|
|
586
|
+
url: string;
|
|
587
|
+
height: number;
|
|
588
|
+
width: number;
|
|
589
|
+
} | null | undefined;
|
|
590
|
+
thumb?: {
|
|
591
|
+
type: string;
|
|
592
|
+
url: string;
|
|
593
|
+
height: number;
|
|
594
|
+
width: number;
|
|
595
|
+
} | null | undefined;
|
|
596
|
+
thumb_webp?: {
|
|
597
|
+
type: string;
|
|
598
|
+
url: string;
|
|
599
|
+
height: number;
|
|
600
|
+
width: number;
|
|
601
|
+
} | null | undefined;
|
|
602
|
+
medium?: {
|
|
603
|
+
type: string;
|
|
604
|
+
url: string;
|
|
605
|
+
height: number;
|
|
606
|
+
width: number;
|
|
607
|
+
} | null | undefined;
|
|
608
|
+
medium_webp?: {
|
|
609
|
+
type: string;
|
|
610
|
+
url: string;
|
|
611
|
+
height: number;
|
|
612
|
+
width: number;
|
|
613
|
+
} | null | undefined;
|
|
614
|
+
large?: {
|
|
615
|
+
type: string;
|
|
616
|
+
url: string;
|
|
617
|
+
height: number;
|
|
618
|
+
width: number;
|
|
619
|
+
} | null | undefined;
|
|
620
|
+
large_webp?: {
|
|
621
|
+
type: string;
|
|
622
|
+
url: string;
|
|
623
|
+
height: number;
|
|
624
|
+
width: number;
|
|
625
|
+
} | null | undefined;
|
|
626
|
+
xlarge?: {
|
|
627
|
+
type: string;
|
|
628
|
+
url: string;
|
|
629
|
+
height: number;
|
|
630
|
+
width: number;
|
|
631
|
+
} | null | undefined;
|
|
632
|
+
xlarge_webp?: {
|
|
633
|
+
type: string;
|
|
634
|
+
url: string;
|
|
635
|
+
height: number;
|
|
636
|
+
width: number;
|
|
637
|
+
} | null | undefined;
|
|
638
|
+
hd?: {
|
|
639
|
+
type: string;
|
|
640
|
+
url: string;
|
|
641
|
+
height: number;
|
|
642
|
+
width: number;
|
|
643
|
+
} | null | undefined;
|
|
644
|
+
hd_webp?: {
|
|
645
|
+
type: string;
|
|
646
|
+
url: string;
|
|
647
|
+
height: number;
|
|
648
|
+
width: number;
|
|
649
|
+
} | null | undefined;
|
|
650
|
+
};
|
|
651
|
+
} | null;
|
|
652
|
+
} | null | undefined;
|
|
653
|
+
loyalty: {
|
|
654
|
+
balance?: {
|
|
655
|
+
currency: {
|
|
656
|
+
code: string;
|
|
657
|
+
decimals_separator: string;
|
|
658
|
+
name: string;
|
|
659
|
+
prefix: string | null;
|
|
660
|
+
suffix: string | null;
|
|
661
|
+
symbol: string;
|
|
662
|
+
thousands_separator: string;
|
|
663
|
+
};
|
|
664
|
+
full: string;
|
|
665
|
+
short: string;
|
|
666
|
+
trimmed: string;
|
|
667
|
+
value: number;
|
|
668
|
+
} | null | undefined;
|
|
669
|
+
bonuses_level?: {
|
|
670
|
+
id: string;
|
|
671
|
+
name: string;
|
|
672
|
+
expenses: {
|
|
673
|
+
currency: {
|
|
674
|
+
code: string;
|
|
675
|
+
decimals_separator: string;
|
|
676
|
+
name: string;
|
|
677
|
+
prefix: string | null;
|
|
678
|
+
suffix: string | null;
|
|
679
|
+
symbol: string;
|
|
680
|
+
thousands_separator: string;
|
|
681
|
+
};
|
|
682
|
+
full: string;
|
|
683
|
+
short: string;
|
|
684
|
+
trimmed: string;
|
|
685
|
+
value: number;
|
|
686
|
+
};
|
|
687
|
+
cashback_rate: {
|
|
688
|
+
value: number;
|
|
689
|
+
percentage: number;
|
|
690
|
+
};
|
|
691
|
+
payment_rate: {
|
|
692
|
+
value: number;
|
|
693
|
+
percentage: number;
|
|
694
|
+
};
|
|
695
|
+
cashier_reward_rate: {
|
|
696
|
+
value: number;
|
|
697
|
+
percentage: number;
|
|
698
|
+
};
|
|
699
|
+
created_at: {
|
|
700
|
+
date: string;
|
|
701
|
+
datetime: string;
|
|
702
|
+
datetime_at: string;
|
|
703
|
+
datetime_utc: string;
|
|
704
|
+
diff: string;
|
|
705
|
+
iso: string;
|
|
706
|
+
iso_utc: string;
|
|
707
|
+
timestamp: number;
|
|
708
|
+
timezone: string;
|
|
709
|
+
} | null;
|
|
710
|
+
updated_at: {
|
|
711
|
+
date: string;
|
|
712
|
+
datetime: string;
|
|
713
|
+
datetime_at: string;
|
|
714
|
+
datetime_utc: string;
|
|
715
|
+
diff: string;
|
|
716
|
+
iso: string;
|
|
717
|
+
iso_utc: string;
|
|
718
|
+
timestamp: number;
|
|
719
|
+
timezone: string;
|
|
720
|
+
} | null;
|
|
721
|
+
} | null | undefined;
|
|
722
|
+
expenses?: {
|
|
723
|
+
currency: {
|
|
724
|
+
code: string;
|
|
725
|
+
decimals_separator: string;
|
|
726
|
+
name: string;
|
|
727
|
+
prefix: string | null;
|
|
728
|
+
suffix: string | null;
|
|
729
|
+
symbol: string;
|
|
730
|
+
thousands_separator: string;
|
|
731
|
+
};
|
|
732
|
+
full: string;
|
|
733
|
+
short: string;
|
|
734
|
+
trimmed: string;
|
|
735
|
+
value: number;
|
|
736
|
+
} | null | undefined;
|
|
737
|
+
rates?: {
|
|
738
|
+
cashback: {
|
|
739
|
+
value: number;
|
|
740
|
+
percentage: number;
|
|
741
|
+
};
|
|
742
|
+
cashier_reward: {
|
|
743
|
+
value: number;
|
|
744
|
+
percentage: number;
|
|
745
|
+
};
|
|
746
|
+
payment: {
|
|
747
|
+
value: number;
|
|
748
|
+
percentage: number;
|
|
749
|
+
};
|
|
750
|
+
} | undefined;
|
|
751
|
+
referral_program: {
|
|
752
|
+
code: string;
|
|
753
|
+
invite_url: string;
|
|
754
|
+
join_url: string;
|
|
755
|
+
} | null;
|
|
756
|
+
} | null;
|
|
757
|
+
birth_date: {
|
|
758
|
+
date: string;
|
|
759
|
+
datetime: string;
|
|
760
|
+
datetime_at: string;
|
|
761
|
+
datetime_utc: string;
|
|
762
|
+
diff: string;
|
|
763
|
+
iso: string;
|
|
764
|
+
iso_utc: string;
|
|
765
|
+
timestamp: number;
|
|
766
|
+
timezone: string;
|
|
767
|
+
} | null;
|
|
768
|
+
registered_at: {
|
|
769
|
+
date: string;
|
|
770
|
+
datetime: string;
|
|
771
|
+
datetime_at: string;
|
|
772
|
+
datetime_utc: string;
|
|
773
|
+
diff: string;
|
|
774
|
+
iso: string;
|
|
775
|
+
iso_utc: string;
|
|
776
|
+
timestamp: number;
|
|
777
|
+
timezone: string;
|
|
778
|
+
} | null;
|
|
779
|
+
created_at: {
|
|
780
|
+
date: string;
|
|
781
|
+
datetime: string;
|
|
782
|
+
datetime_at: string;
|
|
783
|
+
datetime_utc: string;
|
|
784
|
+
diff: string;
|
|
785
|
+
iso: string;
|
|
786
|
+
iso_utc: string;
|
|
787
|
+
timestamp: number;
|
|
788
|
+
timezone: string;
|
|
789
|
+
} | null;
|
|
790
|
+
updated_at: {
|
|
791
|
+
date: string;
|
|
792
|
+
datetime: string;
|
|
793
|
+
datetime_at: string;
|
|
794
|
+
datetime_utc: string;
|
|
795
|
+
diff: string;
|
|
796
|
+
iso: string;
|
|
797
|
+
iso_utc: string;
|
|
798
|
+
timestamp: number;
|
|
799
|
+
timezone: string;
|
|
800
|
+
} | null;
|
|
801
|
+
} | null>;
|
|
802
|
+
setToken(token: string): Promise<{
|
|
803
|
+
id: string;
|
|
804
|
+
store_profile_id: string;
|
|
805
|
+
first_name: string | null;
|
|
806
|
+
last_name: string | null;
|
|
807
|
+
full_name: string | null;
|
|
808
|
+
phone: {
|
|
809
|
+
country: string;
|
|
810
|
+
e164: string;
|
|
811
|
+
international: string;
|
|
812
|
+
national: string;
|
|
813
|
+
};
|
|
814
|
+
email: string | null;
|
|
815
|
+
gender: {
|
|
816
|
+
id: string;
|
|
817
|
+
name: string;
|
|
818
|
+
};
|
|
819
|
+
media?: {
|
|
820
|
+
avatar: {
|
|
821
|
+
id: string;
|
|
822
|
+
images: {
|
|
823
|
+
placeholder?: {
|
|
824
|
+
type: string;
|
|
825
|
+
url: string;
|
|
826
|
+
height: number;
|
|
827
|
+
width: number;
|
|
828
|
+
} | null | undefined;
|
|
829
|
+
placeholder_webp?: {
|
|
830
|
+
type: string;
|
|
831
|
+
url: string;
|
|
832
|
+
height: number;
|
|
833
|
+
width: number;
|
|
834
|
+
} | null | undefined;
|
|
835
|
+
thumb?: {
|
|
836
|
+
type: string;
|
|
837
|
+
url: string;
|
|
838
|
+
height: number;
|
|
839
|
+
width: number;
|
|
840
|
+
} | null | undefined;
|
|
841
|
+
thumb_webp?: {
|
|
842
|
+
type: string;
|
|
843
|
+
url: string;
|
|
844
|
+
height: number;
|
|
845
|
+
width: number;
|
|
846
|
+
} | null | undefined;
|
|
847
|
+
medium?: {
|
|
848
|
+
type: string;
|
|
849
|
+
url: string;
|
|
850
|
+
height: number;
|
|
851
|
+
width: number;
|
|
852
|
+
} | null | undefined;
|
|
853
|
+
medium_webp?: {
|
|
854
|
+
type: string;
|
|
855
|
+
url: string;
|
|
856
|
+
height: number;
|
|
857
|
+
width: number;
|
|
858
|
+
} | null | undefined;
|
|
859
|
+
large?: {
|
|
860
|
+
type: string;
|
|
861
|
+
url: string;
|
|
862
|
+
height: number;
|
|
863
|
+
width: number;
|
|
864
|
+
} | null | undefined;
|
|
865
|
+
large_webp?: {
|
|
866
|
+
type: string;
|
|
867
|
+
url: string;
|
|
868
|
+
height: number;
|
|
869
|
+
width: number;
|
|
870
|
+
} | null | undefined;
|
|
871
|
+
xlarge?: {
|
|
872
|
+
type: string;
|
|
873
|
+
url: string;
|
|
874
|
+
height: number;
|
|
875
|
+
width: number;
|
|
876
|
+
} | null | undefined;
|
|
877
|
+
xlarge_webp?: {
|
|
878
|
+
type: string;
|
|
879
|
+
url: string;
|
|
880
|
+
height: number;
|
|
881
|
+
width: number;
|
|
882
|
+
} | null | undefined;
|
|
883
|
+
hd?: {
|
|
884
|
+
type: string;
|
|
885
|
+
url: string;
|
|
886
|
+
height: number;
|
|
887
|
+
width: number;
|
|
888
|
+
} | null | undefined;
|
|
889
|
+
hd_webp?: {
|
|
890
|
+
type: string;
|
|
891
|
+
url: string;
|
|
892
|
+
height: number;
|
|
893
|
+
width: number;
|
|
894
|
+
} | null | undefined;
|
|
895
|
+
};
|
|
896
|
+
} | null;
|
|
897
|
+
} | null | undefined;
|
|
898
|
+
loyalty: {
|
|
899
|
+
balance?: {
|
|
900
|
+
currency: {
|
|
901
|
+
code: string;
|
|
902
|
+
decimals_separator: string;
|
|
903
|
+
name: string;
|
|
904
|
+
prefix: string | null;
|
|
905
|
+
suffix: string | null;
|
|
906
|
+
symbol: string;
|
|
907
|
+
thousands_separator: string;
|
|
908
|
+
};
|
|
909
|
+
full: string;
|
|
910
|
+
short: string;
|
|
911
|
+
trimmed: string;
|
|
912
|
+
value: number;
|
|
913
|
+
} | null | undefined;
|
|
914
|
+
bonuses_level?: {
|
|
915
|
+
id: string;
|
|
916
|
+
name: string;
|
|
917
|
+
expenses: {
|
|
918
|
+
currency: {
|
|
919
|
+
code: string;
|
|
920
|
+
decimals_separator: string;
|
|
921
|
+
name: string;
|
|
922
|
+
prefix: string | null;
|
|
923
|
+
suffix: string | null;
|
|
924
|
+
symbol: string;
|
|
925
|
+
thousands_separator: string;
|
|
926
|
+
};
|
|
927
|
+
full: string;
|
|
928
|
+
short: string;
|
|
929
|
+
trimmed: string;
|
|
930
|
+
value: number;
|
|
931
|
+
};
|
|
932
|
+
cashback_rate: {
|
|
933
|
+
value: number;
|
|
934
|
+
percentage: number;
|
|
935
|
+
};
|
|
936
|
+
payment_rate: {
|
|
937
|
+
value: number;
|
|
938
|
+
percentage: number;
|
|
939
|
+
};
|
|
940
|
+
cashier_reward_rate: {
|
|
941
|
+
value: number;
|
|
942
|
+
percentage: number;
|
|
943
|
+
};
|
|
944
|
+
created_at: {
|
|
945
|
+
date: string;
|
|
946
|
+
datetime: string;
|
|
947
|
+
datetime_at: string;
|
|
948
|
+
datetime_utc: string;
|
|
949
|
+
diff: string;
|
|
950
|
+
iso: string;
|
|
951
|
+
iso_utc: string;
|
|
952
|
+
timestamp: number;
|
|
953
|
+
timezone: string;
|
|
954
|
+
} | null;
|
|
955
|
+
updated_at: {
|
|
956
|
+
date: string;
|
|
957
|
+
datetime: string;
|
|
958
|
+
datetime_at: string;
|
|
959
|
+
datetime_utc: string;
|
|
960
|
+
diff: string;
|
|
961
|
+
iso: string;
|
|
962
|
+
iso_utc: string;
|
|
963
|
+
timestamp: number;
|
|
964
|
+
timezone: string;
|
|
965
|
+
} | null;
|
|
966
|
+
} | null | undefined;
|
|
967
|
+
expenses?: {
|
|
968
|
+
currency: {
|
|
969
|
+
code: string;
|
|
970
|
+
decimals_separator: string;
|
|
971
|
+
name: string;
|
|
972
|
+
prefix: string | null;
|
|
973
|
+
suffix: string | null;
|
|
974
|
+
symbol: string;
|
|
975
|
+
thousands_separator: string;
|
|
976
|
+
};
|
|
977
|
+
full: string;
|
|
978
|
+
short: string;
|
|
979
|
+
trimmed: string;
|
|
980
|
+
value: number;
|
|
981
|
+
} | null | undefined;
|
|
982
|
+
rates?: {
|
|
983
|
+
cashback: {
|
|
984
|
+
value: number;
|
|
985
|
+
percentage: number;
|
|
986
|
+
};
|
|
987
|
+
cashier_reward: {
|
|
988
|
+
value: number;
|
|
989
|
+
percentage: number;
|
|
990
|
+
};
|
|
991
|
+
payment: {
|
|
992
|
+
value: number;
|
|
993
|
+
percentage: number;
|
|
994
|
+
};
|
|
995
|
+
} | undefined;
|
|
996
|
+
referral_program: {
|
|
997
|
+
code: string;
|
|
998
|
+
invite_url: string;
|
|
999
|
+
join_url: string;
|
|
1000
|
+
} | null;
|
|
1001
|
+
} | null;
|
|
1002
|
+
birth_date: {
|
|
1003
|
+
date: string;
|
|
1004
|
+
datetime: string;
|
|
1005
|
+
datetime_at: string;
|
|
1006
|
+
datetime_utc: string;
|
|
1007
|
+
diff: string;
|
|
1008
|
+
iso: string;
|
|
1009
|
+
iso_utc: string;
|
|
1010
|
+
timestamp: number;
|
|
1011
|
+
timezone: string;
|
|
1012
|
+
} | null;
|
|
1013
|
+
registered_at: {
|
|
1014
|
+
date: string;
|
|
1015
|
+
datetime: string;
|
|
1016
|
+
datetime_at: string;
|
|
1017
|
+
datetime_utc: string;
|
|
1018
|
+
diff: string;
|
|
1019
|
+
iso: string;
|
|
1020
|
+
iso_utc: string;
|
|
1021
|
+
timestamp: number;
|
|
1022
|
+
timezone: string;
|
|
1023
|
+
} | null;
|
|
1024
|
+
created_at: {
|
|
1025
|
+
date: string;
|
|
1026
|
+
datetime: string;
|
|
1027
|
+
datetime_at: string;
|
|
1028
|
+
datetime_utc: string;
|
|
1029
|
+
diff: string;
|
|
1030
|
+
iso: string;
|
|
1031
|
+
iso_utc: string;
|
|
1032
|
+
timestamp: number;
|
|
1033
|
+
timezone: string;
|
|
1034
|
+
} | null;
|
|
1035
|
+
updated_at: {
|
|
1036
|
+
date: string;
|
|
1037
|
+
datetime: string;
|
|
1038
|
+
datetime_at: string;
|
|
1039
|
+
datetime_utc: string;
|
|
1040
|
+
diff: string;
|
|
1041
|
+
iso: string;
|
|
1042
|
+
iso_utc: string;
|
|
1043
|
+
timestamp: number;
|
|
1044
|
+
timezone: string;
|
|
1045
|
+
} | null;
|
|
1046
|
+
} | null>;
|
|
1047
|
+
logout(): void;
|
|
1048
|
+
}>;
|
|
1049
|
+
|
|
1050
|
+
declare function getFirstMedium(media: Medium | Medium[], sizes?: string[], preferWebp?: boolean): Image | null;
|
|
1051
|
+
|
|
1052
|
+
declare enum ProductsSourceType {
|
|
1053
|
+
Category = "category",
|
|
1054
|
+
Collection = "collection"
|
|
1055
|
+
}
|
|
1056
|
+
declare enum ProductsSorting {
|
|
1057
|
+
Manual = "manual",
|
|
1058
|
+
NameAsc = "name",
|
|
1059
|
+
NameDesc = "-name",
|
|
1060
|
+
PriceAsc = "price",
|
|
1061
|
+
PriceDesc = "-price"
|
|
1062
|
+
}
|
|
1063
|
+
interface ProductsSource {
|
|
1064
|
+
type?: ProductsSourceType;
|
|
1065
|
+
id?: string;
|
|
1066
|
+
error?: boolean;
|
|
1067
|
+
}
|
|
1068
|
+
interface ProductsFilters {
|
|
1069
|
+
[key: string]: string[];
|
|
1070
|
+
}
|
|
1071
|
+
interface ProductsPriceFilters {
|
|
1072
|
+
min?: string | number | null;
|
|
1073
|
+
max?: string | number | null;
|
|
1074
|
+
}
|
|
1075
|
+
interface ProductsLoader {
|
|
1076
|
+
cityId: string | null;
|
|
1077
|
+
source: ProductsSource | null;
|
|
1078
|
+
sorting: ProductsSorting;
|
|
1079
|
+
search: string | null;
|
|
1080
|
+
filters: ProductsFilters;
|
|
1081
|
+
pricesFilters: ProductsPriceFilters;
|
|
1082
|
+
visibility?: string | null;
|
|
1083
|
+
pagination: {
|
|
1084
|
+
count: number;
|
|
1085
|
+
};
|
|
1086
|
+
with?: string;
|
|
1087
|
+
}
|
|
1088
|
+
declare type ProductsRequestCallback = (request: ProductsPaginationRequest | null) => void;
|
|
1089
|
+
interface ProductsListProvider {
|
|
1090
|
+
state: Ref<PaginatedLoaderState>;
|
|
1091
|
+
allowed: Ref<boolean>;
|
|
1092
|
+
pagination: Ref<Pagination | null>;
|
|
1093
|
+
items: Ref<Product[]>;
|
|
1094
|
+
init: (callback?: ProductsRequestCallback) => Promise<void>;
|
|
1095
|
+
load: (page: number, reset: boolean, callback?: ProductsRequestCallback) => Promise<void>;
|
|
1096
|
+
filters: Ref<ProductsFilters>;
|
|
1097
|
+
pricesFilters: Ref<ProductsPriceFilters>;
|
|
1098
|
+
pricesRange: Ref<ProductsPricesRange | null>;
|
|
1099
|
+
features: Ref<Feature[] | FeaturesGroupContainer[]>;
|
|
1100
|
+
sorting: Ref<ProductsSorting>;
|
|
1101
|
+
search: Ref<string | null>;
|
|
1102
|
+
}
|
|
1103
|
+
declare enum ProductsFiltersType {
|
|
1104
|
+
Features = "features",
|
|
1105
|
+
FeaturesGroups = "featuresGroups"
|
|
1106
|
+
}
|
|
1107
|
+
interface ProductsListConfig {
|
|
1108
|
+
source: ProductsSource | null;
|
|
1109
|
+
search?: string | null;
|
|
1110
|
+
sorting: ProductsSorting | null;
|
|
1111
|
+
filters: ProductsFilters | null;
|
|
1112
|
+
pricesFilters: ProductsPriceFilters | null;
|
|
1113
|
+
count: number;
|
|
1114
|
+
filtersType: ProductsFiltersType | null;
|
|
1115
|
+
with?: string;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
declare function useFeaturesFilters(categoryId: string | null, values: ProductsFilters | null): {
|
|
1119
|
+
filters: Ref<ProductsFilters>;
|
|
1120
|
+
load: () => Promise<void>;
|
|
1121
|
+
items: Ref<Feature[]>;
|
|
1122
|
+
};
|
|
1123
|
+
declare function useFeaturesGroupsFilters(categoryId: string | null, values: ProductsFilters | null): {
|
|
1124
|
+
filters: Ref<ProductsFilters>;
|
|
1125
|
+
load: () => Promise<void>;
|
|
1126
|
+
items: Ref<FeaturesGroupContainer[]>;
|
|
1127
|
+
};
|
|
1128
|
+
declare function useProductsPricesRangeFilters(categoryId: string | null, values?: ProductsPriceFilters | null): {
|
|
1129
|
+
filters: Ref<ProductsPriceFilters>;
|
|
1130
|
+
load: () => Promise<void>;
|
|
1131
|
+
range: Ref<_zenky_api.ProductsPricesRange | null>;
|
|
1132
|
+
};
|
|
1133
|
+
|
|
1134
|
+
declare function useProductsList(config: ComputedRef<ProductsListConfig>, errorHandler?: OptionalApiErrorHandler): ProductsListProvider;
|
|
1135
|
+
declare function getProductsListQueryParams(config: ProductsListConfig, request: ProductsPaginationRequest | null): object;
|
|
1136
|
+
declare function getProductsListParamsFromQuery(query: any | null | undefined): object | null;
|
|
1137
|
+
|
|
1138
|
+
declare function useProductsPricesRange(categoryId: string | null, errorHandler?: OptionalApiErrorHandler): DataLoader<ProductsPricesRange>;
|
|
1139
|
+
|
|
1140
|
+
declare function getProductsSource(source: ProductsSource | null): ProductsSource | null;
|
|
1141
|
+
|
|
1142
|
+
declare function getProductsPaginationRequest(page: number, loader: ProductsLoader): ProductsPaginationRequest | null;
|
|
1143
|
+
|
|
1144
|
+
declare function getStockSchedule(schedule: Schedule): string;
|
|
1145
|
+
declare function getStockAddress(stock: Stock): string | null;
|
|
1146
|
+
|
|
1147
|
+
interface StoreState {
|
|
1148
|
+
loading: boolean;
|
|
1149
|
+
loaded: boolean;
|
|
1150
|
+
store: Store | null;
|
|
1151
|
+
storeId: string;
|
|
1152
|
+
cityId: string | null;
|
|
1153
|
+
}
|
|
1154
|
+
declare const useStoreStore: pinia.StoreDefinition<"zenky:storefront:store", StoreState, {
|
|
1155
|
+
cities(): City[];
|
|
1156
|
+
city(): City | null;
|
|
1157
|
+
stocks(): Stock[];
|
|
1158
|
+
settings(): StoreSettings | null;
|
|
1159
|
+
addressesResolver(): string | null;
|
|
1160
|
+
loyalty(): any;
|
|
1161
|
+
}, {
|
|
1162
|
+
loadStore(inclusions: string): Promise<void>;
|
|
1163
|
+
selectDefaultCity(): City | null;
|
|
1164
|
+
selectCity(cityId: string): City | null;
|
|
1165
|
+
}>;
|
|
1166
|
+
|
|
1167
|
+
export { AddressForm, AddressFormValue, AddressFormValueProvider, ApiErrorHandler, AuthenticationEvent, AuthenticationForm, AuthenticationFormProvider, AuthenticationResult, AuthenticationResultType, AuthenticationStage, AuthenticationStatusCheckerProvider, CategoriesProvider, CategoriesState, CategoriesTreeProvider, CategoryProvider, CollectionsState, ConfirmableDataDestroyer, ConfirmationProvider, CustomerStore, DadataProvider, DataDestroyer, DataDestroyerHandler, DataLoader, DataProvider, EditAddressFormProvider, EmitAuthenticationEvent, FlatCategoriesTreeProvider, FlattenNestedCategory, ItemLoader, ItemProvider, ListLoader, ListProvider, LoaderState, LoginProvider, LogoutProvider, OptionalApiErrorHandler, PaginatedItemsProvider, PaginatedLoader, PaginatedLoaderState, PasswordResetProvider, ProductsCollectionProvider, ProductsCollectionsProvider, RegistrationProvider, ReversedTreeProvider, SplittedCategoriesTreeProvider, StateDataLoader, StateDataLoaderState, StoreState, ZenkyInjection, ZenkyStorage, createStorage, getAddressForm, getApiErrorHandler, getExistedAddress, getExistedAddressDisplayValue, getFirstMedium, getProductsListParamsFromQuery, getProductsListQueryParams, getProductsPaginationRequest, getProductsSource, getSelectedAddress, getSelectedAddressDisplayValue, getStockAddress, getStockSchedule, getStorage, useAddressFormValue, useArticleCategoriesList, useArticleItem, useArticlesList, useAuthenticationForm, useAuthenticationStatusChecker, useCategories, useCategoriesStore, useCategoriesTree, useCategory, useCategoryFeaturesGroupsList, useCategoryFeaturesList, useCollection, useCollections, useCollectionsStore, useCustomer, useCustomerStore, useDadata, useDataDestroyer, useDataLoader, useDeliveryAddressDestroyer, useDeliveryAddressesList, useEditAddressForm, useFeaturesFilters, useFeaturesGroupsFilters, useFlatCategoriesTree, useItemLoader, useListLoader, useLogin, useLogout, useOrderItem, useOrdersList, usePaginatedLoader, usePasswordReset, usePaymentMethodDestroyer, usePaymentMethodsList, usePhoneConfirmation, useProductsList, useProductsPricesRange, useProductsPricesRangeFilters, useRegistration, useReversedTree, useSplittedCategoriesTree, useStateDataLoader, useStoreStore, useSuggestionsRestrictedToCity };
|