@guardian/bridget
Advanced tools
Comparing version 0.0.0-2024-09-26-snapshot-1 to 0.0.0-2024-10-10-snapshot-1
{ | ||
"name": "@guardian/bridget", | ||
"version": "0.0.0-2024-09-26-snapshot-1", | ||
"version": "0.0.0-2024-10-10-snapshot-1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -77,15 +77,2 @@ /// <reference types="node" /> | ||
} | ||
export interface IWebFullscreen__Args { | ||
} | ||
export interface IWebFullscreen__ArgsArgs { | ||
} | ||
export declare const WebFullscreen__ArgsCodec: thrift.IStructCodec<IWebFullscreen__ArgsArgs, IWebFullscreen__Args>; | ||
export declare class WebFullscreen__Args extends thrift.StructLike implements IWebFullscreen__Args { | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IWebFullscreen__ArgsArgs); | ||
static read(input: thrift.TProtocol): WebFullscreen__Args; | ||
static write(args: IWebFullscreen__ArgsArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface IInsertVideos__Result { | ||
@@ -140,10 +127,10 @@ success?: void; | ||
export interface ISetFullscreen__Result { | ||
success?: void; | ||
success?: boolean; | ||
} | ||
export interface ISetFullscreen__ResultArgs { | ||
success?: void; | ||
success?: boolean; | ||
} | ||
export declare const SetFullscreen__ResultCodec: thrift.IStructCodec<ISetFullscreen__ResultArgs, ISetFullscreen__Result>; | ||
export declare class SetFullscreen__Result extends thrift.StructLike implements ISetFullscreen__Result { | ||
success?: void; | ||
success?: boolean; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
@@ -156,18 +143,2 @@ readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
} | ||
export interface IWebFullscreen__Result { | ||
success?: boolean; | ||
} | ||
export interface IWebFullscreen__ResultArgs { | ||
success?: boolean; | ||
} | ||
export declare const WebFullscreen__ResultCodec: thrift.IStructCodec<IWebFullscreen__ResultArgs, IWebFullscreen__Result>; | ||
export declare class WebFullscreen__Result extends thrift.StructLike implements IWebFullscreen__Result { | ||
success?: boolean; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IWebFullscreen__ResultArgs); | ||
static read(input: thrift.TProtocol): WebFullscreen__Result; | ||
static write(args: IWebFullscreen__ResultArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export declare class Client<Context = any> extends thrift.ThriftClient<Context> { | ||
@@ -188,4 +159,3 @@ static readonly serviceName: string; | ||
sendVideoEvent(videoEvent: VideoEvent.IVideoEventArgs, context?: Context): Promise<void>; | ||
setFullscreen(isFullscreen: boolean, context?: Context): Promise<void>; | ||
webFullscreen(context?: Context): Promise<boolean>; | ||
setFullscreen(isFullscreen: boolean, context?: Context): Promise<boolean>; | ||
} | ||
@@ -196,4 +166,3 @@ export interface IHandler<Context = any> { | ||
sendVideoEvent(videoEvent: VideoEvent.IVideoEvent, context?: Context): void | Promise<void>; | ||
setFullscreen(isFullscreen: boolean, context?: Context): void | Promise<void>; | ||
webFullscreen(context?: Context): boolean | Promise<boolean>; | ||
setFullscreen(isFullscreen: boolean, context?: Context): boolean | Promise<boolean>; | ||
} | ||
@@ -216,3 +185,2 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> { | ||
process_setFullscreen(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>; | ||
process_webFullscreen(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>; | ||
} |
196
Videos.js
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Processor = exports.Client = exports.WebFullscreen__Result = exports.WebFullscreen__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.WebFullscreen__Args = exports.WebFullscreen__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; | ||
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; | ||
/* tslint:disable */ | ||
@@ -55,9 +55,5 @@ /* eslint-disable */ | ||
fieldAnnotations: {} | ||
}, | ||
webFullscreen: { | ||
annotations: {}, | ||
fieldAnnotations: {} | ||
} | ||
}; | ||
exports.methodNames = ["insertVideos", "updateVideos", "sendVideoEvent", "setFullscreen", "webFullscreen"]; | ||
exports.methodNames = ["insertVideos", "updateVideos", "sendVideoEvent", "setFullscreen"]; | ||
exports.methodParameters = { | ||
@@ -67,4 +63,3 @@ insertVideos: 2, | ||
sendVideoEvent: 2, | ||
setFullscreen: 2, | ||
webFullscreen: 1 | ||
setFullscreen: 2 | ||
}; | ||
@@ -417,46 +412,2 @@ exports.InsertVideos__ArgsCodec = { | ||
exports.SetFullscreen__Args = SetFullscreen__Args; | ||
exports.WebFullscreen__ArgsCodec = { | ||
encode(args, output) { | ||
output.writeStructBegin("WebFullscreen__Args"); | ||
output.writeFieldStop(); | ||
output.writeStructEnd(); | ||
return; | ||
}, | ||
decode(input) { | ||
input.readStructBegin(); | ||
while (true) { | ||
const ret = input.readFieldBegin(); | ||
const fieldType = ret.fieldType; | ||
const fieldId = ret.fieldId; | ||
if (fieldType === thrift.TType.STOP) { | ||
break; | ||
} | ||
switch (fieldId) { | ||
default: { | ||
input.skip(fieldType); | ||
} | ||
} | ||
input.readFieldEnd(); | ||
} | ||
input.readStructEnd(); | ||
return {}; | ||
} | ||
}; | ||
class WebFullscreen__Args extends thrift.StructLike { | ||
constructor(args = {}) { | ||
super(); | ||
this._annotations = {}; | ||
this._fieldAnnotations = {}; | ||
} | ||
static read(input) { | ||
return new WebFullscreen__Args(exports.WebFullscreen__ArgsCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.WebFullscreen__ArgsCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.WebFullscreen__ArgsCodec.encode(this, output); | ||
} | ||
} | ||
exports.WebFullscreen__Args = WebFullscreen__Args; | ||
exports.InsertVideos__ResultCodec = { | ||
@@ -641,65 +592,6 @@ encode(args, output) { | ||
encode(args, output) { | ||
output.writeStructBegin("SetFullscreen__Result"); | ||
output.writeFieldStop(); | ||
output.writeStructEnd(); | ||
return; | ||
}, | ||
decode(input) { | ||
let _args = {}; | ||
input.readStructBegin(); | ||
while (true) { | ||
const ret = input.readFieldBegin(); | ||
const fieldType = ret.fieldType; | ||
const fieldId = ret.fieldId; | ||
if (fieldType === thrift.TType.STOP) { | ||
break; | ||
} | ||
switch (fieldId) { | ||
case 0: | ||
if (fieldType === thrift.TType.VOID) { | ||
input.skip(fieldType); | ||
} | ||
else { | ||
input.skip(fieldType); | ||
} | ||
break; | ||
default: { | ||
input.skip(fieldType); | ||
} | ||
} | ||
input.readFieldEnd(); | ||
} | ||
input.readStructEnd(); | ||
return { | ||
success: _args.success | ||
}; | ||
} | ||
}; | ||
class SetFullscreen__Result extends thrift.StructLike { | ||
constructor(args = {}) { | ||
super(); | ||
this._annotations = {}; | ||
this._fieldAnnotations = {}; | ||
if (args.success != null) { | ||
const value_20 = undefined; | ||
this.success = value_20; | ||
} | ||
} | ||
static read(input) { | ||
return new SetFullscreen__Result(exports.SetFullscreen__ResultCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.SetFullscreen__ResultCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.SetFullscreen__ResultCodec.encode(this, output); | ||
} | ||
} | ||
exports.SetFullscreen__Result = SetFullscreen__Result; | ||
exports.WebFullscreen__ResultCodec = { | ||
encode(args, output) { | ||
const obj = { | ||
success: args.success | ||
}; | ||
output.writeStructBegin("WebFullscreen__Result"); | ||
output.writeStructBegin("SetFullscreen__Result"); | ||
if (obj.success != null) { | ||
@@ -727,4 +619,4 @@ output.writeFieldBegin("success", thrift.TType.BOOL, 0); | ||
if (fieldType === thrift.TType.BOOL) { | ||
const value_21 = input.readBool(); | ||
_args.success = value_21; | ||
const value_20 = input.readBool(); | ||
_args.success = value_20; | ||
} | ||
@@ -747,3 +639,3 @@ else { | ||
}; | ||
class WebFullscreen__Result extends thrift.StructLike { | ||
class SetFullscreen__Result extends thrift.StructLike { | ||
constructor(args = {}) { | ||
@@ -754,17 +646,17 @@ super(); | ||
if (args.success != null) { | ||
const value_22 = args.success; | ||
this.success = value_22; | ||
const value_21 = args.success; | ||
this.success = value_21; | ||
} | ||
} | ||
static read(input) { | ||
return new WebFullscreen__Result(exports.WebFullscreen__ResultCodec.decode(input)); | ||
return new SetFullscreen__Result(exports.SetFullscreen__ResultCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.WebFullscreen__ResultCodec.encode(args, output); | ||
return exports.SetFullscreen__ResultCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.WebFullscreen__ResultCodec.encode(this, output); | ||
return exports.SetFullscreen__ResultCodec.encode(this, output); | ||
} | ||
} | ||
exports.WebFullscreen__Result = WebFullscreen__Result; | ||
exports.SetFullscreen__Result = SetFullscreen__Result; | ||
class Client extends thrift.ThriftClient { | ||
@@ -899,35 +791,2 @@ constructor() { | ||
input.readMessageEnd(); | ||
return Promise.resolve(result.success); | ||
} | ||
} | ||
else { | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName)); | ||
} | ||
} | ||
catch (err) { | ||
return Promise.reject(err); | ||
} | ||
}); | ||
} | ||
webFullscreen(context) { | ||
const writer = new this.transport(); | ||
const output = new this.protocol(writer); | ||
output.writeMessageBegin("webFullscreen", thrift.MessageType.CALL, this.incrementRequestId()); | ||
const args = {}; | ||
exports.WebFullscreen__ArgsCodec.encode(args, output); | ||
output.writeMessageEnd(); | ||
return this.connection.send(writer.flush(), context).then((data) => { | ||
const reader = this.transport.receiver(data); | ||
const input = new this.protocol(reader); | ||
try { | ||
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin(); | ||
if (fieldName === "webFullscreen") { | ||
if (messageType === thrift.MessageType.EXCEPTION) { | ||
const err = thrift.TApplicationExceptionCodec.decode(input); | ||
input.readMessageEnd(); | ||
return Promise.reject(err); | ||
} | ||
else { | ||
const result = exports.WebFullscreen__ResultCodec.decode(input); | ||
input.readMessageEnd(); | ||
if (result.success != null) { | ||
@@ -937,3 +796,3 @@ return Promise.resolve(result.success); | ||
else { | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "webFullscreen failed: unknown result")); | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "setFullscreen failed: unknown result")); | ||
} | ||
@@ -989,6 +848,2 @@ } | ||
} | ||
case "process_webFullscreen": { | ||
resolve(this.process_webFullscreen(requestId, input, output, context)); | ||
break; | ||
} | ||
default: { | ||
@@ -1104,25 +959,2 @@ input.skip(thrift.TType.STRUCT); | ||
} | ||
process_webFullscreen(requestId, input, output, context) { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
input.readMessageEnd(); | ||
resolve(this._handler.webFullscreen(context)); | ||
} | ||
catch (err) { | ||
reject(err); | ||
} | ||
}).then((data) => { | ||
const result = { success: data }; | ||
output.writeMessageBegin("webFullscreen", thrift.MessageType.REPLY, requestId); | ||
exports.WebFullscreen__ResultCodec.encode(result, output); | ||
output.writeMessageEnd(); | ||
return output.flush(); | ||
}).catch((err) => { | ||
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message); | ||
output.writeMessageBegin("webFullscreen", thrift.MessageType.EXCEPTION, requestId); | ||
thrift.TApplicationExceptionCodec.encode(result, output); | ||
output.writeMessageEnd(); | ||
return output.flush(); | ||
}); | ||
} | ||
} | ||
@@ -1129,0 +961,0 @@ exports.Processor = Processor; |
501827
12433