@guardian/content-api-models 32.0.0-PREVIEW.filterproduct-element-temp.2025-10-07T1607.88693c5b → 32.0.0-PREVIEW.filterproduct-element-temp.2025-10-17T1357.19edb5e8
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 +1 -1
- package/v1/productCTA.d.ts +16 -0
- package/v1/productCTA.js +100 -0
- package/v1/productCustomAttribute.d.ts +14 -0
- package/v1/{statistic.js → productCustomAttribute.js} +8 -8
- package/v1/productDisplayType.d.ts +2 -1
- package/v1/productDisplayType.js +1 -0
- package/v1/productElementFields.d.ts +5 -11
- package/v1/productElementFields.js +46 -137
- package/v1/productImage.d.ts +4 -0
- package/v1/productImage.js +60 -0
- package/v1/statistic.d.ts +0 -14
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
{
|
|
3
3
|
"name": "@guardian/content-api-models",
|
|
4
|
-
"version": "32.0.0-PREVIEW.filterproduct-element-temp.2025-10-
|
|
4
|
+
"version": "32.0.0-PREVIEW.filterproduct-element-temp.2025-10-17T1357.19edb5e8",
|
|
5
5
|
"description": "Typescript library built from the content api thrift definitions",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autogenerated by scrooge-generator-extras
|
|
3
|
+
*
|
|
4
|
+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
5
|
+
*/
|
|
6
|
+
import { TProtocol } from 'thrift';
|
|
7
|
+
export interface ProductCTA {
|
|
8
|
+
url?: string;
|
|
9
|
+
text?: string;
|
|
10
|
+
retailer?: string;
|
|
11
|
+
price?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class ProductCTASerde {
|
|
14
|
+
static read(protocol: TProtocol): ProductCTA;
|
|
15
|
+
static write(protocol: TProtocol, value0: ProductCTA): void;
|
|
16
|
+
}
|
package/v1/productCTA.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Autogenerated by scrooge-generator-extras
|
|
4
|
+
*
|
|
5
|
+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ProductCTASerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var ProductCTASerde = /** @class */ (function () {
|
|
11
|
+
function ProductCTASerde() {
|
|
12
|
+
}
|
|
13
|
+
ProductCTASerde.read = function (protocol) {
|
|
14
|
+
protocol.readStructBegin();
|
|
15
|
+
var result = {};
|
|
16
|
+
while (true) {
|
|
17
|
+
var ret = protocol.readFieldBegin();
|
|
18
|
+
var ftype = ret.ftype;
|
|
19
|
+
var fid = ret.fid;
|
|
20
|
+
if (ftype === thrift_1.Thrift.Type.STOP) {
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
switch (fid) {
|
|
24
|
+
case 1:
|
|
25
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
26
|
+
var value1 = protocol.readString();
|
|
27
|
+
result.url = value1;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
protocol.skip(ftype);
|
|
31
|
+
}
|
|
32
|
+
break;
|
|
33
|
+
case 2:
|
|
34
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
35
|
+
var value1 = protocol.readString();
|
|
36
|
+
result.text = value1;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
protocol.skip(ftype);
|
|
40
|
+
}
|
|
41
|
+
break;
|
|
42
|
+
case 3:
|
|
43
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
44
|
+
var value1 = protocol.readString();
|
|
45
|
+
result.retailer = value1;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
protocol.skip(ftype);
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
case 4:
|
|
52
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
53
|
+
var value1 = protocol.readString();
|
|
54
|
+
result.price = value1;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
protocol.skip(ftype);
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
default:
|
|
61
|
+
protocol.skip(ftype);
|
|
62
|
+
}
|
|
63
|
+
protocol.readFieldEnd();
|
|
64
|
+
}
|
|
65
|
+
protocol.readStructEnd();
|
|
66
|
+
// @ts-ignore
|
|
67
|
+
return result;
|
|
68
|
+
};
|
|
69
|
+
ProductCTASerde.write = function (protocol, value0) {
|
|
70
|
+
protocol.writeStructBegin('ProductCTA');
|
|
71
|
+
if (value0.url !== null && value0.url !== undefined) {
|
|
72
|
+
var value1 = value0.url;
|
|
73
|
+
protocol.writeFieldBegin('url', thrift_1.Thrift.Type.STRING, 1);
|
|
74
|
+
protocol.writeString(value1);
|
|
75
|
+
protocol.writeFieldEnd();
|
|
76
|
+
}
|
|
77
|
+
if (value0.text !== null && value0.text !== undefined) {
|
|
78
|
+
var value1 = value0.text;
|
|
79
|
+
protocol.writeFieldBegin('text', thrift_1.Thrift.Type.STRING, 2);
|
|
80
|
+
protocol.writeString(value1);
|
|
81
|
+
protocol.writeFieldEnd();
|
|
82
|
+
}
|
|
83
|
+
if (value0.retailer !== null && value0.retailer !== undefined) {
|
|
84
|
+
var value1 = value0.retailer;
|
|
85
|
+
protocol.writeFieldBegin('retailer', thrift_1.Thrift.Type.STRING, 3);
|
|
86
|
+
protocol.writeString(value1);
|
|
87
|
+
protocol.writeFieldEnd();
|
|
88
|
+
}
|
|
89
|
+
if (value0.price !== null && value0.price !== undefined) {
|
|
90
|
+
var value1 = value0.price;
|
|
91
|
+
protocol.writeFieldBegin('price', thrift_1.Thrift.Type.STRING, 4);
|
|
92
|
+
protocol.writeString(value1);
|
|
93
|
+
protocol.writeFieldEnd();
|
|
94
|
+
}
|
|
95
|
+
protocol.writeFieldStop();
|
|
96
|
+
protocol.writeStructEnd();
|
|
97
|
+
};
|
|
98
|
+
return ProductCTASerde;
|
|
99
|
+
}());
|
|
100
|
+
exports.ProductCTASerde = ProductCTASerde;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autogenerated by scrooge-generator-extras
|
|
3
|
+
*
|
|
4
|
+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
5
|
+
*/
|
|
6
|
+
import { TProtocol } from 'thrift';
|
|
7
|
+
export interface ProductCustomAttribute {
|
|
8
|
+
name?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class ProductCustomAttributeSerde {
|
|
12
|
+
static read(protocol: TProtocol): ProductCustomAttribute;
|
|
13
|
+
static write(protocol: TProtocol, value0: ProductCustomAttribute): void;
|
|
14
|
+
}
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
8
|
+
exports.ProductCustomAttributeSerde = void 0;
|
|
9
9
|
var thrift_1 = require("thrift");
|
|
10
|
-
var
|
|
11
|
-
function
|
|
10
|
+
var ProductCustomAttributeSerde = /** @class */ (function () {
|
|
11
|
+
function ProductCustomAttributeSerde() {
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
ProductCustomAttributeSerde.read = function (protocol) {
|
|
14
14
|
protocol.readStructBegin();
|
|
15
15
|
var result = {};
|
|
16
16
|
while (true) {
|
|
@@ -48,8 +48,8 @@ var StatisticSerde = /** @class */ (function () {
|
|
|
48
48
|
// @ts-ignore
|
|
49
49
|
return result;
|
|
50
50
|
};
|
|
51
|
-
|
|
52
|
-
protocol.writeStructBegin('
|
|
51
|
+
ProductCustomAttributeSerde.write = function (protocol, value0) {
|
|
52
|
+
protocol.writeStructBegin('ProductCustomAttribute');
|
|
53
53
|
if (value0.name !== null && value0.name !== undefined) {
|
|
54
54
|
var value1 = value0.name;
|
|
55
55
|
protocol.writeFieldBegin('name', thrift_1.Thrift.Type.STRING, 1);
|
|
@@ -65,6 +65,6 @@ var StatisticSerde = /** @class */ (function () {
|
|
|
65
65
|
protocol.writeFieldStop();
|
|
66
66
|
protocol.writeStructEnd();
|
|
67
67
|
};
|
|
68
|
-
return
|
|
68
|
+
return ProductCustomAttributeSerde;
|
|
69
69
|
}());
|
|
70
|
-
exports.
|
|
70
|
+
exports.ProductCustomAttributeSerde = ProductCustomAttributeSerde;
|
package/v1/productDisplayType.js
CHANGED
|
@@ -10,4 +10,5 @@ var ProductDisplayType;
|
|
|
10
10
|
(function (ProductDisplayType) {
|
|
11
11
|
ProductDisplayType[ProductDisplayType["INLINE_WITH_PRODUCT_CARD"] = 0] = "INLINE_WITH_PRODUCT_CARD";
|
|
12
12
|
ProductDisplayType[ProductDisplayType["INLINE_ONLY"] = 1] = "INLINE_ONLY";
|
|
13
|
+
ProductDisplayType[ProductDisplayType["PRODUCT_CARD_ONLY"] = 2] = "PRODUCT_CARD_ONLY";
|
|
13
14
|
})(ProductDisplayType || (exports.ProductDisplayType = ProductDisplayType = {}));
|
|
@@ -5,27 +5,21 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { TProtocol } from 'thrift';
|
|
7
7
|
import { BlockElement } from './blockElement';
|
|
8
|
+
import { ProductCTA } from './productCTA';
|
|
9
|
+
import { ProductCustomAttribute } from './productCustomAttribute';
|
|
8
10
|
import { ProductDisplayType } from './productDisplayType';
|
|
9
11
|
import { ProductImage } from './productImage';
|
|
10
|
-
import { Statistic } from './statistic';
|
|
11
12
|
export interface ProductElementFields {
|
|
12
13
|
productName?: string;
|
|
13
14
|
brandName?: string;
|
|
14
15
|
primaryHeading?: string;
|
|
15
16
|
secondaryHeading?: string;
|
|
17
|
+
displayType: ProductDisplayType;
|
|
16
18
|
starRating?: string;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
primaryRetailer?: string;
|
|
20
|
-
primaryPrice?: string;
|
|
21
|
-
secondaryProductUrl?: string;
|
|
22
|
-
secondaryCta?: string;
|
|
23
|
-
secondaryRetailer?: string;
|
|
24
|
-
secondaryPrice?: string;
|
|
25
|
-
statistics?: Statistic[];
|
|
19
|
+
productCtas?: ProductCTA[];
|
|
20
|
+
customAttributes?: ProductCustomAttribute[];
|
|
26
21
|
image?: ProductImage;
|
|
27
22
|
content?: BlockElement[];
|
|
28
|
-
displayType: ProductDisplayType;
|
|
29
23
|
}
|
|
30
24
|
export declare class ProductElementFieldsSerde {
|
|
31
25
|
static read(protocol: TProtocol): ProductElementFields;
|
|
@@ -8,13 +8,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.ProductElementFieldsSerde = void 0;
|
|
9
9
|
var thrift_1 = require("thrift");
|
|
10
10
|
var blockElement_1 = require("./blockElement");
|
|
11
|
+
var productCTA_1 = require("./productCTA");
|
|
12
|
+
var productCustomAttribute_1 = require("./productCustomAttribute");
|
|
11
13
|
var productImage_1 = require("./productImage");
|
|
12
|
-
var statistic_1 = require("./statistic");
|
|
13
14
|
var ProductElementFieldsSerde = /** @class */ (function () {
|
|
14
15
|
function ProductElementFieldsSerde() {
|
|
15
16
|
}
|
|
16
17
|
ProductElementFieldsSerde.read = function (protocol) {
|
|
17
|
-
var _a, _b;
|
|
18
|
+
var _a, _b, _c;
|
|
18
19
|
protocol.readStructBegin();
|
|
19
20
|
var result = {};
|
|
20
21
|
while (true) {
|
|
@@ -62,9 +63,9 @@ var ProductElementFieldsSerde = /** @class */ (function () {
|
|
|
62
63
|
}
|
|
63
64
|
break;
|
|
64
65
|
case 5:
|
|
65
|
-
if (ftype === thrift_1.Thrift.Type.
|
|
66
|
-
var value1 = protocol.
|
|
67
|
-
result.
|
|
66
|
+
if (ftype === thrift_1.Thrift.Type.I32) {
|
|
67
|
+
var value1 = protocol.readI32();
|
|
68
|
+
result.displayType = value1;
|
|
68
69
|
}
|
|
69
70
|
else {
|
|
70
71
|
protocol.skip(ftype);
|
|
@@ -73,94 +74,49 @@ var ProductElementFieldsSerde = /** @class */ (function () {
|
|
|
73
74
|
case 6:
|
|
74
75
|
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
75
76
|
var value1 = protocol.readString();
|
|
76
|
-
result.
|
|
77
|
+
result.starRating = value1;
|
|
77
78
|
}
|
|
78
79
|
else {
|
|
79
80
|
protocol.skip(ftype);
|
|
80
81
|
}
|
|
81
82
|
break;
|
|
82
83
|
case 7:
|
|
83
|
-
if (ftype === thrift_1.Thrift.Type.
|
|
84
|
-
var
|
|
85
|
-
|
|
84
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
85
|
+
var listInfo1 = protocol.readListBegin();
|
|
86
|
+
var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
|
|
87
|
+
var value1 = [];
|
|
88
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
89
|
+
for (var i = 0; i < listSize1; i++) {
|
|
90
|
+
var value2 = productCTA_1.ProductCTASerde.read(protocol);
|
|
91
|
+
value1.push(value2);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
protocol.readListEnd();
|
|
95
|
+
result.productCtas = value1;
|
|
86
96
|
}
|
|
87
97
|
else {
|
|
88
98
|
protocol.skip(ftype);
|
|
89
99
|
}
|
|
90
100
|
break;
|
|
91
101
|
case 8:
|
|
92
|
-
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
93
|
-
var value1 = protocol.readString();
|
|
94
|
-
result.primaryRetailer = value1;
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
protocol.skip(ftype);
|
|
98
|
-
}
|
|
99
|
-
break;
|
|
100
|
-
case 9:
|
|
101
|
-
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
102
|
-
var value1 = protocol.readString();
|
|
103
|
-
result.primaryPrice = value1;
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
protocol.skip(ftype);
|
|
107
|
-
}
|
|
108
|
-
break;
|
|
109
|
-
case 10:
|
|
110
|
-
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
111
|
-
var value1 = protocol.readString();
|
|
112
|
-
result.secondaryProductUrl = value1;
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
protocol.skip(ftype);
|
|
116
|
-
}
|
|
117
|
-
break;
|
|
118
|
-
case 11:
|
|
119
|
-
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
120
|
-
var value1 = protocol.readString();
|
|
121
|
-
result.secondaryCta = value1;
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
protocol.skip(ftype);
|
|
125
|
-
}
|
|
126
|
-
break;
|
|
127
|
-
case 12:
|
|
128
|
-
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
129
|
-
var value1 = protocol.readString();
|
|
130
|
-
result.secondaryRetailer = value1;
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
protocol.skip(ftype);
|
|
134
|
-
}
|
|
135
|
-
break;
|
|
136
|
-
case 13:
|
|
137
|
-
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
138
|
-
var value1 = protocol.readString();
|
|
139
|
-
result.secondaryPrice = value1;
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
protocol.skip(ftype);
|
|
143
|
-
}
|
|
144
|
-
break;
|
|
145
|
-
case 14:
|
|
146
102
|
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
147
103
|
var listInfo1 = protocol.readListBegin();
|
|
148
|
-
var listSize1 = (
|
|
104
|
+
var listSize1 = (_b = listInfo1.size) !== null && _b !== void 0 ? _b : 0;
|
|
149
105
|
var value1 = [];
|
|
150
106
|
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
151
107
|
for (var i = 0; i < listSize1; i++) {
|
|
152
|
-
var value2 =
|
|
108
|
+
var value2 = productCustomAttribute_1.ProductCustomAttributeSerde.read(protocol);
|
|
153
109
|
value1.push(value2);
|
|
154
110
|
}
|
|
155
111
|
}
|
|
156
112
|
protocol.readListEnd();
|
|
157
|
-
result.
|
|
113
|
+
result.customAttributes = value1;
|
|
158
114
|
}
|
|
159
115
|
else {
|
|
160
116
|
protocol.skip(ftype);
|
|
161
117
|
}
|
|
162
118
|
break;
|
|
163
|
-
case
|
|
119
|
+
case 9:
|
|
164
120
|
if (ftype === thrift_1.Thrift.Type.STRUCT) {
|
|
165
121
|
var value1 = productImage_1.ProductImageSerde.read(protocol);
|
|
166
122
|
result.image = value1;
|
|
@@ -169,10 +125,10 @@ var ProductElementFieldsSerde = /** @class */ (function () {
|
|
|
169
125
|
protocol.skip(ftype);
|
|
170
126
|
}
|
|
171
127
|
break;
|
|
172
|
-
case
|
|
128
|
+
case 10:
|
|
173
129
|
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
174
130
|
var listInfo1 = protocol.readListBegin();
|
|
175
|
-
var listSize1 = (
|
|
131
|
+
var listSize1 = (_c = listInfo1.size) !== null && _c !== void 0 ? _c : 0;
|
|
176
132
|
var value1 = [];
|
|
177
133
|
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
178
134
|
for (var i = 0; i < listSize1; i++) {
|
|
@@ -187,15 +143,6 @@ var ProductElementFieldsSerde = /** @class */ (function () {
|
|
|
187
143
|
protocol.skip(ftype);
|
|
188
144
|
}
|
|
189
145
|
break;
|
|
190
|
-
case 17:
|
|
191
|
-
if (ftype === thrift_1.Thrift.Type.I32) {
|
|
192
|
-
var value1 = protocol.readI32();
|
|
193
|
-
result.displayType = value1;
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
protocol.skip(ftype);
|
|
197
|
-
}
|
|
198
|
-
break;
|
|
199
146
|
default:
|
|
200
147
|
protocol.skip(ftype);
|
|
201
148
|
}
|
|
@@ -231,79 +178,47 @@ var ProductElementFieldsSerde = /** @class */ (function () {
|
|
|
231
178
|
protocol.writeString(value1);
|
|
232
179
|
protocol.writeFieldEnd();
|
|
233
180
|
}
|
|
234
|
-
if (value0.
|
|
235
|
-
var value1 = value0.
|
|
236
|
-
protocol.writeFieldBegin('
|
|
237
|
-
protocol.
|
|
238
|
-
protocol.writeFieldEnd();
|
|
239
|
-
}
|
|
240
|
-
if (value0.primaryProductUrl !== null && value0.primaryProductUrl !== undefined) {
|
|
241
|
-
var value1 = value0.primaryProductUrl;
|
|
242
|
-
protocol.writeFieldBegin('primaryProductUrl', thrift_1.Thrift.Type.STRING, 6);
|
|
243
|
-
protocol.writeString(value1);
|
|
244
|
-
protocol.writeFieldEnd();
|
|
245
|
-
}
|
|
246
|
-
if (value0.primaryCta !== null && value0.primaryCta !== undefined) {
|
|
247
|
-
var value1 = value0.primaryCta;
|
|
248
|
-
protocol.writeFieldBegin('primaryCta', thrift_1.Thrift.Type.STRING, 7);
|
|
249
|
-
protocol.writeString(value1);
|
|
250
|
-
protocol.writeFieldEnd();
|
|
251
|
-
}
|
|
252
|
-
if (value0.primaryRetailer !== null && value0.primaryRetailer !== undefined) {
|
|
253
|
-
var value1 = value0.primaryRetailer;
|
|
254
|
-
protocol.writeFieldBegin('primaryRetailer', thrift_1.Thrift.Type.STRING, 8);
|
|
255
|
-
protocol.writeString(value1);
|
|
256
|
-
protocol.writeFieldEnd();
|
|
257
|
-
}
|
|
258
|
-
if (value0.primaryPrice !== null && value0.primaryPrice !== undefined) {
|
|
259
|
-
var value1 = value0.primaryPrice;
|
|
260
|
-
protocol.writeFieldBegin('primaryPrice', thrift_1.Thrift.Type.STRING, 9);
|
|
261
|
-
protocol.writeString(value1);
|
|
262
|
-
protocol.writeFieldEnd();
|
|
263
|
-
}
|
|
264
|
-
if (value0.secondaryProductUrl !== null && value0.secondaryProductUrl !== undefined) {
|
|
265
|
-
var value1 = value0.secondaryProductUrl;
|
|
266
|
-
protocol.writeFieldBegin('secondaryProductUrl', thrift_1.Thrift.Type.STRING, 10);
|
|
267
|
-
protocol.writeString(value1);
|
|
268
|
-
protocol.writeFieldEnd();
|
|
269
|
-
}
|
|
270
|
-
if (value0.secondaryCta !== null && value0.secondaryCta !== undefined) {
|
|
271
|
-
var value1 = value0.secondaryCta;
|
|
272
|
-
protocol.writeFieldBegin('secondaryCta', thrift_1.Thrift.Type.STRING, 11);
|
|
273
|
-
protocol.writeString(value1);
|
|
181
|
+
if (value0.displayType !== null && value0.displayType !== undefined) {
|
|
182
|
+
var value1 = value0.displayType;
|
|
183
|
+
protocol.writeFieldBegin('displayType', thrift_1.Thrift.Type.I32, 5);
|
|
184
|
+
protocol.writeI32(value1);
|
|
274
185
|
protocol.writeFieldEnd();
|
|
275
186
|
}
|
|
276
|
-
if (value0.
|
|
277
|
-
var value1 = value0.
|
|
278
|
-
protocol.writeFieldBegin('
|
|
187
|
+
if (value0.starRating !== null && value0.starRating !== undefined) {
|
|
188
|
+
var value1 = value0.starRating;
|
|
189
|
+
protocol.writeFieldBegin('starRating', thrift_1.Thrift.Type.STRING, 6);
|
|
279
190
|
protocol.writeString(value1);
|
|
280
191
|
protocol.writeFieldEnd();
|
|
281
192
|
}
|
|
282
|
-
if (value0.
|
|
283
|
-
var value1 = value0.
|
|
284
|
-
protocol.writeFieldBegin('
|
|
285
|
-
protocol.
|
|
193
|
+
if (value0.productCtas !== null && value0.productCtas !== undefined) {
|
|
194
|
+
var value1 = value0.productCtas;
|
|
195
|
+
protocol.writeFieldBegin('productCtas', thrift_1.Thrift.Type.LIST, 7);
|
|
196
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
197
|
+
value1.forEach(function (value2) {
|
|
198
|
+
productCTA_1.ProductCTASerde.write(protocol, value2);
|
|
199
|
+
});
|
|
200
|
+
protocol.writeListEnd();
|
|
286
201
|
protocol.writeFieldEnd();
|
|
287
202
|
}
|
|
288
|
-
if (value0.
|
|
289
|
-
var value1 = value0.
|
|
290
|
-
protocol.writeFieldBegin('
|
|
203
|
+
if (value0.customAttributes !== null && value0.customAttributes !== undefined) {
|
|
204
|
+
var value1 = value0.customAttributes;
|
|
205
|
+
protocol.writeFieldBegin('customAttributes', thrift_1.Thrift.Type.LIST, 8);
|
|
291
206
|
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
292
207
|
value1.forEach(function (value2) {
|
|
293
|
-
|
|
208
|
+
productCustomAttribute_1.ProductCustomAttributeSerde.write(protocol, value2);
|
|
294
209
|
});
|
|
295
210
|
protocol.writeListEnd();
|
|
296
211
|
protocol.writeFieldEnd();
|
|
297
212
|
}
|
|
298
213
|
if (value0.image !== null && value0.image !== undefined) {
|
|
299
214
|
var value1 = value0.image;
|
|
300
|
-
protocol.writeFieldBegin('image', thrift_1.Thrift.Type.STRUCT,
|
|
215
|
+
protocol.writeFieldBegin('image', thrift_1.Thrift.Type.STRUCT, 9);
|
|
301
216
|
productImage_1.ProductImageSerde.write(protocol, value1);
|
|
302
217
|
protocol.writeFieldEnd();
|
|
303
218
|
}
|
|
304
219
|
if (value0.content !== null && value0.content !== undefined) {
|
|
305
220
|
var value1 = value0.content;
|
|
306
|
-
protocol.writeFieldBegin('content', thrift_1.Thrift.Type.LIST,
|
|
221
|
+
protocol.writeFieldBegin('content', thrift_1.Thrift.Type.LIST, 10);
|
|
307
222
|
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
308
223
|
value1.forEach(function (value2) {
|
|
309
224
|
blockElement_1.BlockElementSerde.write(protocol, value2);
|
|
@@ -311,12 +226,6 @@ var ProductElementFieldsSerde = /** @class */ (function () {
|
|
|
311
226
|
protocol.writeListEnd();
|
|
312
227
|
protocol.writeFieldEnd();
|
|
313
228
|
}
|
|
314
|
-
if (value0.displayType !== null && value0.displayType !== undefined) {
|
|
315
|
-
var value1 = value0.displayType;
|
|
316
|
-
protocol.writeFieldBegin('displayType', thrift_1.Thrift.Type.I32, 17);
|
|
317
|
-
protocol.writeI32(value1);
|
|
318
|
-
protocol.writeFieldEnd();
|
|
319
|
-
}
|
|
320
229
|
protocol.writeFieldStop();
|
|
321
230
|
protocol.writeStructEnd();
|
|
322
231
|
};
|
package/v1/productImage.d.ts
CHANGED
|
@@ -13,6 +13,10 @@ export interface ProductImage {
|
|
|
13
13
|
mediaId?: string;
|
|
14
14
|
file?: string;
|
|
15
15
|
suppliersReference?: string;
|
|
16
|
+
imageType?: string;
|
|
17
|
+
height?: number;
|
|
18
|
+
width?: number;
|
|
19
|
+
credit?: string;
|
|
16
20
|
}
|
|
17
21
|
export declare class ProductImageSerde {
|
|
18
22
|
static read(protocol: TProtocol): ProductImage;
|
package/v1/productImage.js
CHANGED
|
@@ -93,6 +93,42 @@ var ProductImageSerde = /** @class */ (function () {
|
|
|
93
93
|
protocol.skip(ftype);
|
|
94
94
|
}
|
|
95
95
|
break;
|
|
96
|
+
case 9:
|
|
97
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
98
|
+
var value1 = protocol.readString();
|
|
99
|
+
result.imageType = value1;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
protocol.skip(ftype);
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
case 10:
|
|
106
|
+
if (ftype === thrift_1.Thrift.Type.I32) {
|
|
107
|
+
var value1 = protocol.readI32();
|
|
108
|
+
result.height = value1;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
protocol.skip(ftype);
|
|
112
|
+
}
|
|
113
|
+
break;
|
|
114
|
+
case 11:
|
|
115
|
+
if (ftype === thrift_1.Thrift.Type.I32) {
|
|
116
|
+
var value1 = protocol.readI32();
|
|
117
|
+
result.width = value1;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
protocol.skip(ftype);
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
case 12:
|
|
124
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
125
|
+
var value1 = protocol.readString();
|
|
126
|
+
result.credit = value1;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
protocol.skip(ftype);
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
96
132
|
default:
|
|
97
133
|
protocol.skip(ftype);
|
|
98
134
|
}
|
|
@@ -152,6 +188,30 @@ var ProductImageSerde = /** @class */ (function () {
|
|
|
152
188
|
protocol.writeString(value1);
|
|
153
189
|
protocol.writeFieldEnd();
|
|
154
190
|
}
|
|
191
|
+
if (value0.imageType !== null && value0.imageType !== undefined) {
|
|
192
|
+
var value1 = value0.imageType;
|
|
193
|
+
protocol.writeFieldBegin('imageType', thrift_1.Thrift.Type.STRING, 9);
|
|
194
|
+
protocol.writeString(value1);
|
|
195
|
+
protocol.writeFieldEnd();
|
|
196
|
+
}
|
|
197
|
+
if (value0.height !== null && value0.height !== undefined) {
|
|
198
|
+
var value1 = value0.height;
|
|
199
|
+
protocol.writeFieldBegin('height', thrift_1.Thrift.Type.I32, 10);
|
|
200
|
+
protocol.writeI32(value1);
|
|
201
|
+
protocol.writeFieldEnd();
|
|
202
|
+
}
|
|
203
|
+
if (value0.width !== null && value0.width !== undefined) {
|
|
204
|
+
var value1 = value0.width;
|
|
205
|
+
protocol.writeFieldBegin('width', thrift_1.Thrift.Type.I32, 11);
|
|
206
|
+
protocol.writeI32(value1);
|
|
207
|
+
protocol.writeFieldEnd();
|
|
208
|
+
}
|
|
209
|
+
if (value0.credit !== null && value0.credit !== undefined) {
|
|
210
|
+
var value1 = value0.credit;
|
|
211
|
+
protocol.writeFieldBegin('credit', thrift_1.Thrift.Type.STRING, 12);
|
|
212
|
+
protocol.writeString(value1);
|
|
213
|
+
protocol.writeFieldEnd();
|
|
214
|
+
}
|
|
155
215
|
protocol.writeFieldStop();
|
|
156
216
|
protocol.writeStructEnd();
|
|
157
217
|
};
|
package/v1/statistic.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Autogenerated by scrooge-generator-extras
|
|
3
|
-
*
|
|
4
|
-
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
5
|
-
*/
|
|
6
|
-
import { TProtocol } from 'thrift';
|
|
7
|
-
export interface Statistic {
|
|
8
|
-
name?: string;
|
|
9
|
-
value?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare class StatisticSerde {
|
|
12
|
-
static read(protocol: TProtocol): Statistic;
|
|
13
|
-
static write(protocol: TProtocol, value0: Statistic): void;
|
|
14
|
-
}
|