@guardian/bridget 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Environment.d.ts +32 -0
- package/Environment.js +184 -2
- package/Tag.d.ts +143 -0
- package/Tag.js +729 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +1 -1
package/Environment.d.ts
CHANGED
|
@@ -20,6 +20,19 @@ export declare class NativeThriftPackageVersion__Args extends thrift.StructLike
|
|
|
20
20
|
static write(args: INativeThriftPackageVersion__ArgsArgs, output: thrift.TProtocol): void;
|
|
21
21
|
write(output: thrift.TProtocol): void;
|
|
22
22
|
}
|
|
23
|
+
export interface IIsMyGuardianEnabled__Args {
|
|
24
|
+
}
|
|
25
|
+
export interface IIsMyGuardianEnabled__ArgsArgs {
|
|
26
|
+
}
|
|
27
|
+
export declare const IsMyGuardianEnabled__ArgsCodec: thrift.IStructCodec<IIsMyGuardianEnabled__ArgsArgs, IIsMyGuardianEnabled__Args>;
|
|
28
|
+
export declare class IsMyGuardianEnabled__Args extends thrift.StructLike implements IIsMyGuardianEnabled__Args {
|
|
29
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
30
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
31
|
+
constructor(args?: IIsMyGuardianEnabled__ArgsArgs);
|
|
32
|
+
static read(input: thrift.TProtocol): IsMyGuardianEnabled__Args;
|
|
33
|
+
static write(args: IIsMyGuardianEnabled__ArgsArgs, output: thrift.TProtocol): void;
|
|
34
|
+
write(output: thrift.TProtocol): void;
|
|
35
|
+
}
|
|
23
36
|
export interface INativeThriftPackageVersion__Result {
|
|
24
37
|
success?: string;
|
|
25
38
|
}
|
|
@@ -36,6 +49,22 @@ export declare class NativeThriftPackageVersion__Result extends thrift.StructLik
|
|
|
36
49
|
static write(args: INativeThriftPackageVersion__ResultArgs, output: thrift.TProtocol): void;
|
|
37
50
|
write(output: thrift.TProtocol): void;
|
|
38
51
|
}
|
|
52
|
+
export interface IIsMyGuardianEnabled__Result {
|
|
53
|
+
success?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface IIsMyGuardianEnabled__ResultArgs {
|
|
56
|
+
success?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export declare const IsMyGuardianEnabled__ResultCodec: thrift.IStructCodec<IIsMyGuardianEnabled__ResultArgs, IIsMyGuardianEnabled__Result>;
|
|
59
|
+
export declare class IsMyGuardianEnabled__Result extends thrift.StructLike implements IIsMyGuardianEnabled__Result {
|
|
60
|
+
success?: boolean;
|
|
61
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
62
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
63
|
+
constructor(args?: IIsMyGuardianEnabled__ResultArgs);
|
|
64
|
+
static read(input: thrift.TProtocol): IsMyGuardianEnabled__Result;
|
|
65
|
+
static write(args: IIsMyGuardianEnabled__ResultArgs, output: thrift.TProtocol): void;
|
|
66
|
+
write(output: thrift.TProtocol): void;
|
|
67
|
+
}
|
|
39
68
|
export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
|
|
40
69
|
static readonly serviceName: string;
|
|
41
70
|
static readonly annotations: thrift.IThriftAnnotations;
|
|
@@ -49,9 +78,11 @@ export declare class Client<Context = any> extends thrift.ThriftClient<Context>
|
|
|
49
78
|
[methodName: string]: number;
|
|
50
79
|
};
|
|
51
80
|
nativeThriftPackageVersion(context?: Context): Promise<string>;
|
|
81
|
+
isMyGuardianEnabled(context?: Context): Promise<boolean>;
|
|
52
82
|
}
|
|
53
83
|
export interface IHandler<Context = any> {
|
|
54
84
|
nativeThriftPackageVersion(context?: Context): string | Promise<string>;
|
|
85
|
+
isMyGuardianEnabled(context?: Context): boolean | Promise<boolean>;
|
|
55
86
|
}
|
|
56
87
|
export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
|
|
57
88
|
protected readonly _handler: IHandler<Context>;
|
|
@@ -66,4 +97,5 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Con
|
|
|
66
97
|
constructor(handler: IHandler<Context>);
|
|
67
98
|
process(input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
68
99
|
process_nativeThriftPackageVersion(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
100
|
+
process_isMyGuardianEnabled(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
69
101
|
}
|
package/Environment.js
CHANGED
|
@@ -20,11 +20,16 @@ exports.methodAnnotations = {
|
|
|
20
20
|
nativeThriftPackageVersion: {
|
|
21
21
|
annotations: {},
|
|
22
22
|
fieldAnnotations: {}
|
|
23
|
+
},
|
|
24
|
+
isMyGuardianEnabled: {
|
|
25
|
+
annotations: {},
|
|
26
|
+
fieldAnnotations: {}
|
|
23
27
|
}
|
|
24
28
|
};
|
|
25
|
-
exports.methodNames = ["nativeThriftPackageVersion"];
|
|
29
|
+
exports.methodNames = ["nativeThriftPackageVersion", "isMyGuardianEnabled"];
|
|
26
30
|
exports.methodParameters = {
|
|
27
|
-
nativeThriftPackageVersion: 1
|
|
31
|
+
nativeThriftPackageVersion: 1,
|
|
32
|
+
isMyGuardianEnabled: 1
|
|
28
33
|
};
|
|
29
34
|
exports.NativeThriftPackageVersion__ArgsCodec = {
|
|
30
35
|
encode(args, output) {
|
|
@@ -70,6 +75,50 @@ class NativeThriftPackageVersion__Args extends thrift.StructLike {
|
|
|
70
75
|
}
|
|
71
76
|
}
|
|
72
77
|
exports.NativeThriftPackageVersion__Args = NativeThriftPackageVersion__Args;
|
|
78
|
+
exports.IsMyGuardianEnabled__ArgsCodec = {
|
|
79
|
+
encode(args, output) {
|
|
80
|
+
output.writeStructBegin("IsMyGuardianEnabled__Args");
|
|
81
|
+
output.writeFieldStop();
|
|
82
|
+
output.writeStructEnd();
|
|
83
|
+
return;
|
|
84
|
+
},
|
|
85
|
+
decode(input) {
|
|
86
|
+
input.readStructBegin();
|
|
87
|
+
while (true) {
|
|
88
|
+
const ret = input.readFieldBegin();
|
|
89
|
+
const fieldType = ret.fieldType;
|
|
90
|
+
const fieldId = ret.fieldId;
|
|
91
|
+
if (fieldType === thrift.TType.STOP) {
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
switch (fieldId) {
|
|
95
|
+
default: {
|
|
96
|
+
input.skip(fieldType);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
input.readFieldEnd();
|
|
100
|
+
}
|
|
101
|
+
input.readStructEnd();
|
|
102
|
+
return {};
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
class IsMyGuardianEnabled__Args extends thrift.StructLike {
|
|
106
|
+
constructor(args = {}) {
|
|
107
|
+
super();
|
|
108
|
+
this._annotations = {};
|
|
109
|
+
this._fieldAnnotations = {};
|
|
110
|
+
}
|
|
111
|
+
static read(input) {
|
|
112
|
+
return new IsMyGuardianEnabled__Args(exports.IsMyGuardianEnabled__ArgsCodec.decode(input));
|
|
113
|
+
}
|
|
114
|
+
static write(args, output) {
|
|
115
|
+
return exports.IsMyGuardianEnabled__ArgsCodec.encode(args, output);
|
|
116
|
+
}
|
|
117
|
+
write(output) {
|
|
118
|
+
return exports.IsMyGuardianEnabled__ArgsCodec.encode(this, output);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
exports.IsMyGuardianEnabled__Args = IsMyGuardianEnabled__Args;
|
|
73
122
|
exports.NativeThriftPackageVersion__ResultCodec = {
|
|
74
123
|
encode(args, output) {
|
|
75
124
|
const obj = {
|
|
@@ -138,6 +187,74 @@ class NativeThriftPackageVersion__Result extends thrift.StructLike {
|
|
|
138
187
|
}
|
|
139
188
|
}
|
|
140
189
|
exports.NativeThriftPackageVersion__Result = NativeThriftPackageVersion__Result;
|
|
190
|
+
exports.IsMyGuardianEnabled__ResultCodec = {
|
|
191
|
+
encode(args, output) {
|
|
192
|
+
const obj = {
|
|
193
|
+
success: args.success
|
|
194
|
+
};
|
|
195
|
+
output.writeStructBegin("IsMyGuardianEnabled__Result");
|
|
196
|
+
if (obj.success != null) {
|
|
197
|
+
output.writeFieldBegin("success", thrift.TType.BOOL, 0);
|
|
198
|
+
output.writeBool(obj.success);
|
|
199
|
+
output.writeFieldEnd();
|
|
200
|
+
}
|
|
201
|
+
output.writeFieldStop();
|
|
202
|
+
output.writeStructEnd();
|
|
203
|
+
return;
|
|
204
|
+
},
|
|
205
|
+
decode(input) {
|
|
206
|
+
let _args = {};
|
|
207
|
+
input.readStructBegin();
|
|
208
|
+
while (true) {
|
|
209
|
+
const ret = input.readFieldBegin();
|
|
210
|
+
const fieldType = ret.fieldType;
|
|
211
|
+
const fieldId = ret.fieldId;
|
|
212
|
+
if (fieldType === thrift.TType.STOP) {
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
switch (fieldId) {
|
|
216
|
+
case 0:
|
|
217
|
+
if (fieldType === thrift.TType.BOOL) {
|
|
218
|
+
const value_3 = input.readBool();
|
|
219
|
+
_args.success = value_3;
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
input.skip(fieldType);
|
|
223
|
+
}
|
|
224
|
+
break;
|
|
225
|
+
default: {
|
|
226
|
+
input.skip(fieldType);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
input.readFieldEnd();
|
|
230
|
+
}
|
|
231
|
+
input.readStructEnd();
|
|
232
|
+
return {
|
|
233
|
+
success: _args.success
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
class IsMyGuardianEnabled__Result extends thrift.StructLike {
|
|
238
|
+
constructor(args = {}) {
|
|
239
|
+
super();
|
|
240
|
+
this._annotations = {};
|
|
241
|
+
this._fieldAnnotations = {};
|
|
242
|
+
if (args.success != null) {
|
|
243
|
+
const value_4 = args.success;
|
|
244
|
+
this.success = value_4;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
static read(input) {
|
|
248
|
+
return new IsMyGuardianEnabled__Result(exports.IsMyGuardianEnabled__ResultCodec.decode(input));
|
|
249
|
+
}
|
|
250
|
+
static write(args, output) {
|
|
251
|
+
return exports.IsMyGuardianEnabled__ResultCodec.encode(args, output);
|
|
252
|
+
}
|
|
253
|
+
write(output) {
|
|
254
|
+
return exports.IsMyGuardianEnabled__ResultCodec.encode(this, output);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
exports.IsMyGuardianEnabled__Result = IsMyGuardianEnabled__Result;
|
|
141
258
|
class Client extends thrift.ThriftClient {
|
|
142
259
|
constructor() {
|
|
143
260
|
super(...arguments);
|
|
@@ -185,6 +302,44 @@ class Client extends thrift.ThriftClient {
|
|
|
185
302
|
}
|
|
186
303
|
});
|
|
187
304
|
}
|
|
305
|
+
isMyGuardianEnabled(context) {
|
|
306
|
+
const writer = new this.transport();
|
|
307
|
+
const output = new this.protocol(writer);
|
|
308
|
+
output.writeMessageBegin("isMyGuardianEnabled", thrift.MessageType.CALL, this.incrementRequestId());
|
|
309
|
+
const args = {};
|
|
310
|
+
exports.IsMyGuardianEnabled__ArgsCodec.encode(args, output);
|
|
311
|
+
output.writeMessageEnd();
|
|
312
|
+
return this.connection.send(writer.flush(), context).then((data) => {
|
|
313
|
+
const reader = this.transport.receiver(data);
|
|
314
|
+
const input = new this.protocol(reader);
|
|
315
|
+
try {
|
|
316
|
+
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
|
|
317
|
+
if (fieldName === "isMyGuardianEnabled") {
|
|
318
|
+
if (messageType === thrift.MessageType.EXCEPTION) {
|
|
319
|
+
const err = thrift.TApplicationExceptionCodec.decode(input);
|
|
320
|
+
input.readMessageEnd();
|
|
321
|
+
return Promise.reject(err);
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
const result = exports.IsMyGuardianEnabled__ResultCodec.decode(input);
|
|
325
|
+
input.readMessageEnd();
|
|
326
|
+
if (result.success != null) {
|
|
327
|
+
return Promise.resolve(result.success);
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "isMyGuardianEnabled failed: unknown result"));
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
catch (err) {
|
|
339
|
+
return Promise.reject(err);
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
}
|
|
188
343
|
}
|
|
189
344
|
exports.Client = Client;
|
|
190
345
|
Client.serviceName = exports.serviceName;
|
|
@@ -211,6 +366,10 @@ class Processor extends thrift.ThriftProcessor {
|
|
|
211
366
|
resolve(this.process_nativeThriftPackageVersion(requestId, input, output, context));
|
|
212
367
|
break;
|
|
213
368
|
}
|
|
369
|
+
case "process_isMyGuardianEnabled": {
|
|
370
|
+
resolve(this.process_isMyGuardianEnabled(requestId, input, output, context));
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
214
373
|
default: {
|
|
215
374
|
input.skip(thrift.TType.STRUCT);
|
|
216
375
|
input.readMessageEnd();
|
|
@@ -248,6 +407,29 @@ class Processor extends thrift.ThriftProcessor {
|
|
|
248
407
|
return output.flush();
|
|
249
408
|
});
|
|
250
409
|
}
|
|
410
|
+
process_isMyGuardianEnabled(requestId, input, output, context) {
|
|
411
|
+
return new Promise((resolve, reject) => {
|
|
412
|
+
try {
|
|
413
|
+
input.readMessageEnd();
|
|
414
|
+
resolve(this._handler.isMyGuardianEnabled(context));
|
|
415
|
+
}
|
|
416
|
+
catch (err) {
|
|
417
|
+
reject(err);
|
|
418
|
+
}
|
|
419
|
+
}).then((data) => {
|
|
420
|
+
const result = { success: data };
|
|
421
|
+
output.writeMessageBegin("isMyGuardianEnabled", thrift.MessageType.REPLY, requestId);
|
|
422
|
+
exports.IsMyGuardianEnabled__ResultCodec.encode(result, output);
|
|
423
|
+
output.writeMessageEnd();
|
|
424
|
+
return output.flush();
|
|
425
|
+
}).catch((err) => {
|
|
426
|
+
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
|
427
|
+
output.writeMessageBegin("isMyGuardianEnabled", thrift.MessageType.EXCEPTION, requestId);
|
|
428
|
+
thrift.TApplicationExceptionCodec.encode(result, output);
|
|
429
|
+
output.writeMessageEnd();
|
|
430
|
+
return output.flush();
|
|
431
|
+
});
|
|
432
|
+
}
|
|
251
433
|
}
|
|
252
434
|
exports.Processor = Processor;
|
|
253
435
|
Processor.serviceName = exports.serviceName;
|
package/Tag.d.ts
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as thrift from "@creditkarma/thrift-server-core";
|
|
3
|
+
import * as Topic from "./Topic";
|
|
4
|
+
export declare const serviceName: string;
|
|
5
|
+
export declare const annotations: thrift.IThriftAnnotations;
|
|
6
|
+
export declare const methodAnnotations: thrift.IMethodAnnotations;
|
|
7
|
+
export declare const methodNames: Array<string>;
|
|
8
|
+
export declare const methodParameters: {
|
|
9
|
+
[methodName: string]: number;
|
|
10
|
+
};
|
|
11
|
+
export interface IFollow__Args {
|
|
12
|
+
topic: Topic.ITopic;
|
|
13
|
+
}
|
|
14
|
+
export interface IFollow__ArgsArgs {
|
|
15
|
+
topic: Topic.ITopicArgs;
|
|
16
|
+
}
|
|
17
|
+
export declare const Follow__ArgsCodec: thrift.IStructCodec<IFollow__ArgsArgs, IFollow__Args>;
|
|
18
|
+
export declare class Follow__Args extends thrift.StructLike implements IFollow__Args {
|
|
19
|
+
topic: Topic.ITopic;
|
|
20
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
21
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
22
|
+
constructor(args: IFollow__ArgsArgs);
|
|
23
|
+
static read(input: thrift.TProtocol): Follow__Args;
|
|
24
|
+
static write(args: IFollow__ArgsArgs, output: thrift.TProtocol): void;
|
|
25
|
+
write(output: thrift.TProtocol): void;
|
|
26
|
+
}
|
|
27
|
+
export interface IUnfollow__Args {
|
|
28
|
+
topic: Topic.ITopic;
|
|
29
|
+
}
|
|
30
|
+
export interface IUnfollow__ArgsArgs {
|
|
31
|
+
topic: Topic.ITopicArgs;
|
|
32
|
+
}
|
|
33
|
+
export declare const Unfollow__ArgsCodec: thrift.IStructCodec<IUnfollow__ArgsArgs, IUnfollow__Args>;
|
|
34
|
+
export declare class Unfollow__Args extends thrift.StructLike implements IUnfollow__Args {
|
|
35
|
+
topic: Topic.ITopic;
|
|
36
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
37
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
38
|
+
constructor(args: IUnfollow__ArgsArgs);
|
|
39
|
+
static read(input: thrift.TProtocol): Unfollow__Args;
|
|
40
|
+
static write(args: IUnfollow__ArgsArgs, output: thrift.TProtocol): void;
|
|
41
|
+
write(output: thrift.TProtocol): void;
|
|
42
|
+
}
|
|
43
|
+
export interface IIsFollowing__Args {
|
|
44
|
+
topic: Topic.ITopic;
|
|
45
|
+
}
|
|
46
|
+
export interface IIsFollowing__ArgsArgs {
|
|
47
|
+
topic: Topic.ITopicArgs;
|
|
48
|
+
}
|
|
49
|
+
export declare const IsFollowing__ArgsCodec: thrift.IStructCodec<IIsFollowing__ArgsArgs, IIsFollowing__Args>;
|
|
50
|
+
export declare class IsFollowing__Args extends thrift.StructLike implements IIsFollowing__Args {
|
|
51
|
+
topic: Topic.ITopic;
|
|
52
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
53
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
54
|
+
constructor(args: IIsFollowing__ArgsArgs);
|
|
55
|
+
static read(input: thrift.TProtocol): IsFollowing__Args;
|
|
56
|
+
static write(args: IIsFollowing__ArgsArgs, output: thrift.TProtocol): void;
|
|
57
|
+
write(output: thrift.TProtocol): void;
|
|
58
|
+
}
|
|
59
|
+
export interface IFollow__Result {
|
|
60
|
+
success?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export interface IFollow__ResultArgs {
|
|
63
|
+
success?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export declare const Follow__ResultCodec: thrift.IStructCodec<IFollow__ResultArgs, IFollow__Result>;
|
|
66
|
+
export declare class Follow__Result extends thrift.StructLike implements IFollow__Result {
|
|
67
|
+
success?: boolean;
|
|
68
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
69
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
70
|
+
constructor(args?: IFollow__ResultArgs);
|
|
71
|
+
static read(input: thrift.TProtocol): Follow__Result;
|
|
72
|
+
static write(args: IFollow__ResultArgs, output: thrift.TProtocol): void;
|
|
73
|
+
write(output: thrift.TProtocol): void;
|
|
74
|
+
}
|
|
75
|
+
export interface IUnfollow__Result {
|
|
76
|
+
success?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface IUnfollow__ResultArgs {
|
|
79
|
+
success?: boolean;
|
|
80
|
+
}
|
|
81
|
+
export declare const Unfollow__ResultCodec: thrift.IStructCodec<IUnfollow__ResultArgs, IUnfollow__Result>;
|
|
82
|
+
export declare class Unfollow__Result extends thrift.StructLike implements IUnfollow__Result {
|
|
83
|
+
success?: boolean;
|
|
84
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
85
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
86
|
+
constructor(args?: IUnfollow__ResultArgs);
|
|
87
|
+
static read(input: thrift.TProtocol): Unfollow__Result;
|
|
88
|
+
static write(args: IUnfollow__ResultArgs, output: thrift.TProtocol): void;
|
|
89
|
+
write(output: thrift.TProtocol): void;
|
|
90
|
+
}
|
|
91
|
+
export interface IIsFollowing__Result {
|
|
92
|
+
success?: boolean;
|
|
93
|
+
}
|
|
94
|
+
export interface IIsFollowing__ResultArgs {
|
|
95
|
+
success?: boolean;
|
|
96
|
+
}
|
|
97
|
+
export declare const IsFollowing__ResultCodec: thrift.IStructCodec<IIsFollowing__ResultArgs, IIsFollowing__Result>;
|
|
98
|
+
export declare class IsFollowing__Result extends thrift.StructLike implements IIsFollowing__Result {
|
|
99
|
+
success?: boolean;
|
|
100
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
101
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
102
|
+
constructor(args?: IIsFollowing__ResultArgs);
|
|
103
|
+
static read(input: thrift.TProtocol): IsFollowing__Result;
|
|
104
|
+
static write(args: IIsFollowing__ResultArgs, output: thrift.TProtocol): void;
|
|
105
|
+
write(output: thrift.TProtocol): void;
|
|
106
|
+
}
|
|
107
|
+
export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
|
|
108
|
+
static readonly serviceName: string;
|
|
109
|
+
static readonly annotations: thrift.IThriftAnnotations;
|
|
110
|
+
static readonly methodAnnotations: thrift.IMethodAnnotations;
|
|
111
|
+
static readonly methodNames: Array<string>;
|
|
112
|
+
readonly _serviceName: string;
|
|
113
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
114
|
+
readonly _methodAnnotations: thrift.IMethodAnnotations;
|
|
115
|
+
readonly _methodNames: Array<string>;
|
|
116
|
+
readonly _methodParameters?: {
|
|
117
|
+
[methodName: string]: number;
|
|
118
|
+
};
|
|
119
|
+
follow(topic: Topic.ITopicArgs, context?: Context): Promise<boolean>;
|
|
120
|
+
unfollow(topic: Topic.ITopicArgs, context?: Context): Promise<boolean>;
|
|
121
|
+
isFollowing(topic: Topic.ITopicArgs, context?: Context): Promise<boolean>;
|
|
122
|
+
}
|
|
123
|
+
export interface IHandler<Context = any> {
|
|
124
|
+
follow(topic: Topic.ITopic, context?: Context): boolean | Promise<boolean>;
|
|
125
|
+
unfollow(topic: Topic.ITopic, context?: Context): boolean | Promise<boolean>;
|
|
126
|
+
isFollowing(topic: Topic.ITopic, context?: Context): boolean | Promise<boolean>;
|
|
127
|
+
}
|
|
128
|
+
export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
|
|
129
|
+
protected readonly _handler: IHandler<Context>;
|
|
130
|
+
static readonly serviceName: string;
|
|
131
|
+
static readonly annotations: thrift.IThriftAnnotations;
|
|
132
|
+
static readonly methodAnnotations: thrift.IMethodAnnotations;
|
|
133
|
+
static readonly methodNames: Array<string>;
|
|
134
|
+
readonly _serviceName: string;
|
|
135
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
136
|
+
readonly _methodAnnotations: thrift.IMethodAnnotations;
|
|
137
|
+
readonly _methodNames: Array<string>;
|
|
138
|
+
constructor(handler: IHandler<Context>);
|
|
139
|
+
process(input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
140
|
+
process_follow(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
141
|
+
process_unfollow(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
142
|
+
process_isFollowing(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
143
|
+
}
|
package/Tag.js
ADDED
|
@@ -0,0 +1,729 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
+
if (mod && mod.__esModule) return mod;
|
|
4
|
+
var result = {};
|
|
5
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
+
result["default"] = mod;
|
|
7
|
+
return result;
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
/* tslint:disable */
|
|
11
|
+
/* eslint-disable */
|
|
12
|
+
/*
|
|
13
|
+
* Autogenerated by @creditkarma/thrift-typescript v3.7.6
|
|
14
|
+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
15
|
+
*/
|
|
16
|
+
const thrift = __importStar(require("@creditkarma/thrift-server-core"));
|
|
17
|
+
const Topic = __importStar(require("./Topic"));
|
|
18
|
+
exports.serviceName = "Tag";
|
|
19
|
+
exports.annotations = {};
|
|
20
|
+
exports.methodAnnotations = {
|
|
21
|
+
follow: {
|
|
22
|
+
annotations: {},
|
|
23
|
+
fieldAnnotations: {}
|
|
24
|
+
},
|
|
25
|
+
unfollow: {
|
|
26
|
+
annotations: {},
|
|
27
|
+
fieldAnnotations: {}
|
|
28
|
+
},
|
|
29
|
+
isFollowing: {
|
|
30
|
+
annotations: {},
|
|
31
|
+
fieldAnnotations: {}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.methodNames = ["follow", "unfollow", "isFollowing"];
|
|
35
|
+
exports.methodParameters = {
|
|
36
|
+
follow: 2,
|
|
37
|
+
unfollow: 2,
|
|
38
|
+
isFollowing: 2
|
|
39
|
+
};
|
|
40
|
+
exports.Follow__ArgsCodec = {
|
|
41
|
+
encode(args, output) {
|
|
42
|
+
const obj = {
|
|
43
|
+
topic: args.topic
|
|
44
|
+
};
|
|
45
|
+
output.writeStructBegin("Follow__Args");
|
|
46
|
+
if (obj.topic != null) {
|
|
47
|
+
output.writeFieldBegin("topic", thrift.TType.STRUCT, 1);
|
|
48
|
+
Topic.TopicCodec.encode(obj.topic, output);
|
|
49
|
+
output.writeFieldEnd();
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[topic] is unset!");
|
|
53
|
+
}
|
|
54
|
+
output.writeFieldStop();
|
|
55
|
+
output.writeStructEnd();
|
|
56
|
+
return;
|
|
57
|
+
},
|
|
58
|
+
decode(input) {
|
|
59
|
+
let _args = {};
|
|
60
|
+
input.readStructBegin();
|
|
61
|
+
while (true) {
|
|
62
|
+
const ret = input.readFieldBegin();
|
|
63
|
+
const fieldType = ret.fieldType;
|
|
64
|
+
const fieldId = ret.fieldId;
|
|
65
|
+
if (fieldType === thrift.TType.STOP) {
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
switch (fieldId) {
|
|
69
|
+
case 1:
|
|
70
|
+
if (fieldType === thrift.TType.STRUCT) {
|
|
71
|
+
const value_1 = Topic.TopicCodec.decode(input);
|
|
72
|
+
_args.topic = value_1;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
input.skip(fieldType);
|
|
76
|
+
}
|
|
77
|
+
break;
|
|
78
|
+
default: {
|
|
79
|
+
input.skip(fieldType);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
input.readFieldEnd();
|
|
83
|
+
}
|
|
84
|
+
input.readStructEnd();
|
|
85
|
+
if (_args.topic !== undefined) {
|
|
86
|
+
return {
|
|
87
|
+
topic: _args.topic
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read Follow__Args from input");
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
class Follow__Args extends thrift.StructLike {
|
|
96
|
+
constructor(args) {
|
|
97
|
+
super();
|
|
98
|
+
this._annotations = {};
|
|
99
|
+
this._fieldAnnotations = {};
|
|
100
|
+
if (args.topic != null) {
|
|
101
|
+
const value_2 = new Topic.Topic(args.topic);
|
|
102
|
+
this.topic = value_2;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[topic] is unset!");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
static read(input) {
|
|
109
|
+
return new Follow__Args(exports.Follow__ArgsCodec.decode(input));
|
|
110
|
+
}
|
|
111
|
+
static write(args, output) {
|
|
112
|
+
return exports.Follow__ArgsCodec.encode(args, output);
|
|
113
|
+
}
|
|
114
|
+
write(output) {
|
|
115
|
+
return exports.Follow__ArgsCodec.encode(this, output);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.Follow__Args = Follow__Args;
|
|
119
|
+
exports.Unfollow__ArgsCodec = {
|
|
120
|
+
encode(args, output) {
|
|
121
|
+
const obj = {
|
|
122
|
+
topic: args.topic
|
|
123
|
+
};
|
|
124
|
+
output.writeStructBegin("Unfollow__Args");
|
|
125
|
+
if (obj.topic != null) {
|
|
126
|
+
output.writeFieldBegin("topic", thrift.TType.STRUCT, 1);
|
|
127
|
+
Topic.TopicCodec.encode(obj.topic, output);
|
|
128
|
+
output.writeFieldEnd();
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[topic] is unset!");
|
|
132
|
+
}
|
|
133
|
+
output.writeFieldStop();
|
|
134
|
+
output.writeStructEnd();
|
|
135
|
+
return;
|
|
136
|
+
},
|
|
137
|
+
decode(input) {
|
|
138
|
+
let _args = {};
|
|
139
|
+
input.readStructBegin();
|
|
140
|
+
while (true) {
|
|
141
|
+
const ret = input.readFieldBegin();
|
|
142
|
+
const fieldType = ret.fieldType;
|
|
143
|
+
const fieldId = ret.fieldId;
|
|
144
|
+
if (fieldType === thrift.TType.STOP) {
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
switch (fieldId) {
|
|
148
|
+
case 1:
|
|
149
|
+
if (fieldType === thrift.TType.STRUCT) {
|
|
150
|
+
const value_3 = Topic.TopicCodec.decode(input);
|
|
151
|
+
_args.topic = value_3;
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
input.skip(fieldType);
|
|
155
|
+
}
|
|
156
|
+
break;
|
|
157
|
+
default: {
|
|
158
|
+
input.skip(fieldType);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
input.readFieldEnd();
|
|
162
|
+
}
|
|
163
|
+
input.readStructEnd();
|
|
164
|
+
if (_args.topic !== undefined) {
|
|
165
|
+
return {
|
|
166
|
+
topic: _args.topic
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read Unfollow__Args from input");
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
class Unfollow__Args extends thrift.StructLike {
|
|
175
|
+
constructor(args) {
|
|
176
|
+
super();
|
|
177
|
+
this._annotations = {};
|
|
178
|
+
this._fieldAnnotations = {};
|
|
179
|
+
if (args.topic != null) {
|
|
180
|
+
const value_4 = new Topic.Topic(args.topic);
|
|
181
|
+
this.topic = value_4;
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[topic] is unset!");
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
static read(input) {
|
|
188
|
+
return new Unfollow__Args(exports.Unfollow__ArgsCodec.decode(input));
|
|
189
|
+
}
|
|
190
|
+
static write(args, output) {
|
|
191
|
+
return exports.Unfollow__ArgsCodec.encode(args, output);
|
|
192
|
+
}
|
|
193
|
+
write(output) {
|
|
194
|
+
return exports.Unfollow__ArgsCodec.encode(this, output);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
exports.Unfollow__Args = Unfollow__Args;
|
|
198
|
+
exports.IsFollowing__ArgsCodec = {
|
|
199
|
+
encode(args, output) {
|
|
200
|
+
const obj = {
|
|
201
|
+
topic: args.topic
|
|
202
|
+
};
|
|
203
|
+
output.writeStructBegin("IsFollowing__Args");
|
|
204
|
+
if (obj.topic != null) {
|
|
205
|
+
output.writeFieldBegin("topic", thrift.TType.STRUCT, 1);
|
|
206
|
+
Topic.TopicCodec.encode(obj.topic, output);
|
|
207
|
+
output.writeFieldEnd();
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[topic] is unset!");
|
|
211
|
+
}
|
|
212
|
+
output.writeFieldStop();
|
|
213
|
+
output.writeStructEnd();
|
|
214
|
+
return;
|
|
215
|
+
},
|
|
216
|
+
decode(input) {
|
|
217
|
+
let _args = {};
|
|
218
|
+
input.readStructBegin();
|
|
219
|
+
while (true) {
|
|
220
|
+
const ret = input.readFieldBegin();
|
|
221
|
+
const fieldType = ret.fieldType;
|
|
222
|
+
const fieldId = ret.fieldId;
|
|
223
|
+
if (fieldType === thrift.TType.STOP) {
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
switch (fieldId) {
|
|
227
|
+
case 1:
|
|
228
|
+
if (fieldType === thrift.TType.STRUCT) {
|
|
229
|
+
const value_5 = Topic.TopicCodec.decode(input);
|
|
230
|
+
_args.topic = value_5;
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
input.skip(fieldType);
|
|
234
|
+
}
|
|
235
|
+
break;
|
|
236
|
+
default: {
|
|
237
|
+
input.skip(fieldType);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
input.readFieldEnd();
|
|
241
|
+
}
|
|
242
|
+
input.readStructEnd();
|
|
243
|
+
if (_args.topic !== undefined) {
|
|
244
|
+
return {
|
|
245
|
+
topic: _args.topic
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read IsFollowing__Args from input");
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
class IsFollowing__Args extends thrift.StructLike {
|
|
254
|
+
constructor(args) {
|
|
255
|
+
super();
|
|
256
|
+
this._annotations = {};
|
|
257
|
+
this._fieldAnnotations = {};
|
|
258
|
+
if (args.topic != null) {
|
|
259
|
+
const value_6 = new Topic.Topic(args.topic);
|
|
260
|
+
this.topic = value_6;
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[topic] is unset!");
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
static read(input) {
|
|
267
|
+
return new IsFollowing__Args(exports.IsFollowing__ArgsCodec.decode(input));
|
|
268
|
+
}
|
|
269
|
+
static write(args, output) {
|
|
270
|
+
return exports.IsFollowing__ArgsCodec.encode(args, output);
|
|
271
|
+
}
|
|
272
|
+
write(output) {
|
|
273
|
+
return exports.IsFollowing__ArgsCodec.encode(this, output);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
exports.IsFollowing__Args = IsFollowing__Args;
|
|
277
|
+
exports.Follow__ResultCodec = {
|
|
278
|
+
encode(args, output) {
|
|
279
|
+
const obj = {
|
|
280
|
+
success: args.success
|
|
281
|
+
};
|
|
282
|
+
output.writeStructBegin("Follow__Result");
|
|
283
|
+
if (obj.success != null) {
|
|
284
|
+
output.writeFieldBegin("success", thrift.TType.BOOL, 0);
|
|
285
|
+
output.writeBool(obj.success);
|
|
286
|
+
output.writeFieldEnd();
|
|
287
|
+
}
|
|
288
|
+
output.writeFieldStop();
|
|
289
|
+
output.writeStructEnd();
|
|
290
|
+
return;
|
|
291
|
+
},
|
|
292
|
+
decode(input) {
|
|
293
|
+
let _args = {};
|
|
294
|
+
input.readStructBegin();
|
|
295
|
+
while (true) {
|
|
296
|
+
const ret = input.readFieldBegin();
|
|
297
|
+
const fieldType = ret.fieldType;
|
|
298
|
+
const fieldId = ret.fieldId;
|
|
299
|
+
if (fieldType === thrift.TType.STOP) {
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
switch (fieldId) {
|
|
303
|
+
case 0:
|
|
304
|
+
if (fieldType === thrift.TType.BOOL) {
|
|
305
|
+
const value_7 = input.readBool();
|
|
306
|
+
_args.success = value_7;
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
input.skip(fieldType);
|
|
310
|
+
}
|
|
311
|
+
break;
|
|
312
|
+
default: {
|
|
313
|
+
input.skip(fieldType);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
input.readFieldEnd();
|
|
317
|
+
}
|
|
318
|
+
input.readStructEnd();
|
|
319
|
+
return {
|
|
320
|
+
success: _args.success
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
class Follow__Result extends thrift.StructLike {
|
|
325
|
+
constructor(args = {}) {
|
|
326
|
+
super();
|
|
327
|
+
this._annotations = {};
|
|
328
|
+
this._fieldAnnotations = {};
|
|
329
|
+
if (args.success != null) {
|
|
330
|
+
const value_8 = args.success;
|
|
331
|
+
this.success = value_8;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
static read(input) {
|
|
335
|
+
return new Follow__Result(exports.Follow__ResultCodec.decode(input));
|
|
336
|
+
}
|
|
337
|
+
static write(args, output) {
|
|
338
|
+
return exports.Follow__ResultCodec.encode(args, output);
|
|
339
|
+
}
|
|
340
|
+
write(output) {
|
|
341
|
+
return exports.Follow__ResultCodec.encode(this, output);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
exports.Follow__Result = Follow__Result;
|
|
345
|
+
exports.Unfollow__ResultCodec = {
|
|
346
|
+
encode(args, output) {
|
|
347
|
+
const obj = {
|
|
348
|
+
success: args.success
|
|
349
|
+
};
|
|
350
|
+
output.writeStructBegin("Unfollow__Result");
|
|
351
|
+
if (obj.success != null) {
|
|
352
|
+
output.writeFieldBegin("success", thrift.TType.BOOL, 0);
|
|
353
|
+
output.writeBool(obj.success);
|
|
354
|
+
output.writeFieldEnd();
|
|
355
|
+
}
|
|
356
|
+
output.writeFieldStop();
|
|
357
|
+
output.writeStructEnd();
|
|
358
|
+
return;
|
|
359
|
+
},
|
|
360
|
+
decode(input) {
|
|
361
|
+
let _args = {};
|
|
362
|
+
input.readStructBegin();
|
|
363
|
+
while (true) {
|
|
364
|
+
const ret = input.readFieldBegin();
|
|
365
|
+
const fieldType = ret.fieldType;
|
|
366
|
+
const fieldId = ret.fieldId;
|
|
367
|
+
if (fieldType === thrift.TType.STOP) {
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
switch (fieldId) {
|
|
371
|
+
case 0:
|
|
372
|
+
if (fieldType === thrift.TType.BOOL) {
|
|
373
|
+
const value_9 = input.readBool();
|
|
374
|
+
_args.success = value_9;
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
input.skip(fieldType);
|
|
378
|
+
}
|
|
379
|
+
break;
|
|
380
|
+
default: {
|
|
381
|
+
input.skip(fieldType);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
input.readFieldEnd();
|
|
385
|
+
}
|
|
386
|
+
input.readStructEnd();
|
|
387
|
+
return {
|
|
388
|
+
success: _args.success
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
class Unfollow__Result extends thrift.StructLike {
|
|
393
|
+
constructor(args = {}) {
|
|
394
|
+
super();
|
|
395
|
+
this._annotations = {};
|
|
396
|
+
this._fieldAnnotations = {};
|
|
397
|
+
if (args.success != null) {
|
|
398
|
+
const value_10 = args.success;
|
|
399
|
+
this.success = value_10;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
static read(input) {
|
|
403
|
+
return new Unfollow__Result(exports.Unfollow__ResultCodec.decode(input));
|
|
404
|
+
}
|
|
405
|
+
static write(args, output) {
|
|
406
|
+
return exports.Unfollow__ResultCodec.encode(args, output);
|
|
407
|
+
}
|
|
408
|
+
write(output) {
|
|
409
|
+
return exports.Unfollow__ResultCodec.encode(this, output);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
exports.Unfollow__Result = Unfollow__Result;
|
|
413
|
+
exports.IsFollowing__ResultCodec = {
|
|
414
|
+
encode(args, output) {
|
|
415
|
+
const obj = {
|
|
416
|
+
success: args.success
|
|
417
|
+
};
|
|
418
|
+
output.writeStructBegin("IsFollowing__Result");
|
|
419
|
+
if (obj.success != null) {
|
|
420
|
+
output.writeFieldBegin("success", thrift.TType.BOOL, 0);
|
|
421
|
+
output.writeBool(obj.success);
|
|
422
|
+
output.writeFieldEnd();
|
|
423
|
+
}
|
|
424
|
+
output.writeFieldStop();
|
|
425
|
+
output.writeStructEnd();
|
|
426
|
+
return;
|
|
427
|
+
},
|
|
428
|
+
decode(input) {
|
|
429
|
+
let _args = {};
|
|
430
|
+
input.readStructBegin();
|
|
431
|
+
while (true) {
|
|
432
|
+
const ret = input.readFieldBegin();
|
|
433
|
+
const fieldType = ret.fieldType;
|
|
434
|
+
const fieldId = ret.fieldId;
|
|
435
|
+
if (fieldType === thrift.TType.STOP) {
|
|
436
|
+
break;
|
|
437
|
+
}
|
|
438
|
+
switch (fieldId) {
|
|
439
|
+
case 0:
|
|
440
|
+
if (fieldType === thrift.TType.BOOL) {
|
|
441
|
+
const value_11 = input.readBool();
|
|
442
|
+
_args.success = value_11;
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
input.skip(fieldType);
|
|
446
|
+
}
|
|
447
|
+
break;
|
|
448
|
+
default: {
|
|
449
|
+
input.skip(fieldType);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
input.readFieldEnd();
|
|
453
|
+
}
|
|
454
|
+
input.readStructEnd();
|
|
455
|
+
return {
|
|
456
|
+
success: _args.success
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
class IsFollowing__Result extends thrift.StructLike {
|
|
461
|
+
constructor(args = {}) {
|
|
462
|
+
super();
|
|
463
|
+
this._annotations = {};
|
|
464
|
+
this._fieldAnnotations = {};
|
|
465
|
+
if (args.success != null) {
|
|
466
|
+
const value_12 = args.success;
|
|
467
|
+
this.success = value_12;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
static read(input) {
|
|
471
|
+
return new IsFollowing__Result(exports.IsFollowing__ResultCodec.decode(input));
|
|
472
|
+
}
|
|
473
|
+
static write(args, output) {
|
|
474
|
+
return exports.IsFollowing__ResultCodec.encode(args, output);
|
|
475
|
+
}
|
|
476
|
+
write(output) {
|
|
477
|
+
return exports.IsFollowing__ResultCodec.encode(this, output);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
exports.IsFollowing__Result = IsFollowing__Result;
|
|
481
|
+
class Client extends thrift.ThriftClient {
|
|
482
|
+
constructor() {
|
|
483
|
+
super(...arguments);
|
|
484
|
+
this._serviceName = exports.serviceName;
|
|
485
|
+
this._annotations = exports.annotations;
|
|
486
|
+
this._methodAnnotations = exports.methodAnnotations;
|
|
487
|
+
this._methodNames = exports.methodNames;
|
|
488
|
+
this._methodParameters = exports.methodParameters;
|
|
489
|
+
}
|
|
490
|
+
follow(topic, context) {
|
|
491
|
+
const writer = new this.transport();
|
|
492
|
+
const output = new this.protocol(writer);
|
|
493
|
+
output.writeMessageBegin("follow", thrift.MessageType.CALL, this.incrementRequestId());
|
|
494
|
+
const args = { topic };
|
|
495
|
+
exports.Follow__ArgsCodec.encode(args, output);
|
|
496
|
+
output.writeMessageEnd();
|
|
497
|
+
return this.connection.send(writer.flush(), context).then((data) => {
|
|
498
|
+
const reader = this.transport.receiver(data);
|
|
499
|
+
const input = new this.protocol(reader);
|
|
500
|
+
try {
|
|
501
|
+
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
|
|
502
|
+
if (fieldName === "follow") {
|
|
503
|
+
if (messageType === thrift.MessageType.EXCEPTION) {
|
|
504
|
+
const err = thrift.TApplicationExceptionCodec.decode(input);
|
|
505
|
+
input.readMessageEnd();
|
|
506
|
+
return Promise.reject(err);
|
|
507
|
+
}
|
|
508
|
+
else {
|
|
509
|
+
const result = exports.Follow__ResultCodec.decode(input);
|
|
510
|
+
input.readMessageEnd();
|
|
511
|
+
if (result.success != null) {
|
|
512
|
+
return Promise.resolve(result.success);
|
|
513
|
+
}
|
|
514
|
+
else {
|
|
515
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "follow failed: unknown result"));
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
catch (err) {
|
|
524
|
+
return Promise.reject(err);
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
unfollow(topic, context) {
|
|
529
|
+
const writer = new this.transport();
|
|
530
|
+
const output = new this.protocol(writer);
|
|
531
|
+
output.writeMessageBegin("unfollow", thrift.MessageType.CALL, this.incrementRequestId());
|
|
532
|
+
const args = { topic };
|
|
533
|
+
exports.Unfollow__ArgsCodec.encode(args, output);
|
|
534
|
+
output.writeMessageEnd();
|
|
535
|
+
return this.connection.send(writer.flush(), context).then((data) => {
|
|
536
|
+
const reader = this.transport.receiver(data);
|
|
537
|
+
const input = new this.protocol(reader);
|
|
538
|
+
try {
|
|
539
|
+
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
|
|
540
|
+
if (fieldName === "unfollow") {
|
|
541
|
+
if (messageType === thrift.MessageType.EXCEPTION) {
|
|
542
|
+
const err = thrift.TApplicationExceptionCodec.decode(input);
|
|
543
|
+
input.readMessageEnd();
|
|
544
|
+
return Promise.reject(err);
|
|
545
|
+
}
|
|
546
|
+
else {
|
|
547
|
+
const result = exports.Unfollow__ResultCodec.decode(input);
|
|
548
|
+
input.readMessageEnd();
|
|
549
|
+
if (result.success != null) {
|
|
550
|
+
return Promise.resolve(result.success);
|
|
551
|
+
}
|
|
552
|
+
else {
|
|
553
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "unfollow failed: unknown result"));
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
else {
|
|
558
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
catch (err) {
|
|
562
|
+
return Promise.reject(err);
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
isFollowing(topic, context) {
|
|
567
|
+
const writer = new this.transport();
|
|
568
|
+
const output = new this.protocol(writer);
|
|
569
|
+
output.writeMessageBegin("isFollowing", thrift.MessageType.CALL, this.incrementRequestId());
|
|
570
|
+
const args = { topic };
|
|
571
|
+
exports.IsFollowing__ArgsCodec.encode(args, output);
|
|
572
|
+
output.writeMessageEnd();
|
|
573
|
+
return this.connection.send(writer.flush(), context).then((data) => {
|
|
574
|
+
const reader = this.transport.receiver(data);
|
|
575
|
+
const input = new this.protocol(reader);
|
|
576
|
+
try {
|
|
577
|
+
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
|
|
578
|
+
if (fieldName === "isFollowing") {
|
|
579
|
+
if (messageType === thrift.MessageType.EXCEPTION) {
|
|
580
|
+
const err = thrift.TApplicationExceptionCodec.decode(input);
|
|
581
|
+
input.readMessageEnd();
|
|
582
|
+
return Promise.reject(err);
|
|
583
|
+
}
|
|
584
|
+
else {
|
|
585
|
+
const result = exports.IsFollowing__ResultCodec.decode(input);
|
|
586
|
+
input.readMessageEnd();
|
|
587
|
+
if (result.success != null) {
|
|
588
|
+
return Promise.resolve(result.success);
|
|
589
|
+
}
|
|
590
|
+
else {
|
|
591
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "isFollowing failed: unknown result"));
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
else {
|
|
596
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
catch (err) {
|
|
600
|
+
return Promise.reject(err);
|
|
601
|
+
}
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
exports.Client = Client;
|
|
606
|
+
Client.serviceName = exports.serviceName;
|
|
607
|
+
Client.annotations = exports.annotations;
|
|
608
|
+
Client.methodAnnotations = exports.methodAnnotations;
|
|
609
|
+
Client.methodNames = exports.methodNames;
|
|
610
|
+
class Processor extends thrift.ThriftProcessor {
|
|
611
|
+
constructor(handler) {
|
|
612
|
+
super();
|
|
613
|
+
this._serviceName = exports.serviceName;
|
|
614
|
+
this._annotations = exports.annotations;
|
|
615
|
+
this._methodAnnotations = exports.methodAnnotations;
|
|
616
|
+
this._methodNames = exports.methodNames;
|
|
617
|
+
this._handler = handler;
|
|
618
|
+
}
|
|
619
|
+
process(input, output, context) {
|
|
620
|
+
return new Promise((resolve, reject) => {
|
|
621
|
+
const metadata = input.readMessageBegin();
|
|
622
|
+
const fieldName = metadata.fieldName;
|
|
623
|
+
const requestId = metadata.requestId;
|
|
624
|
+
const methodName = "process_" + fieldName;
|
|
625
|
+
switch (methodName) {
|
|
626
|
+
case "process_follow": {
|
|
627
|
+
resolve(this.process_follow(requestId, input, output, context));
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
case "process_unfollow": {
|
|
631
|
+
resolve(this.process_unfollow(requestId, input, output, context));
|
|
632
|
+
break;
|
|
633
|
+
}
|
|
634
|
+
case "process_isFollowing": {
|
|
635
|
+
resolve(this.process_isFollowing(requestId, input, output, context));
|
|
636
|
+
break;
|
|
637
|
+
}
|
|
638
|
+
default: {
|
|
639
|
+
input.skip(thrift.TType.STRUCT);
|
|
640
|
+
input.readMessageEnd();
|
|
641
|
+
const errMessage = "Unknown function " + fieldName;
|
|
642
|
+
const err = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN_METHOD, errMessage);
|
|
643
|
+
output.writeMessageBegin(fieldName, thrift.MessageType.EXCEPTION, requestId);
|
|
644
|
+
thrift.TApplicationExceptionCodec.encode(err, output);
|
|
645
|
+
output.writeMessageEnd();
|
|
646
|
+
resolve(output.flush());
|
|
647
|
+
break;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
process_follow(requestId, input, output, context) {
|
|
653
|
+
return new Promise((resolve, reject) => {
|
|
654
|
+
try {
|
|
655
|
+
const args = exports.Follow__ArgsCodec.decode(input);
|
|
656
|
+
input.readMessageEnd();
|
|
657
|
+
resolve(this._handler.follow(args.topic, context));
|
|
658
|
+
}
|
|
659
|
+
catch (err) {
|
|
660
|
+
reject(err);
|
|
661
|
+
}
|
|
662
|
+
}).then((data) => {
|
|
663
|
+
const result = { success: data };
|
|
664
|
+
output.writeMessageBegin("follow", thrift.MessageType.REPLY, requestId);
|
|
665
|
+
exports.Follow__ResultCodec.encode(result, output);
|
|
666
|
+
output.writeMessageEnd();
|
|
667
|
+
return output.flush();
|
|
668
|
+
}).catch((err) => {
|
|
669
|
+
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
|
670
|
+
output.writeMessageBegin("follow", thrift.MessageType.EXCEPTION, requestId);
|
|
671
|
+
thrift.TApplicationExceptionCodec.encode(result, output);
|
|
672
|
+
output.writeMessageEnd();
|
|
673
|
+
return output.flush();
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
process_unfollow(requestId, input, output, context) {
|
|
677
|
+
return new Promise((resolve, reject) => {
|
|
678
|
+
try {
|
|
679
|
+
const args = exports.Unfollow__ArgsCodec.decode(input);
|
|
680
|
+
input.readMessageEnd();
|
|
681
|
+
resolve(this._handler.unfollow(args.topic, context));
|
|
682
|
+
}
|
|
683
|
+
catch (err) {
|
|
684
|
+
reject(err);
|
|
685
|
+
}
|
|
686
|
+
}).then((data) => {
|
|
687
|
+
const result = { success: data };
|
|
688
|
+
output.writeMessageBegin("unfollow", thrift.MessageType.REPLY, requestId);
|
|
689
|
+
exports.Unfollow__ResultCodec.encode(result, output);
|
|
690
|
+
output.writeMessageEnd();
|
|
691
|
+
return output.flush();
|
|
692
|
+
}).catch((err) => {
|
|
693
|
+
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
|
694
|
+
output.writeMessageBegin("unfollow", thrift.MessageType.EXCEPTION, requestId);
|
|
695
|
+
thrift.TApplicationExceptionCodec.encode(result, output);
|
|
696
|
+
output.writeMessageEnd();
|
|
697
|
+
return output.flush();
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
process_isFollowing(requestId, input, output, context) {
|
|
701
|
+
return new Promise((resolve, reject) => {
|
|
702
|
+
try {
|
|
703
|
+
const args = exports.IsFollowing__ArgsCodec.decode(input);
|
|
704
|
+
input.readMessageEnd();
|
|
705
|
+
resolve(this._handler.isFollowing(args.topic, context));
|
|
706
|
+
}
|
|
707
|
+
catch (err) {
|
|
708
|
+
reject(err);
|
|
709
|
+
}
|
|
710
|
+
}).then((data) => {
|
|
711
|
+
const result = { success: data };
|
|
712
|
+
output.writeMessageBegin("isFollowing", thrift.MessageType.REPLY, requestId);
|
|
713
|
+
exports.IsFollowing__ResultCodec.encode(result, output);
|
|
714
|
+
output.writeMessageEnd();
|
|
715
|
+
return output.flush();
|
|
716
|
+
}).catch((err) => {
|
|
717
|
+
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
|
718
|
+
output.writeMessageBegin("isFollowing", thrift.MessageType.EXCEPTION, requestId);
|
|
719
|
+
thrift.TApplicationExceptionCodec.encode(result, output);
|
|
720
|
+
output.writeMessageEnd();
|
|
721
|
+
return output.flush();
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
exports.Processor = Processor;
|
|
726
|
+
Processor.serviceName = exports.serviceName;
|
|
727
|
+
Processor.annotations = exports.annotations;
|
|
728
|
+
Processor.methodAnnotations = exports.methodAnnotations;
|
|
729
|
+
Processor.methodNames = exports.methodNames;
|
package/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ import * as Commercial from "./Commercial";
|
|
|
16
16
|
export { Commercial as Commercial };
|
|
17
17
|
import * as Acquisitions from "./Acquisitions";
|
|
18
18
|
export { Acquisitions as Acquisitions };
|
|
19
|
+
import * as Tag from "./Tag";
|
|
20
|
+
export { Tag as Tag };
|
|
19
21
|
import * as Notifications from "./Notifications";
|
|
20
22
|
export { Notifications as Notifications };
|
|
21
23
|
import * as User from "./User";
|
package/index.js
CHANGED
|
@@ -34,6 +34,8 @@ const Commercial = __importStar(require("./Commercial"));
|
|
|
34
34
|
exports.Commercial = Commercial;
|
|
35
35
|
const Acquisitions = __importStar(require("./Acquisitions"));
|
|
36
36
|
exports.Acquisitions = Acquisitions;
|
|
37
|
+
const Tag = __importStar(require("./Tag"));
|
|
38
|
+
exports.Tag = Tag;
|
|
37
39
|
const Notifications = __importStar(require("./Notifications"));
|
|
38
40
|
exports.Notifications = Notifications;
|
|
39
41
|
const User = __importStar(require("./User"));
|