@guardian/content-api-models 19.0.1 → 21.0.0-PREVIEW.agschema-org-field.2024-03-01T1602.c5a81993
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/schemaorg/authorInfo.d.ts +15 -0
- package/schemaorg/authorInfo.js +99 -0
- package/schemaorg/recipeStep.d.ts +17 -0
- package/schemaorg/recipeStep.js +129 -0
- package/schemaorg/schemaRecipe.d.ts +30 -0
- package/schemaorg/schemaRecipe.js +348 -0
- package/v1/blockElement.d.ts +2 -0
- package/v1/blockElement.js +16 -0
- package/v1/content.d.ts +2 -0
- package/v1/content.js +16 -0
- package/v1/elementType.d.ts +2 -1
- package/v1/elementType.js +1 -0
- package/v1/listElementFields.d.ts +16 -0
- package/v1/listElementFields.js +85 -0
- package/v1/listItem.d.ts +15 -0
- package/v1/listItem.js +87 -0
- package/v1/listType.d.ts +9 -0
- package/v1/listType.js +13 -0
- package/v1/schemaOrg.d.ts +14 -0
- package/v1/schemaOrg.js +70 -0
package/package.json
CHANGED
|
@@ -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
|
+
export interface AuthorInfo {
|
|
8
|
+
_at_type: string;
|
|
9
|
+
name: string;
|
|
10
|
+
sameAs?: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare class AuthorInfoSerde {
|
|
13
|
+
static read(protocol: TProtocol): AuthorInfo;
|
|
14
|
+
static write(protocol: TProtocol, value0: AuthorInfo): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
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.AuthorInfoSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var AuthorInfoSerde = /** @class */ (function () {
|
|
11
|
+
function AuthorInfoSerde() {
|
|
12
|
+
}
|
|
13
|
+
AuthorInfoSerde.read = function (protocol) {
|
|
14
|
+
var _a;
|
|
15
|
+
protocol.readStructBegin();
|
|
16
|
+
var result = {};
|
|
17
|
+
while (true) {
|
|
18
|
+
var ret = protocol.readFieldBegin();
|
|
19
|
+
var ftype = ret.ftype;
|
|
20
|
+
var fid = ret.fid;
|
|
21
|
+
if (ftype === thrift_1.Thrift.Type.STOP) {
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
switch (fid) {
|
|
25
|
+
case 1:
|
|
26
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
27
|
+
var value1 = protocol.readString();
|
|
28
|
+
result._at_type = value1;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
protocol.skip(ftype);
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
34
|
+
case 2:
|
|
35
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
36
|
+
var value1 = protocol.readString();
|
|
37
|
+
result.name = value1;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
protocol.skip(ftype);
|
|
41
|
+
}
|
|
42
|
+
break;
|
|
43
|
+
case 3:
|
|
44
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
45
|
+
var listInfo1 = protocol.readListBegin();
|
|
46
|
+
var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
|
|
47
|
+
var value1 = [];
|
|
48
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRING) {
|
|
49
|
+
for (var i = 0; i < listSize1; i++) {
|
|
50
|
+
var value2 = protocol.readString();
|
|
51
|
+
value1.push(value2);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
protocol.readListEnd();
|
|
55
|
+
result.sameAs = value1;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
protocol.skip(ftype);
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
default:
|
|
62
|
+
protocol.skip(ftype);
|
|
63
|
+
}
|
|
64
|
+
protocol.readFieldEnd();
|
|
65
|
+
}
|
|
66
|
+
protocol.readStructEnd();
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
return result;
|
|
69
|
+
};
|
|
70
|
+
AuthorInfoSerde.write = function (protocol, value0) {
|
|
71
|
+
protocol.writeStructBegin('AuthorInfo');
|
|
72
|
+
if (value0._at_type !== null && value0._at_type !== undefined) {
|
|
73
|
+
var value1 = value0._at_type;
|
|
74
|
+
protocol.writeFieldBegin('_at_type', thrift_1.Thrift.Type.STRING, 1);
|
|
75
|
+
protocol.writeString(value1);
|
|
76
|
+
protocol.writeFieldEnd();
|
|
77
|
+
}
|
|
78
|
+
if (value0.name !== null && value0.name !== undefined) {
|
|
79
|
+
var value1 = value0.name;
|
|
80
|
+
protocol.writeFieldBegin('name', thrift_1.Thrift.Type.STRING, 2);
|
|
81
|
+
protocol.writeString(value1);
|
|
82
|
+
protocol.writeFieldEnd();
|
|
83
|
+
}
|
|
84
|
+
if (value0.sameAs !== null && value0.sameAs !== undefined) {
|
|
85
|
+
var value1 = value0.sameAs;
|
|
86
|
+
protocol.writeFieldBegin('sameAs', thrift_1.Thrift.Type.LIST, 3);
|
|
87
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRING, value1.length);
|
|
88
|
+
value1.forEach(function (value2) {
|
|
89
|
+
protocol.writeString(value2);
|
|
90
|
+
});
|
|
91
|
+
protocol.writeListEnd();
|
|
92
|
+
protocol.writeFieldEnd();
|
|
93
|
+
}
|
|
94
|
+
protocol.writeFieldStop();
|
|
95
|
+
protocol.writeStructEnd();
|
|
96
|
+
};
|
|
97
|
+
return AuthorInfoSerde;
|
|
98
|
+
}());
|
|
99
|
+
exports.AuthorInfoSerde = AuthorInfoSerde;
|
|
@@ -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 RecipeStep {
|
|
8
|
+
_at_type: string;
|
|
9
|
+
text: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
url?: string;
|
|
12
|
+
image?: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare class RecipeStepSerde {
|
|
15
|
+
static read(protocol: TProtocol): RecipeStep;
|
|
16
|
+
static write(protocol: TProtocol, value0: RecipeStep): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
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.RecipeStepSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var RecipeStepSerde = /** @class */ (function () {
|
|
11
|
+
function RecipeStepSerde() {
|
|
12
|
+
}
|
|
13
|
+
RecipeStepSerde.read = function (protocol) {
|
|
14
|
+
var _a;
|
|
15
|
+
protocol.readStructBegin();
|
|
16
|
+
var result = {};
|
|
17
|
+
while (true) {
|
|
18
|
+
var ret = protocol.readFieldBegin();
|
|
19
|
+
var ftype = ret.ftype;
|
|
20
|
+
var fid = ret.fid;
|
|
21
|
+
if (ftype === thrift_1.Thrift.Type.STOP) {
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
switch (fid) {
|
|
25
|
+
case 1:
|
|
26
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
27
|
+
var value1 = protocol.readString();
|
|
28
|
+
result._at_type = value1;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
protocol.skip(ftype);
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
34
|
+
case 2:
|
|
35
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
36
|
+
var value1 = protocol.readString();
|
|
37
|
+
result.text = value1;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
protocol.skip(ftype);
|
|
41
|
+
}
|
|
42
|
+
break;
|
|
43
|
+
case 3:
|
|
44
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
45
|
+
var value1 = protocol.readString();
|
|
46
|
+
result.name = value1;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
protocol.skip(ftype);
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
case 4:
|
|
53
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
54
|
+
var value1 = protocol.readString();
|
|
55
|
+
result.url = value1;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
protocol.skip(ftype);
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
case 5:
|
|
62
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
63
|
+
var listInfo1 = protocol.readListBegin();
|
|
64
|
+
var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
|
|
65
|
+
var value1 = [];
|
|
66
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRING) {
|
|
67
|
+
for (var i = 0; i < listSize1; i++) {
|
|
68
|
+
var value2 = protocol.readString();
|
|
69
|
+
value1.push(value2);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
protocol.readListEnd();
|
|
73
|
+
result.image = value1;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
protocol.skip(ftype);
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
protocol.skip(ftype);
|
|
81
|
+
}
|
|
82
|
+
protocol.readFieldEnd();
|
|
83
|
+
}
|
|
84
|
+
protocol.readStructEnd();
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
return result;
|
|
87
|
+
};
|
|
88
|
+
RecipeStepSerde.write = function (protocol, value0) {
|
|
89
|
+
protocol.writeStructBegin('RecipeStep');
|
|
90
|
+
if (value0._at_type !== null && value0._at_type !== undefined) {
|
|
91
|
+
var value1 = value0._at_type;
|
|
92
|
+
protocol.writeFieldBegin('_at_type', thrift_1.Thrift.Type.STRING, 1);
|
|
93
|
+
protocol.writeString(value1);
|
|
94
|
+
protocol.writeFieldEnd();
|
|
95
|
+
}
|
|
96
|
+
if (value0.text !== null && value0.text !== undefined) {
|
|
97
|
+
var value1 = value0.text;
|
|
98
|
+
protocol.writeFieldBegin('text', thrift_1.Thrift.Type.STRING, 2);
|
|
99
|
+
protocol.writeString(value1);
|
|
100
|
+
protocol.writeFieldEnd();
|
|
101
|
+
}
|
|
102
|
+
if (value0.name !== null && value0.name !== undefined) {
|
|
103
|
+
var value1 = value0.name;
|
|
104
|
+
protocol.writeFieldBegin('name', thrift_1.Thrift.Type.STRING, 3);
|
|
105
|
+
protocol.writeString(value1);
|
|
106
|
+
protocol.writeFieldEnd();
|
|
107
|
+
}
|
|
108
|
+
if (value0.url !== null && value0.url !== undefined) {
|
|
109
|
+
var value1 = value0.url;
|
|
110
|
+
protocol.writeFieldBegin('url', thrift_1.Thrift.Type.STRING, 4);
|
|
111
|
+
protocol.writeString(value1);
|
|
112
|
+
protocol.writeFieldEnd();
|
|
113
|
+
}
|
|
114
|
+
if (value0.image !== null && value0.image !== undefined) {
|
|
115
|
+
var value1 = value0.image;
|
|
116
|
+
protocol.writeFieldBegin('image', thrift_1.Thrift.Type.LIST, 5);
|
|
117
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRING, value1.length);
|
|
118
|
+
value1.forEach(function (value2) {
|
|
119
|
+
protocol.writeString(value2);
|
|
120
|
+
});
|
|
121
|
+
protocol.writeListEnd();
|
|
122
|
+
protocol.writeFieldEnd();
|
|
123
|
+
}
|
|
124
|
+
protocol.writeFieldStop();
|
|
125
|
+
protocol.writeStructEnd();
|
|
126
|
+
};
|
|
127
|
+
return RecipeStepSerde;
|
|
128
|
+
}());
|
|
129
|
+
exports.RecipeStepSerde = RecipeStepSerde;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { AuthorInfo } from './authorInfo';
|
|
8
|
+
import { RecipeStep } from './recipeStep';
|
|
9
|
+
export interface SchemaRecipe {
|
|
10
|
+
_at_context: string;
|
|
11
|
+
_at_type: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
image?: string;
|
|
15
|
+
datePublished?: string;
|
|
16
|
+
url?: string;
|
|
17
|
+
recipeCategory?: string[];
|
|
18
|
+
recipeCuisine?: string[];
|
|
19
|
+
recipeIngredient?: string[];
|
|
20
|
+
recipeInstructions?: RecipeStep[];
|
|
21
|
+
recipeYield?: string[];
|
|
22
|
+
prepTime?: string;
|
|
23
|
+
cookTime?: string;
|
|
24
|
+
totalTime?: string;
|
|
25
|
+
author?: AuthorInfo;
|
|
26
|
+
}
|
|
27
|
+
export declare class SchemaRecipeSerde {
|
|
28
|
+
static read(protocol: TProtocol): SchemaRecipe;
|
|
29
|
+
static write(protocol: TProtocol, value0: SchemaRecipe): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,348 @@
|
|
|
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.SchemaRecipeSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var authorInfo_1 = require("./authorInfo");
|
|
11
|
+
var recipeStep_1 = require("./recipeStep");
|
|
12
|
+
var SchemaRecipeSerde = /** @class */ (function () {
|
|
13
|
+
function SchemaRecipeSerde() {
|
|
14
|
+
}
|
|
15
|
+
SchemaRecipeSerde.read = function (protocol) {
|
|
16
|
+
var _a, _b, _c, _d, _e;
|
|
17
|
+
protocol.readStructBegin();
|
|
18
|
+
var result = {};
|
|
19
|
+
while (true) {
|
|
20
|
+
var ret = protocol.readFieldBegin();
|
|
21
|
+
var ftype = ret.ftype;
|
|
22
|
+
var fid = ret.fid;
|
|
23
|
+
if (ftype === thrift_1.Thrift.Type.STOP) {
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
switch (fid) {
|
|
27
|
+
case 1:
|
|
28
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
29
|
+
var value1 = protocol.readString();
|
|
30
|
+
result._at_context = value1;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
protocol.skip(ftype);
|
|
34
|
+
}
|
|
35
|
+
break;
|
|
36
|
+
case 2:
|
|
37
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
38
|
+
var value1 = protocol.readString();
|
|
39
|
+
result._at_type = value1;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
protocol.skip(ftype);
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
case 3:
|
|
46
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
47
|
+
var value1 = protocol.readString();
|
|
48
|
+
result.name = value1;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
protocol.skip(ftype);
|
|
52
|
+
}
|
|
53
|
+
break;
|
|
54
|
+
case 4:
|
|
55
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
56
|
+
var value1 = protocol.readString();
|
|
57
|
+
result.description = value1;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
protocol.skip(ftype);
|
|
61
|
+
}
|
|
62
|
+
break;
|
|
63
|
+
case 5:
|
|
64
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
65
|
+
var value1 = protocol.readString();
|
|
66
|
+
result.image = value1;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
protocol.skip(ftype);
|
|
70
|
+
}
|
|
71
|
+
break;
|
|
72
|
+
case 6:
|
|
73
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
74
|
+
var value1 = protocol.readString();
|
|
75
|
+
result.datePublished = value1;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
protocol.skip(ftype);
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
case 7:
|
|
82
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
83
|
+
var value1 = protocol.readString();
|
|
84
|
+
result.url = value1;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
protocol.skip(ftype);
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
case 8:
|
|
91
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
92
|
+
var listInfo1 = protocol.readListBegin();
|
|
93
|
+
var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
|
|
94
|
+
var value1 = [];
|
|
95
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRING) {
|
|
96
|
+
for (var i = 0; i < listSize1; i++) {
|
|
97
|
+
var value2 = protocol.readString();
|
|
98
|
+
value1.push(value2);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
protocol.readListEnd();
|
|
102
|
+
result.recipeCategory = value1;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
protocol.skip(ftype);
|
|
106
|
+
}
|
|
107
|
+
break;
|
|
108
|
+
case 9:
|
|
109
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
110
|
+
var listInfo1 = protocol.readListBegin();
|
|
111
|
+
var listSize1 = (_b = listInfo1.size) !== null && _b !== void 0 ? _b : 0;
|
|
112
|
+
var value1 = [];
|
|
113
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRING) {
|
|
114
|
+
for (var i = 0; i < listSize1; i++) {
|
|
115
|
+
var value2 = protocol.readString();
|
|
116
|
+
value1.push(value2);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
protocol.readListEnd();
|
|
120
|
+
result.recipeCuisine = value1;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
protocol.skip(ftype);
|
|
124
|
+
}
|
|
125
|
+
break;
|
|
126
|
+
case 10:
|
|
127
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
128
|
+
var listInfo1 = protocol.readListBegin();
|
|
129
|
+
var listSize1 = (_c = listInfo1.size) !== null && _c !== void 0 ? _c : 0;
|
|
130
|
+
var value1 = [];
|
|
131
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRING) {
|
|
132
|
+
for (var i = 0; i < listSize1; i++) {
|
|
133
|
+
var value2 = protocol.readString();
|
|
134
|
+
value1.push(value2);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
protocol.readListEnd();
|
|
138
|
+
result.recipeIngredient = value1;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
protocol.skip(ftype);
|
|
142
|
+
}
|
|
143
|
+
break;
|
|
144
|
+
case 11:
|
|
145
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
146
|
+
var listInfo1 = protocol.readListBegin();
|
|
147
|
+
var listSize1 = (_d = listInfo1.size) !== null && _d !== void 0 ? _d : 0;
|
|
148
|
+
var value1 = [];
|
|
149
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
150
|
+
for (var i = 0; i < listSize1; i++) {
|
|
151
|
+
var value2 = recipeStep_1.RecipeStepSerde.read(protocol);
|
|
152
|
+
value1.push(value2);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
protocol.readListEnd();
|
|
156
|
+
result.recipeInstructions = value1;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
protocol.skip(ftype);
|
|
160
|
+
}
|
|
161
|
+
break;
|
|
162
|
+
case 12:
|
|
163
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
164
|
+
var listInfo1 = protocol.readListBegin();
|
|
165
|
+
var listSize1 = (_e = listInfo1.size) !== null && _e !== void 0 ? _e : 0;
|
|
166
|
+
var value1 = [];
|
|
167
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRING) {
|
|
168
|
+
for (var i = 0; i < listSize1; i++) {
|
|
169
|
+
var value2 = protocol.readString();
|
|
170
|
+
value1.push(value2);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
protocol.readListEnd();
|
|
174
|
+
result.recipeYield = value1;
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
protocol.skip(ftype);
|
|
178
|
+
}
|
|
179
|
+
break;
|
|
180
|
+
case 13:
|
|
181
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
182
|
+
var value1 = protocol.readString();
|
|
183
|
+
result.prepTime = value1;
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
protocol.skip(ftype);
|
|
187
|
+
}
|
|
188
|
+
break;
|
|
189
|
+
case 14:
|
|
190
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
191
|
+
var value1 = protocol.readString();
|
|
192
|
+
result.cookTime = value1;
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
protocol.skip(ftype);
|
|
196
|
+
}
|
|
197
|
+
break;
|
|
198
|
+
case 15:
|
|
199
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
200
|
+
var value1 = protocol.readString();
|
|
201
|
+
result.totalTime = value1;
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
protocol.skip(ftype);
|
|
205
|
+
}
|
|
206
|
+
break;
|
|
207
|
+
case 16:
|
|
208
|
+
if (ftype === thrift_1.Thrift.Type.STRUCT) {
|
|
209
|
+
var value1 = authorInfo_1.AuthorInfoSerde.read(protocol);
|
|
210
|
+
result.author = value1;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
protocol.skip(ftype);
|
|
214
|
+
}
|
|
215
|
+
break;
|
|
216
|
+
default:
|
|
217
|
+
protocol.skip(ftype);
|
|
218
|
+
}
|
|
219
|
+
protocol.readFieldEnd();
|
|
220
|
+
}
|
|
221
|
+
protocol.readStructEnd();
|
|
222
|
+
// @ts-ignore
|
|
223
|
+
return result;
|
|
224
|
+
};
|
|
225
|
+
SchemaRecipeSerde.write = function (protocol, value0) {
|
|
226
|
+
protocol.writeStructBegin('SchemaRecipe');
|
|
227
|
+
if (value0._at_context !== null && value0._at_context !== undefined) {
|
|
228
|
+
var value1 = value0._at_context;
|
|
229
|
+
protocol.writeFieldBegin('_at_context', thrift_1.Thrift.Type.STRING, 1);
|
|
230
|
+
protocol.writeString(value1);
|
|
231
|
+
protocol.writeFieldEnd();
|
|
232
|
+
}
|
|
233
|
+
if (value0._at_type !== null && value0._at_type !== undefined) {
|
|
234
|
+
var value1 = value0._at_type;
|
|
235
|
+
protocol.writeFieldBegin('_at_type', thrift_1.Thrift.Type.STRING, 2);
|
|
236
|
+
protocol.writeString(value1);
|
|
237
|
+
protocol.writeFieldEnd();
|
|
238
|
+
}
|
|
239
|
+
if (value0.name !== null && value0.name !== undefined) {
|
|
240
|
+
var value1 = value0.name;
|
|
241
|
+
protocol.writeFieldBegin('name', thrift_1.Thrift.Type.STRING, 3);
|
|
242
|
+
protocol.writeString(value1);
|
|
243
|
+
protocol.writeFieldEnd();
|
|
244
|
+
}
|
|
245
|
+
if (value0.description !== null && value0.description !== undefined) {
|
|
246
|
+
var value1 = value0.description;
|
|
247
|
+
protocol.writeFieldBegin('description', thrift_1.Thrift.Type.STRING, 4);
|
|
248
|
+
protocol.writeString(value1);
|
|
249
|
+
protocol.writeFieldEnd();
|
|
250
|
+
}
|
|
251
|
+
if (value0.image !== null && value0.image !== undefined) {
|
|
252
|
+
var value1 = value0.image;
|
|
253
|
+
protocol.writeFieldBegin('image', thrift_1.Thrift.Type.STRING, 5);
|
|
254
|
+
protocol.writeString(value1);
|
|
255
|
+
protocol.writeFieldEnd();
|
|
256
|
+
}
|
|
257
|
+
if (value0.datePublished !== null && value0.datePublished !== undefined) {
|
|
258
|
+
var value1 = value0.datePublished;
|
|
259
|
+
protocol.writeFieldBegin('datePublished', thrift_1.Thrift.Type.STRING, 6);
|
|
260
|
+
protocol.writeString(value1);
|
|
261
|
+
protocol.writeFieldEnd();
|
|
262
|
+
}
|
|
263
|
+
if (value0.url !== null && value0.url !== undefined) {
|
|
264
|
+
var value1 = value0.url;
|
|
265
|
+
protocol.writeFieldBegin('url', thrift_1.Thrift.Type.STRING, 7);
|
|
266
|
+
protocol.writeString(value1);
|
|
267
|
+
protocol.writeFieldEnd();
|
|
268
|
+
}
|
|
269
|
+
if (value0.recipeCategory !== null && value0.recipeCategory !== undefined) {
|
|
270
|
+
var value1 = value0.recipeCategory;
|
|
271
|
+
protocol.writeFieldBegin('recipeCategory', thrift_1.Thrift.Type.LIST, 8);
|
|
272
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRING, value1.length);
|
|
273
|
+
value1.forEach(function (value2) {
|
|
274
|
+
protocol.writeString(value2);
|
|
275
|
+
});
|
|
276
|
+
protocol.writeListEnd();
|
|
277
|
+
protocol.writeFieldEnd();
|
|
278
|
+
}
|
|
279
|
+
if (value0.recipeCuisine !== null && value0.recipeCuisine !== undefined) {
|
|
280
|
+
var value1 = value0.recipeCuisine;
|
|
281
|
+
protocol.writeFieldBegin('recipeCuisine', thrift_1.Thrift.Type.LIST, 9);
|
|
282
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRING, value1.length);
|
|
283
|
+
value1.forEach(function (value2) {
|
|
284
|
+
protocol.writeString(value2);
|
|
285
|
+
});
|
|
286
|
+
protocol.writeListEnd();
|
|
287
|
+
protocol.writeFieldEnd();
|
|
288
|
+
}
|
|
289
|
+
if (value0.recipeIngredient !== null && value0.recipeIngredient !== undefined) {
|
|
290
|
+
var value1 = value0.recipeIngredient;
|
|
291
|
+
protocol.writeFieldBegin('recipeIngredient', thrift_1.Thrift.Type.LIST, 10);
|
|
292
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRING, value1.length);
|
|
293
|
+
value1.forEach(function (value2) {
|
|
294
|
+
protocol.writeString(value2);
|
|
295
|
+
});
|
|
296
|
+
protocol.writeListEnd();
|
|
297
|
+
protocol.writeFieldEnd();
|
|
298
|
+
}
|
|
299
|
+
if (value0.recipeInstructions !== null && value0.recipeInstructions !== undefined) {
|
|
300
|
+
var value1 = value0.recipeInstructions;
|
|
301
|
+
protocol.writeFieldBegin('recipeInstructions', thrift_1.Thrift.Type.LIST, 11);
|
|
302
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
303
|
+
value1.forEach(function (value2) {
|
|
304
|
+
recipeStep_1.RecipeStepSerde.write(protocol, value2);
|
|
305
|
+
});
|
|
306
|
+
protocol.writeListEnd();
|
|
307
|
+
protocol.writeFieldEnd();
|
|
308
|
+
}
|
|
309
|
+
if (value0.recipeYield !== null && value0.recipeYield !== undefined) {
|
|
310
|
+
var value1 = value0.recipeYield;
|
|
311
|
+
protocol.writeFieldBegin('recipeYield', thrift_1.Thrift.Type.LIST, 12);
|
|
312
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRING, value1.length);
|
|
313
|
+
value1.forEach(function (value2) {
|
|
314
|
+
protocol.writeString(value2);
|
|
315
|
+
});
|
|
316
|
+
protocol.writeListEnd();
|
|
317
|
+
protocol.writeFieldEnd();
|
|
318
|
+
}
|
|
319
|
+
if (value0.prepTime !== null && value0.prepTime !== undefined) {
|
|
320
|
+
var value1 = value0.prepTime;
|
|
321
|
+
protocol.writeFieldBegin('prepTime', thrift_1.Thrift.Type.STRING, 13);
|
|
322
|
+
protocol.writeString(value1);
|
|
323
|
+
protocol.writeFieldEnd();
|
|
324
|
+
}
|
|
325
|
+
if (value0.cookTime !== null && value0.cookTime !== undefined) {
|
|
326
|
+
var value1 = value0.cookTime;
|
|
327
|
+
protocol.writeFieldBegin('cookTime', thrift_1.Thrift.Type.STRING, 14);
|
|
328
|
+
protocol.writeString(value1);
|
|
329
|
+
protocol.writeFieldEnd();
|
|
330
|
+
}
|
|
331
|
+
if (value0.totalTime !== null && value0.totalTime !== undefined) {
|
|
332
|
+
var value1 = value0.totalTime;
|
|
333
|
+
protocol.writeFieldBegin('totalTime', thrift_1.Thrift.Type.STRING, 15);
|
|
334
|
+
protocol.writeString(value1);
|
|
335
|
+
protocol.writeFieldEnd();
|
|
336
|
+
}
|
|
337
|
+
if (value0.author !== null && value0.author !== undefined) {
|
|
338
|
+
var value1 = value0.author;
|
|
339
|
+
protocol.writeFieldBegin('author', thrift_1.Thrift.Type.STRUCT, 16);
|
|
340
|
+
authorInfo_1.AuthorInfoSerde.write(protocol, value1);
|
|
341
|
+
protocol.writeFieldEnd();
|
|
342
|
+
}
|
|
343
|
+
protocol.writeFieldStop();
|
|
344
|
+
protocol.writeStructEnd();
|
|
345
|
+
};
|
|
346
|
+
return SchemaRecipeSerde;
|
|
347
|
+
}());
|
|
348
|
+
exports.SchemaRecipeSerde = SchemaRecipeSerde;
|
package/v1/blockElement.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { EmbedTracking } from './embedTracking';
|
|
|
17
17
|
import { ImageElementFields } from './imageElementFields';
|
|
18
18
|
import { InstagramElementFields } from './instagramElementFields';
|
|
19
19
|
import { InteractiveElementFields } from './interactiveElementFields';
|
|
20
|
+
import { ListElementFields } from './listElementFields';
|
|
20
21
|
import { MembershipElementFields } from './membershipElementFields';
|
|
21
22
|
import { PullquoteElementFields } from './pullquoteElementFields';
|
|
22
23
|
import { RecipeElementFields } from './recipeElementFields';
|
|
@@ -53,6 +54,7 @@ export interface BlockElement {
|
|
|
53
54
|
calloutTypeData?: CalloutElementFields;
|
|
54
55
|
cartoonTypeData?: CartoonElementFields;
|
|
55
56
|
recipeTypeData?: RecipeElementFields;
|
|
57
|
+
listTypeData?: ListElementFields;
|
|
56
58
|
}
|
|
57
59
|
export declare class BlockElementSerde {
|
|
58
60
|
static read(protocol: TProtocol): BlockElement;
|
package/v1/blockElement.js
CHANGED
|
@@ -19,6 +19,7 @@ var embedTracking_1 = require("./embedTracking");
|
|
|
19
19
|
var imageElementFields_1 = require("./imageElementFields");
|
|
20
20
|
var instagramElementFields_1 = require("./instagramElementFields");
|
|
21
21
|
var interactiveElementFields_1 = require("./interactiveElementFields");
|
|
22
|
+
var listElementFields_1 = require("./listElementFields");
|
|
22
23
|
var membershipElementFields_1 = require("./membershipElementFields");
|
|
23
24
|
var pullquoteElementFields_1 = require("./pullquoteElementFields");
|
|
24
25
|
var recipeElementFields_1 = require("./recipeElementFields");
|
|
@@ -278,6 +279,15 @@ var BlockElementSerde = /** @class */ (function () {
|
|
|
278
279
|
protocol.skip(ftype);
|
|
279
280
|
}
|
|
280
281
|
break;
|
|
282
|
+
case 26:
|
|
283
|
+
if (ftype === thrift_1.Thrift.Type.STRUCT) {
|
|
284
|
+
var value1 = listElementFields_1.ListElementFieldsSerde.read(protocol);
|
|
285
|
+
result.listTypeData = value1;
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
protocol.skip(ftype);
|
|
289
|
+
}
|
|
290
|
+
break;
|
|
281
291
|
default:
|
|
282
292
|
protocol.skip(ftype);
|
|
283
293
|
}
|
|
@@ -443,6 +453,12 @@ var BlockElementSerde = /** @class */ (function () {
|
|
|
443
453
|
recipeElementFields_1.RecipeElementFieldsSerde.write(protocol, value1);
|
|
444
454
|
protocol.writeFieldEnd();
|
|
445
455
|
}
|
|
456
|
+
if (value0.listTypeData !== null && value0.listTypeData !== undefined) {
|
|
457
|
+
var value1 = value0.listTypeData;
|
|
458
|
+
protocol.writeFieldBegin('listTypeData', thrift_1.Thrift.Type.STRUCT, 26);
|
|
459
|
+
listElementFields_1.ListElementFieldsSerde.write(protocol, value1);
|
|
460
|
+
protocol.writeFieldEnd();
|
|
461
|
+
}
|
|
446
462
|
protocol.writeFieldStop();
|
|
447
463
|
protocol.writeStructEnd();
|
|
448
464
|
};
|
package/v1/content.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { Debug } from './debug';
|
|
|
17
17
|
import { Element } from './element';
|
|
18
18
|
import { Reference } from './reference';
|
|
19
19
|
import { Rights } from './rights';
|
|
20
|
+
import { SchemaOrg } from './schemaOrg';
|
|
20
21
|
import { Section } from './section';
|
|
21
22
|
import { Tag } from './tag';
|
|
22
23
|
export interface Content {
|
|
@@ -46,6 +47,7 @@ export interface Content {
|
|
|
46
47
|
pillarName?: string;
|
|
47
48
|
aliasPaths?: AliasPath[];
|
|
48
49
|
channels?: ContentChannel[];
|
|
50
|
+
schemaOrg?: SchemaOrg;
|
|
49
51
|
}
|
|
50
52
|
export declare class ContentSerde {
|
|
51
53
|
static read(protocol: TProtocol): Content;
|
package/v1/content.js
CHANGED
|
@@ -20,6 +20,7 @@ var debug_1 = require("./debug");
|
|
|
20
20
|
var element_1 = require("./element");
|
|
21
21
|
var reference_1 = require("./reference");
|
|
22
22
|
var rights_1 = require("./rights");
|
|
23
|
+
var schemaOrg_1 = require("./schemaOrg");
|
|
23
24
|
var section_1 = require("./section");
|
|
24
25
|
var tag_1 = require("./tag");
|
|
25
26
|
var ContentSerde = /** @class */ (function () {
|
|
@@ -321,6 +322,15 @@ var ContentSerde = /** @class */ (function () {
|
|
|
321
322
|
protocol.skip(ftype);
|
|
322
323
|
}
|
|
323
324
|
break;
|
|
325
|
+
case 29:
|
|
326
|
+
if (ftype === thrift_1.Thrift.Type.STRUCT) {
|
|
327
|
+
var value1 = schemaOrg_1.SchemaOrgSerde.read(protocol);
|
|
328
|
+
result.schemaOrg = value1;
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
protocol.skip(ftype);
|
|
332
|
+
}
|
|
333
|
+
break;
|
|
324
334
|
default:
|
|
325
335
|
protocol.skip(ftype);
|
|
326
336
|
}
|
|
@@ -508,6 +518,12 @@ var ContentSerde = /** @class */ (function () {
|
|
|
508
518
|
protocol.writeListEnd();
|
|
509
519
|
protocol.writeFieldEnd();
|
|
510
520
|
}
|
|
521
|
+
if (value0.schemaOrg !== null && value0.schemaOrg !== undefined) {
|
|
522
|
+
var value1 = value0.schemaOrg;
|
|
523
|
+
protocol.writeFieldBegin('schemaOrg', thrift_1.Thrift.Type.STRUCT, 29);
|
|
524
|
+
schemaOrg_1.SchemaOrgSerde.write(protocol, value1);
|
|
525
|
+
protocol.writeFieldEnd();
|
|
526
|
+
}
|
|
511
527
|
protocol.writeFieldStop();
|
|
512
528
|
protocol.writeStructEnd();
|
|
513
529
|
};
|
package/v1/elementType.d.ts
CHANGED
package/v1/elementType.js
CHANGED
|
@@ -31,4 +31,5 @@ var ElementType;
|
|
|
31
31
|
ElementType[ElementType["CALLOUT"] = 20] = "CALLOUT";
|
|
32
32
|
ElementType[ElementType["CARTOON"] = 21] = "CARTOON";
|
|
33
33
|
ElementType[ElementType["RECIPE"] = 22] = "RECIPE";
|
|
34
|
+
ElementType[ElementType["LIST"] = 23] = "LIST";
|
|
34
35
|
})(ElementType || (exports.ElementType = ElementType = {}));
|
|
@@ -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
|
+
import { ListItem } from './listItem';
|
|
8
|
+
import { ListType } from './listType';
|
|
9
|
+
export interface ListElementFields {
|
|
10
|
+
items: ListItem[];
|
|
11
|
+
type?: ListType;
|
|
12
|
+
}
|
|
13
|
+
export declare class ListElementFieldsSerde {
|
|
14
|
+
static read(protocol: TProtocol): ListElementFields;
|
|
15
|
+
static write(protocol: TProtocol, value0: ListElementFields): void;
|
|
16
|
+
}
|
|
@@ -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.ListElementFieldsSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var listItem_1 = require("./listItem");
|
|
11
|
+
var ListElementFieldsSerde = /** @class */ (function () {
|
|
12
|
+
function ListElementFieldsSerde() {
|
|
13
|
+
}
|
|
14
|
+
ListElementFieldsSerde.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 = listItem_1.ListItemSerde.read(protocol);
|
|
34
|
+
value1.push(value2);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
protocol.readListEnd();
|
|
38
|
+
result.items = value1;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
protocol.skip(ftype);
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
case 2:
|
|
45
|
+
if (ftype === thrift_1.Thrift.Type.I32) {
|
|
46
|
+
var value1 = protocol.readI32();
|
|
47
|
+
result.type = 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
|
+
ListElementFieldsSerde.write = function (protocol, value0) {
|
|
63
|
+
protocol.writeStructBegin('ListElementFields');
|
|
64
|
+
if (value0.items !== null && value0.items !== undefined) {
|
|
65
|
+
var value1 = value0.items;
|
|
66
|
+
protocol.writeFieldBegin('items', thrift_1.Thrift.Type.LIST, 1);
|
|
67
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
68
|
+
value1.forEach(function (value2) {
|
|
69
|
+
listItem_1.ListItemSerde.write(protocol, value2);
|
|
70
|
+
});
|
|
71
|
+
protocol.writeListEnd();
|
|
72
|
+
protocol.writeFieldEnd();
|
|
73
|
+
}
|
|
74
|
+
if (value0.type !== null && value0.type !== undefined) {
|
|
75
|
+
var value1 = value0.type;
|
|
76
|
+
protocol.writeFieldBegin('type', thrift_1.Thrift.Type.I32, 2);
|
|
77
|
+
protocol.writeI32(value1);
|
|
78
|
+
protocol.writeFieldEnd();
|
|
79
|
+
}
|
|
80
|
+
protocol.writeFieldStop();
|
|
81
|
+
protocol.writeStructEnd();
|
|
82
|
+
};
|
|
83
|
+
return ListElementFieldsSerde;
|
|
84
|
+
}());
|
|
85
|
+
exports.ListElementFieldsSerde = ListElementFieldsSerde;
|
package/v1/listItem.d.ts
ADDED
|
@@ -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 { BlockElement } from './blockElement';
|
|
8
|
+
export interface ListItem {
|
|
9
|
+
elements: BlockElement[];
|
|
10
|
+
title?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class ListItemSerde {
|
|
13
|
+
static read(protocol: TProtocol): ListItem;
|
|
14
|
+
static write(protocol: TProtocol, value0: ListItem): void;
|
|
15
|
+
}
|
package/v1/listItem.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
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.ListItemSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var blockElement_1 = require("./blockElement");
|
|
11
|
+
var ListItemSerde = /** @class */ (function () {
|
|
12
|
+
function ListItemSerde() {
|
|
13
|
+
}
|
|
14
|
+
ListItemSerde.read = function (protocol) {
|
|
15
|
+
var _a;
|
|
16
|
+
protocol.readStructBegin();
|
|
17
|
+
var result = {
|
|
18
|
+
elements: [],
|
|
19
|
+
};
|
|
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.LIST) {
|
|
30
|
+
var listInfo1 = protocol.readListBegin();
|
|
31
|
+
var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
|
|
32
|
+
var value1 = [];
|
|
33
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
34
|
+
for (var i = 0; i < listSize1; i++) {
|
|
35
|
+
var value2 = blockElement_1.BlockElementSerde.read(protocol);
|
|
36
|
+
value1.push(value2);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
protocol.readListEnd();
|
|
40
|
+
result.elements = value1;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
protocol.skip(ftype);
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
46
|
+
case 2:
|
|
47
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
48
|
+
var value1 = protocol.readString();
|
|
49
|
+
result.title = value1;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
protocol.skip(ftype);
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
default:
|
|
56
|
+
protocol.skip(ftype);
|
|
57
|
+
}
|
|
58
|
+
protocol.readFieldEnd();
|
|
59
|
+
}
|
|
60
|
+
protocol.readStructEnd();
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
return result;
|
|
63
|
+
};
|
|
64
|
+
ListItemSerde.write = function (protocol, value0) {
|
|
65
|
+
protocol.writeStructBegin('ListItem');
|
|
66
|
+
if (value0.elements !== null && value0.elements !== undefined) {
|
|
67
|
+
var value1 = value0.elements;
|
|
68
|
+
protocol.writeFieldBegin('elements', thrift_1.Thrift.Type.LIST, 1);
|
|
69
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
70
|
+
value1.forEach(function (value2) {
|
|
71
|
+
blockElement_1.BlockElementSerde.write(protocol, value2);
|
|
72
|
+
});
|
|
73
|
+
protocol.writeListEnd();
|
|
74
|
+
protocol.writeFieldEnd();
|
|
75
|
+
}
|
|
76
|
+
if (value0.title !== null && value0.title !== undefined) {
|
|
77
|
+
var value1 = value0.title;
|
|
78
|
+
protocol.writeFieldBegin('title', thrift_1.Thrift.Type.STRING, 2);
|
|
79
|
+
protocol.writeString(value1);
|
|
80
|
+
protocol.writeFieldEnd();
|
|
81
|
+
}
|
|
82
|
+
protocol.writeFieldStop();
|
|
83
|
+
protocol.writeStructEnd();
|
|
84
|
+
};
|
|
85
|
+
return ListItemSerde;
|
|
86
|
+
}());
|
|
87
|
+
exports.ListItemSerde = ListItemSerde;
|
package/v1/listType.d.ts
ADDED
package/v1/listType.js
ADDED
|
@@ -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.ListType = void 0;
|
|
9
|
+
var ListType;
|
|
10
|
+
(function (ListType) {
|
|
11
|
+
ListType[ListType["KEY_TAKEAWAYS"] = 1] = "KEY_TAKEAWAYS";
|
|
12
|
+
ListType[ListType["Q_AND_A_EXPLAINER"] = 2] = "Q_AND_A_EXPLAINER";
|
|
13
|
+
})(ListType || (exports.ListType = ListType = {}));
|
|
@@ -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
|
+
import { SchemaRecipe } from '../schemaorg/schemaRecipe';
|
|
8
|
+
export interface SchemaOrg {
|
|
9
|
+
recipe?: SchemaRecipe[];
|
|
10
|
+
}
|
|
11
|
+
export declare class SchemaOrgSerde {
|
|
12
|
+
static read(protocol: TProtocol): SchemaOrg;
|
|
13
|
+
static write(protocol: TProtocol, value0: SchemaOrg): void;
|
|
14
|
+
}
|
package/v1/schemaOrg.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.SchemaOrgSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var schemaRecipe_1 = require("../schemaorg/schemaRecipe");
|
|
11
|
+
var SchemaOrgSerde = /** @class */ (function () {
|
|
12
|
+
function SchemaOrgSerde() {
|
|
13
|
+
}
|
|
14
|
+
SchemaOrgSerde.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 = schemaRecipe_1.SchemaRecipeSerde.read(protocol);
|
|
34
|
+
value1.push(value2);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
protocol.readListEnd();
|
|
38
|
+
result.recipe = value1;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
protocol.skip(ftype);
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
default:
|
|
45
|
+
protocol.skip(ftype);
|
|
46
|
+
}
|
|
47
|
+
protocol.readFieldEnd();
|
|
48
|
+
}
|
|
49
|
+
protocol.readStructEnd();
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
return result;
|
|
52
|
+
};
|
|
53
|
+
SchemaOrgSerde.write = function (protocol, value0) {
|
|
54
|
+
protocol.writeStructBegin('SchemaOrg');
|
|
55
|
+
if (value0.recipe !== null && value0.recipe !== undefined) {
|
|
56
|
+
var value1 = value0.recipe;
|
|
57
|
+
protocol.writeFieldBegin('recipe', thrift_1.Thrift.Type.LIST, 1);
|
|
58
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
59
|
+
value1.forEach(function (value2) {
|
|
60
|
+
schemaRecipe_1.SchemaRecipeSerde.write(protocol, value2);
|
|
61
|
+
});
|
|
62
|
+
protocol.writeListEnd();
|
|
63
|
+
protocol.writeFieldEnd();
|
|
64
|
+
}
|
|
65
|
+
protocol.writeFieldStop();
|
|
66
|
+
protocol.writeStructEnd();
|
|
67
|
+
};
|
|
68
|
+
return SchemaOrgSerde;
|
|
69
|
+
}());
|
|
70
|
+
exports.SchemaOrgSerde = SchemaOrgSerde;
|