@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,14 @@
1
+ /**
2
+ * Autogenerated by scrooge-generator-extras
3
+ *
4
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ */
6
+ import { TProtocol } from 'thrift';
7
+ export interface AuxiliaryAtom {
8
+ atomId: string;
9
+ atomType: string;
10
+ }
11
+ export declare class AuxiliaryAtomSerde {
12
+ static read(protocol: TProtocol): AuxiliaryAtom;
13
+ static write(protocol: TProtocol, value0: AuxiliaryAtom): void;
14
+ }
@@ -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.AuxiliaryAtomSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var AuxiliaryAtomSerde = /** @class */ (function () {
11
+ function AuxiliaryAtomSerde() {
12
+ }
13
+ AuxiliaryAtomSerde.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.atomId = 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.atomType = value1;
37
+ }
38
+ else {
39
+ protocol.skip(ftype);
40
+ }
41
+ break;
42
+ default:
43
+ protocol.skip(ftype);
44
+ }
45
+ protocol.readFieldEnd();
46
+ }
47
+ protocol.readStructEnd();
48
+ // @ts-ignore
49
+ return result;
50
+ };
51
+ AuxiliaryAtomSerde.write = function (protocol, value0) {
52
+ protocol.writeStructBegin('AuxiliaryAtom');
53
+ if (value0.atomId !== null && value0.atomId !== undefined) {
54
+ var value1 = value0.atomId;
55
+ protocol.writeFieldBegin('atomId', thrift_1.Thrift.Type.STRING, 1);
56
+ protocol.writeString(value1);
57
+ protocol.writeFieldEnd();
58
+ }
59
+ if (value0.atomType !== null && value0.atomType !== undefined) {
60
+ var value1 = value0.atomType;
61
+ protocol.writeFieldBegin('atomType', thrift_1.Thrift.Type.STRING, 2);
62
+ protocol.writeString(value1);
63
+ protocol.writeFieldEnd();
64
+ }
65
+ protocol.writeFieldStop();
66
+ protocol.writeStructEnd();
67
+ };
68
+ return AuxiliaryAtomSerde;
69
+ }());
70
+ exports.AuxiliaryAtomSerde = AuxiliaryAtomSerde;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Autogenerated by scrooge-generator-extras
3
+ *
4
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ */
6
+ import { TProtocol } from 'thrift';
7
+ import { AuxiliaryAtom } from './auxiliaryAtom';
8
+ import { EventType } from './eventType';
9
+ export interface AuxiliaryAtomEvent {
10
+ contentId: string;
11
+ eventType: EventType;
12
+ auxiliaryAtom: AuxiliaryAtom[];
13
+ }
14
+ export declare class AuxiliaryAtomEventSerde {
15
+ static read(protocol: TProtocol): AuxiliaryAtomEvent;
16
+ static write(protocol: TProtocol, value0: AuxiliaryAtomEvent): void;
17
+ }
@@ -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.AuxiliaryAtomEventSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var auxiliaryAtom_1 = require("./auxiliaryAtom");
11
+ var AuxiliaryAtomEventSerde = /** @class */ (function () {
12
+ function AuxiliaryAtomEventSerde() {
13
+ }
14
+ AuxiliaryAtomEventSerde.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.contentId = value1;
30
+ }
31
+ else {
32
+ protocol.skip(ftype);
33
+ }
34
+ break;
35
+ case 2:
36
+ if (ftype === thrift_1.Thrift.Type.I32) {
37
+ var value1 = protocol.readI32();
38
+ result.eventType = value1;
39
+ }
40
+ else {
41
+ protocol.skip(ftype);
42
+ }
43
+ break;
44
+ case 3:
45
+ if (ftype === thrift_1.Thrift.Type.LIST) {
46
+ var listInfo1 = protocol.readListBegin();
47
+ var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
48
+ var value1 = [];
49
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
50
+ for (var i = 0; i < listSize1; i++) {
51
+ var value2 = auxiliaryAtom_1.AuxiliaryAtomSerde.read(protocol);
52
+ value1.push(value2);
53
+ }
54
+ }
55
+ protocol.readListEnd();
56
+ result.auxiliaryAtom = value1;
57
+ }
58
+ else {
59
+ protocol.skip(ftype);
60
+ }
61
+ break;
62
+ default:
63
+ protocol.skip(ftype);
64
+ }
65
+ protocol.readFieldEnd();
66
+ }
67
+ protocol.readStructEnd();
68
+ // @ts-ignore
69
+ return result;
70
+ };
71
+ AuxiliaryAtomEventSerde.write = function (protocol, value0) {
72
+ protocol.writeStructBegin('AuxiliaryAtomEvent');
73
+ if (value0.contentId !== null && value0.contentId !== undefined) {
74
+ var value1 = value0.contentId;
75
+ protocol.writeFieldBegin('contentId', thrift_1.Thrift.Type.STRING, 1);
76
+ protocol.writeString(value1);
77
+ protocol.writeFieldEnd();
78
+ }
79
+ if (value0.eventType !== null && value0.eventType !== undefined) {
80
+ var value1 = value0.eventType;
81
+ protocol.writeFieldBegin('eventType', thrift_1.Thrift.Type.I32, 2);
82
+ protocol.writeI32(value1);
83
+ protocol.writeFieldEnd();
84
+ }
85
+ if (value0.auxiliaryAtom !== null && value0.auxiliaryAtom !== undefined) {
86
+ var value1 = value0.auxiliaryAtom;
87
+ protocol.writeFieldBegin('auxiliaryAtom', thrift_1.Thrift.Type.LIST, 3);
88
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
89
+ value1.forEach(function (value2) {
90
+ auxiliaryAtom_1.AuxiliaryAtomSerde.write(protocol, value2);
91
+ });
92
+ protocol.writeListEnd();
93
+ protocol.writeFieldEnd();
94
+ }
95
+ protocol.writeFieldStop();
96
+ protocol.writeStructEnd();
97
+ };
98
+ return AuxiliaryAtomEventSerde;
99
+ }());
100
+ exports.AuxiliaryAtomEventSerde = AuxiliaryAtomEventSerde;
@@ -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
+ ADD = 0,
8
+ REMOVE = 1
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["ADD"] = 0] = "ADD";
12
+ EventType[EventType["REMOVE"] = 1] = "REMOVE";
13
+ })(EventType || (exports.EventType = EventType = {}));
@@ -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 { AliasPath } from '../../../v1/aliasPath';
8
+ export interface DeletedContent {
9
+ aliasPaths?: AliasPath[];
10
+ }
11
+ export declare class DeletedContentSerde {
12
+ static read(protocol: TProtocol): DeletedContent;
13
+ static write(protocol: TProtocol, value0: DeletedContent): void;
14
+ }
@@ -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.DeletedContentSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var aliasPath_1 = require("../../../v1/aliasPath");
11
+ var DeletedContentSerde = /** @class */ (function () {
12
+ function DeletedContentSerde() {
13
+ }
14
+ DeletedContentSerde.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 2:
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 = aliasPath_1.AliasPathSerde.read(protocol);
34
+ value1.push(value2);
35
+ }
36
+ }
37
+ protocol.readListEnd();
38
+ result.aliasPaths = 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
+ DeletedContentSerde.write = function (protocol, value0) {
54
+ protocol.writeStructBegin('DeletedContent');
55
+ if (value0.aliasPaths !== null && value0.aliasPaths !== undefined) {
56
+ var value1 = value0.aliasPaths;
57
+ protocol.writeFieldBegin('aliasPaths', thrift_1.Thrift.Type.LIST, 2);
58
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
59
+ value1.forEach(function (value2) {
60
+ aliasPath_1.AliasPathSerde.write(protocol, value2);
61
+ });
62
+ protocol.writeListEnd();
63
+ protocol.writeFieldEnd();
64
+ }
65
+ protocol.writeFieldStop();
66
+ protocol.writeStructEnd();
67
+ };
68
+ return DeletedContentSerde;
69
+ }());
70
+ exports.DeletedContentSerde = DeletedContentSerde;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Autogenerated by scrooge-generator-extras
3
+ *
4
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ */
6
+ import { TProtocol } from 'thrift';
7
+ import Int64 from 'node-int64';
8
+ import { EventPayload } from './eventPayload';
9
+ import { EventType } from './eventType';
10
+ import { ItemType } from './itemType';
11
+ export interface Event {
12
+ payloadId: string;
13
+ eventType: EventType;
14
+ itemType: ItemType;
15
+ dateTime: Int64;
16
+ payload?: EventPayload;
17
+ }
18
+ export declare class EventSerde {
19
+ static read(protocol: TProtocol): Event;
20
+ static write(protocol: TProtocol, value0: Event): void;
21
+ }
@@ -0,0 +1,116 @@
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.EventSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var eventPayload_1 = require("./eventPayload");
11
+ var EventSerde = /** @class */ (function () {
12
+ function EventSerde() {
13
+ }
14
+ EventSerde.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.payloadId = value1;
29
+ }
30
+ else {
31
+ protocol.skip(ftype);
32
+ }
33
+ break;
34
+ case 2:
35
+ if (ftype === thrift_1.Thrift.Type.I32) {
36
+ var value1 = protocol.readI32();
37
+ result.eventType = value1;
38
+ }
39
+ else {
40
+ protocol.skip(ftype);
41
+ }
42
+ break;
43
+ case 3:
44
+ if (ftype === thrift_1.Thrift.Type.I32) {
45
+ var value1 = protocol.readI32();
46
+ result.itemType = value1;
47
+ }
48
+ else {
49
+ protocol.skip(ftype);
50
+ }
51
+ break;
52
+ case 4:
53
+ if (ftype === thrift_1.Thrift.Type.I64) {
54
+ var value1 = protocol.readI64();
55
+ result.dateTime = value1;
56
+ }
57
+ else {
58
+ protocol.skip(ftype);
59
+ }
60
+ break;
61
+ case 5:
62
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
63
+ var value1 = eventPayload_1.EventPayloadSerde.read(protocol);
64
+ result.payload = value1;
65
+ }
66
+ else {
67
+ protocol.skip(ftype);
68
+ }
69
+ break;
70
+ default:
71
+ protocol.skip(ftype);
72
+ }
73
+ protocol.readFieldEnd();
74
+ }
75
+ protocol.readStructEnd();
76
+ // @ts-ignore
77
+ return result;
78
+ };
79
+ EventSerde.write = function (protocol, value0) {
80
+ protocol.writeStructBegin('Event');
81
+ if (value0.payloadId !== null && value0.payloadId !== undefined) {
82
+ var value1 = value0.payloadId;
83
+ protocol.writeFieldBegin('payloadId', thrift_1.Thrift.Type.STRING, 1);
84
+ protocol.writeString(value1);
85
+ protocol.writeFieldEnd();
86
+ }
87
+ if (value0.eventType !== null && value0.eventType !== undefined) {
88
+ var value1 = value0.eventType;
89
+ protocol.writeFieldBegin('eventType', thrift_1.Thrift.Type.I32, 2);
90
+ protocol.writeI32(value1);
91
+ protocol.writeFieldEnd();
92
+ }
93
+ if (value0.itemType !== null && value0.itemType !== undefined) {
94
+ var value1 = value0.itemType;
95
+ protocol.writeFieldBegin('itemType', thrift_1.Thrift.Type.I32, 3);
96
+ protocol.writeI32(value1);
97
+ protocol.writeFieldEnd();
98
+ }
99
+ if (value0.dateTime !== null && value0.dateTime !== undefined) {
100
+ var value1 = value0.dateTime;
101
+ protocol.writeFieldBegin('dateTime', thrift_1.Thrift.Type.I64, 4);
102
+ protocol.writeI64(value1);
103
+ protocol.writeFieldEnd();
104
+ }
105
+ if (value0.payload !== null && value0.payload !== undefined) {
106
+ var value1 = value0.payload;
107
+ protocol.writeFieldBegin('payload', thrift_1.Thrift.Type.STRUCT, 5);
108
+ eventPayload_1.EventPayloadSerde.write(protocol, value1);
109
+ protocol.writeFieldEnd();
110
+ }
111
+ protocol.writeFieldStop();
112
+ protocol.writeStructEnd();
113
+ };
114
+ return EventSerde;
115
+ }());
116
+ exports.EventSerde = EventSerde;
@@ -0,0 +1,27 @@
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 { Content } from '../../../v1/content';
8
+ import { DeletedContent } from './deletedContent';
9
+ import { RetrievableContent } from './retrievableContent';
10
+ import { Atom } from '@guardian/content-atom-model/atom';
11
+ export type EventPayload = {
12
+ kind: "content";
13
+ content: Content;
14
+ } | {
15
+ kind: "retrievableContent";
16
+ retrievableContent: RetrievableContent;
17
+ } | {
18
+ kind: "atom";
19
+ atom: Atom;
20
+ } | {
21
+ kind: "deletedContent";
22
+ deletedContent: DeletedContent;
23
+ };
24
+ export declare class EventPayloadSerde {
25
+ static read(protocol: TProtocol): EventPayload;
26
+ static write(protocol: TProtocol, value0: EventPayload): void;
27
+ }
@@ -0,0 +1,118 @@
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.EventPayloadSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var content_1 = require("../../../v1/content");
11
+ var deletedContent_1 = require("./deletedContent");
12
+ var retrievableContent_1 = require("./retrievableContent");
13
+ var atom_1 = require("@guardian/content-atom-model/atom");
14
+ var EventPayloadSerde = /** @class */ (function () {
15
+ function EventPayloadSerde() {
16
+ }
17
+ EventPayloadSerde.read = function (protocol) {
18
+ protocol.readStructBegin();
19
+ var result = {};
20
+ while (true) {
21
+ var ret = protocol.readFieldBegin();
22
+ var ftype = ret.ftype;
23
+ var fid = ret.fid;
24
+ if (ftype === thrift_1.Thrift.Type.STOP) {
25
+ break;
26
+ }
27
+ switch (fid) {
28
+ case 1:
29
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
30
+ var value1 = content_1.ContentSerde.read(protocol);
31
+ result.content = value1;
32
+ result.kind = "content";
33
+ }
34
+ else {
35
+ protocol.skip(ftype);
36
+ }
37
+ break;
38
+ case 2:
39
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
40
+ var value1 = retrievableContent_1.RetrievableContentSerde.read(protocol);
41
+ result.retrievableContent = value1;
42
+ result.kind = "retrievableContent";
43
+ }
44
+ else {
45
+ protocol.skip(ftype);
46
+ }
47
+ break;
48
+ case 3:
49
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
50
+ var value1 = atom_1.AtomSerde.read(protocol);
51
+ result.atom = value1;
52
+ result.kind = "atom";
53
+ }
54
+ else {
55
+ protocol.skip(ftype);
56
+ }
57
+ break;
58
+ case 4:
59
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
60
+ var value1 = deletedContent_1.DeletedContentSerde.read(protocol);
61
+ result.deletedContent = value1;
62
+ result.kind = "deletedContent";
63
+ }
64
+ else {
65
+ protocol.skip(ftype);
66
+ }
67
+ break;
68
+ default:
69
+ protocol.skip(ftype);
70
+ }
71
+ protocol.readFieldEnd();
72
+ }
73
+ protocol.readStructEnd();
74
+ // @ts-ignore
75
+ return result;
76
+ };
77
+ EventPayloadSerde.write = function (protocol, value0) {
78
+ protocol.writeStructBegin('EventPayload');
79
+ switch (value0.kind) {
80
+ case "content":
81
+ if (value0.content !== null && value0.content !== undefined) {
82
+ var value1 = value0.content;
83
+ protocol.writeFieldBegin('content', thrift_1.Thrift.Type.STRUCT, 1);
84
+ content_1.ContentSerde.write(protocol, value1);
85
+ protocol.writeFieldEnd();
86
+ }
87
+ break;
88
+ case "retrievableContent":
89
+ if (value0.retrievableContent !== null && value0.retrievableContent !== undefined) {
90
+ var value1 = value0.retrievableContent;
91
+ protocol.writeFieldBegin('retrievableContent', thrift_1.Thrift.Type.STRUCT, 2);
92
+ retrievableContent_1.RetrievableContentSerde.write(protocol, value1);
93
+ protocol.writeFieldEnd();
94
+ }
95
+ break;
96
+ case "atom":
97
+ if (value0.atom !== null && value0.atom !== undefined) {
98
+ var value1 = value0.atom;
99
+ protocol.writeFieldBegin('atom', thrift_1.Thrift.Type.STRUCT, 3);
100
+ atom_1.AtomSerde.write(protocol, value1);
101
+ protocol.writeFieldEnd();
102
+ }
103
+ break;
104
+ case "deletedContent":
105
+ if (value0.deletedContent !== null && value0.deletedContent !== undefined) {
106
+ var value1 = value0.deletedContent;
107
+ protocol.writeFieldBegin('deletedContent', thrift_1.Thrift.Type.STRUCT, 4);
108
+ deletedContent_1.DeletedContentSerde.write(protocol, value1);
109
+ protocol.writeFieldEnd();
110
+ }
111
+ break;
112
+ }
113
+ protocol.writeFieldStop();
114
+ protocol.writeStructEnd();
115
+ };
116
+ return EventPayloadSerde;
117
+ }());
118
+ exports.EventPayloadSerde = EventPayloadSerde;
@@ -0,0 +1,10 @@
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
+ RETRIEVABLEUPDATE = 3
10
+ }
@@ -0,0 +1,14 @@
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[EventType["RETRIEVABLEUPDATE"] = 3] = "RETRIEVABLEUPDATE";
14
+ })(EventType || (exports.EventType = EventType = {}));
@@ -0,0 +1,12 @@
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 ItemType {
7
+ CONTENT = 1,
8
+ TAG = 2,
9
+ SECTION = 3,
10
+ STORYPACKAGE = 4,
11
+ ATOM = 5
12
+ }
@@ -0,0 +1,16 @@
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.ItemType = void 0;
9
+ var ItemType;
10
+ (function (ItemType) {
11
+ ItemType[ItemType["CONTENT"] = 1] = "CONTENT";
12
+ ItemType[ItemType["TAG"] = 2] = "TAG";
13
+ ItemType[ItemType["SECTION"] = 3] = "SECTION";
14
+ ItemType[ItemType["STORYPACKAGE"] = 4] = "STORYPACKAGE";
15
+ ItemType[ItemType["ATOM"] = 5] = "ATOM";
16
+ })(ItemType || (exports.ItemType = ItemType = {}));
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Autogenerated by scrooge-generator-extras
3
+ *
4
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ */
6
+ import { TProtocol } from 'thrift';
7
+ import Int64 from 'node-int64';
8
+ import { AliasPath } from '../../../v1/aliasPath';
9
+ import { ContentType } from '../../../v1/contentType';
10
+ export interface RetrievableContent {
11
+ id: string;
12
+ capiUrl: string;
13
+ lastModifiedDate?: Int64;
14
+ internalRevision?: number;
15
+ contentType?: ContentType;
16
+ aliasPaths?: AliasPath[];
17
+ }
18
+ export declare class RetrievableContentSerde {
19
+ static read(protocol: TProtocol): RetrievableContent;
20
+ static write(protocol: TProtocol, value0: RetrievableContent): void;
21
+ }