@guardian/content-api-models 43.0.0 → 44.0.0
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/assetFields.d.ts +2 -0
- package/v1/assetFields.js +30 -1
- package/v1/blockElement.d.ts +2 -0
- package/v1/blockElement.js +16 -0
- package/v1/colorScheme.d.ts +9 -0
- package/v1/colorScheme.js +13 -0
- package/v1/elementType.d.ts +2 -1
- package/v1/elementType.js +1 -0
- package/v1/interactiveElementFields.d.ts +2 -0
- package/v1/interactiveElementFields.js +30 -0
- package/v1/responsiveImageElementFields.d.ts +21 -0
- package/v1/responsiveImageElementFields.js +172 -0
- package/v1/responsiveImageVariant.d.ts +17 -0
- package/v1/responsiveImageVariant.js +97 -0
- package/v1/responsiveImageVariantImage.d.ts +17 -0
- package/v1/responsiveImageVariantImage.js +112 -0
package/package.json
CHANGED
package/v1/assetFields.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { TProtocol } from 'thrift';
|
|
|
7
7
|
import Int64 from 'node-int64';
|
|
8
8
|
import { CapiDateTime } from './capiDateTime';
|
|
9
9
|
import { CartoonVariant } from './cartoonVariant';
|
|
10
|
+
import { ResponsiveImageVariant } from './responsiveImageVariant';
|
|
10
11
|
export interface AssetFields {
|
|
11
12
|
aspectRatio?: string;
|
|
12
13
|
altText?: string;
|
|
@@ -79,6 +80,7 @@ export interface AssetFields {
|
|
|
79
80
|
isMandatory?: boolean;
|
|
80
81
|
cartoonVariants?: CartoonVariant[];
|
|
81
82
|
secureFileWithAds?: string;
|
|
83
|
+
responsiveImageVariants?: ResponsiveImageVariant[];
|
|
82
84
|
}
|
|
83
85
|
export declare class AssetFieldsSerde {
|
|
84
86
|
static read(protocol: TProtocol): AssetFields;
|
package/v1/assetFields.js
CHANGED
|
@@ -9,9 +9,10 @@ exports.AssetFieldsSerde = void 0;
|
|
|
9
9
|
const thrift_1 = require("thrift");
|
|
10
10
|
const capiDateTime_1 = require("./capiDateTime");
|
|
11
11
|
const cartoonVariant_1 = require("./cartoonVariant");
|
|
12
|
+
const responsiveImageVariant_1 = require("./responsiveImageVariant");
|
|
12
13
|
class AssetFieldsSerde {
|
|
13
14
|
static read(protocol) {
|
|
14
|
-
var _a;
|
|
15
|
+
var _a, _b;
|
|
15
16
|
protocol.readStructBegin();
|
|
16
17
|
const result = {};
|
|
17
18
|
while (true) {
|
|
@@ -670,6 +671,24 @@ class AssetFieldsSerde {
|
|
|
670
671
|
protocol.skip(ftype);
|
|
671
672
|
}
|
|
672
673
|
break;
|
|
674
|
+
case 72:
|
|
675
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
676
|
+
const listInfo1 = protocol.readListBegin();
|
|
677
|
+
const listSize1 = (_b = listInfo1.size) !== null && _b !== void 0 ? _b : 0;
|
|
678
|
+
const value1 = [];
|
|
679
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
680
|
+
for (let i = 0; i < listSize1; i++) {
|
|
681
|
+
const value2 = responsiveImageVariant_1.ResponsiveImageVariantSerde.read(protocol);
|
|
682
|
+
value1.push(value2);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
protocol.readListEnd();
|
|
686
|
+
result.responsiveImageVariants = value1;
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
protocol.skip(ftype);
|
|
690
|
+
}
|
|
691
|
+
break;
|
|
673
692
|
default:
|
|
674
693
|
protocol.skip(ftype);
|
|
675
694
|
}
|
|
@@ -1111,6 +1130,16 @@ class AssetFieldsSerde {
|
|
|
1111
1130
|
protocol.writeString(value1);
|
|
1112
1131
|
protocol.writeFieldEnd();
|
|
1113
1132
|
}
|
|
1133
|
+
if (value0.responsiveImageVariants !== null && value0.responsiveImageVariants !== undefined) {
|
|
1134
|
+
const value1 = value0.responsiveImageVariants;
|
|
1135
|
+
protocol.writeFieldBegin('responsiveImageVariants', thrift_1.Thrift.Type.LIST, 72);
|
|
1136
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
1137
|
+
value1.forEach(value2 => {
|
|
1138
|
+
responsiveImageVariant_1.ResponsiveImageVariantSerde.write(protocol, value2);
|
|
1139
|
+
});
|
|
1140
|
+
protocol.writeListEnd();
|
|
1141
|
+
protocol.writeFieldEnd();
|
|
1142
|
+
}
|
|
1114
1143
|
protocol.writeFieldStop();
|
|
1115
1144
|
protocol.writeStructEnd();
|
|
1116
1145
|
}
|
package/v1/blockElement.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { MembershipElementFields } from './membershipElementFields';
|
|
|
23
23
|
import { ProductElementFields } from './productElementFields';
|
|
24
24
|
import { PullquoteElementFields } from './pullquoteElementFields';
|
|
25
25
|
import { RecipeElementFields } from './recipeElementFields';
|
|
26
|
+
import { ResponsiveImageElementFields } from './responsiveImageElementFields';
|
|
26
27
|
import { RichLinkElementFields } from './richLinkElementFields';
|
|
27
28
|
import { StandardElementFields } from './standardElementFields';
|
|
28
29
|
import { TextElementFields } from './textElementFields';
|
|
@@ -61,6 +62,7 @@ export interface BlockElement {
|
|
|
61
62
|
timelineTypeData?: TimelineElementFields;
|
|
62
63
|
linkTypeData?: LinkElementFields;
|
|
63
64
|
productTypeData?: ProductElementFields;
|
|
65
|
+
responsiveImageTypeData?: ResponsiveImageElementFields;
|
|
64
66
|
}
|
|
65
67
|
export declare class BlockElementSerde {
|
|
66
68
|
static read(protocol: TProtocol): BlockElement;
|
package/v1/blockElement.js
CHANGED
|
@@ -25,6 +25,7 @@ const membershipElementFields_1 = require("./membershipElementFields");
|
|
|
25
25
|
const productElementFields_1 = require("./productElementFields");
|
|
26
26
|
const pullquoteElementFields_1 = require("./pullquoteElementFields");
|
|
27
27
|
const recipeElementFields_1 = require("./recipeElementFields");
|
|
28
|
+
const responsiveImageElementFields_1 = require("./responsiveImageElementFields");
|
|
28
29
|
const richLinkElementFields_1 = require("./richLinkElementFields");
|
|
29
30
|
const standardElementFields_1 = require("./standardElementFields");
|
|
30
31
|
const textElementFields_1 = require("./textElementFields");
|
|
@@ -316,6 +317,15 @@ class BlockElementSerde {
|
|
|
316
317
|
protocol.skip(ftype);
|
|
317
318
|
}
|
|
318
319
|
break;
|
|
320
|
+
case 30:
|
|
321
|
+
if (ftype === thrift_1.Thrift.Type.STRUCT) {
|
|
322
|
+
const value1 = responsiveImageElementFields_1.ResponsiveImageElementFieldsSerde.read(protocol);
|
|
323
|
+
result.responsiveImageTypeData = value1;
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
protocol.skip(ftype);
|
|
327
|
+
}
|
|
328
|
+
break;
|
|
319
329
|
default:
|
|
320
330
|
protocol.skip(ftype);
|
|
321
331
|
}
|
|
@@ -505,6 +515,12 @@ class BlockElementSerde {
|
|
|
505
515
|
productElementFields_1.ProductElementFieldsSerde.write(protocol, value1);
|
|
506
516
|
protocol.writeFieldEnd();
|
|
507
517
|
}
|
|
518
|
+
if (value0.responsiveImageTypeData !== null && value0.responsiveImageTypeData !== undefined) {
|
|
519
|
+
const value1 = value0.responsiveImageTypeData;
|
|
520
|
+
protocol.writeFieldBegin('responsiveImageTypeData', thrift_1.Thrift.Type.STRUCT, 30);
|
|
521
|
+
responsiveImageElementFields_1.ResponsiveImageElementFieldsSerde.write(protocol, value1);
|
|
522
|
+
protocol.writeFieldEnd();
|
|
523
|
+
}
|
|
508
524
|
protocol.writeFieldStop();
|
|
509
525
|
protocol.writeStructEnd();
|
|
510
526
|
}
|
|
@@ -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.ColorScheme = void 0;
|
|
9
|
+
var ColorScheme;
|
|
10
|
+
(function (ColorScheme) {
|
|
11
|
+
ColorScheme[ColorScheme["LIGHT"] = 0] = "LIGHT";
|
|
12
|
+
ColorScheme[ColorScheme["DARK"] = 1] = "DARK";
|
|
13
|
+
})(ColorScheme || (exports.ColorScheme = ColorScheme = {}));
|
package/v1/elementType.d.ts
CHANGED
package/v1/elementType.js
CHANGED
|
@@ -35,4 +35,5 @@ var ElementType;
|
|
|
35
35
|
ElementType[ElementType["TIMELINE"] = 24] = "TIMELINE";
|
|
36
36
|
ElementType[ElementType["LINK"] = 25] = "LINK";
|
|
37
37
|
ElementType[ElementType["PRODUCT"] = 26] = "PRODUCT";
|
|
38
|
+
ElementType[ElementType["RESPONSIVE_IMAGE"] = 27] = "RESPONSIVE_IMAGE";
|
|
38
39
|
})(ElementType || (exports.ElementType = ElementType = {}));
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
5
5
|
*/
|
|
6
6
|
import { TProtocol } from 'thrift';
|
|
7
|
+
import { BlockElement } from './blockElement';
|
|
7
8
|
export interface InteractiveElementFields {
|
|
8
9
|
url?: string;
|
|
9
10
|
originalUrl?: string;
|
|
@@ -17,6 +18,7 @@ export interface InteractiveElementFields {
|
|
|
17
18
|
role?: string;
|
|
18
19
|
isMandatory?: boolean;
|
|
19
20
|
sourceDomain?: string;
|
|
21
|
+
fallbackContent?: BlockElement[];
|
|
20
22
|
}
|
|
21
23
|
export declare class InteractiveElementFieldsSerde {
|
|
22
24
|
static read(protocol: TProtocol): InteractiveElementFields;
|
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.InteractiveElementFieldsSerde = void 0;
|
|
9
9
|
const thrift_1 = require("thrift");
|
|
10
|
+
const blockElement_1 = require("./blockElement");
|
|
10
11
|
class InteractiveElementFieldsSerde {
|
|
11
12
|
static read(protocol) {
|
|
13
|
+
var _a;
|
|
12
14
|
protocol.readStructBegin();
|
|
13
15
|
const result = {};
|
|
14
16
|
while (true) {
|
|
@@ -127,6 +129,24 @@ class InteractiveElementFieldsSerde {
|
|
|
127
129
|
protocol.skip(ftype);
|
|
128
130
|
}
|
|
129
131
|
break;
|
|
132
|
+
case 15:
|
|
133
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
134
|
+
const listInfo1 = protocol.readListBegin();
|
|
135
|
+
const listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
|
|
136
|
+
const value1 = [];
|
|
137
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
138
|
+
for (let i = 0; i < listSize1; i++) {
|
|
139
|
+
const value2 = blockElement_1.BlockElementSerde.read(protocol);
|
|
140
|
+
value1.push(value2);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
protocol.readListEnd();
|
|
144
|
+
result.fallbackContent = value1;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
protocol.skip(ftype);
|
|
148
|
+
}
|
|
149
|
+
break;
|
|
130
150
|
default:
|
|
131
151
|
protocol.skip(ftype);
|
|
132
152
|
}
|
|
@@ -210,6 +230,16 @@ class InteractiveElementFieldsSerde {
|
|
|
210
230
|
protocol.writeString(value1);
|
|
211
231
|
protocol.writeFieldEnd();
|
|
212
232
|
}
|
|
233
|
+
if (value0.fallbackContent !== null && value0.fallbackContent !== undefined) {
|
|
234
|
+
const value1 = value0.fallbackContent;
|
|
235
|
+
protocol.writeFieldBegin('fallbackContent', thrift_1.Thrift.Type.LIST, 15);
|
|
236
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
237
|
+
value1.forEach(value2 => {
|
|
238
|
+
blockElement_1.BlockElementSerde.write(protocol, value2);
|
|
239
|
+
});
|
|
240
|
+
protocol.writeListEnd();
|
|
241
|
+
protocol.writeFieldEnd();
|
|
242
|
+
}
|
|
213
243
|
protocol.writeFieldStop();
|
|
214
244
|
protocol.writeStructEnd();
|
|
215
245
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { ResponsiveImageVariant } from './responsiveImageVariant';
|
|
8
|
+
export interface ResponsiveImageElementFields {
|
|
9
|
+
responsiveImageVariants?: ResponsiveImageVariant[];
|
|
10
|
+
role?: string;
|
|
11
|
+
photographer?: string;
|
|
12
|
+
caption?: string;
|
|
13
|
+
alt?: string;
|
|
14
|
+
source?: string;
|
|
15
|
+
displayCredit?: boolean;
|
|
16
|
+
imageType?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class ResponsiveImageElementFieldsSerde {
|
|
19
|
+
static read(protocol: TProtocol): ResponsiveImageElementFields;
|
|
20
|
+
static write(protocol: TProtocol, value0: ResponsiveImageElementFields): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
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.ResponsiveImageElementFieldsSerde = void 0;
|
|
9
|
+
const thrift_1 = require("thrift");
|
|
10
|
+
const responsiveImageVariant_1 = require("./responsiveImageVariant");
|
|
11
|
+
class ResponsiveImageElementFieldsSerde {
|
|
12
|
+
static read(protocol) {
|
|
13
|
+
var _a;
|
|
14
|
+
protocol.readStructBegin();
|
|
15
|
+
const result = {};
|
|
16
|
+
while (true) {
|
|
17
|
+
const ret = protocol.readFieldBegin();
|
|
18
|
+
const ftype = ret.ftype;
|
|
19
|
+
const 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.LIST) {
|
|
26
|
+
const listInfo1 = protocol.readListBegin();
|
|
27
|
+
const listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
|
|
28
|
+
const value1 = [];
|
|
29
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
30
|
+
for (let i = 0; i < listSize1; i++) {
|
|
31
|
+
const value2 = responsiveImageVariant_1.ResponsiveImageVariantSerde.read(protocol);
|
|
32
|
+
value1.push(value2);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
protocol.readListEnd();
|
|
36
|
+
result.responsiveImageVariants = value1;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
protocol.skip(ftype);
|
|
40
|
+
}
|
|
41
|
+
break;
|
|
42
|
+
case 2:
|
|
43
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
44
|
+
const value1 = protocol.readString();
|
|
45
|
+
result.role = value1;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
protocol.skip(ftype);
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
case 3:
|
|
52
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
53
|
+
const value1 = protocol.readString();
|
|
54
|
+
result.photographer = value1;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
protocol.skip(ftype);
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
case 4:
|
|
61
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
62
|
+
const value1 = protocol.readString();
|
|
63
|
+
result.caption = value1;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
protocol.skip(ftype);
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
case 5:
|
|
70
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
71
|
+
const value1 = protocol.readString();
|
|
72
|
+
result.alt = value1;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
protocol.skip(ftype);
|
|
76
|
+
}
|
|
77
|
+
break;
|
|
78
|
+
case 6:
|
|
79
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
80
|
+
const value1 = protocol.readString();
|
|
81
|
+
result.source = value1;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
protocol.skip(ftype);
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
case 7:
|
|
88
|
+
if (ftype === thrift_1.Thrift.Type.BOOL) {
|
|
89
|
+
const value1 = protocol.readBool();
|
|
90
|
+
result.displayCredit = value1;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
protocol.skip(ftype);
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
case 8:
|
|
97
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
98
|
+
const value1 = protocol.readString();
|
|
99
|
+
result.imageType = value1;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
protocol.skip(ftype);
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
default:
|
|
106
|
+
protocol.skip(ftype);
|
|
107
|
+
}
|
|
108
|
+
protocol.readFieldEnd();
|
|
109
|
+
}
|
|
110
|
+
protocol.readStructEnd();
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
return result;
|
|
113
|
+
}
|
|
114
|
+
static write(protocol, value0) {
|
|
115
|
+
protocol.writeStructBegin('ResponsiveImageElementFields');
|
|
116
|
+
if (value0.responsiveImageVariants !== null && value0.responsiveImageVariants !== undefined) {
|
|
117
|
+
const value1 = value0.responsiveImageVariants;
|
|
118
|
+
protocol.writeFieldBegin('responsiveImageVariants', thrift_1.Thrift.Type.LIST, 1);
|
|
119
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
120
|
+
value1.forEach(value2 => {
|
|
121
|
+
responsiveImageVariant_1.ResponsiveImageVariantSerde.write(protocol, value2);
|
|
122
|
+
});
|
|
123
|
+
protocol.writeListEnd();
|
|
124
|
+
protocol.writeFieldEnd();
|
|
125
|
+
}
|
|
126
|
+
if (value0.role !== null && value0.role !== undefined) {
|
|
127
|
+
const value1 = value0.role;
|
|
128
|
+
protocol.writeFieldBegin('role', thrift_1.Thrift.Type.STRING, 2);
|
|
129
|
+
protocol.writeString(value1);
|
|
130
|
+
protocol.writeFieldEnd();
|
|
131
|
+
}
|
|
132
|
+
if (value0.photographer !== null && value0.photographer !== undefined) {
|
|
133
|
+
const value1 = value0.photographer;
|
|
134
|
+
protocol.writeFieldBegin('photographer', thrift_1.Thrift.Type.STRING, 3);
|
|
135
|
+
protocol.writeString(value1);
|
|
136
|
+
protocol.writeFieldEnd();
|
|
137
|
+
}
|
|
138
|
+
if (value0.caption !== null && value0.caption !== undefined) {
|
|
139
|
+
const value1 = value0.caption;
|
|
140
|
+
protocol.writeFieldBegin('caption', thrift_1.Thrift.Type.STRING, 4);
|
|
141
|
+
protocol.writeString(value1);
|
|
142
|
+
protocol.writeFieldEnd();
|
|
143
|
+
}
|
|
144
|
+
if (value0.alt !== null && value0.alt !== undefined) {
|
|
145
|
+
const value1 = value0.alt;
|
|
146
|
+
protocol.writeFieldBegin('alt', thrift_1.Thrift.Type.STRING, 5);
|
|
147
|
+
protocol.writeString(value1);
|
|
148
|
+
protocol.writeFieldEnd();
|
|
149
|
+
}
|
|
150
|
+
if (value0.source !== null && value0.source !== undefined) {
|
|
151
|
+
const value1 = value0.source;
|
|
152
|
+
protocol.writeFieldBegin('source', thrift_1.Thrift.Type.STRING, 6);
|
|
153
|
+
protocol.writeString(value1);
|
|
154
|
+
protocol.writeFieldEnd();
|
|
155
|
+
}
|
|
156
|
+
if (value0.displayCredit !== null && value0.displayCredit !== undefined) {
|
|
157
|
+
const value1 = value0.displayCredit;
|
|
158
|
+
protocol.writeFieldBegin('displayCredit', thrift_1.Thrift.Type.BOOL, 7);
|
|
159
|
+
protocol.writeBool(value1);
|
|
160
|
+
protocol.writeFieldEnd();
|
|
161
|
+
}
|
|
162
|
+
if (value0.imageType !== null && value0.imageType !== undefined) {
|
|
163
|
+
const value1 = value0.imageType;
|
|
164
|
+
protocol.writeFieldBegin('imageType', thrift_1.Thrift.Type.STRING, 8);
|
|
165
|
+
protocol.writeString(value1);
|
|
166
|
+
protocol.writeFieldEnd();
|
|
167
|
+
}
|
|
168
|
+
protocol.writeFieldStop();
|
|
169
|
+
protocol.writeStructEnd();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
exports.ResponsiveImageElementFieldsSerde = ResponsiveImageElementFieldsSerde;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 { ColorScheme } from './colorScheme';
|
|
8
|
+
import { ResponsiveImageVariantImage } from './responsiveImageVariantImage';
|
|
9
|
+
export interface ResponsiveImageVariant {
|
|
10
|
+
viewportSize: string;
|
|
11
|
+
images: ResponsiveImageVariantImage[];
|
|
12
|
+
colorScheme?: ColorScheme;
|
|
13
|
+
}
|
|
14
|
+
export declare class ResponsiveImageVariantSerde {
|
|
15
|
+
static read(protocol: TProtocol): ResponsiveImageVariant;
|
|
16
|
+
static write(protocol: TProtocol, value0: ResponsiveImageVariant): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
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.ResponsiveImageVariantSerde = void 0;
|
|
9
|
+
const thrift_1 = require("thrift");
|
|
10
|
+
const responsiveImageVariantImage_1 = require("./responsiveImageVariantImage");
|
|
11
|
+
class ResponsiveImageVariantSerde {
|
|
12
|
+
static read(protocol) {
|
|
13
|
+
var _a;
|
|
14
|
+
protocol.readStructBegin();
|
|
15
|
+
const result = {};
|
|
16
|
+
while (true) {
|
|
17
|
+
const ret = protocol.readFieldBegin();
|
|
18
|
+
const ftype = ret.ftype;
|
|
19
|
+
const 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
|
+
const value1 = protocol.readString();
|
|
27
|
+
result.viewportSize = value1;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
protocol.skip(ftype);
|
|
31
|
+
}
|
|
32
|
+
break;
|
|
33
|
+
case 2:
|
|
34
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
35
|
+
const listInfo1 = protocol.readListBegin();
|
|
36
|
+
const listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
|
|
37
|
+
const value1 = [];
|
|
38
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
39
|
+
for (let i = 0; i < listSize1; i++) {
|
|
40
|
+
const value2 = responsiveImageVariantImage_1.ResponsiveImageVariantImageSerde.read(protocol);
|
|
41
|
+
value1.push(value2);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
protocol.readListEnd();
|
|
45
|
+
result.images = value1;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
protocol.skip(ftype);
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
case 3:
|
|
52
|
+
if (ftype === thrift_1.Thrift.Type.I32) {
|
|
53
|
+
const value1 = protocol.readI32();
|
|
54
|
+
result.colorScheme = 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
|
+
static write(protocol, value0) {
|
|
70
|
+
protocol.writeStructBegin('ResponsiveImageVariant');
|
|
71
|
+
if (value0.viewportSize !== null && value0.viewportSize !== undefined) {
|
|
72
|
+
const value1 = value0.viewportSize;
|
|
73
|
+
protocol.writeFieldBegin('viewportSize', thrift_1.Thrift.Type.STRING, 1);
|
|
74
|
+
protocol.writeString(value1);
|
|
75
|
+
protocol.writeFieldEnd();
|
|
76
|
+
}
|
|
77
|
+
if (value0.images !== null && value0.images !== undefined) {
|
|
78
|
+
const value1 = value0.images;
|
|
79
|
+
protocol.writeFieldBegin('images', thrift_1.Thrift.Type.LIST, 2);
|
|
80
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
81
|
+
value1.forEach(value2 => {
|
|
82
|
+
responsiveImageVariantImage_1.ResponsiveImageVariantImageSerde.write(protocol, value2);
|
|
83
|
+
});
|
|
84
|
+
protocol.writeListEnd();
|
|
85
|
+
protocol.writeFieldEnd();
|
|
86
|
+
}
|
|
87
|
+
if (value0.colorScheme !== null && value0.colorScheme !== undefined) {
|
|
88
|
+
const value1 = value0.colorScheme;
|
|
89
|
+
protocol.writeFieldBegin('colorScheme', thrift_1.Thrift.Type.I32, 3);
|
|
90
|
+
protocol.writeI32(value1);
|
|
91
|
+
protocol.writeFieldEnd();
|
|
92
|
+
}
|
|
93
|
+
protocol.writeFieldStop();
|
|
94
|
+
protocol.writeStructEnd();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.ResponsiveImageVariantSerde = ResponsiveImageVariantSerde;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 ResponsiveImageVariantImage {
|
|
8
|
+
mimeType: string;
|
|
9
|
+
file: string;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
mediaId?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class ResponsiveImageVariantImageSerde {
|
|
15
|
+
static read(protocol: TProtocol): ResponsiveImageVariantImage;
|
|
16
|
+
static write(protocol: TProtocol, value0: ResponsiveImageVariantImage): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
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.ResponsiveImageVariantImageSerde = void 0;
|
|
9
|
+
const thrift_1 = require("thrift");
|
|
10
|
+
class ResponsiveImageVariantImageSerde {
|
|
11
|
+
static read(protocol) {
|
|
12
|
+
protocol.readStructBegin();
|
|
13
|
+
const result = {};
|
|
14
|
+
while (true) {
|
|
15
|
+
const ret = protocol.readFieldBegin();
|
|
16
|
+
const ftype = ret.ftype;
|
|
17
|
+
const fid = ret.fid;
|
|
18
|
+
if (ftype === thrift_1.Thrift.Type.STOP) {
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
switch (fid) {
|
|
22
|
+
case 1:
|
|
23
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
24
|
+
const value1 = protocol.readString();
|
|
25
|
+
result.mimeType = value1;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
protocol.skip(ftype);
|
|
29
|
+
}
|
|
30
|
+
break;
|
|
31
|
+
case 2:
|
|
32
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
33
|
+
const value1 = protocol.readString();
|
|
34
|
+
result.file = value1;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
protocol.skip(ftype);
|
|
38
|
+
}
|
|
39
|
+
break;
|
|
40
|
+
case 3:
|
|
41
|
+
if (ftype === thrift_1.Thrift.Type.I32) {
|
|
42
|
+
const value1 = protocol.readI32();
|
|
43
|
+
result.width = value1;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
protocol.skip(ftype);
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
case 4:
|
|
50
|
+
if (ftype === thrift_1.Thrift.Type.I32) {
|
|
51
|
+
const value1 = protocol.readI32();
|
|
52
|
+
result.height = value1;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
protocol.skip(ftype);
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
case 5:
|
|
59
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
60
|
+
const value1 = protocol.readString();
|
|
61
|
+
result.mediaId = value1;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
protocol.skip(ftype);
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
default:
|
|
68
|
+
protocol.skip(ftype);
|
|
69
|
+
}
|
|
70
|
+
protocol.readFieldEnd();
|
|
71
|
+
}
|
|
72
|
+
protocol.readStructEnd();
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
static write(protocol, value0) {
|
|
77
|
+
protocol.writeStructBegin('ResponsiveImageVariantImage');
|
|
78
|
+
if (value0.mimeType !== null && value0.mimeType !== undefined) {
|
|
79
|
+
const value1 = value0.mimeType;
|
|
80
|
+
protocol.writeFieldBegin('mimeType', thrift_1.Thrift.Type.STRING, 1);
|
|
81
|
+
protocol.writeString(value1);
|
|
82
|
+
protocol.writeFieldEnd();
|
|
83
|
+
}
|
|
84
|
+
if (value0.file !== null && value0.file !== undefined) {
|
|
85
|
+
const value1 = value0.file;
|
|
86
|
+
protocol.writeFieldBegin('file', thrift_1.Thrift.Type.STRING, 2);
|
|
87
|
+
protocol.writeString(value1);
|
|
88
|
+
protocol.writeFieldEnd();
|
|
89
|
+
}
|
|
90
|
+
if (value0.width !== null && value0.width !== undefined) {
|
|
91
|
+
const value1 = value0.width;
|
|
92
|
+
protocol.writeFieldBegin('width', thrift_1.Thrift.Type.I32, 3);
|
|
93
|
+
protocol.writeI32(value1);
|
|
94
|
+
protocol.writeFieldEnd();
|
|
95
|
+
}
|
|
96
|
+
if (value0.height !== null && value0.height !== undefined) {
|
|
97
|
+
const value1 = value0.height;
|
|
98
|
+
protocol.writeFieldBegin('height', thrift_1.Thrift.Type.I32, 4);
|
|
99
|
+
protocol.writeI32(value1);
|
|
100
|
+
protocol.writeFieldEnd();
|
|
101
|
+
}
|
|
102
|
+
if (value0.mediaId !== null && value0.mediaId !== undefined) {
|
|
103
|
+
const value1 = value0.mediaId;
|
|
104
|
+
protocol.writeFieldBegin('mediaId', thrift_1.Thrift.Type.STRING, 5);
|
|
105
|
+
protocol.writeString(value1);
|
|
106
|
+
protocol.writeFieldEnd();
|
|
107
|
+
}
|
|
108
|
+
protocol.writeFieldStop();
|
|
109
|
+
protocol.writeStructEnd();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.ResponsiveImageVariantImageSerde = ResponsiveImageVariantImageSerde;
|