@guardian/bridget 8.7.5 → 8.8.0-2026-03-05
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 +32 -0
- package/Videos.js +185 -3
- package/package.json +1 -1
package/Videos.d.ts
CHANGED
|
@@ -74,6 +74,19 @@ export declare class SetFullscreen__Args extends thrift.StructLike implements IS
|
|
|
74
74
|
static write(args: ISetFullscreen__ArgsArgs, output: thrift.TProtocol): void;
|
|
75
75
|
write(output: thrift.TProtocol): void;
|
|
76
76
|
}
|
|
77
|
+
export interface IIsAutoplayEnabled__Args {
|
|
78
|
+
}
|
|
79
|
+
export interface IIsAutoplayEnabled__ArgsArgs {
|
|
80
|
+
}
|
|
81
|
+
export declare const IsAutoplayEnabled__ArgsCodec: thrift.IStructCodec<IIsAutoplayEnabled__ArgsArgs, IIsAutoplayEnabled__Args>;
|
|
82
|
+
export declare class IsAutoplayEnabled__Args extends thrift.StructLike implements IIsAutoplayEnabled__Args {
|
|
83
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
84
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
85
|
+
constructor(args?: IIsAutoplayEnabled__ArgsArgs);
|
|
86
|
+
static read(input: thrift.TProtocol): IsAutoplayEnabled__Args;
|
|
87
|
+
static write(args: IIsAutoplayEnabled__ArgsArgs, output: thrift.TProtocol): void;
|
|
88
|
+
write(output: thrift.TProtocol): void;
|
|
89
|
+
}
|
|
77
90
|
export interface IInsertVideos__Result {
|
|
78
91
|
success?: void;
|
|
79
92
|
}
|
|
@@ -138,6 +151,22 @@ export declare class SetFullscreen__Result extends thrift.StructLike implements
|
|
|
138
151
|
static write(args: ISetFullscreen__ResultArgs, output: thrift.TProtocol): void;
|
|
139
152
|
write(output: thrift.TProtocol): void;
|
|
140
153
|
}
|
|
154
|
+
export interface IIsAutoplayEnabled__Result {
|
|
155
|
+
success?: boolean;
|
|
156
|
+
}
|
|
157
|
+
export interface IIsAutoplayEnabled__ResultArgs {
|
|
158
|
+
success?: boolean;
|
|
159
|
+
}
|
|
160
|
+
export declare const IsAutoplayEnabled__ResultCodec: thrift.IStructCodec<IIsAutoplayEnabled__ResultArgs, IIsAutoplayEnabled__Result>;
|
|
161
|
+
export declare class IsAutoplayEnabled__Result extends thrift.StructLike implements IIsAutoplayEnabled__Result {
|
|
162
|
+
success?: boolean;
|
|
163
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
164
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
165
|
+
constructor(args?: IIsAutoplayEnabled__ResultArgs);
|
|
166
|
+
static read(input: thrift.TProtocol): IsAutoplayEnabled__Result;
|
|
167
|
+
static write(args: IIsAutoplayEnabled__ResultArgs, output: thrift.TProtocol): void;
|
|
168
|
+
write(output: thrift.TProtocol): void;
|
|
169
|
+
}
|
|
141
170
|
export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
|
|
142
171
|
static readonly serviceName: string;
|
|
143
172
|
static readonly annotations: thrift.IThriftAnnotations;
|
|
@@ -154,12 +183,14 @@ export declare class Client<Context = any> extends thrift.ThriftClient<Context>
|
|
|
154
183
|
updateVideos(videoSlots: Array<VideoSlot.IVideoSlotArgs>, context?: Context): Promise<void>;
|
|
155
184
|
sendVideoEvent(videoEvent: VideoEvent.IVideoEventArgs, context?: Context): Promise<void>;
|
|
156
185
|
setFullscreen(isFullscreen: boolean, context?: Context): Promise<boolean>;
|
|
186
|
+
isAutoplayEnabled(context?: Context): Promise<boolean>;
|
|
157
187
|
}
|
|
158
188
|
export interface IHandler<Context = any> {
|
|
159
189
|
insertVideos(videoSlots: Array<VideoSlot.IVideoSlot>, context?: Context): void | Promise<void>;
|
|
160
190
|
updateVideos(videoSlots: Array<VideoSlot.IVideoSlot>, context?: Context): void | Promise<void>;
|
|
161
191
|
sendVideoEvent(videoEvent: VideoEvent.IVideoEvent, context?: Context): void | Promise<void>;
|
|
162
192
|
setFullscreen(isFullscreen: boolean, context?: Context): boolean | Promise<boolean>;
|
|
193
|
+
isAutoplayEnabled(context?: Context): boolean | Promise<boolean>;
|
|
163
194
|
}
|
|
164
195
|
export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
|
|
165
196
|
protected readonly _handler: IHandler<Context>;
|
|
@@ -177,4 +208,5 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Con
|
|
|
177
208
|
process_updateVideos(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
178
209
|
process_sendVideoEvent(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
179
210
|
process_setFullscreen(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
211
|
+
process_isAutoplayEnabled(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
180
212
|
}
|
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.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;
|
|
26
|
+
exports.Processor = exports.Client = exports.IsAutoplayEnabled__Result = exports.IsAutoplayEnabled__ResultCodec = 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.IsAutoplayEnabled__Args = exports.IsAutoplayEnabled__ArgsCodec = 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
|
/*
|
|
@@ -51,14 +51,19 @@ exports.methodAnnotations = {
|
|
|
51
51
|
setFullscreen: {
|
|
52
52
|
annotations: {},
|
|
53
53
|
fieldAnnotations: {}
|
|
54
|
+
},
|
|
55
|
+
isAutoplayEnabled: {
|
|
56
|
+
annotations: {},
|
|
57
|
+
fieldAnnotations: {}
|
|
54
58
|
}
|
|
55
59
|
};
|
|
56
|
-
exports.methodNames = ["insertVideos", "updateVideos", "sendVideoEvent", "setFullscreen"];
|
|
60
|
+
exports.methodNames = ["insertVideos", "updateVideos", "sendVideoEvent", "setFullscreen", "isAutoplayEnabled"];
|
|
57
61
|
exports.methodParameters = {
|
|
58
62
|
insertVideos: 2,
|
|
59
63
|
updateVideos: 2,
|
|
60
64
|
sendVideoEvent: 2,
|
|
61
|
-
setFullscreen: 2
|
|
65
|
+
setFullscreen: 2,
|
|
66
|
+
isAutoplayEnabled: 1
|
|
62
67
|
};
|
|
63
68
|
exports.InsertVideos__ArgsCodec = {
|
|
64
69
|
encode(args, output) {
|
|
@@ -406,6 +411,50 @@ class SetFullscreen__Args extends thrift.StructLike {
|
|
|
406
411
|
}
|
|
407
412
|
}
|
|
408
413
|
exports.SetFullscreen__Args = SetFullscreen__Args;
|
|
414
|
+
exports.IsAutoplayEnabled__ArgsCodec = {
|
|
415
|
+
encode(args, output) {
|
|
416
|
+
output.writeStructBegin("IsAutoplayEnabled__Args");
|
|
417
|
+
output.writeFieldStop();
|
|
418
|
+
output.writeStructEnd();
|
|
419
|
+
return;
|
|
420
|
+
},
|
|
421
|
+
decode(input) {
|
|
422
|
+
input.readStructBegin();
|
|
423
|
+
while (true) {
|
|
424
|
+
const ret = input.readFieldBegin();
|
|
425
|
+
const fieldType = ret.fieldType;
|
|
426
|
+
const fieldId = ret.fieldId;
|
|
427
|
+
if (fieldType === thrift.TType.STOP) {
|
|
428
|
+
break;
|
|
429
|
+
}
|
|
430
|
+
switch (fieldId) {
|
|
431
|
+
default: {
|
|
432
|
+
input.skip(fieldType);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
input.readFieldEnd();
|
|
436
|
+
}
|
|
437
|
+
input.readStructEnd();
|
|
438
|
+
return {};
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
class IsAutoplayEnabled__Args extends thrift.StructLike {
|
|
442
|
+
constructor(args = {}) {
|
|
443
|
+
super();
|
|
444
|
+
this._annotations = {};
|
|
445
|
+
this._fieldAnnotations = {};
|
|
446
|
+
}
|
|
447
|
+
static read(input) {
|
|
448
|
+
return new IsAutoplayEnabled__Args(exports.IsAutoplayEnabled__ArgsCodec.decode(input));
|
|
449
|
+
}
|
|
450
|
+
static write(args, output) {
|
|
451
|
+
return exports.IsAutoplayEnabled__ArgsCodec.encode(args, output);
|
|
452
|
+
}
|
|
453
|
+
write(output) {
|
|
454
|
+
return exports.IsAutoplayEnabled__ArgsCodec.encode(this, output);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
exports.IsAutoplayEnabled__Args = IsAutoplayEnabled__Args;
|
|
409
458
|
exports.InsertVideos__ResultCodec = {
|
|
410
459
|
encode(args, output) {
|
|
411
460
|
output.writeStructBegin("InsertVideos__Result");
|
|
@@ -651,6 +700,74 @@ class SetFullscreen__Result extends thrift.StructLike {
|
|
|
651
700
|
}
|
|
652
701
|
}
|
|
653
702
|
exports.SetFullscreen__Result = SetFullscreen__Result;
|
|
703
|
+
exports.IsAutoplayEnabled__ResultCodec = {
|
|
704
|
+
encode(args, output) {
|
|
705
|
+
const obj = {
|
|
706
|
+
success: args.success
|
|
707
|
+
};
|
|
708
|
+
output.writeStructBegin("IsAutoplayEnabled__Result");
|
|
709
|
+
if (obj.success != null) {
|
|
710
|
+
output.writeFieldBegin("success", thrift.TType.BOOL, 0);
|
|
711
|
+
output.writeBool(obj.success);
|
|
712
|
+
output.writeFieldEnd();
|
|
713
|
+
}
|
|
714
|
+
output.writeFieldStop();
|
|
715
|
+
output.writeStructEnd();
|
|
716
|
+
return;
|
|
717
|
+
},
|
|
718
|
+
decode(input) {
|
|
719
|
+
let _args = {};
|
|
720
|
+
input.readStructBegin();
|
|
721
|
+
while (true) {
|
|
722
|
+
const ret = input.readFieldBegin();
|
|
723
|
+
const fieldType = ret.fieldType;
|
|
724
|
+
const fieldId = ret.fieldId;
|
|
725
|
+
if (fieldType === thrift.TType.STOP) {
|
|
726
|
+
break;
|
|
727
|
+
}
|
|
728
|
+
switch (fieldId) {
|
|
729
|
+
case 0:
|
|
730
|
+
if (fieldType === thrift.TType.BOOL) {
|
|
731
|
+
const value_22 = input.readBool();
|
|
732
|
+
_args.success = value_22;
|
|
733
|
+
}
|
|
734
|
+
else {
|
|
735
|
+
input.skip(fieldType);
|
|
736
|
+
}
|
|
737
|
+
break;
|
|
738
|
+
default: {
|
|
739
|
+
input.skip(fieldType);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
input.readFieldEnd();
|
|
743
|
+
}
|
|
744
|
+
input.readStructEnd();
|
|
745
|
+
return {
|
|
746
|
+
success: _args.success
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
class IsAutoplayEnabled__Result extends thrift.StructLike {
|
|
751
|
+
constructor(args = {}) {
|
|
752
|
+
super();
|
|
753
|
+
this._annotations = {};
|
|
754
|
+
this._fieldAnnotations = {};
|
|
755
|
+
if (args.success != null) {
|
|
756
|
+
const value_23 = args.success;
|
|
757
|
+
this.success = value_23;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
static read(input) {
|
|
761
|
+
return new IsAutoplayEnabled__Result(exports.IsAutoplayEnabled__ResultCodec.decode(input));
|
|
762
|
+
}
|
|
763
|
+
static write(args, output) {
|
|
764
|
+
return exports.IsAutoplayEnabled__ResultCodec.encode(args, output);
|
|
765
|
+
}
|
|
766
|
+
write(output) {
|
|
767
|
+
return exports.IsAutoplayEnabled__ResultCodec.encode(this, output);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
exports.IsAutoplayEnabled__Result = IsAutoplayEnabled__Result;
|
|
654
771
|
class Client extends thrift.ThriftClient {
|
|
655
772
|
constructor() {
|
|
656
773
|
super(...arguments);
|
|
@@ -797,6 +914,44 @@ class Client extends thrift.ThriftClient {
|
|
|
797
914
|
}
|
|
798
915
|
});
|
|
799
916
|
}
|
|
917
|
+
isAutoplayEnabled(context) {
|
|
918
|
+
const writer = new this.transport();
|
|
919
|
+
const output = new this.protocol(writer);
|
|
920
|
+
output.writeMessageBegin("isAutoplayEnabled", thrift.MessageType.CALL, this.incrementRequestId());
|
|
921
|
+
const args = {};
|
|
922
|
+
exports.IsAutoplayEnabled__ArgsCodec.encode(args, output);
|
|
923
|
+
output.writeMessageEnd();
|
|
924
|
+
return this.connection.send(writer.flush(), context).then((data) => {
|
|
925
|
+
const reader = this.transport.receiver(data);
|
|
926
|
+
const input = new this.protocol(reader);
|
|
927
|
+
try {
|
|
928
|
+
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
|
|
929
|
+
if (fieldName === "isAutoplayEnabled") {
|
|
930
|
+
if (messageType === thrift.MessageType.EXCEPTION) {
|
|
931
|
+
const err = thrift.TApplicationExceptionCodec.decode(input);
|
|
932
|
+
input.readMessageEnd();
|
|
933
|
+
return Promise.reject(err);
|
|
934
|
+
}
|
|
935
|
+
else {
|
|
936
|
+
const result = exports.IsAutoplayEnabled__ResultCodec.decode(input);
|
|
937
|
+
input.readMessageEnd();
|
|
938
|
+
if (result.success != null) {
|
|
939
|
+
return Promise.resolve(result.success);
|
|
940
|
+
}
|
|
941
|
+
else {
|
|
942
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "isAutoplayEnabled failed: unknown result"));
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
else {
|
|
947
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
catch (err) {
|
|
951
|
+
return Promise.reject(err);
|
|
952
|
+
}
|
|
953
|
+
});
|
|
954
|
+
}
|
|
800
955
|
}
|
|
801
956
|
exports.Client = Client;
|
|
802
957
|
Client.serviceName = exports.serviceName;
|
|
@@ -835,6 +990,10 @@ class Processor extends thrift.ThriftProcessor {
|
|
|
835
990
|
resolve(this.process_setFullscreen(requestId, input, output, context));
|
|
836
991
|
break;
|
|
837
992
|
}
|
|
993
|
+
case "process_isAutoplayEnabled": {
|
|
994
|
+
resolve(this.process_isAutoplayEnabled(requestId, input, output, context));
|
|
995
|
+
break;
|
|
996
|
+
}
|
|
838
997
|
default: {
|
|
839
998
|
input.skip(thrift.TType.STRUCT);
|
|
840
999
|
input.readMessageEnd();
|
|
@@ -945,6 +1104,29 @@ class Processor extends thrift.ThriftProcessor {
|
|
|
945
1104
|
return output.flush();
|
|
946
1105
|
});
|
|
947
1106
|
}
|
|
1107
|
+
process_isAutoplayEnabled(requestId, input, output, context) {
|
|
1108
|
+
return new Promise((resolve, reject) => {
|
|
1109
|
+
try {
|
|
1110
|
+
input.readMessageEnd();
|
|
1111
|
+
resolve(this._handler.isAutoplayEnabled(context));
|
|
1112
|
+
}
|
|
1113
|
+
catch (err) {
|
|
1114
|
+
reject(err);
|
|
1115
|
+
}
|
|
1116
|
+
}).then((data) => {
|
|
1117
|
+
const result = { success: data };
|
|
1118
|
+
output.writeMessageBegin("isAutoplayEnabled", thrift.MessageType.REPLY, requestId);
|
|
1119
|
+
exports.IsAutoplayEnabled__ResultCodec.encode(result, output);
|
|
1120
|
+
output.writeMessageEnd();
|
|
1121
|
+
return output.flush();
|
|
1122
|
+
}).catch((err) => {
|
|
1123
|
+
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
|
1124
|
+
output.writeMessageBegin("isAutoplayEnabled", thrift.MessageType.EXCEPTION, requestId);
|
|
1125
|
+
thrift.TApplicationExceptionCodec.encode(result, output);
|
|
1126
|
+
output.writeMessageEnd();
|
|
1127
|
+
return output.flush();
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
948
1130
|
}
|
|
949
1131
|
exports.Processor = Processor;
|
|
950
1132
|
Processor.serviceName = exports.serviceName;
|