@guardian/bridget
Advanced tools
Comparing version 0.0.0-2024-04-11-snapshot-2 to 0.0.0-2024-04-16-snapshot-1
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import * as thrift from "@creditkarma/thrift-server-core"; | ||
import * as DiscussionResponse from "./DiscussionResponse"; | ||
import * as ReportAbuseParameters from "./ReportAbuseParameters"; | ||
import * as GetUserProfileResponse from "./GetUserProfileResponse"; | ||
import * as DiscussionServiceResponse from "./DiscussionServiceResponse"; | ||
export declare const serviceName: string; | ||
@@ -49,18 +47,2 @@ export declare const annotations: thrift.IThriftAnnotations; | ||
} | ||
export interface IPreview__Args { | ||
body: string; | ||
} | ||
export interface IPreview__ArgsArgs { | ||
body: string; | ||
} | ||
export declare const Preview__ArgsCodec: thrift.IStructCodec<IPreview__ArgsArgs, IPreview__Args>; | ||
export declare class Preview__Args extends thrift.StructLike implements IPreview__Args { | ||
body: string; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args: IPreview__ArgsArgs); | ||
static read(input: thrift.TProtocol): Preview__Args; | ||
static write(args: IPreview__ArgsArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface IReply__Args { | ||
@@ -88,18 +70,2 @@ shortUrl: string; | ||
} | ||
export interface IReportAbuse__Args { | ||
parameters: ReportAbuseParameters.IReportAbuseParameters; | ||
} | ||
export interface IReportAbuse__ArgsArgs { | ||
parameters: ReportAbuseParameters.IReportAbuseParametersArgs; | ||
} | ||
export declare const ReportAbuse__ArgsCodec: thrift.IStructCodec<IReportAbuse__ArgsArgs, IReportAbuse__Args>; | ||
export declare class ReportAbuse__Args extends thrift.StructLike implements IReportAbuse__Args { | ||
parameters: ReportAbuseParameters.IReportAbuseParameters; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args: IReportAbuse__ArgsArgs); | ||
static read(input: thrift.TProtocol): ReportAbuse__Args; | ||
static write(args: IReportAbuse__ArgsArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface IGetUserProfile__Args { | ||
@@ -119,10 +85,10 @@ } | ||
export interface IRecommend__Result { | ||
success?: DiscussionResponse.DiscussionResponse; | ||
success?: DiscussionServiceResponse.DiscussionServiceResponse; | ||
} | ||
export interface IRecommend__ResultArgs { | ||
success?: DiscussionResponse.DiscussionResponseArgs; | ||
success?: DiscussionServiceResponse.DiscussionServiceResponseArgs; | ||
} | ||
export declare const Recommend__ResultCodec: thrift.IStructCodec<IRecommend__ResultArgs, IRecommend__Result>; | ||
export declare class Recommend__Result extends thrift.StructLike implements IRecommend__Result { | ||
success?: DiscussionResponse.DiscussionResponse; | ||
success?: DiscussionServiceResponse.DiscussionServiceResponse; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
@@ -136,10 +102,10 @@ readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
export interface IComment__Result { | ||
success?: DiscussionResponse.DiscussionResponse; | ||
success?: DiscussionServiceResponse.DiscussionServiceResponse; | ||
} | ||
export interface IComment__ResultArgs { | ||
success?: DiscussionResponse.DiscussionResponseArgs; | ||
success?: DiscussionServiceResponse.DiscussionServiceResponseArgs; | ||
} | ||
export declare const Comment__ResultCodec: thrift.IStructCodec<IComment__ResultArgs, IComment__Result>; | ||
export declare class Comment__Result extends thrift.StructLike implements IComment__Result { | ||
success?: DiscussionResponse.DiscussionResponse; | ||
success?: DiscussionServiceResponse.DiscussionServiceResponse; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
@@ -152,27 +118,11 @@ readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
} | ||
export interface IPreview__Result { | ||
success?: DiscussionResponse.DiscussionResponse; | ||
} | ||
export interface IPreview__ResultArgs { | ||
success?: DiscussionResponse.DiscussionResponseArgs; | ||
} | ||
export declare const Preview__ResultCodec: thrift.IStructCodec<IPreview__ResultArgs, IPreview__Result>; | ||
export declare class Preview__Result extends thrift.StructLike implements IPreview__Result { | ||
success?: DiscussionResponse.DiscussionResponse; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IPreview__ResultArgs); | ||
static read(input: thrift.TProtocol): Preview__Result; | ||
static write(args: IPreview__ResultArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface IReply__Result { | ||
success?: DiscussionResponse.DiscussionResponse; | ||
success?: DiscussionServiceResponse.DiscussionServiceResponse; | ||
} | ||
export interface IReply__ResultArgs { | ||
success?: DiscussionResponse.DiscussionResponseArgs; | ||
success?: DiscussionServiceResponse.DiscussionServiceResponseArgs; | ||
} | ||
export declare const Reply__ResultCodec: thrift.IStructCodec<IReply__ResultArgs, IReply__Result>; | ||
export declare class Reply__Result extends thrift.StructLike implements IReply__Result { | ||
success?: DiscussionResponse.DiscussionResponse; | ||
success?: DiscussionServiceResponse.DiscussionServiceResponse; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
@@ -185,27 +135,11 @@ readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
} | ||
export interface IReportAbuse__Result { | ||
success?: DiscussionResponse.DiscussionResponse; | ||
} | ||
export interface IReportAbuse__ResultArgs { | ||
success?: DiscussionResponse.DiscussionResponseArgs; | ||
} | ||
export declare const ReportAbuse__ResultCodec: thrift.IStructCodec<IReportAbuse__ResultArgs, IReportAbuse__Result>; | ||
export declare class ReportAbuse__Result extends thrift.StructLike implements IReportAbuse__Result { | ||
success?: DiscussionResponse.DiscussionResponse; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IReportAbuse__ResultArgs); | ||
static read(input: thrift.TProtocol): ReportAbuse__Result; | ||
static write(args: IReportAbuse__ResultArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface IGetUserProfile__Result { | ||
success?: GetUserProfileResponse.GetUserProfileResponse; | ||
success?: DiscussionServiceResponse.DiscussionServiceResponse; | ||
} | ||
export interface IGetUserProfile__ResultArgs { | ||
success?: GetUserProfileResponse.GetUserProfileResponseArgs; | ||
success?: DiscussionServiceResponse.DiscussionServiceResponseArgs; | ||
} | ||
export declare const GetUserProfile__ResultCodec: thrift.IStructCodec<IGetUserProfile__ResultArgs, IGetUserProfile__Result>; | ||
export declare class GetUserProfile__Result extends thrift.StructLike implements IGetUserProfile__Result { | ||
success?: GetUserProfileResponse.GetUserProfileResponse; | ||
success?: DiscussionServiceResponse.DiscussionServiceResponse; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
@@ -230,16 +164,12 @@ readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
}; | ||
recommend(commentId: string, context?: Context): Promise<DiscussionResponse.DiscussionResponse>; | ||
comment(shortUrl: string, body: string, context?: Context): Promise<DiscussionResponse.DiscussionResponse>; | ||
preview(body: string, context?: Context): Promise<DiscussionResponse.DiscussionResponse>; | ||
reply(shortUrl: string, body: string, parentCommentId: string, context?: Context): Promise<DiscussionResponse.DiscussionResponse>; | ||
reportAbuse(parameters: ReportAbuseParameters.IReportAbuseParametersArgs, context?: Context): Promise<DiscussionResponse.DiscussionResponse>; | ||
getUserProfile(context?: Context): Promise<GetUserProfileResponse.GetUserProfileResponse>; | ||
recommend(commentId: string, context?: Context): Promise<DiscussionServiceResponse.DiscussionServiceResponse>; | ||
comment(shortUrl: string, body: string, context?: Context): Promise<DiscussionServiceResponse.DiscussionServiceResponse>; | ||
reply(shortUrl: string, body: string, parentCommentId: string, context?: Context): Promise<DiscussionServiceResponse.DiscussionServiceResponse>; | ||
getUserProfile(context?: Context): Promise<DiscussionServiceResponse.DiscussionServiceResponse>; | ||
} | ||
export interface IHandler<Context = any> { | ||
recommend(commentId: string, context?: Context): DiscussionResponse.DiscussionResponseArgs | Promise<DiscussionResponse.DiscussionResponseArgs>; | ||
comment(shortUrl: string, body: string, context?: Context): DiscussionResponse.DiscussionResponseArgs | Promise<DiscussionResponse.DiscussionResponseArgs>; | ||
preview(body: string, context?: Context): DiscussionResponse.DiscussionResponseArgs | Promise<DiscussionResponse.DiscussionResponseArgs>; | ||
reply(shortUrl: string, body: string, parentCommentId: string, context?: Context): DiscussionResponse.DiscussionResponseArgs | Promise<DiscussionResponse.DiscussionResponseArgs>; | ||
reportAbuse(parameters: ReportAbuseParameters.IReportAbuseParameters, context?: Context): DiscussionResponse.DiscussionResponseArgs | Promise<DiscussionResponse.DiscussionResponseArgs>; | ||
getUserProfile(context?: Context): GetUserProfileResponse.GetUserProfileResponseArgs | Promise<GetUserProfileResponse.GetUserProfileResponseArgs>; | ||
recommend(commentId: string, context?: Context): DiscussionServiceResponse.DiscussionServiceResponseArgs | Promise<DiscussionServiceResponse.DiscussionServiceResponseArgs>; | ||
comment(shortUrl: string, body: string, context?: Context): DiscussionServiceResponse.DiscussionServiceResponseArgs | Promise<DiscussionServiceResponse.DiscussionServiceResponseArgs>; | ||
reply(shortUrl: string, body: string, parentCommentId: string, context?: Context): DiscussionServiceResponse.DiscussionServiceResponseArgs | Promise<DiscussionServiceResponse.DiscussionServiceResponseArgs>; | ||
getUserProfile(context?: Context): DiscussionServiceResponse.DiscussionServiceResponseArgs | Promise<DiscussionServiceResponse.DiscussionServiceResponseArgs>; | ||
} | ||
@@ -260,6 +190,4 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> { | ||
process_comment(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>; | ||
process_preview(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>; | ||
process_reply(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>; | ||
process_reportAbuse(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>; | ||
process_getUserProfile(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>; | ||
} |
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Processor = exports.Client = exports.GetUserProfile__Result = exports.GetUserProfile__ResultCodec = exports.ReportAbuse__Result = exports.ReportAbuse__ResultCodec = exports.Reply__Result = exports.Reply__ResultCodec = exports.Preview__Result = exports.Preview__ResultCodec = exports.Comment__Result = exports.Comment__ResultCodec = exports.Recommend__Result = exports.Recommend__ResultCodec = exports.GetUserProfile__Args = exports.GetUserProfile__ArgsCodec = exports.ReportAbuse__Args = exports.ReportAbuse__ArgsCodec = exports.Reply__Args = exports.Reply__ArgsCodec = exports.Preview__Args = exports.Preview__ArgsCodec = exports.Comment__Args = exports.Comment__ArgsCodec = exports.Recommend__Args = exports.Recommend__ArgsCodec = exports.methodParameters = exports.methodNames = exports.methodAnnotations = exports.annotations = exports.serviceName = void 0; | ||
exports.Processor = exports.Client = exports.GetUserProfile__Result = exports.GetUserProfile__ResultCodec = exports.Reply__Result = exports.Reply__ResultCodec = exports.Comment__Result = exports.Comment__ResultCodec = exports.Recommend__Result = exports.Recommend__ResultCodec = exports.GetUserProfile__Args = exports.GetUserProfile__ArgsCodec = exports.Reply__Args = exports.Reply__ArgsCodec = exports.Comment__Args = exports.Comment__ArgsCodec = exports.Recommend__Args = exports.Recommend__ArgsCodec = exports.methodParameters = exports.methodNames = exports.methodAnnotations = exports.annotations = exports.serviceName = void 0; | ||
/* tslint:disable */ | ||
@@ -35,5 +35,3 @@ /* eslint-disable */ | ||
const thrift = __importStar(require("@creditkarma/thrift-server-core")); | ||
const DiscussionResponse = __importStar(require("./DiscussionResponse")); | ||
const ReportAbuseParameters = __importStar(require("./ReportAbuseParameters")); | ||
const GetUserProfileResponse = __importStar(require("./GetUserProfileResponse")); | ||
const DiscussionServiceResponse = __importStar(require("./DiscussionServiceResponse")); | ||
exports.serviceName = "Discussion"; | ||
@@ -50,6 +48,2 @@ exports.annotations = {}; | ||
}, | ||
preview: { | ||
annotations: {}, | ||
fieldAnnotations: {} | ||
}, | ||
reply: { | ||
@@ -59,6 +53,2 @@ annotations: {}, | ||
}, | ||
reportAbuse: { | ||
annotations: {}, | ||
fieldAnnotations: {} | ||
}, | ||
getUserProfile: { | ||
@@ -69,9 +59,7 @@ annotations: {}, | ||
}; | ||
exports.methodNames = ["recommend", "comment", "preview", "reply", "reportAbuse", "getUserProfile"]; | ||
exports.methodNames = ["recommend", "comment", "reply", "getUserProfile"]; | ||
exports.methodParameters = { | ||
recommend: 2, | ||
comment: 3, | ||
preview: 2, | ||
reply: 4, | ||
reportAbuse: 2, | ||
getUserProfile: 1 | ||
@@ -263,81 +251,2 @@ }; | ||
exports.Comment__Args = Comment__Args; | ||
exports.Preview__ArgsCodec = { | ||
encode(args, output) { | ||
const obj = { | ||
body: args.body | ||
}; | ||
output.writeStructBegin("Preview__Args"); | ||
if (obj.body != null) { | ||
output.writeFieldBegin("body", thrift.TType.STRING, 1); | ||
output.writeString(obj.body); | ||
output.writeFieldEnd(); | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[body] is unset!"); | ||
} | ||
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 1: | ||
if (fieldType === thrift.TType.STRING) { | ||
const value_7 = input.readString(); | ||
_args.body = value_7; | ||
} | ||
else { | ||
input.skip(fieldType); | ||
} | ||
break; | ||
default: { | ||
input.skip(fieldType); | ||
} | ||
} | ||
input.readFieldEnd(); | ||
} | ||
input.readStructEnd(); | ||
if (_args.body !== undefined) { | ||
return { | ||
body: _args.body | ||
}; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read Preview__Args from input"); | ||
} | ||
} | ||
}; | ||
class Preview__Args extends thrift.StructLike { | ||
constructor(args) { | ||
super(); | ||
this._annotations = {}; | ||
this._fieldAnnotations = {}; | ||
if (args.body != null) { | ||
const value_8 = args.body; | ||
this.body = value_8; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[body] is unset!"); | ||
} | ||
} | ||
static read(input) { | ||
return new Preview__Args(exports.Preview__ArgsCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.Preview__ArgsCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.Preview__ArgsCodec.encode(this, output); | ||
} | ||
} | ||
exports.Preview__Args = Preview__Args; | ||
exports.Reply__ArgsCodec = { | ||
@@ -392,4 +301,4 @@ encode(args, output) { | ||
if (fieldType === thrift.TType.STRING) { | ||
const value_9 = input.readString(); | ||
_args.shortUrl = value_9; | ||
const value_7 = input.readString(); | ||
_args.shortUrl = value_7; | ||
} | ||
@@ -402,4 +311,4 @@ else { | ||
if (fieldType === thrift.TType.STRING) { | ||
const value_10 = input.readString(); | ||
_args.body = value_10; | ||
const value_8 = input.readString(); | ||
_args.body = value_8; | ||
} | ||
@@ -412,4 +321,4 @@ else { | ||
if (fieldType === thrift.TType.STRING) { | ||
const value_11 = input.readString(); | ||
_args.parentCommentId = value_11; | ||
const value_9 = input.readString(); | ||
_args.parentCommentId = value_9; | ||
} | ||
@@ -445,4 +354,4 @@ else { | ||
if (args.shortUrl != null) { | ||
const value_12 = args.shortUrl; | ||
this.shortUrl = value_12; | ||
const value_10 = args.shortUrl; | ||
this.shortUrl = value_10; | ||
} | ||
@@ -453,4 +362,4 @@ else { | ||
if (args.body != null) { | ||
const value_13 = args.body; | ||
this.body = value_13; | ||
const value_11 = args.body; | ||
this.body = value_11; | ||
} | ||
@@ -461,4 +370,4 @@ else { | ||
if (args.parentCommentId != null) { | ||
const value_14 = args.parentCommentId; | ||
this.parentCommentId = value_14; | ||
const value_12 = args.parentCommentId; | ||
this.parentCommentId = value_12; | ||
} | ||
@@ -480,81 +389,2 @@ else { | ||
exports.Reply__Args = Reply__Args; | ||
exports.ReportAbuse__ArgsCodec = { | ||
encode(args, output) { | ||
const obj = { | ||
parameters: args.parameters | ||
}; | ||
output.writeStructBegin("ReportAbuse__Args"); | ||
if (obj.parameters != null) { | ||
output.writeFieldBegin("parameters", thrift.TType.STRUCT, 1); | ||
ReportAbuseParameters.ReportAbuseParametersCodec.encode(obj.parameters, output); | ||
output.writeFieldEnd(); | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[parameters] is unset!"); | ||
} | ||
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 1: | ||
if (fieldType === thrift.TType.STRUCT) { | ||
const value_15 = ReportAbuseParameters.ReportAbuseParametersCodec.decode(input); | ||
_args.parameters = value_15; | ||
} | ||
else { | ||
input.skip(fieldType); | ||
} | ||
break; | ||
default: { | ||
input.skip(fieldType); | ||
} | ||
} | ||
input.readFieldEnd(); | ||
} | ||
input.readStructEnd(); | ||
if (_args.parameters !== undefined) { | ||
return { | ||
parameters: _args.parameters | ||
}; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read ReportAbuse__Args from input"); | ||
} | ||
} | ||
}; | ||
class ReportAbuse__Args extends thrift.StructLike { | ||
constructor(args) { | ||
super(); | ||
this._annotations = {}; | ||
this._fieldAnnotations = {}; | ||
if (args.parameters != null) { | ||
const value_16 = new ReportAbuseParameters.ReportAbuseParameters(args.parameters); | ||
this.parameters = value_16; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[parameters] is unset!"); | ||
} | ||
} | ||
static read(input) { | ||
return new ReportAbuse__Args(exports.ReportAbuse__ArgsCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.ReportAbuse__ArgsCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.ReportAbuse__ArgsCodec.encode(this, output); | ||
} | ||
} | ||
exports.ReportAbuse__Args = ReportAbuse__Args; | ||
exports.GetUserProfile__ArgsCodec = { | ||
@@ -612,3 +442,3 @@ encode(args, output) { | ||
output.writeFieldBegin("success", thrift.TType.STRUCT, 0); | ||
DiscussionResponse.DiscussionResponseCodec.encode(obj.success, output); | ||
DiscussionServiceResponse.DiscussionServiceResponseCodec.encode(obj.success, output); | ||
output.writeFieldEnd(); | ||
@@ -633,4 +463,4 @@ } | ||
if (fieldType === thrift.TType.STRUCT) { | ||
const value_17 = DiscussionResponse.DiscussionResponseCodec.decode(input); | ||
_args.success = value_17; | ||
const value_13 = DiscussionServiceResponse.DiscussionServiceResponseCodec.decode(input); | ||
_args.success = value_13; | ||
} | ||
@@ -659,4 +489,4 @@ else { | ||
if (args.success != null) { | ||
const value_18 = DiscussionResponse.DiscussionResponseCodec.create(args.success); | ||
this.success = value_18; | ||
const value_14 = DiscussionServiceResponse.DiscussionServiceResponseCodec.create(args.success); | ||
this.success = value_14; | ||
} | ||
@@ -683,3 +513,3 @@ } | ||
output.writeFieldBegin("success", thrift.TType.STRUCT, 0); | ||
DiscussionResponse.DiscussionResponseCodec.encode(obj.success, output); | ||
DiscussionServiceResponse.DiscussionServiceResponseCodec.encode(obj.success, output); | ||
output.writeFieldEnd(); | ||
@@ -704,4 +534,4 @@ } | ||
if (fieldType === thrift.TType.STRUCT) { | ||
const value_19 = DiscussionResponse.DiscussionResponseCodec.decode(input); | ||
_args.success = value_19; | ||
const value_15 = DiscussionServiceResponse.DiscussionServiceResponseCodec.decode(input); | ||
_args.success = value_15; | ||
} | ||
@@ -730,4 +560,4 @@ else { | ||
if (args.success != null) { | ||
const value_20 = DiscussionResponse.DiscussionResponseCodec.create(args.success); | ||
this.success = value_20; | ||
const value_16 = DiscussionServiceResponse.DiscussionServiceResponseCodec.create(args.success); | ||
this.success = value_16; | ||
} | ||
@@ -746,70 +576,2 @@ } | ||
exports.Comment__Result = Comment__Result; | ||
exports.Preview__ResultCodec = { | ||
encode(args, output) { | ||
const obj = { | ||
success: args.success | ||
}; | ||
output.writeStructBegin("Preview__Result"); | ||
if (obj.success != null) { | ||
output.writeFieldBegin("success", thrift.TType.STRUCT, 0); | ||
DiscussionResponse.DiscussionResponseCodec.encode(obj.success, output); | ||
output.writeFieldEnd(); | ||
} | ||
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.STRUCT) { | ||
const value_21 = DiscussionResponse.DiscussionResponseCodec.decode(input); | ||
_args.success = value_21; | ||
} | ||
else { | ||
input.skip(fieldType); | ||
} | ||
break; | ||
default: { | ||
input.skip(fieldType); | ||
} | ||
} | ||
input.readFieldEnd(); | ||
} | ||
input.readStructEnd(); | ||
return { | ||
success: _args.success | ||
}; | ||
} | ||
}; | ||
class Preview__Result extends thrift.StructLike { | ||
constructor(args = {}) { | ||
super(); | ||
this._annotations = {}; | ||
this._fieldAnnotations = {}; | ||
if (args.success != null) { | ||
const value_22 = DiscussionResponse.DiscussionResponseCodec.create(args.success); | ||
this.success = value_22; | ||
} | ||
} | ||
static read(input) { | ||
return new Preview__Result(exports.Preview__ResultCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.Preview__ResultCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.Preview__ResultCodec.encode(this, output); | ||
} | ||
} | ||
exports.Preview__Result = Preview__Result; | ||
exports.Reply__ResultCodec = { | ||
@@ -823,3 +585,3 @@ encode(args, output) { | ||
output.writeFieldBegin("success", thrift.TType.STRUCT, 0); | ||
DiscussionResponse.DiscussionResponseCodec.encode(obj.success, output); | ||
DiscussionServiceResponse.DiscussionServiceResponseCodec.encode(obj.success, output); | ||
output.writeFieldEnd(); | ||
@@ -844,4 +606,4 @@ } | ||
if (fieldType === thrift.TType.STRUCT) { | ||
const value_23 = DiscussionResponse.DiscussionResponseCodec.decode(input); | ||
_args.success = value_23; | ||
const value_17 = DiscussionServiceResponse.DiscussionServiceResponseCodec.decode(input); | ||
_args.success = value_17; | ||
} | ||
@@ -870,4 +632,4 @@ else { | ||
if (args.success != null) { | ||
const value_24 = DiscussionResponse.DiscussionResponseCodec.create(args.success); | ||
this.success = value_24; | ||
const value_18 = DiscussionServiceResponse.DiscussionServiceResponseCodec.create(args.success); | ||
this.success = value_18; | ||
} | ||
@@ -886,70 +648,2 @@ } | ||
exports.Reply__Result = Reply__Result; | ||
exports.ReportAbuse__ResultCodec = { | ||
encode(args, output) { | ||
const obj = { | ||
success: args.success | ||
}; | ||
output.writeStructBegin("ReportAbuse__Result"); | ||
if (obj.success != null) { | ||
output.writeFieldBegin("success", thrift.TType.STRUCT, 0); | ||
DiscussionResponse.DiscussionResponseCodec.encode(obj.success, output); | ||
output.writeFieldEnd(); | ||
} | ||
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.STRUCT) { | ||
const value_25 = DiscussionResponse.DiscussionResponseCodec.decode(input); | ||
_args.success = value_25; | ||
} | ||
else { | ||
input.skip(fieldType); | ||
} | ||
break; | ||
default: { | ||
input.skip(fieldType); | ||
} | ||
} | ||
input.readFieldEnd(); | ||
} | ||
input.readStructEnd(); | ||
return { | ||
success: _args.success | ||
}; | ||
} | ||
}; | ||
class ReportAbuse__Result extends thrift.StructLike { | ||
constructor(args = {}) { | ||
super(); | ||
this._annotations = {}; | ||
this._fieldAnnotations = {}; | ||
if (args.success != null) { | ||
const value_26 = DiscussionResponse.DiscussionResponseCodec.create(args.success); | ||
this.success = value_26; | ||
} | ||
} | ||
static read(input) { | ||
return new ReportAbuse__Result(exports.ReportAbuse__ResultCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.ReportAbuse__ResultCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.ReportAbuse__ResultCodec.encode(this, output); | ||
} | ||
} | ||
exports.ReportAbuse__Result = ReportAbuse__Result; | ||
exports.GetUserProfile__ResultCodec = { | ||
@@ -963,3 +657,3 @@ encode(args, output) { | ||
output.writeFieldBegin("success", thrift.TType.STRUCT, 0); | ||
GetUserProfileResponse.GetUserProfileResponseCodec.encode(obj.success, output); | ||
DiscussionServiceResponse.DiscussionServiceResponseCodec.encode(obj.success, output); | ||
output.writeFieldEnd(); | ||
@@ -984,4 +678,4 @@ } | ||
if (fieldType === thrift.TType.STRUCT) { | ||
const value_27 = GetUserProfileResponse.GetUserProfileResponseCodec.decode(input); | ||
_args.success = value_27; | ||
const value_19 = DiscussionServiceResponse.DiscussionServiceResponseCodec.decode(input); | ||
_args.success = value_19; | ||
} | ||
@@ -1010,4 +704,4 @@ else { | ||
if (args.success != null) { | ||
const value_28 = GetUserProfileResponse.GetUserProfileResponseCodec.create(args.success); | ||
this.success = value_28; | ||
const value_20 = DiscussionServiceResponse.DiscussionServiceResponseCodec.create(args.success); | ||
this.success = value_20; | ||
} | ||
@@ -1111,40 +805,2 @@ } | ||
} | ||
preview(body, context) { | ||
const writer = new this.transport(); | ||
const output = new this.protocol(writer); | ||
output.writeMessageBegin("preview", thrift.MessageType.CALL, this.incrementRequestId()); | ||
const args = { body }; | ||
exports.Preview__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 === "preview") { | ||
if (messageType === thrift.MessageType.EXCEPTION) { | ||
const err = thrift.TApplicationExceptionCodec.decode(input); | ||
input.readMessageEnd(); | ||
return Promise.reject(err); | ||
} | ||
else { | ||
const result = exports.Preview__ResultCodec.decode(input); | ||
input.readMessageEnd(); | ||
if (result.success != null) { | ||
return Promise.resolve(result.success); | ||
} | ||
else { | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "preview failed: unknown result")); | ||
} | ||
} | ||
} | ||
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); | ||
} | ||
}); | ||
} | ||
reply(shortUrl, body, parentCommentId, context) { | ||
@@ -1188,40 +844,2 @@ const writer = new this.transport(); | ||
} | ||
reportAbuse(parameters, context) { | ||
const writer = new this.transport(); | ||
const output = new this.protocol(writer); | ||
output.writeMessageBegin("reportAbuse", thrift.MessageType.CALL, this.incrementRequestId()); | ||
const args = { parameters }; | ||
exports.ReportAbuse__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 === "reportAbuse") { | ||
if (messageType === thrift.MessageType.EXCEPTION) { | ||
const err = thrift.TApplicationExceptionCodec.decode(input); | ||
input.readMessageEnd(); | ||
return Promise.reject(err); | ||
} | ||
else { | ||
const result = exports.ReportAbuse__ResultCodec.decode(input); | ||
input.readMessageEnd(); | ||
if (result.success != null) { | ||
return Promise.resolve(result.success); | ||
} | ||
else { | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "reportAbuse failed: unknown result")); | ||
} | ||
} | ||
} | ||
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); | ||
} | ||
}); | ||
} | ||
getUserProfile(context) { | ||
@@ -1295,6 +913,2 @@ const writer = new this.transport(); | ||
} | ||
case "process_preview": { | ||
resolve(this.process_preview(requestId, input, output, context)); | ||
break; | ||
} | ||
case "process_reply": { | ||
@@ -1304,6 +918,2 @@ resolve(this.process_reply(requestId, input, output, context)); | ||
} | ||
case "process_reportAbuse": { | ||
resolve(this.process_reportAbuse(requestId, input, output, context)); | ||
break; | ||
} | ||
case "process_getUserProfile": { | ||
@@ -1375,26 +985,2 @@ resolve(this.process_getUserProfile(requestId, input, output, context)); | ||
} | ||
process_preview(requestId, input, output, context) { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
const args = exports.Preview__ArgsCodec.decode(input); | ||
input.readMessageEnd(); | ||
resolve(this._handler.preview(args.body, context)); | ||
} | ||
catch (err) { | ||
reject(err); | ||
} | ||
}).then((data) => { | ||
const result = { success: data }; | ||
output.writeMessageBegin("preview", thrift.MessageType.REPLY, requestId); | ||
exports.Preview__ResultCodec.encode(result, output); | ||
output.writeMessageEnd(); | ||
return output.flush(); | ||
}).catch((err) => { | ||
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message); | ||
output.writeMessageBegin("preview", thrift.MessageType.EXCEPTION, requestId); | ||
thrift.TApplicationExceptionCodec.encode(result, output); | ||
output.writeMessageEnd(); | ||
return output.flush(); | ||
}); | ||
} | ||
process_reply(requestId, input, output, context) { | ||
@@ -1424,26 +1010,2 @@ return new Promise((resolve, reject) => { | ||
} | ||
process_reportAbuse(requestId, input, output, context) { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
const args = exports.ReportAbuse__ArgsCodec.decode(input); | ||
input.readMessageEnd(); | ||
resolve(this._handler.reportAbuse(args.parameters, context)); | ||
} | ||
catch (err) { | ||
reject(err); | ||
} | ||
}).then((data) => { | ||
const result = { success: data }; | ||
output.writeMessageBegin("reportAbuse", thrift.MessageType.REPLY, requestId); | ||
exports.ReportAbuse__ResultCodec.encode(result, output); | ||
output.writeMessageEnd(); | ||
return output.flush(); | ||
}).catch((err) => { | ||
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message); | ||
output.writeMessageBegin("reportAbuse", thrift.MessageType.EXCEPTION, requestId); | ||
thrift.TApplicationExceptionCodec.encode(result, output); | ||
output.writeMessageEnd(); | ||
return output.flush(); | ||
}); | ||
} | ||
process_getUserProfile(requestId, input, output, context) { | ||
@@ -1450,0 +1012,0 @@ return new Promise((resolve, reject) => { |
@@ -14,9 +14,4 @@ export * from "./PurchaseScreenReason"; | ||
export * from "./MetricFont"; | ||
export * from "./DiscussionBadge"; | ||
export * from "./DiscussionUserProfile"; | ||
export * from "./DiscussionApiResponse"; | ||
export * from "./ReportAbuseParameters"; | ||
export * from "./Metric"; | ||
export * from "./GetUserProfileResponse"; | ||
export * from "./DiscussionResponse"; | ||
export * from "./DiscussionServiceResponse"; | ||
import * as Environment from "./Environment"; | ||
@@ -23,0 +18,0 @@ export { Environment as Environment }; |
@@ -49,9 +49,4 @@ "use strict"; | ||
__exportStar(require("./MetricFont"), exports); | ||
__exportStar(require("./DiscussionBadge"), exports); | ||
__exportStar(require("./DiscussionUserProfile"), exports); | ||
__exportStar(require("./DiscussionApiResponse"), exports); | ||
__exportStar(require("./ReportAbuseParameters"), exports); | ||
__exportStar(require("./Metric"), exports); | ||
__exportStar(require("./GetUserProfileResponse"), exports); | ||
__exportStar(require("./DiscussionResponse"), exports); | ||
__exportStar(require("./DiscussionServiceResponse"), exports); | ||
const Environment = __importStar(require("./Environment")); | ||
@@ -58,0 +53,0 @@ exports.Environment = Environment; |
{ | ||
"name": "@guardian/bridget", | ||
"version": "0.0.0-2024-04-11-snapshot-2", | ||
"version": "0.0.0-2024-04-16-snapshot-1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
475199
60
11747