@guardian/bridget 6.0.0 → 7.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.
@@ -0,0 +1,9 @@
1
+ export declare enum MediaEvent {
2
+ request = 0,
3
+ ready = 1,
4
+ play = 2,
5
+ percent25 = 3,
6
+ percent50 = 4,
7
+ percent75 = 5,
8
+ end = 6
9
+ }
package/MediaEvent.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MediaEvent = void 0;
4
+ /* tslint:disable */
5
+ /* eslint-disable */
6
+ /*
7
+ * Autogenerated by @creditkarma/thrift-typescript v3.7.6
8
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
9
+ */
10
+ var MediaEvent;
11
+ (function (MediaEvent) {
12
+ MediaEvent[MediaEvent["request"] = 0] = "request";
13
+ MediaEvent[MediaEvent["ready"] = 1] = "ready";
14
+ MediaEvent[MediaEvent["play"] = 2] = "play";
15
+ MediaEvent[MediaEvent["percent25"] = 3] = "percent25";
16
+ MediaEvent[MediaEvent["percent50"] = 4] = "percent50";
17
+ MediaEvent[MediaEvent["percent75"] = 5] = "percent75";
18
+ MediaEvent[MediaEvent["end"] = 6] = "end";
19
+ })(MediaEvent || (exports.MediaEvent = MediaEvent = {}));
@@ -0,0 +1,21 @@
1
+ import * as thrift from "@creditkarma/thrift-server-core";
2
+ import * as MediaEvent from "./MediaEvent";
3
+ export interface IVideoEvent {
4
+ videoId: string;
5
+ event: MediaEvent.MediaEvent;
6
+ }
7
+ export interface IVideoEventArgs {
8
+ videoId: string;
9
+ event: MediaEvent.MediaEvent;
10
+ }
11
+ export declare const VideoEventCodec: thrift.IStructCodec<IVideoEventArgs, IVideoEvent>;
12
+ export declare class VideoEvent extends thrift.StructLike implements IVideoEvent {
13
+ videoId: string;
14
+ event: MediaEvent.MediaEvent;
15
+ readonly _annotations: thrift.IThriftAnnotations;
16
+ readonly _fieldAnnotations: thrift.IFieldAnnotations;
17
+ constructor(args: IVideoEventArgs);
18
+ static read(input: thrift.TProtocol): VideoEvent;
19
+ static write(args: IVideoEventArgs, output: thrift.TProtocol): void;
20
+ write(output: thrift.TProtocol): void;
21
+ }
package/VideoEvent.js ADDED
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.VideoEvent = exports.VideoEventCodec = void 0;
27
+ /* tslint:disable */
28
+ /* eslint-disable */
29
+ /*
30
+ * Autogenerated by @creditkarma/thrift-typescript v3.7.6
31
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
32
+ */
33
+ const thrift = __importStar(require("@creditkarma/thrift-server-core"));
34
+ exports.VideoEventCodec = {
35
+ encode(args, output) {
36
+ const obj = {
37
+ videoId: args.videoId,
38
+ event: args.event
39
+ };
40
+ output.writeStructBegin("VideoEvent");
41
+ if (obj.videoId != null) {
42
+ output.writeFieldBegin("videoId", thrift.TType.STRING, 1);
43
+ output.writeString(obj.videoId);
44
+ output.writeFieldEnd();
45
+ }
46
+ else {
47
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[videoId] is unset!");
48
+ }
49
+ if (obj.event != null) {
50
+ output.writeFieldBegin("event", thrift.TType.I32, 2);
51
+ output.writeI32(obj.event);
52
+ output.writeFieldEnd();
53
+ }
54
+ else {
55
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[event] is unset!");
56
+ }
57
+ output.writeFieldStop();
58
+ output.writeStructEnd();
59
+ return;
60
+ },
61
+ decode(input) {
62
+ let _args = {};
63
+ input.readStructBegin();
64
+ while (true) {
65
+ const ret = input.readFieldBegin();
66
+ const fieldType = ret.fieldType;
67
+ const fieldId = ret.fieldId;
68
+ if (fieldType === thrift.TType.STOP) {
69
+ break;
70
+ }
71
+ switch (fieldId) {
72
+ case 1:
73
+ if (fieldType === thrift.TType.STRING) {
74
+ const value_1 = input.readString();
75
+ _args.videoId = value_1;
76
+ }
77
+ else {
78
+ input.skip(fieldType);
79
+ }
80
+ break;
81
+ case 2:
82
+ if (fieldType === thrift.TType.I32) {
83
+ const value_2 = input.readI32();
84
+ _args.event = value_2;
85
+ }
86
+ else {
87
+ input.skip(fieldType);
88
+ }
89
+ break;
90
+ default: {
91
+ input.skip(fieldType);
92
+ }
93
+ }
94
+ input.readFieldEnd();
95
+ }
96
+ input.readStructEnd();
97
+ if (_args.videoId !== undefined && _args.event !== undefined) {
98
+ return {
99
+ videoId: _args.videoId,
100
+ event: _args.event
101
+ };
102
+ }
103
+ else {
104
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read VideoEvent from input");
105
+ }
106
+ }
107
+ };
108
+ class VideoEvent extends thrift.StructLike {
109
+ constructor(args) {
110
+ super();
111
+ this._annotations = {};
112
+ this._fieldAnnotations = {};
113
+ if (args.videoId != null) {
114
+ const value_3 = args.videoId;
115
+ this.videoId = value_3;
116
+ }
117
+ else {
118
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[videoId] is unset!");
119
+ }
120
+ if (args.event != null) {
121
+ const value_4 = args.event;
122
+ this.event = value_4;
123
+ }
124
+ else {
125
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[event] is unset!");
126
+ }
127
+ }
128
+ static read(input) {
129
+ return new VideoEvent(exports.VideoEventCodec.decode(input));
130
+ }
131
+ static write(args, output) {
132
+ return exports.VideoEventCodec.encode(args, output);
133
+ }
134
+ write(output) {
135
+ return exports.VideoEventCodec.encode(this, output);
136
+ }
137
+ }
138
+ exports.VideoEvent = VideoEvent;
package/Videos.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  /// <reference types="node" />
3
3
  import * as thrift from "@creditkarma/thrift-server-core";
4
4
  import * as VideoSlot from "./VideoSlot";
5
+ import * as VideoEvent from "./VideoEvent";
5
6
  export declare const serviceName: string;
6
7
  export declare const annotations: thrift.IThriftAnnotations;
7
8
  export declare const methodAnnotations: thrift.IMethodAnnotations;
@@ -41,6 +42,35 @@ export declare class UpdateVideos__Args extends thrift.StructLike implements IUp
41
42
  static write(args: IUpdateVideos__ArgsArgs, output: thrift.TProtocol): void;
42
43
  write(output: thrift.TProtocol): void;
43
44
  }
45
+ export interface ISendVideoEvent__Args {
46
+ videoEvent: VideoEvent.IVideoEvent;
47
+ }
48
+ export interface ISendVideoEvent__ArgsArgs {
49
+ videoEvent: VideoEvent.IVideoEventArgs;
50
+ }
51
+ export declare const SendVideoEvent__ArgsCodec: thrift.IStructCodec<ISendVideoEvent__ArgsArgs, ISendVideoEvent__Args>;
52
+ export declare class SendVideoEvent__Args extends thrift.StructLike implements ISendVideoEvent__Args {
53
+ videoEvent: VideoEvent.IVideoEvent;
54
+ readonly _annotations: thrift.IThriftAnnotations;
55
+ readonly _fieldAnnotations: thrift.IFieldAnnotations;
56
+ constructor(args: ISendVideoEvent__ArgsArgs);
57
+ static read(input: thrift.TProtocol): SendVideoEvent__Args;
58
+ static write(args: ISendVideoEvent__ArgsArgs, output: thrift.TProtocol): void;
59
+ write(output: thrift.TProtocol): void;
60
+ }
61
+ export interface IFullscreen__Args {
62
+ }
63
+ export interface IFullscreen__ArgsArgs {
64
+ }
65
+ export declare const Fullscreen__ArgsCodec: thrift.IStructCodec<IFullscreen__ArgsArgs, IFullscreen__Args>;
66
+ export declare class Fullscreen__Args extends thrift.StructLike implements IFullscreen__Args {
67
+ readonly _annotations: thrift.IThriftAnnotations;
68
+ readonly _fieldAnnotations: thrift.IFieldAnnotations;
69
+ constructor(args?: IFullscreen__ArgsArgs);
70
+ static read(input: thrift.TProtocol): Fullscreen__Args;
71
+ static write(args: IFullscreen__ArgsArgs, output: thrift.TProtocol): void;
72
+ write(output: thrift.TProtocol): void;
73
+ }
44
74
  export interface IInsertVideos__Result {
45
75
  success?: void;
46
76
  }
@@ -73,6 +103,38 @@ export declare class UpdateVideos__Result extends thrift.StructLike implements I
73
103
  static write(args: IUpdateVideos__ResultArgs, output: thrift.TProtocol): void;
74
104
  write(output: thrift.TProtocol): void;
75
105
  }
106
+ export interface ISendVideoEvent__Result {
107
+ success?: void;
108
+ }
109
+ export interface ISendVideoEvent__ResultArgs {
110
+ success?: void;
111
+ }
112
+ export declare const SendVideoEvent__ResultCodec: thrift.IStructCodec<ISendVideoEvent__ResultArgs, ISendVideoEvent__Result>;
113
+ export declare class SendVideoEvent__Result extends thrift.StructLike implements ISendVideoEvent__Result {
114
+ success?: void;
115
+ readonly _annotations: thrift.IThriftAnnotations;
116
+ readonly _fieldAnnotations: thrift.IFieldAnnotations;
117
+ constructor(args?: ISendVideoEvent__ResultArgs);
118
+ static read(input: thrift.TProtocol): SendVideoEvent__Result;
119
+ static write(args: ISendVideoEvent__ResultArgs, output: thrift.TProtocol): void;
120
+ write(output: thrift.TProtocol): void;
121
+ }
122
+ export interface IFullscreen__Result {
123
+ success?: void;
124
+ }
125
+ export interface IFullscreen__ResultArgs {
126
+ success?: void;
127
+ }
128
+ export declare const Fullscreen__ResultCodec: thrift.IStructCodec<IFullscreen__ResultArgs, IFullscreen__Result>;
129
+ export declare class Fullscreen__Result extends thrift.StructLike implements IFullscreen__Result {
130
+ success?: void;
131
+ readonly _annotations: thrift.IThriftAnnotations;
132
+ readonly _fieldAnnotations: thrift.IFieldAnnotations;
133
+ constructor(args?: IFullscreen__ResultArgs);
134
+ static read(input: thrift.TProtocol): Fullscreen__Result;
135
+ static write(args: IFullscreen__ResultArgs, output: thrift.TProtocol): void;
136
+ write(output: thrift.TProtocol): void;
137
+ }
76
138
  export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
77
139
  static readonly serviceName: string;
78
140
  static readonly annotations: thrift.IThriftAnnotations;
@@ -87,10 +149,14 @@ export declare class Client<Context = any> extends thrift.ThriftClient<Context>
87
149
  };
88
150
  insertVideos(videoSlots: Array<VideoSlot.IVideoSlotArgs>, context?: Context): Promise<void>;
89
151
  updateVideos(videoSlots: Array<VideoSlot.IVideoSlotArgs>, context?: Context): Promise<void>;
152
+ sendVideoEvent(videoEvent: VideoEvent.IVideoEventArgs, context?: Context): Promise<void>;
153
+ fullscreen(context?: Context): Promise<void>;
90
154
  }
91
155
  export interface IHandler<Context = any> {
92
156
  insertVideos(videoSlots: Array<VideoSlot.IVideoSlot>, context?: Context): void | Promise<void>;
93
157
  updateVideos(videoSlots: Array<VideoSlot.IVideoSlot>, context?: Context): void | Promise<void>;
158
+ sendVideoEvent(videoEvent: VideoEvent.IVideoEvent, context?: Context): void | Promise<void>;
159
+ fullscreen(context?: Context): void | Promise<void>;
94
160
  }
95
161
  export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
96
162
  protected readonly _handler: IHandler<Context>;
@@ -106,4 +172,6 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Con
106
172
  process(input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
107
173
  process_insertVideos(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
108
174
  process_updateVideos(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
175
+ process_sendVideoEvent(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
176
+ process_fullscreen(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
109
177
  }
package/Videos.js CHANGED
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Processor = exports.Client = exports.UpdateVideos__Result = exports.UpdateVideos__ResultCodec = exports.InsertVideos__Result = exports.InsertVideos__ResultCodec = exports.UpdateVideos__Args = exports.UpdateVideos__ArgsCodec = exports.InsertVideos__Args = exports.InsertVideos__ArgsCodec = exports.methodParameters = exports.methodNames = exports.methodAnnotations = exports.annotations = exports.serviceName = void 0;
26
+ exports.Processor = exports.Client = exports.Fullscreen__Result = exports.Fullscreen__ResultCodec = exports.SendVideoEvent__Result = exports.SendVideoEvent__ResultCodec = exports.UpdateVideos__Result = exports.UpdateVideos__ResultCodec = exports.InsertVideos__Result = exports.InsertVideos__ResultCodec = exports.Fullscreen__Args = exports.Fullscreen__ArgsCodec = exports.SendVideoEvent__Args = exports.SendVideoEvent__ArgsCodec = exports.UpdateVideos__Args = exports.UpdateVideos__ArgsCodec = exports.InsertVideos__Args = exports.InsertVideos__ArgsCodec = exports.methodParameters = exports.methodNames = exports.methodAnnotations = exports.annotations = exports.serviceName = void 0;
27
27
  /* tslint:disable */
28
28
  /* eslint-disable */
29
29
  /*
@@ -32,6 +32,7 @@ exports.Processor = exports.Client = exports.UpdateVideos__Result = exports.Upda
32
32
  */
33
33
  const thrift = __importStar(require("@creditkarma/thrift-server-core"));
34
34
  const VideoSlot = __importStar(require("./VideoSlot"));
35
+ const VideoEvent = __importStar(require("./VideoEvent"));
35
36
  exports.serviceName = "Videos";
36
37
  exports.annotations = {};
37
38
  exports.methodAnnotations = {
@@ -42,12 +43,22 @@ exports.methodAnnotations = {
42
43
  updateVideos: {
43
44
  annotations: {},
44
45
  fieldAnnotations: {}
46
+ },
47
+ sendVideoEvent: {
48
+ annotations: {},
49
+ fieldAnnotations: {}
50
+ },
51
+ fullscreen: {
52
+ annotations: {},
53
+ fieldAnnotations: {}
45
54
  }
46
55
  };
47
- exports.methodNames = ["insertVideos", "updateVideos"];
56
+ exports.methodNames = ["insertVideos", "updateVideos", "sendVideoEvent", "fullscreen"];
48
57
  exports.methodParameters = {
49
58
  insertVideos: 2,
50
- updateVideos: 2
59
+ updateVideos: 2,
60
+ sendVideoEvent: 2,
61
+ fullscreen: 1
51
62
  };
52
63
  exports.InsertVideos__ArgsCodec = {
53
64
  encode(args, output) {
@@ -237,6 +248,129 @@ class UpdateVideos__Args extends thrift.StructLike {
237
248
  }
238
249
  }
239
250
  exports.UpdateVideos__Args = UpdateVideos__Args;
251
+ exports.SendVideoEvent__ArgsCodec = {
252
+ encode(args, output) {
253
+ const obj = {
254
+ videoEvent: args.videoEvent
255
+ };
256
+ output.writeStructBegin("SendVideoEvent__Args");
257
+ if (obj.videoEvent != null) {
258
+ output.writeFieldBegin("videoEvent", thrift.TType.STRUCT, 1);
259
+ VideoEvent.VideoEventCodec.encode(obj.videoEvent, output);
260
+ output.writeFieldEnd();
261
+ }
262
+ else {
263
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[videoEvent] is unset!");
264
+ }
265
+ output.writeFieldStop();
266
+ output.writeStructEnd();
267
+ return;
268
+ },
269
+ decode(input) {
270
+ let _args = {};
271
+ input.readStructBegin();
272
+ while (true) {
273
+ const ret = input.readFieldBegin();
274
+ const fieldType = ret.fieldType;
275
+ const fieldId = ret.fieldId;
276
+ if (fieldType === thrift.TType.STOP) {
277
+ break;
278
+ }
279
+ switch (fieldId) {
280
+ case 1:
281
+ if (fieldType === thrift.TType.STRUCT) {
282
+ const value_13 = VideoEvent.VideoEventCodec.decode(input);
283
+ _args.videoEvent = value_13;
284
+ }
285
+ else {
286
+ input.skip(fieldType);
287
+ }
288
+ break;
289
+ default: {
290
+ input.skip(fieldType);
291
+ }
292
+ }
293
+ input.readFieldEnd();
294
+ }
295
+ input.readStructEnd();
296
+ if (_args.videoEvent !== undefined) {
297
+ return {
298
+ videoEvent: _args.videoEvent
299
+ };
300
+ }
301
+ else {
302
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read SendVideoEvent__Args from input");
303
+ }
304
+ }
305
+ };
306
+ class SendVideoEvent__Args extends thrift.StructLike {
307
+ constructor(args) {
308
+ super();
309
+ this._annotations = {};
310
+ this._fieldAnnotations = {};
311
+ if (args.videoEvent != null) {
312
+ const value_14 = new VideoEvent.VideoEvent(args.videoEvent);
313
+ this.videoEvent = value_14;
314
+ }
315
+ else {
316
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[videoEvent] is unset!");
317
+ }
318
+ }
319
+ static read(input) {
320
+ return new SendVideoEvent__Args(exports.SendVideoEvent__ArgsCodec.decode(input));
321
+ }
322
+ static write(args, output) {
323
+ return exports.SendVideoEvent__ArgsCodec.encode(args, output);
324
+ }
325
+ write(output) {
326
+ return exports.SendVideoEvent__ArgsCodec.encode(this, output);
327
+ }
328
+ }
329
+ exports.SendVideoEvent__Args = SendVideoEvent__Args;
330
+ exports.Fullscreen__ArgsCodec = {
331
+ encode(args, output) {
332
+ output.writeStructBegin("Fullscreen__Args");
333
+ output.writeFieldStop();
334
+ output.writeStructEnd();
335
+ return;
336
+ },
337
+ decode(input) {
338
+ input.readStructBegin();
339
+ while (true) {
340
+ const ret = input.readFieldBegin();
341
+ const fieldType = ret.fieldType;
342
+ const fieldId = ret.fieldId;
343
+ if (fieldType === thrift.TType.STOP) {
344
+ break;
345
+ }
346
+ switch (fieldId) {
347
+ default: {
348
+ input.skip(fieldType);
349
+ }
350
+ }
351
+ input.readFieldEnd();
352
+ }
353
+ input.readStructEnd();
354
+ return {};
355
+ }
356
+ };
357
+ class Fullscreen__Args extends thrift.StructLike {
358
+ constructor(args = {}) {
359
+ super();
360
+ this._annotations = {};
361
+ this._fieldAnnotations = {};
362
+ }
363
+ static read(input) {
364
+ return new Fullscreen__Args(exports.Fullscreen__ArgsCodec.decode(input));
365
+ }
366
+ static write(args, output) {
367
+ return exports.Fullscreen__ArgsCodec.encode(args, output);
368
+ }
369
+ write(output) {
370
+ return exports.Fullscreen__ArgsCodec.encode(this, output);
371
+ }
372
+ }
373
+ exports.Fullscreen__Args = Fullscreen__Args;
240
374
  exports.InsertVideos__ResultCodec = {
241
375
  encode(args, output) {
242
376
  output.writeStructBegin("InsertVideos__Result");
@@ -281,8 +415,8 @@ class InsertVideos__Result extends thrift.StructLike {
281
415
  this._annotations = {};
282
416
  this._fieldAnnotations = {};
283
417
  if (args.success != null) {
284
- const value_13 = undefined;
285
- this.success = value_13;
418
+ const value_15 = undefined;
419
+ this.success = value_15;
286
420
  }
287
421
  }
288
422
  static read(input) {
@@ -340,8 +474,8 @@ class UpdateVideos__Result extends thrift.StructLike {
340
474
  this._annotations = {};
341
475
  this._fieldAnnotations = {};
342
476
  if (args.success != null) {
343
- const value_14 = undefined;
344
- this.success = value_14;
477
+ const value_16 = undefined;
478
+ this.success = value_16;
345
479
  }
346
480
  }
347
481
  static read(input) {
@@ -355,6 +489,124 @@ class UpdateVideos__Result extends thrift.StructLike {
355
489
  }
356
490
  }
357
491
  exports.UpdateVideos__Result = UpdateVideos__Result;
492
+ exports.SendVideoEvent__ResultCodec = {
493
+ encode(args, output) {
494
+ output.writeStructBegin("SendVideoEvent__Result");
495
+ output.writeFieldStop();
496
+ output.writeStructEnd();
497
+ return;
498
+ },
499
+ decode(input) {
500
+ let _args = {};
501
+ input.readStructBegin();
502
+ while (true) {
503
+ const ret = input.readFieldBegin();
504
+ const fieldType = ret.fieldType;
505
+ const fieldId = ret.fieldId;
506
+ if (fieldType === thrift.TType.STOP) {
507
+ break;
508
+ }
509
+ switch (fieldId) {
510
+ case 0:
511
+ if (fieldType === thrift.TType.VOID) {
512
+ input.skip(fieldType);
513
+ }
514
+ else {
515
+ input.skip(fieldType);
516
+ }
517
+ break;
518
+ default: {
519
+ input.skip(fieldType);
520
+ }
521
+ }
522
+ input.readFieldEnd();
523
+ }
524
+ input.readStructEnd();
525
+ return {
526
+ success: _args.success
527
+ };
528
+ }
529
+ };
530
+ class SendVideoEvent__Result extends thrift.StructLike {
531
+ constructor(args = {}) {
532
+ super();
533
+ this._annotations = {};
534
+ this._fieldAnnotations = {};
535
+ if (args.success != null) {
536
+ const value_17 = undefined;
537
+ this.success = value_17;
538
+ }
539
+ }
540
+ static read(input) {
541
+ return new SendVideoEvent__Result(exports.SendVideoEvent__ResultCodec.decode(input));
542
+ }
543
+ static write(args, output) {
544
+ return exports.SendVideoEvent__ResultCodec.encode(args, output);
545
+ }
546
+ write(output) {
547
+ return exports.SendVideoEvent__ResultCodec.encode(this, output);
548
+ }
549
+ }
550
+ exports.SendVideoEvent__Result = SendVideoEvent__Result;
551
+ exports.Fullscreen__ResultCodec = {
552
+ encode(args, output) {
553
+ output.writeStructBegin("Fullscreen__Result");
554
+ output.writeFieldStop();
555
+ output.writeStructEnd();
556
+ return;
557
+ },
558
+ decode(input) {
559
+ let _args = {};
560
+ input.readStructBegin();
561
+ while (true) {
562
+ const ret = input.readFieldBegin();
563
+ const fieldType = ret.fieldType;
564
+ const fieldId = ret.fieldId;
565
+ if (fieldType === thrift.TType.STOP) {
566
+ break;
567
+ }
568
+ switch (fieldId) {
569
+ case 0:
570
+ if (fieldType === thrift.TType.VOID) {
571
+ input.skip(fieldType);
572
+ }
573
+ else {
574
+ input.skip(fieldType);
575
+ }
576
+ break;
577
+ default: {
578
+ input.skip(fieldType);
579
+ }
580
+ }
581
+ input.readFieldEnd();
582
+ }
583
+ input.readStructEnd();
584
+ return {
585
+ success: _args.success
586
+ };
587
+ }
588
+ };
589
+ class Fullscreen__Result extends thrift.StructLike {
590
+ constructor(args = {}) {
591
+ super();
592
+ this._annotations = {};
593
+ this._fieldAnnotations = {};
594
+ if (args.success != null) {
595
+ const value_18 = undefined;
596
+ this.success = value_18;
597
+ }
598
+ }
599
+ static read(input) {
600
+ return new Fullscreen__Result(exports.Fullscreen__ResultCodec.decode(input));
601
+ }
602
+ static write(args, output) {
603
+ return exports.Fullscreen__ResultCodec.encode(args, output);
604
+ }
605
+ write(output) {
606
+ return exports.Fullscreen__ResultCodec.encode(this, output);
607
+ }
608
+ }
609
+ exports.Fullscreen__Result = Fullscreen__Result;
358
610
  class Client extends thrift.ThriftClient {
359
611
  constructor() {
360
612
  super(...arguments);
@@ -430,6 +682,72 @@ class Client extends thrift.ThriftClient {
430
682
  }
431
683
  });
432
684
  }
685
+ sendVideoEvent(videoEvent, context) {
686
+ const writer = new this.transport();
687
+ const output = new this.protocol(writer);
688
+ output.writeMessageBegin("sendVideoEvent", thrift.MessageType.CALL, this.incrementRequestId());
689
+ const args = { videoEvent };
690
+ exports.SendVideoEvent__ArgsCodec.encode(args, output);
691
+ output.writeMessageEnd();
692
+ return this.connection.send(writer.flush(), context).then((data) => {
693
+ const reader = this.transport.receiver(data);
694
+ const input = new this.protocol(reader);
695
+ try {
696
+ const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
697
+ if (fieldName === "sendVideoEvent") {
698
+ if (messageType === thrift.MessageType.EXCEPTION) {
699
+ const err = thrift.TApplicationExceptionCodec.decode(input);
700
+ input.readMessageEnd();
701
+ return Promise.reject(err);
702
+ }
703
+ else {
704
+ const result = exports.SendVideoEvent__ResultCodec.decode(input);
705
+ input.readMessageEnd();
706
+ return Promise.resolve(result.success);
707
+ }
708
+ }
709
+ else {
710
+ return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
711
+ }
712
+ }
713
+ catch (err) {
714
+ return Promise.reject(err);
715
+ }
716
+ });
717
+ }
718
+ fullscreen(context) {
719
+ const writer = new this.transport();
720
+ const output = new this.protocol(writer);
721
+ output.writeMessageBegin("fullscreen", thrift.MessageType.CALL, this.incrementRequestId());
722
+ const args = {};
723
+ exports.Fullscreen__ArgsCodec.encode(args, output);
724
+ output.writeMessageEnd();
725
+ return this.connection.send(writer.flush(), context).then((data) => {
726
+ const reader = this.transport.receiver(data);
727
+ const input = new this.protocol(reader);
728
+ try {
729
+ const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
730
+ if (fieldName === "fullscreen") {
731
+ if (messageType === thrift.MessageType.EXCEPTION) {
732
+ const err = thrift.TApplicationExceptionCodec.decode(input);
733
+ input.readMessageEnd();
734
+ return Promise.reject(err);
735
+ }
736
+ else {
737
+ const result = exports.Fullscreen__ResultCodec.decode(input);
738
+ input.readMessageEnd();
739
+ return Promise.resolve(result.success);
740
+ }
741
+ }
742
+ else {
743
+ return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
744
+ }
745
+ }
746
+ catch (err) {
747
+ return Promise.reject(err);
748
+ }
749
+ });
750
+ }
433
751
  }
434
752
  exports.Client = Client;
435
753
  Client.serviceName = exports.serviceName;
@@ -460,6 +778,14 @@ class Processor extends thrift.ThriftProcessor {
460
778
  resolve(this.process_updateVideos(requestId, input, output, context));
461
779
  break;
462
780
  }
781
+ case "process_sendVideoEvent": {
782
+ resolve(this.process_sendVideoEvent(requestId, input, output, context));
783
+ break;
784
+ }
785
+ case "process_fullscreen": {
786
+ resolve(this.process_fullscreen(requestId, input, output, context));
787
+ break;
788
+ }
463
789
  default: {
464
790
  input.skip(thrift.TType.STRUCT);
465
791
  input.readMessageEnd();
@@ -522,6 +848,53 @@ class Processor extends thrift.ThriftProcessor {
522
848
  return output.flush();
523
849
  });
524
850
  }
851
+ process_sendVideoEvent(requestId, input, output, context) {
852
+ return new Promise((resolve, reject) => {
853
+ try {
854
+ const args = exports.SendVideoEvent__ArgsCodec.decode(input);
855
+ input.readMessageEnd();
856
+ resolve(this._handler.sendVideoEvent(args.videoEvent, context));
857
+ }
858
+ catch (err) {
859
+ reject(err);
860
+ }
861
+ }).then((data) => {
862
+ const result = { success: data };
863
+ output.writeMessageBegin("sendVideoEvent", thrift.MessageType.REPLY, requestId);
864
+ exports.SendVideoEvent__ResultCodec.encode(result, output);
865
+ output.writeMessageEnd();
866
+ return output.flush();
867
+ }).catch((err) => {
868
+ const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
869
+ output.writeMessageBegin("sendVideoEvent", thrift.MessageType.EXCEPTION, requestId);
870
+ thrift.TApplicationExceptionCodec.encode(result, output);
871
+ output.writeMessageEnd();
872
+ return output.flush();
873
+ });
874
+ }
875
+ process_fullscreen(requestId, input, output, context) {
876
+ return new Promise((resolve, reject) => {
877
+ try {
878
+ input.readMessageEnd();
879
+ resolve(this._handler.fullscreen(context));
880
+ }
881
+ catch (err) {
882
+ reject(err);
883
+ }
884
+ }).then((data) => {
885
+ const result = { success: data };
886
+ output.writeMessageBegin("fullscreen", thrift.MessageType.REPLY, requestId);
887
+ exports.Fullscreen__ResultCodec.encode(result, output);
888
+ output.writeMessageEnd();
889
+ return output.flush();
890
+ }).catch((err) => {
891
+ const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
892
+ output.writeMessageBegin("fullscreen", thrift.MessageType.EXCEPTION, requestId);
893
+ thrift.TApplicationExceptionCodec.encode(result, output);
894
+ output.writeMessageEnd();
895
+ return output.flush();
896
+ });
897
+ }
525
898
  }
526
899
  exports.Processor = Processor;
527
900
  Processor.serviceName = exports.serviceName;
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./MediaEvent";
1
2
  export * from "./PurchaseScreenReason";
2
3
  export * from "./SignInScreenReason";
3
4
  export * from "./SignInScreenReferrer";
@@ -11,6 +12,7 @@ export * from "./MaybeEpic";
11
12
  export * from "./VideoSlot";
12
13
  export * from "./MetricPaint";
13
14
  export * from "./MetricFont";
15
+ export * from "./VideoEvent";
14
16
  export * from "./Metric";
15
17
  export * from "./DiscussionServiceResponse";
16
18
  import * as Environment from "./Environment";
package/index.js CHANGED
@@ -33,6 +33,7 @@ exports.Newsletters = exports.Navigation = exports.Analytics = exports.Discussio
33
33
  * Autogenerated by @creditkarma/thrift-typescript v3.7.6
34
34
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
35
35
  */
36
+ __exportStar(require("./MediaEvent"), exports);
36
37
  __exportStar(require("./PurchaseScreenReason"), exports);
37
38
  __exportStar(require("./SignInScreenReason"), exports);
38
39
  __exportStar(require("./SignInScreenReferrer"), exports);
@@ -46,6 +47,7 @@ __exportStar(require("./MaybeEpic"), exports);
46
47
  __exportStar(require("./VideoSlot"), exports);
47
48
  __exportStar(require("./MetricPaint"), exports);
48
49
  __exportStar(require("./MetricFont"), exports);
50
+ __exportStar(require("./VideoEvent"), exports);
49
51
  __exportStar(require("./Metric"), exports);
50
52
  __exportStar(require("./DiscussionServiceResponse"), exports);
51
53
  const Environment = __importStar(require("./Environment"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/bridget",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {