@reactionary/core 0.10.55 → 0.10.57

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactionary/core",
3
- "version": "0.10.55",
3
+ "version": "0.10.57",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./src/index.d.ts",
@@ -7,6 +7,9 @@ const ProductSearchResultItemComplianceDataSchema = z.looseObject({
7
7
  weee_symbol: z.boolean().default(false).meta({ description: "Indicates whether the WEEE symbol can be shown on the product" }),
8
8
  energy_class: z.string().optional().meta({ description: "The energy class of the product, as required by EU regulations. A,B,C,D,E,F,G, etc" }),
9
9
  garan_duration: z.number().optional().meta({ description: "The duration of the guarantee in months as by the EU Garan scheme. Only set if above 24." }),
10
+ energy_class_range: z.string().optional().meta({ description: 'The scale the energy class belongs to, e.g. "A-G", "A++-G" or "A+++-D". Needed to render the EU class arrow, because the same class letter is drawn differently on different scales.' }),
11
+ eprel_registration_number: z.string().optional().meta({ description: "The EPREL registration number of the product model (digits only, up to 19). Together with eprel_product_group it identifies the official EU energy label and class arrow." }),
12
+ eprel_product_group: z.string().optional().meta({ description: 'The EPREL product group URL code the model is registered under, e.g. "spaceheaters" or "localspaceheaters".' }),
10
13
  is_organic: z.boolean().optional().meta({ description: "Indicates whether the product is organic" }),
11
14
  organic_certification_type: z.string().optional().meta({ description: "The type of organic certification, e.g., EU_ORGANIC_LEAF, GOTS, ECOCERT." })
12
15
  });
@@ -20,6 +23,7 @@ const ProductSearchResultItemSchema = BaseModelSchema.extend({
20
23
  name: z.string(),
21
24
  slug: z.string(),
22
25
  complianceData: ProductSearchResultItemComplianceDataSchema.optional().meta({ description: "Compliance data for the product as required by EU regulations." }),
26
+ canAddToCartDirectly: z.boolean().default(false).meta({ description: "Whether the storefront may render an add-to-cart button for this product directly on a PLP. When false, the customer must always visit the PDP first, e.g. for regulatory reasons or as a business decision. Set by the indexer where the search provider supports it; otherwise providers default it to true only when the product has exactly one variant." }),
23
27
  variants: z.array(ProductSearchResultItemVariantSchema).meta({ description: "A list of variants associated with the product in the search results. If exactly one is present, you can use add-to-cart directly from PLP. If none are present, you must direct to PDP. If mulitple are present, and no options are set, you must direct to PDP. If multiple are present, and they have options, you can render swatches on PLP and allow customer to flip between variants." })
24
28
  });
25
29
  const ProductSearchResultFacetValueSchema = z.looseObject({
@@ -6,6 +6,9 @@ const ProductComplianceDataSchema = z.looseObject({
6
6
  weee_symbol: z.boolean().default(false).meta({ description: "Indicates whether the WEEE symbol can be shown on the product" }),
7
7
  energy_class: z.string().optional().meta({ description: "The energy class of the product, as required by EU regulations. A,B,C,D,E,F,G, etc" }),
8
8
  garan_duration: z.number().optional().meta({ description: "The duration of the guarantee in months as by the EU Garan scheme. Only set if above 24." }),
9
+ energy_class_range: z.string().optional().meta({ description: 'The scale the energy class belongs to, e.g. "A-G", "A++-G" or "A+++-D". Needed to render the EU class arrow, because the same class letter is drawn differently on different scales.' }),
10
+ eprel_registration_number: z.string().optional().meta({ description: "The EPREL registration number of the product model (digits only, up to 19). Together with eprel_product_group it identifies the official EU energy label and class arrow." }),
11
+ eprel_product_group: z.string().optional().meta({ description: 'The EPREL product group URL code the model is registered under, e.g. "spaceheaters" or "localspaceheaters".' }),
9
12
  safety_warnings: z.string().optional().meta({ description: "Any safety warnings associated with the product as required by EU regulations." }),
10
13
  composition: z.string().optional().meta({ description: "The composition of the product as required by EU regulations." }),
11
14
  additional_disclosures: z.string().optional().meta({ description: "Any additional disclosures associated with the product as required by EU regulations." }),
@@ -30,9 +30,13 @@ export declare const ProductAssociationProductSearchResultItemSchema: z.ZodObjec
30
30
  weee_symbol: z.ZodDefault<z.ZodBoolean>;
31
31
  energy_class: z.ZodOptional<z.ZodString>;
32
32
  garan_duration: z.ZodOptional<z.ZodNumber>;
33
+ energy_class_range: z.ZodOptional<z.ZodString>;
34
+ eprel_registration_number: z.ZodOptional<z.ZodString>;
35
+ eprel_product_group: z.ZodOptional<z.ZodString>;
33
36
  is_organic: z.ZodOptional<z.ZodBoolean>;
34
37
  organic_certification_type: z.ZodOptional<z.ZodString>;
35
38
  }, z.core.$loose>>;
39
+ canAddToCartDirectly: z.ZodDefault<z.ZodBoolean>;
36
40
  variants: z.ZodArray<z.ZodObject<{
37
41
  variant: z.ZodObject<{
38
42
  sku: z.ZodString;
@@ -85,9 +89,13 @@ export declare const ProductAssociationSchema: z.ZodDiscriminatedUnion<[z.ZodObj
85
89
  weee_symbol: z.ZodDefault<z.ZodBoolean>;
86
90
  energy_class: z.ZodOptional<z.ZodString>;
87
91
  garan_duration: z.ZodOptional<z.ZodNumber>;
92
+ energy_class_range: z.ZodOptional<z.ZodString>;
93
+ eprel_registration_number: z.ZodOptional<z.ZodString>;
94
+ eprel_product_group: z.ZodOptional<z.ZodString>;
88
95
  is_organic: z.ZodOptional<z.ZodBoolean>;
89
96
  organic_certification_type: z.ZodOptional<z.ZodString>;
90
97
  }, z.core.$loose>>;
98
+ canAddToCartDirectly: z.ZodDefault<z.ZodBoolean>;
91
99
  variants: z.ZodArray<z.ZodObject<{
92
100
  variant: z.ZodObject<{
93
101
  sku: z.ZodString;
@@ -33,9 +33,13 @@ export declare const ProductRecommendationProductSearchResultItemSchema: z.ZodOb
33
33
  weee_symbol: z.ZodDefault<z.ZodBoolean>;
34
34
  energy_class: z.ZodOptional<z.ZodString>;
35
35
  garan_duration: z.ZodOptional<z.ZodNumber>;
36
+ energy_class_range: z.ZodOptional<z.ZodString>;
37
+ eprel_registration_number: z.ZodOptional<z.ZodString>;
38
+ eprel_product_group: z.ZodOptional<z.ZodString>;
36
39
  is_organic: z.ZodOptional<z.ZodBoolean>;
37
40
  organic_certification_type: z.ZodOptional<z.ZodString>;
38
41
  }, z.core.$loose>>;
42
+ canAddToCartDirectly: z.ZodDefault<z.ZodBoolean>;
39
43
  variants: z.ZodArray<z.ZodObject<{
40
44
  variant: z.ZodObject<{
41
45
  sku: z.ZodString;
@@ -90,9 +94,13 @@ export declare const ProductRecommendationSchema: z.ZodDiscriminatedUnion<[z.Zod
90
94
  weee_symbol: z.ZodDefault<z.ZodBoolean>;
91
95
  energy_class: z.ZodOptional<z.ZodString>;
92
96
  garan_duration: z.ZodOptional<z.ZodNumber>;
97
+ energy_class_range: z.ZodOptional<z.ZodString>;
98
+ eprel_registration_number: z.ZodOptional<z.ZodString>;
99
+ eprel_product_group: z.ZodOptional<z.ZodString>;
93
100
  is_organic: z.ZodOptional<z.ZodBoolean>;
94
101
  organic_certification_type: z.ZodOptional<z.ZodString>;
95
102
  }, z.core.$loose>>;
103
+ canAddToCartDirectly: z.ZodDefault<z.ZodBoolean>;
96
104
  variants: z.ZodArray<z.ZodObject<{
97
105
  variant: z.ZodObject<{
98
106
  sku: z.ZodString;
@@ -5,6 +5,9 @@ export declare const ProductSearchResultItemComplianceDataSchema: z.ZodObject<{
5
5
  weee_symbol: z.ZodDefault<z.ZodBoolean>;
6
6
  energy_class: z.ZodOptional<z.ZodString>;
7
7
  garan_duration: z.ZodOptional<z.ZodNumber>;
8
+ energy_class_range: z.ZodOptional<z.ZodString>;
9
+ eprel_registration_number: z.ZodOptional<z.ZodString>;
10
+ eprel_product_group: z.ZodOptional<z.ZodString>;
8
11
  is_organic: z.ZodOptional<z.ZodBoolean>;
9
12
  organic_certification_type: z.ZodOptional<z.ZodString>;
10
13
  }, z.core.$loose>;
@@ -45,9 +48,13 @@ export declare const ProductSearchResultItemSchema: z.ZodObject<{
45
48
  weee_symbol: z.ZodDefault<z.ZodBoolean>;
46
49
  energy_class: z.ZodOptional<z.ZodString>;
47
50
  garan_duration: z.ZodOptional<z.ZodNumber>;
51
+ energy_class_range: z.ZodOptional<z.ZodString>;
52
+ eprel_registration_number: z.ZodOptional<z.ZodString>;
53
+ eprel_product_group: z.ZodOptional<z.ZodString>;
48
54
  is_organic: z.ZodOptional<z.ZodBoolean>;
49
55
  organic_certification_type: z.ZodOptional<z.ZodString>;
50
56
  }, z.core.$loose>>;
57
+ canAddToCartDirectly: z.ZodDefault<z.ZodBoolean>;
51
58
  variants: z.ZodArray<z.ZodObject<{
52
59
  variant: z.ZodObject<{
53
60
  sku: z.ZodString;
@@ -119,9 +126,13 @@ export declare const ProductSearchResultSchema: z.ZodObject<{
119
126
  weee_symbol: z.ZodDefault<z.ZodBoolean>;
120
127
  energy_class: z.ZodOptional<z.ZodString>;
121
128
  garan_duration: z.ZodOptional<z.ZodNumber>;
129
+ energy_class_range: z.ZodOptional<z.ZodString>;
130
+ eprel_registration_number: z.ZodOptional<z.ZodString>;
131
+ eprel_product_group: z.ZodOptional<z.ZodString>;
122
132
  is_organic: z.ZodOptional<z.ZodBoolean>;
123
133
  organic_certification_type: z.ZodOptional<z.ZodString>;
124
134
  }, z.core.$loose>>;
135
+ canAddToCartDirectly: z.ZodDefault<z.ZodBoolean>;
125
136
  variants: z.ZodArray<z.ZodObject<{
126
137
  variant: z.ZodObject<{
127
138
  sku: z.ZodString;
@@ -9,6 +9,9 @@ export declare const ProductComplianceDataSchema: z.ZodObject<{
9
9
  weee_symbol: z.ZodDefault<z.ZodBoolean>;
10
10
  energy_class: z.ZodOptional<z.ZodString>;
11
11
  garan_duration: z.ZodOptional<z.ZodNumber>;
12
+ energy_class_range: z.ZodOptional<z.ZodString>;
13
+ eprel_registration_number: z.ZodOptional<z.ZodString>;
14
+ eprel_product_group: z.ZodOptional<z.ZodString>;
12
15
  safety_warnings: z.ZodOptional<z.ZodString>;
13
16
  composition: z.ZodOptional<z.ZodString>;
14
17
  additional_disclosures: z.ZodOptional<z.ZodString>;
@@ -234,6 +237,9 @@ export declare const ProductSchema: z.ZodObject<{
234
237
  weee_symbol: z.ZodDefault<z.ZodBoolean>;
235
238
  energy_class: z.ZodOptional<z.ZodString>;
236
239
  garan_duration: z.ZodOptional<z.ZodNumber>;
240
+ energy_class_range: z.ZodOptional<z.ZodString>;
241
+ eprel_registration_number: z.ZodOptional<z.ZodString>;
242
+ eprel_product_group: z.ZodOptional<z.ZodString>;
237
243
  safety_warnings: z.ZodOptional<z.ZodString>;
238
244
  composition: z.ZodOptional<z.ZodString>;
239
245
  additional_disclosures: z.ZodOptional<z.ZodString>;