@guardian/bridget 7.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.
- package/Videos.d.ts +23 -20
- package/Videos.js +94 -44
- package/package.json +1 -1
package/Videos.d.ts
CHANGED
|
@@ -58,17 +58,20 @@ export declare class SendVideoEvent__Args extends thrift.StructLike implements I
|
|
|
58
58
|
static write(args: ISendVideoEvent__ArgsArgs, output: thrift.TProtocol): void;
|
|
59
59
|
write(output: thrift.TProtocol): void;
|
|
60
60
|
}
|
|
61
|
-
export interface
|
|
61
|
+
export interface ISetFullscreen__Args {
|
|
62
|
+
isFullscreen: boolean;
|
|
62
63
|
}
|
|
63
|
-
export interface
|
|
64
|
+
export interface ISetFullscreen__ArgsArgs {
|
|
65
|
+
isFullscreen: boolean;
|
|
64
66
|
}
|
|
65
|
-
export declare const
|
|
66
|
-
export declare class
|
|
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;
|
|
67
70
|
readonly _annotations: thrift.IThriftAnnotations;
|
|
68
71
|
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
69
|
-
constructor(args
|
|
70
|
-
static read(input: thrift.TProtocol):
|
|
71
|
-
static write(args:
|
|
72
|
+
constructor(args: ISetFullscreen__ArgsArgs);
|
|
73
|
+
static read(input: thrift.TProtocol): SetFullscreen__Args;
|
|
74
|
+
static write(args: ISetFullscreen__ArgsArgs, output: thrift.TProtocol): void;
|
|
72
75
|
write(output: thrift.TProtocol): void;
|
|
73
76
|
}
|
|
74
77
|
export interface IInsertVideos__Result {
|
|
@@ -119,20 +122,20 @@ export declare class SendVideoEvent__Result extends thrift.StructLike implements
|
|
|
119
122
|
static write(args: ISendVideoEvent__ResultArgs, output: thrift.TProtocol): void;
|
|
120
123
|
write(output: thrift.TProtocol): void;
|
|
121
124
|
}
|
|
122
|
-
export interface
|
|
123
|
-
success?:
|
|
125
|
+
export interface ISetFullscreen__Result {
|
|
126
|
+
success?: boolean;
|
|
124
127
|
}
|
|
125
|
-
export interface
|
|
126
|
-
success?:
|
|
128
|
+
export interface ISetFullscreen__ResultArgs {
|
|
129
|
+
success?: boolean;
|
|
127
130
|
}
|
|
128
|
-
export declare const
|
|
129
|
-
export declare class
|
|
130
|
-
success?:
|
|
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;
|
|
131
134
|
readonly _annotations: thrift.IThriftAnnotations;
|
|
132
135
|
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
133
|
-
constructor(args?:
|
|
134
|
-
static read(input: thrift.TProtocol):
|
|
135
|
-
static write(args:
|
|
136
|
+
constructor(args?: ISetFullscreen__ResultArgs);
|
|
137
|
+
static read(input: thrift.TProtocol): SetFullscreen__Result;
|
|
138
|
+
static write(args: ISetFullscreen__ResultArgs, output: thrift.TProtocol): void;
|
|
136
139
|
write(output: thrift.TProtocol): void;
|
|
137
140
|
}
|
|
138
141
|
export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
|
|
@@ -150,13 +153,13 @@ export declare class Client<Context = any> extends thrift.ThriftClient<Context>
|
|
|
150
153
|
insertVideos(videoSlots: Array<VideoSlot.IVideoSlotArgs>, context?: Context): Promise<void>;
|
|
151
154
|
updateVideos(videoSlots: Array<VideoSlot.IVideoSlotArgs>, context?: Context): Promise<void>;
|
|
152
155
|
sendVideoEvent(videoEvent: VideoEvent.IVideoEventArgs, context?: Context): Promise<void>;
|
|
153
|
-
|
|
156
|
+
setFullscreen(isFullscreen: boolean, context?: Context): Promise<boolean>;
|
|
154
157
|
}
|
|
155
158
|
export interface IHandler<Context = any> {
|
|
156
159
|
insertVideos(videoSlots: Array<VideoSlot.IVideoSlot>, context?: Context): void | Promise<void>;
|
|
157
160
|
updateVideos(videoSlots: Array<VideoSlot.IVideoSlot>, context?: Context): void | Promise<void>;
|
|
158
161
|
sendVideoEvent(videoEvent: VideoEvent.IVideoEvent, context?: Context): void | Promise<void>;
|
|
159
|
-
|
|
162
|
+
setFullscreen(isFullscreen: boolean, context?: Context): boolean | Promise<boolean>;
|
|
160
163
|
}
|
|
161
164
|
export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
|
|
162
165
|
protected readonly _handler: IHandler<Context>;
|
|
@@ -173,5 +176,5 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Con
|
|
|
173
176
|
process_insertVideos(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
174
177
|
process_updateVideos(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
175
178
|
process_sendVideoEvent(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
176
|
-
|
|
179
|
+
process_setFullscreen(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
177
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.
|
|
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
|
/*
|
|
@@ -48,17 +48,17 @@ exports.methodAnnotations = {
|
|
|
48
48
|
annotations: {},
|
|
49
49
|
fieldAnnotations: {}
|
|
50
50
|
},
|
|
51
|
-
|
|
51
|
+
setFullscreen: {
|
|
52
52
|
annotations: {},
|
|
53
53
|
fieldAnnotations: {}
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
exports.methodNames = ["insertVideos", "updateVideos", "sendVideoEvent", "
|
|
56
|
+
exports.methodNames = ["insertVideos", "updateVideos", "sendVideoEvent", "setFullscreen"];
|
|
57
57
|
exports.methodParameters = {
|
|
58
58
|
insertVideos: 2,
|
|
59
59
|
updateVideos: 2,
|
|
60
60
|
sendVideoEvent: 2,
|
|
61
|
-
|
|
61
|
+
setFullscreen: 2
|
|
62
62
|
};
|
|
63
63
|
exports.InsertVideos__ArgsCodec = {
|
|
64
64
|
encode(args, output) {
|
|
@@ -327,14 +327,26 @@ class SendVideoEvent__Args extends thrift.StructLike {
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
exports.SendVideoEvent__Args = SendVideoEvent__Args;
|
|
330
|
-
exports.
|
|
330
|
+
exports.SetFullscreen__ArgsCodec = {
|
|
331
331
|
encode(args, output) {
|
|
332
|
-
|
|
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
|
+
}
|
|
333
344
|
output.writeFieldStop();
|
|
334
345
|
output.writeStructEnd();
|
|
335
346
|
return;
|
|
336
347
|
},
|
|
337
348
|
decode(input) {
|
|
349
|
+
let _args = {};
|
|
338
350
|
input.readStructBegin();
|
|
339
351
|
while (true) {
|
|
340
352
|
const ret = input.readFieldBegin();
|
|
@@ -344,6 +356,15 @@ exports.Fullscreen__ArgsCodec = {
|
|
|
344
356
|
break;
|
|
345
357
|
}
|
|
346
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;
|
|
347
368
|
default: {
|
|
348
369
|
input.skip(fieldType);
|
|
349
370
|
}
|
|
@@ -351,26 +372,40 @@ exports.Fullscreen__ArgsCodec = {
|
|
|
351
372
|
input.readFieldEnd();
|
|
352
373
|
}
|
|
353
374
|
input.readStructEnd();
|
|
354
|
-
|
|
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
|
+
}
|
|
355
383
|
}
|
|
356
384
|
};
|
|
357
|
-
class
|
|
358
|
-
constructor(args
|
|
385
|
+
class SetFullscreen__Args extends thrift.StructLike {
|
|
386
|
+
constructor(args) {
|
|
359
387
|
super();
|
|
360
388
|
this._annotations = {};
|
|
361
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
|
+
}
|
|
362
397
|
}
|
|
363
398
|
static read(input) {
|
|
364
|
-
return new
|
|
399
|
+
return new SetFullscreen__Args(exports.SetFullscreen__ArgsCodec.decode(input));
|
|
365
400
|
}
|
|
366
401
|
static write(args, output) {
|
|
367
|
-
return exports.
|
|
402
|
+
return exports.SetFullscreen__ArgsCodec.encode(args, output);
|
|
368
403
|
}
|
|
369
404
|
write(output) {
|
|
370
|
-
return exports.
|
|
405
|
+
return exports.SetFullscreen__ArgsCodec.encode(this, output);
|
|
371
406
|
}
|
|
372
407
|
}
|
|
373
|
-
exports.
|
|
408
|
+
exports.SetFullscreen__Args = SetFullscreen__Args;
|
|
374
409
|
exports.InsertVideos__ResultCodec = {
|
|
375
410
|
encode(args, output) {
|
|
376
411
|
output.writeStructBegin("InsertVideos__Result");
|
|
@@ -415,8 +450,8 @@ class InsertVideos__Result extends thrift.StructLike {
|
|
|
415
450
|
this._annotations = {};
|
|
416
451
|
this._fieldAnnotations = {};
|
|
417
452
|
if (args.success != null) {
|
|
418
|
-
const
|
|
419
|
-
this.success =
|
|
453
|
+
const value_17 = undefined;
|
|
454
|
+
this.success = value_17;
|
|
420
455
|
}
|
|
421
456
|
}
|
|
422
457
|
static read(input) {
|
|
@@ -474,8 +509,8 @@ class UpdateVideos__Result extends thrift.StructLike {
|
|
|
474
509
|
this._annotations = {};
|
|
475
510
|
this._fieldAnnotations = {};
|
|
476
511
|
if (args.success != null) {
|
|
477
|
-
const
|
|
478
|
-
this.success =
|
|
512
|
+
const value_18 = undefined;
|
|
513
|
+
this.success = value_18;
|
|
479
514
|
}
|
|
480
515
|
}
|
|
481
516
|
static read(input) {
|
|
@@ -533,8 +568,8 @@ class SendVideoEvent__Result extends thrift.StructLike {
|
|
|
533
568
|
this._annotations = {};
|
|
534
569
|
this._fieldAnnotations = {};
|
|
535
570
|
if (args.success != null) {
|
|
536
|
-
const
|
|
537
|
-
this.success =
|
|
571
|
+
const value_19 = undefined;
|
|
572
|
+
this.success = value_19;
|
|
538
573
|
}
|
|
539
574
|
}
|
|
540
575
|
static read(input) {
|
|
@@ -548,9 +583,17 @@ class SendVideoEvent__Result extends thrift.StructLike {
|
|
|
548
583
|
}
|
|
549
584
|
}
|
|
550
585
|
exports.SendVideoEvent__Result = SendVideoEvent__Result;
|
|
551
|
-
exports.
|
|
586
|
+
exports.SetFullscreen__ResultCodec = {
|
|
552
587
|
encode(args, output) {
|
|
553
|
-
|
|
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
|
+
}
|
|
554
597
|
output.writeFieldStop();
|
|
555
598
|
output.writeStructEnd();
|
|
556
599
|
return;
|
|
@@ -567,8 +610,9 @@ exports.Fullscreen__ResultCodec = {
|
|
|
567
610
|
}
|
|
568
611
|
switch (fieldId) {
|
|
569
612
|
case 0:
|
|
570
|
-
if (fieldType === thrift.TType.
|
|
571
|
-
input.
|
|
613
|
+
if (fieldType === thrift.TType.BOOL) {
|
|
614
|
+
const value_20 = input.readBool();
|
|
615
|
+
_args.success = value_20;
|
|
572
616
|
}
|
|
573
617
|
else {
|
|
574
618
|
input.skip(fieldType);
|
|
@@ -586,27 +630,27 @@ exports.Fullscreen__ResultCodec = {
|
|
|
586
630
|
};
|
|
587
631
|
}
|
|
588
632
|
};
|
|
589
|
-
class
|
|
633
|
+
class SetFullscreen__Result extends thrift.StructLike {
|
|
590
634
|
constructor(args = {}) {
|
|
591
635
|
super();
|
|
592
636
|
this._annotations = {};
|
|
593
637
|
this._fieldAnnotations = {};
|
|
594
638
|
if (args.success != null) {
|
|
595
|
-
const
|
|
596
|
-
this.success =
|
|
639
|
+
const value_21 = args.success;
|
|
640
|
+
this.success = value_21;
|
|
597
641
|
}
|
|
598
642
|
}
|
|
599
643
|
static read(input) {
|
|
600
|
-
return new
|
|
644
|
+
return new SetFullscreen__Result(exports.SetFullscreen__ResultCodec.decode(input));
|
|
601
645
|
}
|
|
602
646
|
static write(args, output) {
|
|
603
|
-
return exports.
|
|
647
|
+
return exports.SetFullscreen__ResultCodec.encode(args, output);
|
|
604
648
|
}
|
|
605
649
|
write(output) {
|
|
606
|
-
return exports.
|
|
650
|
+
return exports.SetFullscreen__ResultCodec.encode(this, output);
|
|
607
651
|
}
|
|
608
652
|
}
|
|
609
|
-
exports.
|
|
653
|
+
exports.SetFullscreen__Result = SetFullscreen__Result;
|
|
610
654
|
class Client extends thrift.ThriftClient {
|
|
611
655
|
constructor() {
|
|
612
656
|
super(...arguments);
|
|
@@ -715,28 +759,33 @@ class Client extends thrift.ThriftClient {
|
|
|
715
759
|
}
|
|
716
760
|
});
|
|
717
761
|
}
|
|
718
|
-
|
|
762
|
+
setFullscreen(isFullscreen, context) {
|
|
719
763
|
const writer = new this.transport();
|
|
720
764
|
const output = new this.protocol(writer);
|
|
721
|
-
output.writeMessageBegin("
|
|
722
|
-
const args = {};
|
|
723
|
-
exports.
|
|
765
|
+
output.writeMessageBegin("setFullscreen", thrift.MessageType.CALL, this.incrementRequestId());
|
|
766
|
+
const args = { isFullscreen };
|
|
767
|
+
exports.SetFullscreen__ArgsCodec.encode(args, output);
|
|
724
768
|
output.writeMessageEnd();
|
|
725
769
|
return this.connection.send(writer.flush(), context).then((data) => {
|
|
726
770
|
const reader = this.transport.receiver(data);
|
|
727
771
|
const input = new this.protocol(reader);
|
|
728
772
|
try {
|
|
729
773
|
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
|
|
730
|
-
if (fieldName === "
|
|
774
|
+
if (fieldName === "setFullscreen") {
|
|
731
775
|
if (messageType === thrift.MessageType.EXCEPTION) {
|
|
732
776
|
const err = thrift.TApplicationExceptionCodec.decode(input);
|
|
733
777
|
input.readMessageEnd();
|
|
734
778
|
return Promise.reject(err);
|
|
735
779
|
}
|
|
736
780
|
else {
|
|
737
|
-
const result = exports.
|
|
781
|
+
const result = exports.SetFullscreen__ResultCodec.decode(input);
|
|
738
782
|
input.readMessageEnd();
|
|
739
|
-
|
|
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
|
+
}
|
|
740
789
|
}
|
|
741
790
|
}
|
|
742
791
|
else {
|
|
@@ -782,8 +831,8 @@ class Processor extends thrift.ThriftProcessor {
|
|
|
782
831
|
resolve(this.process_sendVideoEvent(requestId, input, output, context));
|
|
783
832
|
break;
|
|
784
833
|
}
|
|
785
|
-
case "
|
|
786
|
-
resolve(this.
|
|
834
|
+
case "process_setFullscreen": {
|
|
835
|
+
resolve(this.process_setFullscreen(requestId, input, output, context));
|
|
787
836
|
break;
|
|
788
837
|
}
|
|
789
838
|
default: {
|
|
@@ -872,24 +921,25 @@ class Processor extends thrift.ThriftProcessor {
|
|
|
872
921
|
return output.flush();
|
|
873
922
|
});
|
|
874
923
|
}
|
|
875
|
-
|
|
924
|
+
process_setFullscreen(requestId, input, output, context) {
|
|
876
925
|
return new Promise((resolve, reject) => {
|
|
877
926
|
try {
|
|
927
|
+
const args = exports.SetFullscreen__ArgsCodec.decode(input);
|
|
878
928
|
input.readMessageEnd();
|
|
879
|
-
resolve(this._handler.
|
|
929
|
+
resolve(this._handler.setFullscreen(args.isFullscreen, context));
|
|
880
930
|
}
|
|
881
931
|
catch (err) {
|
|
882
932
|
reject(err);
|
|
883
933
|
}
|
|
884
934
|
}).then((data) => {
|
|
885
935
|
const result = { success: data };
|
|
886
|
-
output.writeMessageBegin("
|
|
887
|
-
exports.
|
|
936
|
+
output.writeMessageBegin("setFullscreen", thrift.MessageType.REPLY, requestId);
|
|
937
|
+
exports.SetFullscreen__ResultCodec.encode(result, output);
|
|
888
938
|
output.writeMessageEnd();
|
|
889
939
|
return output.flush();
|
|
890
940
|
}).catch((err) => {
|
|
891
941
|
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
|
892
|
-
output.writeMessageBegin("
|
|
942
|
+
output.writeMessageBegin("setFullscreen", thrift.MessageType.EXCEPTION, requestId);
|
|
893
943
|
thrift.TApplicationExceptionCodec.encode(result, output);
|
|
894
944
|
output.writeMessageEnd();
|
|
895
945
|
return output.flush();
|