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