@guardian/content-api-models 31.0.0 → 32.0.0-PREVIEW.filterproduct-element-temp.2025-10-07T1607.88693c5b
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/blockElement.d.ts +2 -0
- package/v1/blockElement.js +16 -0
- package/v1/crosswordType.d.ts +2 -1
- package/v1/crosswordType.js +1 -0
- package/v1/elementType.d.ts +2 -1
- package/v1/elementType.js +1 -0
- package/v1/productDisplayType.d.ts +9 -0
- package/v1/productDisplayType.js +13 -0
- package/v1/productElementFields.d.ts +33 -0
- package/v1/productElementFields.js +325 -0
- package/v1/productImage.d.ts +20 -0
- package/v1/productImage.js +160 -0
- package/v1/statistic.d.ts +14 -0
- package/v1/statistic.js +70 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
{
|
|
3
3
|
"name": "@guardian/content-api-models",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "32.0.0-PREVIEW.filterproduct-element-temp.2025-10-07T1607.88693c5b",
|
|
5
5
|
"description": "Typescript library built from the content api thrift definitions",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
package/v1/blockElement.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { InteractiveElementFields } from './interactiveElementFields';
|
|
|
20
20
|
import { LinkElementFields } from './linkElementFields';
|
|
21
21
|
import { ListElementFields } from './listElementFields';
|
|
22
22
|
import { MembershipElementFields } from './membershipElementFields';
|
|
23
|
+
import { ProductElementFields } from './productElementFields';
|
|
23
24
|
import { PullquoteElementFields } from './pullquoteElementFields';
|
|
24
25
|
import { RecipeElementFields } from './recipeElementFields';
|
|
25
26
|
import { RichLinkElementFields } from './richLinkElementFields';
|
|
@@ -59,6 +60,7 @@ export interface BlockElement {
|
|
|
59
60
|
listTypeData?: ListElementFields;
|
|
60
61
|
timelineTypeData?: TimelineElementFields;
|
|
61
62
|
linkTypeData?: LinkElementFields;
|
|
63
|
+
tempProductTypeData?: ProductElementFields;
|
|
62
64
|
}
|
|
63
65
|
export declare class BlockElementSerde {
|
|
64
66
|
static read(protocol: TProtocol): BlockElement;
|
package/v1/blockElement.js
CHANGED
|
@@ -22,6 +22,7 @@ var interactiveElementFields_1 = require("./interactiveElementFields");
|
|
|
22
22
|
var linkElementFields_1 = require("./linkElementFields");
|
|
23
23
|
var listElementFields_1 = require("./listElementFields");
|
|
24
24
|
var membershipElementFields_1 = require("./membershipElementFields");
|
|
25
|
+
var productElementFields_1 = require("./productElementFields");
|
|
25
26
|
var pullquoteElementFields_1 = require("./pullquoteElementFields");
|
|
26
27
|
var recipeElementFields_1 = require("./recipeElementFields");
|
|
27
28
|
var richLinkElementFields_1 = require("./richLinkElementFields");
|
|
@@ -308,6 +309,15 @@ var BlockElementSerde = /** @class */ (function () {
|
|
|
308
309
|
protocol.skip(ftype);
|
|
309
310
|
}
|
|
310
311
|
break;
|
|
312
|
+
case 29:
|
|
313
|
+
if (ftype === thrift_1.Thrift.Type.STRUCT) {
|
|
314
|
+
var value1 = productElementFields_1.ProductElementFieldsSerde.read(protocol);
|
|
315
|
+
result.tempProductTypeData = value1;
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
protocol.skip(ftype);
|
|
319
|
+
}
|
|
320
|
+
break;
|
|
311
321
|
default:
|
|
312
322
|
protocol.skip(ftype);
|
|
313
323
|
}
|
|
@@ -491,6 +501,12 @@ var BlockElementSerde = /** @class */ (function () {
|
|
|
491
501
|
linkElementFields_1.LinkElementFieldsSerde.write(protocol, value1);
|
|
492
502
|
protocol.writeFieldEnd();
|
|
493
503
|
}
|
|
504
|
+
if (value0.tempProductTypeData !== null && value0.tempProductTypeData !== undefined) {
|
|
505
|
+
var value1 = value0.tempProductTypeData;
|
|
506
|
+
protocol.writeFieldBegin('tempProductTypeData', thrift_1.Thrift.Type.STRUCT, 29);
|
|
507
|
+
productElementFields_1.ProductElementFieldsSerde.write(protocol, value1);
|
|
508
|
+
protocol.writeFieldEnd();
|
|
509
|
+
}
|
|
494
510
|
protocol.writeFieldStop();
|
|
495
511
|
protocol.writeStructEnd();
|
|
496
512
|
};
|
package/v1/crosswordType.d.ts
CHANGED
package/v1/crosswordType.js
CHANGED
|
@@ -19,4 +19,5 @@ var CrosswordType;
|
|
|
19
19
|
CrosswordType[CrosswordType["QUICK_CRYPTIC"] = 8] = "QUICK_CRYPTIC";
|
|
20
20
|
CrosswordType[CrosswordType["SPECIAL"] = 9] = "SPECIAL";
|
|
21
21
|
CrosswordType[CrosswordType["SUNDAY_QUICK"] = 10] = "SUNDAY_QUICK";
|
|
22
|
+
CrosswordType[CrosswordType["MINI"] = 11] = "MINI";
|
|
22
23
|
})(CrosswordType || (exports.CrosswordType = CrosswordType = {}));
|
package/v1/elementType.d.ts
CHANGED
package/v1/elementType.js
CHANGED
|
@@ -34,4 +34,5 @@ var ElementType;
|
|
|
34
34
|
ElementType[ElementType["LIST"] = 23] = "LIST";
|
|
35
35
|
ElementType[ElementType["TIMELINE"] = 24] = "TIMELINE";
|
|
36
36
|
ElementType[ElementType["LINK"] = 25] = "LINK";
|
|
37
|
+
ElementType[ElementType["PRODUCT"] = 26] = "PRODUCT";
|
|
37
38
|
})(ElementType || (exports.ElementType = ElementType = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
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.ProductDisplayType = void 0;
|
|
9
|
+
var ProductDisplayType;
|
|
10
|
+
(function (ProductDisplayType) {
|
|
11
|
+
ProductDisplayType[ProductDisplayType["INLINE_WITH_PRODUCT_CARD"] = 0] = "INLINE_WITH_PRODUCT_CARD";
|
|
12
|
+
ProductDisplayType[ProductDisplayType["INLINE_ONLY"] = 1] = "INLINE_ONLY";
|
|
13
|
+
})(ProductDisplayType || (exports.ProductDisplayType = ProductDisplayType = {}));
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
import { BlockElement } from './blockElement';
|
|
8
|
+
import { ProductDisplayType } from './productDisplayType';
|
|
9
|
+
import { ProductImage } from './productImage';
|
|
10
|
+
import { Statistic } from './statistic';
|
|
11
|
+
export interface ProductElementFields {
|
|
12
|
+
productName?: string;
|
|
13
|
+
brandName?: string;
|
|
14
|
+
primaryHeading?: string;
|
|
15
|
+
secondaryHeading?: string;
|
|
16
|
+
starRating?: string;
|
|
17
|
+
primaryProductUrl?: string;
|
|
18
|
+
primaryCta?: string;
|
|
19
|
+
primaryRetailer?: string;
|
|
20
|
+
primaryPrice?: string;
|
|
21
|
+
secondaryProductUrl?: string;
|
|
22
|
+
secondaryCta?: string;
|
|
23
|
+
secondaryRetailer?: string;
|
|
24
|
+
secondaryPrice?: string;
|
|
25
|
+
statistics?: Statistic[];
|
|
26
|
+
image?: ProductImage;
|
|
27
|
+
content?: BlockElement[];
|
|
28
|
+
displayType: ProductDisplayType;
|
|
29
|
+
}
|
|
30
|
+
export declare class ProductElementFieldsSerde {
|
|
31
|
+
static read(protocol: TProtocol): ProductElementFields;
|
|
32
|
+
static write(protocol: TProtocol, value0: ProductElementFields): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,325 @@
|
|
|
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.ProductElementFieldsSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var blockElement_1 = require("./blockElement");
|
|
11
|
+
var productImage_1 = require("./productImage");
|
|
12
|
+
var statistic_1 = require("./statistic");
|
|
13
|
+
var ProductElementFieldsSerde = /** @class */ (function () {
|
|
14
|
+
function ProductElementFieldsSerde() {
|
|
15
|
+
}
|
|
16
|
+
ProductElementFieldsSerde.read = function (protocol) {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
protocol.readStructBegin();
|
|
19
|
+
var result = {};
|
|
20
|
+
while (true) {
|
|
21
|
+
var ret = protocol.readFieldBegin();
|
|
22
|
+
var ftype = ret.ftype;
|
|
23
|
+
var fid = ret.fid;
|
|
24
|
+
if (ftype === thrift_1.Thrift.Type.STOP) {
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
switch (fid) {
|
|
28
|
+
case 1:
|
|
29
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
30
|
+
var value1 = protocol.readString();
|
|
31
|
+
result.productName = value1;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
protocol.skip(ftype);
|
|
35
|
+
}
|
|
36
|
+
break;
|
|
37
|
+
case 2:
|
|
38
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
39
|
+
var value1 = protocol.readString();
|
|
40
|
+
result.brandName = value1;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
protocol.skip(ftype);
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
46
|
+
case 3:
|
|
47
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
48
|
+
var value1 = protocol.readString();
|
|
49
|
+
result.primaryHeading = value1;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
protocol.skip(ftype);
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
case 4:
|
|
56
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
57
|
+
var value1 = protocol.readString();
|
|
58
|
+
result.secondaryHeading = value1;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
protocol.skip(ftype);
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
case 5:
|
|
65
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
66
|
+
var value1 = protocol.readString();
|
|
67
|
+
result.starRating = value1;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
protocol.skip(ftype);
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
73
|
+
case 6:
|
|
74
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
75
|
+
var value1 = protocol.readString();
|
|
76
|
+
result.primaryProductUrl = value1;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
protocol.skip(ftype);
|
|
80
|
+
}
|
|
81
|
+
break;
|
|
82
|
+
case 7:
|
|
83
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
84
|
+
var value1 = protocol.readString();
|
|
85
|
+
result.primaryCta = value1;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
protocol.skip(ftype);
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
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
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
147
|
+
var listInfo1 = protocol.readListBegin();
|
|
148
|
+
var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
|
|
149
|
+
var value1 = [];
|
|
150
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
151
|
+
for (var i = 0; i < listSize1; i++) {
|
|
152
|
+
var value2 = statistic_1.StatisticSerde.read(protocol);
|
|
153
|
+
value1.push(value2);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
protocol.readListEnd();
|
|
157
|
+
result.statistics = value1;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
protocol.skip(ftype);
|
|
161
|
+
}
|
|
162
|
+
break;
|
|
163
|
+
case 15:
|
|
164
|
+
if (ftype === thrift_1.Thrift.Type.STRUCT) {
|
|
165
|
+
var value1 = productImage_1.ProductImageSerde.read(protocol);
|
|
166
|
+
result.image = value1;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
protocol.skip(ftype);
|
|
170
|
+
}
|
|
171
|
+
break;
|
|
172
|
+
case 16:
|
|
173
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
174
|
+
var listInfo1 = protocol.readListBegin();
|
|
175
|
+
var listSize1 = (_b = listInfo1.size) !== null && _b !== void 0 ? _b : 0;
|
|
176
|
+
var value1 = [];
|
|
177
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
178
|
+
for (var i = 0; i < listSize1; i++) {
|
|
179
|
+
var value2 = blockElement_1.BlockElementSerde.read(protocol);
|
|
180
|
+
value1.push(value2);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
protocol.readListEnd();
|
|
184
|
+
result.content = value1;
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
protocol.skip(ftype);
|
|
188
|
+
}
|
|
189
|
+
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
|
+
default:
|
|
200
|
+
protocol.skip(ftype);
|
|
201
|
+
}
|
|
202
|
+
protocol.readFieldEnd();
|
|
203
|
+
}
|
|
204
|
+
protocol.readStructEnd();
|
|
205
|
+
// @ts-ignore
|
|
206
|
+
return result;
|
|
207
|
+
};
|
|
208
|
+
ProductElementFieldsSerde.write = function (protocol, value0) {
|
|
209
|
+
protocol.writeStructBegin('ProductElementFields');
|
|
210
|
+
if (value0.productName !== null && value0.productName !== undefined) {
|
|
211
|
+
var value1 = value0.productName;
|
|
212
|
+
protocol.writeFieldBegin('productName', thrift_1.Thrift.Type.STRING, 1);
|
|
213
|
+
protocol.writeString(value1);
|
|
214
|
+
protocol.writeFieldEnd();
|
|
215
|
+
}
|
|
216
|
+
if (value0.brandName !== null && value0.brandName !== undefined) {
|
|
217
|
+
var value1 = value0.brandName;
|
|
218
|
+
protocol.writeFieldBegin('brandName', thrift_1.Thrift.Type.STRING, 2);
|
|
219
|
+
protocol.writeString(value1);
|
|
220
|
+
protocol.writeFieldEnd();
|
|
221
|
+
}
|
|
222
|
+
if (value0.primaryHeading !== null && value0.primaryHeading !== undefined) {
|
|
223
|
+
var value1 = value0.primaryHeading;
|
|
224
|
+
protocol.writeFieldBegin('primaryHeading', thrift_1.Thrift.Type.STRING, 3);
|
|
225
|
+
protocol.writeString(value1);
|
|
226
|
+
protocol.writeFieldEnd();
|
|
227
|
+
}
|
|
228
|
+
if (value0.secondaryHeading !== null && value0.secondaryHeading !== undefined) {
|
|
229
|
+
var value1 = value0.secondaryHeading;
|
|
230
|
+
protocol.writeFieldBegin('secondaryHeading', thrift_1.Thrift.Type.STRING, 4);
|
|
231
|
+
protocol.writeString(value1);
|
|
232
|
+
protocol.writeFieldEnd();
|
|
233
|
+
}
|
|
234
|
+
if (value0.starRating !== null && value0.starRating !== undefined) {
|
|
235
|
+
var value1 = value0.starRating;
|
|
236
|
+
protocol.writeFieldBegin('starRating', thrift_1.Thrift.Type.STRING, 5);
|
|
237
|
+
protocol.writeString(value1);
|
|
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);
|
|
274
|
+
protocol.writeFieldEnd();
|
|
275
|
+
}
|
|
276
|
+
if (value0.secondaryRetailer !== null && value0.secondaryRetailer !== undefined) {
|
|
277
|
+
var value1 = value0.secondaryRetailer;
|
|
278
|
+
protocol.writeFieldBegin('secondaryRetailer', thrift_1.Thrift.Type.STRING, 12);
|
|
279
|
+
protocol.writeString(value1);
|
|
280
|
+
protocol.writeFieldEnd();
|
|
281
|
+
}
|
|
282
|
+
if (value0.secondaryPrice !== null && value0.secondaryPrice !== undefined) {
|
|
283
|
+
var value1 = value0.secondaryPrice;
|
|
284
|
+
protocol.writeFieldBegin('secondaryPrice', thrift_1.Thrift.Type.STRING, 13);
|
|
285
|
+
protocol.writeString(value1);
|
|
286
|
+
protocol.writeFieldEnd();
|
|
287
|
+
}
|
|
288
|
+
if (value0.statistics !== null && value0.statistics !== undefined) {
|
|
289
|
+
var value1 = value0.statistics;
|
|
290
|
+
protocol.writeFieldBegin('statistics', thrift_1.Thrift.Type.LIST, 14);
|
|
291
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
292
|
+
value1.forEach(function (value2) {
|
|
293
|
+
statistic_1.StatisticSerde.write(protocol, value2);
|
|
294
|
+
});
|
|
295
|
+
protocol.writeListEnd();
|
|
296
|
+
protocol.writeFieldEnd();
|
|
297
|
+
}
|
|
298
|
+
if (value0.image !== null && value0.image !== undefined) {
|
|
299
|
+
var value1 = value0.image;
|
|
300
|
+
protocol.writeFieldBegin('image', thrift_1.Thrift.Type.STRUCT, 15);
|
|
301
|
+
productImage_1.ProductImageSerde.write(protocol, value1);
|
|
302
|
+
protocol.writeFieldEnd();
|
|
303
|
+
}
|
|
304
|
+
if (value0.content !== null && value0.content !== undefined) {
|
|
305
|
+
var value1 = value0.content;
|
|
306
|
+
protocol.writeFieldBegin('content', thrift_1.Thrift.Type.LIST, 16);
|
|
307
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
308
|
+
value1.forEach(function (value2) {
|
|
309
|
+
blockElement_1.BlockElementSerde.write(protocol, value2);
|
|
310
|
+
});
|
|
311
|
+
protocol.writeListEnd();
|
|
312
|
+
protocol.writeFieldEnd();
|
|
313
|
+
}
|
|
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
|
+
protocol.writeFieldStop();
|
|
321
|
+
protocol.writeStructEnd();
|
|
322
|
+
};
|
|
323
|
+
return ProductElementFieldsSerde;
|
|
324
|
+
}());
|
|
325
|
+
exports.ProductElementFieldsSerde = ProductElementFieldsSerde;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 ProductImage {
|
|
8
|
+
caption?: string;
|
|
9
|
+
displayCredit?: boolean;
|
|
10
|
+
source?: string;
|
|
11
|
+
photographer?: string;
|
|
12
|
+
alt?: string;
|
|
13
|
+
mediaId?: string;
|
|
14
|
+
file?: string;
|
|
15
|
+
suppliersReference?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class ProductImageSerde {
|
|
18
|
+
static read(protocol: TProtocol): ProductImage;
|
|
19
|
+
static write(protocol: TProtocol, value0: ProductImage): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
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.ProductImageSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var ProductImageSerde = /** @class */ (function () {
|
|
11
|
+
function ProductImageSerde() {
|
|
12
|
+
}
|
|
13
|
+
ProductImageSerde.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.caption = value1;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
protocol.skip(ftype);
|
|
31
|
+
}
|
|
32
|
+
break;
|
|
33
|
+
case 2:
|
|
34
|
+
if (ftype === thrift_1.Thrift.Type.BOOL) {
|
|
35
|
+
var value1 = protocol.readBool();
|
|
36
|
+
result.displayCredit = 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.source = 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.photographer = value1;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
protocol.skip(ftype);
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
case 5:
|
|
61
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
62
|
+
var value1 = protocol.readString();
|
|
63
|
+
result.alt = value1;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
protocol.skip(ftype);
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
case 6:
|
|
70
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
71
|
+
var value1 = protocol.readString();
|
|
72
|
+
result.mediaId = value1;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
protocol.skip(ftype);
|
|
76
|
+
}
|
|
77
|
+
break;
|
|
78
|
+
case 7:
|
|
79
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
80
|
+
var value1 = protocol.readString();
|
|
81
|
+
result.file = value1;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
protocol.skip(ftype);
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
case 8:
|
|
88
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
89
|
+
var value1 = protocol.readString();
|
|
90
|
+
result.suppliersReference = value1;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
protocol.skip(ftype);
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
default:
|
|
97
|
+
protocol.skip(ftype);
|
|
98
|
+
}
|
|
99
|
+
protocol.readFieldEnd();
|
|
100
|
+
}
|
|
101
|
+
protocol.readStructEnd();
|
|
102
|
+
// @ts-ignore
|
|
103
|
+
return result;
|
|
104
|
+
};
|
|
105
|
+
ProductImageSerde.write = function (protocol, value0) {
|
|
106
|
+
protocol.writeStructBegin('ProductImage');
|
|
107
|
+
if (value0.caption !== null && value0.caption !== undefined) {
|
|
108
|
+
var value1 = value0.caption;
|
|
109
|
+
protocol.writeFieldBegin('caption', thrift_1.Thrift.Type.STRING, 1);
|
|
110
|
+
protocol.writeString(value1);
|
|
111
|
+
protocol.writeFieldEnd();
|
|
112
|
+
}
|
|
113
|
+
if (value0.displayCredit !== null && value0.displayCredit !== undefined) {
|
|
114
|
+
var value1 = value0.displayCredit;
|
|
115
|
+
protocol.writeFieldBegin('displayCredit', thrift_1.Thrift.Type.BOOL, 2);
|
|
116
|
+
protocol.writeBool(value1);
|
|
117
|
+
protocol.writeFieldEnd();
|
|
118
|
+
}
|
|
119
|
+
if (value0.source !== null && value0.source !== undefined) {
|
|
120
|
+
var value1 = value0.source;
|
|
121
|
+
protocol.writeFieldBegin('source', thrift_1.Thrift.Type.STRING, 3);
|
|
122
|
+
protocol.writeString(value1);
|
|
123
|
+
protocol.writeFieldEnd();
|
|
124
|
+
}
|
|
125
|
+
if (value0.photographer !== null && value0.photographer !== undefined) {
|
|
126
|
+
var value1 = value0.photographer;
|
|
127
|
+
protocol.writeFieldBegin('photographer', thrift_1.Thrift.Type.STRING, 4);
|
|
128
|
+
protocol.writeString(value1);
|
|
129
|
+
protocol.writeFieldEnd();
|
|
130
|
+
}
|
|
131
|
+
if (value0.alt !== null && value0.alt !== undefined) {
|
|
132
|
+
var value1 = value0.alt;
|
|
133
|
+
protocol.writeFieldBegin('alt', thrift_1.Thrift.Type.STRING, 5);
|
|
134
|
+
protocol.writeString(value1);
|
|
135
|
+
protocol.writeFieldEnd();
|
|
136
|
+
}
|
|
137
|
+
if (value0.mediaId !== null && value0.mediaId !== undefined) {
|
|
138
|
+
var value1 = value0.mediaId;
|
|
139
|
+
protocol.writeFieldBegin('mediaId', thrift_1.Thrift.Type.STRING, 6);
|
|
140
|
+
protocol.writeString(value1);
|
|
141
|
+
protocol.writeFieldEnd();
|
|
142
|
+
}
|
|
143
|
+
if (value0.file !== null && value0.file !== undefined) {
|
|
144
|
+
var value1 = value0.file;
|
|
145
|
+
protocol.writeFieldBegin('file', thrift_1.Thrift.Type.STRING, 7);
|
|
146
|
+
protocol.writeString(value1);
|
|
147
|
+
protocol.writeFieldEnd();
|
|
148
|
+
}
|
|
149
|
+
if (value0.suppliersReference !== null && value0.suppliersReference !== undefined) {
|
|
150
|
+
var value1 = value0.suppliersReference;
|
|
151
|
+
protocol.writeFieldBegin('suppliersReference', thrift_1.Thrift.Type.STRING, 8);
|
|
152
|
+
protocol.writeString(value1);
|
|
153
|
+
protocol.writeFieldEnd();
|
|
154
|
+
}
|
|
155
|
+
protocol.writeFieldStop();
|
|
156
|
+
protocol.writeStructEnd();
|
|
157
|
+
};
|
|
158
|
+
return ProductImageSerde;
|
|
159
|
+
}());
|
|
160
|
+
exports.ProductImageSerde = ProductImageSerde;
|
|
@@ -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 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
|
+
}
|
package/v1/statistic.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
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.StatisticSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var StatisticSerde = /** @class */ (function () {
|
|
11
|
+
function StatisticSerde() {
|
|
12
|
+
}
|
|
13
|
+
StatisticSerde.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.name = 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.value = value1;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
protocol.skip(ftype);
|
|
40
|
+
}
|
|
41
|
+
break;
|
|
42
|
+
default:
|
|
43
|
+
protocol.skip(ftype);
|
|
44
|
+
}
|
|
45
|
+
protocol.readFieldEnd();
|
|
46
|
+
}
|
|
47
|
+
protocol.readStructEnd();
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
StatisticSerde.write = function (protocol, value0) {
|
|
52
|
+
protocol.writeStructBegin('Statistic');
|
|
53
|
+
if (value0.name !== null && value0.name !== undefined) {
|
|
54
|
+
var value1 = value0.name;
|
|
55
|
+
protocol.writeFieldBegin('name', thrift_1.Thrift.Type.STRING, 1);
|
|
56
|
+
protocol.writeString(value1);
|
|
57
|
+
protocol.writeFieldEnd();
|
|
58
|
+
}
|
|
59
|
+
if (value0.value !== null && value0.value !== undefined) {
|
|
60
|
+
var value1 = value0.value;
|
|
61
|
+
protocol.writeFieldBegin('value', thrift_1.Thrift.Type.STRING, 2);
|
|
62
|
+
protocol.writeString(value1);
|
|
63
|
+
protocol.writeFieldEnd();
|
|
64
|
+
}
|
|
65
|
+
protocol.writeFieldStop();
|
|
66
|
+
protocol.writeStructEnd();
|
|
67
|
+
};
|
|
68
|
+
return StatisticSerde;
|
|
69
|
+
}());
|
|
70
|
+
exports.StatisticSerde = StatisticSerde;
|