@guardian/content-api-models 17.6.2 → 17.7.0-beta.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 +3 -0
- package/v1/assetFields.js +45 -0
- package/v1/assetType.d.ts +2 -1
- package/v1/assetType.js +1 -0
- package/v1/blockElement.d.ts +2 -0
- package/v1/blockElement.js +16 -0
- package/v1/cartoonElementFields.d.ts +20 -0
- package/v1/cartoonElementFields.js +160 -0
- package/v1/cartoonImage.d.ts +17 -0
- package/v1/cartoonImage.js +115 -0
- package/v1/cartoonVariant.d.ts +15 -0
- package/v1/cartoonVariant.js +85 -0
- package/v1/elementType.d.ts +2 -1
- package/v1/elementType.js +1 -0
package/package.json
CHANGED
package/v1/assetFields.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { TProtocol } from 'thrift';
|
|
7
7
|
import Int64 from 'node-int64';
|
|
8
8
|
import { CapiDateTime } from './capiDateTime';
|
|
9
|
+
import { CartoonVariant } from './cartoonVariant';
|
|
9
10
|
export interface AssetFields {
|
|
10
11
|
aspectRatio?: string;
|
|
11
12
|
altText?: string;
|
|
@@ -75,6 +76,8 @@ export interface AssetFields {
|
|
|
75
76
|
start?: CapiDateTime;
|
|
76
77
|
end?: CapiDateTime;
|
|
77
78
|
safeEmbedCode?: boolean;
|
|
79
|
+
isMandatory?: boolean;
|
|
80
|
+
cartoonVariants?: CartoonVariant[];
|
|
78
81
|
}
|
|
79
82
|
export declare class AssetFieldsSerde {
|
|
80
83
|
static read(protocol: TProtocol): AssetFields;
|
package/v1/assetFields.js
CHANGED
|
@@ -8,10 +8,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.AssetFieldsSerde = void 0;
|
|
9
9
|
var thrift_1 = require("thrift");
|
|
10
10
|
var capiDateTime_1 = require("./capiDateTime");
|
|
11
|
+
var cartoonVariant_1 = require("./cartoonVariant");
|
|
11
12
|
var AssetFieldsSerde = /** @class */ (function () {
|
|
12
13
|
function AssetFieldsSerde() {
|
|
13
14
|
}
|
|
14
15
|
AssetFieldsSerde.read = function (protocol) {
|
|
16
|
+
var _a;
|
|
15
17
|
protocol.readStructBegin();
|
|
16
18
|
var result = {};
|
|
17
19
|
while (true) {
|
|
@@ -634,6 +636,33 @@ var AssetFieldsSerde = /** @class */ (function () {
|
|
|
634
636
|
protocol.skip(ftype);
|
|
635
637
|
}
|
|
636
638
|
break;
|
|
639
|
+
case 69:
|
|
640
|
+
if (ftype === thrift_1.Thrift.Type.BOOL) {
|
|
641
|
+
var value1 = protocol.readBool();
|
|
642
|
+
result.isMandatory = value1;
|
|
643
|
+
}
|
|
644
|
+
else {
|
|
645
|
+
protocol.skip(ftype);
|
|
646
|
+
}
|
|
647
|
+
break;
|
|
648
|
+
case 70:
|
|
649
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
650
|
+
var listInfo1 = protocol.readListBegin();
|
|
651
|
+
var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
|
|
652
|
+
var value1 = [];
|
|
653
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
654
|
+
for (var i = 0; i < listSize1; i++) {
|
|
655
|
+
var value2 = cartoonVariant_1.CartoonVariantSerde.read(protocol);
|
|
656
|
+
value1.push(value2);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
protocol.readListEnd();
|
|
660
|
+
result.cartoonVariants = value1;
|
|
661
|
+
}
|
|
662
|
+
else {
|
|
663
|
+
protocol.skip(ftype);
|
|
664
|
+
}
|
|
665
|
+
break;
|
|
637
666
|
default:
|
|
638
667
|
protocol.skip(ftype);
|
|
639
668
|
}
|
|
@@ -1053,6 +1082,22 @@ var AssetFieldsSerde = /** @class */ (function () {
|
|
|
1053
1082
|
protocol.writeBool(value1);
|
|
1054
1083
|
protocol.writeFieldEnd();
|
|
1055
1084
|
}
|
|
1085
|
+
if (value0.isMandatory !== null && value0.isMandatory !== undefined) {
|
|
1086
|
+
var value1 = value0.isMandatory;
|
|
1087
|
+
protocol.writeFieldBegin('isMandatory', thrift_1.Thrift.Type.BOOL, 69);
|
|
1088
|
+
protocol.writeBool(value1);
|
|
1089
|
+
protocol.writeFieldEnd();
|
|
1090
|
+
}
|
|
1091
|
+
if (value0.cartoonVariants !== null && value0.cartoonVariants !== undefined) {
|
|
1092
|
+
var value1 = value0.cartoonVariants;
|
|
1093
|
+
protocol.writeFieldBegin('cartoonVariants', thrift_1.Thrift.Type.LIST, 70);
|
|
1094
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
1095
|
+
value1.forEach(function (value2) {
|
|
1096
|
+
cartoonVariant_1.CartoonVariantSerde.write(protocol, value2);
|
|
1097
|
+
});
|
|
1098
|
+
protocol.writeListEnd();
|
|
1099
|
+
protocol.writeFieldEnd();
|
|
1100
|
+
}
|
|
1056
1101
|
protocol.writeFieldStop();
|
|
1057
1102
|
protocol.writeStructEnd();
|
|
1058
1103
|
};
|
package/v1/assetType.d.ts
CHANGED
package/v1/assetType.js
CHANGED
|
@@ -13,4 +13,5 @@ var AssetType;
|
|
|
13
13
|
AssetType[AssetType["AUDIO"] = 2] = "AUDIO";
|
|
14
14
|
AssetType[AssetType["EMBED"] = 3] = "EMBED";
|
|
15
15
|
AssetType[AssetType["TWEET"] = 4] = "TWEET";
|
|
16
|
+
AssetType[AssetType["CARTOON"] = 5] = "CARTOON";
|
|
16
17
|
})(AssetType = exports.AssetType || (exports.AssetType = {}));
|
package/v1/blockElement.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { TProtocol } from 'thrift';
|
|
|
7
7
|
import { Asset } from './asset';
|
|
8
8
|
import { AudioElementFields } from './audioElementFields';
|
|
9
9
|
import { CalloutElementFields } from './calloutElementFields';
|
|
10
|
+
import { CartoonElementFields } from './cartoonElementFields';
|
|
10
11
|
import { CodeElementFields } from './codeElementFields';
|
|
11
12
|
import { CommentElementFields } from './commentElementFields';
|
|
12
13
|
import { ContentAtomElementFields } from './contentAtomElementFields';
|
|
@@ -49,6 +50,7 @@ export interface BlockElement {
|
|
|
49
50
|
tracking?: EmbedTracking;
|
|
50
51
|
codeTypeData?: CodeElementFields;
|
|
51
52
|
calloutTypeData?: CalloutElementFields;
|
|
53
|
+
cartoonTypeData?: CartoonElementFields;
|
|
52
54
|
}
|
|
53
55
|
export declare class BlockElementSerde {
|
|
54
56
|
static read(protocol: TProtocol): BlockElement;
|
package/v1/blockElement.js
CHANGED
|
@@ -10,6 +10,7 @@ var thrift_1 = require("thrift");
|
|
|
10
10
|
var asset_1 = require("./asset");
|
|
11
11
|
var audioElementFields_1 = require("./audioElementFields");
|
|
12
12
|
var calloutElementFields_1 = require("./calloutElementFields");
|
|
13
|
+
var cartoonElementFields_1 = require("./cartoonElementFields");
|
|
13
14
|
var codeElementFields_1 = require("./codeElementFields");
|
|
14
15
|
var commentElementFields_1 = require("./commentElementFields");
|
|
15
16
|
var contentAtomElementFields_1 = require("./contentAtomElementFields");
|
|
@@ -258,6 +259,15 @@ var BlockElementSerde = /** @class */ (function () {
|
|
|
258
259
|
protocol.skip(ftype);
|
|
259
260
|
}
|
|
260
261
|
break;
|
|
262
|
+
case 24:
|
|
263
|
+
if (ftype === thrift_1.Thrift.Type.STRUCT) {
|
|
264
|
+
var value1 = cartoonElementFields_1.CartoonElementFieldsSerde.read(protocol);
|
|
265
|
+
result.cartoonTypeData = value1;
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
protocol.skip(ftype);
|
|
269
|
+
}
|
|
270
|
+
break;
|
|
261
271
|
default:
|
|
262
272
|
protocol.skip(ftype);
|
|
263
273
|
}
|
|
@@ -411,6 +421,12 @@ var BlockElementSerde = /** @class */ (function () {
|
|
|
411
421
|
calloutElementFields_1.CalloutElementFieldsSerde.write(protocol, value1);
|
|
412
422
|
protocol.writeFieldEnd();
|
|
413
423
|
}
|
|
424
|
+
if (value0.cartoonTypeData !== null && value0.cartoonTypeData !== undefined) {
|
|
425
|
+
var value1 = value0.cartoonTypeData;
|
|
426
|
+
protocol.writeFieldBegin('cartoonTypeData', thrift_1.Thrift.Type.STRUCT, 24);
|
|
427
|
+
cartoonElementFields_1.CartoonElementFieldsSerde.write(protocol, value1);
|
|
428
|
+
protocol.writeFieldEnd();
|
|
429
|
+
}
|
|
414
430
|
protocol.writeFieldStop();
|
|
415
431
|
protocol.writeStructEnd();
|
|
416
432
|
};
|
|
@@ -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
|
+
import { CartoonVariant } from './cartoonVariant';
|
|
8
|
+
export interface CartoonElementFields {
|
|
9
|
+
variants?: CartoonVariant[];
|
|
10
|
+
role?: string;
|
|
11
|
+
credit?: string;
|
|
12
|
+
caption?: string;
|
|
13
|
+
alt?: string;
|
|
14
|
+
source?: string;
|
|
15
|
+
displayCredit?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare class CartoonElementFieldsSerde {
|
|
18
|
+
static read(protocol: TProtocol): CartoonElementFields;
|
|
19
|
+
static write(protocol: TProtocol, value0: CartoonElementFields): 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.CartoonElementFieldsSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var cartoonVariant_1 = require("./cartoonVariant");
|
|
11
|
+
var CartoonElementFieldsSerde = /** @class */ (function () {
|
|
12
|
+
function CartoonElementFieldsSerde() {
|
|
13
|
+
}
|
|
14
|
+
CartoonElementFieldsSerde.read = function (protocol) {
|
|
15
|
+
var _a;
|
|
16
|
+
protocol.readStructBegin();
|
|
17
|
+
var result = {};
|
|
18
|
+
while (true) {
|
|
19
|
+
var ret = protocol.readFieldBegin();
|
|
20
|
+
var ftype = ret.ftype;
|
|
21
|
+
var fid = ret.fid;
|
|
22
|
+
if (ftype === thrift_1.Thrift.Type.STOP) {
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
switch (fid) {
|
|
26
|
+
case 1:
|
|
27
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
28
|
+
var listInfo1 = protocol.readListBegin();
|
|
29
|
+
var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
|
|
30
|
+
var value1 = [];
|
|
31
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
32
|
+
for (var i = 0; i < listSize1; i++) {
|
|
33
|
+
var value2 = cartoonVariant_1.CartoonVariantSerde.read(protocol);
|
|
34
|
+
value1.push(value2);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
protocol.readListEnd();
|
|
38
|
+
result.variants = value1;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
protocol.skip(ftype);
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
case 2:
|
|
45
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
46
|
+
var value1 = protocol.readString();
|
|
47
|
+
result.role = value1;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
protocol.skip(ftype);
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
case 3:
|
|
54
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
55
|
+
var value1 = protocol.readString();
|
|
56
|
+
result.credit = value1;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
protocol.skip(ftype);
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
case 4:
|
|
63
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
64
|
+
var value1 = protocol.readString();
|
|
65
|
+
result.caption = value1;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
protocol.skip(ftype);
|
|
69
|
+
}
|
|
70
|
+
break;
|
|
71
|
+
case 5:
|
|
72
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
73
|
+
var value1 = protocol.readString();
|
|
74
|
+
result.alt = value1;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
protocol.skip(ftype);
|
|
78
|
+
}
|
|
79
|
+
break;
|
|
80
|
+
case 6:
|
|
81
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
82
|
+
var value1 = protocol.readString();
|
|
83
|
+
result.source = value1;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
protocol.skip(ftype);
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
case 7:
|
|
90
|
+
if (ftype === thrift_1.Thrift.Type.BOOL) {
|
|
91
|
+
var value1 = protocol.readBool();
|
|
92
|
+
result.displayCredit = value1;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
protocol.skip(ftype);
|
|
96
|
+
}
|
|
97
|
+
break;
|
|
98
|
+
default:
|
|
99
|
+
protocol.skip(ftype);
|
|
100
|
+
}
|
|
101
|
+
protocol.readFieldEnd();
|
|
102
|
+
}
|
|
103
|
+
protocol.readStructEnd();
|
|
104
|
+
// @ts-ignore
|
|
105
|
+
return result;
|
|
106
|
+
};
|
|
107
|
+
CartoonElementFieldsSerde.write = function (protocol, value0) {
|
|
108
|
+
protocol.writeStructBegin('CartoonElementFields');
|
|
109
|
+
if (value0.variants !== null && value0.variants !== undefined) {
|
|
110
|
+
var value1 = value0.variants;
|
|
111
|
+
protocol.writeFieldBegin('variants', thrift_1.Thrift.Type.LIST, 1);
|
|
112
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
113
|
+
value1.forEach(function (value2) {
|
|
114
|
+
cartoonVariant_1.CartoonVariantSerde.write(protocol, value2);
|
|
115
|
+
});
|
|
116
|
+
protocol.writeListEnd();
|
|
117
|
+
protocol.writeFieldEnd();
|
|
118
|
+
}
|
|
119
|
+
if (value0.role !== null && value0.role !== undefined) {
|
|
120
|
+
var value1 = value0.role;
|
|
121
|
+
protocol.writeFieldBegin('role', thrift_1.Thrift.Type.STRING, 2);
|
|
122
|
+
protocol.writeString(value1);
|
|
123
|
+
protocol.writeFieldEnd();
|
|
124
|
+
}
|
|
125
|
+
if (value0.credit !== null && value0.credit !== undefined) {
|
|
126
|
+
var value1 = value0.credit;
|
|
127
|
+
protocol.writeFieldBegin('credit', thrift_1.Thrift.Type.STRING, 3);
|
|
128
|
+
protocol.writeString(value1);
|
|
129
|
+
protocol.writeFieldEnd();
|
|
130
|
+
}
|
|
131
|
+
if (value0.caption !== null && value0.caption !== undefined) {
|
|
132
|
+
var value1 = value0.caption;
|
|
133
|
+
protocol.writeFieldBegin('caption', thrift_1.Thrift.Type.STRING, 4);
|
|
134
|
+
protocol.writeString(value1);
|
|
135
|
+
protocol.writeFieldEnd();
|
|
136
|
+
}
|
|
137
|
+
if (value0.alt !== null && value0.alt !== undefined) {
|
|
138
|
+
var value1 = value0.alt;
|
|
139
|
+
protocol.writeFieldBegin('alt', thrift_1.Thrift.Type.STRING, 5);
|
|
140
|
+
protocol.writeString(value1);
|
|
141
|
+
protocol.writeFieldEnd();
|
|
142
|
+
}
|
|
143
|
+
if (value0.source !== null && value0.source !== undefined) {
|
|
144
|
+
var value1 = value0.source;
|
|
145
|
+
protocol.writeFieldBegin('source', thrift_1.Thrift.Type.STRING, 6);
|
|
146
|
+
protocol.writeString(value1);
|
|
147
|
+
protocol.writeFieldEnd();
|
|
148
|
+
}
|
|
149
|
+
if (value0.displayCredit !== null && value0.displayCredit !== undefined) {
|
|
150
|
+
var value1 = value0.displayCredit;
|
|
151
|
+
protocol.writeFieldBegin('displayCredit', thrift_1.Thrift.Type.BOOL, 7);
|
|
152
|
+
protocol.writeBool(value1);
|
|
153
|
+
protocol.writeFieldEnd();
|
|
154
|
+
}
|
|
155
|
+
protocol.writeFieldStop();
|
|
156
|
+
protocol.writeStructEnd();
|
|
157
|
+
};
|
|
158
|
+
return CartoonElementFieldsSerde;
|
|
159
|
+
}());
|
|
160
|
+
exports.CartoonElementFieldsSerde = CartoonElementFieldsSerde;
|
|
@@ -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 CartoonImage {
|
|
8
|
+
mimeType: string;
|
|
9
|
+
file: string;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
mediaId?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class CartoonImageSerde {
|
|
15
|
+
static read(protocol: TProtocol): CartoonImage;
|
|
16
|
+
static write(protocol: TProtocol, value0: CartoonImage): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
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.CartoonImageSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var CartoonImageSerde = /** @class */ (function () {
|
|
11
|
+
function CartoonImageSerde() {
|
|
12
|
+
}
|
|
13
|
+
CartoonImageSerde.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.mimeType = 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.file = value1;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
protocol.skip(ftype);
|
|
40
|
+
}
|
|
41
|
+
break;
|
|
42
|
+
case 3:
|
|
43
|
+
if (ftype === thrift_1.Thrift.Type.I32) {
|
|
44
|
+
var value1 = protocol.readI32();
|
|
45
|
+
result.width = value1;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
protocol.skip(ftype);
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
case 4:
|
|
52
|
+
if (ftype === thrift_1.Thrift.Type.I32) {
|
|
53
|
+
var value1 = protocol.readI32();
|
|
54
|
+
result.height = 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.mediaId = value1;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
protocol.skip(ftype);
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
protocol.skip(ftype);
|
|
71
|
+
}
|
|
72
|
+
protocol.readFieldEnd();
|
|
73
|
+
}
|
|
74
|
+
protocol.readStructEnd();
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
return result;
|
|
77
|
+
};
|
|
78
|
+
CartoonImageSerde.write = function (protocol, value0) {
|
|
79
|
+
protocol.writeStructBegin('CartoonImage');
|
|
80
|
+
if (value0.mimeType !== null && value0.mimeType !== undefined) {
|
|
81
|
+
var value1 = value0.mimeType;
|
|
82
|
+
protocol.writeFieldBegin('mimeType', thrift_1.Thrift.Type.STRING, 1);
|
|
83
|
+
protocol.writeString(value1);
|
|
84
|
+
protocol.writeFieldEnd();
|
|
85
|
+
}
|
|
86
|
+
if (value0.file !== null && value0.file !== undefined) {
|
|
87
|
+
var value1 = value0.file;
|
|
88
|
+
protocol.writeFieldBegin('file', thrift_1.Thrift.Type.STRING, 2);
|
|
89
|
+
protocol.writeString(value1);
|
|
90
|
+
protocol.writeFieldEnd();
|
|
91
|
+
}
|
|
92
|
+
if (value0.width !== null && value0.width !== undefined) {
|
|
93
|
+
var value1 = value0.width;
|
|
94
|
+
protocol.writeFieldBegin('width', thrift_1.Thrift.Type.I32, 3);
|
|
95
|
+
protocol.writeI32(value1);
|
|
96
|
+
protocol.writeFieldEnd();
|
|
97
|
+
}
|
|
98
|
+
if (value0.height !== null && value0.height !== undefined) {
|
|
99
|
+
var value1 = value0.height;
|
|
100
|
+
protocol.writeFieldBegin('height', thrift_1.Thrift.Type.I32, 4);
|
|
101
|
+
protocol.writeI32(value1);
|
|
102
|
+
protocol.writeFieldEnd();
|
|
103
|
+
}
|
|
104
|
+
if (value0.mediaId !== null && value0.mediaId !== undefined) {
|
|
105
|
+
var value1 = value0.mediaId;
|
|
106
|
+
protocol.writeFieldBegin('mediaId', thrift_1.Thrift.Type.STRING, 5);
|
|
107
|
+
protocol.writeString(value1);
|
|
108
|
+
protocol.writeFieldEnd();
|
|
109
|
+
}
|
|
110
|
+
protocol.writeFieldStop();
|
|
111
|
+
protocol.writeStructEnd();
|
|
112
|
+
};
|
|
113
|
+
return CartoonImageSerde;
|
|
114
|
+
}());
|
|
115
|
+
exports.CartoonImageSerde = CartoonImageSerde;
|
|
@@ -0,0 +1,15 @@
|
|
|
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 { CartoonImage } from './cartoonImage';
|
|
8
|
+
export interface CartoonVariant {
|
|
9
|
+
viewportSize: string;
|
|
10
|
+
images: CartoonImage[];
|
|
11
|
+
}
|
|
12
|
+
export declare class CartoonVariantSerde {
|
|
13
|
+
static read(protocol: TProtocol): CartoonVariant;
|
|
14
|
+
static write(protocol: TProtocol, value0: CartoonVariant): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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.CartoonVariantSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var cartoonImage_1 = require("./cartoonImage");
|
|
11
|
+
var CartoonVariantSerde = /** @class */ (function () {
|
|
12
|
+
function CartoonVariantSerde() {
|
|
13
|
+
}
|
|
14
|
+
CartoonVariantSerde.read = function (protocol) {
|
|
15
|
+
var _a;
|
|
16
|
+
protocol.readStructBegin();
|
|
17
|
+
var result = {};
|
|
18
|
+
while (true) {
|
|
19
|
+
var ret = protocol.readFieldBegin();
|
|
20
|
+
var ftype = ret.ftype;
|
|
21
|
+
var fid = ret.fid;
|
|
22
|
+
if (ftype === thrift_1.Thrift.Type.STOP) {
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
switch (fid) {
|
|
26
|
+
case 1:
|
|
27
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
28
|
+
var value1 = protocol.readString();
|
|
29
|
+
result.viewportSize = value1;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
protocol.skip(ftype);
|
|
33
|
+
}
|
|
34
|
+
break;
|
|
35
|
+
case 2:
|
|
36
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
37
|
+
var listInfo1 = protocol.readListBegin();
|
|
38
|
+
var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
|
|
39
|
+
var value1 = [];
|
|
40
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
41
|
+
for (var i = 0; i < listSize1; i++) {
|
|
42
|
+
var value2 = cartoonImage_1.CartoonImageSerde.read(protocol);
|
|
43
|
+
value1.push(value2);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
protocol.readListEnd();
|
|
47
|
+
result.images = value1;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
protocol.skip(ftype);
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
protocol.skip(ftype);
|
|
55
|
+
}
|
|
56
|
+
protocol.readFieldEnd();
|
|
57
|
+
}
|
|
58
|
+
protocol.readStructEnd();
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
return result;
|
|
61
|
+
};
|
|
62
|
+
CartoonVariantSerde.write = function (protocol, value0) {
|
|
63
|
+
protocol.writeStructBegin('CartoonVariant');
|
|
64
|
+
if (value0.viewportSize !== null && value0.viewportSize !== undefined) {
|
|
65
|
+
var value1 = value0.viewportSize;
|
|
66
|
+
protocol.writeFieldBegin('viewportSize', thrift_1.Thrift.Type.STRING, 1);
|
|
67
|
+
protocol.writeString(value1);
|
|
68
|
+
protocol.writeFieldEnd();
|
|
69
|
+
}
|
|
70
|
+
if (value0.images !== null && value0.images !== undefined) {
|
|
71
|
+
var value1 = value0.images;
|
|
72
|
+
protocol.writeFieldBegin('images', thrift_1.Thrift.Type.LIST, 2);
|
|
73
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
74
|
+
value1.forEach(function (value2) {
|
|
75
|
+
cartoonImage_1.CartoonImageSerde.write(protocol, value2);
|
|
76
|
+
});
|
|
77
|
+
protocol.writeListEnd();
|
|
78
|
+
protocol.writeFieldEnd();
|
|
79
|
+
}
|
|
80
|
+
protocol.writeFieldStop();
|
|
81
|
+
protocol.writeStructEnd();
|
|
82
|
+
};
|
|
83
|
+
return CartoonVariantSerde;
|
|
84
|
+
}());
|
|
85
|
+
exports.CartoonVariantSerde = CartoonVariantSerde;
|
package/v1/elementType.d.ts
CHANGED
package/v1/elementType.js
CHANGED
|
@@ -29,4 +29,5 @@ var ElementType;
|
|
|
29
29
|
ElementType[ElementType["CONTENTATOM"] = 18] = "CONTENTATOM";
|
|
30
30
|
ElementType[ElementType["VINE"] = 19] = "VINE";
|
|
31
31
|
ElementType[ElementType["CALLOUT"] = 20] = "CALLOUT";
|
|
32
|
+
ElementType[ElementType["CARTOON"] = 21] = "CARTOON";
|
|
32
33
|
})(ElementType = exports.ElementType || (exports.ElementType = {}));
|