@guardian/bridget
Advanced tools
Comparing version 0.0.0-2024-04-10-snapshot-2 to 0.0.0-2024-04-11-snapshot
import * as thrift from "@creditkarma/thrift-server-core"; | ||
import * as AddUsernameError from "./AddUsernameError"; | ||
export interface IAddUsernameApiResponse { | ||
status?: string; | ||
status: string; | ||
errors?: Array<AddUsernameError.IAddUsernameError>; | ||
} | ||
export interface IAddUsernameApiResponseArgs { | ||
status?: string; | ||
status: string; | ||
errors?: Array<AddUsernameError.IAddUsernameErrorArgs>; | ||
@@ -13,7 +13,7 @@ } | ||
export declare class AddUsernameApiResponse extends thrift.StructLike implements IAddUsernameApiResponse { | ||
status?: string; | ||
status: string; | ||
errors?: Array<AddUsernameError.IAddUsernameError>; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IAddUsernameApiResponseArgs); | ||
constructor(args: IAddUsernameApiResponseArgs); | ||
static read(input: thrift.TProtocol): AddUsernameApiResponse; | ||
@@ -20,0 +20,0 @@ static write(args: IAddUsernameApiResponseArgs, output: thrift.TProtocol): void; |
@@ -47,2 +47,5 @@ "use strict"; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[status] is unset!"); | ||
} | ||
if (obj.errors != null) { | ||
@@ -104,10 +107,15 @@ output.writeFieldBegin("errors", thrift.TType.LIST, 2); | ||
input.readStructEnd(); | ||
return { | ||
status: _args.status, | ||
errors: _args.errors | ||
}; | ||
if (_args.status !== undefined) { | ||
return { | ||
status: _args.status, | ||
errors: _args.errors | ||
}; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read AddUsernameApiResponse from input"); | ||
} | ||
} | ||
}; | ||
class AddUsernameApiResponse extends thrift.StructLike { | ||
constructor(args = {}) { | ||
constructor(args) { | ||
super(); | ||
@@ -120,2 +128,5 @@ this._annotations = {}; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[status] is unset!"); | ||
} | ||
if (args.errors != null) { | ||
@@ -122,0 +133,0 @@ const value_6 = new Array(); |
import * as thrift from "@creditkarma/thrift-server-core"; | ||
export interface IAddUsernameError { | ||
message?: string; | ||
message: string; | ||
} | ||
export interface IAddUsernameErrorArgs { | ||
message?: string; | ||
message: string; | ||
} | ||
export declare const AddUsernameErrorCodec: thrift.IStructCodec<IAddUsernameErrorArgs, IAddUsernameError>; | ||
export declare class AddUsernameError extends thrift.StructLike implements IAddUsernameError { | ||
message?: string; | ||
message: string; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IAddUsernameErrorArgs); | ||
constructor(args: IAddUsernameErrorArgs); | ||
static read(input: thrift.TProtocol): AddUsernameError; | ||
@@ -15,0 +15,0 @@ static write(args: IAddUsernameErrorArgs, output: thrift.TProtocol): void; |
@@ -45,2 +45,5 @@ "use strict"; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[message] is unset!"); | ||
} | ||
output.writeFieldStop(); | ||
@@ -77,9 +80,14 @@ output.writeStructEnd(); | ||
input.readStructEnd(); | ||
return { | ||
message: _args.message | ||
}; | ||
if (_args.message !== undefined) { | ||
return { | ||
message: _args.message | ||
}; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read AddUsernameError from input"); | ||
} | ||
} | ||
}; | ||
class AddUsernameError extends thrift.StructLike { | ||
constructor(args = {}) { | ||
constructor(args) { | ||
super(); | ||
@@ -92,2 +100,5 @@ this._annotations = {}; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[message] is unset!"); | ||
} | ||
} | ||
@@ -94,0 +105,0 @@ static read(input) { |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import * as thrift from "@creditkarma/thrift-server-core"; | ||
import * as AddUsernameResponse from "./AddUsernameResponse"; | ||
import * as DiscussionResponse from "./DiscussionResponse"; | ||
import * as ReportAbuseParameters from "./ReportAbuseParameters"; | ||
import * as GetUserProfileResponse from "./GetUserProfileResponse"; | ||
import * as AddUsernameResponse from "./AddUsernameResponse"; | ||
import * as ReportAbuseParameters from "./ReportAbuseParameters"; | ||
export declare const serviceName: string; | ||
@@ -15,2 +15,18 @@ export declare const annotations: thrift.IThriftAnnotations; | ||
}; | ||
export interface IAddUsername__Args { | ||
username: string; | ||
} | ||
export interface IAddUsername__ArgsArgs { | ||
username: string; | ||
} | ||
export declare const AddUsername__ArgsCodec: thrift.IStructCodec<IAddUsername__ArgsArgs, IAddUsername__Args>; | ||
export declare class AddUsername__Args extends thrift.StructLike implements IAddUsername__Args { | ||
username: string; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args: IAddUsername__ArgsArgs); | ||
static read(input: thrift.TProtocol): AddUsername__Args; | ||
static write(args: IAddUsername__ArgsArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface IRecommend__Args { | ||
@@ -32,15 +48,2 @@ commentId: string; | ||
} | ||
export interface IGetUserProfile__Args { | ||
} | ||
export interface IGetUserProfile__ArgsArgs { | ||
} | ||
export declare const GetUserProfile__ArgsCodec: thrift.IStructCodec<IGetUserProfile__ArgsArgs, IGetUserProfile__Args>; | ||
export declare class GetUserProfile__Args extends thrift.StructLike implements IGetUserProfile__Args { | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IGetUserProfile__ArgsArgs); | ||
static read(input: thrift.TProtocol): GetUserProfile__Args; | ||
static write(args: IGetUserProfile__ArgsArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface IComment__Args { | ||
@@ -103,18 +106,2 @@ shortUrl: string; | ||
} | ||
export interface IAddUsername__Args { | ||
username: string; | ||
} | ||
export interface IAddUsername__ArgsArgs { | ||
username: string; | ||
} | ||
export declare const AddUsername__ArgsCodec: thrift.IStructCodec<IAddUsername__ArgsArgs, IAddUsername__Args>; | ||
export declare class AddUsername__Args extends thrift.StructLike implements IAddUsername__Args { | ||
username: string; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args: IAddUsername__ArgsArgs); | ||
static read(input: thrift.TProtocol): AddUsername__Args; | ||
static write(args: IAddUsername__ArgsArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface IReportAbuse__Args { | ||
@@ -136,2 +123,31 @@ parameters: ReportAbuseParameters.IReportAbuseParameters; | ||
} | ||
export interface IGetUserProfile__Args { | ||
} | ||
export interface IGetUserProfile__ArgsArgs { | ||
} | ||
export declare const GetUserProfile__ArgsCodec: thrift.IStructCodec<IGetUserProfile__ArgsArgs, IGetUserProfile__Args>; | ||
export declare class GetUserProfile__Args extends thrift.StructLike implements IGetUserProfile__Args { | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IGetUserProfile__ArgsArgs); | ||
static read(input: thrift.TProtocol): GetUserProfile__Args; | ||
static write(args: IGetUserProfile__ArgsArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface IAddUsername__Result { | ||
success?: AddUsernameResponse.AddUsernameResponse; | ||
} | ||
export interface IAddUsername__ResultArgs { | ||
success?: AddUsernameResponse.AddUsernameResponseArgs; | ||
} | ||
export declare const AddUsername__ResultCodec: thrift.IStructCodec<IAddUsername__ResultArgs, IAddUsername__Result>; | ||
export declare class AddUsername__Result extends thrift.StructLike implements IAddUsername__Result { | ||
success?: AddUsernameResponse.AddUsernameResponse; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IAddUsername__ResultArgs); | ||
static read(input: thrift.TProtocol): AddUsername__Result; | ||
static write(args: IAddUsername__ResultArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface IRecommend__Result { | ||
@@ -153,18 +169,2 @@ success?: DiscussionResponse.DiscussionResponse; | ||
} | ||
export interface IGetUserProfile__Result { | ||
success?: GetUserProfileResponse.GetUserProfileResponse; | ||
} | ||
export interface IGetUserProfile__ResultArgs { | ||
success?: GetUserProfileResponse.GetUserProfileResponseArgs; | ||
} | ||
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; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IGetUserProfile__ResultArgs); | ||
static read(input: thrift.TProtocol): GetUserProfile__Result; | ||
static write(args: IGetUserProfile__ResultArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface IComment__Result { | ||
@@ -218,18 +218,2 @@ success?: DiscussionResponse.DiscussionResponse; | ||
} | ||
export interface IAddUsername__Result { | ||
success?: AddUsernameResponse.AddUsernameResponse; | ||
} | ||
export interface IAddUsername__ResultArgs { | ||
success?: AddUsernameResponse.AddUsernameResponseArgs; | ||
} | ||
export declare const AddUsername__ResultCodec: thrift.IStructCodec<IAddUsername__ResultArgs, IAddUsername__Result>; | ||
export declare class AddUsername__Result extends thrift.StructLike implements IAddUsername__Result { | ||
success?: AddUsernameResponse.AddUsernameResponse; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IAddUsername__ResultArgs); | ||
static read(input: thrift.TProtocol): AddUsername__Result; | ||
static write(args: IAddUsername__ResultArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface IReportAbuse__Result { | ||
@@ -251,2 +235,18 @@ success?: DiscussionResponse.DiscussionResponse; | ||
} | ||
export interface IGetUserProfile__Result { | ||
success?: GetUserProfileResponse.GetUserProfileResponse; | ||
} | ||
export interface IGetUserProfile__ResultArgs { | ||
success?: GetUserProfileResponse.GetUserProfileResponseArgs; | ||
} | ||
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; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IGetUserProfile__ResultArgs); | ||
static read(input: thrift.TProtocol): GetUserProfile__Result; | ||
static write(args: IGetUserProfile__ResultArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export declare class Client<Context = any> extends thrift.ThriftClient<Context> { | ||
@@ -264,18 +264,18 @@ static readonly serviceName: string; | ||
}; | ||
addUsername(username: string, context?: Context): Promise<AddUsernameResponse.AddUsernameResponse>; | ||
recommend(commentId: string, context?: Context): Promise<DiscussionResponse.DiscussionResponse>; | ||
getUserProfile(context?: Context): Promise<GetUserProfileResponse.GetUserProfileResponse>; | ||
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>; | ||
addUsername(username: string, context?: Context): Promise<AddUsernameResponse.AddUsernameResponse>; | ||
reportAbuse(parameters: ReportAbuseParameters.IReportAbuseParametersArgs, context?: Context): Promise<DiscussionResponse.DiscussionResponse>; | ||
getUserProfile(context?: Context): Promise<GetUserProfileResponse.GetUserProfileResponse>; | ||
} | ||
export interface IHandler<Context = any> { | ||
addUsername(username: string, context?: Context): AddUsernameResponse.AddUsernameResponseArgs | Promise<AddUsernameResponse.AddUsernameResponseArgs>; | ||
recommend(commentId: string, context?: Context): DiscussionResponse.DiscussionResponseArgs | Promise<DiscussionResponse.DiscussionResponseArgs>; | ||
getUserProfile(context?: Context): GetUserProfileResponse.GetUserProfileResponseArgs | Promise<GetUserProfileResponse.GetUserProfileResponseArgs>; | ||
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>; | ||
addUsername(username: string, context?: Context): AddUsernameResponse.AddUsernameResponseArgs | Promise<AddUsernameResponse.AddUsernameResponseArgs>; | ||
reportAbuse(parameters: ReportAbuseParameters.IReportAbuseParameters, context?: Context): DiscussionResponse.DiscussionResponseArgs | Promise<DiscussionResponse.DiscussionResponseArgs>; | ||
getUserProfile(context?: Context): GetUserProfileResponse.GetUserProfileResponseArgs | Promise<GetUserProfileResponse.GetUserProfileResponseArgs>; | ||
} | ||
@@ -294,9 +294,9 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> { | ||
process(input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>; | ||
process_addUsername(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>; | ||
process_recommend(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>; | ||
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_addUsername(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.ReportAbuse__Result = exports.ReportAbuse__ResultCodec = exports.AddUsername__Result = exports.AddUsername__ResultCodec = exports.Reply__Result = exports.Reply__ResultCodec = exports.Preview__Result = exports.Preview__ResultCodec = exports.Comment__Result = exports.Comment__ResultCodec = exports.GetUserProfile__Result = exports.GetUserProfile__ResultCodec = exports.Recommend__Result = exports.Recommend__ResultCodec = exports.ReportAbuse__Args = exports.ReportAbuse__ArgsCodec = exports.AddUsername__Args = exports.AddUsername__ArgsCodec = exports.Reply__Args = exports.Reply__ArgsCodec = exports.Preview__Args = exports.Preview__ArgsCodec = exports.Comment__Args = exports.Comment__ArgsCodec = exports.GetUserProfile__Args = exports.GetUserProfile__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.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.AddUsername__Result = exports.AddUsername__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.AddUsername__Args = exports.AddUsername__ArgsCodec = exports.methodParameters = exports.methodNames = exports.methodAnnotations = exports.annotations = exports.serviceName = void 0; | ||
/* tslint:disable */ | ||
@@ -35,14 +35,14 @@ /* eslint-disable */ | ||
const thrift = __importStar(require("@creditkarma/thrift-server-core")); | ||
const AddUsernameResponse = __importStar(require("./AddUsernameResponse")); | ||
const DiscussionResponse = __importStar(require("./DiscussionResponse")); | ||
const ReportAbuseParameters = __importStar(require("./ReportAbuseParameters")); | ||
const GetUserProfileResponse = __importStar(require("./GetUserProfileResponse")); | ||
const AddUsernameResponse = __importStar(require("./AddUsernameResponse")); | ||
const ReportAbuseParameters = __importStar(require("./ReportAbuseParameters")); | ||
exports.serviceName = "Discussion"; | ||
exports.annotations = {}; | ||
exports.methodAnnotations = { | ||
recommend: { | ||
addUsername: { | ||
annotations: {}, | ||
fieldAnnotations: {} | ||
}, | ||
getUserProfile: { | ||
recommend: { | ||
annotations: {}, | ||
@@ -63,7 +63,7 @@ fieldAnnotations: {} | ||
}, | ||
addUsername: { | ||
reportAbuse: { | ||
annotations: {}, | ||
fieldAnnotations: {} | ||
}, | ||
reportAbuse: { | ||
getUserProfile: { | ||
annotations: {}, | ||
@@ -73,25 +73,25 @@ fieldAnnotations: {} | ||
}; | ||
exports.methodNames = ["recommend", "getUserProfile", "comment", "preview", "reply", "addUsername", "reportAbuse"]; | ||
exports.methodNames = ["addUsername", "recommend", "comment", "preview", "reply", "reportAbuse", "getUserProfile"]; | ||
exports.methodParameters = { | ||
addUsername: 2, | ||
recommend: 2, | ||
getUserProfile: 1, | ||
comment: 3, | ||
preview: 2, | ||
reply: 4, | ||
addUsername: 2, | ||
reportAbuse: 2 | ||
reportAbuse: 2, | ||
getUserProfile: 1 | ||
}; | ||
exports.Recommend__ArgsCodec = { | ||
exports.AddUsername__ArgsCodec = { | ||
encode(args, output) { | ||
const obj = { | ||
commentId: args.commentId | ||
username: args.username | ||
}; | ||
output.writeStructBegin("Recommend__Args"); | ||
if (obj.commentId != null) { | ||
output.writeFieldBegin("commentId", thrift.TType.STRING, 1); | ||
output.writeString(obj.commentId); | ||
output.writeStructBegin("AddUsername__Args"); | ||
if (obj.username != null) { | ||
output.writeFieldBegin("username", thrift.TType.STRING, 1); | ||
output.writeString(obj.username); | ||
output.writeFieldEnd(); | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[commentId] is unset!"); | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[username] is unset!"); | ||
} | ||
@@ -116,3 +116,3 @@ output.writeFieldStop(); | ||
const value_1 = input.readString(); | ||
_args.commentId = value_1; | ||
_args.username = value_1; | ||
} | ||
@@ -130,13 +130,13 @@ else { | ||
input.readStructEnd(); | ||
if (_args.commentId !== undefined) { | ||
if (_args.username !== undefined) { | ||
return { | ||
commentId: _args.commentId | ||
username: _args.username | ||
}; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read Recommend__Args from input"); | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read AddUsername__Args from input"); | ||
} | ||
} | ||
}; | ||
class Recommend__Args extends thrift.StructLike { | ||
class AddUsername__Args extends thrift.StructLike { | ||
constructor(args) { | ||
@@ -146,24 +146,35 @@ super(); | ||
this._fieldAnnotations = {}; | ||
if (args.commentId != null) { | ||
const value_2 = args.commentId; | ||
this.commentId = value_2; | ||
if (args.username != null) { | ||
const value_2 = args.username; | ||
this.username = value_2; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[commentId] is unset!"); | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[username] is unset!"); | ||
} | ||
} | ||
static read(input) { | ||
return new Recommend__Args(exports.Recommend__ArgsCodec.decode(input)); | ||
return new AddUsername__Args(exports.AddUsername__ArgsCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.Recommend__ArgsCodec.encode(args, output); | ||
return exports.AddUsername__ArgsCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.Recommend__ArgsCodec.encode(this, output); | ||
return exports.AddUsername__ArgsCodec.encode(this, output); | ||
} | ||
} | ||
exports.Recommend__Args = Recommend__Args; | ||
exports.GetUserProfile__ArgsCodec = { | ||
exports.AddUsername__Args = AddUsername__Args; | ||
exports.Recommend__ArgsCodec = { | ||
encode(args, output) { | ||
output.writeStructBegin("GetUserProfile__Args"); | ||
const obj = { | ||
commentId: args.commentId | ||
}; | ||
output.writeStructBegin("Recommend__Args"); | ||
if (obj.commentId != null) { | ||
output.writeFieldBegin("commentId", thrift.TType.STRING, 1); | ||
output.writeString(obj.commentId); | ||
output.writeFieldEnd(); | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[commentId] is unset!"); | ||
} | ||
output.writeFieldStop(); | ||
@@ -174,2 +185,3 @@ output.writeStructEnd(); | ||
decode(input) { | ||
let _args = {}; | ||
input.readStructBegin(); | ||
@@ -184,2 +196,11 @@ while (true) { | ||
switch (fieldId) { | ||
case 1: | ||
if (fieldType === thrift.TType.STRING) { | ||
const value_3 = input.readString(); | ||
_args.commentId = value_3; | ||
} | ||
else { | ||
input.skip(fieldType); | ||
} | ||
break; | ||
default: { | ||
@@ -192,22 +213,36 @@ input.skip(fieldType); | ||
input.readStructEnd(); | ||
return {}; | ||
if (_args.commentId !== undefined) { | ||
return { | ||
commentId: _args.commentId | ||
}; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read Recommend__Args from input"); | ||
} | ||
} | ||
}; | ||
class GetUserProfile__Args extends thrift.StructLike { | ||
constructor(args = {}) { | ||
class Recommend__Args extends thrift.StructLike { | ||
constructor(args) { | ||
super(); | ||
this._annotations = {}; | ||
this._fieldAnnotations = {}; | ||
if (args.commentId != null) { | ||
const value_4 = args.commentId; | ||
this.commentId = value_4; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[commentId] is unset!"); | ||
} | ||
} | ||
static read(input) { | ||
return new GetUserProfile__Args(exports.GetUserProfile__ArgsCodec.decode(input)); | ||
return new Recommend__Args(exports.Recommend__ArgsCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.GetUserProfile__ArgsCodec.encode(args, output); | ||
return exports.Recommend__ArgsCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.GetUserProfile__ArgsCodec.encode(this, output); | ||
return exports.Recommend__ArgsCodec.encode(this, output); | ||
} | ||
} | ||
exports.GetUserProfile__Args = GetUserProfile__Args; | ||
exports.Recommend__Args = Recommend__Args; | ||
exports.Comment__ArgsCodec = { | ||
@@ -253,4 +288,4 @@ encode(args, output) { | ||
if (fieldType === thrift.TType.STRING) { | ||
const value_3 = input.readString(); | ||
_args.shortUrl = value_3; | ||
const value_5 = input.readString(); | ||
_args.shortUrl = value_5; | ||
} | ||
@@ -263,4 +298,4 @@ else { | ||
if (fieldType === thrift.TType.STRING) { | ||
const value_4 = input.readString(); | ||
_args.body = value_4; | ||
const value_6 = input.readString(); | ||
_args.body = value_6; | ||
} | ||
@@ -295,4 +330,4 @@ else { | ||
if (args.shortUrl != null) { | ||
const value_5 = args.shortUrl; | ||
this.shortUrl = value_5; | ||
const value_7 = args.shortUrl; | ||
this.shortUrl = value_7; | ||
} | ||
@@ -303,4 +338,4 @@ else { | ||
if (args.body != null) { | ||
const value_6 = args.body; | ||
this.body = value_6; | ||
const value_8 = args.body; | ||
this.body = value_8; | ||
} | ||
@@ -353,4 +388,4 @@ else { | ||
if (fieldType === thrift.TType.STRING) { | ||
const value_7 = input.readString(); | ||
_args.body = value_7; | ||
const value_9 = input.readString(); | ||
_args.body = value_9; | ||
} | ||
@@ -384,4 +419,4 @@ else { | ||
if (args.body != null) { | ||
const value_8 = args.body; | ||
this.body = value_8; | ||
const value_10 = args.body; | ||
this.body = value_10; | ||
} | ||
@@ -452,4 +487,4 @@ else { | ||
if (fieldType === thrift.TType.STRING) { | ||
const value_9 = input.readString(); | ||
_args.shortUrl = value_9; | ||
const value_11 = input.readString(); | ||
_args.shortUrl = value_11; | ||
} | ||
@@ -462,4 +497,4 @@ else { | ||
if (fieldType === thrift.TType.STRING) { | ||
const value_10 = input.readString(); | ||
_args.body = value_10; | ||
const value_12 = input.readString(); | ||
_args.body = value_12; | ||
} | ||
@@ -472,4 +507,4 @@ else { | ||
if (fieldType === thrift.TType.STRING) { | ||
const value_11 = input.readString(); | ||
_args.parentCommentId = value_11; | ||
const value_13 = input.readString(); | ||
_args.parentCommentId = value_13; | ||
} | ||
@@ -505,4 +540,4 @@ else { | ||
if (args.shortUrl != null) { | ||
const value_12 = args.shortUrl; | ||
this.shortUrl = value_12; | ||
const value_14 = args.shortUrl; | ||
this.shortUrl = value_14; | ||
} | ||
@@ -513,4 +548,4 @@ else { | ||
if (args.body != null) { | ||
const value_13 = args.body; | ||
this.body = value_13; | ||
const value_15 = args.body; | ||
this.body = value_15; | ||
} | ||
@@ -521,4 +556,4 @@ else { | ||
if (args.parentCommentId != null) { | ||
const value_14 = args.parentCommentId; | ||
this.parentCommentId = value_14; | ||
const value_16 = args.parentCommentId; | ||
this.parentCommentId = value_16; | ||
} | ||
@@ -540,15 +575,15 @@ else { | ||
exports.Reply__Args = Reply__Args; | ||
exports.AddUsername__ArgsCodec = { | ||
exports.ReportAbuse__ArgsCodec = { | ||
encode(args, output) { | ||
const obj = { | ||
username: args.username | ||
parameters: args.parameters | ||
}; | ||
output.writeStructBegin("AddUsername__Args"); | ||
if (obj.username != null) { | ||
output.writeFieldBegin("username", thrift.TType.STRING, 1); | ||
output.writeString(obj.username); | ||
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[username] is unset!"); | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[parameters] is unset!"); | ||
} | ||
@@ -571,5 +606,5 @@ output.writeFieldStop(); | ||
case 1: | ||
if (fieldType === thrift.TType.STRING) { | ||
const value_15 = input.readString(); | ||
_args.username = value_15; | ||
if (fieldType === thrift.TType.STRUCT) { | ||
const value_17 = ReportAbuseParameters.ReportAbuseParametersCodec.decode(input); | ||
_args.parameters = value_17; | ||
} | ||
@@ -587,13 +622,13 @@ else { | ||
input.readStructEnd(); | ||
if (_args.username !== undefined) { | ||
if (_args.parameters !== undefined) { | ||
return { | ||
username: _args.username | ||
parameters: _args.parameters | ||
}; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read AddUsername__Args from input"); | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read ReportAbuse__Args from input"); | ||
} | ||
} | ||
}; | ||
class AddUsername__Args extends thrift.StructLike { | ||
class ReportAbuse__Args extends thrift.StructLike { | ||
constructor(args) { | ||
@@ -603,35 +638,24 @@ super(); | ||
this._fieldAnnotations = {}; | ||
if (args.username != null) { | ||
const value_16 = args.username; | ||
this.username = value_16; | ||
if (args.parameters != null) { | ||
const value_18 = new ReportAbuseParameters.ReportAbuseParameters(args.parameters); | ||
this.parameters = value_18; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[username] is unset!"); | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[parameters] is unset!"); | ||
} | ||
} | ||
static read(input) { | ||
return new AddUsername__Args(exports.AddUsername__ArgsCodec.decode(input)); | ||
return new ReportAbuse__Args(exports.ReportAbuse__ArgsCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.AddUsername__ArgsCodec.encode(args, output); | ||
return exports.ReportAbuse__ArgsCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.AddUsername__ArgsCodec.encode(this, output); | ||
return exports.ReportAbuse__ArgsCodec.encode(this, output); | ||
} | ||
} | ||
exports.AddUsername__Args = AddUsername__Args; | ||
exports.ReportAbuse__ArgsCodec = { | ||
exports.ReportAbuse__Args = ReportAbuse__Args; | ||
exports.GetUserProfile__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.writeStructBegin("GetUserProfile__Args"); | ||
output.writeFieldStop(); | ||
@@ -642,3 +666,2 @@ output.writeStructEnd(); | ||
decode(input) { | ||
let _args = {}; | ||
input.readStructBegin(); | ||
@@ -653,11 +676,2 @@ while (true) { | ||
switch (fieldId) { | ||
case 1: | ||
if (fieldType === thrift.TType.STRUCT) { | ||
const value_17 = ReportAbuseParameters.ReportAbuseParametersCodec.decode(input); | ||
_args.parameters = value_17; | ||
} | ||
else { | ||
input.skip(fieldType); | ||
} | ||
break; | ||
default: { | ||
@@ -670,37 +684,23 @@ input.skip(fieldType); | ||
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"); | ||
} | ||
return {}; | ||
} | ||
}; | ||
class ReportAbuse__Args extends thrift.StructLike { | ||
constructor(args) { | ||
class GetUserProfile__Args extends thrift.StructLike { | ||
constructor(args = {}) { | ||
super(); | ||
this._annotations = {}; | ||
this._fieldAnnotations = {}; | ||
if (args.parameters != null) { | ||
const value_18 = new ReportAbuseParameters.ReportAbuseParameters(args.parameters); | ||
this.parameters = value_18; | ||
} | ||
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)); | ||
return new GetUserProfile__Args(exports.GetUserProfile__ArgsCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.ReportAbuse__ArgsCodec.encode(args, output); | ||
return exports.GetUserProfile__ArgsCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.ReportAbuse__ArgsCodec.encode(this, output); | ||
return exports.GetUserProfile__ArgsCodec.encode(this, output); | ||
} | ||
} | ||
exports.ReportAbuse__Args = ReportAbuse__Args; | ||
exports.Recommend__ResultCodec = { | ||
exports.GetUserProfile__Args = GetUserProfile__Args; | ||
exports.AddUsername__ResultCodec = { | ||
encode(args, output) { | ||
@@ -710,6 +710,6 @@ const obj = { | ||
}; | ||
output.writeStructBegin("Recommend__Result"); | ||
output.writeStructBegin("AddUsername__Result"); | ||
if (obj.success != null) { | ||
output.writeFieldBegin("success", thrift.TType.STRUCT, 0); | ||
DiscussionResponse.DiscussionResponseCodec.encode(obj.success, output); | ||
AddUsernameResponse.AddUsernameResponseCodec.encode(obj.success, output); | ||
output.writeFieldEnd(); | ||
@@ -734,3 +734,3 @@ } | ||
if (fieldType === thrift.TType.STRUCT) { | ||
const value_19 = DiscussionResponse.DiscussionResponseCodec.decode(input); | ||
const value_19 = AddUsernameResponse.AddUsernameResponseCodec.decode(input); | ||
_args.success = value_19; | ||
@@ -754,3 +754,3 @@ } | ||
}; | ||
class Recommend__Result extends thrift.StructLike { | ||
class AddUsername__Result extends thrift.StructLike { | ||
constructor(args = {}) { | ||
@@ -761,3 +761,3 @@ super(); | ||
if (args.success != null) { | ||
const value_20 = DiscussionResponse.DiscussionResponseCodec.create(args.success); | ||
const value_20 = AddUsernameResponse.AddUsernameResponseCodec.create(args.success); | ||
this.success = value_20; | ||
@@ -767,13 +767,13 @@ } | ||
static read(input) { | ||
return new Recommend__Result(exports.Recommend__ResultCodec.decode(input)); | ||
return new AddUsername__Result(exports.AddUsername__ResultCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.Recommend__ResultCodec.encode(args, output); | ||
return exports.AddUsername__ResultCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.Recommend__ResultCodec.encode(this, output); | ||
return exports.AddUsername__ResultCodec.encode(this, output); | ||
} | ||
} | ||
exports.Recommend__Result = Recommend__Result; | ||
exports.GetUserProfile__ResultCodec = { | ||
exports.AddUsername__Result = AddUsername__Result; | ||
exports.Recommend__ResultCodec = { | ||
encode(args, output) { | ||
@@ -783,6 +783,6 @@ const obj = { | ||
}; | ||
output.writeStructBegin("GetUserProfile__Result"); | ||
output.writeStructBegin("Recommend__Result"); | ||
if (obj.success != null) { | ||
output.writeFieldBegin("success", thrift.TType.STRUCT, 0); | ||
GetUserProfileResponse.GetUserProfileResponseCodec.encode(obj.success, output); | ||
DiscussionResponse.DiscussionResponseCodec.encode(obj.success, output); | ||
output.writeFieldEnd(); | ||
@@ -807,3 +807,3 @@ } | ||
if (fieldType === thrift.TType.STRUCT) { | ||
const value_21 = GetUserProfileResponse.GetUserProfileResponseCodec.decode(input); | ||
const value_21 = DiscussionResponse.DiscussionResponseCodec.decode(input); | ||
_args.success = value_21; | ||
@@ -827,3 +827,3 @@ } | ||
}; | ||
class GetUserProfile__Result extends thrift.StructLike { | ||
class Recommend__Result extends thrift.StructLike { | ||
constructor(args = {}) { | ||
@@ -834,3 +834,3 @@ super(); | ||
if (args.success != null) { | ||
const value_22 = GetUserProfileResponse.GetUserProfileResponseCodec.create(args.success); | ||
const value_22 = DiscussionResponse.DiscussionResponseCodec.create(args.success); | ||
this.success = value_22; | ||
@@ -840,12 +840,12 @@ } | ||
static read(input) { | ||
return new GetUserProfile__Result(exports.GetUserProfile__ResultCodec.decode(input)); | ||
return new Recommend__Result(exports.Recommend__ResultCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.GetUserProfile__ResultCodec.encode(args, output); | ||
return exports.Recommend__ResultCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.GetUserProfile__ResultCodec.encode(this, output); | ||
return exports.Recommend__ResultCodec.encode(this, output); | ||
} | ||
} | ||
exports.GetUserProfile__Result = GetUserProfile__Result; | ||
exports.Recommend__Result = Recommend__Result; | ||
exports.Comment__ResultCodec = { | ||
@@ -1055,3 +1055,3 @@ encode(args, output) { | ||
exports.Reply__Result = Reply__Result; | ||
exports.AddUsername__ResultCodec = { | ||
exports.ReportAbuse__ResultCodec = { | ||
encode(args, output) { | ||
@@ -1061,6 +1061,6 @@ const obj = { | ||
}; | ||
output.writeStructBegin("AddUsername__Result"); | ||
output.writeStructBegin("ReportAbuse__Result"); | ||
if (obj.success != null) { | ||
output.writeFieldBegin("success", thrift.TType.STRUCT, 0); | ||
AddUsernameResponse.AddUsernameResponseCodec.encode(obj.success, output); | ||
DiscussionResponse.DiscussionResponseCodec.encode(obj.success, output); | ||
output.writeFieldEnd(); | ||
@@ -1085,3 +1085,3 @@ } | ||
if (fieldType === thrift.TType.STRUCT) { | ||
const value_29 = AddUsernameResponse.AddUsernameResponseCodec.decode(input); | ||
const value_29 = DiscussionResponse.DiscussionResponseCodec.decode(input); | ||
_args.success = value_29; | ||
@@ -1105,3 +1105,3 @@ } | ||
}; | ||
class AddUsername__Result extends thrift.StructLike { | ||
class ReportAbuse__Result extends thrift.StructLike { | ||
constructor(args = {}) { | ||
@@ -1112,3 +1112,3 @@ super(); | ||
if (args.success != null) { | ||
const value_30 = AddUsernameResponse.AddUsernameResponseCodec.create(args.success); | ||
const value_30 = DiscussionResponse.DiscussionResponseCodec.create(args.success); | ||
this.success = value_30; | ||
@@ -1118,13 +1118,13 @@ } | ||
static read(input) { | ||
return new AddUsername__Result(exports.AddUsername__ResultCodec.decode(input)); | ||
return new ReportAbuse__Result(exports.ReportAbuse__ResultCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.AddUsername__ResultCodec.encode(args, output); | ||
return exports.ReportAbuse__ResultCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.AddUsername__ResultCodec.encode(this, output); | ||
return exports.ReportAbuse__ResultCodec.encode(this, output); | ||
} | ||
} | ||
exports.AddUsername__Result = AddUsername__Result; | ||
exports.ReportAbuse__ResultCodec = { | ||
exports.ReportAbuse__Result = ReportAbuse__Result; | ||
exports.GetUserProfile__ResultCodec = { | ||
encode(args, output) { | ||
@@ -1134,6 +1134,6 @@ const obj = { | ||
}; | ||
output.writeStructBegin("ReportAbuse__Result"); | ||
output.writeStructBegin("GetUserProfile__Result"); | ||
if (obj.success != null) { | ||
output.writeFieldBegin("success", thrift.TType.STRUCT, 0); | ||
DiscussionResponse.DiscussionResponseCodec.encode(obj.success, output); | ||
GetUserProfileResponse.GetUserProfileResponseCodec.encode(obj.success, output); | ||
output.writeFieldEnd(); | ||
@@ -1158,3 +1158,3 @@ } | ||
if (fieldType === thrift.TType.STRUCT) { | ||
const value_31 = DiscussionResponse.DiscussionResponseCodec.decode(input); | ||
const value_31 = GetUserProfileResponse.GetUserProfileResponseCodec.decode(input); | ||
_args.success = value_31; | ||
@@ -1178,3 +1178,3 @@ } | ||
}; | ||
class ReportAbuse__Result extends thrift.StructLike { | ||
class GetUserProfile__Result extends thrift.StructLike { | ||
constructor(args = {}) { | ||
@@ -1185,3 +1185,3 @@ super(); | ||
if (args.success != null) { | ||
const value_32 = DiscussionResponse.DiscussionResponseCodec.create(args.success); | ||
const value_32 = GetUserProfileResponse.GetUserProfileResponseCodec.create(args.success); | ||
this.success = value_32; | ||
@@ -1191,12 +1191,12 @@ } | ||
static read(input) { | ||
return new ReportAbuse__Result(exports.ReportAbuse__ResultCodec.decode(input)); | ||
return new GetUserProfile__Result(exports.GetUserProfile__ResultCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.ReportAbuse__ResultCodec.encode(args, output); | ||
return exports.GetUserProfile__ResultCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.ReportAbuse__ResultCodec.encode(this, output); | ||
return exports.GetUserProfile__ResultCodec.encode(this, output); | ||
} | ||
} | ||
exports.ReportAbuse__Result = ReportAbuse__Result; | ||
exports.GetUserProfile__Result = GetUserProfile__Result; | ||
class Client extends thrift.ThriftClient { | ||
@@ -1211,8 +1211,8 @@ constructor() { | ||
} | ||
recommend(commentId, context) { | ||
addUsername(username, context) { | ||
const writer = new this.transport(); | ||
const output = new this.protocol(writer); | ||
output.writeMessageBegin("recommend", thrift.MessageType.CALL, this.incrementRequestId()); | ||
const args = { commentId }; | ||
exports.Recommend__ArgsCodec.encode(args, output); | ||
output.writeMessageBegin("addUsername", thrift.MessageType.CALL, this.incrementRequestId()); | ||
const args = { username }; | ||
exports.AddUsername__ArgsCodec.encode(args, output); | ||
output.writeMessageEnd(); | ||
@@ -1224,3 +1224,3 @@ return this.connection.send(writer.flush(), context).then((data) => { | ||
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin(); | ||
if (fieldName === "recommend") { | ||
if (fieldName === "addUsername") { | ||
if (messageType === thrift.MessageType.EXCEPTION) { | ||
@@ -1232,3 +1232,3 @@ const err = thrift.TApplicationExceptionCodec.decode(input); | ||
else { | ||
const result = exports.Recommend__ResultCodec.decode(input); | ||
const result = exports.AddUsername__ResultCodec.decode(input); | ||
input.readMessageEnd(); | ||
@@ -1239,3 +1239,3 @@ if (result.success != null) { | ||
else { | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "recommend failed: unknown result")); | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "addUsername failed: unknown result")); | ||
} | ||
@@ -1253,8 +1253,8 @@ } | ||
} | ||
getUserProfile(context) { | ||
recommend(commentId, context) { | ||
const writer = new this.transport(); | ||
const output = new this.protocol(writer); | ||
output.writeMessageBegin("getUserProfile", thrift.MessageType.CALL, this.incrementRequestId()); | ||
const args = {}; | ||
exports.GetUserProfile__ArgsCodec.encode(args, output); | ||
output.writeMessageBegin("recommend", thrift.MessageType.CALL, this.incrementRequestId()); | ||
const args = { commentId }; | ||
exports.Recommend__ArgsCodec.encode(args, output); | ||
output.writeMessageEnd(); | ||
@@ -1266,3 +1266,3 @@ return this.connection.send(writer.flush(), context).then((data) => { | ||
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin(); | ||
if (fieldName === "getUserProfile") { | ||
if (fieldName === "recommend") { | ||
if (messageType === thrift.MessageType.EXCEPTION) { | ||
@@ -1274,3 +1274,3 @@ const err = thrift.TApplicationExceptionCodec.decode(input); | ||
else { | ||
const result = exports.GetUserProfile__ResultCodec.decode(input); | ||
const result = exports.Recommend__ResultCodec.decode(input); | ||
input.readMessageEnd(); | ||
@@ -1281,3 +1281,3 @@ if (result.success != null) { | ||
else { | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "getUserProfile failed: unknown result")); | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "recommend failed: unknown result")); | ||
} | ||
@@ -1409,8 +1409,8 @@ } | ||
} | ||
addUsername(username, context) { | ||
reportAbuse(parameters, context) { | ||
const writer = new this.transport(); | ||
const output = new this.protocol(writer); | ||
output.writeMessageBegin("addUsername", thrift.MessageType.CALL, this.incrementRequestId()); | ||
const args = { username }; | ||
exports.AddUsername__ArgsCodec.encode(args, output); | ||
output.writeMessageBegin("reportAbuse", thrift.MessageType.CALL, this.incrementRequestId()); | ||
const args = { parameters }; | ||
exports.ReportAbuse__ArgsCodec.encode(args, output); | ||
output.writeMessageEnd(); | ||
@@ -1422,3 +1422,3 @@ return this.connection.send(writer.flush(), context).then((data) => { | ||
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin(); | ||
if (fieldName === "addUsername") { | ||
if (fieldName === "reportAbuse") { | ||
if (messageType === thrift.MessageType.EXCEPTION) { | ||
@@ -1430,3 +1430,3 @@ const err = thrift.TApplicationExceptionCodec.decode(input); | ||
else { | ||
const result = exports.AddUsername__ResultCodec.decode(input); | ||
const result = exports.ReportAbuse__ResultCodec.decode(input); | ||
input.readMessageEnd(); | ||
@@ -1437,3 +1437,3 @@ if (result.success != null) { | ||
else { | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "addUsername failed: unknown result")); | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "reportAbuse failed: unknown result")); | ||
} | ||
@@ -1451,8 +1451,8 @@ } | ||
} | ||
reportAbuse(parameters, context) { | ||
getUserProfile(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.writeMessageBegin("getUserProfile", thrift.MessageType.CALL, this.incrementRequestId()); | ||
const args = {}; | ||
exports.GetUserProfile__ArgsCodec.encode(args, output); | ||
output.writeMessageEnd(); | ||
@@ -1464,3 +1464,3 @@ return this.connection.send(writer.flush(), context).then((data) => { | ||
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin(); | ||
if (fieldName === "reportAbuse") { | ||
if (fieldName === "getUserProfile") { | ||
if (messageType === thrift.MessageType.EXCEPTION) { | ||
@@ -1472,3 +1472,3 @@ const err = thrift.TApplicationExceptionCodec.decode(input); | ||
else { | ||
const result = exports.ReportAbuse__ResultCodec.decode(input); | ||
const result = exports.GetUserProfile__ResultCodec.decode(input); | ||
input.readMessageEnd(); | ||
@@ -1479,3 +1479,3 @@ if (result.success != null) { | ||
else { | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "reportAbuse failed: unknown result")); | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "getUserProfile failed: unknown result")); | ||
} | ||
@@ -1515,2 +1515,6 @@ } | ||
switch (methodName) { | ||
case "process_addUsername": { | ||
resolve(this.process_addUsername(requestId, input, output, context)); | ||
break; | ||
} | ||
case "process_recommend": { | ||
@@ -1520,6 +1524,2 @@ resolve(this.process_recommend(requestId, input, output, context)); | ||
} | ||
case "process_getUserProfile": { | ||
resolve(this.process_getUserProfile(requestId, input, output, context)); | ||
break; | ||
} | ||
case "process_comment": { | ||
@@ -1537,6 +1537,2 @@ resolve(this.process_comment(requestId, input, output, context)); | ||
} | ||
case "process_addUsername": { | ||
resolve(this.process_addUsername(requestId, input, output, context)); | ||
break; | ||
} | ||
case "process_reportAbuse": { | ||
@@ -1546,2 +1542,6 @@ resolve(this.process_reportAbuse(requestId, input, output, context)); | ||
} | ||
case "process_getUserProfile": { | ||
resolve(this.process_getUserProfile(requestId, input, output, context)); | ||
break; | ||
} | ||
default: { | ||
@@ -1561,8 +1561,8 @@ input.skip(thrift.TType.STRUCT); | ||
} | ||
process_recommend(requestId, input, output, context) { | ||
process_addUsername(requestId, input, output, context) { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
const args = exports.Recommend__ArgsCodec.decode(input); | ||
const args = exports.AddUsername__ArgsCodec.decode(input); | ||
input.readMessageEnd(); | ||
resolve(this._handler.recommend(args.commentId, context)); | ||
resolve(this._handler.addUsername(args.username, context)); | ||
} | ||
@@ -1574,4 +1574,4 @@ catch (err) { | ||
const result = { success: data }; | ||
output.writeMessageBegin("recommend", thrift.MessageType.REPLY, requestId); | ||
exports.Recommend__ResultCodec.encode(result, output); | ||
output.writeMessageBegin("addUsername", thrift.MessageType.REPLY, requestId); | ||
exports.AddUsername__ResultCodec.encode(result, output); | ||
output.writeMessageEnd(); | ||
@@ -1581,3 +1581,3 @@ return output.flush(); | ||
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message); | ||
output.writeMessageBegin("recommend", thrift.MessageType.EXCEPTION, requestId); | ||
output.writeMessageBegin("addUsername", thrift.MessageType.EXCEPTION, requestId); | ||
thrift.TApplicationExceptionCodec.encode(result, output); | ||
@@ -1588,7 +1588,8 @@ output.writeMessageEnd(); | ||
} | ||
process_getUserProfile(requestId, input, output, context) { | ||
process_recommend(requestId, input, output, context) { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
const args = exports.Recommend__ArgsCodec.decode(input); | ||
input.readMessageEnd(); | ||
resolve(this._handler.getUserProfile(context)); | ||
resolve(this._handler.recommend(args.commentId, context)); | ||
} | ||
@@ -1600,4 +1601,4 @@ catch (err) { | ||
const result = { success: data }; | ||
output.writeMessageBegin("getUserProfile", thrift.MessageType.REPLY, requestId); | ||
exports.GetUserProfile__ResultCodec.encode(result, output); | ||
output.writeMessageBegin("recommend", thrift.MessageType.REPLY, requestId); | ||
exports.Recommend__ResultCodec.encode(result, output); | ||
output.writeMessageEnd(); | ||
@@ -1607,3 +1608,3 @@ return output.flush(); | ||
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message); | ||
output.writeMessageBegin("getUserProfile", thrift.MessageType.EXCEPTION, requestId); | ||
output.writeMessageBegin("recommend", thrift.MessageType.EXCEPTION, requestId); | ||
thrift.TApplicationExceptionCodec.encode(result, output); | ||
@@ -1686,8 +1687,8 @@ output.writeMessageEnd(); | ||
} | ||
process_addUsername(requestId, input, output, context) { | ||
process_reportAbuse(requestId, input, output, context) { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
const args = exports.AddUsername__ArgsCodec.decode(input); | ||
const args = exports.ReportAbuse__ArgsCodec.decode(input); | ||
input.readMessageEnd(); | ||
resolve(this._handler.addUsername(args.username, context)); | ||
resolve(this._handler.reportAbuse(args.parameters, context)); | ||
} | ||
@@ -1699,4 +1700,4 @@ catch (err) { | ||
const result = { success: data }; | ||
output.writeMessageBegin("addUsername", thrift.MessageType.REPLY, requestId); | ||
exports.AddUsername__ResultCodec.encode(result, output); | ||
output.writeMessageBegin("reportAbuse", thrift.MessageType.REPLY, requestId); | ||
exports.ReportAbuse__ResultCodec.encode(result, output); | ||
output.writeMessageEnd(); | ||
@@ -1706,3 +1707,3 @@ return output.flush(); | ||
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message); | ||
output.writeMessageBegin("addUsername", thrift.MessageType.EXCEPTION, requestId); | ||
output.writeMessageBegin("reportAbuse", thrift.MessageType.EXCEPTION, requestId); | ||
thrift.TApplicationExceptionCodec.encode(result, output); | ||
@@ -1713,8 +1714,7 @@ output.writeMessageEnd(); | ||
} | ||
process_reportAbuse(requestId, input, output, context) { | ||
process_getUserProfile(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)); | ||
resolve(this._handler.getUserProfile(context)); | ||
} | ||
@@ -1726,4 +1726,4 @@ catch (err) { | ||
const result = { success: data }; | ||
output.writeMessageBegin("reportAbuse", thrift.MessageType.REPLY, requestId); | ||
exports.ReportAbuse__ResultCodec.encode(result, output); | ||
output.writeMessageBegin("getUserProfile", thrift.MessageType.REPLY, requestId); | ||
exports.GetUserProfile__ResultCodec.encode(result, output); | ||
output.writeMessageEnd(); | ||
@@ -1733,3 +1733,3 @@ return output.flush(); | ||
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message); | ||
output.writeMessageBegin("reportAbuse", thrift.MessageType.EXCEPTION, requestId); | ||
output.writeMessageBegin("getUserProfile", thrift.MessageType.EXCEPTION, requestId); | ||
thrift.TApplicationExceptionCodec.encode(result, output); | ||
@@ -1736,0 +1736,0 @@ output.writeMessageEnd(); |
{ | ||
"name": "@guardian/bridget", | ||
"version": "0.0.0-2024-04-10-snapshot-2", | ||
"version": "0.0.0-2024-04-11-snapshot", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
import * as thrift from "@creditkarma/thrift-server-core"; | ||
export interface IReportAbuseParameters { | ||
commentId?: string; | ||
categoryId?: string; | ||
commentId: string; | ||
categoryId: string; | ||
reason?: string; | ||
@@ -9,4 +9,4 @@ email?: string; | ||
export interface IReportAbuseParametersArgs { | ||
commentId?: string; | ||
categoryId?: string; | ||
commentId: string; | ||
categoryId: string; | ||
reason?: string; | ||
@@ -17,4 +17,4 @@ email?: string; | ||
export declare class ReportAbuseParameters extends thrift.StructLike implements IReportAbuseParameters { | ||
commentId?: string; | ||
categoryId?: string; | ||
commentId: string; | ||
categoryId: string; | ||
reason?: string; | ||
@@ -24,3 +24,3 @@ email?: string; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IReportAbuseParametersArgs); | ||
constructor(args: IReportAbuseParametersArgs); | ||
static read(input: thrift.TProtocol): ReportAbuseParameters; | ||
@@ -27,0 +27,0 @@ static write(args: IReportAbuseParametersArgs, output: thrift.TProtocol): void; |
@@ -48,2 +48,5 @@ "use strict"; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[commentId] is unset!"); | ||
} | ||
if (obj.categoryId != null) { | ||
@@ -54,2 +57,5 @@ output.writeFieldBegin("categoryId", thrift.TType.STRING, 2); | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[categoryId] is unset!"); | ||
} | ||
if (obj.reason != null) { | ||
@@ -123,12 +129,17 @@ output.writeFieldBegin("reason", thrift.TType.STRING, 3); | ||
input.readStructEnd(); | ||
return { | ||
commentId: _args.commentId, | ||
categoryId: _args.categoryId, | ||
reason: _args.reason, | ||
email: _args.email | ||
}; | ||
if (_args.commentId !== undefined && _args.categoryId !== undefined) { | ||
return { | ||
commentId: _args.commentId, | ||
categoryId: _args.categoryId, | ||
reason: _args.reason, | ||
email: _args.email | ||
}; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read ReportAbuseParameters from input"); | ||
} | ||
} | ||
}; | ||
class ReportAbuseParameters extends thrift.StructLike { | ||
constructor(args = {}) { | ||
constructor(args) { | ||
super(); | ||
@@ -141,2 +152,5 @@ this._annotations = {}; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[commentId] is unset!"); | ||
} | ||
if (args.categoryId != null) { | ||
@@ -146,2 +160,5 @@ const value_6 = args.categoryId; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[categoryId] is unset!"); | ||
} | ||
if (args.reason != null) { | ||
@@ -148,0 +165,0 @@ const value_7 = args.reason; |
571253
14176