@wix/auto_sdk_stores_read-only-variants-v-3 1.0.16 → 1.0.17
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/build/cjs/index.d.ts +35 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +22 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +187 -81
- package/build/cjs/meta.js.map +1 -1
- package/build/{internal/cjs/stores-catalog-v3-read-only-variant-read-only-variants-v-3.universal-DmrKxIKF.d.ts → cjs/stores-catalog-v3-read-only-variant-read-only-variants-v-3.universal-BvjIOy5Y.d.ts} +207 -103
- package/build/es/index.d.mts +35 -2
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +22 -2
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +187 -81
- package/build/es/meta.mjs.map +1 -1
- package/build/{internal/es/stores-catalog-v3-read-only-variant-read-only-variants-v-3.universal-DmrKxIKF.d.mts → es/stores-catalog-v3-read-only-variant-read-only-variants-v-3.universal-BvjIOy5Y.d.mts} +207 -103
- package/build/internal/cjs/index.d.ts +16 -16
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +11 -8
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +187 -81
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/{cjs/index-CFBlj8M-.d.ts → internal/cjs/stores-catalog-v3-read-only-variant-read-only-variants-v-3.universal-DwK-NZst.d.ts} +338 -92
- package/build/internal/es/index.d.mts +16 -16
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +11 -8
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +187 -81
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/{es/index-CFBlj8M-.d.mts → internal/es/stores-catalog-v3-read-only-variant-read-only-variants-v-3.universal-DwK-NZst.d.mts} +338 -92
- package/package.json +2 -2
package/build/cjs/meta.d.ts
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aJ as QueryVariantsRequest$1, aO as QueryVariantsResponse$1, aR as SearchVariantsRequest$1, a as SearchVariantsResponse$1 } from './stores-catalog-v3-read-only-variant-read-only-variants-v-3.universal-BvjIOy5Y.js';
|
|
2
2
|
import '@wix/sdk-types';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A read-only representation of a product variant with enhanced query capabilities.
|
|
6
|
+
*
|
|
7
|
+
* Product variants represent different options of a product, such as size, color, or material combinations.
|
|
8
|
+
* This read-only variant provides direct access to variant data without requiring nested product queries,
|
|
9
|
+
* making it ideal for inventory management, variant comparison, and e-commerce catalog displays.
|
|
10
|
+
*
|
|
11
|
+
* The variant includes both variant-specific information (like SKU, price, and option choices), as well as
|
|
12
|
+
* contextual product information (like product name, visibility, categories) for convenience.
|
|
13
|
+
*/
|
|
4
14
|
interface ReadOnlyVariant extends ReadOnlyVariantTypedPropertiesOneOf {
|
|
5
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Physical properties such as weight and dimensions.
|
|
17
|
+
*
|
|
18
|
+
* Required when the product type is `PHYSICAL`.
|
|
19
|
+
*/
|
|
6
20
|
physicalProperties?: V3VariantPhysicalProperties;
|
|
7
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Digital properties such as downloadable files.
|
|
23
|
+
*
|
|
24
|
+
* Required when the product type is `DIGITAL`.
|
|
25
|
+
*/
|
|
8
26
|
digitalProperties?: V3VariantDigitalProperties;
|
|
9
27
|
/**
|
|
10
28
|
* Variant ID.
|
|
@@ -20,91 +38,113 @@ interface ReadOnlyVariant extends ReadOnlyVariantTypedPropertiesOneOf {
|
|
|
20
38
|
*/
|
|
21
39
|
visible?: boolean | null;
|
|
22
40
|
/**
|
|
23
|
-
*
|
|
41
|
+
* Stock keeping unit (SKU) for inventory tracking and identification.
|
|
42
|
+
*
|
|
43
|
+
* The SKU is typically used for inventory management, order fulfillment, and product identification
|
|
44
|
+
* across different systems.
|
|
24
45
|
* @minLength 1
|
|
25
46
|
* @maxLength 40
|
|
26
47
|
* @readonly
|
|
27
48
|
*/
|
|
28
49
|
sku?: string | null;
|
|
29
50
|
/**
|
|
30
|
-
*
|
|
51
|
+
* Barcode for the variant, typically used for point-of-sale systems and inventory management.
|
|
52
|
+
*
|
|
53
|
+
* Common barcode formats include UPC, EAN, and Code 128. The barcode helps with
|
|
54
|
+
* quick product identification and checkout processes.
|
|
31
55
|
* @minLength 1
|
|
32
56
|
* @maxLength 40
|
|
33
57
|
* @readonly
|
|
34
58
|
*/
|
|
35
59
|
barcode?: string | null;
|
|
36
60
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
61
|
+
* Product option choices that define this variant.
|
|
62
|
+
*
|
|
63
|
+
* Each option choice represents a specific selection for a product option (like "Size: Large" or "Color: Red").
|
|
64
|
+
* An empty list indicates this is the default variant of a product with no managed options.
|
|
39
65
|
* @maxSize 6
|
|
40
66
|
* @readonly
|
|
41
67
|
*/
|
|
42
68
|
optionChoices?: V3OptionChoice[];
|
|
43
69
|
/**
|
|
44
|
-
*
|
|
70
|
+
* Pricing information for the variant.
|
|
45
71
|
* @readonly
|
|
46
72
|
*/
|
|
47
73
|
price?: V3PriceInfo;
|
|
48
74
|
/**
|
|
49
|
-
*
|
|
75
|
+
* Revenue and cost details for business analytics.
|
|
50
76
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* > + Your app has the required `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope.
|
|
77
|
+
* Includes cost, profit, and profit margin calculations.
|
|
78
|
+
* Returned only when you pass `"MERCHANT_DATA"` to the `fields` parameter.
|
|
54
79
|
* @readonly
|
|
55
80
|
*/
|
|
56
81
|
revenueDetails?: V3RevenueDetails;
|
|
57
82
|
/**
|
|
58
|
-
*
|
|
83
|
+
* Media associated with the variant.
|
|
84
|
+
*
|
|
85
|
+
* Typically includes images, videos, or other media files specific to this variant.
|
|
59
86
|
* @readonly
|
|
60
87
|
*/
|
|
61
88
|
media?: V3ProductMedia;
|
|
62
89
|
/**
|
|
63
|
-
* Subscription
|
|
64
|
-
*
|
|
90
|
+
* Subscription pricing information when the variant is part of subscription plans.
|
|
91
|
+
*
|
|
92
|
+
* Shows calculated prices after applying subscription discounts to the variant's price.
|
|
93
|
+
* Returned only when you pass `"SUBSCRIPTION_PRICES_INFO"` to the `fields` parameter.
|
|
65
94
|
* @readonly
|
|
66
95
|
*/
|
|
67
96
|
subscriptionPricesInfo?: V3SubscriptionPricesInfo;
|
|
68
97
|
/**
|
|
69
|
-
*
|
|
98
|
+
* Current inventory and availability status.
|
|
70
99
|
* @readonly
|
|
71
100
|
*/
|
|
72
101
|
inventoryStatus?: V3InventoryStatus;
|
|
73
102
|
/**
|
|
74
|
-
* Product
|
|
103
|
+
* Product information for context and convenience.
|
|
104
|
+
*
|
|
105
|
+
* Includes essential product details like name, visibility, and categories to avoid
|
|
106
|
+
* requiring separate product API calls when working with variants.
|
|
75
107
|
* @readonly
|
|
76
108
|
*/
|
|
77
109
|
productData?: ProductFields;
|
|
78
110
|
}
|
|
79
111
|
/** @oneof */
|
|
80
112
|
interface ReadOnlyVariantTypedPropertiesOneOf {
|
|
81
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Physical properties such as weight and dimensions.
|
|
115
|
+
*
|
|
116
|
+
* Required when the product type is `PHYSICAL`.
|
|
117
|
+
*/
|
|
82
118
|
physicalProperties?: V3VariantPhysicalProperties;
|
|
83
|
-
/**
|
|
119
|
+
/**
|
|
120
|
+
* Digital properties such as downloadable files.
|
|
121
|
+
*
|
|
122
|
+
* Required when the product type is `DIGITAL`.
|
|
123
|
+
*/
|
|
84
124
|
digitalProperties?: V3VariantDigitalProperties;
|
|
85
125
|
}
|
|
86
126
|
interface V3OptionChoice {
|
|
87
127
|
/**
|
|
88
|
-
* Option and choice
|
|
128
|
+
* Option and choice identifiers.
|
|
89
129
|
* @readonly
|
|
90
130
|
*/
|
|
91
131
|
optionChoiceIds?: V3OptionChoiceIds;
|
|
92
132
|
/**
|
|
93
|
-
*
|
|
133
|
+
* Human-readable option and choice names.
|
|
94
134
|
* @readonly
|
|
95
135
|
*/
|
|
96
136
|
optionChoiceNames?: V3OptionChoiceNames;
|
|
97
137
|
}
|
|
98
138
|
interface V3OptionChoiceIds {
|
|
99
139
|
/**
|
|
100
|
-
*
|
|
140
|
+
* Product option ID.
|
|
101
141
|
* @minLength 1
|
|
102
142
|
* @maxLength 36
|
|
103
143
|
* @readonly
|
|
104
144
|
*/
|
|
105
145
|
optionId?: string;
|
|
106
146
|
/**
|
|
107
|
-
*
|
|
147
|
+
* Specific choice ID within the option.
|
|
108
148
|
* @format GUID
|
|
109
149
|
* @readonly
|
|
110
150
|
*/
|
|
@@ -112,21 +152,28 @@ interface V3OptionChoiceIds {
|
|
|
112
152
|
}
|
|
113
153
|
interface V3OptionChoiceNames {
|
|
114
154
|
/**
|
|
115
|
-
*
|
|
155
|
+
* Display name of the product option.
|
|
156
|
+
*
|
|
157
|
+
* For example, "Size", "Color", or "Material".
|
|
116
158
|
* @minLength 1
|
|
117
159
|
* @maxLength 50
|
|
118
160
|
* @readonly
|
|
119
161
|
*/
|
|
120
162
|
optionName?: string;
|
|
121
163
|
/**
|
|
122
|
-
*
|
|
164
|
+
* Display name of the chosen option value.
|
|
165
|
+
*
|
|
166
|
+
* For example, "Large", "Red", or "Cotton".
|
|
123
167
|
* @minLength 1
|
|
124
168
|
* @maxLength 50
|
|
125
169
|
* @readonly
|
|
126
170
|
*/
|
|
127
171
|
choiceName?: string;
|
|
128
172
|
/**
|
|
129
|
-
*
|
|
173
|
+
* Visual representation style for the option choice.
|
|
174
|
+
*
|
|
175
|
+
* Determines how the option is displayed in the product selector UI.
|
|
176
|
+
* Common values include "TEXT_CHOICES", "COLOR_CHOICES", or "IMAGE_CHOICES".
|
|
130
177
|
* @readonly
|
|
131
178
|
* @maxLength 50
|
|
132
179
|
*/
|
|
@@ -134,12 +181,15 @@ interface V3OptionChoiceNames {
|
|
|
134
181
|
}
|
|
135
182
|
interface V3PriceInfo {
|
|
136
183
|
/**
|
|
137
|
-
*
|
|
184
|
+
* Current selling price of the variant.
|
|
138
185
|
* @readonly
|
|
139
186
|
*/
|
|
140
187
|
actualPrice?: V3FixedMonetaryAmount;
|
|
141
188
|
/**
|
|
142
|
-
*
|
|
189
|
+
* Original price before any discounts.
|
|
190
|
+
*
|
|
191
|
+
* Used to show customers the savings when the variant is on sale.
|
|
192
|
+
* If not set, no original price is displayed.
|
|
143
193
|
* @readonly
|
|
144
194
|
*/
|
|
145
195
|
compareAtPrice?: V3FixedMonetaryAmount;
|
|
@@ -160,18 +210,22 @@ interface V3FixedMonetaryAmount {
|
|
|
160
210
|
}
|
|
161
211
|
interface V3RevenueDetails {
|
|
162
212
|
/**
|
|
163
|
-
*
|
|
213
|
+
* Cost of the variant for profit calculations.
|
|
214
|
+
*
|
|
215
|
+
* The amount you pay to produce or acquire this variant.
|
|
164
216
|
* @readonly
|
|
165
217
|
*/
|
|
166
218
|
cost?: V3FixedMonetaryAmount;
|
|
167
219
|
/**
|
|
168
|
-
* Profit
|
|
220
|
+
* Profit amount calculated by subtracting cost from the discounted price.
|
|
169
221
|
* @readonly
|
|
170
222
|
*/
|
|
171
223
|
profit?: V3FixedMonetaryAmount;
|
|
172
224
|
/**
|
|
173
|
-
* Profit
|
|
174
|
-
*
|
|
225
|
+
* Profit margin as a percentage of the selling price.
|
|
226
|
+
*
|
|
227
|
+
* Calculated by dividing profit by the discounted price. The result is rounded to 4 decimal places.
|
|
228
|
+
* A value of 0.25 represents a 25% profit margin.
|
|
175
229
|
* @readonly
|
|
176
230
|
* @max 1
|
|
177
231
|
*/
|
|
@@ -340,7 +394,7 @@ declare enum ProductMediaMediaType {
|
|
|
340
394
|
type ProductMediaMediaTypeWithLiterals = ProductMediaMediaType | 'UNKNOWN_MEDIA_TYPE' | 'IMAGE' | 'VIDEO';
|
|
341
395
|
interface V3Thumbnail {
|
|
342
396
|
/**
|
|
343
|
-
* Thumbnail
|
|
397
|
+
* Thumbnail URL.
|
|
344
398
|
* @format WEB_URL
|
|
345
399
|
* @readonly
|
|
346
400
|
*/
|
|
@@ -365,35 +419,45 @@ interface V3Thumbnail {
|
|
|
365
419
|
}
|
|
366
420
|
interface V3VariantPhysicalProperties {
|
|
367
421
|
/**
|
|
368
|
-
*
|
|
422
|
+
* Weight of the variant for shipping calculations.
|
|
423
|
+
*
|
|
424
|
+
* Used for shipping cost calculations and fulfillment planning.
|
|
425
|
+
* Returned only when you pass `"WEIGHT_MEASUREMENT_UNIT_INFO"` to the `fields` parameter.
|
|
369
426
|
* @max 999999999.99
|
|
370
427
|
* @readonly
|
|
371
428
|
*/
|
|
372
429
|
weight?: number | null;
|
|
373
430
|
/**
|
|
374
|
-
* Price per unit
|
|
375
|
-
*
|
|
376
|
-
*
|
|
431
|
+
* Price per unit measurement information.
|
|
432
|
+
*
|
|
433
|
+
* Allows customers to compare prices based on a standard unit (like price per kilogram or per liter).
|
|
434
|
+
* Useful for bulk products or items sold by weight or volume.
|
|
377
435
|
* @readonly
|
|
378
436
|
*/
|
|
379
437
|
pricePerUnit?: V3PricePerUnit;
|
|
380
438
|
}
|
|
381
439
|
interface V3PricePerUnit {
|
|
382
440
|
/**
|
|
383
|
-
* Price per unit
|
|
384
|
-
*
|
|
441
|
+
* Price per unit measurement settings.
|
|
442
|
+
*
|
|
443
|
+
* Defines the unit of measurement for price comparison (e.g., per kilogram, per liter).
|
|
444
|
+
* The measurement unit must correspond to the unit set on the parent product.
|
|
385
445
|
* @readonly
|
|
386
446
|
*/
|
|
387
447
|
settings?: V3PricePerUnitSettings;
|
|
388
448
|
/**
|
|
389
|
-
* Calculated
|
|
390
|
-
*
|
|
449
|
+
* Calculated price per unit value.
|
|
450
|
+
*
|
|
451
|
+
* Shows the variant's price normalized to the standard unit of measurement.
|
|
452
|
+
* For example, if a 500g variant costs $2 and the standard unit is 1kg, this value would be $4.
|
|
391
453
|
* @readonly
|
|
392
454
|
* @decimalValue options { gte:0, lte:999999999, maxScale:3 }
|
|
393
455
|
*/
|
|
394
456
|
value?: string;
|
|
395
457
|
/**
|
|
396
|
-
*
|
|
458
|
+
* Human-readable description of the price per unit.
|
|
459
|
+
*
|
|
460
|
+
* For example, "per kg" or "per liter".
|
|
397
461
|
* @readonly
|
|
398
462
|
* @maxLength 100
|
|
399
463
|
*/
|
|
@@ -443,7 +507,9 @@ declare enum MeasurementUnit {
|
|
|
443
507
|
type MeasurementUnitWithLiterals = MeasurementUnit | 'UNSPECIFIED' | 'ML' | 'CL' | 'L' | 'CBM' | 'MG' | 'G' | 'KG' | 'MM' | 'CM' | 'M' | 'SQM' | 'OZ' | 'LB' | 'FLOZ' | 'PT' | 'QT' | 'GAL' | 'IN' | 'FT' | 'YD' | 'SQFT';
|
|
444
508
|
interface V3VariantDigitalProperties {
|
|
445
509
|
/**
|
|
446
|
-
* Digital file
|
|
510
|
+
* Digital file available for download after purchase.
|
|
511
|
+
*
|
|
512
|
+
* The file that customers receive when they purchase this digital variant.
|
|
447
513
|
* @readonly
|
|
448
514
|
*/
|
|
449
515
|
digitalFile?: V3SecuredMedia;
|
|
@@ -496,7 +562,9 @@ declare enum SecuredMediaFileType {
|
|
|
496
562
|
type SecuredMediaFileTypeWithLiterals = SecuredMediaFileType | 'UNSPECIFIED' | 'SECURE_PICTURE' | 'SECURE_VIDEO' | 'SECURE_DOCUMENT' | 'SECURE_MUSIC' | 'SECURE_ARCHIVE';
|
|
497
563
|
interface V3SubscriptionPricesInfo {
|
|
498
564
|
/**
|
|
499
|
-
*
|
|
565
|
+
* Pricing for different subscription plans.
|
|
566
|
+
*
|
|
567
|
+
* Shows how the variant's price changes with different subscription intervals or discounts.
|
|
500
568
|
* @maxSize 6
|
|
501
569
|
* @readonly
|
|
502
570
|
*/
|
|
@@ -504,31 +572,33 @@ interface V3SubscriptionPricesInfo {
|
|
|
504
572
|
}
|
|
505
573
|
interface V3SubscriptionPrice {
|
|
506
574
|
/**
|
|
507
|
-
* Subscription ID.
|
|
575
|
+
* Subscription plan ID.
|
|
508
576
|
* @format GUID
|
|
509
577
|
* @readonly
|
|
510
578
|
*/
|
|
511
579
|
subscriptionId?: string;
|
|
512
580
|
/**
|
|
513
|
-
*
|
|
581
|
+
* Variant price with subscription discount applied.
|
|
514
582
|
* @readonly
|
|
515
583
|
*/
|
|
516
584
|
price?: V3FixedMonetaryAmount;
|
|
517
585
|
/**
|
|
518
|
-
* Price per unit
|
|
586
|
+
* Price per unit for subscription pricing.
|
|
519
587
|
* @readonly
|
|
520
588
|
*/
|
|
521
589
|
pricePerUnit?: V3SubscriptionPricePerUnit;
|
|
522
590
|
}
|
|
523
591
|
interface V3SubscriptionPricePerUnit {
|
|
524
592
|
/**
|
|
525
|
-
* Calculated
|
|
593
|
+
* Calculated price per unit for the subscription.
|
|
594
|
+
*
|
|
595
|
+
* Takes into account the subscription discount and the variant's price per unit settings.
|
|
526
596
|
* @readonly
|
|
527
597
|
* @decimalValue options { gte:0, lte:999999999, maxScale:3 }
|
|
528
598
|
*/
|
|
529
599
|
value?: string;
|
|
530
600
|
/**
|
|
531
|
-
*
|
|
601
|
+
* Description of the subscription price per unit.
|
|
532
602
|
* @readonly
|
|
533
603
|
* @maxLength 20
|
|
534
604
|
*/
|
|
@@ -536,80 +606,87 @@ interface V3SubscriptionPricePerUnit {
|
|
|
536
606
|
}
|
|
537
607
|
interface V3InventoryStatus {
|
|
538
608
|
/**
|
|
539
|
-
* Whether the variant is in stock.
|
|
609
|
+
* Whether the variant is currently in stock and available for purchase.
|
|
540
610
|
* @readonly
|
|
541
611
|
*/
|
|
542
612
|
inStock?: boolean;
|
|
543
613
|
/**
|
|
544
|
-
* Whether
|
|
614
|
+
* Whether customers can place preorders for this variant when it's out of stock.
|
|
545
615
|
* @readonly
|
|
546
616
|
*/
|
|
547
617
|
preorderEnabled?: boolean;
|
|
548
618
|
}
|
|
549
619
|
interface ProductFields extends ProductFieldsTypedPropertiesOneOf {
|
|
550
620
|
/**
|
|
551
|
-
* Physical properties.
|
|
621
|
+
* Physical product properties such as weight and dimensions.
|
|
552
622
|
*
|
|
553
|
-
* Required when `productType
|
|
623
|
+
* Required when `productType` is `PHYSICAL`.
|
|
554
624
|
*/
|
|
555
625
|
physicalProperties?: V3PhysicalProperties;
|
|
556
626
|
/**
|
|
557
|
-
*
|
|
627
|
+
* Product ID.
|
|
558
628
|
* @minLength 1
|
|
559
629
|
* @maxLength 36
|
|
560
630
|
* @readonly
|
|
561
631
|
*/
|
|
562
632
|
productId?: string;
|
|
563
633
|
/**
|
|
564
|
-
* Product name.
|
|
634
|
+
* Product name displayed to customers.
|
|
565
635
|
* @minLength 1
|
|
566
636
|
* @maxLength 80
|
|
567
637
|
* @readonly
|
|
568
638
|
*/
|
|
569
639
|
name?: string | null;
|
|
570
640
|
/**
|
|
571
|
-
* product
|
|
641
|
+
* Type of product determining available properties and behavior.
|
|
572
642
|
* @readonly
|
|
573
643
|
*/
|
|
574
644
|
productType?: V3ProductTypeWithLiterals;
|
|
575
645
|
/**
|
|
576
|
-
*
|
|
646
|
+
* URL-friendly identifier for the product.
|
|
647
|
+
*
|
|
648
|
+
* Used in product page URLs and for SEO optimization.
|
|
577
649
|
* @format URL_SLUG
|
|
578
650
|
* @readonly
|
|
579
651
|
*/
|
|
580
652
|
slug?: string | null;
|
|
581
653
|
/**
|
|
582
|
-
* Whether the product is visible to site visitors
|
|
654
|
+
* Whether the product is visible to site visitors.
|
|
583
655
|
*
|
|
584
656
|
* Default: `true`
|
|
585
657
|
* @readonly
|
|
586
658
|
*/
|
|
587
659
|
visible?: boolean | null;
|
|
588
660
|
/**
|
|
589
|
-
* Whether the product
|
|
661
|
+
* Whether the product appears in point-of-sale systems.
|
|
590
662
|
*
|
|
591
663
|
* Default: `true`
|
|
592
|
-
*
|
|
664
|
+
* Always `false` for digital products.
|
|
593
665
|
* @readonly
|
|
594
666
|
*/
|
|
595
667
|
visibleInPos?: boolean | null;
|
|
596
668
|
/**
|
|
597
|
-
*
|
|
669
|
+
* Primary category assignment for the product.
|
|
670
|
+
*
|
|
671
|
+
* Determines the main category used for navigation and organization.
|
|
598
672
|
* @format GUID
|
|
599
673
|
* @readonly
|
|
600
674
|
*/
|
|
601
675
|
mainCategoryId?: string | null;
|
|
602
676
|
/**
|
|
603
|
-
* Currency used for
|
|
677
|
+
* Currency used for pricing this product.
|
|
604
678
|
*
|
|
605
|
-
*
|
|
606
|
-
*
|
|
679
|
+
* Three-letter currency code in ISO-4217 alphabetic format.
|
|
680
|
+
* Defaults to the site's currency setting unless specified in request headers.
|
|
681
|
+
* Returned only when you pass `"CURRENCY"` to the `fields` parameter.
|
|
607
682
|
* @format CURRENCY
|
|
608
683
|
* @readonly
|
|
609
684
|
*/
|
|
610
685
|
currency?: string | null;
|
|
611
686
|
/**
|
|
612
|
-
*
|
|
687
|
+
* Revision number, which increments by 1 each time the product is updated.
|
|
688
|
+
* To prevent conflicting changes,
|
|
689
|
+
* the current revision must be passed when updating the product.
|
|
613
690
|
* @readonly
|
|
614
691
|
*/
|
|
615
692
|
revision?: string | null;
|
|
@@ -617,9 +694,9 @@ interface ProductFields extends ProductFieldsTypedPropertiesOneOf {
|
|
|
617
694
|
/** @oneof */
|
|
618
695
|
interface ProductFieldsTypedPropertiesOneOf {
|
|
619
696
|
/**
|
|
620
|
-
* Physical properties.
|
|
697
|
+
* Physical product properties such as weight and dimensions.
|
|
621
698
|
*
|
|
622
|
-
* Required when `productType
|
|
699
|
+
* Required when `productType` is `PHYSICAL`.
|
|
623
700
|
*/
|
|
624
701
|
physicalProperties?: V3PhysicalProperties;
|
|
625
702
|
}
|
|
@@ -635,15 +712,19 @@ declare enum V3ProductType {
|
|
|
635
712
|
type V3ProductTypeWithLiterals = V3ProductType | 'UNKNOWN_PRODUCT_TYPE' | 'PHYSICAL' | 'DIGITAL';
|
|
636
713
|
interface V3PhysicalProperties {
|
|
637
714
|
/**
|
|
638
|
-
* Weight measurement unit.
|
|
639
|
-
*
|
|
715
|
+
* Weight measurement unit information for the product.
|
|
716
|
+
*
|
|
717
|
+
* Defines the unit of measurement (kg, lb, etc.) used for product weight calculations.
|
|
718
|
+
* Returned only when you pass `"WEIGHT_MEASUREMENT_UNIT_INFO"` to the `fields` parameter.
|
|
640
719
|
* @readonly
|
|
641
720
|
*/
|
|
642
721
|
weightMeasurementUnitInfo?: V3WeightMeasurementUnitInfo;
|
|
643
722
|
}
|
|
644
723
|
interface V3WeightMeasurementUnitInfo {
|
|
645
724
|
/**
|
|
646
|
-
*
|
|
725
|
+
* Unit of measurement for weight.
|
|
726
|
+
*
|
|
727
|
+
* Standard units include kilograms (KG), pounds (LB), ounces (OZ), and grams (G).
|
|
647
728
|
* @readonly
|
|
648
729
|
*/
|
|
649
730
|
weightMeasurementUnit?: WeightUnitWithLiterals;
|
|
@@ -659,10 +740,11 @@ declare enum WeightUnit {
|
|
|
659
740
|
/** @enumType */
|
|
660
741
|
type WeightUnitWithLiterals = WeightUnit | 'UNSPECIFIED_WEIGHT_UNIT' | 'KG' | 'LB';
|
|
661
742
|
interface QueryVariantsRequest {
|
|
662
|
-
/** WQL expression. */
|
|
743
|
+
/** WQL expression for filtering variants. */
|
|
663
744
|
query?: CursorQuery;
|
|
664
745
|
/**
|
|
665
|
-
*
|
|
746
|
+
* List of additional fields to include in the response.
|
|
747
|
+
* See VariantOps.RequestedFields for available options.
|
|
666
748
|
* @maxSize 100
|
|
667
749
|
*/
|
|
668
750
|
fields?: RequestedFieldsWithLiterals[];
|
|
@@ -722,20 +804,43 @@ interface CursorPaging {
|
|
|
722
804
|
cursor?: string | null;
|
|
723
805
|
}
|
|
724
806
|
declare enum RequestedFields {
|
|
725
|
-
/**
|
|
807
|
+
/** Unknown requested field. */
|
|
726
808
|
UNKNOWN_REQUESTED_FIELD = "UNKNOWN_REQUESTED_FIELD",
|
|
809
|
+
/**
|
|
810
|
+
* Include currency information in product data.
|
|
811
|
+
*
|
|
812
|
+
* Returns the currency code (ISO-4217 format) used for pricing this variant.
|
|
813
|
+
* Defaults to the site's currency unless specified in request headers.
|
|
814
|
+
*/
|
|
727
815
|
CURRENCY = "CURRENCY",
|
|
728
|
-
/**
|
|
816
|
+
/**
|
|
817
|
+
* Include merchant-specific data such as cost and profit information.
|
|
818
|
+
*
|
|
819
|
+
* Returns revenue details including cost, profit, and profit margin.
|
|
820
|
+
* Requires `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope.
|
|
821
|
+
*/
|
|
729
822
|
MERCHANT_DATA = "MERCHANT_DATA",
|
|
823
|
+
/**
|
|
824
|
+
* Include subscription pricing information.
|
|
825
|
+
*
|
|
826
|
+
* Returns calculated prices for different subscription plans with applied discounts.
|
|
827
|
+
* Only relevant for variants that are part of subscription offerings.
|
|
828
|
+
*/
|
|
730
829
|
SUBSCRIPTION_PRICES_INFO = "SUBSCRIPTION_PRICES_INFO",
|
|
830
|
+
/**
|
|
831
|
+
* Include weight measurement unit information.
|
|
832
|
+
*
|
|
833
|
+
* Returns the weight measurement unit (kg, lb, etc.) used for the variant.
|
|
834
|
+
* Useful for shipping calculations and product comparisons.
|
|
835
|
+
*/
|
|
731
836
|
WEIGHT_MEASUREMENT_UNIT_INFO = "WEIGHT_MEASUREMENT_UNIT_INFO"
|
|
732
837
|
}
|
|
733
838
|
/** @enumType */
|
|
734
839
|
type RequestedFieldsWithLiterals = RequestedFields | 'UNKNOWN_REQUESTED_FIELD' | 'CURRENCY' | 'MERCHANT_DATA' | 'SUBSCRIPTION_PRICES_INFO' | 'WEIGHT_MEASUREMENT_UNIT_INFO';
|
|
735
840
|
interface QueryVariantsResponse {
|
|
736
|
-
/**
|
|
841
|
+
/** Variants matching the query criteria. */
|
|
737
842
|
variants?: ReadOnlyVariant[];
|
|
738
|
-
/**
|
|
843
|
+
/** Pagination information with cursors for next pages. */
|
|
739
844
|
pagingMetadata?: CursorPagingMetadata;
|
|
740
845
|
}
|
|
741
846
|
interface CursorPagingMetadata {
|
|
@@ -764,10 +869,11 @@ interface Cursors {
|
|
|
764
869
|
prev?: string | null;
|
|
765
870
|
}
|
|
766
871
|
interface SearchVariantsRequest {
|
|
767
|
-
/** WQL expression */
|
|
872
|
+
/** WQL expression for searching variants. */
|
|
768
873
|
search?: CursorSearch;
|
|
769
874
|
/**
|
|
770
|
-
*
|
|
875
|
+
* List of additional fields to include in the response.
|
|
876
|
+
* See VariantOps.RequestedFields for available options.
|
|
771
877
|
* @maxSize 100
|
|
772
878
|
*/
|
|
773
879
|
fields?: RequestedFieldsWithLiterals[];
|
|
@@ -1044,11 +1150,11 @@ declare enum Mode {
|
|
|
1044
1150
|
/** @enumType */
|
|
1045
1151
|
type ModeWithLiterals = Mode | 'OR' | 'AND';
|
|
1046
1152
|
interface SearchVariantsResponse {
|
|
1047
|
-
/** Variants
|
|
1153
|
+
/** Variants matching the search criteria. */
|
|
1048
1154
|
variants?: ReadOnlyVariant[];
|
|
1049
|
-
/**
|
|
1155
|
+
/** Pagination information with cursors for next pages. */
|
|
1050
1156
|
pagingMetadata?: CursorPagingMetadata;
|
|
1051
|
-
/** Aggregation
|
|
1157
|
+
/** Aggregation results for faceted search. */
|
|
1052
1158
|
aggregationData?: AggregationData;
|
|
1053
1159
|
}
|
|
1054
1160
|
interface AggregationData {
|
package/build/cjs/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../meta.ts","../../src/stores-catalog-v3-read-only-variant-read-only-variants-v-3.http.ts","../../src/stores-catalog-v3-read-only-variant-read-only-variants-v-3.meta.ts"],"sourcesContent":["export * from './src/stores-catalog-v3-read-only-variant-read-only-variants-v-3.meta.js';\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixStoresCatalogProductVariantsReaderApiV3ProductVariantsReaderUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/product-variants-reader',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/stores/v3/products/query-variants',\n destPath: '/v3/products/query-variants',\n },\n {\n srcPath: '/stores/v3/products/search-variants',\n destPath: '/v3/products/search-variants',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_stores_read-only-variants-v-3';\n\n/**\n * Retrieves a list of ReadOnlyVariants, given the provided [paging, filtering, and sorting][1].\n * Up to 1,000 ReadOnlyVariants can be returned per request.\n * To learn how to query ReadOnlyVariants, see [API Query Language][2].\n * [1]: https://dev.wix.com/api/rest/getting-started/sorting-and-paging\n * [2]: https://dev.wix.com/api/rest/getting-started/api-query-language\n */\nexport function queryVariants(payload: object): RequestOptionsFactory<any> {\n function __queryVariants({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v3.read_only_variant',\n method: 'POST' as any,\n methodFqn:\n 'com.wix.stores.catalog.product.variants.reader.api.v3.ProductVariantsReader.QueryVariants',\n packageName: PACKAGE_NAME,\n url: resolveComWixStoresCatalogProductVariantsReaderApiV3ProductVariantsReaderUrl(\n { protoPath: '/v3/products/query-variants', data: payload, host }\n ),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'variants.physicalProperties.weight' },\n {\n path: 'variants.physicalProperties.pricePerUnit.settings.quantity',\n },\n { path: 'variants.revenueDetails.profitMargin' },\n ],\n },\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'variants.media.image.urlExpirationDate' },\n { path: 'variants.media.video.urlExpirationDate' },\n { path: 'variants.media.video.resolutions.urlExpirationDate' },\n {\n path: 'variants.media.video.resolutions.poster.urlExpirationDate',\n },\n { path: 'variants.media.video.posters.urlExpirationDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryVariants;\n}\n\n/**\n * Search Variants using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)\n * >**Notes:**\n * + If you don't have permissions to read non visible products then variants related to non-visible products will be filtered out from response.\n * In such case non visible variants also will be filtered out.\n */\nexport function searchVariants(payload: object): RequestOptionsFactory<any> {\n function __searchVariants({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'search.aggregations.range.buckets.from' },\n { path: 'search.aggregations.range.buckets.to' },\n {\n path: 'search.aggregations.nested.nestedAggregations.range.buckets.from',\n },\n {\n path: 'search.aggregations.nested.nestedAggregations.range.buckets.to',\n },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v3.read_only_variant',\n method: 'POST' as any,\n methodFqn:\n 'com.wix.stores.catalog.product.variants.reader.api.v3.ProductVariantsReader.SearchVariants',\n packageName: PACKAGE_NAME,\n url: resolveComWixStoresCatalogProductVariantsReaderApiV3ProductVariantsReaderUrl(\n {\n protoPath: '/v3/products/search-variants',\n data: serializedData,\n host,\n }\n ),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'variants.physicalProperties.weight' },\n { path: 'aggregationData.results.ranges.results.from' },\n { path: 'aggregationData.results.ranges.results.to' },\n {\n path: 'aggregationData.results.groupedByValue.results.nestedResults.ranges.results.from',\n },\n {\n path: 'aggregationData.results.groupedByValue.results.nestedResults.ranges.results.to',\n },\n {\n path: 'aggregationData.results.nested.results.results.*.range.from',\n },\n {\n path: 'aggregationData.results.nested.results.results.*.range.to',\n },\n {\n path: 'variants.physicalProperties.pricePerUnit.settings.quantity',\n },\n { path: 'variants.revenueDetails.profitMargin' },\n { path: 'aggregationData.results.scalar.value' },\n {\n path: 'aggregationData.results.groupedByValue.results.nestedResults.scalar.value',\n },\n {\n path: 'aggregationData.results.nested.results.results.*.scalar.value',\n },\n ],\n },\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'variants.media.image.urlExpirationDate' },\n { path: 'variants.media.video.urlExpirationDate' },\n { path: 'variants.media.video.resolutions.urlExpirationDate' },\n {\n path: 'variants.media.video.resolutions.poster.urlExpirationDate',\n },\n { path: 'variants.media.video.posters.urlExpirationDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __searchVariants;\n}\n","import * as ambassadorWixStoresCatalogV3ReadOnlyVariant from './stores-catalog-v3-read-only-variant-read-only-variants-v-3.http.js';\nimport * as ambassadorWixStoresCatalogV3ReadOnlyVariantTypes from './stores-catalog-v3-read-only-variant-read-only-variants-v-3.types.js';\nimport * as ambassadorWixStoresCatalogV3ReadOnlyVariantUniversalTypes from './stores-catalog-v3-read-only-variant-read-only-variants-v-3.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function queryVariants(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixStoresCatalogV3ReadOnlyVariantUniversalTypes.QueryVariantsRequest,\n ambassadorWixStoresCatalogV3ReadOnlyVariantTypes.QueryVariantsRequest,\n ambassadorWixStoresCatalogV3ReadOnlyVariantUniversalTypes.QueryVariantsResponse,\n ambassadorWixStoresCatalogV3ReadOnlyVariantTypes.QueryVariantsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixStoresCatalogV3ReadOnlyVariant.queryVariants(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v3/products/query-variants',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function searchVariants(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixStoresCatalogV3ReadOnlyVariantUniversalTypes.SearchVariantsRequest,\n ambassadorWixStoresCatalogV3ReadOnlyVariantTypes.SearchVariantsRequest,\n ambassadorWixStoresCatalogV3ReadOnlyVariantUniversalTypes.SearchVariantsResponse,\n ambassadorWixStoresCatalogV3ReadOnlyVariantTypes.SearchVariantsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixStoresCatalogV3ReadOnlyVariant.searchVariants(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v3/products/search-variants',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA,sBAAAC;AAAA;AAAA;;;ACAA,mBAA6C;AAC7C,IAAAC,gBAA6C;AAC7C,uBAAqD;AACrD,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,6EACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AA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AAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,kBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACwC,eAAe,OAAO;AAEpE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["queryVariants","searchVariants","import_float","payload","queryVariants","searchVariants"]}
|
|
1
|
+
{"version":3,"sources":["../../meta.ts","../../src/stores-catalog-v3-read-only-variant-read-only-variants-v-3.http.ts","../../src/stores-catalog-v3-read-only-variant-read-only-variants-v-3.meta.ts"],"sourcesContent":["export * from './src/stores-catalog-v3-read-only-variant-read-only-variants-v-3.meta.js';\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixStoresCatalogProductVariantsReaderApiV3ProductVariantsReaderUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/product-variants-reader',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/stores/v3/products/query-variants',\n destPath: '/v3/products/query-variants',\n },\n {\n srcPath: '/stores/v3/products/search-variants',\n destPath: '/v3/products/search-variants',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_stores_read-only-variants-v-3';\n\n/**\n * Retrieve product variants using structured queries with cursor-based pagination.\n *\n * Use this endpoint for simple filtering operations on `id` and `productId`.\n * For complex queries with free-text search and aggregations, use Search Variants instead.\n *\n * Up to 1,000 variants can be returned per request.\n */\nexport function queryVariants(payload: object): RequestOptionsFactory<any> {\n function __queryVariants({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v3.read_only_variant',\n method: 'POST' as any,\n methodFqn:\n 'com.wix.stores.catalog.product.variants.reader.api.v3.ProductVariantsReader.QueryVariants',\n packageName: PACKAGE_NAME,\n url: resolveComWixStoresCatalogProductVariantsReaderApiV3ProductVariantsReaderUrl(\n { protoPath: '/v3/products/query-variants', data: payload, host }\n ),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'variants.physicalProperties.weight' },\n {\n path: 'variants.physicalProperties.pricePerUnit.settings.quantity',\n },\n { path: 'variants.revenueDetails.profitMargin' },\n ],\n },\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'variants.media.image.urlExpirationDate' },\n { path: 'variants.media.video.urlExpirationDate' },\n { path: 'variants.media.video.resolutions.urlExpirationDate' },\n {\n path: 'variants.media.video.resolutions.poster.urlExpirationDate',\n },\n { path: 'variants.media.video.posters.urlExpirationDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryVariants;\n}\n\n/**\n * Search product variants using free-text search with advanced query capabilities.\n *\n * Use this endpoint for complex queries that include free-text search, aggregations,\n * or when you need faceted search results. For simple filtering, use Query Variants instead.\n *\n * Supports Wix Query Language (WQL) for structured filtering combined with free-text search.\n * > **Note:** Non-visible variants, and variants related to non-visible products are filtered from results if you don't have permissions to read hidden products.\n */\nexport function searchVariants(payload: object): RequestOptionsFactory<any> {\n function __searchVariants({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'search.aggregations.range.buckets.from' },\n { path: 'search.aggregations.range.buckets.to' },\n {\n path: 'search.aggregations.nested.nestedAggregations.range.buckets.from',\n },\n {\n path: 'search.aggregations.nested.nestedAggregations.range.buckets.to',\n },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v3.read_only_variant',\n method: 'POST' as any,\n methodFqn:\n 'com.wix.stores.catalog.product.variants.reader.api.v3.ProductVariantsReader.SearchVariants',\n packageName: PACKAGE_NAME,\n url: resolveComWixStoresCatalogProductVariantsReaderApiV3ProductVariantsReaderUrl(\n {\n protoPath: '/v3/products/search-variants',\n data: serializedData,\n host,\n }\n ),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'variants.physicalProperties.weight' },\n { path: 'aggregationData.results.ranges.results.from' },\n { path: 'aggregationData.results.ranges.results.to' },\n {\n path: 'aggregationData.results.groupedByValue.results.nestedResults.ranges.results.from',\n },\n {\n path: 'aggregationData.results.groupedByValue.results.nestedResults.ranges.results.to',\n },\n {\n path: 'aggregationData.results.nested.results.results.*.range.from',\n },\n {\n path: 'aggregationData.results.nested.results.results.*.range.to',\n },\n {\n path: 'variants.physicalProperties.pricePerUnit.settings.quantity',\n },\n { path: 'variants.revenueDetails.profitMargin' },\n { path: 'aggregationData.results.scalar.value' },\n {\n path: 'aggregationData.results.groupedByValue.results.nestedResults.scalar.value',\n },\n {\n path: 'aggregationData.results.nested.results.results.*.scalar.value',\n },\n ],\n },\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'variants.media.image.urlExpirationDate' },\n { path: 'variants.media.video.urlExpirationDate' },\n { path: 'variants.media.video.resolutions.urlExpirationDate' },\n {\n path: 'variants.media.video.resolutions.poster.urlExpirationDate',\n },\n { path: 'variants.media.video.posters.urlExpirationDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __searchVariants;\n}\n","import * as ambassadorWixStoresCatalogV3ReadOnlyVariant from './stores-catalog-v3-read-only-variant-read-only-variants-v-3.http.js';\nimport * as ambassadorWixStoresCatalogV3ReadOnlyVariantTypes from './stores-catalog-v3-read-only-variant-read-only-variants-v-3.types.js';\nimport * as ambassadorWixStoresCatalogV3ReadOnlyVariantUniversalTypes from './stores-catalog-v3-read-only-variant-read-only-variants-v-3.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function queryVariants(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixStoresCatalogV3ReadOnlyVariantUniversalTypes.QueryVariantsRequest,\n ambassadorWixStoresCatalogV3ReadOnlyVariantTypes.QueryVariantsRequest,\n ambassadorWixStoresCatalogV3ReadOnlyVariantUniversalTypes.QueryVariantsResponse,\n ambassadorWixStoresCatalogV3ReadOnlyVariantTypes.QueryVariantsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixStoresCatalogV3ReadOnlyVariant.queryVariants(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v3/products/query-variants',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function searchVariants(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixStoresCatalogV3ReadOnlyVariantUniversalTypes.SearchVariantsRequest,\n ambassadorWixStoresCatalogV3ReadOnlyVariantTypes.SearchVariantsRequest,\n ambassadorWixStoresCatalogV3ReadOnlyVariantUniversalTypes.SearchVariantsResponse,\n ambassadorWixStoresCatalogV3ReadOnlyVariantTypes.SearchVariantsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixStoresCatalogV3ReadOnlyVariant.searchVariants(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v3/products/search-variants',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA,sBAAAC;AAAA;AAAA;;;ACAA,mBAA6C;AAC7C,IAAAC,gBAA6C;AAC7C,uBAAqD;AACrD,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,6EACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAUd,SAAS,cAAc,SAA6C;AACzE,WAAS,gBAAgB,EAAE,KAAK,GAAQ;AACtC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK;AAAA,QACH,EAAE,WAAW,+BAA+B,MAAM,SAAS,KAAK;AAAA,MAClE;AAAA,MACA,MAAM;AAAA,MACN,mB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ACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["queryVariants","searchVariants","import_float","payload","queryVariants","searchVariants"]}
|