@guardian/content-api-models 4.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.
Files changed (192) hide show
  1. package/auxiliaryatomevent/v1/auxiliaryAtom.d.ts +14 -0
  2. package/auxiliaryatomevent/v1/auxiliaryAtom.js +70 -0
  3. package/auxiliaryatomevent/v1/auxiliaryAtomEvent.d.ts +17 -0
  4. package/auxiliaryatomevent/v1/auxiliaryAtomEvent.js +100 -0
  5. package/auxiliaryatomevent/v1/eventType.d.ts +9 -0
  6. package/auxiliaryatomevent/v1/eventType.js +13 -0
  7. package/crier/event/v1/deletedContent.d.ts +14 -0
  8. package/crier/event/v1/deletedContent.js +70 -0
  9. package/crier/event/v1/event.d.ts +21 -0
  10. package/crier/event/v1/event.js +116 -0
  11. package/crier/event/v1/eventPayload.d.ts +27 -0
  12. package/crier/event/v1/eventPayload.js +118 -0
  13. package/crier/event/v1/eventType.d.ts +10 -0
  14. package/crier/event/v1/eventType.js +14 -0
  15. package/crier/event/v1/itemType.d.ts +12 -0
  16. package/crier/event/v1/itemType.js +16 -0
  17. package/crier/event/v1/retrievableContent.d.ts +21 -0
  18. package/crier/event/v1/retrievableContent.js +145 -0
  19. package/fastly/event/v1/contentDecachedEvent.d.ts +19 -0
  20. package/fastly/event/v1/contentDecachedEvent.js +100 -0
  21. package/fastly/event/v1/eventType.d.ts +9 -0
  22. package/fastly/event/v1/eventType.js +13 -0
  23. package/package.json +24 -0
  24. package/tsconfig.json +15 -0
  25. package/v1/aliasPath.d.ts +15 -0
  26. package/v1/aliasPath.js +71 -0
  27. package/v1/asset.d.ts +18 -0
  28. package/v1/asset.js +101 -0
  29. package/v1/assetFields.d.ts +85 -0
  30. package/v1/assetFields.js +1106 -0
  31. package/v1/assetType.d.ts +13 -0
  32. package/v1/assetType.js +17 -0
  33. package/v1/atomUsageResponse.d.ts +20 -0
  34. package/v1/atomUsageResponse.js +174 -0
  35. package/v1/atoms.d.ts +29 -0
  36. package/v1/atoms.js +490 -0
  37. package/v1/atomsResponse.d.ts +21 -0
  38. package/v1/atomsResponse.js +175 -0
  39. package/v1/audioElementFields.d.ts +25 -0
  40. package/v1/audioElementFields.js +235 -0
  41. package/v1/block.d.ts +30 -0
  42. package/v1/block.js +283 -0
  43. package/v1/blockAttributes.d.ts +18 -0
  44. package/v1/blockAttributes.js +116 -0
  45. package/v1/blockElement.d.ts +60 -0
  46. package/v1/blockElement.js +451 -0
  47. package/v1/blocks.d.ts +19 -0
  48. package/v1/blocks.js +144 -0
  49. package/v1/calloutElementFields.d.ts +17 -0
  50. package/v1/calloutElementFields.js +115 -0
  51. package/v1/capiDateTime.d.ts +15 -0
  52. package/v1/capiDateTime.js +70 -0
  53. package/v1/cartoonElementFields.d.ts +22 -0
  54. package/v1/cartoonElementFields.js +190 -0
  55. package/v1/cartoonImage.d.ts +17 -0
  56. package/v1/cartoonImage.js +115 -0
  57. package/v1/cartoonVariant.d.ts +15 -0
  58. package/v1/cartoonVariant.js +85 -0
  59. package/v1/channelFields.d.ts +15 -0
  60. package/v1/channelFields.js +71 -0
  61. package/v1/codeElementFields.d.ts +14 -0
  62. package/v1/codeElementFields.js +70 -0
  63. package/v1/commentElementFields.d.ts +24 -0
  64. package/v1/commentElementFields.js +220 -0
  65. package/v1/content.d.ts +53 -0
  66. package/v1/content.js +516 -0
  67. package/v1/contentAtomElementFields.d.ts +16 -0
  68. package/v1/contentAtomElementFields.js +100 -0
  69. package/v1/contentChannel.d.ts +15 -0
  70. package/v1/contentChannel.js +71 -0
  71. package/v1/contentFields.d.ts +67 -0
  72. package/v1/contentFields.js +821 -0
  73. package/v1/contentStats.d.ts +27 -0
  74. package/v1/contentStats.js +265 -0
  75. package/v1/contentType.d.ts +15 -0
  76. package/v1/contentType.js +19 -0
  77. package/v1/crossword.d.ts +31 -0
  78. package/v1/crossword.js +268 -0
  79. package/v1/crosswordCreator.d.ts +14 -0
  80. package/v1/crosswordCreator.js +70 -0
  81. package/v1/crosswordDimensions.d.ts +14 -0
  82. package/v1/crosswordDimensions.js +70 -0
  83. package/v1/crosswordEntry.d.ts +26 -0
  84. package/v1/crosswordEntry.js +249 -0
  85. package/v1/crosswordPosition.d.ts +14 -0
  86. package/v1/crosswordPosition.js +70 -0
  87. package/v1/crosswordType.d.ts +15 -0
  88. package/v1/crosswordType.js +19 -0
  89. package/v1/debug.d.ts +18 -0
  90. package/v1/debug.js +101 -0
  91. package/v1/edition.d.ts +17 -0
  92. package/v1/edition.js +115 -0
  93. package/v1/editionsResponse.d.ts +17 -0
  94. package/v1/editionsResponse.js +115 -0
  95. package/v1/element.d.ts +19 -0
  96. package/v1/element.js +130 -0
  97. package/v1/elementType.d.ts +30 -0
  98. package/v1/elementType.js +34 -0
  99. package/v1/embedElementFields.d.ts +20 -0
  100. package/v1/embedElementFields.js +160 -0
  101. package/v1/embedReach.d.ts +14 -0
  102. package/v1/embedReach.js +69 -0
  103. package/v1/embedTracking.d.ts +14 -0
  104. package/v1/embedTracking.js +58 -0
  105. package/v1/embedTracksType.d.ts +10 -0
  106. package/v1/embedTracksType.js +14 -0
  107. package/v1/entitiesResponse.d.ts +16 -0
  108. package/v1/entitiesResponse.js +100 -0
  109. package/v1/errorResponse.d.ts +14 -0
  110. package/v1/errorResponse.js +70 -0
  111. package/v1/imageElementFields.d.ts +26 -0
  112. package/v1/imageElementFields.js +250 -0
  113. package/v1/instagramElementFields.d.ts +23 -0
  114. package/v1/instagramElementFields.js +205 -0
  115. package/v1/interactiveElementFields.d.ts +24 -0
  116. package/v1/interactiveElementFields.js +220 -0
  117. package/v1/itemResponse.d.ts +53 -0
  118. package/v1/itemResponse.js +676 -0
  119. package/v1/membershipElementFields.d.ts +25 -0
  120. package/v1/membershipElementFields.js +221 -0
  121. package/v1/membershipPlaceholder.d.ts +13 -0
  122. package/v1/membershipPlaceholder.js +55 -0
  123. package/v1/membershipTier.d.ts +9 -0
  124. package/v1/membershipTier.js +13 -0
  125. package/v1/mostViewedVideo.d.ts +14 -0
  126. package/v1/mostViewedVideo.js +70 -0
  127. package/v1/networkFront.d.ts +18 -0
  128. package/v1/networkFront.js +130 -0
  129. package/v1/office.d.ts +10 -0
  130. package/v1/office.js +14 -0
  131. package/v1/package.d.ts +18 -0
  132. package/v1/package.js +116 -0
  133. package/v1/packageArticle.d.ts +16 -0
  134. package/v1/packageArticle.js +72 -0
  135. package/v1/packagesResponse.d.ts +22 -0
  136. package/v1/packagesResponse.js +190 -0
  137. package/v1/pillar.d.ts +15 -0
  138. package/v1/pillar.js +99 -0
  139. package/v1/pillarsResponse.d.ts +16 -0
  140. package/v1/pillarsResponse.js +100 -0
  141. package/v1/platformType.d.ts +10 -0
  142. package/v1/platformType.js +14 -0
  143. package/v1/podcast.d.ts +25 -0
  144. package/v1/podcast.js +235 -0
  145. package/v1/podcastCategory.d.ts +14 -0
  146. package/v1/podcastCategory.js +70 -0
  147. package/v1/pullquoteElementFields.d.ts +17 -0
  148. package/v1/pullquoteElementFields.js +115 -0
  149. package/v1/recipeElementFields.d.ts +13 -0
  150. package/v1/recipeElementFields.js +55 -0
  151. package/v1/reference.d.ts +14 -0
  152. package/v1/reference.js +70 -0
  153. package/v1/richLinkElementFields.d.ts +19 -0
  154. package/v1/richLinkElementFields.js +131 -0
  155. package/v1/rights.d.ts +15 -0
  156. package/v1/rights.js +89 -0
  157. package/v1/searchResponse.d.ts +22 -0
  158. package/v1/searchResponse.js +190 -0
  159. package/v1/section.d.ts +20 -0
  160. package/v1/section.js +159 -0
  161. package/v1/sectionsResponse.d.ts +17 -0
  162. package/v1/sectionsResponse.js +115 -0
  163. package/v1/sponsorship.d.ts +27 -0
  164. package/v1/sponsorship.js +208 -0
  165. package/v1/sponsorshipLogoDimensions.d.ts +14 -0
  166. package/v1/sponsorshipLogoDimensions.js +70 -0
  167. package/v1/sponsorshipTargeting.d.ts +15 -0
  168. package/v1/sponsorshipTargeting.js +85 -0
  169. package/v1/sponsorshipType.d.ts +10 -0
  170. package/v1/sponsorshipType.js +14 -0
  171. package/v1/standardElementFields.d.ts +25 -0
  172. package/v1/standardElementFields.js +235 -0
  173. package/v1/tag.d.ts +42 -0
  174. package/v1/tag.js +486 -0
  175. package/v1/tagType.d.ts +19 -0
  176. package/v1/tagType.js +23 -0
  177. package/v1/tagsResponse.d.ts +21 -0
  178. package/v1/tagsResponse.js +175 -0
  179. package/v1/textElementFields.d.ts +14 -0
  180. package/v1/textElementFields.js +70 -0
  181. package/v1/tweetElementFields.d.ts +20 -0
  182. package/v1/tweetElementFields.js +160 -0
  183. package/v1/user.d.ts +15 -0
  184. package/v1/user.js +85 -0
  185. package/v1/videoElementFields.d.ts +33 -0
  186. package/v1/videoElementFields.js +355 -0
  187. package/v1/videoStatsResponse.d.ts +15 -0
  188. package/v1/videoStatsResponse.js +85 -0
  189. package/v1/vineElementFields.d.ts +24 -0
  190. package/v1/vineElementFields.js +220 -0
  191. package/v1/witnessElementFields.d.ts +40 -0
  192. package/v1/witnessElementFields.js +446 -0
@@ -0,0 +1,145 @@
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.RetrievableContentSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var aliasPath_1 = require("../../../v1/aliasPath");
11
+ var RetrievableContentSerde = /** @class */ (function () {
12
+ function RetrievableContentSerde() {
13
+ }
14
+ RetrievableContentSerde.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.id = value1;
30
+ }
31
+ else {
32
+ protocol.skip(ftype);
33
+ }
34
+ break;
35
+ case 2:
36
+ if (ftype === thrift_1.Thrift.Type.STRING) {
37
+ var value1 = protocol.readString();
38
+ result.capiUrl = value1;
39
+ }
40
+ else {
41
+ protocol.skip(ftype);
42
+ }
43
+ break;
44
+ case 3:
45
+ if (ftype === thrift_1.Thrift.Type.I64) {
46
+ var value1 = protocol.readI64();
47
+ result.lastModifiedDate = value1;
48
+ }
49
+ else {
50
+ protocol.skip(ftype);
51
+ }
52
+ break;
53
+ case 4:
54
+ if (ftype === thrift_1.Thrift.Type.I32) {
55
+ var value1 = protocol.readI32();
56
+ result.internalRevision = value1;
57
+ }
58
+ else {
59
+ protocol.skip(ftype);
60
+ }
61
+ break;
62
+ case 5:
63
+ if (ftype === thrift_1.Thrift.Type.I32) {
64
+ var value1 = protocol.readI32();
65
+ result.contentType = value1;
66
+ }
67
+ else {
68
+ protocol.skip(ftype);
69
+ }
70
+ break;
71
+ case 7:
72
+ if (ftype === thrift_1.Thrift.Type.LIST) {
73
+ var listInfo1 = protocol.readListBegin();
74
+ var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
75
+ var value1 = [];
76
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
77
+ for (var i = 0; i < listSize1; i++) {
78
+ var value2 = aliasPath_1.AliasPathSerde.read(protocol);
79
+ value1.push(value2);
80
+ }
81
+ }
82
+ protocol.readListEnd();
83
+ result.aliasPaths = value1;
84
+ }
85
+ else {
86
+ protocol.skip(ftype);
87
+ }
88
+ break;
89
+ default:
90
+ protocol.skip(ftype);
91
+ }
92
+ protocol.readFieldEnd();
93
+ }
94
+ protocol.readStructEnd();
95
+ // @ts-ignore
96
+ return result;
97
+ };
98
+ RetrievableContentSerde.write = function (protocol, value0) {
99
+ protocol.writeStructBegin('RetrievableContent');
100
+ if (value0.id !== null && value0.id !== undefined) {
101
+ var value1 = value0.id;
102
+ protocol.writeFieldBegin('id', thrift_1.Thrift.Type.STRING, 1);
103
+ protocol.writeString(value1);
104
+ protocol.writeFieldEnd();
105
+ }
106
+ if (value0.capiUrl !== null && value0.capiUrl !== undefined) {
107
+ var value1 = value0.capiUrl;
108
+ protocol.writeFieldBegin('capiUrl', thrift_1.Thrift.Type.STRING, 2);
109
+ protocol.writeString(value1);
110
+ protocol.writeFieldEnd();
111
+ }
112
+ if (value0.lastModifiedDate !== null && value0.lastModifiedDate !== undefined) {
113
+ var value1 = value0.lastModifiedDate;
114
+ protocol.writeFieldBegin('lastModifiedDate', thrift_1.Thrift.Type.I64, 3);
115
+ protocol.writeI64(value1);
116
+ protocol.writeFieldEnd();
117
+ }
118
+ if (value0.internalRevision !== null && value0.internalRevision !== undefined) {
119
+ var value1 = value0.internalRevision;
120
+ protocol.writeFieldBegin('internalRevision', thrift_1.Thrift.Type.I32, 4);
121
+ protocol.writeI32(value1);
122
+ protocol.writeFieldEnd();
123
+ }
124
+ if (value0.contentType !== null && value0.contentType !== undefined) {
125
+ var value1 = value0.contentType;
126
+ protocol.writeFieldBegin('contentType', thrift_1.Thrift.Type.I32, 5);
127
+ protocol.writeI32(value1);
128
+ protocol.writeFieldEnd();
129
+ }
130
+ if (value0.aliasPaths !== null && value0.aliasPaths !== undefined) {
131
+ var value1 = value0.aliasPaths;
132
+ protocol.writeFieldBegin('aliasPaths', thrift_1.Thrift.Type.LIST, 7);
133
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
134
+ value1.forEach(function (value2) {
135
+ aliasPath_1.AliasPathSerde.write(protocol, value2);
136
+ });
137
+ protocol.writeListEnd();
138
+ protocol.writeFieldEnd();
139
+ }
140
+ protocol.writeFieldStop();
141
+ protocol.writeStructEnd();
142
+ };
143
+ return RetrievableContentSerde;
144
+ }());
145
+ exports.RetrievableContentSerde = RetrievableContentSerde;
@@ -0,0 +1,19 @@
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 Int64 from 'node-int64';
8
+ import { ContentType } from '../../../v1/contentType';
9
+ import { EventType } from './eventType';
10
+ export interface ContentDecachedEvent {
11
+ contentPath: string;
12
+ eventType: EventType;
13
+ contentType?: ContentType;
14
+ eventPublished?: Int64;
15
+ }
16
+ export declare class ContentDecachedEventSerde {
17
+ static read(protocol: TProtocol): ContentDecachedEvent;
18
+ static write(protocol: TProtocol, value0: ContentDecachedEvent): void;
19
+ }
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ /**
3
+ * Autogenerated by scrooge-generator-extras
4
+ *
5
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ContentDecachedEventSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var ContentDecachedEventSerde = /** @class */ (function () {
11
+ function ContentDecachedEventSerde() {
12
+ }
13
+ ContentDecachedEventSerde.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.contentPath = value1;
28
+ }
29
+ else {
30
+ protocol.skip(ftype);
31
+ }
32
+ break;
33
+ case 2:
34
+ if (ftype === thrift_1.Thrift.Type.I32) {
35
+ var value1 = protocol.readI32();
36
+ result.eventType = 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.contentType = value1;
46
+ }
47
+ else {
48
+ protocol.skip(ftype);
49
+ }
50
+ break;
51
+ case 5:
52
+ if (ftype === thrift_1.Thrift.Type.I64) {
53
+ var value1 = protocol.readI64();
54
+ result.eventPublished = 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
+ ContentDecachedEventSerde.write = function (protocol, value0) {
70
+ protocol.writeStructBegin('ContentDecachedEvent');
71
+ if (value0.contentPath !== null && value0.contentPath !== undefined) {
72
+ var value1 = value0.contentPath;
73
+ protocol.writeFieldBegin('contentPath', thrift_1.Thrift.Type.STRING, 1);
74
+ protocol.writeString(value1);
75
+ protocol.writeFieldEnd();
76
+ }
77
+ if (value0.eventType !== null && value0.eventType !== undefined) {
78
+ var value1 = value0.eventType;
79
+ protocol.writeFieldBegin('eventType', thrift_1.Thrift.Type.I32, 2);
80
+ protocol.writeI32(value1);
81
+ protocol.writeFieldEnd();
82
+ }
83
+ if (value0.contentType !== null && value0.contentType !== undefined) {
84
+ var value1 = value0.contentType;
85
+ protocol.writeFieldBegin('contentType', thrift_1.Thrift.Type.I32, 3);
86
+ protocol.writeI32(value1);
87
+ protocol.writeFieldEnd();
88
+ }
89
+ if (value0.eventPublished !== null && value0.eventPublished !== undefined) {
90
+ var value1 = value0.eventPublished;
91
+ protocol.writeFieldBegin('eventPublished', thrift_1.Thrift.Type.I64, 5);
92
+ protocol.writeI64(value1);
93
+ protocol.writeFieldEnd();
94
+ }
95
+ protocol.writeFieldStop();
96
+ protocol.writeStructEnd();
97
+ };
98
+ return ContentDecachedEventSerde;
99
+ }());
100
+ exports.ContentDecachedEventSerde = ContentDecachedEventSerde;
@@ -0,0 +1,9 @@
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
+ export declare enum EventType {
7
+ UPDATE = 1,
8
+ DELETE = 2
9
+ }
@@ -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.EventType = void 0;
9
+ var EventType;
10
+ (function (EventType) {
11
+ EventType[EventType["UPDATE"] = 1] = "UPDATE";
12
+ EventType[EventType["DELETE"] = 2] = "DELETE";
13
+ })(EventType || (exports.EventType = EventType = {}));
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+
2
+ {
3
+ "name": "@guardian/content-api-models",
4
+ "version": "4.0.0",
5
+ "description": "Typescript library built from the content api thrift definitions",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": ""
9
+ },
10
+ "author": "",
11
+ "license": "Apache-2.0",
12
+ "devDependencies": {
13
+ "typescript": "^5.2.2"
14
+ },
15
+ "dependencies": {
16
+ "@guardian/story-packages-model": "^2.2.0",
17
+ "@guardian/content-entity-model": "^2.2.1",
18
+ "@types/thrift": "^0.10.11",
19
+ "thrift": "^0.15.0",
20
+ "@guardian/content-atom-model": "^4.0.0",
21
+ "@types/node-int64": "^0.4.29",
22
+ "node-int64": "^0.4.0"
23
+ }
24
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,15 @@
1
+
2
+ {
3
+ "compilerOptions": {
4
+ "target": "es5",
5
+ "module": "commonjs",
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "skipLibCheck": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "declaration": true,
11
+ // this is to disable searching in ../node_modules as it can trigger compilation errors unrelated to this
12
+ // self contained project
13
+ "typeRoots": ["./node_modules/@types"],
14
+ }
15
+ }
@@ -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 { CapiDateTime } from './capiDateTime';
8
+ export interface AliasPath {
9
+ path: string;
10
+ ceasedToBeCanonicalAt: CapiDateTime;
11
+ }
12
+ export declare class AliasPathSerde {
13
+ static read(protocol: TProtocol): AliasPath;
14
+ static write(protocol: TProtocol, value0: AliasPath): void;
15
+ }
@@ -0,0 +1,71 @@
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.AliasPathSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var capiDateTime_1 = require("./capiDateTime");
11
+ var AliasPathSerde = /** @class */ (function () {
12
+ function AliasPathSerde() {
13
+ }
14
+ AliasPathSerde.read = function (protocol) {
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.path = value1;
29
+ }
30
+ else {
31
+ protocol.skip(ftype);
32
+ }
33
+ break;
34
+ case 2:
35
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
36
+ var value1 = capiDateTime_1.CapiDateTimeSerde.read(protocol);
37
+ result.ceasedToBeCanonicalAt = value1;
38
+ }
39
+ else {
40
+ protocol.skip(ftype);
41
+ }
42
+ break;
43
+ default:
44
+ protocol.skip(ftype);
45
+ }
46
+ protocol.readFieldEnd();
47
+ }
48
+ protocol.readStructEnd();
49
+ // @ts-ignore
50
+ return result;
51
+ };
52
+ AliasPathSerde.write = function (protocol, value0) {
53
+ protocol.writeStructBegin('AliasPath');
54
+ if (value0.path !== null && value0.path !== undefined) {
55
+ var value1 = value0.path;
56
+ protocol.writeFieldBegin('path', thrift_1.Thrift.Type.STRING, 1);
57
+ protocol.writeString(value1);
58
+ protocol.writeFieldEnd();
59
+ }
60
+ if (value0.ceasedToBeCanonicalAt !== null && value0.ceasedToBeCanonicalAt !== undefined) {
61
+ var value1 = value0.ceasedToBeCanonicalAt;
62
+ protocol.writeFieldBegin('ceasedToBeCanonicalAt', thrift_1.Thrift.Type.STRUCT, 2);
63
+ capiDateTime_1.CapiDateTimeSerde.write(protocol, value1);
64
+ protocol.writeFieldEnd();
65
+ }
66
+ protocol.writeFieldStop();
67
+ protocol.writeStructEnd();
68
+ };
69
+ return AliasPathSerde;
70
+ }());
71
+ exports.AliasPathSerde = AliasPathSerde;
package/v1/asset.d.ts ADDED
@@ -0,0 +1,18 @@
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 { AssetFields } from './assetFields';
8
+ import { AssetType } from './assetType';
9
+ export interface Asset {
10
+ type: AssetType;
11
+ mimeType?: string;
12
+ file?: string;
13
+ typeData?: AssetFields;
14
+ }
15
+ export declare class AssetSerde {
16
+ static read(protocol: TProtocol): Asset;
17
+ static write(protocol: TProtocol, value0: Asset): void;
18
+ }
package/v1/asset.js ADDED
@@ -0,0 +1,101 @@
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.AssetSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var assetFields_1 = require("./assetFields");
11
+ var AssetSerde = /** @class */ (function () {
12
+ function AssetSerde() {
13
+ }
14
+ AssetSerde.read = function (protocol) {
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.I32) {
27
+ var value1 = protocol.readI32();
28
+ result.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.mimeType = 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.file = value1;
47
+ }
48
+ else {
49
+ protocol.skip(ftype);
50
+ }
51
+ break;
52
+ case 4:
53
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
54
+ var value1 = assetFields_1.AssetFieldsSerde.read(protocol);
55
+ result.typeData = 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
+ AssetSerde.write = function (protocol, value0) {
71
+ protocol.writeStructBegin('Asset');
72
+ if (value0.type !== null && value0.type !== undefined) {
73
+ var value1 = value0.type;
74
+ protocol.writeFieldBegin('type', thrift_1.Thrift.Type.I32, 1);
75
+ protocol.writeI32(value1);
76
+ protocol.writeFieldEnd();
77
+ }
78
+ if (value0.mimeType !== null && value0.mimeType !== undefined) {
79
+ var value1 = value0.mimeType;
80
+ protocol.writeFieldBegin('mimeType', thrift_1.Thrift.Type.STRING, 2);
81
+ protocol.writeString(value1);
82
+ protocol.writeFieldEnd();
83
+ }
84
+ if (value0.file !== null && value0.file !== undefined) {
85
+ var value1 = value0.file;
86
+ protocol.writeFieldBegin('file', thrift_1.Thrift.Type.STRING, 3);
87
+ protocol.writeString(value1);
88
+ protocol.writeFieldEnd();
89
+ }
90
+ if (value0.typeData !== null && value0.typeData !== undefined) {
91
+ var value1 = value0.typeData;
92
+ protocol.writeFieldBegin('typeData', thrift_1.Thrift.Type.STRUCT, 4);
93
+ assetFields_1.AssetFieldsSerde.write(protocol, value1);
94
+ protocol.writeFieldEnd();
95
+ }
96
+ protocol.writeFieldStop();
97
+ protocol.writeStructEnd();
98
+ };
99
+ return AssetSerde;
100
+ }());
101
+ exports.AssetSerde = AssetSerde;
@@ -0,0 +1,85 @@
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 Int64 from 'node-int64';
8
+ import { CapiDateTime } from './capiDateTime';
9
+ import { CartoonVariant } from './cartoonVariant';
10
+ export interface AssetFields {
11
+ aspectRatio?: string;
12
+ altText?: string;
13
+ isInappropriateForAdverts?: boolean;
14
+ caption?: string;
15
+ credit?: string;
16
+ embeddable?: boolean;
17
+ photographer?: string;
18
+ source?: string;
19
+ stillImageUrl?: string;
20
+ width?: number;
21
+ height?: number;
22
+ name?: string;
23
+ secureFile?: string;
24
+ isMaster?: boolean;
25
+ sizeInBytes?: Int64;
26
+ durationMinutes?: number;
27
+ durationSeconds?: number;
28
+ displayCredit?: boolean;
29
+ thumbnailUrl?: string;
30
+ role?: string;
31
+ mediaId?: string;
32
+ iframeUrl?: string;
33
+ scriptName?: string;
34
+ scriptUrl?: string;
35
+ blockAds?: boolean;
36
+ html?: string;
37
+ embedType?: string;
38
+ explicit?: boolean;
39
+ clean?: boolean;
40
+ thumbnailImageUrl?: string;
41
+ linkText?: string;
42
+ linkPrefix?: string;
43
+ shortUrl?: string;
44
+ imageType?: string;
45
+ suppliersReference?: string;
46
+ mediaApiUri?: string;
47
+ copyright?: string;
48
+ mimeType?: string;
49
+ url?: string;
50
+ originalUrl?: string;
51
+ id?: string;
52
+ attribution?: string;
53
+ description?: string;
54
+ title?: string;
55
+ contentAuthSystem?: string;
56
+ alt?: string;
57
+ picdarUrn?: string;
58
+ comment?: string;
59
+ witnessEmbedType?: string;
60
+ authorName?: string;
61
+ authorUsername?: string;
62
+ authorWitnessProfileUrl?: string;
63
+ authorGuardianProfileUrl?: string;
64
+ apiUrl?: string;
65
+ dateCreated?: CapiDateTime;
66
+ youtubeUrl?: string;
67
+ youtubeSource?: string;
68
+ youtubeTitle?: string;
69
+ youtubeDescription?: string;
70
+ youtubeAuthorName?: string;
71
+ youtubeHtml?: string;
72
+ venue?: string;
73
+ location?: string;
74
+ identifier?: string;
75
+ price?: string;
76
+ start?: CapiDateTime;
77
+ end?: CapiDateTime;
78
+ safeEmbedCode?: boolean;
79
+ isMandatory?: boolean;
80
+ cartoonVariants?: CartoonVariant[];
81
+ }
82
+ export declare class AssetFieldsSerde {
83
+ static read(protocol: TProtocol): AssetFields;
84
+ static write(protocol: TProtocol, value0: AssetFields): void;
85
+ }