@guardian/bridget 6.0.0 → 8.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,38 @@ 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 ISetFullscreen__Args {
62
+ isFullscreen: boolean;
63
+ }
64
+ export interface ISetFullscreen__ArgsArgs {
65
+ isFullscreen: boolean;
66
+ }
67
+ export declare const SetFullscreen__ArgsCodec: thrift.IStructCodec<ISetFullscreen__ArgsArgs, ISetFullscreen__Args>;
68
+ export declare class SetFullscreen__Args extends thrift.StructLike implements ISetFullscreen__Args {
69
+ isFullscreen: boolean;
70
+ readonly _annotations: thrift.IThriftAnnotations;
71
+ readonly _fieldAnnotations: thrift.IFieldAnnotations;
72
+ constructor(args: ISetFullscreen__ArgsArgs);
73
+ static read(input: thrift.TProtocol): SetFullscreen__Args;
74
+ static write(args: ISetFullscreen__ArgsArgs, output: thrift.TProtocol): void;
75
+ write(output: thrift.TProtocol): void;
76
+ }
44
77
  export interface IInsertVideos__Result {
45
78
  success?: void;
46
79
  }
@@ -73,6 +106,38 @@ export declare class UpdateVideos__Result extends thrift.StructLike implements I
73
106
  static write(args: IUpdateVideos__ResultArgs, output: thrift.TProtocol): void;
74
107
  write(output: thrift.TProtocol): void;
75
108
  }
109
+ export interface ISendVideoEvent__Result {
110
+ success?: void;
111
+ }
112
+ export interface ISendVideoEvent__ResultArgs {
113
+ success?: void;
114
+ }
115
+ export declare const SendVideoEvent__ResultCodec: thrift.IStructCodec<ISendVideoEvent__ResultArgs, ISendVideoEvent__Result>;
116
+ export declare class SendVideoEvent__Result extends thrift.StructLike implements ISendVideoEvent__Result {
117
+ success?: void;
118
+ readonly _annotations: thrift.IThriftAnnotations;
119
+ readonly _fieldAnnotations: thrift.IFieldAnnotations;
120
+ constructor(args?: ISendVideoEvent__ResultArgs);
121
+ static read(input: thrift.TProtocol): SendVideoEvent__Result;
122
+ static write(args: ISendVideoEvent__ResultArgs, output: thrift.TProtocol): void;
123
+ write(output: thrift.TProtocol): void;
124
+ }
125
+ export interface ISetFullscreen__Result {
126
+ success?: boolean;
127
+ }
128
+ export interface ISetFullscreen__ResultArgs {
129
+ success?: boolean;
130
+ }
131
+ export declare const SetFullscreen__ResultCodec: thrift.IStructCodec<ISetFullscreen__ResultArgs, ISetFullscreen__Result>;
132
+ export declare class SetFullscreen__Result extends thrift.StructLike implements ISetFullscreen__Result {
133
+ success?: boolean;
134
+ readonly _annotations: thrift.IThriftAnnotations;
135
+ readonly _fieldAnnotations: thrift.IFieldAnnotations;
136
+ constructor(args?: ISetFullscreen__ResultArgs);
137
+ static read(input: thrift.TProtocol): SetFullscreen__Result;
138
+ static write(args: ISetFullscreen__ResultArgs, output: thrift.TProtocol): void;
139
+ write(output: thrift.TProtocol): void;
140
+ }
76
141
  export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
77
142
  static readonly serviceName: string;
78
143
  static readonly annotations: thrift.IThriftAnnotations;
@@ -87,10 +152,14 @@ export declare class Client<Context = any> extends thrift.ThriftClient<Context>
87
152
  };
88
153
  insertVideos(videoSlots: Array<VideoSlot.IVideoSlotArgs>, context?: Context): Promise<void>;
89
154
  updateVideos(videoSlots: Array<VideoSlot.IVideoSlotArgs>, context?: Context): Promise<void>;
155
+ sendVideoEvent(videoEvent: VideoEvent.IVideoEventArgs, context?: Context): Promise<void>;
156
+ setFullscreen(isFullscreen: boolean, context?: Context): Promise<boolean>;
90
157
  }
91
158
  export interface IHandler<Context = any> {
92
159
  insertVideos(videoSlots: Array<VideoSlot.IVideoSlot>, context?: Context): void | Promise<void>;
93
160
  updateVideos(videoSlots: Array<VideoSlot.IVideoSlot>, context?: Context): void | Promise<void>;
161
+ sendVideoEvent(videoEvent: VideoEvent.IVideoEvent, context?: Context): void | Promise<void>;
162
+ setFullscreen(isFullscreen: boolean, context?: Context): boolean | Promise<boolean>;
94
163
  }
95
164
  export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
96
165
  protected readonly _handler: IHandler<Context>;
@@ -106,4 +175,6 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Con
106
175
  process(input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
107
176
  process_insertVideos(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
108
177
  process_updateVideos(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
178
+ process_sendVideoEvent(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
179
+ process_setFullscreen(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
109
180
  }
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.SetFullscreen__Result = exports.SetFullscreen__ResultCodec = exports.SendVideoEvent__Result = exports.SendVideoEvent__ResultCodec = exports.UpdateVideos__Result = exports.UpdateVideos__ResultCodec = exports.InsertVideos__Result = exports.InsertVideos__ResultCodec = exports.SetFullscreen__Args = exports.SetFullscreen__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
+ setFullscreen: {
52
+ annotations: {},
53
+ fieldAnnotations: {}
45
54
  }
46
55
  };
47
- exports.methodNames = ["insertVideos", "updateVideos"];
56
+ exports.methodNames = ["insertVideos", "updateVideos", "sendVideoEvent", "setFullscreen"];
48
57
  exports.methodParameters = {
49
58
  insertVideos: 2,
50
- updateVideos: 2
59
+ updateVideos: 2,
60
+ sendVideoEvent: 2,
61
+ setFullscreen: 2
51
62
  };
52
63
  exports.InsertVideos__ArgsCodec = {
53
64
  encode(args, output) {
@@ -237,6 +248,164 @@ 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.SetFullscreen__ArgsCodec = {
331
+ encode(args, output) {
332
+ const obj = {
333
+ isFullscreen: args.isFullscreen
334
+ };
335
+ output.writeStructBegin("SetFullscreen__Args");
336
+ if (obj.isFullscreen != null) {
337
+ output.writeFieldBegin("isFullscreen", thrift.TType.BOOL, 1);
338
+ output.writeBool(obj.isFullscreen);
339
+ output.writeFieldEnd();
340
+ }
341
+ else {
342
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[isFullscreen] is unset!");
343
+ }
344
+ output.writeFieldStop();
345
+ output.writeStructEnd();
346
+ return;
347
+ },
348
+ decode(input) {
349
+ let _args = {};
350
+ input.readStructBegin();
351
+ while (true) {
352
+ const ret = input.readFieldBegin();
353
+ const fieldType = ret.fieldType;
354
+ const fieldId = ret.fieldId;
355
+ if (fieldType === thrift.TType.STOP) {
356
+ break;
357
+ }
358
+ switch (fieldId) {
359
+ case 1:
360
+ if (fieldType === thrift.TType.BOOL) {
361
+ const value_15 = input.readBool();
362
+ _args.isFullscreen = value_15;
363
+ }
364
+ else {
365
+ input.skip(fieldType);
366
+ }
367
+ break;
368
+ default: {
369
+ input.skip(fieldType);
370
+ }
371
+ }
372
+ input.readFieldEnd();
373
+ }
374
+ input.readStructEnd();
375
+ if (_args.isFullscreen !== undefined) {
376
+ return {
377
+ isFullscreen: _args.isFullscreen
378
+ };
379
+ }
380
+ else {
381
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read SetFullscreen__Args from input");
382
+ }
383
+ }
384
+ };
385
+ class SetFullscreen__Args extends thrift.StructLike {
386
+ constructor(args) {
387
+ super();
388
+ this._annotations = {};
389
+ this._fieldAnnotations = {};
390
+ if (args.isFullscreen != null) {
391
+ const value_16 = args.isFullscreen;
392
+ this.isFullscreen = value_16;
393
+ }
394
+ else {
395
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[isFullscreen] is unset!");
396
+ }
397
+ }
398
+ static read(input) {
399
+ return new SetFullscreen__Args(exports.SetFullscreen__ArgsCodec.decode(input));
400
+ }
401
+ static write(args, output) {
402
+ return exports.SetFullscreen__ArgsCodec.encode(args, output);
403
+ }
404
+ write(output) {
405
+ return exports.SetFullscreen__ArgsCodec.encode(this, output);
406
+ }
407
+ }
408
+ exports.SetFullscreen__Args = SetFullscreen__Args;
240
409
  exports.InsertVideos__ResultCodec = {
241
410
  encode(args, output) {
242
411
  output.writeStructBegin("InsertVideos__Result");
@@ -281,8 +450,8 @@ class InsertVideos__Result extends thrift.StructLike {
281
450
  this._annotations = {};
282
451
  this._fieldAnnotations = {};
283
452
  if (args.success != null) {
284
- const value_13 = undefined;
285
- this.success = value_13;
453
+ const value_17 = undefined;
454
+ this.success = value_17;
286
455
  }
287
456
  }
288
457
  static read(input) {
@@ -340,8 +509,8 @@ class UpdateVideos__Result extends thrift.StructLike {
340
509
  this._annotations = {};
341
510
  this._fieldAnnotations = {};
342
511
  if (args.success != null) {
343
- const value_14 = undefined;
344
- this.success = value_14;
512
+ const value_18 = undefined;
513
+ this.success = value_18;
345
514
  }
346
515
  }
347
516
  static read(input) {
@@ -355,6 +524,133 @@ class UpdateVideos__Result extends thrift.StructLike {
355
524
  }
356
525
  }
357
526
  exports.UpdateVideos__Result = UpdateVideos__Result;
527
+ exports.SendVideoEvent__ResultCodec = {
528
+ encode(args, output) {
529
+ output.writeStructBegin("SendVideoEvent__Result");
530
+ output.writeFieldStop();
531
+ output.writeStructEnd();
532
+ return;
533
+ },
534
+ decode(input) {
535
+ let _args = {};
536
+ input.readStructBegin();
537
+ while (true) {
538
+ const ret = input.readFieldBegin();
539
+ const fieldType = ret.fieldType;
540
+ const fieldId = ret.fieldId;
541
+ if (fieldType === thrift.TType.STOP) {
542
+ break;
543
+ }
544
+ switch (fieldId) {
545
+ case 0:
546
+ if (fieldType === thrift.TType.VOID) {
547
+ input.skip(fieldType);
548
+ }
549
+ else {
550
+ input.skip(fieldType);
551
+ }
552
+ break;
553
+ default: {
554
+ input.skip(fieldType);
555
+ }
556
+ }
557
+ input.readFieldEnd();
558
+ }
559
+ input.readStructEnd();
560
+ return {
561
+ success: _args.success
562
+ };
563
+ }
564
+ };
565
+ class SendVideoEvent__Result extends thrift.StructLike {
566
+ constructor(args = {}) {
567
+ super();
568
+ this._annotations = {};
569
+ this._fieldAnnotations = {};
570
+ if (args.success != null) {
571
+ const value_19 = undefined;
572
+ this.success = value_19;
573
+ }
574
+ }
575
+ static read(input) {
576
+ return new SendVideoEvent__Result(exports.SendVideoEvent__ResultCodec.decode(input));
577
+ }
578
+ static write(args, output) {
579
+ return exports.SendVideoEvent__ResultCodec.encode(args, output);
580
+ }
581
+ write(output) {
582
+ return exports.SendVideoEvent__ResultCodec.encode(this, output);
583
+ }
584
+ }
585
+ exports.SendVideoEvent__Result = SendVideoEvent__Result;
586
+ exports.SetFullscreen__ResultCodec = {
587
+ encode(args, output) {
588
+ const obj = {
589
+ success: args.success
590
+ };
591
+ output.writeStructBegin("SetFullscreen__Result");
592
+ if (obj.success != null) {
593
+ output.writeFieldBegin("success", thrift.TType.BOOL, 0);
594
+ output.writeBool(obj.success);
595
+ output.writeFieldEnd();
596
+ }
597
+ output.writeFieldStop();
598
+ output.writeStructEnd();
599
+ return;
600
+ },
601
+ decode(input) {
602
+ let _args = {};
603
+ input.readStructBegin();
604
+ while (true) {
605
+ const ret = input.readFieldBegin();
606
+ const fieldType = ret.fieldType;
607
+ const fieldId = ret.fieldId;
608
+ if (fieldType === thrift.TType.STOP) {
609
+ break;
610
+ }
611
+ switch (fieldId) {
612
+ case 0:
613
+ if (fieldType === thrift.TType.BOOL) {
614
+ const value_20 = input.readBool();
615
+ _args.success = value_20;
616
+ }
617
+ else {
618
+ input.skip(fieldType);
619
+ }
620
+ break;
621
+ default: {
622
+ input.skip(fieldType);
623
+ }
624
+ }
625
+ input.readFieldEnd();
626
+ }
627
+ input.readStructEnd();
628
+ return {
629
+ success: _args.success
630
+ };
631
+ }
632
+ };
633
+ class SetFullscreen__Result extends thrift.StructLike {
634
+ constructor(args = {}) {
635
+ super();
636
+ this._annotations = {};
637
+ this._fieldAnnotations = {};
638
+ if (args.success != null) {
639
+ const value_21 = args.success;
640
+ this.success = value_21;
641
+ }
642
+ }
643
+ static read(input) {
644
+ return new SetFullscreen__Result(exports.SetFullscreen__ResultCodec.decode(input));
645
+ }
646
+ static write(args, output) {
647
+ return exports.SetFullscreen__ResultCodec.encode(args, output);
648
+ }
649
+ write(output) {
650
+ return exports.SetFullscreen__ResultCodec.encode(this, output);
651
+ }
652
+ }
653
+ exports.SetFullscreen__Result = SetFullscreen__Result;
358
654
  class Client extends thrift.ThriftClient {
359
655
  constructor() {
360
656
  super(...arguments);
@@ -430,6 +726,77 @@ class Client extends thrift.ThriftClient {
430
726
  }
431
727
  });
432
728
  }
729
+ sendVideoEvent(videoEvent, context) {
730
+ const writer = new this.transport();
731
+ const output = new this.protocol(writer);
732
+ output.writeMessageBegin("sendVideoEvent", thrift.MessageType.CALL, this.incrementRequestId());
733
+ const args = { videoEvent };
734
+ exports.SendVideoEvent__ArgsCodec.encode(args, output);
735
+ output.writeMessageEnd();
736
+ return this.connection.send(writer.flush(), context).then((data) => {
737
+ const reader = this.transport.receiver(data);
738
+ const input = new this.protocol(reader);
739
+ try {
740
+ const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
741
+ if (fieldName === "sendVideoEvent") {
742
+ if (messageType === thrift.MessageType.EXCEPTION) {
743
+ const err = thrift.TApplicationExceptionCodec.decode(input);
744
+ input.readMessageEnd();
745
+ return Promise.reject(err);
746
+ }
747
+ else {
748
+ const result = exports.SendVideoEvent__ResultCodec.decode(input);
749
+ input.readMessageEnd();
750
+ return Promise.resolve(result.success);
751
+ }
752
+ }
753
+ else {
754
+ return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
755
+ }
756
+ }
757
+ catch (err) {
758
+ return Promise.reject(err);
759
+ }
760
+ });
761
+ }
762
+ setFullscreen(isFullscreen, context) {
763
+ const writer = new this.transport();
764
+ const output = new this.protocol(writer);
765
+ output.writeMessageBegin("setFullscreen", thrift.MessageType.CALL, this.incrementRequestId());
766
+ const args = { isFullscreen };
767
+ exports.SetFullscreen__ArgsCodec.encode(args, output);
768
+ output.writeMessageEnd();
769
+ return this.connection.send(writer.flush(), context).then((data) => {
770
+ const reader = this.transport.receiver(data);
771
+ const input = new this.protocol(reader);
772
+ try {
773
+ const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
774
+ if (fieldName === "setFullscreen") {
775
+ if (messageType === thrift.MessageType.EXCEPTION) {
776
+ const err = thrift.TApplicationExceptionCodec.decode(input);
777
+ input.readMessageEnd();
778
+ return Promise.reject(err);
779
+ }
780
+ else {
781
+ const result = exports.SetFullscreen__ResultCodec.decode(input);
782
+ input.readMessageEnd();
783
+ if (result.success != null) {
784
+ return Promise.resolve(result.success);
785
+ }
786
+ else {
787
+ return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "setFullscreen failed: unknown result"));
788
+ }
789
+ }
790
+ }
791
+ else {
792
+ return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
793
+ }
794
+ }
795
+ catch (err) {
796
+ return Promise.reject(err);
797
+ }
798
+ });
799
+ }
433
800
  }
434
801
  exports.Client = Client;
435
802
  Client.serviceName = exports.serviceName;
@@ -460,6 +827,14 @@ class Processor extends thrift.ThriftProcessor {
460
827
  resolve(this.process_updateVideos(requestId, input, output, context));
461
828
  break;
462
829
  }
830
+ case "process_sendVideoEvent": {
831
+ resolve(this.process_sendVideoEvent(requestId, input, output, context));
832
+ break;
833
+ }
834
+ case "process_setFullscreen": {
835
+ resolve(this.process_setFullscreen(requestId, input, output, context));
836
+ break;
837
+ }
463
838
  default: {
464
839
  input.skip(thrift.TType.STRUCT);
465
840
  input.readMessageEnd();
@@ -522,6 +897,54 @@ class Processor extends thrift.ThriftProcessor {
522
897
  return output.flush();
523
898
  });
524
899
  }
900
+ process_sendVideoEvent(requestId, input, output, context) {
901
+ return new Promise((resolve, reject) => {
902
+ try {
903
+ const args = exports.SendVideoEvent__ArgsCodec.decode(input);
904
+ input.readMessageEnd();
905
+ resolve(this._handler.sendVideoEvent(args.videoEvent, context));
906
+ }
907
+ catch (err) {
908
+ reject(err);
909
+ }
910
+ }).then((data) => {
911
+ const result = { success: data };
912
+ output.writeMessageBegin("sendVideoEvent", thrift.MessageType.REPLY, requestId);
913
+ exports.SendVideoEvent__ResultCodec.encode(result, output);
914
+ output.writeMessageEnd();
915
+ return output.flush();
916
+ }).catch((err) => {
917
+ const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
918
+ output.writeMessageBegin("sendVideoEvent", thrift.MessageType.EXCEPTION, requestId);
919
+ thrift.TApplicationExceptionCodec.encode(result, output);
920
+ output.writeMessageEnd();
921
+ return output.flush();
922
+ });
923
+ }
924
+ process_setFullscreen(requestId, input, output, context) {
925
+ return new Promise((resolve, reject) => {
926
+ try {
927
+ const args = exports.SetFullscreen__ArgsCodec.decode(input);
928
+ input.readMessageEnd();
929
+ resolve(this._handler.setFullscreen(args.isFullscreen, context));
930
+ }
931
+ catch (err) {
932
+ reject(err);
933
+ }
934
+ }).then((data) => {
935
+ const result = { success: data };
936
+ output.writeMessageBegin("setFullscreen", thrift.MessageType.REPLY, requestId);
937
+ exports.SetFullscreen__ResultCodec.encode(result, output);
938
+ output.writeMessageEnd();
939
+ return output.flush();
940
+ }).catch((err) => {
941
+ const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
942
+ output.writeMessageBegin("setFullscreen", thrift.MessageType.EXCEPTION, requestId);
943
+ thrift.TApplicationExceptionCodec.encode(result, output);
944
+ output.writeMessageEnd();
945
+ return output.flush();
946
+ });
947
+ }
525
948
  }
526
949
  exports.Processor = Processor;
527
950
  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": "8.0.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {