@iheartjane/dm-sdk 2.24.1-edge.fd78782

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,1082 @@
1
+ declare enum AdMode {
2
+ All = "all",
3
+ Default = "default",
4
+ Off = "off"
5
+ }
6
+ declare enum AppMode {
7
+ Bloom = "bloom",
8
+ Default = "default",
9
+ Embedded = "embedded",
10
+ FramelessEmbed = "framelessEmbed",
11
+ Headless = "headless",
12
+ Kiosk = "kiosk",
13
+ OperatorEmbed = "operatorEmbed",
14
+ WhiteLabel = "whiteLabel"
15
+ }
16
+ declare enum IntendedDisplay {
17
+ Desktop = "desktop",
18
+ Kiosk = "kiosk",
19
+ Mobile = "mobile"
20
+ }
21
+ declare enum JaneDeviceIdSentinel {
22
+ UserOptOut = "user-opt-out"
23
+ }
24
+ declare enum PageContextEnum {
25
+ Featured = "featured",
26
+ Midgrid = "midgrid"
27
+ }
28
+ declare enum Placement {
29
+ BestSelling = "best_selling",
30
+ BrandSpecials = "brand_specials",
31
+ BuyAgainRow = "buy_again_row",
32
+ CartToppers = "cart_toppers",
33
+ CustomImageRow = "custom_image_row",
34
+ FeaturedRow = "featured_row",
35
+ MenuDynamicRow = "menu_dynamic_row",
36
+ MenuInline = "menu_inline",
37
+ MenuInlineTable = "menu_inline_table",
38
+ MenuTopRow = "menu_top_row",
39
+ PdpRow = "pdp_row",
40
+ Sale = "sale",
41
+ Specials = "specials",
42
+ VirtualBudtenderSearch = "virtual_budtender_search"
43
+ }
44
+ declare enum ProductKindEnum {
45
+ Edible = "edible",
46
+ Extract = "extract",
47
+ Flower = "flower",
48
+ Gear = "gear",
49
+ Grow = "grow",
50
+ Merch = "merch",
51
+ PreRoll = "pre-roll",
52
+ Tincture = "tincture",
53
+ Topical = "topical",
54
+ Vape = "vape"
55
+ }
56
+ declare enum ReviewSortEnum {
57
+ Rating = "rating",
58
+ Recent = "recent",
59
+ Upvote = "upvote"
60
+ }
61
+ declare enum SearchSortEnum {
62
+ BestSellerRank = "best-seller-rank",
63
+ CategoryAndNameAsc = "category-and-name-asc",
64
+ Default = "default",
65
+ PriceAsc = "price-asc",
66
+ PriceDesc = "price-desc",
67
+ PriceEighthOunceAsc = "price-eighth-ounce-asc",
68
+ PriceEighthOunceDesc = "price-eighth-ounce-desc",
69
+ PriceGramAsc = "price-gram-asc",
70
+ PriceGramDesc = "price-gram-desc",
71
+ PriceHalfGramAsc = "price-half-gram-asc",
72
+ PriceHalfGramDesc = "price-half-gram-desc",
73
+ PriceHalfOunceAsc = "price-half-ounce-asc",
74
+ PriceHalfOunceDesc = "price-half-ounce-desc",
75
+ PriceOunceAsc = "price-ounce-asc",
76
+ PriceOunceDesc = "price-ounce-desc",
77
+ PriceQuarterOunceAsc = "price-quarter-ounce-asc",
78
+ PriceQuarterOunceDesc = "price-quarter-ounce-desc",
79
+ PriceTwoGramAsc = "price-two-gram-asc",
80
+ PriceTwoGramDesc = "price-two-gram-desc",
81
+ Rating = "rating",
82
+ Recommendation = "recommendation",
83
+ ThcPotencyAsc = "thc-potency-asc",
84
+ ThcPotencyDesc = "thc-potency-desc"
85
+ }
86
+ declare enum SessionEventCategory {
87
+ Edible = "edible",
88
+ Extract = "extract",
89
+ Flower = "flower",
90
+ PreRoll = "pre-roll",
91
+ Vape = "vape"
92
+ }
93
+ interface BrandSpecials {
94
+ placement: Placement;
95
+ /**
96
+ * The title of the brand specials
97
+ */
98
+ title?: string;
99
+ }
100
+ interface BrandSpecialsPlacementResponse {
101
+ placement?: Placement;
102
+ specials?: BrandSpecials[];
103
+ title?: string;
104
+ }
105
+ type Click = {
106
+ /**
107
+ * Distinct identifier
108
+ */
109
+ distinctId?: string;
110
+ /**
111
+ * Should be true if the click ads the product to the cart
112
+ */
113
+ isAddToCart?: boolean;
114
+ /**
115
+ * Jane device identifier
116
+ */
117
+ janeDeviceId: string;
118
+ /**
119
+ * Jane store identifier
120
+ */
121
+ storeId: number;
122
+ } & Engagement;
123
+ interface ConversionExternalProduct {
124
+ posProductId: string;
125
+ price: number;
126
+ quantity: number;
127
+ }
128
+ interface CustomImageData$1 {
129
+ headline: string;
130
+ image_url: string;
131
+ intended_display: IntendedDisplay;
132
+ logo_url: string;
133
+ overlay_color: string;
134
+ position_x: number;
135
+ position_y: number;
136
+ scale_number: number;
137
+ text_color: string;
138
+ }
139
+ interface Engagement {
140
+ /**
141
+ * Ad token
142
+ */
143
+ adToken?: string;
144
+ /**
145
+ * Kevel token
146
+ */
147
+ kevelToken?: string;
148
+ /**
149
+ * MyHigh identifier
150
+ */
151
+ myHighD?: string;
152
+ /**
153
+ * Product ID
154
+ */
155
+ productId: number;
156
+ }
157
+ type FilterContext = KindFilterContext;
158
+ interface Impression {
159
+ /**
160
+ * Distinct identifier
161
+ */
162
+ distinctId?: string;
163
+ /**
164
+ * @minItems 1
165
+ */
166
+ engagements: Engagement[];
167
+ /**
168
+ * Jane device identifier
169
+ */
170
+ janeDeviceId: string;
171
+ }
172
+ interface KindFilterContext {
173
+ kind: ProductKindEnum[];
174
+ }
175
+ interface PageProduct {
176
+ object_id: string;
177
+ search_attributes?: Record<string, unknown>;
178
+ }
179
+ interface PageResponse {
180
+ products?: PageProduct[];
181
+ }
182
+ type PlacementResponse = BrandSpecialsPlacementResponse | ProductsPlacementResponse | SpecialsPlacementResponse;
183
+ interface Product {
184
+ ad_token: string;
185
+ flight_id?: number;
186
+ kevel_token?: string;
187
+ my_high_d?: string;
188
+ object_id: string;
189
+ price_id?: string;
190
+ product_id: number;
191
+ search_attributes?: Record<string, unknown>;
192
+ store_id: number;
193
+ }
194
+ interface ProductReviewsResponse$1 {
195
+ aggregate: ReviewAggregate;
196
+ ai_summary?: string;
197
+ product_id: number;
198
+ reviews: Review[];
199
+ total_count: number;
200
+ }
201
+ interface ProductsPlacementResponse {
202
+ creative_ids?: number[];
203
+ /**
204
+ * @deprecated true
205
+ */
206
+ custom_image_data?: CustomImageData$1;
207
+ custom_images?: CustomImageData$1[];
208
+ nb_hits?: number;
209
+ placement?: Placement;
210
+ products?: Product[];
211
+ row_id?: number;
212
+ search_facets?: Record<string, Record<string, number>>;
213
+ title?: string;
214
+ }
215
+ interface Review {
216
+ activities?: string[];
217
+ avatar?: number;
218
+ comment?: string;
219
+ /**
220
+ * @format date-time
221
+ */
222
+ created_at: string;
223
+ feelings?: string[];
224
+ has_comment: boolean;
225
+ id: number;
226
+ nickname?: string;
227
+ product_id: number;
228
+ rating: number;
229
+ store_id?: number;
230
+ store_name?: string;
231
+ /**
232
+ * @format date-time
233
+ */
234
+ updated_at: string;
235
+ upvote_count: number;
236
+ }
237
+ interface ReviewAggregate {
238
+ activities_distribution?: ReviewDistribution;
239
+ average_rating: number;
240
+ distribution: ReviewDistribution;
241
+ feelings_distribution?: ReviewDistribution;
242
+ review_count: number;
243
+ }
244
+ type ReviewDistribution = Record<string, number>;
245
+ type SessionEvent = ({
246
+ type: 'clickedAddToCart';
247
+ } & Omit<SessionEventClickedAddToCart, 'type'>) | ({
248
+ type: 'filteredCategory';
249
+ } & SessionEventFilteredCategory) | ({
250
+ type: 'viewedProduct';
251
+ } & Omit<SessionEventViewedProduct, 'type'>);
252
+ type SessionEventClickedAddToCart = SessionEventClickedAddToCartPOSProduct | SessionEventClickedAddToCartProduct;
253
+ interface SessionEventClickedAddToCartPOSProduct {
254
+ posProductId: string;
255
+ productId?: never;
256
+ storeId: number;
257
+ }
258
+ interface SessionEventClickedAddToCartProduct {
259
+ posProductId?: never;
260
+ productId: number;
261
+ storeId: number;
262
+ }
263
+ interface SessionEventFilteredCategory {
264
+ category: SessionEventCategory;
265
+ storeId: number;
266
+ }
267
+ type SessionEventViewedProduct = SessionEventViewedProductPOSProduct | SessionEventViewedProductProduct;
268
+ interface SessionEventViewedProductPOSProduct {
269
+ posProductId: string;
270
+ productId?: never;
271
+ storeId: number;
272
+ }
273
+ interface SessionEventViewedProductProduct {
274
+ posProductId?: never;
275
+ productId: number;
276
+ storeId: number;
277
+ }
278
+ interface SpecialResponse {
279
+ description?: string;
280
+ specialId?: number;
281
+ title?: string;
282
+ }
283
+ interface SpecialsPlacementResponse {
284
+ placement?: Placement;
285
+ specials?: SpecialResponse[];
286
+ title?: string;
287
+ }
288
+ type VirtualBudtenderProduct = {
289
+ /**
290
+ * AI-generated explanation for why this product matches the query
291
+ *
292
+ * @example This product contains CBD which is known for its calming effects and may help with sleep
293
+ */
294
+ reasoning?: string;
295
+ /**
296
+ * Relevance score for this product (0 to 10)
297
+ *
298
+ * @example 8.5
299
+ * @format float
300
+ * @maximum 10
301
+ * @minimum 0
302
+ */
303
+ score?: number;
304
+ } & Product;
305
+ interface VirtualBudtenderQuery {
306
+ /**
307
+ * Human-readable display text for the query
308
+ *
309
+ * @example Help me sleep
310
+ */
311
+ displayText: string;
312
+ /**
313
+ * The natural language query string
314
+ *
315
+ * @example help me sleep
316
+ */
317
+ query: string;
318
+ }
319
+ interface VirtualBudtenderSearchResponse {
320
+ /**
321
+ * AI-generated response in HTML format
322
+ *
323
+ * @example <p>Based on your request for sleep help, I recommend these products...</p>
324
+ */
325
+ htmlResponse: string;
326
+ /**
327
+ * AI-generated response in markdown format
328
+ *
329
+ * @example Based on your request for sleep help, I recommend these products that contain CBD and indica strains...
330
+ */
331
+ markdownResponse: string;
332
+ /**
333
+ * List of products matching the query
334
+ */
335
+ products: VirtualBudtenderProduct[];
336
+ /**
337
+ * The original query that was searched
338
+ *
339
+ * @example help me sleep
340
+ */
341
+ query: string;
342
+ /**
343
+ * Total number of products found
344
+ *
345
+ * @example 15
346
+ * @minimum 0
347
+ */
348
+ totalResults: number;
349
+ /**
350
+ * Raw AI-generated response without formatting
351
+ *
352
+ * @example Based on your request for sleep help, I recommend these products that contain CBD and indica strains...
353
+ */
354
+ unformattedResponse: string;
355
+ }
356
+
357
+ /**
358
+ * Configuration options for the Jane DM SDK client.
359
+ */
360
+ type JaneDMConfig = JaneDMInternalConfig & JaneDMPublicConfig;
361
+ /**
362
+ * Tracking identifiers for a user
363
+ */
364
+ interface JaneDMIdentifiers {
365
+ /**
366
+ * A unique identifier, UUID, representing the device visiting the site
367
+ */
368
+ jdid: string;
369
+ /**
370
+ * @internal
371
+ */
372
+ mixpanelDistinctId?: string;
373
+ /**
374
+ * Optional unique identifier for an external pos authenticated user
375
+ */
376
+ posUserId?: string;
377
+ /**
378
+ * Optional unique identifier for a Jane authenticated user
379
+ */
380
+ userId?: number;
381
+ }
382
+ /**
383
+ * Internal configuration options for the Jane DM SDK client.
384
+ * Should never be set by the consumer of the SDK.
385
+ *
386
+ * **Modification of these fields will result in unexpected behavior.**
387
+ * @internal
388
+ */
389
+ interface JaneDMInternalConfig {
390
+ /**
391
+ * The context in which the DM placements should be served in
392
+ *
393
+ * Should never be set by the consumer of the SDK
394
+ *
395
+ * @default 'headless'
396
+ * @internal
397
+ */
398
+ appMode?: AppMode;
399
+ /**
400
+ * Endpoint used for tracking events
401
+ *
402
+ * The default value is the same as the endpoint
403
+ *
404
+ * Should never be set by the consumer of the SDK
405
+ * @internal
406
+ */
407
+ eventsEndpoint?: string;
408
+ /**
409
+ * Endpoint used for fetching the page data
410
+ *
411
+ * The default value is the same as the endpoint
412
+ *
413
+ * Should never be set by the consumer of the SDK
414
+ * @internal
415
+ */
416
+ pageEndpoint?: string;
417
+ /**
418
+ * Skip automatic onLoad call in SmartSort constructor
419
+ *
420
+ * When true, prevents automatic fingerprint collection and session events
421
+ * on SmartSort instantiation. Use this when you need manual control over
422
+ * when onLoad is triggered.
423
+ *
424
+ * Should never be set by the consumer of the SDK
425
+ *
426
+ * @default false
427
+ * @internal
428
+ */
429
+ skipAutoSmartSortOnLoad?: boolean;
430
+ /**
431
+ * This is an internal field used for tracking the source of the SDK
432
+ *
433
+ * Should never be set by the consumer of the SDK
434
+ *
435
+ * @default 'sdk'
436
+ * @internal
437
+ */
438
+ source?: string;
439
+ }
440
+ /**
441
+ * Public configuration options for the Jane DM SDK client.
442
+ */
443
+ interface JaneDMPublicConfig {
444
+ /**
445
+ * Key that enables access to the DM API.
446
+ *
447
+ * Reach out to a Jane representative to learn more about how to obtain an API key.
448
+ */
449
+ apiKey: string;
450
+ /**
451
+ * The endpoint to use for the DM API
452
+ * @default 'https://dmerch.iheartjane.com'
453
+ */
454
+ endpoint?: string;
455
+ /**
456
+ * Identifiers object for user tracking purposes
457
+ */
458
+ identifier?: JaneDMIdentifiers;
459
+ }
460
+ type RequiredConfig = Required<JaneDMConfig>;
461
+
462
+ type Facets = Record<string, Record<string, number>>;
463
+
464
+ /**
465
+ * Default page size used across paginated resources when the caller does
466
+ * not specify one. Matches the server-side default.
467
+ */
468
+ declare const DEFAULT_PAGE_SIZE = 50;
469
+ /**
470
+ * Shared shape for every paginated iterator in the SDK. Yields items
471
+ * one at a time by default; `.pages` exposes an iterator over whole
472
+ * page envelopes for callers that need page-level data during traversal.
473
+ *
474
+ * Internal: not re-exported from the public SDK entry point. Consumers
475
+ * use the concrete per-resource iterable types (e.g.
476
+ * `ProductReviewsIterable`).
477
+ */
478
+ interface PaginatedIterable<TItem, TResponse> extends AsyncIterable<TItem> {
479
+ pages: AsyncIterable<TResponse>;
480
+ }
481
+ /**
482
+ * Shared shape for every paginated response in the SDK. Per-resource
483
+ * types extend this with domain-specific fields (e.g. aggregates) at
484
+ * the top level.
485
+ *
486
+ * Internal: not re-exported from the public SDK entry point. Consumers
487
+ * use the concrete per-resource types (e.g. `ProductReviewsResponse`).
488
+ */
489
+ interface PaginatedResponse<TItem> {
490
+ items: TItem[];
491
+ pagination: PaginationInfo;
492
+ }
493
+ /**
494
+ * Pagination metadata included on every paginated response envelope.
495
+ *
496
+ * Use this shape when typing your own pagination UI components
497
+ * (e.g. a page selector, next/prev buttons, or an infinite-scroll
498
+ * "load more" control).
499
+ */
500
+ interface PaginationInfo {
501
+ /**
502
+ * The page that was returned. 1-indexed.
503
+ */
504
+ currentPage: number;
505
+ /**
506
+ * `true` when another page exists after `currentPage`.
507
+ */
508
+ hasNextPage: boolean;
509
+ /**
510
+ * `true` when a page exists before `currentPage`.
511
+ */
512
+ hasPreviousPage: boolean;
513
+ /**
514
+ * The size of the current page, echoing the requested `pageSize`.
515
+ */
516
+ pageSize: number;
517
+ /**
518
+ * Total number of items across every page, matching the filter.
519
+ */
520
+ totalCount: number;
521
+ /**
522
+ * `Math.ceil(totalCount / pageSize)`, floored to 1 so empty result
523
+ * sets still have at least one page.
524
+ */
525
+ totalPages: number;
526
+ }
527
+
528
+ /**
529
+ * Filter/config props accepted by `fetchProductReviews`.
530
+ */
531
+ interface FetchProductReviewsProps {
532
+ activities?: string[];
533
+ feelings?: string[];
534
+ /**
535
+ * When `true`, restricts results to reviews that have a non-empty
536
+ * comment. Every aggregate in the response (counts, average, star
537
+ * distribution, feeling/activity tag distributions) is computed over
538
+ * only the commented reviews.
539
+ *
540
+ * Omit (or `false`) for no filter — both are equivalent, since `false`
541
+ * is a no-op server-side. The SDK drops `false` from the request body
542
+ * to keep the payload minimal.
543
+ */
544
+ hasComment?: boolean;
545
+ /**
546
+ * 1-indexed. Defaults to 1.
547
+ */
548
+ page?: number;
549
+ pageSize?: number;
550
+ productId: number;
551
+ ratings?: number[];
552
+ sort?: ReviewSortEnum;
553
+ }
554
+ /**
555
+ * Filter/config props accepted by `iterateProductReviews`. Identical to
556
+ * `FetchProductReviewsProps` except `page` is omitted — the iterator
557
+ * always starts at page 1 and advances until the server reports no
558
+ * more pages.
559
+ */
560
+ type IterateProductReviewsProps = Omit<FetchProductReviewsProps, 'page'>;
561
+ interface ProductReview {
562
+ activities?: string[];
563
+ avatar?: number;
564
+ comment?: string;
565
+ createdAt: string;
566
+ feelings?: string[];
567
+ hasComment: boolean;
568
+ id: number;
569
+ nickname?: string;
570
+ productId: number;
571
+ rating: number;
572
+ storeId?: number;
573
+ storeName?: string;
574
+ updatedAt: string;
575
+ upvoteCount: number;
576
+ }
577
+ interface ProductReviewsAggregate {
578
+ activitiesDistribution?: Record<string, number>;
579
+ averageRating: number;
580
+ distribution: Record<string, number>;
581
+ feelingsDistribution?: Record<string, number>;
582
+ reviewCount: number;
583
+ }
584
+ /**
585
+ * Async iterable returned by `JaneDM.iterateProductReviews`. Yields
586
+ * individual reviews by default; use `.pages` to iterate over whole
587
+ * page envelopes.
588
+ *
589
+ * @see [Pagination guide](https://dm-sdk-docs.iheartjane.com/app/pagination).
590
+ */
591
+ type ProductReviewsIterable = PaginatedIterable<ProductReview, ProductReviewsResponse>;
592
+ /**
593
+ * Envelope returned by `JaneDM.fetchProductReviews`. Extends the SDK's
594
+ * shared paginated-response shape with review-specific fields.
595
+ *
596
+ * @see {@link PaginationInfo} for the `pagination` field shape.
597
+ * @see [Pagination guide](https://dm-sdk-docs.iheartjane.com/app/pagination).
598
+ */
599
+ interface ProductReviewsResponse extends PaginatedResponse<ProductReview> {
600
+ aggregate: ProductReviewsAggregate;
601
+ /**
602
+ * AI-generated summary of the product's reviews. Absent when no
603
+ * summary has been generated for the product. Whole-product: does not
604
+ * vary with the request's filters or pagination.
605
+ */
606
+ aiSummary?: string;
607
+ productId: number;
608
+ }
609
+
610
+ /**
611
+ * @deprecated Use `SearchSortEnum.best_seller_sort` instead
612
+ */
613
+ declare const bestSellerRank = "best-seller-rank";
614
+ /**
615
+ * @deprecated Use `SearchSortEnum.category_and_name_asc` instead
616
+ */
617
+ declare const categoryAndNameAsc = "category-and-name-asc";
618
+ /**
619
+ * @deprecated Use `SearchSortEnum.default` instead
620
+ */
621
+ declare const defaultOrder = "default";
622
+ /**
623
+ * @deprecated Use `SearchSortEnum.price_asc` instead
624
+ */
625
+ declare const priceAsc = "price-asc";
626
+ /**
627
+ * @deprecated Use `SearchSortEnum.price_desc` instead
628
+ */
629
+ declare const priceDesc = "price-desc";
630
+ /**
631
+ * @deprecated Use `SearchSortEnum.price_eighth_ounce_asc` instead
632
+ */
633
+ declare const priceEighthOunceAsc = "price-eighth-ounce-asc";
634
+ /**
635
+ * @deprecated Use `SearchSortEnum.price_eighth_ounce_desc` instead
636
+ */
637
+ declare const priceEighthOunceDesc = "price-eighth-ounce-desc";
638
+ /**
639
+ * @deprecated Use `SearchSortEnum.price_gram_asc` instead
640
+ */
641
+ declare const priceGramAsc = "price-gram-asc";
642
+ /**
643
+ * @deprecated Use `SearchSortEnum.price_gram_desc` instead
644
+ */
645
+ declare const priceGramDesc = "price-gram-desc";
646
+ /**
647
+ * @deprecated Use `SearchSortEnum.price_half_gram_asc` instead
648
+ */
649
+ declare const priceHalfGramAsc = "price-half-gram-asc";
650
+ /**
651
+ * @deprecated Use `SearchSortEnum.price_half_gram_desc` instead
652
+ */
653
+ declare const priceHalfGramDesc = "price-half-gram-desc";
654
+ /**
655
+ * @deprecated Use `SearchSortEnum.price_half_ounce_asc` instead
656
+ */
657
+ declare const priceHalfOunceAsc = "price-half-ounce-asc";
658
+ /**
659
+ * @deprecated Use `SearchSortEnum.price_half_ounce_desc` instead
660
+ */
661
+ declare const priceHalfOunceDesc = "price-half-ounce-desc";
662
+ /**
663
+ * @deprecated Use `SearchSortEnum.price_ounce_asc` instead
664
+ */
665
+ declare const priceOunceAsc = "price-ounce-asc";
666
+ /**
667
+ * @deprecated Use `SearchSortEnum.price_ounce_desc` instead
668
+ */
669
+ declare const priceOunceDesc = "price-ounce-desc";
670
+ /**
671
+ * @deprecated Use `SearchSortEnum.price_quarter_ounce_asc` instead
672
+ */
673
+ declare const priceQuarterOunceAsc = "price-quarter-ounce-asc";
674
+ /**
675
+ * @deprecated Use `SearchSortEnum.price_quarter_ounce_desc` instead
676
+ */
677
+ declare const priceQuarterOunceDesc = "price-quarter-ounce-desc";
678
+ /**
679
+ * @deprecated Use `SearchSortEnum.price_two_gram_asc` instead
680
+ */
681
+ declare const priceTwoGramAsc = "price-two-gram-asc";
682
+ /**
683
+ * @deprecated Use `SearchSortEnum.price_two_gram_desc` instead
684
+ */
685
+ declare const priceTwoGramDesc = "price-two-gram-desc";
686
+ /**
687
+ * @deprecated Use `SearchSortEnum.rating` instead
688
+ */
689
+ declare const rating = "rating";
690
+ /**
691
+ * @deprecated Use `SearchSortEnum.recommendation` instead
692
+ */
693
+ declare const recommendation = "recommendation";
694
+ /**
695
+ * @deprecated Use `SearchSortEnum.thc_potency_asc` instead
696
+ */
697
+ declare const thcPotencyAsc = "thc-potency-asc";
698
+ /**
699
+ * @deprecated Use `SearchSortEnum.thc_potency_desc` instead
700
+ */
701
+ declare const thcPotencyDesc = "thc-potency-desc";
702
+ declare const searchSorts: readonly ["best-seller-rank", "category-and-name-asc", "default", "price-asc", "price-desc", "price-eighth-ounce-asc", "price-eighth-ounce-desc", "price-gram-asc", "price-gram-desc", "price-half-gram-asc", "price-half-gram-desc", "price-half-ounce-asc", "price-half-ounce-desc", "price-ounce-asc", "price-ounce-desc", "price-quarter-ounce-asc", "price-quarter-ounce-desc", "price-two-gram-asc", "price-two-gram-desc", "rating", "recommendation", "thc-potency-asc", "thc-potency-desc"];
703
+ /**
704
+ * @deprecated Use `SearchSortEnum` instead
705
+ */
706
+ type SearchSort = (typeof searchSorts)[number];
707
+
708
+ interface CustomImageData {
709
+ headline: string;
710
+ imageUrl: string;
711
+ intendedDisplay: IntendedDisplay;
712
+ logoUrl: string;
713
+ overlayColor: string;
714
+ positionX: number;
715
+ positionY: number;
716
+ scaleNumber: number;
717
+ textColor: string;
718
+ }
719
+ /**
720
+ * Properties to fetch by a single store id.
721
+ */
722
+ interface FetchByStoreIdProps {
723
+ /**
724
+ * The store ID to use for the placement.
725
+ * @deprecated Use `storeIds` instead
726
+ */
727
+ storeId: number;
728
+ storeIds?: never;
729
+ }
730
+ /**
731
+ * Properties to fetch by many store ids.
732
+ */
733
+ interface FetchByStoreIdsProps {
734
+ storeId?: never;
735
+ /**
736
+ * The store IDs to use for the placement.
737
+ */
738
+ storeIds: number[];
739
+ }
740
+ /**
741
+ * Properties to fetch a CartTopperRow by POS product IDs.
742
+ */
743
+ interface FetchCartTopperRowByPosProductId {
744
+ cartProductIds?: never;
745
+ /**
746
+ * The POS IDs of the products present in the cart.
747
+ */
748
+ posCartProductIds: string[];
749
+ }
750
+ /**
751
+ * Properties to fetch a CartTopperRow by product IDs.
752
+ */
753
+ interface FetchCartTopperRowByProductProps {
754
+ /**
755
+ * The IDs of the products present in the cart.
756
+ */
757
+ cartProductIds: number[];
758
+ posCartProductIds?: never;
759
+ }
760
+ /**
761
+ * Properties to fetch a CartTopperRow.
762
+ */
763
+ type FetchCartTopperRowProps = {
764
+ /**
765
+ * Product attributes that will be returned in the search results.
766
+ */
767
+ searchAttributes: string[];
768
+ /**
769
+ * The store ID to use for the placement.
770
+ */
771
+ storeId: number;
772
+ } & (FetchCartTopperRowByPosProductId | FetchCartTopperRowByProductProps);
773
+ /**
774
+ * Properties to fetch a CustomImageRow.
775
+ */
776
+ interface FetchCustomImageRowProps {
777
+ /**
778
+ * A list of attributes to be returned in the search results, such as
779
+ * `['product_id', 'name']`.
780
+ */
781
+ searchAttributes: string[];
782
+ /**
783
+ * A filter string to be applied to the search results, such as
784
+ * `'kind:flower'`.
785
+ */
786
+ searchFilter?: string;
787
+ /**
788
+ * The store ID to use for the placement.
789
+ */
790
+ storeId: number;
791
+ }
792
+ /**
793
+ * Properties to fetch a MenuRow.
794
+ * @internal
795
+ */
796
+ type FetchMenuRowProps = {
797
+ /**
798
+ * The ad mode to use for the placement.
799
+ *
800
+ * @default AdMode.Default
801
+ */
802
+ adMode?: AdMode;
803
+ /**
804
+ * If false, the products will not be deduped across stores.
805
+ */
806
+ distinctByProduct?: boolean;
807
+ /**
808
+ * Metadata passed through data warehouse
809
+ * @internal
810
+ */
811
+ metadata?: Record<string, unknown>;
812
+ /**
813
+ * The number of columns of products that are displayed in the placement.
814
+ */
815
+ numColumns?: number;
816
+ /**
817
+ * A list of attributes to be returned in the search results, such as
818
+ * `['product_id', 'name']`.
819
+ */
820
+ searchAttributes: string[];
821
+ /**
822
+ * A filter string to be applied to the search results, such as
823
+ * `'kind:flower'`.
824
+ */
825
+ searchFilter?: string;
826
+ searchQuery?: string;
827
+ /**
828
+ * The sort order to apply to the search results.
829
+ */
830
+ searchSort: SearchSort | SearchSortEnum;
831
+ } & (FetchByStoreIdProps | FetchByStoreIdsProps);
832
+ /**
833
+ * Properties to fetch a MenuTopRow.
834
+ */
835
+ type FetchMenuTopRowProps<AdditionalTypes = object> = {
836
+ /**
837
+ * A list of attributes to be returned in the search results, such as
838
+ * `['product_id', 'name']`.
839
+ */
840
+ searchAttributes: string[];
841
+ /**
842
+ * A filter string to be applied to the search results, such as
843
+ * `'kind:flower'`.
844
+ */
845
+ searchFilter?: string;
846
+ /**
847
+ * The store ID to use for the placement.
848
+ */
849
+ storeId: number;
850
+ } & AdditionalTypes;
851
+ interface FetchRecommendedPDPRowByPosProductId {
852
+ /**
853
+ * POS Product ID of the product being viewed.
854
+ */
855
+ posProductId: string;
856
+ productId?: never;
857
+ }
858
+ interface FetchRecommendedPDPRowByProductId {
859
+ posProductId?: never;
860
+ /**
861
+ * Product ID of the product being viewed.
862
+ */
863
+ productId: number;
864
+ }
865
+ /**
866
+ * Properties to fetch a PDPRow.
867
+ */
868
+ type FetchRecommendedPDPRowProps = {
869
+ /**
870
+ * A list of attributes to be returned in the search results, such as
871
+ * `['product_id', 'name']`.
872
+ */
873
+ searchAttributes: string[];
874
+ /**
875
+ * The store ID to use for the placement.
876
+ */
877
+ storeId: number;
878
+ } & (FetchRecommendedPDPRowByPosProductId | FetchRecommendedPDPRowByProductId);
879
+ /**
880
+ * Properties to fetch a RecommendedRow
881
+ */
882
+ interface FetchRecommendedRowProps {
883
+ /**
884
+ * The ad mode to use for the placement.
885
+ *
886
+ * @default AdMode.Default
887
+ */
888
+ adMode?: AdMode;
889
+ /**
890
+ * Structured filter contexts to apply to the search results.
891
+ * Supports filtering by product kind.
892
+ * @example
893
+ * ```typescript
894
+ * filterContext: [{ kind: ['flower', 'edible', 'vape'] }]
895
+ * ```
896
+ */
897
+ filterContext?: FilterContext[];
898
+ /**
899
+ * Page context indicating where the placement appears.
900
+ * Defaults to 'featured' if not specified.
901
+ * @example
902
+ * ```typescript
903
+ * pageContext: 'featured' // or 'midgrid'
904
+ * ```
905
+ */
906
+ pageContext?: PageContextEnum;
907
+ /**
908
+ * A list of attributes to be returned in the search results, such as
909
+ * `['product_id', 'name']`.
910
+ */
911
+ searchAttributes: string[];
912
+ /**
913
+ * The store ID to use for the placement.
914
+ */
915
+ storeId: number;
916
+ }
917
+ /**
918
+ * Properties to fetch a SmartSort instance.
919
+ */
920
+ type FetchRecommendedSortProps = {
921
+ /**
922
+ * If true, no ads are displayed in the placement.
923
+ */
924
+ disableAds?: boolean;
925
+ /**
926
+ * If false, the products will not be deduped across stores.
927
+ */
928
+ distinctByProduct?: boolean;
929
+ /**
930
+ * The maximum number of products to display in the placement.
931
+ */
932
+ maxProducts?: number;
933
+ /**
934
+ * Metadata passed through data warehouse
935
+ * @internal
936
+ */
937
+ metadata?: Record<string, unknown>;
938
+ /**
939
+ * The number of columns of products that are displayed in the placement.
940
+ */
941
+ numColumns?: number;
942
+ /**
943
+ * The number of products to fetch in each page.
944
+ */
945
+ pageSize?: number;
946
+ /**
947
+ * A list of attributes to be returned in the search results, such as
948
+ * `['product_id', 'name']`.
949
+ */
950
+ searchAttributes: string[];
951
+ /**
952
+ * A list of search facets to be returned in the search results, such as
953
+ * `['kind']`.
954
+ */
955
+ searchFacets?: string[];
956
+ /**
957
+ * A filter string to be applied to the search results, such as
958
+ * `'kind:flower'`.
959
+ */
960
+ searchFilter?: string;
961
+ searchQuery?: string;
962
+ /**
963
+ * The sort order to apply to the search results.
964
+ */
965
+ searchSort: SearchSort | SearchSortEnum;
966
+ } & (FetchByStoreIdProps | FetchByStoreIdsProps);
967
+ /**
968
+ * Cached product in the SmartSort placement
969
+ * The key difference between a Cached and a regular `SmartSortProduct`
970
+ * is the hydration of the `attributes` property.
971
+ * Cached products do not have this attribute while `SmartSortProducts` do.
972
+ * @internal
973
+ */
974
+ interface SmartSortCachedProductProps {
975
+ clickPayload: Click;
976
+ clickUrl: string;
977
+ impressPayload: Impression;
978
+ impressUrl: string;
979
+ isSponsored: boolean;
980
+ objectId: string;
981
+ }
982
+ /**
983
+ * The SmartSortClickIntent is used to determine if the click
984
+ * event should be treated as an "add to cart" event.
985
+ *
986
+ */
987
+ interface SmartSortClickIntent {
988
+ /**
989
+ * When set to true, the click event will be treated as an "add to cart" event.
990
+ *
991
+ * @default false
992
+ */
993
+ isAddToCart?: boolean;
994
+ }
995
+ /**
996
+ * Data structure used to request the next set of products when loading
997
+ * the next page of a SmartSort placement.
998
+ */
999
+ interface SmartSortNextPageProps {
1000
+ pageSize: number;
1001
+ searchAttributes: string[];
1002
+ }
1003
+ /**
1004
+ * Properties to create a `SmartSortProduct` instance.
1005
+ */
1006
+ interface SmartSortProductProps<ProductShape extends object = Record<string, unknown>> extends SmartSortCachedProductProps {
1007
+ attributes: ProductShape;
1008
+ hasBeenImpressed?: boolean;
1009
+ }
1010
+ /**
1011
+ * Properties to recreate a `SmartSort` instance.
1012
+ * These properties should be passed **unmodified** to the constructor.
1013
+ */
1014
+ interface SmartSortProps<ProductShape extends object = Record<string, unknown>> {
1015
+ /**
1016
+ * Cached products for the placement. This field is used internally to
1017
+ * improve the performance of the placement.
1018
+ * @internal
1019
+ */
1020
+ cachedProducts: SmartSortCachedProductProps[];
1021
+ /**
1022
+ * Jane configuration object.
1023
+ * @internal
1024
+ */
1025
+ config: RequiredConfig;
1026
+ /**
1027
+ * The creative IDs associated with the placement
1028
+ */
1029
+ creativeIds?: number[];
1030
+ /**
1031
+ * The custom images for the placement. Always an array; empty when the
1032
+ * placement returns no custom images.
1033
+ */
1034
+ customImages?: CustomImageData[];
1035
+ /**
1036
+ * Parameters to request the next page of the placement.
1037
+ */
1038
+ nextPageProps: SmartSortNextPageProps;
1039
+ /**
1040
+ * URL where the next set of products can be fetched from.
1041
+ */
1042
+ nextPageUrl: string;
1043
+ /**
1044
+ * The placement type of the current instance.
1045
+ */
1046
+ placement?: Placement;
1047
+ /**
1048
+ * The products to display in the placement
1049
+ */
1050
+ products: SmartSortProductProps<ProductShape>[];
1051
+ /**
1052
+ * The row id of the placement.
1053
+ */
1054
+ rowId?: number | undefined;
1055
+ /**
1056
+ * A map of search facets for this placement.
1057
+ * @example
1058
+ * ```json
1059
+ * {
1060
+ * "category": {
1061
+ * "sativa": 20,
1062
+ * "indica": 10,
1063
+ * },
1064
+ * "kind": {
1065
+ * "flower": 31,
1066
+ * "vape": 5,
1067
+ * },
1068
+ * }
1069
+ * ```
1070
+ */
1071
+ searchFacets?: Record<string, Record<string, number>>;
1072
+ /**
1073
+ * The title of the placement
1074
+ */
1075
+ title?: string | undefined;
1076
+ /**
1077
+ * Total number of products available
1078
+ */
1079
+ totalProducts: number;
1080
+ }
1081
+
1082
+ export { priceEighthOunceDesc as $, AdMode as A, type JaneDMConfig as B, type Click as C, DEFAULT_PAGE_SIZE as D, type JaneDMIdentifiers as E, type FilterContext as F, JaneDeviceIdSentinel as G, type PaginationInfo as H, type Impression as I, type JaneDMPublicConfig as J, ProductKindEnum as K, type ProductReview as L, type ProductReviewsAggregate as M, ReviewSortEnum as N, type SearchSort as O, Placement as P, type SmartSortNextPageProps as Q, type RequiredConfig as R, SearchSortEnum as S, type VirtualBudtenderSearchResponse as T, bestSellerRank as U, type VirtualBudtenderQuery as V, categoryAndNameAsc as W, defaultOrder as X, priceAsc as Y, priceDesc as Z, priceEighthOunceAsc as _, PageContextEnum as a, priceGramAsc as a0, priceGramDesc as a1, priceHalfGramAsc as a2, priceHalfGramDesc as a3, priceHalfOunceAsc as a4, priceHalfOunceDesc as a5, priceOunceAsc as a6, priceOunceDesc as a7, priceQuarterOunceAsc as a8, priceQuarterOunceDesc as a9, priceTwoGramAsc as aa, priceTwoGramDesc as ab, rating as ac, recommendation as ad, searchSorts as ae, thcPotencyAsc as af, thcPotencyDesc as ag, type PlacementResponse as ah, type Product as ai, type ProductReviewsResponse$1 as aj, type ProductsPlacementResponse as ak, type PageResponse as al, type CustomImageData$1 as am, type CustomImageData as b, type SmartSortProductProps as c, type SmartSortClickIntent as d, type SmartSortProps as e, type ConversionExternalProduct as f, type SessionEvent as g, type JaneDMInternalConfig as h, type FetchCartTopperRowProps as i, type FetchCustomImageRowProps as j, type Facets as k, type FetchMenuRowProps as l, type FetchMenuTopRowProps as m, type FetchProductReviewsProps as n, type ProductReviewsResponse as o, type FetchRecommendedPDPRowProps as p, type FetchRecommendedRowProps as q, type FetchRecommendedSortProps as r, type IterateProductReviewsProps as s, type ProductReviewsIterable as t, AppMode as u, type FetchCartTopperRowByPosProductId as v, type FetchCartTopperRowByProductProps as w, type FetchRecommendedPDPRowByPosProductId as x, type FetchRecommendedPDPRowByProductId as y, IntendedDisplay as z };