@guardian/content-api-models 17.3.0 → 17.3.1-SNAPSHOT

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 CHANGED
@@ -1,7 +1,6 @@
1
-
2
1
  {
3
2
  "name": "@guardian/content-api-models",
4
- "version": "17.3.0",
3
+ "version": "17.3.1-SNAPSHOT",
5
4
  "description": "Typescript library built from the content api thrift definitions",
6
5
  "repository": {
7
6
  "type": "git",
@@ -10,15 +9,15 @@
10
9
  "author": "",
11
10
  "license": "Apache-2.0",
12
11
  "devDependencies": {
13
- "typescript": "^4.5.4"
14
- },
12
+ "typescript": "^4.5.4"
13
+ },
15
14
  "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": "^3.4.0",
21
- "@types/node-int64": "^0.4.29",
22
- "node-int64": "^0.4.0"
15
+ "@guardian/story-packages-model": "^2.2.0",
16
+ "@guardian/content-entity-model": "^2.2.1",
17
+ "@types/thrift": "^0.10.11",
18
+ "thrift": "^0.15.0",
19
+ "@guardian/content-atom-model": "^3.4.0",
20
+ "@types/node-int64": "^0.4.29",
21
+ "node-int64": "^0.4.0"
22
+ }
23
23
  }
24
- }
@@ -6,6 +6,7 @@
6
6
  import { TProtocol } from 'thrift';
7
7
  import { Asset } from './asset';
8
8
  import { AudioElementFields } from './audioElementFields';
9
+ import { CalloutElementFields } from './calloutElementFields';
9
10
  import { CodeElementFields } from './codeElementFields';
10
11
  import { CommentElementFields } from './commentElementFields';
11
12
  import { ContentAtomElementFields } from './contentAtomElementFields';
@@ -47,6 +48,7 @@ export interface BlockElement {
47
48
  contentAtomTypeData?: ContentAtomElementFields;
48
49
  tracking?: EmbedTracking;
49
50
  codeTypeData?: CodeElementFields;
51
+ calloutTypeData?: CalloutElementFields;
50
52
  }
51
53
  export declare class BlockElementSerde {
52
54
  static read(protocol: TProtocol): BlockElement;
@@ -9,6 +9,7 @@ exports.BlockElementSerde = void 0;
9
9
  var thrift_1 = require("thrift");
10
10
  var asset_1 = require("./asset");
11
11
  var audioElementFields_1 = require("./audioElementFields");
12
+ var calloutElementFields_1 = require("./calloutElementFields");
12
13
  var codeElementFields_1 = require("./codeElementFields");
13
14
  var commentElementFields_1 = require("./commentElementFields");
14
15
  var contentAtomElementFields_1 = require("./contentAtomElementFields");
@@ -248,6 +249,15 @@ var BlockElementSerde = /** @class */ (function () {
248
249
  protocol.skip(ftype);
249
250
  }
250
251
  break;
252
+ case 23:
253
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
254
+ var value1 = calloutElementFields_1.CalloutElementFieldsSerde.read(protocol);
255
+ result.calloutTypeData = value1;
256
+ }
257
+ else {
258
+ protocol.skip(ftype);
259
+ }
260
+ break;
251
261
  default:
252
262
  protocol.skip(ftype);
253
263
  }
@@ -395,6 +405,12 @@ var BlockElementSerde = /** @class */ (function () {
395
405
  codeElementFields_1.CodeElementFieldsSerde.write(protocol, value1);
396
406
  protocol.writeFieldEnd();
397
407
  }
408
+ if (value0.calloutTypeData !== null && value0.calloutTypeData !== undefined) {
409
+ var value1 = value0.calloutTypeData;
410
+ protocol.writeFieldBegin('calloutTypeData', thrift_1.Thrift.Type.STRUCT, 23);
411
+ calloutElementFields_1.CalloutElementFieldsSerde.write(protocol, value1);
412
+ protocol.writeFieldEnd();
413
+ }
398
414
  protocol.writeFieldStop();
399
415
  protocol.writeStructEnd();
400
416
  };
@@ -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 CalloutElementFields {
8
+ campaignId?: string;
9
+ isNonCollapsible?: boolean;
10
+ }
11
+ export declare class CalloutElementFieldsSerde {
12
+ static read(protocol: TProtocol): CalloutElementFields;
13
+ static write(protocol: TProtocol, value0: CalloutElementFields): 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.CalloutElementFieldsSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var CalloutElementFieldsSerde = /** @class */ (function () {
11
+ function CalloutElementFieldsSerde() {
12
+ }
13
+ CalloutElementFieldsSerde.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.campaignId = value1;
28
+ }
29
+ else {
30
+ protocol.skip(ftype);
31
+ }
32
+ break;
33
+ case 2:
34
+ if (ftype === thrift_1.Thrift.Type.BOOL) {
35
+ var value1 = protocol.readBool();
36
+ result.isNonCollapsible = 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
+ CalloutElementFieldsSerde.write = function (protocol, value0) {
52
+ protocol.writeStructBegin('CalloutElementFields');
53
+ if (value0.campaignId !== null && value0.campaignId !== undefined) {
54
+ var value1 = value0.campaignId;
55
+ protocol.writeFieldBegin('campaignId', thrift_1.Thrift.Type.STRING, 1);
56
+ protocol.writeString(value1);
57
+ protocol.writeFieldEnd();
58
+ }
59
+ if (value0.isNonCollapsible !== null && value0.isNonCollapsible !== undefined) {
60
+ var value1 = value0.isNonCollapsible;
61
+ protocol.writeFieldBegin('isNonCollapsible', thrift_1.Thrift.Type.BOOL, 2);
62
+ protocol.writeBool(value1);
63
+ protocol.writeFieldEnd();
64
+ }
65
+ protocol.writeFieldStop();
66
+ protocol.writeStructEnd();
67
+ };
68
+ return CalloutElementFieldsSerde;
69
+ }());
70
+ exports.CalloutElementFieldsSerde = CalloutElementFieldsSerde;
@@ -19,6 +19,7 @@ export interface ContentStats {
19
19
  comments: number;
20
20
  instagram: number;
21
21
  vines: number;
22
+ callouts: number;
22
23
  }
23
24
  export declare class ContentStatsSerde {
24
25
  static read(protocol: TProtocol): ContentStats;
@@ -147,6 +147,15 @@ var ContentStatsSerde = /** @class */ (function () {
147
147
  protocol.skip(ftype);
148
148
  }
149
149
  break;
150
+ case 15:
151
+ if (ftype === thrift_1.Thrift.Type.I32) {
152
+ var value1 = protocol.readI32();
153
+ result.callouts = value1;
154
+ }
155
+ else {
156
+ protocol.skip(ftype);
157
+ }
158
+ break;
150
159
  default:
151
160
  protocol.skip(ftype);
152
161
  }
@@ -242,6 +251,12 @@ var ContentStatsSerde = /** @class */ (function () {
242
251
  protocol.writeI32(value1);
243
252
  protocol.writeFieldEnd();
244
253
  }
254
+ if (value0.callouts !== null && value0.callouts !== undefined) {
255
+ var value1 = value0.callouts;
256
+ protocol.writeFieldBegin('callouts', thrift_1.Thrift.Type.I32, 15);
257
+ protocol.writeI32(value1);
258
+ protocol.writeFieldEnd();
259
+ }
245
260
  protocol.writeFieldStop();
246
261
  protocol.writeStructEnd();
247
262
  };
@@ -23,5 +23,6 @@ export declare enum ElementType {
23
23
  MEMBERSHIP = 16,
24
24
  INSTAGRAM = 17,
25
25
  CONTENTATOM = 18,
26
- VINE = 19
26
+ VINE = 19,
27
+ CALLOUT = 20
27
28
  }
package/v1/elementType.js CHANGED
@@ -28,4 +28,5 @@ var ElementType;
28
28
  ElementType[ElementType["INSTAGRAM"] = 17] = "INSTAGRAM";
29
29
  ElementType[ElementType["CONTENTATOM"] = 18] = "CONTENTATOM";
30
30
  ElementType[ElementType["VINE"] = 19] = "VINE";
31
+ ElementType[ElementType["CALLOUT"] = 20] = "CALLOUT";
31
32
  })(ElementType = exports.ElementType || (exports.ElementType = {}));