@guardian/bridget
Advanced tools
Comparing version 0.0.0-2024-03-11-snapshot-3 to 0.0.0-2024-03-11-snapshot-signin
export * from "./PurchaseScreenReason"; | ||
export * from "./SignInScreenReason"; | ||
export * from "./SignInScreenReferrer"; | ||
export * from "./Rect"; | ||
@@ -3,0 +5,0 @@ export * from "./AdSlot"; |
@@ -37,2 +37,4 @@ "use strict"; | ||
__exportStar(require("./PurchaseScreenReason"), exports); | ||
__exportStar(require("./SignInScreenReason"), exports); | ||
__exportStar(require("./SignInScreenReferrer"), exports); | ||
__exportStar(require("./Rect"), exports); | ||
@@ -39,0 +41,0 @@ __exportStar(require("./AdSlot"), exports); |
{ | ||
"name": "@guardian/bridget", | ||
"version": "0.0.0-2024-03-11-snapshot-3", | ||
"version": "0.0.0-2024-03-11-snapshot-signin", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import * as thrift from "@creditkarma/thrift-server-core"; | ||
import * as SignInScreenReason from "./SignInScreenReason"; | ||
export declare const serviceName: string; | ||
@@ -66,2 +67,31 @@ export declare const annotations: thrift.IThriftAnnotations; | ||
} | ||
export interface IIsSignedIn__Args { | ||
} | ||
export interface IIsSignedIn__ArgsArgs { | ||
} | ||
export declare const IsSignedIn__ArgsCodec: thrift.IStructCodec<IIsSignedIn__ArgsArgs, IIsSignedIn__Args>; | ||
export declare class IsSignedIn__Args extends thrift.StructLike implements IIsSignedIn__Args { | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IIsSignedIn__ArgsArgs); | ||
static read(input: thrift.TProtocol): IsSignedIn__Args; | ||
static write(args: IIsSignedIn__ArgsArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface ISignIn__Args { | ||
reason: SignInScreenReason.SignInScreenReason; | ||
} | ||
export interface ISignIn__ArgsArgs { | ||
reason: SignInScreenReason.SignInScreenReason; | ||
} | ||
export declare const SignIn__ArgsCodec: thrift.IStructCodec<ISignIn__ArgsArgs, ISignIn__Args>; | ||
export declare class SignIn__Args extends thrift.StructLike implements ISignIn__Args { | ||
reason: SignInScreenReason.SignInScreenReason; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args: ISignIn__ArgsArgs); | ||
static read(input: thrift.TProtocol): SignIn__Args; | ||
static write(args: ISignIn__ArgsArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface IIsPremium__Result { | ||
@@ -131,2 +161,34 @@ success?: boolean; | ||
} | ||
export interface IIsSignedIn__Result { | ||
success?: boolean; | ||
} | ||
export interface IIsSignedIn__ResultArgs { | ||
success?: boolean; | ||
} | ||
export declare const IsSignedIn__ResultCodec: thrift.IStructCodec<IIsSignedIn__ResultArgs, IIsSignedIn__Result>; | ||
export declare class IsSignedIn__Result extends thrift.StructLike implements IIsSignedIn__Result { | ||
success?: boolean; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: IIsSignedIn__ResultArgs); | ||
static read(input: thrift.TProtocol): IsSignedIn__Result; | ||
static write(args: IIsSignedIn__ResultArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export interface ISignIn__Result { | ||
success?: void; | ||
} | ||
export interface ISignIn__ResultArgs { | ||
success?: void; | ||
} | ||
export declare const SignIn__ResultCodec: thrift.IStructCodec<ISignIn__ResultArgs, ISignIn__Result>; | ||
export declare class SignIn__Result extends thrift.StructLike implements ISignIn__Result { | ||
success?: void; | ||
readonly _annotations: thrift.IThriftAnnotations; | ||
readonly _fieldAnnotations: thrift.IFieldAnnotations; | ||
constructor(args?: ISignIn__ResultArgs); | ||
static read(input: thrift.TProtocol): SignIn__Result; | ||
static write(args: ISignIn__ResultArgs, output: thrift.TProtocol): void; | ||
write(output: thrift.TProtocol): void; | ||
} | ||
export declare class Client<Context = any> extends thrift.ThriftClient<Context> { | ||
@@ -148,2 +210,4 @@ static readonly serviceName: string; | ||
doesCcpaApply(context?: Context): Promise<boolean>; | ||
isSignedIn(context?: Context): Promise<boolean>; | ||
signIn(reason: SignInScreenReason.SignInScreenReason, context?: Context): Promise<void>; | ||
} | ||
@@ -155,2 +219,4 @@ export interface IHandler<Context = any> { | ||
doesCcpaApply(context?: Context): boolean | Promise<boolean>; | ||
isSignedIn(context?: Context): boolean | Promise<boolean>; | ||
signIn(reason: SignInScreenReason.SignInScreenReason, context?: Context): void | Promise<void>; | ||
} | ||
@@ -173,2 +239,4 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> { | ||
process_doesCcpaApply(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>; | ||
process_isSignedIn(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>; | ||
process_signIn(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>; | ||
} |
438
User.js
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Processor = exports.Client = exports.DoesCcpaApply__Result = exports.DoesCcpaApply__ResultCodec = exports.DiscussionId__Result = exports.DiscussionId__ResultCodec = exports.FilterSeenArticles__Result = exports.FilterSeenArticles__ResultCodec = exports.IsPremium__Result = exports.IsPremium__ResultCodec = exports.DoesCcpaApply__Args = exports.DoesCcpaApply__ArgsCodec = exports.DiscussionId__Args = exports.DiscussionId__ArgsCodec = exports.FilterSeenArticles__Args = exports.FilterSeenArticles__ArgsCodec = exports.IsPremium__Args = exports.IsPremium__ArgsCodec = exports.methodParameters = exports.methodNames = exports.methodAnnotations = exports.annotations = exports.serviceName = void 0; | ||
exports.Processor = exports.Client = exports.SignIn__Result = exports.SignIn__ResultCodec = exports.IsSignedIn__Result = exports.IsSignedIn__ResultCodec = exports.DoesCcpaApply__Result = exports.DoesCcpaApply__ResultCodec = exports.DiscussionId__Result = exports.DiscussionId__ResultCodec = exports.FilterSeenArticles__Result = exports.FilterSeenArticles__ResultCodec = exports.IsPremium__Result = exports.IsPremium__ResultCodec = exports.SignIn__Args = exports.SignIn__ArgsCodec = exports.IsSignedIn__Args = exports.IsSignedIn__ArgsCodec = exports.DoesCcpaApply__Args = exports.DoesCcpaApply__ArgsCodec = exports.DiscussionId__Args = exports.DiscussionId__ArgsCodec = exports.FilterSeenArticles__Args = exports.FilterSeenArticles__ArgsCodec = exports.IsPremium__Args = exports.IsPremium__ArgsCodec = exports.methodParameters = exports.methodNames = exports.methodAnnotations = exports.annotations = exports.serviceName = void 0; | ||
/* tslint:disable */ | ||
@@ -53,5 +53,13 @@ /* eslint-disable */ | ||
fieldAnnotations: {} | ||
}, | ||
isSignedIn: { | ||
annotations: {}, | ||
fieldAnnotations: {} | ||
}, | ||
signIn: { | ||
annotations: {}, | ||
fieldAnnotations: {} | ||
} | ||
}; | ||
exports.methodNames = ["isPremium", "filterSeenArticles", "discussionId", "doesCcpaApply"]; | ||
exports.methodNames = ["isPremium", "filterSeenArticles", "discussionId", "doesCcpaApply", "isSignedIn", "signIn"]; | ||
exports.methodParameters = { | ||
@@ -61,3 +69,5 @@ isPremium: 1, | ||
discussionId: 1, | ||
doesCcpaApply: 1 | ||
doesCcpaApply: 1, | ||
isSignedIn: 1, | ||
signIn: 2 | ||
}; | ||
@@ -290,2 +300,125 @@ exports.IsPremium__ArgsCodec = { | ||
exports.DoesCcpaApply__Args = DoesCcpaApply__Args; | ||
exports.IsSignedIn__ArgsCodec = { | ||
encode(args, output) { | ||
output.writeStructBegin("IsSignedIn__Args"); | ||
output.writeFieldStop(); | ||
output.writeStructEnd(); | ||
return; | ||
}, | ||
decode(input) { | ||
input.readStructBegin(); | ||
while (true) { | ||
const ret = input.readFieldBegin(); | ||
const fieldType = ret.fieldType; | ||
const fieldId = ret.fieldId; | ||
if (fieldType === thrift.TType.STOP) { | ||
break; | ||
} | ||
switch (fieldId) { | ||
default: { | ||
input.skip(fieldType); | ||
} | ||
} | ||
input.readFieldEnd(); | ||
} | ||
input.readStructEnd(); | ||
return {}; | ||
} | ||
}; | ||
class IsSignedIn__Args extends thrift.StructLike { | ||
constructor(args = {}) { | ||
super(); | ||
this._annotations = {}; | ||
this._fieldAnnotations = {}; | ||
} | ||
static read(input) { | ||
return new IsSignedIn__Args(exports.IsSignedIn__ArgsCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.IsSignedIn__ArgsCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.IsSignedIn__ArgsCodec.encode(this, output); | ||
} | ||
} | ||
exports.IsSignedIn__Args = IsSignedIn__Args; | ||
exports.SignIn__ArgsCodec = { | ||
encode(args, output) { | ||
const obj = { | ||
reason: args.reason | ||
}; | ||
output.writeStructBegin("SignIn__Args"); | ||
if (obj.reason != null) { | ||
output.writeFieldBegin("reason", thrift.TType.I32, 1); | ||
output.writeI32(obj.reason); | ||
output.writeFieldEnd(); | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[reason] 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.I32) { | ||
const value_7 = input.readI32(); | ||
_args.reason = value_7; | ||
} | ||
else { | ||
input.skip(fieldType); | ||
} | ||
break; | ||
default: { | ||
input.skip(fieldType); | ||
} | ||
} | ||
input.readFieldEnd(); | ||
} | ||
input.readStructEnd(); | ||
if (_args.reason !== undefined) { | ||
return { | ||
reason: _args.reason | ||
}; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read SignIn__Args from input"); | ||
} | ||
} | ||
}; | ||
class SignIn__Args extends thrift.StructLike { | ||
constructor(args) { | ||
super(); | ||
this._annotations = {}; | ||
this._fieldAnnotations = {}; | ||
if (args.reason != null) { | ||
const value_8 = args.reason; | ||
this.reason = value_8; | ||
} | ||
else { | ||
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[reason] is unset!"); | ||
} | ||
} | ||
static read(input) { | ||
return new SignIn__Args(exports.SignIn__ArgsCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.SignIn__ArgsCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.SignIn__ArgsCodec.encode(this, output); | ||
} | ||
} | ||
exports.SignIn__Args = SignIn__Args; | ||
exports.IsPremium__ResultCodec = { | ||
@@ -319,4 +452,4 @@ encode(args, output) { | ||
if (fieldType === thrift.TType.BOOL) { | ||
const value_7 = input.readBool(); | ||
_args.success = value_7; | ||
const value_9 = input.readBool(); | ||
_args.success = value_9; | ||
} | ||
@@ -345,4 +478,4 @@ else { | ||
if (args.success != null) { | ||
const value_8 = args.success; | ||
this.success = value_8; | ||
const value_10 = args.success; | ||
this.success = value_10; | ||
} | ||
@@ -370,4 +503,4 @@ } | ||
output.writeListBegin(thrift.TType.STRING, obj.success.length); | ||
obj.success.forEach((value_9) => { | ||
output.writeString(value_9); | ||
obj.success.forEach((value_11) => { | ||
output.writeString(value_11); | ||
}); | ||
@@ -394,11 +527,11 @@ output.writeListEnd(); | ||
if (fieldType === thrift.TType.LIST) { | ||
const value_10 = new Array(); | ||
const value_12 = new Array(); | ||
const metadata_2 = input.readListBegin(); | ||
const size_2 = metadata_2.size; | ||
for (let i_2 = 0; i_2 < size_2; i_2++) { | ||
const value_11 = input.readString(); | ||
value_10.push(value_11); | ||
const value_13 = input.readString(); | ||
value_12.push(value_13); | ||
} | ||
input.readListEnd(); | ||
_args.success = value_10; | ||
_args.success = value_12; | ||
} | ||
@@ -427,8 +560,8 @@ else { | ||
if (args.success != null) { | ||
const value_12 = new Array(); | ||
args.success.forEach((value_13) => { | ||
const value_14 = value_13; | ||
value_12.push(value_14); | ||
const value_14 = new Array(); | ||
args.success.forEach((value_15) => { | ||
const value_16 = value_15; | ||
value_14.push(value_16); | ||
}); | ||
this.success = value_12; | ||
this.success = value_14; | ||
} | ||
@@ -475,4 +608,4 @@ } | ||
if (fieldType === thrift.TType.STRING) { | ||
const value_15 = input.readString(); | ||
_args.success = value_15; | ||
const value_17 = input.readString(); | ||
_args.success = value_17; | ||
} | ||
@@ -501,4 +634,4 @@ else { | ||
if (args.success != null) { | ||
const value_16 = args.success; | ||
this.success = value_16; | ||
const value_18 = args.success; | ||
this.success = value_18; | ||
} | ||
@@ -545,4 +678,4 @@ } | ||
if (fieldType === thrift.TType.BOOL) { | ||
const value_17 = input.readBool(); | ||
_args.success = value_17; | ||
const value_19 = input.readBool(); | ||
_args.success = value_19; | ||
} | ||
@@ -571,4 +704,4 @@ else { | ||
if (args.success != null) { | ||
const value_18 = args.success; | ||
this.success = value_18; | ||
const value_20 = args.success; | ||
this.success = value_20; | ||
} | ||
@@ -587,2 +720,129 @@ } | ||
exports.DoesCcpaApply__Result = DoesCcpaApply__Result; | ||
exports.IsSignedIn__ResultCodec = { | ||
encode(args, output) { | ||
const obj = { | ||
success: args.success | ||
}; | ||
output.writeStructBegin("IsSignedIn__Result"); | ||
if (obj.success != null) { | ||
output.writeFieldBegin("success", thrift.TType.BOOL, 0); | ||
output.writeBool(obj.success); | ||
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.BOOL) { | ||
const value_21 = input.readBool(); | ||
_args.success = value_21; | ||
} | ||
else { | ||
input.skip(fieldType); | ||
} | ||
break; | ||
default: { | ||
input.skip(fieldType); | ||
} | ||
} | ||
input.readFieldEnd(); | ||
} | ||
input.readStructEnd(); | ||
return { | ||
success: _args.success | ||
}; | ||
} | ||
}; | ||
class IsSignedIn__Result extends thrift.StructLike { | ||
constructor(args = {}) { | ||
super(); | ||
this._annotations = {}; | ||
this._fieldAnnotations = {}; | ||
if (args.success != null) { | ||
const value_22 = args.success; | ||
this.success = value_22; | ||
} | ||
} | ||
static read(input) { | ||
return new IsSignedIn__Result(exports.IsSignedIn__ResultCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.IsSignedIn__ResultCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.IsSignedIn__ResultCodec.encode(this, output); | ||
} | ||
} | ||
exports.IsSignedIn__Result = IsSignedIn__Result; | ||
exports.SignIn__ResultCodec = { | ||
encode(args, output) { | ||
output.writeStructBegin("SignIn__Result"); | ||
output.writeFieldStop(); | ||
output.writeStructEnd(); | ||
return; | ||
}, | ||
decode(input) { | ||
let _args = {}; | ||
input.readStructBegin(); | ||
while (true) { | ||
const ret = input.readFieldBegin(); | ||
const fieldType = ret.fieldType; | ||
const fieldId = ret.fieldId; | ||
if (fieldType === thrift.TType.STOP) { | ||
break; | ||
} | ||
switch (fieldId) { | ||
case 0: | ||
if (fieldType === thrift.TType.VOID) { | ||
input.skip(fieldType); | ||
} | ||
else { | ||
input.skip(fieldType); | ||
} | ||
break; | ||
default: { | ||
input.skip(fieldType); | ||
} | ||
} | ||
input.readFieldEnd(); | ||
} | ||
input.readStructEnd(); | ||
return { | ||
success: _args.success | ||
}; | ||
} | ||
}; | ||
class SignIn__Result extends thrift.StructLike { | ||
constructor(args = {}) { | ||
super(); | ||
this._annotations = {}; | ||
this._fieldAnnotations = {}; | ||
if (args.success != null) { | ||
const value_23 = undefined; | ||
this.success = value_23; | ||
} | ||
} | ||
static read(input) { | ||
return new SignIn__Result(exports.SignIn__ResultCodec.decode(input)); | ||
} | ||
static write(args, output) { | ||
return exports.SignIn__ResultCodec.encode(args, output); | ||
} | ||
write(output) { | ||
return exports.SignIn__ResultCodec.encode(this, output); | ||
} | ||
} | ||
exports.SignIn__Result = SignIn__Result; | ||
class Client extends thrift.ThriftClient { | ||
@@ -749,2 +1009,73 @@ constructor() { | ||
} | ||
isSignedIn(context) { | ||
const writer = new this.transport(); | ||
const output = new this.protocol(writer); | ||
output.writeMessageBegin("isSignedIn", thrift.MessageType.CALL, this.incrementRequestId()); | ||
const args = {}; | ||
exports.IsSignedIn__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 === "isSignedIn") { | ||
if (messageType === thrift.MessageType.EXCEPTION) { | ||
const err = thrift.TApplicationExceptionCodec.decode(input); | ||
input.readMessageEnd(); | ||
return Promise.reject(err); | ||
} | ||
else { | ||
const result = exports.IsSignedIn__ResultCodec.decode(input); | ||
input.readMessageEnd(); | ||
if (result.success != null) { | ||
return Promise.resolve(result.success); | ||
} | ||
else { | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "isSignedIn 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); | ||
} | ||
}); | ||
} | ||
signIn(reason, context) { | ||
const writer = new this.transport(); | ||
const output = new this.protocol(writer); | ||
output.writeMessageBegin("signIn", thrift.MessageType.CALL, this.incrementRequestId()); | ||
const args = { reason }; | ||
exports.SignIn__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 === "signIn") { | ||
if (messageType === thrift.MessageType.EXCEPTION) { | ||
const err = thrift.TApplicationExceptionCodec.decode(input); | ||
input.readMessageEnd(); | ||
return Promise.reject(err); | ||
} | ||
else { | ||
const result = exports.SignIn__ResultCodec.decode(input); | ||
input.readMessageEnd(); | ||
return Promise.resolve(result.success); | ||
} | ||
} | ||
else { | ||
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName)); | ||
} | ||
} | ||
catch (err) { | ||
return Promise.reject(err); | ||
} | ||
}); | ||
} | ||
} | ||
@@ -788,2 +1119,10 @@ exports.Client = Client; | ||
} | ||
case "process_isSignedIn": { | ||
resolve(this.process_isSignedIn(requestId, input, output, context)); | ||
break; | ||
} | ||
case "process_signIn": { | ||
resolve(this.process_signIn(requestId, input, output, context)); | ||
break; | ||
} | ||
default: { | ||
@@ -896,2 +1235,49 @@ input.skip(thrift.TType.STRUCT); | ||
} | ||
process_isSignedIn(requestId, input, output, context) { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
input.readMessageEnd(); | ||
resolve(this._handler.isSignedIn(context)); | ||
} | ||
catch (err) { | ||
reject(err); | ||
} | ||
}).then((data) => { | ||
const result = { success: data }; | ||
output.writeMessageBegin("isSignedIn", thrift.MessageType.REPLY, requestId); | ||
exports.IsSignedIn__ResultCodec.encode(result, output); | ||
output.writeMessageEnd(); | ||
return output.flush(); | ||
}).catch((err) => { | ||
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message); | ||
output.writeMessageBegin("isSignedIn", thrift.MessageType.EXCEPTION, requestId); | ||
thrift.TApplicationExceptionCodec.encode(result, output); | ||
output.writeMessageEnd(); | ||
return output.flush(); | ||
}); | ||
} | ||
process_signIn(requestId, input, output, context) { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
const args = exports.SignIn__ArgsCodec.decode(input); | ||
input.readMessageEnd(); | ||
resolve(this._handler.signIn(args.reason, context)); | ||
} | ||
catch (err) { | ||
reject(err); | ||
} | ||
}).then((data) => { | ||
const result = { success: data }; | ||
output.writeMessageBegin("signIn", thrift.MessageType.REPLY, requestId); | ||
exports.SignIn__ResultCodec.encode(result, output); | ||
output.writeMessageEnd(); | ||
return output.flush(); | ||
}).catch((err) => { | ||
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message); | ||
output.writeMessageBegin("signIn", thrift.MessageType.EXCEPTION, requestId); | ||
thrift.TApplicationExceptionCodec.encode(result, output); | ||
output.writeMessageEnd(); | ||
return output.flush(); | ||
}); | ||
} | ||
} | ||
@@ -898,0 +1284,0 @@ exports.Processor = Processor; |
480426
58
11948