picnic-api-fix 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,697 @@
1
+ export type ApiConfig = {
2
+ countryCode?: CountryCode;
3
+ apiVersion?: string;
4
+ authKey?: string;
5
+ url?: string;
6
+ };
7
+ export type CountryCode = "NL" | "DE";
8
+ export type ImageSize = "tiny" | "small" | "medium" | "large" | "extra-large";
9
+ export type ApiError = {
10
+ code: string;
11
+ details: any;
12
+ message: string;
13
+ };
14
+ export type LoginInput = {
15
+ key: string;
16
+ secret: string;
17
+ client_id: number;
18
+ };
19
+ export type Generate2FACodeInput = {
20
+ channel: "SMS" | string;
21
+ };
22
+ export type Verify2FACodeInput = {
23
+ otp: string;
24
+ };
25
+ export type LoginResult = {
26
+ user_id: string;
27
+ second_factor_authentication_required: boolean;
28
+ show_second_factor_authentication_intro: boolean;
29
+ authKey: string;
30
+ };
31
+ export type Address = {
32
+ house_number: number;
33
+ house_number_ext: string;
34
+ postcode: string;
35
+ street: string;
36
+ city: string;
37
+ };
38
+ export type Subscription = {
39
+ list_id: string;
40
+ subscribed: boolean;
41
+ name: string;
42
+ };
43
+ export type HouseholdDetails = {
44
+ adults: number;
45
+ children: number;
46
+ cats: number;
47
+ dogs: number;
48
+ author: string;
49
+ last_edit_ts: number;
50
+ };
51
+ export type ConsentDecisions = {
52
+ MISC_COMMERCIAL_ADS: boolean;
53
+ MISC_COMMERCIAL_EMAILS: boolean;
54
+ MISC_COMMERCIAL_MESSAGES: boolean;
55
+ MISC_READ_ADVERTISING_ID: boolean;
56
+ MISC_WHATS_APP_COMMUNICATION: boolean;
57
+ PERSONALIZED_RANKING_CONSENT: boolean;
58
+ POST_MAIL: boolean;
59
+ PURCHASES_CATEGORY_CONSENT: boolean;
60
+ WEEKLY_COMMERCIAL_EMAILS: boolean;
61
+ };
62
+ export type FeatureToggle = {
63
+ name: string;
64
+ };
65
+ export type User = {
66
+ user_id: string;
67
+ firstname: string;
68
+ lastname: string;
69
+ address: Address;
70
+ phone: string;
71
+ contact_email: string;
72
+ feature_toggles: FeatureToggle[];
73
+ push_subscriptions: Subscription[];
74
+ subscriptions: Subscription[];
75
+ customer_type: string | "CONSUMER";
76
+ household_details: HouseholdDetails;
77
+ check_general_consent: boolean;
78
+ placed_order: boolean;
79
+ received_delivery: boolean;
80
+ total_deliveries: number;
81
+ completed_deliveries: number;
82
+ consent_decisions: ConsentDecisions;
83
+ };
84
+ export type UserInfo = {
85
+ user_id: string;
86
+ redacted_phone_number: string;
87
+ feature_toggles: FeatureToggle[];
88
+ };
89
+ export type Avatar = {
90
+ image_url: string;
91
+ type: string;
92
+ };
93
+ export type ProfileUser = {
94
+ address: Address;
95
+ avatar: Avatar;
96
+ mgm: MgmDetails;
97
+ };
98
+ export type ProfileMenu = {
99
+ highlights: any[];
100
+ user: ProfileUser;
101
+ };
102
+ export type BankInformation = {
103
+ bank_id: string;
104
+ name: string;
105
+ };
106
+ export type AvailablePaymentMethod = {
107
+ available_banks?: BankInformation[];
108
+ payment_method: string;
109
+ };
110
+ export type PaymentMethodBrand = {
111
+ brand: string;
112
+ display_name: string;
113
+ icon_url: string;
114
+ };
115
+ export type PaymentMethod = {
116
+ brands: PaymentMethodBrand[];
117
+ data: object;
118
+ display_name: string;
119
+ icon_url: string;
120
+ payment_method: string;
121
+ visibility: string;
122
+ visibility_reason: null | string;
123
+ };
124
+ export type StoredPaymentOption = {
125
+ account: string | null;
126
+ brand: string;
127
+ display_name: string;
128
+ icon_url: string;
129
+ id: string;
130
+ payment_method: string;
131
+ };
132
+ export type PaymentProfile = {
133
+ available_payment_method_item: any | null;
134
+ available_payment_methods: AvailablePaymentMethod[];
135
+ checkout_banner: any | null;
136
+ payment_methods: PaymentMethod[];
137
+ preferred_payment_option_id: string;
138
+ stored_payment_options: StoredPaymentOption[];
139
+ };
140
+ export type WalletTransactionsInput = {
141
+ page_number: number;
142
+ };
143
+ export type WalletTransaction = {
144
+ account: string;
145
+ amount_in_cents: number;
146
+ brand: string;
147
+ display_name: string;
148
+ icon_url: string;
149
+ id: string;
150
+ status: string;
151
+ timestamp: number;
152
+ transaction_method: string;
153
+ transaction_type: string;
154
+ };
155
+ export type ReturnedContainer = {
156
+ localized_name: string;
157
+ price: number;
158
+ quantity: number;
159
+ type: string;
160
+ };
161
+ export type Deposit = {
162
+ count: number;
163
+ type: string;
164
+ value: number;
165
+ };
166
+ export type WalletTransactionDetails = {
167
+ article_issue_refunds: any[];
168
+ debt_resolution: any | null;
169
+ delivery_debt: any | null;
170
+ delivery_id: string;
171
+ deposits: Deposit[];
172
+ refunded_items: any[];
173
+ returned_containers: ReturnedContainer[];
174
+ shop_items: OrderLine[];
175
+ };
176
+ export type OpeningTime = {
177
+ start: number[];
178
+ end: number[];
179
+ };
180
+ export type OpeningTimes = {
181
+ [date: string]: OpeningTime;
182
+ };
183
+ export type ContactDetails = {
184
+ email: string;
185
+ phone: string;
186
+ whatsapp: string;
187
+ };
188
+ export type CustomerServiceContactInfo = {
189
+ contact_details: ContactDetails;
190
+ opening_times: OpeningTimes;
191
+ };
192
+ export type Link = {
193
+ type: string;
194
+ href: string;
195
+ };
196
+ export type BasePriceDecorator = {
197
+ type: "BASE_PRICE";
198
+ base_price_text: string;
199
+ };
200
+ export type FreshLabelDecorator = {
201
+ type: "FRESH_LABEL";
202
+ period: string;
203
+ };
204
+ export type LabelDecorator = {
205
+ type: "LABEL";
206
+ text: string;
207
+ };
208
+ export type PriceDecorator = {
209
+ type: "PRICE";
210
+ display_price: number;
211
+ };
212
+ export type QuantityDecorator = {
213
+ type: "QUANTITY";
214
+ quantity: number;
215
+ };
216
+ export type BackgroundImageDecorator = {
217
+ type: "BACKGROUND_IMAGE";
218
+ image_ids: string[];
219
+ height_percent: number;
220
+ };
221
+ export type DeeplinkReference = {
222
+ type: "DEEPLINK";
223
+ target: string;
224
+ };
225
+ export type SubBanner = {
226
+ banner_id: string;
227
+ image_id: string;
228
+ display_time: string;
229
+ description: string;
230
+ reference: DeeplinkReference;
231
+ position: string;
232
+ };
233
+ export type BannersDecorator = {
234
+ type: "BANNERS";
235
+ height_percentage: number;
236
+ banners: SubBanner[];
237
+ };
238
+ export type UnitQuantityDecorator = {
239
+ type: "UNIT_QUANTITY";
240
+ unit_quantity_text: string;
241
+ };
242
+ export type OrderedQuantityDecorator = {
243
+ type: "ORDERED_QUANTITY";
244
+ image_id: string;
245
+ quantity: string;
246
+ };
247
+ export type ProductSizeDecorator = {
248
+ type: "PRODUCT_SIZE";
249
+ text: string;
250
+ };
251
+ export type ValidityLabelDecorator = {
252
+ type: "VALIDITY_LABEL";
253
+ valid_until: string;
254
+ };
255
+ export type Position = {
256
+ start_index: number;
257
+ length: number;
258
+ };
259
+ export type Style = {
260
+ position: Position;
261
+ color: string;
262
+ style: string;
263
+ };
264
+ export type TitleStyleDecorator = {
265
+ type: "TITLE_STYLE";
266
+ styles: Style[];
267
+ };
268
+ export type MoreButtonDecorator = {
269
+ type: "MORE_BUTTON";
270
+ link: Link;
271
+ images: string[];
272
+ sellable_item_count: number;
273
+ };
274
+ export type Explanation = {
275
+ short_explanation: string;
276
+ long_explanation: string;
277
+ };
278
+ export type Replacement = {
279
+ type: "REPLACEMENT";
280
+ display_price: number;
281
+ image_id: string;
282
+ replacement_type: string;
283
+ } & ArticleMixin;
284
+ export type UnavailableDecorator = {
285
+ type: "UNAVAILABLE";
286
+ reason: string;
287
+ replacements?: Replacement[];
288
+ deeplink: string;
289
+ explanation: Explanation;
290
+ };
291
+ export type Characteristics = {
292
+ baby_month: string | null;
293
+ rating: string | null;
294
+ score: string | null;
295
+ type: "FROZEN";
296
+ };
297
+ export type ProductCharacteristicsDecorator = {
298
+ type: "PRODUCT_CHARACTERISTICS";
299
+ characteristics: Characteristics[];
300
+ };
301
+ export type FailureReason = "PRODUCT_ABSENT" | "PRODUCT_LOW_QUALITY" | "PRODUCT_NOT_SHIPPED";
302
+ export type ArticleDeliveryFailureDecorator = {
303
+ type: "ARTICLE_DELIVERY_FAILURES";
304
+ failures: {
305
+ [x: string]: FailureReason[];
306
+ };
307
+ prices: {
308
+ [x: string]: number;
309
+ };
310
+ };
311
+ export type ImmutableDecorator = {
312
+ type: "IMMUTABLE";
313
+ };
314
+ export type BundlesButtonDecorator = {
315
+ type: "BUNDLES_BUTTON";
316
+ icon_color: string;
317
+ deeplink: string;
318
+ background_color: string;
319
+ };
320
+ export type Decorator = BasePriceDecorator | FreshLabelDecorator | LabelDecorator | PriceDecorator | BackgroundImageDecorator | BannersDecorator | QuantityDecorator | UnitQuantityDecorator | ValidityLabelDecorator | TitleStyleDecorator | MoreButtonDecorator | UnavailableDecorator | ImmutableDecorator | ArticleDeliveryFailureDecorator | BundlesButtonDecorator | OrderedQuantityDecorator | ProductSizeDecorator | ProductCharacteristicsDecorator;
321
+ export type SingleArticle = {
322
+ type: "SINGLE_ARTICLE";
323
+ display_price: number;
324
+ image_id: string;
325
+ } & ArticleMixin;
326
+ export type SearchResult = {
327
+ decorators: Decorator[];
328
+ display_price: string;
329
+ id: string;
330
+ image_id: string;
331
+ max_count: number;
332
+ name: string;
333
+ unit_quantity: string;
334
+ };
335
+ export type SearchSuggestion = {
336
+ type: "SEARCH_SUGGESTION";
337
+ id: string;
338
+ links: Link[];
339
+ suggestion: string;
340
+ };
341
+ export type SuggestionResult = SearchSuggestion;
342
+ export type NutritionalSubValue = {
343
+ name: string;
344
+ value: string;
345
+ gda_percentage: string;
346
+ };
347
+ export type NutritionalValue = {
348
+ name: string;
349
+ value: string;
350
+ gda_percentage: string;
351
+ sub_values: NutritionalSubValue[];
352
+ };
353
+ export type SubCategory = {
354
+ type: "CATEGORY";
355
+ id: string;
356
+ decorators: Decorator[];
357
+ links: Link[];
358
+ name: string;
359
+ items: Category[];
360
+ level: number;
361
+ is_included_in_category_tree: boolean;
362
+ hidden: boolean;
363
+ };
364
+ export type Category = {
365
+ type: "CATEGORY";
366
+ id: string;
367
+ decorators: Decorator[];
368
+ links: Link[];
369
+ name: string;
370
+ items: SubCategory[];
371
+ level: number;
372
+ is_included_in_category_tree: boolean;
373
+ hidden: boolean;
374
+ };
375
+ export type TemplatedContent = {
376
+ type: "TEMPLATED_CONTENT";
377
+ template_id: string;
378
+ version_id: string;
379
+ version_name: string;
380
+ content: string;
381
+ parameters: string[];
382
+ actions: string[];
383
+ };
384
+ export type Content = {
385
+ type: "CONTENT";
386
+ id: string;
387
+ display_position: string;
388
+ payload: TemplatedContent;
389
+ };
390
+ export type DisplayPositionContent = {
391
+ type: "DISPLAY_POSITION_CONTENTS";
392
+ id: string;
393
+ links: Link[];
394
+ display_position: string;
395
+ items: Content[];
396
+ };
397
+ export type MyStore = {
398
+ type: "MY_STORE";
399
+ catalog: Category[];
400
+ content: DisplayPositionContent[];
401
+ user: User;
402
+ first_time_user: boolean;
403
+ landing_page_hint: string;
404
+ id: string;
405
+ links: Link[];
406
+ };
407
+ export type ArticleMixin = {
408
+ id: string;
409
+ name: string;
410
+ unit_quantity: string;
411
+ unit_quantity_sub?: string;
412
+ price: number;
413
+ tags: any[];
414
+ decorators: Decorator[];
415
+ max_count: number;
416
+ };
417
+ export type OrderArticle = {
418
+ type: "ORDER_ARTICLE";
419
+ image_ids: string[];
420
+ perishable: boolean;
421
+ } & ArticleMixin;
422
+ export type OrderLine = {
423
+ type: "ORDER_LINE";
424
+ id: string;
425
+ items: OrderArticle[];
426
+ display_price: number;
427
+ price: number;
428
+ decorators: Decorator[];
429
+ };
430
+ export type Source = {
431
+ id: string;
432
+ };
433
+ export type ImageComponent = {
434
+ type: string;
435
+ source: Source;
436
+ width: number;
437
+ height: number;
438
+ resize_mode: string;
439
+ };
440
+ export type IconImages = {
441
+ "image-id": string;
442
+ };
443
+ export type TrackingAttributes = {
444
+ template_variant_id: string;
445
+ entity_ids: string[];
446
+ };
447
+ export type PML<Component> = {
448
+ pml_version: string;
449
+ component: Component;
450
+ images?: IconImages;
451
+ tracking_attributes: TrackingAttributes;
452
+ };
453
+ export type Icon = PML<ImageComponent>;
454
+ export type DeliverySlot = {
455
+ slot_id: string;
456
+ hub_id: string;
457
+ fc_id: string;
458
+ window_start: string;
459
+ window_end: string;
460
+ cut_off_time: string;
461
+ is_available: boolean;
462
+ selected: boolean;
463
+ reserved: boolean;
464
+ minimum_order_value: number;
465
+ icon?: Icon;
466
+ unavailability_reason: "CLOSED" | string;
467
+ };
468
+ export type SelectedSlot = {
469
+ slot_id: string;
470
+ state: string;
471
+ };
472
+ export type StackComponent = {
473
+ type: "STACK";
474
+ axis?: string;
475
+ alignment: string;
476
+ spacing: string;
477
+ padding_vertical?: number;
478
+ children?: Component[];
479
+ child?: Component;
480
+ };
481
+ export type ContainerComponent = {
482
+ type: "CONTAINER";
483
+ border_width: number;
484
+ border_radius: number;
485
+ border_color: string;
486
+ background_color: string;
487
+ width: number;
488
+ height: number;
489
+ children?: Component[];
490
+ child?: Component;
491
+ };
492
+ export type RichTextComponent = {
493
+ type: "RICH_TEXT";
494
+ text_type: string;
495
+ text_alignment: string;
496
+ markdown: string;
497
+ };
498
+ export type Component = StackComponent | ContainerComponent | ImageComponent | RichTextComponent;
499
+ export type SlotSelectorMessage = {
500
+ pml_version: string;
501
+ component: Component;
502
+ images: {
503
+ icon: string;
504
+ };
505
+ tracking_attributes: TrackingAttributes;
506
+ };
507
+ export type DepositBreakdown = {
508
+ type: "BAG" | "DEFAULT" | string;
509
+ value: number;
510
+ count: number;
511
+ };
512
+ export type Order = {
513
+ type: "ORDER";
514
+ id: string;
515
+ items: OrderLine[];
516
+ delivery_slots: DeliverySlot[];
517
+ selected_slot: SelectedSlot;
518
+ slot_selector_message: SlotSelectorMessage;
519
+ total_count: number;
520
+ total_price: number;
521
+ checkout_total_price: number;
522
+ mts: number;
523
+ deposit_breakdown: DepositBreakdown[];
524
+ total_savings: number;
525
+ total_deposit: number;
526
+ cancellable: boolean;
527
+ creation_time: string;
528
+ status: DeliveryStatus;
529
+ decorator_overrides: {
530
+ [key: string]: Decorator[];
531
+ };
532
+ cancellation_time: string | null;
533
+ };
534
+ export type AddProductInput = {
535
+ product_id: string;
536
+ count: number;
537
+ };
538
+ export type GetDeliverySlotsResult = {
539
+ delivery_slots: DeliverySlot[];
540
+ slot_selector_message: SlotSelectorMessage;
541
+ selected_slot: SelectedSlot;
542
+ };
543
+ export type SetDeliverySlotInput = {
544
+ slot_id: string;
545
+ };
546
+ export type DeliveryStatus = "CURRENT" | "COMPLETED" | "CANCELLED" | string;
547
+ export type DeliveryTime = {
548
+ start: string;
549
+ end: string;
550
+ };
551
+ export type ReturnContainer = {
552
+ type: "BAG" | "BEER_BOTTLE" | "DISPOSABLE" | "NESPRESSO_BAG" | string;
553
+ localized_name: string;
554
+ quantity: number;
555
+ price: number;
556
+ };
557
+ export type Delivery = {
558
+ type: "DELIVERY";
559
+ id: string;
560
+ delivery_id: string;
561
+ creation_time: string;
562
+ slot: DeliverySlot;
563
+ eta2: DeliveryTime;
564
+ status: DeliveryStatus;
565
+ delivery_time: DeliveryTime;
566
+ orders: Order[];
567
+ returned_containers: ReturnContainer[];
568
+ parcels: any[];
569
+ };
570
+ export type Vehicle = {
571
+ image: string;
572
+ };
573
+ export type Scenario = {
574
+ ts: string;
575
+ lng: string;
576
+ lat: string;
577
+ };
578
+ export type DeliveryScenario = {
579
+ scenario: Scenario[];
580
+ vehicle: Vehicle;
581
+ };
582
+ export type DeliveryPosition = {
583
+ scenario_ts: string;
584
+ };
585
+ export type OrderStatus = {
586
+ checkout_status: "FINISHED" | string;
587
+ };
588
+ export type MgmDetails = {
589
+ mgm_code: string;
590
+ invitee_value: number;
591
+ inviter_value: number;
592
+ share_url: string;
593
+ amount_earned: number;
594
+ };
595
+ export type ConsentSettingText = {
596
+ title: string;
597
+ text: string;
598
+ dissent_text: string;
599
+ timestamp: string;
600
+ };
601
+ export type ConsentSetting = {
602
+ type: string;
603
+ id: string;
604
+ text_id: string;
605
+ text_locale: string;
606
+ text: ConsentSettingText;
607
+ established_decision: boolean;
608
+ initial_state: boolean;
609
+ };
610
+ export type ConsentDeclaration = {
611
+ consent_request_text_id: string;
612
+ consent_request_locale: string;
613
+ agreement: boolean;
614
+ };
615
+ export type SetConsentSettingsInput = {
616
+ consent_declarations: ConsentDeclaration[];
617
+ };
618
+ export type SetConsentSettingsResult = {
619
+ consent_request_text_ids: string[];
620
+ };
621
+ export type NutritionalTable = {
622
+ type: "NUTRITIONAL_TABLE";
623
+ nutritional_table: {
624
+ default_unit: string;
625
+ values: NutritionalValue[];
626
+ };
627
+ };
628
+ export type PriceInfo = {
629
+ price: number;
630
+ price_color: string | null;
631
+ original_price: number | null;
632
+ deposit: number | null;
633
+ base_price_text: string | null;
634
+ };
635
+ export type Tagged<Type, Obj> = {
636
+ type: Type;
637
+ } & Obj;
638
+ export type ArticleMiscHeader = {
639
+ icon: string;
640
+ text: string;
641
+ };
642
+ export type ArticleMiscBody = NutritionalTable | Tagged<"PML", {
643
+ pml_content: PML<Component>;
644
+ }>;
645
+ export type ArticleMisc = {
646
+ header: ArticleMiscHeader;
647
+ body: ArticleMiscBody;
648
+ };
649
+ export type ArticleHighlight = {
650
+ icon: string;
651
+ text: string;
652
+ action: any | null;
653
+ };
654
+ export type AllergyContains = {
655
+ name: string;
656
+ color: string;
657
+ };
658
+ export type Allergies = {
659
+ allergy_contains: AllergyContains[];
660
+ allergy_may_contain: string[];
661
+ allergy_text: string | null;
662
+ };
663
+ export type ArticleLabels = {
664
+ brand_tier: any | null;
665
+ status: any[];
666
+ characteristics: any[];
667
+ size: any | null;
668
+ promo: {
669
+ text: string;
670
+ } | null;
671
+ };
672
+ export type ArticleDescription = {
673
+ main: string;
674
+ extension: string | null;
675
+ };
676
+ export type Article = {
677
+ type: "ARTICLE_DETAILS";
678
+ id: string;
679
+ name: string;
680
+ description: ArticleDescription;
681
+ images: {
682
+ image_id: string;
683
+ }[];
684
+ labels: ArticleLabels;
685
+ price_info: PriceInfo;
686
+ unit_quantity: string;
687
+ max_order_quantity: number;
688
+ category_link: string;
689
+ allergies: Allergies;
690
+ highlights: ArticleHighlight[];
691
+ mood_gallery: (Tagged<"Image", {
692
+ image_id: string;
693
+ }> | any)[];
694
+ decorators?: Decorator[];
695
+ misc: ArticleMisc[];
696
+ };
697
+ //# sourceMappingURL=picnic-api.d.ts.map