@zenky/storefront-api 0.0.17 → 0.0.18

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +1069 -1081
  2. package/package.json +3 -2
package/dist/index.d.ts CHANGED
@@ -1,1300 +1,1288 @@
1
- export interface ClientConfig {
2
- baseUrl?: string;
3
- token?: string;
4
- client?: string;
5
- timezone?: string;
6
- fetchOptions?: any;
7
- }
8
- export interface InclusionRequest {
9
- with?: string;
10
- }
11
- export interface PaginationRequest {
12
- count?: number;
13
- page?: number;
14
- }
15
- export interface SearchRequest {
16
- search?: string;
17
- }
18
- export interface OrderingRequest {
19
- order_by?: string;
20
- }
21
- export interface ListRequest extends PaginationRequest, InclusionRequest, SearchRequest, OrderingRequest {
22
- }
23
- export interface Pagination {
24
- total: number;
25
- count: number;
26
- per_page: number;
27
- current_page: number;
28
- total_pages: number;
29
- links: {
30
- previous?: string | null;
31
- next?: string | null;
32
- };
33
- has_previous_page: boolean;
34
- has_next_page: boolean;
35
- elements: {
36
- type: 'page' | 'placeholder';
37
- page: number | null;
38
- active: boolean;
39
- }[];
40
- }
41
- export interface PaginatedResponse<T> {
42
- items: T[];
43
- pagination: Pagination;
44
- }
45
- export declare class Client {
46
- private readonly baseUrl;
47
- private token;
48
- private readonly client;
49
- private readonly timezone;
50
- private readonly fetchFunction;
51
- private readonly fetchOptions;
52
- static build(config?: ClientConfig | null | undefined, fetcher?: any): Client;
53
- private constructor();
54
- setToken(token: string | null): Client;
55
- request(method: string, path: string, body?: any, apiToken?: string | null): Promise<any>;
56
- }
57
-
58
- export declare abstract class AbstractResource {
59
- protected client: Client;
60
- constructor(client: Client);
61
- protected getStoreUrl(storeId: string, path: string, query?: any): string;
62
- protected getUrl(path: string, query?: any): string;
63
- protected getPaginatedResponse<T>(response: any): PaginatedResponse<T>;
64
- protected getResponse<T>(response: any): T;
65
- }
66
- export declare class ZenkyError extends Error {
67
- readonly err: ApiError | null;
68
- constructor(message: string, error: ApiError | null);
69
- }
70
- export declare class ZenkyStorefront {
71
- protected readonly client: Client;
72
- readonly store: StoreResource;
73
- readonly auth: AuthenticationResource;
74
- readonly customer: CustomersResource;
75
- readonly categories: CategoriesResource;
76
- readonly products: ProductsResource;
77
- readonly addresses: AddressesResource;
78
- readonly orders: OrdersResource;
79
- readonly collections: CollectionsResource;
80
- readonly offers: OffersResource;
81
- readonly articles: ArticlesResource;
82
- readonly feedback: FeedbackResource;
83
- constructor(config?: ClientConfig, fetcher?: any);
84
- setApiToken(token: string | null): ZenkyStorefront;
85
- }
1
+ // Generated by dts-bundle-generator v8.0.1
86
2
 
87
3
  export interface Phone {
88
- number: string;
89
- country: string;
90
- national: string;
4
+ number: string;
5
+ country: string;
6
+ national: string;
91
7
  }
92
8
  export interface GeoLocation {
93
- latitude: number;
94
- longitude: number;
9
+ latitude: number;
10
+ longitude: number;
95
11
  }
96
12
  export interface Discount {
97
- difference: number;
98
- percentage: number;
13
+ difference: number;
14
+ percentage: number;
99
15
  }
100
16
  export declare enum DiscountType {
101
- Amount = "amount",
102
- Percentage = "percentage"
17
+ Amount = "amount",
18
+ Percentage = "percentage"
103
19
  }
104
20
  export declare enum ContactType {
105
- Email = "email",
106
- Website = "website",
107
- Vk = "vk",
108
- Facebook = "facebook",
109
- Instagram = "instagram",
110
- Twitter = "twitter",
111
- Ok = "ok",
112
- Tiktok = "tiktok"
21
+ Email = "email",
22
+ Website = "website",
23
+ Vk = "vk",
24
+ Facebook = "facebook",
25
+ Instagram = "instagram",
26
+ Twitter = "twitter",
27
+ Ok = "ok",
28
+ Tiktok = "tiktok"
113
29
  }
114
30
  export interface Contact {
115
- type: ContactType;
116
- value: string;
31
+ type: ContactType;
32
+ value: string;
117
33
  }
118
34
  export interface ScheduleDay {
119
- hours: string;
35
+ hours: string;
120
36
  }
121
37
  export declare enum TernaryFilter {
122
- Yes = "yes",
123
- No = "no",
124
- Both = "both"
38
+ Yes = "yes",
39
+ No = "no",
40
+ Both = "both"
125
41
  }
126
42
  export interface Schedule {
127
- is_open_now: boolean;
128
- opening_at: string | null;
129
- closing_at: string | null;
130
- days: {
131
- monday: ScheduleDay | null;
132
- tuesday: ScheduleDay | null;
133
- wednesday: ScheduleDay | null;
134
- thursday: ScheduleDay | null;
135
- friday: ScheduleDay | null;
136
- saturday: ScheduleDay | null;
137
- sunday: ScheduleDay | null;
138
- };
43
+ is_open_now: boolean;
44
+ opening_at: string | null;
45
+ closing_at: string | null;
46
+ days: {
47
+ monday: ScheduleDay | null;
48
+ tuesday: ScheduleDay | null;
49
+ wednesday: ScheduleDay | null;
50
+ thursday: ScheduleDay | null;
51
+ friday: ScheduleDay | null;
52
+ saturday: ScheduleDay | null;
53
+ sunday: ScheduleDay | null;
54
+ };
139
55
  }
140
56
  export interface ApiError {
141
- message: string;
142
- original_message: string;
143
- http_code: number;
144
- error_code: string;
145
- meta: any;
57
+ message: string;
58
+ original_message: string;
59
+ http_code: number;
60
+ error_code: string;
61
+ meta: any;
146
62
  }
147
63
  export declare enum OrderAuthenticationMethod {
148
- Disabled = "disabled",
149
- Preauth = "preauth",
150
- Confirmation = "confirmation"
64
+ Disabled = "disabled",
65
+ Preauth = "preauth",
66
+ Confirmation = "confirmation"
151
67
  }
152
68
  export declare enum AddressesProvider {
153
- Dadata = "dadata",
154
- Manual = "manual"
69
+ Dadata = "dadata",
70
+ Manual = "manual"
155
71
  }
156
72
  export declare enum RecaptchaAction {
157
- Registration = "registration",
158
- ResendRegistrationCode = "resend_registration_code",
159
- ResetPassword = "reset_password",
160
- OrderSubmission = "order_submission",
161
- FeedbackRequest = "feedback_request",
162
- CallbackRequest = "callback_request"
73
+ Registration = "registration",
74
+ ResendRegistrationCode = "resend_registration_code",
75
+ ResetPassword = "reset_password",
76
+ OrderSubmission = "order_submission",
77
+ FeedbackRequest = "feedback_request",
78
+ CallbackRequest = "callback_request"
163
79
  }
164
80
  export interface PhoneRequest {
165
- number: string;
166
- country: string;
81
+ number: string;
82
+ country: string;
167
83
  }
168
-
169
84
  export interface DeliveryAddress {
170
- id: string;
171
- resolver: AddressesProvider;
172
- name: string | null;
173
- address: string;
174
- coordinates: GeoLocation | null;
175
- country: string | null;
176
- city: string | null;
177
- settlement: string | null;
178
- street: string | null;
179
- house: string | null;
180
- block: string | null;
181
- apartment: string | null;
182
- entrance: string | null;
183
- floor: string | null;
184
- has_intercom: boolean;
85
+ id: string;
86
+ resolver: AddressesProvider;
87
+ name: string | null;
88
+ address: string;
89
+ coordinates: GeoLocation | null;
90
+ country: string | null;
91
+ city: string | null;
92
+ settlement: string | null;
93
+ street: string | null;
94
+ house: string | null;
95
+ block: string | null;
96
+ apartment: string | null;
97
+ entrance: string | null;
98
+ floor: string | null;
99
+ has_intercom: boolean;
185
100
  }
186
101
  export interface ExistedDeliveryAddressRequest {
187
- id: string;
102
+ id: string;
188
103
  }
189
104
  export interface DadataDeliveryAddressRequest {
190
- name?: string;
191
- address: string;
192
- house?: string;
193
- block?: string;
194
- apartment?: string;
195
- entrance?: string;
196
- floor?: string;
197
- has_intercom?: boolean;
105
+ name?: string;
106
+ address: string;
107
+ house?: string;
108
+ block?: string;
109
+ apartment?: string;
110
+ entrance?: string;
111
+ floor?: string;
112
+ has_intercom?: boolean;
198
113
  }
199
114
  export interface ManualDeliveryAddressRequest {
200
- name?: string;
201
- city?: string;
202
- street?: string;
203
- house?: string;
204
- block?: string;
205
- apartment?: string;
206
- entrance?: string;
207
- floor?: string;
208
- has_intercom?: boolean;
115
+ name?: string;
116
+ city?: string;
117
+ street?: string;
118
+ house?: string;
119
+ block?: string;
120
+ apartment?: string;
121
+ entrance?: string;
122
+ floor?: string;
123
+ has_intercom?: boolean;
209
124
  }
210
- export interface ArticleCategory {
211
- id: string;
212
- short_id: string;
213
- slug: string | null;
214
- name: string | null;
125
+ export interface DadataAddressSuggestion {
126
+ value: string | null;
127
+ unrestricted_value: string | null;
128
+ data: {
129
+ postal_code: string | null;
130
+ country: string | null;
131
+ country_code: string | null;
132
+ federal_district: string | null;
133
+ region_fias_id: string | null;
134
+ region_kladr_id: string | null;
135
+ region_iso_code: string | null;
136
+ region_with_type: string | null;
137
+ region_type: string | null;
138
+ region_type_full: string | null;
139
+ region: string | null;
140
+ area_fias_id: string | null;
141
+ area_kladr_id: string | null;
142
+ area_with_type: string | null;
143
+ area_type: string | null;
144
+ area_type_full: string | null;
145
+ area: string | null;
146
+ city_fias_id: string | null;
147
+ city_kladr_id: string | null;
148
+ city_with_type: string | null;
149
+ city_type: string | null;
150
+ city_type_full: string | null;
151
+ city: string | null;
152
+ city_area: string | null;
153
+ city_district_fias_id: string | null;
154
+ city_district_with_type: string | null;
155
+ city_district_type: string | null;
156
+ city_district_type_full: string | null;
157
+ city_district: string | null;
158
+ settlement_fias_id: string | null;
159
+ settlement_kladr_id: string | null;
160
+ settlement_with_type: string | null;
161
+ settlement_type: string | null;
162
+ settlement_type_full: string | null;
163
+ settlement: string | null;
164
+ street_fias_id: string | null;
165
+ street_kladr_id: string | null;
166
+ street_with_type: string | null;
167
+ street_type: string | null;
168
+ street_type_full: string | null;
169
+ street: string | null;
170
+ stead_fias_id: string | null;
171
+ stead_cadnum: string | null;
172
+ stead_type: string | null;
173
+ stead_type_full: string | null;
174
+ stead: string | null;
175
+ house_fias_id: string | null;
176
+ house_kladr_id: string | null;
177
+ house_cadnum: string | null;
178
+ house_type: string | null;
179
+ house_type_full: string | null;
180
+ house: string | null;
181
+ block_type: string | null;
182
+ block_type_full: string | null;
183
+ block: string | null;
184
+ flat_fias_id: string | null;
185
+ flat_cadnum: string | null;
186
+ flat_type: string | null;
187
+ flat_type_full: string | null;
188
+ flat: string | null;
189
+ flat_area: string | null;
190
+ square_meter_price: string | null;
191
+ flat_price: string | null;
192
+ room_fias_id: string | null;
193
+ room_cadnum: string | null;
194
+ room_type: string | null;
195
+ room_type_full: string | null;
196
+ postal_box: string | null;
197
+ fias_id: string | null;
198
+ fias_level: string | null;
199
+ fias_actuality_state: string | null;
200
+ kladr_id: string | null;
201
+ geoname_id: string | null;
202
+ capital_marker: string | null;
203
+ okato: string | null;
204
+ oktmo: string | null;
205
+ tax_office: string | null;
206
+ tax_office_legal: string | null;
207
+ timezone: string | null;
208
+ geo_lat: string | null;
209
+ geo_lon: string | null;
210
+ qc_geo: string | null;
211
+ beltway_hit: string | null;
212
+ beltway_distance: string | null;
213
+ metro?: {
214
+ name: string | null;
215
+ line: string | null;
216
+ distance: string | null;
217
+ }[] | null;
218
+ };
219
+ }
220
+ export declare enum AddressSuggestionsProvider {
221
+ DADATA = "dadata"
215
222
  }
216
- export interface Article {
217
- id: string;
218
- short_id: string;
219
- slug: string | null;
220
- title: string | null;
221
- intro: string | null;
222
- body: string | null;
223
- updated_at: string;
224
- cover: Media | null;
225
- category?: ArticleCategory | null;
223
+ export interface AddressSuggestions {
224
+ provider: AddressSuggestionsProvider;
225
+ suggestions: DadataAddressSuggestion[];
226
226
  }
227
- export interface ListArticlesRequest extends ListRequest {
228
- category_id?: string;
227
+ export interface AddressSuggestionsRequest {
228
+ query: string;
229
+ city_id?: string;
230
+ count?: number;
229
231
  }
230
- export declare class ArticlesResource extends AbstractResource {
231
- getArticleCategories(storeId: string): Promise<PaginatedResponse<ArticleCategory>>;
232
- getArticleCategory(storeId: string, categoryId: string): Promise<ArticleCategory>;
233
- getArticles(storeId: string, request?: ListArticlesRequest): Promise<PaginatedResponse<ArticleCategory>>;
234
- getArticle(storeId: string, articleId: string, request?: InclusionRequest): Promise<ArticleCategory>;
232
+ export interface Image {
233
+ url: string;
234
+ width: number;
235
+ height: number;
235
236
  }
236
- export interface FeatureValue {
237
- id: string;
238
- alias: string;
239
- name: string | null;
240
- range: number | null;
237
+ export interface Media {
238
+ placeholder: Image | null;
239
+ medium: Image | null;
240
+ large: Image | null;
241
+ xlarge: Image | null;
242
+ hd: Image | null;
241
243
  }
242
- export declare enum FeatureType {
243
- Select = "select",
244
- MutipleSelect = "mutiple_select",
245
- Checkboxes = "checkboxes",
246
- Radios = "radios",
247
- Range = "range",
248
- Text = "text"
244
+ export interface ClientConfig {
245
+ baseUrl?: string;
246
+ token?: string;
247
+ client?: string;
248
+ timezone?: string;
249
+ fetchOptions?: any;
249
250
  }
250
- export declare enum FeatureRange {
251
- Integer = "integer",
252
- Float = "float"
251
+ export interface InclusionRequest {
252
+ with?: string;
253
253
  }
254
- export interface Feature {
255
- id: string;
256
- alias: string;
257
- name: string | null;
258
- filterable: boolean;
259
- type: FeatureType;
260
- range: FeatureRange | null;
261
- values: FeatureValue[];
254
+ export interface PaginationRequest {
255
+ count?: number;
256
+ page?: number;
262
257
  }
263
- export interface FeaturesGroup {
264
- id: string;
265
- name: string | null;
266
- description: string | null;
267
- features: Feature[];
258
+ export interface SearchRequest {
259
+ search?: string;
268
260
  }
269
- export declare class CategoriesResource extends AbstractResource {
270
- getCategories(storeId: string, request?: CategoriesListRequest): Promise<PaginatedResponse<Category>>;
271
- getCategoriesTree(storeId: string, request?: InclusionRequest): Promise<NestedCategory[]>;
272
- getCategory(storeId: string, categoryId: string, request?: InclusionRequest): Promise<Category>;
273
- getFeaturesGroups(storeId: string, categoryId: string): Promise<FeaturesGroup[]>;
274
- getFeatures(storeId: string, categoryId: string): Promise<Feature[]>;
261
+ export interface OrderingRequest {
262
+ order_by?: string;
275
263
  }
276
- export interface Category {
277
- id: string;
278
- short_id: string;
279
- parent_id: string | null;
280
- is_featured: boolean;
281
- slug: string | null;
282
- name: string | null;
283
- description: string | null;
284
- cover?: Media | null;
285
- seo?: Seo | null;
264
+ export interface ListRequest extends PaginationRequest, InclusionRequest, SearchRequest, OrderingRequest {
286
265
  }
287
- export interface NestedCategory extends Category {
288
- children: NestedCategory[];
266
+ export interface Pagination {
267
+ total: number;
268
+ count: number;
269
+ per_page: number;
270
+ current_page: number;
271
+ total_pages: number;
272
+ links: {
273
+ previous?: string | null;
274
+ next?: string | null;
275
+ };
276
+ has_previous_page: boolean;
277
+ has_next_page: boolean;
278
+ elements: {
279
+ type: "page" | "placeholder";
280
+ page: number | null;
281
+ active: boolean;
282
+ }[];
289
283
  }
290
- export interface CategoriesListRequest extends ListRequest {
291
- featured?: boolean;
292
- }export interface SeoMetaTagAttribute {
293
- attribute: string;
294
- value: string;
284
+ export interface PaginatedResponse<T> {
285
+ items: T[];
286
+ pagination: Pagination;
295
287
  }
296
- export interface SeoMetaTag {
297
- name: SeoMetaTagAttribute;
298
- value: SeoMetaTagAttribute;
299
- additional: SeoMetaTagAttribute[];
288
+ export interface ArticleCategory {
289
+ id: string;
290
+ short_id: string;
291
+ slug: string | null;
292
+ name: string | null;
300
293
  }
301
- export interface Seo {
302
- title: string | null;
303
- description: string | null;
304
- meta: SeoMetaTag[];
294
+ export interface Article {
295
+ id: string;
296
+ short_id: string;
297
+ slug: string | null;
298
+ title: string | null;
299
+ intro: string | null;
300
+ body: string | null;
301
+ updated_at: string;
302
+ cover: Media | null;
303
+ category?: ArticleCategory | null;
305
304
  }
306
- export interface Image {
307
- url: string;
308
- width: number;
309
- height: number;
305
+ export interface ListArticlesRequest extends ListRequest {
306
+ category_id?: string;
307
+ }
308
+ declare class Client {
309
+ private readonly baseUrl;
310
+ private token;
311
+ private readonly client;
312
+ private readonly timezone;
313
+ private readonly fetchFunction;
314
+ private readonly fetchOptions;
315
+ static build(config?: ClientConfig | null | undefined, fetcher?: any): Client;
316
+ private constructor();
317
+ setToken(token: string | null): Client;
318
+ request(method: string, path: string, body?: any, apiToken?: string | null): Promise<any>;
319
+ }
320
+ declare abstract class AbstractResource {
321
+ protected client: Client;
322
+ constructor(client: Client);
323
+ protected getStoreUrl(storeId: string, path: string, query?: any): string;
324
+ protected getUrl(path: string, query?: any): string;
325
+ protected getPaginatedResponse<T>(response: any): PaginatedResponse<T>;
326
+ protected getResponse<T>(response: any): T;
310
327
  }
311
- export interface Media {
312
- placeholder: Image | null;
313
- medium: Image | null;
314
- large: Image | null;
315
- xlarge: Image | null;
316
- hd: Image | null;
328
+ export declare class ArticlesResource extends AbstractResource {
329
+ getArticleCategories(storeId: string): Promise<PaginatedResponse<ArticleCategory>>;
330
+ getArticleCategory(storeId: string, categoryId: string): Promise<ArticleCategory>;
331
+ getArticles(storeId: string, request?: ListArticlesRequest): Promise<PaginatedResponse<ArticleCategory>>;
332
+ getArticle(storeId: string, articleId: string, request?: InclusionRequest): Promise<ArticleCategory>;
317
333
  }
318
- export interface ProductsCollection {
319
- id: string;
320
- name: string | null;
321
- description: string | null;
322
- cover: Media | null;
334
+ export interface SeoMetaTagAttribute {
335
+ attribute: string;
336
+ value: string;
323
337
  }
324
- export interface CollectionsListRequest extends PaginationRequest, SearchRequest, OrderingRequest {
338
+ export interface SeoMetaTag {
339
+ name: SeoMetaTagAttribute;
340
+ value: SeoMetaTagAttribute;
341
+ additional: SeoMetaTagAttribute[];
325
342
  }
326
- export declare class CollectionsResource extends AbstractResource {
327
- getCollections(storeId: string, request?: CollectionsListRequest): Promise<PaginatedResponse<ProductsCollection>>;
328
- getCollection(storeId: string, id: string): Promise<ProductsCollection>;
343
+ export interface Seo {
344
+ title: string | null;
345
+ description: string | null;
346
+ meta: SeoMetaTag[];
329
347
  }
330
- export interface BonusesLevel {
331
- id: string;
332
- name: string;
333
- expenses: number;
334
- cashback_rate: number | null;
335
- payment_rate: number | null;
348
+ export interface Category {
349
+ id: string;
350
+ short_id: string;
351
+ parent_id: string | null;
352
+ is_featured: boolean;
353
+ slug: string | null;
354
+ name: string | null;
355
+ description: string | null;
356
+ cover?: Media | null;
357
+ seo?: Seo | null;
336
358
  }
337
- export interface LoyaltyRates {
338
- cashback: number | null;
339
- payment: number | null;
359
+ export interface NestedCategory extends Category {
360
+ children: NestedCategory[];
340
361
  }
341
- export declare enum BonusesTransactionType {
342
- Increase = "increase",
343
- Decrease = "decrease"
362
+ export interface CategoriesListRequest extends ListRequest {
363
+ featured?: boolean;
344
364
  }
345
- export declare enum BonusesTransactionStatus {
346
- Pending = "pending",
347
- Confirmed = "confirmed",
348
- Cancelled = "cancelled",
349
- Rejected = "rejected",
350
- Refunded = "refunded",
351
- PartiallyRefunded = "partially_refunded"
365
+ export interface FeatureValue {
366
+ id: string;
367
+ alias: string;
368
+ name: string | null;
369
+ range: number | null;
352
370
  }
353
- export declare enum BonusesTransactionReason {
354
- Manual = "manual",
355
- Cashback = "cashback",
356
- ReferralReward = "referral_reward",
357
- RecruitReward = "recruit_reward",
358
- Payment = "payment",
359
- Cancellation = "cancellation",
360
- Refund = "refund",
361
- Adjustment = "adjustment",
362
- WelcomeBonuses = "welcome_bonuses",
363
- PromotionReward = "promotion_reward",
364
- External = "external"
371
+ export declare enum FeatureType {
372
+ Select = "select",
373
+ MutipleSelect = "mutiple_select",
374
+ Checkboxes = "checkboxes",
375
+ Radios = "radios",
376
+ Range = "range",
377
+ Text = "text"
365
378
  }
366
- export interface BonusesTransaction {
367
- id: string;
368
- order_id: string | null;
369
- type: BonusesTransactionType;
370
- status: BonusesTransactionStatus;
371
- reason: BonusesTransactionReason;
372
- amount: number;
373
- source_amount: number | null;
374
- created_at: string;
375
- confirmed_at: string | null;
376
- cancelled_at: string | null;
379
+ export declare enum FeatureRange {
380
+ Integer = "integer",
381
+ Float = "float"
377
382
  }
378
- export interface ListBonusesTransactionsRequest extends PaginationRequest {
379
- type?: BonusesTransactionType;
380
- status?: BonusesTransactionStatus;
381
- reason?: BonusesTransactionReason;
383
+ export interface Feature {
384
+ id: string;
385
+ alias: string;
386
+ name: string | null;
387
+ filterable: boolean;
388
+ type: FeatureType;
389
+ range: FeatureRange | null;
390
+ values: FeatureValue[];
382
391
  }
383
- export interface ListCustomerBonusesTransactionsRequest extends ListBonusesTransactionsRequest {
384
- order_id?: string;
392
+ export interface FeaturesGroup {
393
+ id: string;
394
+ name: string | null;
395
+ description: string | null;
396
+ features: Feature[];
385
397
  }
386
- export declare enum Gender {
387
- Female = "female",
388
- Male = "male",
389
- Other = "other"
398
+ export declare class CategoriesResource extends AbstractResource {
399
+ getCategories(storeId: string, request?: CategoriesListRequest): Promise<PaginatedResponse<Category>>;
400
+ getCategoriesTree(storeId: string, request?: InclusionRequest): Promise<NestedCategory[]>;
401
+ getCategory(storeId: string, categoryId: string, request?: InclusionRequest): Promise<Category>;
402
+ getFeaturesGroups(storeId: string, categoryId: string): Promise<FeaturesGroup[]>;
403
+ getFeatures(storeId: string, categoryId: string): Promise<Feature[]>;
390
404
  }
391
- export interface CustomerSettings {
392
- onesignal_id: string | null;
393
- device_id: string | null;
394
- device_token: string | null;
395
- device_os: string | null;
396
- barcode: string | null;
397
- qrcode: string | null;
405
+ export declare class ZenkyError extends Error {
406
+ readonly err: ApiError | null;
407
+ constructor(message: string, error: ApiError | null);
398
408
  }
399
- export interface CustomerLoyaltyProfile {
400
- referral_program: {
401
- code: string;
402
- join_url: string;
403
- invite_url: string;
404
- };
405
- balance: number;
406
- bonuses_level: BonusesLevel | null;
407
- rates: LoyaltyRates | null;
408
- settings?: CustomerSettings;
409
- avatar?: Media | null;
409
+ export declare class ZenkyErrorBuilder {
410
+ static build(response: any): Promise<ZenkyError>;
410
411
  }
411
- export interface Customer {
412
- id: string;
413
- store_profile_id: string;
414
- first_name: string | null;
415
- last_name: string | null;
416
- phone: Phone;
417
- gender: Gender;
418
- birth_date: string | null;
419
- registered_at: string;
420
- loyalty: CustomerLoyaltyProfile | null;
412
+ export interface Stock {
413
+ id: string;
414
+ name: string | null;
415
+ description: string | null;
416
+ address: string | null;
417
+ coordinates: GeoLocation | null;
418
+ links: Contact[];
419
+ phones: Phone[];
420
+ schedule: Schedule | null;
421
421
  }
422
-
423
- export interface UpdateCustomerProfileRequest {
424
- first_name?: string;
425
- last_name?: string;
426
- gender?: Gender;
427
- birth_date?: string;
428
- password?: string;
429
- current_password?: string;
422
+ export interface DeliveryZone {
423
+ id: string;
424
+ name: string | null;
425
+ coordinates: GeoLocation[];
426
+ description: string | null;
427
+ color: string | null;
428
+ min_price: number | null;
429
+ free_delivery_price: number | null;
430
+ delivery_price: number | null;
431
+ delivery_time: string | null;
430
432
  }
431
-
432
- export interface RemoveCustomerProfileRequest {
433
- password: string;
433
+ export interface City {
434
+ id: string;
435
+ is_default: boolean;
436
+ name: string | null;
437
+ timezone: string;
438
+ coordinates: GeoLocation | null;
439
+ stocks: Stock[];
440
+ delivery_zones: DeliveryZone[];
434
441
  }
435
-
436
- export interface UpdateCustomerSettingsRequest {
437
- onesignal_id?: string;
438
- device_id?: string;
439
- device_token?: string;
440
- device_os?: string;
441
- barcode?: string;
442
- qrcode?: string;
442
+ export interface StoreSettings {
443
+ country: string;
444
+ currency: string;
445
+ orders: {
446
+ authentication_method: OrderAuthenticationMethod;
447
+ use_early_delivery: boolean;
448
+ addresses_provider: AddressesProvider;
449
+ };
450
+ products: {
451
+ use_stock_filter: boolean;
452
+ };
453
+ loyalty: {
454
+ enabled: boolean;
455
+ bonuses: {
456
+ on_demand_balance_enabled: boolean;
457
+ pin_enabled: boolean;
458
+ };
459
+ };
460
+ recaptcha: {
461
+ actions: RecaptchaAction[];
462
+ key: string;
463
+ } | null;
464
+ websockets: {
465
+ app_id: string;
466
+ app_key: string;
467
+ options: {
468
+ host: string;
469
+ port: number;
470
+ };
471
+ } | null;
443
472
  }
444
-
445
- export interface DeliveryAddressRequest {
446
- delivery_address: DadataDeliveryAddressRequest | ManualDeliveryAddressRequest;
473
+ export interface Store {
474
+ id: string;
475
+ name: string;
476
+ domain: string | null;
477
+ app_store_url: string | null;
478
+ google_play_url: string | null;
479
+ logo: Media | null;
480
+ square_logo: Media | null;
481
+ links: Contact[];
482
+ phones: Phone[];
483
+ cities: City[];
484
+ settings: StoreSettings;
447
485
  }
448
-
449
- export enum AcquiringType {
450
- CloudPayments = 'cloudpayments',
486
+ export declare class StoreResource extends AbstractResource {
487
+ getStore(storeId: string): Promise<Store>;
488
+ getStoreByBundleId(bundleId: string): Promise<Store>;
451
489
  }
452
-
453
- export enum PaymentSystemType {
454
- Visa = 'visa',
455
- MasterCard = 'master-card',
456
- MIR = 'mir',
457
- Maestro = 'maestro',
458
- AmericanExpress = 'american-express',
459
- DinersClub = 'diners-club',
460
- Discover = 'discover',
461
- JCB = 'jcb',
462
- UnionPay = 'union-pay',
490
+ export interface ProductsCollection {
491
+ id: string;
492
+ name: string | null;
493
+ description: string | null;
494
+ cover: Media | null;
463
495
  }
464
-
465
- export interface PaymentSystem {
466
- id: PaymentSystemType;
467
- name: string;
468
- logos: {
469
- black: string | null;
470
- white: string | null;
471
- colored: string | null;
472
- };
496
+ export interface CollectionsListRequest extends PaginationRequest, SearchRequest, OrderingRequest {
473
497
  }
474
-
475
- export interface BankInfo {
476
- id: string;
477
- name: string;
478
- url: string;
479
- background_colors: string[];
480
- primary_background_color: string;
481
- background_style: 'dark' | 'white';
482
- logo_style: 'dark' | 'white';
483
- text_color: string;
484
- logos: {
485
- png: string | null;
486
- svg: string | null;
487
- };
488
- payment_system: PaymentSystem;
498
+ export declare class CollectionsResource extends AbstractResource {
499
+ getCollections(storeId: string, request?: CollectionsListRequest): Promise<PaginatedResponse<ProductsCollection>>;
500
+ getCollection(storeId: string, id: string): Promise<ProductsCollection>;
489
501
  }
490
-
491
- export interface CustomerPaymentMethod {
492
- id: string;
493
- acquiring_type: AcquiringType;
494
- card_type: PaymentSystemType;
495
- card_first_six: string;
496
- card_last_four: string;
497
- name: string;
498
- bank: BankInfo | null;
502
+ export interface OfferBanner {
503
+ title: string | null;
504
+ description: string | null;
505
+ image: Media | null;
499
506
  }
500
-
501
- export declare class CustomersResource extends AbstractResource {
502
- getProfile(storeId: string, request?: InclusionRequest, apiToken?: string): Promise<Customer>;
503
- updateProfile(storeId: string, request: UpdateCustomerProfileRequest, apiToken?: string): Promise<Customer>;
504
- removeProfile(storeId: string, request: RemoveCustomerProfileRequest, apiToken?: string): Promise<boolean>;
505
- getSettings(storeId: string, apiToken?: string): Promise<CustomerSettings>;
506
- updateSettings(storeId: string, request: UpdateCustomerSettingsRequest, apiToken?: string): Promise<CustomerSettings>;
507
- getAddresses(storeId: string, request?: ListRequest, apiToken?: string): Promise<PaginatedResponse<DeliveryAddress>>;
508
- createAddress(storeId: string, request: DeliveryAddressRequest, apiToken?: string): Promise<DeliveryAddress>;
509
- updateAddress(storeId: string, addressId: string, request: DeliveryAddressRequest, apiToken?: string): Promise<DeliveryAddress>;
510
- deleteAddress(storeId: string, addressId: string, apiToken?: string): Promise<boolean>;
511
- getPaymentMethods(storeId: string, request?: PaginationRequest, apiToken?: string): Promise<PaginatedResponse<CustomerPaymentMethod>>;
512
- deletePaymentMethod(storeId: string, paymentMethodId: string, apiToken?: string): Promise<boolean>;
513
- getBonusesTransactions(storeId: string, request?: ListCustomerBonusesTransactionsRequest, apiToken?: string): Promise<PaginatedResponse<BonusesTransaction>>;
507
+ export interface OfferArticle {
508
+ title: string | null;
509
+ intro: string | null;
510
+ body: string | null;
511
+ cover: Media | null;
512
+ }
513
+ export interface Offer {
514
+ id: string;
515
+ short_id: string;
516
+ slug: string | null;
517
+ banners: {
518
+ desktop: OfferBanner | null;
519
+ mobile: OfferBanner | null;
520
+ };
521
+ article?: OfferArticle | null;
522
+ }
523
+ export declare class OffersResource extends AbstractResource {
524
+ getOffers(storeId: string, request?: ListRequest): Promise<PaginatedResponse<Offer>>;
525
+ getOffer(storeId: string, offerId: string, request?: InclusionRequest): Promise<Offer>;
514
526
  }
515
527
  export interface Feedback {
516
- id: string;
517
- name: string | null;
518
- email: string | null;
519
- phone: Phone | null;
520
- comment: string | null;
521
- created_at: string;
528
+ id: string;
529
+ name: string | null;
530
+ email: string | null;
531
+ phone: Phone | null;
532
+ comment: string | null;
533
+ created_at: string;
522
534
  }
523
535
  export interface FeedbackRequest {
524
- name?: string;
525
- email?: string;
526
- phone?: PhoneRequest;
527
- comment?: string;
536
+ name?: string;
537
+ email?: string;
538
+ phone?: PhoneRequest;
539
+ comment?: string;
528
540
  }
529
541
  export interface CallbackRequest {
530
- phone: PhoneRequest;
542
+ phone: PhoneRequest;
531
543
  }
532
544
  export declare class FeedbackResource extends AbstractResource {
533
- createFeedback(storeId: string, request: FeedbackRequest): Promise<Feedback>;
534
- createCallback(storeId: string, request: CallbackRequest): Promise<boolean>;
545
+ createFeedback(storeId: string, request: FeedbackRequest): Promise<Feedback>;
546
+ createCallback(storeId: string, request: CallbackRequest): Promise<boolean>;
535
547
  }
536
548
  export interface Modifier {
537
- id: string;
538
- sku: string | null;
539
- name: string | null;
540
- price: number | null;
549
+ id: string;
550
+ sku: string | null;
551
+ name: string | null;
552
+ price: number | null;
541
553
  }
542
554
  export interface BasicModifiersGroup {
543
- id: string;
544
- name: string | null;
555
+ id: string;
556
+ name: string | null;
545
557
  }
546
558
  export interface ModifiersGroup extends BasicModifiersGroup {
547
- modifiers: Modifier[];
559
+ modifiers: Modifier[];
548
560
  }
549
561
  export interface ProductModifier {
550
- modifier: Modifier;
551
- is_required: boolean;
552
- min_quantity: number | null;
553
- max_quantity: number | null;
562
+ modifier: Modifier;
563
+ is_required: boolean;
564
+ min_quantity: number | null;
565
+ max_quantity: number | null;
554
566
  }
555
567
  export interface ProductModifiersGroup {
556
- group: ModifiersGroup;
557
- is_required: boolean;
558
- min_quantity: number | null;
559
- max_quantity: number | null;
560
- }
561
- export interface OfferBanner {
562
- title: string | null;
563
- description: string | null;
564
- image: Media | null;
565
- }
566
- export interface OfferArticle {
567
- title: string | null;
568
- intro: string | null;
569
- body: string | null;
570
- cover: Media | null;
571
- }
572
- export interface Offer {
573
- id: string;
574
- short_id: string;
575
- slug: string | null;
576
- banners: {
577
- desktop: OfferBanner | null;
578
- mobile: OfferBanner | null;
579
- };
580
- article?: OfferArticle | null;
581
- }
582
- export declare class OffersResource extends AbstractResource {
583
- getOffers(storeId: string, request?: ListRequest): Promise<PaginatedResponse<Offer>>;
584
- getOffer(storeId: string, offerId: string, request?: InclusionRequest): Promise<Offer>;
568
+ group: ModifiersGroup;
569
+ is_required: boolean;
570
+ min_quantity: number | null;
571
+ max_quantity: number | null;
585
572
  }
586
573
  export declare enum UnitType {
587
- Piece = "piece",
588
- Gram = "gram",
589
- Kilogram = "kilogram",
590
- Meter = "meter"
574
+ Piece = "piece",
575
+ Gram = "gram",
576
+ Kilogram = "kilogram",
577
+ Meter = "meter"
591
578
  }
592
579
  export declare enum Dimension {
593
- Weight = "weight",
594
- Width = "width",
595
- Height = "height",
596
- Length = "length"
580
+ Weight = "weight",
581
+ Width = "width",
582
+ Height = "height",
583
+ Length = "length"
597
584
  }
598
585
  export declare enum DimensionType {
599
- Netto = "netto",
600
- Brutto = "brutto"
586
+ Netto = "netto",
587
+ Brutto = "brutto"
601
588
  }
602
589
  export declare enum VariantOptionType {
603
- Color = "color"
590
+ Color = "color"
604
591
  }
605
592
  export declare enum ProductContextType {
606
- Category = "category",
607
- Group = "group",
608
- VariantOption = "variant_option",
609
- VariantOptionValue = "variant_option_value"
593
+ Category = "category",
594
+ Group = "group",
595
+ VariantOption = "variant_option",
596
+ VariantOptionValue = "variant_option_value"
610
597
  }
611
598
  export interface ProductVariantPrice {
612
- stock_id: string | null;
613
- price: number;
614
- original_price: number | null;
615
- discount: Discount | null;
599
+ stock_id: string | null;
600
+ price: number;
601
+ original_price: number | null;
602
+ discount: Discount | null;
616
603
  }
617
604
  export interface ProductVariantDimension {
618
- dimension: Dimension;
619
- type: DimensionType;
620
- value: number;
605
+ dimension: Dimension;
606
+ type: DimensionType;
607
+ value: number;
621
608
  }
622
609
  export interface ProductVariantRemainder {
623
- stock_id: string;
624
- quantity: number;
625
- label: string | null;
610
+ stock_id: string;
611
+ quantity: number;
612
+ label: string | null;
626
613
  }
627
614
  export interface ProductVariantOptionValue {
628
- id: string;
629
- name: string | null;
630
- color: string | null;
615
+ id: string;
616
+ name: string | null;
617
+ color: string | null;
631
618
  }
632
619
  export interface ProductVariantOption {
633
- id: string;
634
- name: string | null;
635
- type: VariantOptionType | null;
636
- value: ProductVariantOptionValue;
620
+ id: string;
621
+ name: string | null;
622
+ type: VariantOptionType | null;
623
+ value: ProductVariantOptionValue;
637
624
  }
638
625
  export interface ProductVariant {
639
- id: string;
640
- sku: string | null;
641
- barcode: string | null;
642
- name: string | null;
643
- price: number;
644
- original_price: number | null;
645
- discount: Discount | null;
646
- default_modifiers?: {
647
- modifiers: {
648
- modifier_id: string;
649
- modifiers_group_id: string | null;
650
- quantity: number;
651
- }[];
652
- hash: string | null;
653
- } | null;
654
- prices?: ProductVariantPrice[];
655
- dimensions?: ProductVariantDimension[];
656
- remainders?: ProductVariantRemainder[];
657
- options?: ProductVariantOption[];
626
+ id: string;
627
+ sku: string | null;
628
+ barcode: string | null;
629
+ name: string | null;
630
+ price: number;
631
+ original_price: number | null;
632
+ discount: Discount | null;
633
+ default_modifiers?: {
634
+ modifiers: {
635
+ modifier_id: string;
636
+ modifiers_group_id: string | null;
637
+ quantity: number;
638
+ }[];
639
+ hash: string | null;
640
+ } | null;
641
+ prices?: ProductVariantPrice[];
642
+ dimensions?: ProductVariantDimension[];
643
+ remainders?: ProductVariantRemainder[];
644
+ options?: ProductVariantOption[];
658
645
  }
659
646
  export interface Product {
660
- id: string;
661
- short_id: string;
662
- slug: string | null;
663
- name: string | null;
664
- description: string | null;
665
- unit_type: UnitType;
666
- weight: number | null;
667
- quantity_step: number | null;
668
- is_promotion_reward: boolean;
669
- categories: Category[];
670
- images: Media[];
671
- variants?: ProductVariant[];
672
- features?: Feature[];
673
- features_groups: FeaturesGroup[];
674
- modifiers?: ProductModifier[];
675
- modifiers_groups?: ProductModifiersGroup[];
676
- seo?: Seo;
647
+ id: string;
648
+ short_id: string;
649
+ slug: string | null;
650
+ name: string | null;
651
+ description: string | null;
652
+ unit_type: UnitType;
653
+ weight: number | null;
654
+ quantity_step: number | null;
655
+ is_promotion_reward: boolean;
656
+ categories: Category[];
657
+ images: Media[];
658
+ variants?: ProductVariant[];
659
+ features?: Feature[];
660
+ features_groups: FeaturesGroup[];
661
+ modifiers?: ProductModifier[];
662
+ modifiers_groups?: ProductModifiersGroup[];
663
+ seo?: Seo;
677
664
  }
678
665
  export interface ListProductsRequest extends ListRequest {
679
- category_id?: string;
680
- features?: {
681
- [key: string]: string;
682
- };
683
- f?: {
684
- [key: string]: string;
685
- };
686
- city_id?: string;
687
- stock_id?: string;
688
- collection_id?: string;
689
- min_price?: number | string;
690
- max_price?: number | string;
691
- featured_categories?: boolean;
692
- promotion_reward?: TernaryFilter;
693
- context_type?: ProductContextType;
694
- context_id?: string;
666
+ category_id?: string;
667
+ features?: {
668
+ [key: string]: string;
669
+ };
670
+ f?: {
671
+ [key: string]: string;
672
+ };
673
+ city_id?: string;
674
+ stock_id?: string;
675
+ collection_id?: string;
676
+ min_price?: number | string;
677
+ max_price?: number | string;
678
+ featured_categories?: boolean;
679
+ promotion_reward?: TernaryFilter;
680
+ context_type?: ProductContextType;
681
+ context_id?: string;
695
682
  }
696
683
  export interface ViewProductRequest extends InclusionRequest {
697
- stock_id?: string;
684
+ stock_id?: string;
698
685
  }
699
686
  export interface ProductVariantPriceCalculation {
700
- price: number;
701
- original_price: number | null;
702
- discount: Discount | null;
703
- modifiers_hash: string | null;
687
+ price: number;
688
+ original_price: number | null;
689
+ discount: Discount | null;
690
+ modifiers_hash: string | null;
704
691
  }
705
692
  export interface ProductModifiersRequest {
706
- modifier_id: string;
707
- modifiers_group_id?: string | null;
708
- quantity: number;
693
+ modifier_id: string;
694
+ modifiers_group_id?: string | null;
695
+ quantity: number;
709
696
  }
710
697
  export interface ProductVariantPriceCalculationRequest {
711
- city_id?: string;
712
- stock_id?: string;
713
- modifiers?: ProductModifiersRequest[];
698
+ city_id?: string;
699
+ stock_id?: string;
700
+ modifiers?: ProductModifiersRequest[];
714
701
  }
715
702
  export declare class ProductsResource extends AbstractResource {
716
- getProducts(storeId: string, request?: ListProductsRequest): Promise<PaginatedResponse<Product>>;
717
- getProduct(storeId: string, productId: string, request?: ViewProductRequest): Promise<Product>;
718
- getProductVariantPrice(storeId: string, productId: string, variantId: string, request: ProductVariantPriceCalculationRequest): Promise<ProductVariantPriceCalculation>;
703
+ getProducts(storeId: string, request?: ListProductsRequest): Promise<PaginatedResponse<Product>>;
704
+ getProduct(storeId: string, productId: string, request?: ViewProductRequest): Promise<Product>;
705
+ getProductVariantPrice(storeId: string, productId: string, variantId: string, request: ProductVariantPriceCalculationRequest): Promise<ProductVariantPriceCalculation>;
719
706
  }
720
- export interface Stock {
721
- id: string;
722
- name: string | null;
723
- description: string | null;
724
- address: string | null;
725
- coordinates: GeoLocation | null;
726
- links: Contact[];
727
- phones: Phone[];
728
- schedule: Schedule | null;
707
+ export interface BonusesLevel {
708
+ id: string;
709
+ name: string;
710
+ expenses: number;
711
+ cashback_rate: number | null;
712
+ payment_rate: number | null;
729
713
  }
730
- export interface DeliveryZone {
731
- id: string;
732
- name: string | null;
733
- coordinates: GeoLocation[];
734
- description: string | null;
735
- color: string | null;
736
- min_price: number | null;
737
- free_delivery_price: number | null;
738
- delivery_price: number | null;
739
- delivery_time: string | null;
714
+ export interface LoyaltyRates {
715
+ cashback: number | null;
716
+ payment: number | null;
740
717
  }
741
- export interface City {
742
- id: string;
743
- is_default: boolean;
744
- name: string | null;
745
- timezone: string;
746
- coordinates: GeoLocation | null;
747
- stocks: Stock[];
748
- delivery_zones: DeliveryZone[];
718
+ export declare enum BonusesTransactionType {
719
+ Increase = "increase",
720
+ Decrease = "decrease"
749
721
  }
750
- export interface StoreSettings {
751
- country: string;
752
- currency: string;
753
- orders: {
754
- authentication_method: OrderAuthenticationMethod;
755
- use_early_delivery: boolean;
756
- addresses_provider: AddressesProvider;
757
- };
758
- products: {
759
- use_stock_filter: boolean;
760
- };
761
- loyalty: {
762
- enabled: boolean;
763
- };
764
- recaptcha: {
765
- actions: RecaptchaAction[];
766
- key: string;
767
- } | null;
768
- websockets: {
769
- app_id: string;
770
- app_key: string;
771
- options: {
772
- host: string;
773
- port: number;
774
- };
775
- } | null;
722
+ export declare enum BonusesTransactionStatus {
723
+ Pending = "pending",
724
+ Confirmed = "confirmed",
725
+ Cancelled = "cancelled",
726
+ Rejected = "rejected",
727
+ Refunded = "refunded",
728
+ PartiallyRefunded = "partially_refunded"
776
729
  }
777
- export interface Store {
778
- id: string;
779
- name: string;
780
- domain: string | null;
781
- app_store_url: string | null;
782
- google_play_url: string | null;
783
- logo: Media | null;
784
- square_logo: Media | null;
785
- links: Contact[];
786
- phones: Phone[];
787
- cities: City[];
788
- settings: StoreSettings;
730
+ export declare enum BonusesTransactionReason {
731
+ Manual = "manual",
732
+ Cashback = "cashback",
733
+ ReferralReward = "referral_reward",
734
+ RecruitReward = "recruit_reward",
735
+ Payment = "payment",
736
+ Cancellation = "cancellation",
737
+ Refund = "refund",
738
+ Adjustment = "adjustment",
739
+ WelcomeBonuses = "welcome_bonuses",
740
+ PromotionReward = "promotion_reward",
741
+ External = "external"
789
742
  }
790
- export declare class StoreResource extends AbstractResource {
791
- getStore(storeId: string): Promise<Store>;
792
- getStoreByBundleId(bundleId: string): Promise<Store>;
743
+ export interface BonusesTransaction {
744
+ id: string;
745
+ order_id: string | null;
746
+ type: BonusesTransactionType;
747
+ status: BonusesTransactionStatus;
748
+ reason: BonusesTransactionReason;
749
+ amount: number;
750
+ source_amount: number | null;
751
+ created_at: string;
752
+ confirmed_at: string | null;
753
+ cancelled_at: string | null;
754
+ }
755
+ export interface ListBonusesTransactionsRequest extends PaginationRequest {
756
+ type?: BonusesTransactionType;
757
+ status?: BonusesTransactionStatus;
758
+ reason?: BonusesTransactionReason;
759
+ }
760
+ export interface ListCustomerBonusesTransactionsRequest extends ListBonusesTransactionsRequest {
761
+ order_id?: string;
762
+ }
763
+ export declare enum Gender {
764
+ Female = "female",
765
+ Male = "male",
766
+ Other = "other"
767
+ }
768
+ export interface CustomerLoyaltyProfile {
769
+ referral_program: {
770
+ code: string;
771
+ join_url: string;
772
+ invite_url: string;
773
+ };
774
+ balance: number;
775
+ bonuses_level: BonusesLevel | null;
776
+ rates: LoyaltyRates | null;
777
+ }
778
+ export interface CustomerSettings {
779
+ onesignal_id: string | null;
780
+ device_id: string | null;
781
+ device_token: string | null;
782
+ device_os: string | null;
783
+ barcode: string | null;
784
+ qrcode: string | null;
785
+ }
786
+ export interface Customer {
787
+ id: string;
788
+ store_profile_id: string;
789
+ first_name: string | null;
790
+ last_name: string | null;
791
+ phone: Phone;
792
+ gender: Gender;
793
+ birth_date: string | null;
794
+ registered_at: string;
795
+ loyalty: CustomerLoyaltyProfile | null;
796
+ settings?: CustomerSettings;
797
+ avatar?: Media | null;
798
+ }
799
+ export interface UpdateCustomerProfileRequest {
800
+ first_name?: string;
801
+ last_name?: string;
802
+ gender?: Gender;
803
+ birth_date?: string;
804
+ password?: string;
805
+ current_password?: string;
806
+ }
807
+ export interface RemoveCustomerProfileRequest {
808
+ password: string;
809
+ }
810
+ export interface UpdateCustomerSettingsRequest {
811
+ onesignal_id?: string;
812
+ device_id?: string;
813
+ device_token?: string;
814
+ device_os?: string;
815
+ barcode?: string;
816
+ qrcode?: string;
817
+ }
818
+ export interface DeliveryAddressRequest {
819
+ delivery_address: DadataDeliveryAddressRequest | ManualDeliveryAddressRequest;
820
+ }
821
+ export declare enum AcquiringType {
822
+ CloudPayments = "cloudpayments"
823
+ }
824
+ export declare enum PaymentSystemType {
825
+ Visa = "visa",
826
+ MasterCard = "master-card",
827
+ MIR = "mir",
828
+ Maestro = "maestro",
829
+ AmericanExpress = "american-express",
830
+ DinersClub = "diners-club",
831
+ Discover = "discover",
832
+ JCB = "jcb",
833
+ UnionPay = "union-pay"
834
+ }
835
+ export interface PaymentSystem {
836
+ id: PaymentSystemType;
837
+ name: string;
838
+ logos: {
839
+ black: string | null;
840
+ white: string | null;
841
+ colored: string | null;
842
+ };
843
+ }
844
+ export interface BankInfo {
845
+ id: string;
846
+ name: string;
847
+ url: string;
848
+ background_colors: string[];
849
+ primary_background_color: string;
850
+ background_style: "dark" | "white";
851
+ logo_style: "dark" | "white";
852
+ text_color: string;
853
+ logos: {
854
+ png: string | null;
855
+ svg: string | null;
856
+ };
857
+ payment_system: PaymentSystem;
858
+ }
859
+ export interface CustomerPaymentMethod {
860
+ id: string;
861
+ acquiring_type: AcquiringType;
862
+ card_type: PaymentSystemType;
863
+ card_first_six: string;
864
+ card_last_four: string;
865
+ name: string;
866
+ bank: BankInfo | null;
867
+ }
868
+ declare enum ConfirmationMethod {
869
+ Sms = "sms",
870
+ Call = "call"
871
+ }
872
+ export interface AbstractRegistrationRequest {
873
+ phone: PhoneRequest;
874
+ password?: string;
875
+ first_name?: string;
876
+ last_name?: string;
877
+ gender?: Gender;
878
+ birth_date?: string;
879
+ }
880
+ export interface RegistrationRequest extends AbstractRegistrationRequest {
881
+ referrer_code?: string;
882
+ referrer_id?: string;
883
+ }
884
+ export interface ConfirmRegistrationRequest extends AbstractRegistrationRequest {
885
+ code: string | number;
886
+ }
887
+ export interface AuthConfirmationStatus {
888
+ confirmation_required: boolean;
889
+ queued_to: string;
890
+ method: ConfirmationMethod;
891
+ }
892
+ export interface AuthResult {
893
+ token: string;
894
+ }
895
+ export interface ResendAuthConfirmationRequest {
896
+ phone: PhoneRequest;
897
+ }
898
+ export interface DispatchPasswordResetRequest {
899
+ phone: PhoneRequest;
900
+ }
901
+ export interface ResetPasswordRequest {
902
+ phone: PhoneRequest;
903
+ code: string | number;
904
+ password: string;
905
+ }
906
+ export interface LoginRequest {
907
+ phone: PhoneRequest;
908
+ password: string;
909
+ }
910
+ export interface CheckPhoneRequest {
911
+ phone: PhoneRequest;
912
+ }
913
+ export interface PhoneCheckResult {
914
+ registered: boolean;
915
+ confirmed: boolean;
793
916
  }
794
917
  export type OrderCredentials = string | {
795
- id: string;
796
- token: string;
797
- api_token?: string;
918
+ id: string;
919
+ token: string;
920
+ api_token?: string;
798
921
  };
799
922
  export declare enum DeliveryMethod {
800
- Delivery = "delivery",
801
- Pickup = "pickup",
802
- OnPremise = "on_premise"
923
+ Delivery = "delivery",
924
+ Pickup = "pickup",
925
+ OnPremise = "on_premise"
803
926
  }
804
927
  export interface OrderStatusKind {
805
- Pending: 'pending';
806
- AwaitingPayment: 'awaiting_payment';
807
- Submitted: 'submitted';
808
- Exported: 'exported';
809
- Packing: 'packing';
810
- Ready: 'ready';
811
- AwaitingDelivery: 'awaiting_delivery';
812
- Delivering: 'delivering';
813
- Delivered: 'delivered';
814
- Rejected: 'rejected';
815
- Cancelled: 'cancelled';
816
- Completed: 'completed';
817
- Custom: 'custom';
928
+ Pending: "pending";
929
+ AwaitingPayment: "awaiting_payment";
930
+ Submitted: "submitted";
931
+ Exported: "exported";
932
+ Packing: "packing";
933
+ Ready: "ready";
934
+ AwaitingDelivery: "awaiting_delivery";
935
+ Delivering: "delivering";
936
+ Delivered: "delivered";
937
+ Rejected: "rejected";
938
+ Cancelled: "cancelled";
939
+ Completed: "completed";
940
+ Custom: "custom";
818
941
  }
819
942
  export declare enum OrderPaymentTransactionType {
820
- Payment = "payment",
821
- Refund = "refund"
943
+ Payment = "payment",
944
+ Refund = "refund"
822
945
  }
823
946
  export declare enum PaymentMethod {
824
- Cash = "cash",
825
- CreditCard = "credit-card",
826
- CloudPayments = "cloudpayments",
827
- CardToken = "card_token",
828
- Bonuses = "bonuses"
947
+ Cash = "cash",
948
+ CreditCard = "credit-card",
949
+ CloudPayments = "cloudpayments",
950
+ CardToken = "card_token",
951
+ Bonuses = "bonuses"
829
952
  }
830
953
  export declare enum OrderPaymentTransactionStatus {
831
- Pending = "pending",
832
- Confirmed = "confirmed",
833
- Cancelled = "cancelled",
834
- PendingRefund = "pending_refund",
835
- Refunding = "refunding",
836
- Refunded = "refunded"
954
+ Pending = "pending",
955
+ Confirmed = "confirmed",
956
+ Cancelled = "cancelled",
957
+ PendingRefund = "pending_refund",
958
+ Refunding = "refunding",
959
+ Refunded = "refunded"
837
960
  }
838
961
  export interface OrderStatus {
839
- id: string;
840
- kind: OrderStatusKind;
841
- name: string | null;
962
+ id: string;
963
+ kind: OrderStatusKind;
964
+ name: string | null;
842
965
  }
843
966
  export interface OrderStatusChange extends OrderStatus {
844
- transitioned_at: string;
967
+ transitioned_at: string;
845
968
  }
846
969
  export interface OrderStatusProgress extends OrderStatus {
847
- transitioned_at: string | null;
970
+ transitioned_at: string | null;
848
971
  }
849
972
  export interface CashPaymentMeta {
850
- change?: number | null;
851
- bill?: number | null;
973
+ change?: number | null;
974
+ bill?: number | null;
852
975
  }
853
976
  export declare enum CloudpaymentsChargeType {
854
- Auth = "auth",
855
- Charge = "charge"
977
+ Auth = "auth",
978
+ Charge = "charge"
856
979
  }
857
980
  export interface CloudpaymentsPaymentMeta {
858
- widget: {
859
- publicId: string;
860
- description: string;
861
- amount: number;
862
- currency: string;
863
- invoiceId: string;
864
- accountId?: string;
865
- skin: string;
866
- };
867
- payment_page_url: string;
868
- charge_type: CloudpaymentsChargeType;
869
- charged_as: CloudpaymentsChargeType | null;
981
+ widget: {
982
+ publicId: string;
983
+ description: string;
984
+ amount: number;
985
+ currency: string;
986
+ invoiceId: string;
987
+ accountId?: string;
988
+ skin: string;
989
+ };
990
+ payment_page_url: string;
991
+ charge_type: CloudpaymentsChargeType;
992
+ charged_as: CloudpaymentsChargeType | null;
870
993
  }
871
994
  export interface OrderPaymentTransaction {
872
- id: string;
873
- type: OrderPaymentTransactionType;
874
- status: OrderPaymentTransactionStatus;
875
- method: PaymentMethod;
876
- amount: number;
877
- created_at: string;
878
- confirmed_at: string | null;
879
- authorization_confirmed_at: string | null;
880
- cancelled_at: string | null;
881
- refunded_at: string | null;
882
- refund_failed_at: string | null;
883
- transaction_meta: CashPaymentMeta | CloudpaymentsPaymentMeta | null;
995
+ id: string;
996
+ type: OrderPaymentTransactionType;
997
+ status: OrderPaymentTransactionStatus;
998
+ method: PaymentMethod;
999
+ amount: number;
1000
+ created_at: string;
1001
+ confirmed_at: string | null;
1002
+ authorization_confirmed_at: string | null;
1003
+ cancelled_at: string | null;
1004
+ refunded_at: string | null;
1005
+ refund_failed_at: string | null;
1006
+ transaction_meta: CashPaymentMeta | CloudpaymentsPaymentMeta | null;
884
1007
  }
885
1008
  export interface OrderProductVariantModifier {
886
- id: string;
887
- modifiers_group_id: string | null;
888
- quantity: number;
889
- total_price: number | null;
890
- unit_price: number | null;
891
- original_price: number | null;
892
- original_unit_price: number | null;
893
- modifier?: Modifier | null;
894
- modifiers_group?: BasicModifiersGroup | null;
1009
+ id: string;
1010
+ modifiers_group_id: string | null;
1011
+ quantity: number;
1012
+ total_price: number | null;
1013
+ unit_price: number | null;
1014
+ original_price: number | null;
1015
+ original_unit_price: number | null;
1016
+ modifier?: Modifier | null;
1017
+ modifiers_group?: BasicModifiersGroup | null;
895
1018
  }
896
1019
  export interface OrderProductVariant {
897
- id: string;
898
- product_id: string;
899
- product_variant_id: string;
900
- stock_id: string | null;
901
- promotion: {
902
- id: string;
903
- reward_id: string;
904
- } | null;
905
- quantity: number;
906
- has_measured_quantity: boolean;
907
- measured_quantity: number | null;
908
- total_price: number;
909
- original_total_price: number | null;
910
- unit_price: number;
911
- original_unit_price: number | null;
912
- discount: Discount | null;
913
- modifiers_hash: string | null;
914
- product?: Product;
915
- variant?: ProductVariant;
916
- modifiers?: OrderProductVariantModifier[];
1020
+ id: string;
1021
+ product_id: string;
1022
+ product_variant_id: string;
1023
+ stock_id: string | null;
1024
+ promotion: {
1025
+ id: string;
1026
+ reward_id: string;
1027
+ } | null;
1028
+ quantity: number;
1029
+ has_measured_quantity: boolean;
1030
+ measured_quantity: number | null;
1031
+ total_price: number;
1032
+ original_total_price: number | null;
1033
+ unit_price: number;
1034
+ original_unit_price: number | null;
1035
+ discount: Discount | null;
1036
+ modifiers_hash: string | null;
1037
+ product?: Product;
1038
+ variant?: ProductVariant;
1039
+ modifiers?: OrderProductVariantModifier[];
917
1040
  }
918
1041
  export interface Order {
919
- id: string;
920
- token: string;
921
- number: string | null;
922
- delivery_method: DeliveryMethod | null;
923
- total_price: number;
924
- original_total_price: number | null;
925
- discount: Discount | null;
926
- notes: string | null;
927
- created_at: string;
928
- submitted_at: string | null;
929
- deliver_at: string | null;
930
- meta_data: {
931
- deliver_at?: string | null;
932
- on_premise?: {
933
- table: string | null;
934
- } | null;
935
- } | null;
936
- status: OrderStatusChange | null;
937
- variants: OrderProductVariant[];
938
- city: City | null;
939
- stock: Stock | null;
940
- customer?: Customer | null;
941
- delivery_address?: DeliveryAddress | null;
942
- delivery_zone?: DeliveryZone;
943
- statuses?: OrderStatus[];
944
- progress?: OrderStatusProgress[];
945
- payments?: OrderPaymentTransaction[];
1042
+ id: string;
1043
+ token: string;
1044
+ number: string | null;
1045
+ delivery_method: DeliveryMethod | null;
1046
+ total_price: number;
1047
+ original_total_price: number | null;
1048
+ discount: Discount | null;
1049
+ notes: string | null;
1050
+ created_at: string;
1051
+ submitted_at: string | null;
1052
+ deliver_at: string | null;
1053
+ meta_data: {
1054
+ deliver_at?: string | null;
1055
+ on_premise?: {
1056
+ table: string | null;
1057
+ } | null;
1058
+ } | null;
1059
+ status: OrderStatusChange | null;
1060
+ variants: OrderProductVariant[];
1061
+ city: City | null;
1062
+ stock: Stock | null;
1063
+ customer?: Customer | null;
1064
+ delivery_address?: DeliveryAddress | null;
1065
+ delivery_zone?: DeliveryZone;
1066
+ statuses?: OrderStatus[];
1067
+ progress?: OrderStatusProgress[];
1068
+ payments?: OrderPaymentTransaction[];
946
1069
  }
947
1070
  export interface OrderPaymentMethod {
948
- id: PaymentMethod;
949
- name: string;
950
- meta?: {
951
- payment_page_url?: string;
952
- };
953
- token?: {
954
- id: string;
955
- type: string;
956
- first_six: string;
957
- last_four: string;
958
- };
1071
+ id: PaymentMethod;
1072
+ name: string;
1073
+ meta?: {
1074
+ payment_page_url?: string;
1075
+ };
1076
+ token?: {
1077
+ id: string;
1078
+ type: string;
1079
+ first_six: string;
1080
+ last_four: string;
1081
+ };
959
1082
  }
960
1083
  export interface OrderDeliveryMethod {
961
- id: DeliveryMethod;
962
- name: string;
963
- min_price: number | null;
964
- delivery_price: number | null;
965
- discount: {
966
- type: DiscountType;
967
- value: number;
968
- } | null;
1084
+ id: DeliveryMethod;
1085
+ name: string;
1086
+ min_price: number | null;
1087
+ delivery_price: number | null;
1088
+ discount: {
1089
+ type: DiscountType;
1090
+ value: number;
1091
+ } | null;
969
1092
  }
970
1093
  export declare enum OrderOptionKind {
971
- PersonsCount = "persons_count",
972
- DeliveryTime = "delivery_time"
1094
+ PersonsCount = "persons_count",
1095
+ DeliveryTime = "delivery_time"
973
1096
  }
974
1097
  export interface OrderOption {
975
- id: string;
976
- kind: OrderOptionKind;
977
- meta: any;
1098
+ id: string;
1099
+ kind: OrderOptionKind;
1100
+ meta: any;
978
1101
  }
979
1102
  export interface OrderSettings {
980
- payment_methods: OrderPaymentMethod[];
981
- delivery_methods: OrderDeliveryMethod[];
982
- options: OrderOption[];
1103
+ payment_methods: OrderPaymentMethod[];
1104
+ delivery_methods: OrderDeliveryMethod[];
1105
+ options: OrderOption[];
983
1106
  }
984
1107
  export declare enum OrderCartCheckerResultReason {
985
- PriceMismatch = "price_mismatch",
986
- OutOfStock = "out_of_stock",
987
- Unavailable = "unavailable"
1108
+ PriceMismatch = "price_mismatch",
1109
+ OutOfStock = "out_of_stock",
1110
+ Unavailable = "unavailable"
988
1111
  }
989
1112
  export declare enum OrderCartCheckerResultAction {
990
- None = "none",
991
- Cleanup = "cleanup"
1113
+ None = "none",
1114
+ Cleanup = "cleanup"
992
1115
  }
993
1116
  export interface OrderCartCheckerResult {
994
- order_variants: {
995
- id: string;
996
- product_variant_id: string;
997
- quantity: number;
998
- reasons: OrderCartCheckerResultReason[];
999
- }[];
1000
- action: OrderCartCheckerResultAction;
1117
+ order_variants: {
1118
+ id: string;
1119
+ product_variant_id: string;
1120
+ quantity: number;
1121
+ reasons: OrderCartCheckerResultReason[];
1122
+ }[];
1123
+ action: OrderCartCheckerResultAction;
1001
1124
  }
1002
1125
  export interface ListOrdersRequest extends ListRequest {
1003
- submitted_from?: string;
1004
- submitted_till?: string;
1005
- order_status_id?: string;
1006
- city_id?: string;
1007
- submission_period?: string;
1126
+ submitted_from?: string;
1127
+ submitted_till?: string;
1128
+ order_status_id?: string;
1129
+ city_id?: string;
1130
+ submission_period?: string;
1008
1131
  }
1009
1132
  export interface CreateOrderRequest {
1010
- city_id: string;
1133
+ city_id: string;
1011
1134
  }
1012
1135
  export interface OrderProductVariantRequest {
1013
- product_variant_id: string;
1014
- quantity: number;
1015
- promotion_id?: string;
1016
- promotion_reward_id?: string;
1017
- modifiers?: ProductModifiersRequest[];
1136
+ product_variant_id: string;
1137
+ quantity: number;
1138
+ promotion_id?: string;
1139
+ promotion_reward_id?: string;
1140
+ modifiers?: ProductModifiersRequest[];
1018
1141
  }
1019
1142
  export interface SetOrderCustomerRequest {
1020
- phone?: PhoneRequest;
1021
- first_name?: string;
1022
- last_name?: string;
1023
- gender?: Gender;
1024
- birth_date?: string;
1143
+ phone?: PhoneRequest;
1144
+ first_name?: string;
1145
+ last_name?: string;
1146
+ gender?: Gender;
1147
+ birth_date?: string;
1025
1148
  }
1026
1149
  export interface SetOrderDeliveryRequest {
1027
- delivery_method: DeliveryMethod;
1028
- delivery_address?: ExistedDeliveryAddressRequest | DadataDeliveryAddressRequest | ManualDeliveryAddressRequest;
1029
- stock_id?: string;
1030
- on_premise?: {
1031
- table: string;
1032
- };
1033
- deliver_at?: string;
1150
+ delivery_method: DeliveryMethod;
1151
+ delivery_address?: ExistedDeliveryAddressRequest | DadataDeliveryAddressRequest | ManualDeliveryAddressRequest;
1152
+ stock_id?: string;
1153
+ on_premise?: {
1154
+ table: string;
1155
+ };
1156
+ deliver_at?: string;
1034
1157
  }
1035
1158
  export interface OrderPaymentMethodRequest {
1036
- method: PaymentMethod;
1037
- amount?: number | string;
1038
- bill?: number | string;
1039
- save_card?: boolean;
1040
- card_token_id?: string;
1159
+ method: PaymentMethod;
1160
+ amount?: number | string;
1161
+ bill?: number | string;
1162
+ save_card?: boolean;
1163
+ card_token_id?: string;
1041
1164
  }
1042
1165
  export interface SetOrderPaymentsRequest {
1043
- payments: OrderPaymentMethodRequest[];
1166
+ payments: OrderPaymentMethodRequest[];
1044
1167
  }
1045
1168
  export interface OrderCheckoutBonusesPreview {
1046
- bonuses: number;
1047
- unpaid: number;
1169
+ bonuses: number;
1170
+ unpaid: number;
1048
1171
  }
1049
1172
  export interface OrderCheckoutTotalPayment {
1050
- id: string;
1051
- method: PaymentMethod;
1052
- amount: number;
1053
- bill?: number;
1054
- change?: number;
1055
- save_card?: boolean;
1056
- card_token_id?: string;
1173
+ id: string;
1174
+ method: PaymentMethod;
1175
+ amount: number;
1176
+ bill?: number;
1177
+ change?: number;
1178
+ save_card?: boolean;
1179
+ card_token_id?: string;
1057
1180
  }
1058
1181
  export interface OrderCheckoutTotal {
1059
- min_price: number | null;
1060
- subtotal: number;
1061
- original_subtotal: number | null;
1062
- delivery_price: number | null;
1063
- delivery_discount: number | null;
1064
- discount: Discount | null;
1065
- total: number;
1066
- original_total: number | null;
1067
- max_bonuses_payment: number | null;
1068
- cashback: number | null;
1069
- payments: OrderCheckoutTotalPayment[];
1182
+ min_price: number | null;
1183
+ subtotal: number;
1184
+ original_subtotal: number | null;
1185
+ delivery_price: number | null;
1186
+ delivery_discount: number | null;
1187
+ discount: Discount | null;
1188
+ total: number;
1189
+ original_total: number | null;
1190
+ max_bonuses_payment: number | null;
1191
+ cashback: number | null;
1192
+ payments: OrderCheckoutTotalPayment[];
1070
1193
  }
1071
1194
  export interface OrderCheckoutRequest {
1072
- notes?: string;
1073
- persons_count?: string | number;
1074
- }
1075
- export declare enum ConfirmationMethod {
1076
- Sms = "sms",
1077
- Call = "call"
1195
+ notes?: string;
1196
+ persons_count?: string | number;
1078
1197
  }
1079
1198
  export interface OrderCheckoutResult {
1080
- confirmation: {
1081
- required: boolean;
1082
- method: ConfirmationMethod | null;
1083
- phone: Phone | null;
1084
- };
1085
- online_payment: {
1086
- required: boolean;
1087
- payment_page_url: string | null;
1088
- };
1089
- order: Order;
1199
+ confirmation: {
1200
+ required: boolean;
1201
+ method: ConfirmationMethod | null;
1202
+ phone: Phone | null;
1203
+ };
1204
+ online_payment: {
1205
+ required: boolean;
1206
+ payment_page_url: string | null;
1207
+ };
1208
+ order: Order;
1090
1209
  }
1091
1210
  export interface ConfirmOrderRequest {
1092
- code: string | number;
1211
+ code: string | number;
1093
1212
  }
1094
1213
  export interface OrderPromotionReward {
1095
- id: string;
1096
- promotion_id: string;
1097
- promotion_reward_id: string;
1098
- item_id: string | null;
1099
- amount: number | null;
1100
- total_amount: number | null;
1101
- count: number;
1214
+ id: string;
1215
+ promotion_id: string;
1216
+ promotion_reward_id: string;
1217
+ item_id: string | null;
1218
+ amount: number | null;
1219
+ total_amount: number | null;
1220
+ count: number;
1102
1221
  }
1103
1222
  export declare class OrdersResource extends AbstractResource {
1104
- protected getOrderUrl(storeId: string, credentials: OrderCredentials, path: string, request?: any): string;
1105
- protected getApiToken(credentials: OrderCredentials): undefined | string;
1106
- getOrders(storeId: string, request?: ListOrdersRequest, apiToken?: string | null): Promise<PaginatedResponse<Order>>;
1107
- createOrder(storeId: string, request: CreateOrderRequest, apiToken?: string | null): Promise<Order>;
1108
- getOrder(storeId: string, credentials: OrderCredentials, request?: InclusionRequest): Promise<Order>;
1109
- getOrderSettings(storeId: string, credentials: OrderCredentials): Promise<OrderSettings>;
1110
- addProductVariantToOrder(storeId: string, credentials: OrderCredentials, request: OrderProductVariantRequest): Promise<Order>;
1111
- removeProductVariantFromOrder(storeId: string, credentials: OrderCredentials, request: OrderProductVariantRequest): Promise<Order>;
1112
- checkProducts(storeId: string, credentials: OrderCredentials): Promise<OrderCartCheckerResult>;
1113
- setOrderCustomer(storeId: string, credentials: OrderCredentials, request: SetOrderCustomerRequest): Promise<boolean>;
1114
- setOrderDeliveryMethod(storeId: string, credentials: OrderCredentials, request: SetOrderDeliveryRequest): Promise<Order>;
1115
- setOrderPayments(storeId: string, credentials: OrderCredentials, request: SetOrderPaymentsRequest): Promise<Order>;
1116
- getOrderBonusesPreview(storeId: string, credentials: OrderCredentials, amount: number | string): Promise<OrderCheckoutBonusesPreview>;
1117
- getOrderTotal(storeId: string, credentials: OrderCredentials): Promise<OrderCheckoutTotal>;
1118
- checkoutOrder(storeId: string, credentials: OrderCredentials, request: OrderCheckoutRequest): Promise<OrderCheckoutResult>;
1119
- confirmOrder(storeId: string, credentials: OrderCredentials, request: ConfirmOrderRequest): Promise<boolean>;
1120
- resendOrderConfirmationCode(storeId: string, credentials: OrderCredentials): Promise<boolean>;
1121
- getOrderBonusesTransactions(storeId: string, credentials: OrderCredentials, request?: ListBonusesTransactionsRequest): Promise<PaginatedResponse<BonusesTransaction>>;
1122
- getOrderCashbackTransaction(storeId: string, credentials: OrderCredentials): Promise<BonusesTransaction>;
1123
- dispatchPromotionsChecker(storeId: string, credentials: OrderCredentials): Promise<boolean>;
1124
- getOrderPromotionRewards(storeId: string, credentials: OrderCredentials): Promise<OrderPromotionReward>;
1125
- }
1126
- export enum AddressSuggestionsProvider {
1127
- DADATA = 'dadata',
1128
- }
1129
- export interface DadataAddressSuggestion {
1130
- value: string | null;
1131
- unrestricted_value: string | null;
1132
- data: {
1133
- postal_code: string | null;
1134
- country: string | null;
1135
- country_code: string | null;
1136
- federal_district: string | null;
1137
- region_fias_id: string | null;
1138
- region_kladr_id: string | null;
1139
- region_iso_code: string | null;
1140
- region_with_type: string | null;
1141
- region_type: string | null;
1142
- region_type_full: string | null;
1143
- region: string | null;
1144
- area_fias_id: string | null;
1145
- area_kladr_id: string | null;
1146
- area_with_type: string | null;
1147
- area_type: string | null;
1148
- area_type_full: string | null;
1149
- area: string | null;
1150
- city_fias_id: string | null;
1151
- city_kladr_id: string | null;
1152
- city_with_type: string | null;
1153
- city_type: string | null;
1154
- city_type_full: string | null;
1155
- city: string | null;
1156
- city_area: string | null;
1157
- city_district_fias_id: string | null;
1158
- city_district_with_type: string | null;
1159
- city_district_type: string | null;
1160
- city_district_type_full: string | null;
1161
- city_district: string | null;
1162
- settlement_fias_id: string | null;
1163
- settlement_kladr_id: string | null;
1164
- settlement_with_type: string | null;
1165
- settlement_type: string | null;
1166
- settlement_type_full: string | null;
1167
- settlement: string | null;
1168
- street_fias_id: string | null;
1169
- street_kladr_id: string | null;
1170
- street_with_type: string | null;
1171
- street_type: string | null;
1172
- street_type_full: string | null;
1173
- street: string | null;
1174
- stead_fias_id: string | null;
1175
- stead_cadnum: string | null;
1176
- stead_type: string | null;
1177
- stead_type_full: string | null;
1178
- stead: string | null;
1179
- house_fias_id: string | null;
1180
- house_kladr_id: string | null;
1181
- house_cadnum: string | null;
1182
- house_type: string | null;
1183
- house_type_full: string | null;
1184
- house: string | null;
1185
- block_type: string | null;
1186
- block_type_full: string | null;
1187
- block: string | null;
1188
- flat_fias_id: string | null;
1189
- flat_cadnum: string | null;
1190
- flat_type: string | null;
1191
- flat_type_full: string | null;
1192
- flat: string | null;
1193
- flat_area: string | null;
1194
- square_meter_price: string | null;
1195
- flat_price: string | null;
1196
- room_fias_id: string | null;
1197
- room_cadnum: string | null;
1198
- room_type: string | null;
1199
- room_type_full: string | null;
1200
- postal_box: string | null;
1201
- fias_id: string | null;
1202
- fias_level: string | null;
1203
- fias_actuality_state: string | null;
1204
- kladr_id: string | null;
1205
- geoname_id: string | null;
1206
- capital_marker: string | null;
1207
- okato: string | null;
1208
- oktmo: string | null;
1209
- tax_office: string | null;
1210
- tax_office_legal: string | null;
1211
- timezone: string | null;
1212
- geo_lat: string | null;
1213
- geo_lon: string | null;
1214
- qc_geo: string | null;
1215
- beltway_hit: string | null;
1216
- beltway_distance: string | null;
1217
- metro?: {
1218
- name: string | null;
1219
- line: string | null;
1220
- distance: string | null;
1221
- }[] | null;
1222
- };
1223
- }
1224
- export interface AddressSuggestions {
1225
- provider: AddressSuggestionsProvider;
1226
- suggestions: DadataAddressSuggestion[];
1227
- }
1228
- export interface AddressSuggestionsRequest {
1229
- query: string;
1230
- city_id?: string;
1231
- count?: number;
1232
- }
1233
- export declare class AddressesResource extends AbstractResource {
1234
- getAddressSuggestions(storeId: string, request: AddressSuggestionsRequest): Promise<AddressSuggestions>;
1235
- }
1236
- export interface AbstractRegistrationRequest {
1237
- phone: PhoneRequest;
1238
- password?: string;
1239
- first_name?: string;
1240
- last_name?: string;
1241
- gender?: Gender;
1242
- birth_date?: string;
1243
- }
1244
-
1245
- export interface RegistrationRequest extends AbstractRegistrationRequest {
1246
- referrer_code?: string;
1247
- referrer_id?: string;
1223
+ protected getOrderUrl(storeId: string, credentials: OrderCredentials, path: string, request?: any): string;
1224
+ protected getApiToken(credentials: OrderCredentials): undefined | string;
1225
+ getOrders(storeId: string, request?: ListOrdersRequest, apiToken?: string | null): Promise<PaginatedResponse<Order>>;
1226
+ createOrder(storeId: string, request: CreateOrderRequest, apiToken?: string | null): Promise<Order>;
1227
+ getOrder(storeId: string, credentials: OrderCredentials, request?: InclusionRequest): Promise<Order>;
1228
+ getOrderSettings(storeId: string, credentials: OrderCredentials): Promise<OrderSettings>;
1229
+ addProductVariantToOrder(storeId: string, credentials: OrderCredentials, request: OrderProductVariantRequest): Promise<Order>;
1230
+ removeProductVariantFromOrder(storeId: string, credentials: OrderCredentials, request: OrderProductVariantRequest): Promise<Order>;
1231
+ checkProducts(storeId: string, credentials: OrderCredentials): Promise<OrderCartCheckerResult>;
1232
+ setOrderCustomer(storeId: string, credentials: OrderCredentials, request: SetOrderCustomerRequest): Promise<boolean>;
1233
+ setOrderDeliveryMethod(storeId: string, credentials: OrderCredentials, request: SetOrderDeliveryRequest): Promise<Order>;
1234
+ setOrderPayments(storeId: string, credentials: OrderCredentials, request: SetOrderPaymentsRequest): Promise<Order>;
1235
+ getOrderBonusesPreview(storeId: string, credentials: OrderCredentials, amount: number | string): Promise<OrderCheckoutBonusesPreview>;
1236
+ getOrderTotal(storeId: string, credentials: OrderCredentials): Promise<OrderCheckoutTotal>;
1237
+ checkoutOrder(storeId: string, credentials: OrderCredentials, request: OrderCheckoutRequest): Promise<OrderCheckoutResult>;
1238
+ confirmOrder(storeId: string, credentials: OrderCredentials, request: ConfirmOrderRequest): Promise<boolean>;
1239
+ resendOrderConfirmationCode(storeId: string, credentials: OrderCredentials): Promise<boolean>;
1240
+ getOrderBonusesTransactions(storeId: string, credentials: OrderCredentials, request?: ListBonusesTransactionsRequest): Promise<PaginatedResponse<BonusesTransaction>>;
1241
+ getOrderCashbackTransaction(storeId: string, credentials: OrderCredentials): Promise<BonusesTransaction>;
1242
+ dispatchPromotionsChecker(storeId: string, credentials: OrderCredentials): Promise<boolean>;
1243
+ getOrderPromotionRewards(storeId: string, credentials: OrderCredentials): Promise<OrderPromotionReward>;
1244
+ }
1245
+ declare class AddressesResource extends AbstractResource {
1246
+ getAddressSuggestions(storeId: string, request: AddressSuggestionsRequest): Promise<AddressSuggestions>;
1247
+ }
1248
+ declare class CustomersResource extends AbstractResource {
1249
+ getProfile(storeId: string, request?: InclusionRequest, apiToken?: string): Promise<Customer>;
1250
+ updateProfile(storeId: string, request: UpdateCustomerProfileRequest, apiToken?: string): Promise<Customer>;
1251
+ removeProfile(storeId: string, request: RemoveCustomerProfileRequest, apiToken?: string): Promise<boolean>;
1252
+ getSettings(storeId: string, apiToken?: string): Promise<CustomerSettings>;
1253
+ updateSettings(storeId: string, request: UpdateCustomerSettingsRequest, apiToken?: string): Promise<CustomerSettings>;
1254
+ getAddresses(storeId: string, request?: ListRequest, apiToken?: string): Promise<PaginatedResponse<DeliveryAddress>>;
1255
+ createAddress(storeId: string, request: DeliveryAddressRequest, apiToken?: string): Promise<DeliveryAddress>;
1256
+ updateAddress(storeId: string, addressId: string, request: DeliveryAddressRequest, apiToken?: string): Promise<DeliveryAddress>;
1257
+ deleteAddress(storeId: string, addressId: string, apiToken?: string): Promise<boolean>;
1258
+ getPaymentMethods(storeId: string, request?: PaginationRequest, apiToken?: string): Promise<PaginatedResponse<CustomerPaymentMethod>>;
1259
+ deletePaymentMethod(storeId: string, paymentMethodId: string, apiToken?: string): Promise<boolean>;
1260
+ getBonusesTransactions(storeId: string, request?: ListCustomerBonusesTransactionsRequest, apiToken?: string): Promise<PaginatedResponse<BonusesTransaction>>;
1261
+ }
1262
+ declare class AuthenticationResource extends AbstractResource {
1263
+ checkPhone(storeId: string, request: CheckPhoneRequest): Promise<PhoneCheckResult>;
1264
+ register(storeId: string, request: RegistrationRequest): Promise<AuthConfirmationStatus>;
1265
+ confirmRegistration(storeId: string, request: ConfirmRegistrationRequest): Promise<AuthResult>;
1266
+ resendRegistrationConfirmation(storeId: string, request: ResendAuthConfirmationRequest): Promise<AuthConfirmationStatus>;
1267
+ login(storeId: string, request: LoginRequest): Promise<AuthResult>;
1268
+ dispatchPasswordReset(storeId: string, request: DispatchPasswordResetRequest): Promise<AuthConfirmationStatus>;
1269
+ resetPassword(storeId: string, request: ResetPasswordRequest): Promise<AuthResult>;
1248
1270
  }
1249
-
1250
- export interface ConfirmRegistrationRequest extends AbstractRegistrationRequest {
1251
- code: string | number;
1252
- }
1253
-
1254
- export interface AuthConfirmationStatus {
1255
- confirmation_required: boolean;
1256
- queued_to: string;
1257
- method: ConfirmationMethod;
1258
- }
1259
-
1260
- export interface AuthResult {
1261
- token: string;
1262
- }
1263
-
1264
- export interface ResendAuthConfirmationRequest {
1265
- phone: PhoneRequest;
1266
- }
1267
-
1268
- export interface DispatchPasswordResetRequest {
1269
- phone: PhoneRequest;
1270
- }
1271
-
1272
- export interface ResetPasswordRequest {
1273
- phone: PhoneRequest;
1274
- code: string | number;
1275
- password: string;
1276
- }
1277
-
1278
- export interface LoginRequest {
1279
- phone: PhoneRequest;
1280
- password: string;
1281
- }
1282
-
1283
- export interface CheckPhoneRequest {
1284
- phone: PhoneRequest;
1285
- }
1286
-
1287
- export interface PhoneCheckResult {
1288
- registered: boolean;
1289
- confirmed: boolean;
1271
+ export declare class ZenkyStorefront {
1272
+ protected readonly client: Client;
1273
+ readonly store: StoreResource;
1274
+ readonly auth: AuthenticationResource;
1275
+ readonly customer: CustomersResource;
1276
+ readonly categories: CategoriesResource;
1277
+ readonly products: ProductsResource;
1278
+ readonly addresses: AddressesResource;
1279
+ readonly orders: OrdersResource;
1280
+ readonly collections: CollectionsResource;
1281
+ readonly offers: OffersResource;
1282
+ readonly articles: ArticlesResource;
1283
+ readonly feedback: FeedbackResource;
1284
+ constructor(config?: ClientConfig, fetcher?: any);
1285
+ setApiToken(token: string | null): ZenkyStorefront;
1290
1286
  }
1291
1287
 
1292
- export declare class AuthenticationResource extends AbstractResource {
1293
- checkPhone(storeId: string, request: CheckPhoneRequest): Promise<PhoneCheckResult>;
1294
- register(storeId: string, request: RegistrationRequest): Promise<AuthConfirmationStatus>;
1295
- confirmRegistration(storeId: string, request: ConfirmRegistrationRequest): Promise<AuthResult>;
1296
- resendRegistrationConfirmation(storeId: string, request: ResendAuthConfirmationRequest): Promise<AuthConfirmationStatus>;
1297
- login(storeId: string, request: LoginRequest): Promise<AuthResult>;
1298
- dispatchPasswordReset(storeId: string, request: DispatchPasswordResetRequest): Promise<AuthConfirmationStatus>;
1299
- resetPassword(storeId: string, request: ResetPasswordRequest): Promise<AuthResult>;
1300
- }
1288
+ export {};