@guardian/bridget 8.3.3 → 8.5.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 +185 -3
- package/Interactives.d.ts +71 -0
- package/Interactives.js +273 -0
- package/ListenToArticle.d.ts +178 -0
- package/ListenToArticle.js +963 -0
- package/NativePlatform.d.ts +4 -0
- package/NativePlatform.js +14 -0
- package/index.d.ts +5 -0
- package/index.js +6 -1
- package/package.json +1 -1
package/Environment.d.ts
CHANGED
|
@@ -34,6 +34,19 @@ export declare class IsMyGuardianEnabled__Args extends thrift.StructLike impleme
|
|
|
34
34
|
static write(args: IIsMyGuardianEnabled__ArgsArgs, output: thrift.TProtocol): void;
|
|
35
35
|
write(output: thrift.TProtocol): void;
|
|
36
36
|
}
|
|
37
|
+
export interface IIsListenToArticleEnabled__Args {
|
|
38
|
+
}
|
|
39
|
+
export interface IIsListenToArticleEnabled__ArgsArgs {
|
|
40
|
+
}
|
|
41
|
+
export declare const IsListenToArticleEnabled__ArgsCodec: thrift.IStructCodec<IIsListenToArticleEnabled__ArgsArgs, IIsListenToArticleEnabled__Args>;
|
|
42
|
+
export declare class IsListenToArticleEnabled__Args extends thrift.StructLike implements IIsListenToArticleEnabled__Args {
|
|
43
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
44
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
45
|
+
constructor(args?: IIsListenToArticleEnabled__ArgsArgs);
|
|
46
|
+
static read(input: thrift.TProtocol): IsListenToArticleEnabled__Args;
|
|
47
|
+
static write(args: IIsListenToArticleEnabled__ArgsArgs, output: thrift.TProtocol): void;
|
|
48
|
+
write(output: thrift.TProtocol): void;
|
|
49
|
+
}
|
|
37
50
|
export interface INativeThriftPackageVersion__Result {
|
|
38
51
|
success?: string;
|
|
39
52
|
}
|
|
@@ -66,6 +79,22 @@ export declare class IsMyGuardianEnabled__Result extends thrift.StructLike imple
|
|
|
66
79
|
static write(args: IIsMyGuardianEnabled__ResultArgs, output: thrift.TProtocol): void;
|
|
67
80
|
write(output: thrift.TProtocol): void;
|
|
68
81
|
}
|
|
82
|
+
export interface IIsListenToArticleEnabled__Result {
|
|
83
|
+
success?: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface IIsListenToArticleEnabled__ResultArgs {
|
|
86
|
+
success?: boolean;
|
|
87
|
+
}
|
|
88
|
+
export declare const IsListenToArticleEnabled__ResultCodec: thrift.IStructCodec<IIsListenToArticleEnabled__ResultArgs, IIsListenToArticleEnabled__Result>;
|
|
89
|
+
export declare class IsListenToArticleEnabled__Result extends thrift.StructLike implements IIsListenToArticleEnabled__Result {
|
|
90
|
+
success?: boolean;
|
|
91
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
92
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
93
|
+
constructor(args?: IIsListenToArticleEnabled__ResultArgs);
|
|
94
|
+
static read(input: thrift.TProtocol): IsListenToArticleEnabled__Result;
|
|
95
|
+
static write(args: IIsListenToArticleEnabled__ResultArgs, output: thrift.TProtocol): void;
|
|
96
|
+
write(output: thrift.TProtocol): void;
|
|
97
|
+
}
|
|
69
98
|
export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
|
|
70
99
|
static readonly serviceName: string;
|
|
71
100
|
static readonly annotations: thrift.IThriftAnnotations;
|
|
@@ -80,10 +109,12 @@ export declare class Client<Context = any> extends thrift.ThriftClient<Context>
|
|
|
80
109
|
};
|
|
81
110
|
nativeThriftPackageVersion(context?: Context): Promise<string>;
|
|
82
111
|
isMyGuardianEnabled(context?: Context): Promise<boolean>;
|
|
112
|
+
isListenToArticleEnabled(context?: Context): Promise<boolean>;
|
|
83
113
|
}
|
|
84
114
|
export interface IHandler<Context = any> {
|
|
85
115
|
nativeThriftPackageVersion(context?: Context): string | Promise<string>;
|
|
86
116
|
isMyGuardianEnabled(context?: Context): boolean | Promise<boolean>;
|
|
117
|
+
isListenToArticleEnabled(context?: Context): boolean | Promise<boolean>;
|
|
87
118
|
}
|
|
88
119
|
export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
|
|
89
120
|
protected readonly _handler: IHandler<Context>;
|
|
@@ -99,4 +130,5 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Con
|
|
|
99
130
|
process(input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
100
131
|
process_nativeThriftPackageVersion(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
101
132
|
process_isMyGuardianEnabled(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
133
|
+
process_isListenToArticleEnabled(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
102
134
|
}
|
package/Environment.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Processor = exports.Client = exports.IsMyGuardianEnabled__Result = exports.IsMyGuardianEnabled__ResultCodec = exports.NativeThriftPackageVersion__Result = exports.NativeThriftPackageVersion__ResultCodec = exports.IsMyGuardianEnabled__Args = exports.IsMyGuardianEnabled__ArgsCodec = exports.NativeThriftPackageVersion__Args = exports.NativeThriftPackageVersion__ArgsCodec = exports.methodParameters = exports.methodNames = exports.methodAnnotations = exports.annotations = exports.serviceName = void 0;
|
|
26
|
+
exports.Processor = exports.Client = exports.IsListenToArticleEnabled__Result = exports.IsListenToArticleEnabled__ResultCodec = exports.IsMyGuardianEnabled__Result = exports.IsMyGuardianEnabled__ResultCodec = exports.NativeThriftPackageVersion__Result = exports.NativeThriftPackageVersion__ResultCodec = exports.IsListenToArticleEnabled__Args = exports.IsListenToArticleEnabled__ArgsCodec = exports.IsMyGuardianEnabled__Args = exports.IsMyGuardianEnabled__ArgsCodec = exports.NativeThriftPackageVersion__Args = exports.NativeThriftPackageVersion__ArgsCodec = exports.methodParameters = exports.methodNames = exports.methodAnnotations = exports.annotations = exports.serviceName = void 0;
|
|
27
27
|
/* tslint:disable */
|
|
28
28
|
/* eslint-disable */
|
|
29
29
|
/*
|
|
@@ -41,12 +41,17 @@ exports.methodAnnotations = {
|
|
|
41
41
|
isMyGuardianEnabled: {
|
|
42
42
|
annotations: {},
|
|
43
43
|
fieldAnnotations: {}
|
|
44
|
+
},
|
|
45
|
+
isListenToArticleEnabled: {
|
|
46
|
+
annotations: {},
|
|
47
|
+
fieldAnnotations: {}
|
|
44
48
|
}
|
|
45
49
|
};
|
|
46
|
-
exports.methodNames = ["nativeThriftPackageVersion", "isMyGuardianEnabled"];
|
|
50
|
+
exports.methodNames = ["nativeThriftPackageVersion", "isMyGuardianEnabled", "isListenToArticleEnabled"];
|
|
47
51
|
exports.methodParameters = {
|
|
48
52
|
nativeThriftPackageVersion: 1,
|
|
49
|
-
isMyGuardianEnabled: 1
|
|
53
|
+
isMyGuardianEnabled: 1,
|
|
54
|
+
isListenToArticleEnabled: 1
|
|
50
55
|
};
|
|
51
56
|
exports.NativeThriftPackageVersion__ArgsCodec = {
|
|
52
57
|
encode(args, output) {
|
|
@@ -136,6 +141,50 @@ class IsMyGuardianEnabled__Args extends thrift.StructLike {
|
|
|
136
141
|
}
|
|
137
142
|
}
|
|
138
143
|
exports.IsMyGuardianEnabled__Args = IsMyGuardianEnabled__Args;
|
|
144
|
+
exports.IsListenToArticleEnabled__ArgsCodec = {
|
|
145
|
+
encode(args, output) {
|
|
146
|
+
output.writeStructBegin("IsListenToArticleEnabled__Args");
|
|
147
|
+
output.writeFieldStop();
|
|
148
|
+
output.writeStructEnd();
|
|
149
|
+
return;
|
|
150
|
+
},
|
|
151
|
+
decode(input) {
|
|
152
|
+
input.readStructBegin();
|
|
153
|
+
while (true) {
|
|
154
|
+
const ret = input.readFieldBegin();
|
|
155
|
+
const fieldType = ret.fieldType;
|
|
156
|
+
const fieldId = ret.fieldId;
|
|
157
|
+
if (fieldType === thrift.TType.STOP) {
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
switch (fieldId) {
|
|
161
|
+
default: {
|
|
162
|
+
input.skip(fieldType);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
input.readFieldEnd();
|
|
166
|
+
}
|
|
167
|
+
input.readStructEnd();
|
|
168
|
+
return {};
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
class IsListenToArticleEnabled__Args extends thrift.StructLike {
|
|
172
|
+
constructor(args = {}) {
|
|
173
|
+
super();
|
|
174
|
+
this._annotations = {};
|
|
175
|
+
this._fieldAnnotations = {};
|
|
176
|
+
}
|
|
177
|
+
static read(input) {
|
|
178
|
+
return new IsListenToArticleEnabled__Args(exports.IsListenToArticleEnabled__ArgsCodec.decode(input));
|
|
179
|
+
}
|
|
180
|
+
static write(args, output) {
|
|
181
|
+
return exports.IsListenToArticleEnabled__ArgsCodec.encode(args, output);
|
|
182
|
+
}
|
|
183
|
+
write(output) {
|
|
184
|
+
return exports.IsListenToArticleEnabled__ArgsCodec.encode(this, output);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.IsListenToArticleEnabled__Args = IsListenToArticleEnabled__Args;
|
|
139
188
|
exports.NativeThriftPackageVersion__ResultCodec = {
|
|
140
189
|
encode(args, output) {
|
|
141
190
|
const obj = {
|
|
@@ -272,6 +321,74 @@ class IsMyGuardianEnabled__Result extends thrift.StructLike {
|
|
|
272
321
|
}
|
|
273
322
|
}
|
|
274
323
|
exports.IsMyGuardianEnabled__Result = IsMyGuardianEnabled__Result;
|
|
324
|
+
exports.IsListenToArticleEnabled__ResultCodec = {
|
|
325
|
+
encode(args, output) {
|
|
326
|
+
const obj = {
|
|
327
|
+
success: args.success
|
|
328
|
+
};
|
|
329
|
+
output.writeStructBegin("IsListenToArticleEnabled__Result");
|
|
330
|
+
if (obj.success != null) {
|
|
331
|
+
output.writeFieldBegin("success", thrift.TType.BOOL, 0);
|
|
332
|
+
output.writeBool(obj.success);
|
|
333
|
+
output.writeFieldEnd();
|
|
334
|
+
}
|
|
335
|
+
output.writeFieldStop();
|
|
336
|
+
output.writeStructEnd();
|
|
337
|
+
return;
|
|
338
|
+
},
|
|
339
|
+
decode(input) {
|
|
340
|
+
let _args = {};
|
|
341
|
+
input.readStructBegin();
|
|
342
|
+
while (true) {
|
|
343
|
+
const ret = input.readFieldBegin();
|
|
344
|
+
const fieldType = ret.fieldType;
|
|
345
|
+
const fieldId = ret.fieldId;
|
|
346
|
+
if (fieldType === thrift.TType.STOP) {
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
switch (fieldId) {
|
|
350
|
+
case 0:
|
|
351
|
+
if (fieldType === thrift.TType.BOOL) {
|
|
352
|
+
const value_5 = input.readBool();
|
|
353
|
+
_args.success = value_5;
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
input.skip(fieldType);
|
|
357
|
+
}
|
|
358
|
+
break;
|
|
359
|
+
default: {
|
|
360
|
+
input.skip(fieldType);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
input.readFieldEnd();
|
|
364
|
+
}
|
|
365
|
+
input.readStructEnd();
|
|
366
|
+
return {
|
|
367
|
+
success: _args.success
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
class IsListenToArticleEnabled__Result extends thrift.StructLike {
|
|
372
|
+
constructor(args = {}) {
|
|
373
|
+
super();
|
|
374
|
+
this._annotations = {};
|
|
375
|
+
this._fieldAnnotations = {};
|
|
376
|
+
if (args.success != null) {
|
|
377
|
+
const value_6 = args.success;
|
|
378
|
+
this.success = value_6;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
static read(input) {
|
|
382
|
+
return new IsListenToArticleEnabled__Result(exports.IsListenToArticleEnabled__ResultCodec.decode(input));
|
|
383
|
+
}
|
|
384
|
+
static write(args, output) {
|
|
385
|
+
return exports.IsListenToArticleEnabled__ResultCodec.encode(args, output);
|
|
386
|
+
}
|
|
387
|
+
write(output) {
|
|
388
|
+
return exports.IsListenToArticleEnabled__ResultCodec.encode(this, output);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
exports.IsListenToArticleEnabled__Result = IsListenToArticleEnabled__Result;
|
|
275
392
|
class Client extends thrift.ThriftClient {
|
|
276
393
|
constructor() {
|
|
277
394
|
super(...arguments);
|
|
@@ -357,6 +474,44 @@ class Client extends thrift.ThriftClient {
|
|
|
357
474
|
}
|
|
358
475
|
});
|
|
359
476
|
}
|
|
477
|
+
isListenToArticleEnabled(context) {
|
|
478
|
+
const writer = new this.transport();
|
|
479
|
+
const output = new this.protocol(writer);
|
|
480
|
+
output.writeMessageBegin("isListenToArticleEnabled", thrift.MessageType.CALL, this.incrementRequestId());
|
|
481
|
+
const args = {};
|
|
482
|
+
exports.IsListenToArticleEnabled__ArgsCodec.encode(args, output);
|
|
483
|
+
output.writeMessageEnd();
|
|
484
|
+
return this.connection.send(writer.flush(), context).then((data) => {
|
|
485
|
+
const reader = this.transport.receiver(data);
|
|
486
|
+
const input = new this.protocol(reader);
|
|
487
|
+
try {
|
|
488
|
+
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
|
|
489
|
+
if (fieldName === "isListenToArticleEnabled") {
|
|
490
|
+
if (messageType === thrift.MessageType.EXCEPTION) {
|
|
491
|
+
const err = thrift.TApplicationExceptionCodec.decode(input);
|
|
492
|
+
input.readMessageEnd();
|
|
493
|
+
return Promise.reject(err);
|
|
494
|
+
}
|
|
495
|
+
else {
|
|
496
|
+
const result = exports.IsListenToArticleEnabled__ResultCodec.decode(input);
|
|
497
|
+
input.readMessageEnd();
|
|
498
|
+
if (result.success != null) {
|
|
499
|
+
return Promise.resolve(result.success);
|
|
500
|
+
}
|
|
501
|
+
else {
|
|
502
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "isListenToArticleEnabled failed: unknown result"));
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
507
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
catch (err) {
|
|
511
|
+
return Promise.reject(err);
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
}
|
|
360
515
|
}
|
|
361
516
|
exports.Client = Client;
|
|
362
517
|
Client.serviceName = exports.serviceName;
|
|
@@ -387,6 +542,10 @@ class Processor extends thrift.ThriftProcessor {
|
|
|
387
542
|
resolve(this.process_isMyGuardianEnabled(requestId, input, output, context));
|
|
388
543
|
break;
|
|
389
544
|
}
|
|
545
|
+
case "process_isListenToArticleEnabled": {
|
|
546
|
+
resolve(this.process_isListenToArticleEnabled(requestId, input, output, context));
|
|
547
|
+
break;
|
|
548
|
+
}
|
|
390
549
|
default: {
|
|
391
550
|
input.skip(thrift.TType.STRUCT);
|
|
392
551
|
input.readMessageEnd();
|
|
@@ -447,6 +606,29 @@ class Processor extends thrift.ThriftProcessor {
|
|
|
447
606
|
return output.flush();
|
|
448
607
|
});
|
|
449
608
|
}
|
|
609
|
+
process_isListenToArticleEnabled(requestId, input, output, context) {
|
|
610
|
+
return new Promise((resolve, reject) => {
|
|
611
|
+
try {
|
|
612
|
+
input.readMessageEnd();
|
|
613
|
+
resolve(this._handler.isListenToArticleEnabled(context));
|
|
614
|
+
}
|
|
615
|
+
catch (err) {
|
|
616
|
+
reject(err);
|
|
617
|
+
}
|
|
618
|
+
}).then((data) => {
|
|
619
|
+
const result = { success: data };
|
|
620
|
+
output.writeMessageBegin("isListenToArticleEnabled", thrift.MessageType.REPLY, requestId);
|
|
621
|
+
exports.IsListenToArticleEnabled__ResultCodec.encode(result, output);
|
|
622
|
+
output.writeMessageEnd();
|
|
623
|
+
return output.flush();
|
|
624
|
+
}).catch((err) => {
|
|
625
|
+
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
|
626
|
+
output.writeMessageBegin("isListenToArticleEnabled", thrift.MessageType.EXCEPTION, requestId);
|
|
627
|
+
thrift.TApplicationExceptionCodec.encode(result, output);
|
|
628
|
+
output.writeMessageEnd();
|
|
629
|
+
return output.flush();
|
|
630
|
+
});
|
|
631
|
+
}
|
|
450
632
|
}
|
|
451
633
|
exports.Processor = Processor;
|
|
452
634
|
Processor.serviceName = exports.serviceName;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import * as thrift from "@creditkarma/thrift-server-core";
|
|
4
|
+
import * as NativePlatform from "./NativePlatform";
|
|
5
|
+
export declare const serviceName: string;
|
|
6
|
+
export declare const annotations: thrift.IThriftAnnotations;
|
|
7
|
+
export declare const methodAnnotations: thrift.IMethodAnnotations;
|
|
8
|
+
export declare const methodNames: Array<string>;
|
|
9
|
+
export declare const methodParameters: {
|
|
10
|
+
[methodName: string]: number;
|
|
11
|
+
};
|
|
12
|
+
export interface IGetNativePlatform__Args {
|
|
13
|
+
}
|
|
14
|
+
export interface IGetNativePlatform__ArgsArgs {
|
|
15
|
+
}
|
|
16
|
+
export declare const GetNativePlatform__ArgsCodec: thrift.IStructCodec<IGetNativePlatform__ArgsArgs, IGetNativePlatform__Args>;
|
|
17
|
+
export declare class GetNativePlatform__Args extends thrift.StructLike implements IGetNativePlatform__Args {
|
|
18
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
19
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
20
|
+
constructor(args?: IGetNativePlatform__ArgsArgs);
|
|
21
|
+
static read(input: thrift.TProtocol): GetNativePlatform__Args;
|
|
22
|
+
static write(args: IGetNativePlatform__ArgsArgs, output: thrift.TProtocol): void;
|
|
23
|
+
write(output: thrift.TProtocol): void;
|
|
24
|
+
}
|
|
25
|
+
export interface IGetNativePlatform__Result {
|
|
26
|
+
success?: NativePlatform.NativePlatform;
|
|
27
|
+
}
|
|
28
|
+
export interface IGetNativePlatform__ResultArgs {
|
|
29
|
+
success?: NativePlatform.NativePlatform;
|
|
30
|
+
}
|
|
31
|
+
export declare const GetNativePlatform__ResultCodec: thrift.IStructCodec<IGetNativePlatform__ResultArgs, IGetNativePlatform__Result>;
|
|
32
|
+
export declare class GetNativePlatform__Result extends thrift.StructLike implements IGetNativePlatform__Result {
|
|
33
|
+
success?: NativePlatform.NativePlatform;
|
|
34
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
35
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
36
|
+
constructor(args?: IGetNativePlatform__ResultArgs);
|
|
37
|
+
static read(input: thrift.TProtocol): GetNativePlatform__Result;
|
|
38
|
+
static write(args: IGetNativePlatform__ResultArgs, output: thrift.TProtocol): void;
|
|
39
|
+
write(output: thrift.TProtocol): void;
|
|
40
|
+
}
|
|
41
|
+
export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
|
|
42
|
+
static readonly serviceName: string;
|
|
43
|
+
static readonly annotations: thrift.IThriftAnnotations;
|
|
44
|
+
static readonly methodAnnotations: thrift.IMethodAnnotations;
|
|
45
|
+
static readonly methodNames: Array<string>;
|
|
46
|
+
readonly _serviceName: string;
|
|
47
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
48
|
+
readonly _methodAnnotations: thrift.IMethodAnnotations;
|
|
49
|
+
readonly _methodNames: Array<string>;
|
|
50
|
+
readonly _methodParameters?: {
|
|
51
|
+
[methodName: string]: number;
|
|
52
|
+
};
|
|
53
|
+
getNativePlatform(context?: Context): Promise<NativePlatform.NativePlatform>;
|
|
54
|
+
}
|
|
55
|
+
export interface IHandler<Context = any> {
|
|
56
|
+
getNativePlatform(context?: Context): NativePlatform.NativePlatform | Promise<NativePlatform.NativePlatform>;
|
|
57
|
+
}
|
|
58
|
+
export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
|
|
59
|
+
protected readonly _handler: IHandler<Context>;
|
|
60
|
+
static readonly serviceName: string;
|
|
61
|
+
static readonly annotations: thrift.IThriftAnnotations;
|
|
62
|
+
static readonly methodAnnotations: thrift.IMethodAnnotations;
|
|
63
|
+
static readonly methodNames: Array<string>;
|
|
64
|
+
readonly _serviceName: string;
|
|
65
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
66
|
+
readonly _methodAnnotations: thrift.IMethodAnnotations;
|
|
67
|
+
readonly _methodNames: Array<string>;
|
|
68
|
+
constructor(handler: IHandler<Context>);
|
|
69
|
+
process(input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
70
|
+
process_getNativePlatform(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
71
|
+
}
|
package/Interactives.js
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Processor = exports.Client = exports.GetNativePlatform__Result = exports.GetNativePlatform__ResultCodec = exports.GetNativePlatform__Args = exports.GetNativePlatform__ArgsCodec = exports.methodParameters = exports.methodNames = exports.methodAnnotations = exports.annotations = exports.serviceName = void 0;
|
|
27
|
+
/* tslint:disable */
|
|
28
|
+
/* eslint-disable */
|
|
29
|
+
/*
|
|
30
|
+
* Autogenerated by @creditkarma/thrift-typescript v3.7.6
|
|
31
|
+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
32
|
+
*/
|
|
33
|
+
const thrift = __importStar(require("@creditkarma/thrift-server-core"));
|
|
34
|
+
exports.serviceName = "Interactives";
|
|
35
|
+
exports.annotations = {};
|
|
36
|
+
exports.methodAnnotations = {
|
|
37
|
+
getNativePlatform: {
|
|
38
|
+
annotations: {},
|
|
39
|
+
fieldAnnotations: {}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.methodNames = ["getNativePlatform"];
|
|
43
|
+
exports.methodParameters = {
|
|
44
|
+
getNativePlatform: 1
|
|
45
|
+
};
|
|
46
|
+
exports.GetNativePlatform__ArgsCodec = {
|
|
47
|
+
encode(args, output) {
|
|
48
|
+
output.writeStructBegin("GetNativePlatform__Args");
|
|
49
|
+
output.writeFieldStop();
|
|
50
|
+
output.writeStructEnd();
|
|
51
|
+
return;
|
|
52
|
+
},
|
|
53
|
+
decode(input) {
|
|
54
|
+
input.readStructBegin();
|
|
55
|
+
while (true) {
|
|
56
|
+
const ret = input.readFieldBegin();
|
|
57
|
+
const fieldType = ret.fieldType;
|
|
58
|
+
const fieldId = ret.fieldId;
|
|
59
|
+
if (fieldType === thrift.TType.STOP) {
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
switch (fieldId) {
|
|
63
|
+
default: {
|
|
64
|
+
input.skip(fieldType);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
input.readFieldEnd();
|
|
68
|
+
}
|
|
69
|
+
input.readStructEnd();
|
|
70
|
+
return {};
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
class GetNativePlatform__Args extends thrift.StructLike {
|
|
74
|
+
constructor(args = {}) {
|
|
75
|
+
super();
|
|
76
|
+
this._annotations = {};
|
|
77
|
+
this._fieldAnnotations = {};
|
|
78
|
+
}
|
|
79
|
+
static read(input) {
|
|
80
|
+
return new GetNativePlatform__Args(exports.GetNativePlatform__ArgsCodec.decode(input));
|
|
81
|
+
}
|
|
82
|
+
static write(args, output) {
|
|
83
|
+
return exports.GetNativePlatform__ArgsCodec.encode(args, output);
|
|
84
|
+
}
|
|
85
|
+
write(output) {
|
|
86
|
+
return exports.GetNativePlatform__ArgsCodec.encode(this, output);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.GetNativePlatform__Args = GetNativePlatform__Args;
|
|
90
|
+
exports.GetNativePlatform__ResultCodec = {
|
|
91
|
+
encode(args, output) {
|
|
92
|
+
const obj = {
|
|
93
|
+
success: args.success
|
|
94
|
+
};
|
|
95
|
+
output.writeStructBegin("GetNativePlatform__Result");
|
|
96
|
+
if (obj.success != null) {
|
|
97
|
+
output.writeFieldBegin("success", thrift.TType.I32, 0);
|
|
98
|
+
output.writeI32(obj.success);
|
|
99
|
+
output.writeFieldEnd();
|
|
100
|
+
}
|
|
101
|
+
output.writeFieldStop();
|
|
102
|
+
output.writeStructEnd();
|
|
103
|
+
return;
|
|
104
|
+
},
|
|
105
|
+
decode(input) {
|
|
106
|
+
let _args = {};
|
|
107
|
+
input.readStructBegin();
|
|
108
|
+
while (true) {
|
|
109
|
+
const ret = input.readFieldBegin();
|
|
110
|
+
const fieldType = ret.fieldType;
|
|
111
|
+
const fieldId = ret.fieldId;
|
|
112
|
+
if (fieldType === thrift.TType.STOP) {
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
switch (fieldId) {
|
|
116
|
+
case 0:
|
|
117
|
+
if (fieldType === thrift.TType.I32) {
|
|
118
|
+
const value_1 = input.readI32();
|
|
119
|
+
_args.success = value_1;
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
input.skip(fieldType);
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
125
|
+
default: {
|
|
126
|
+
input.skip(fieldType);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
input.readFieldEnd();
|
|
130
|
+
}
|
|
131
|
+
input.readStructEnd();
|
|
132
|
+
return {
|
|
133
|
+
success: _args.success
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
class GetNativePlatform__Result extends thrift.StructLike {
|
|
138
|
+
constructor(args = {}) {
|
|
139
|
+
super();
|
|
140
|
+
this._annotations = {};
|
|
141
|
+
this._fieldAnnotations = {};
|
|
142
|
+
if (args.success != null) {
|
|
143
|
+
const value_2 = args.success;
|
|
144
|
+
this.success = value_2;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
static read(input) {
|
|
148
|
+
return new GetNativePlatform__Result(exports.GetNativePlatform__ResultCodec.decode(input));
|
|
149
|
+
}
|
|
150
|
+
static write(args, output) {
|
|
151
|
+
return exports.GetNativePlatform__ResultCodec.encode(args, output);
|
|
152
|
+
}
|
|
153
|
+
write(output) {
|
|
154
|
+
return exports.GetNativePlatform__ResultCodec.encode(this, output);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
exports.GetNativePlatform__Result = GetNativePlatform__Result;
|
|
158
|
+
class Client extends thrift.ThriftClient {
|
|
159
|
+
constructor() {
|
|
160
|
+
super(...arguments);
|
|
161
|
+
this._serviceName = exports.serviceName;
|
|
162
|
+
this._annotations = exports.annotations;
|
|
163
|
+
this._methodAnnotations = exports.methodAnnotations;
|
|
164
|
+
this._methodNames = exports.methodNames;
|
|
165
|
+
this._methodParameters = exports.methodParameters;
|
|
166
|
+
}
|
|
167
|
+
getNativePlatform(context) {
|
|
168
|
+
const writer = new this.transport();
|
|
169
|
+
const output = new this.protocol(writer);
|
|
170
|
+
output.writeMessageBegin("getNativePlatform", thrift.MessageType.CALL, this.incrementRequestId());
|
|
171
|
+
const args = {};
|
|
172
|
+
exports.GetNativePlatform__ArgsCodec.encode(args, output);
|
|
173
|
+
output.writeMessageEnd();
|
|
174
|
+
return this.connection.send(writer.flush(), context).then((data) => {
|
|
175
|
+
const reader = this.transport.receiver(data);
|
|
176
|
+
const input = new this.protocol(reader);
|
|
177
|
+
try {
|
|
178
|
+
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
|
|
179
|
+
if (fieldName === "getNativePlatform") {
|
|
180
|
+
if (messageType === thrift.MessageType.EXCEPTION) {
|
|
181
|
+
const err = thrift.TApplicationExceptionCodec.decode(input);
|
|
182
|
+
input.readMessageEnd();
|
|
183
|
+
return Promise.reject(err);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
const result = exports.GetNativePlatform__ResultCodec.decode(input);
|
|
187
|
+
input.readMessageEnd();
|
|
188
|
+
if (result.success != null) {
|
|
189
|
+
return Promise.resolve(result.success);
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "getNativePlatform failed: unknown result"));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
catch (err) {
|
|
201
|
+
return Promise.reject(err);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
exports.Client = Client;
|
|
207
|
+
Client.serviceName = exports.serviceName;
|
|
208
|
+
Client.annotations = exports.annotations;
|
|
209
|
+
Client.methodAnnotations = exports.methodAnnotations;
|
|
210
|
+
Client.methodNames = exports.methodNames;
|
|
211
|
+
class Processor extends thrift.ThriftProcessor {
|
|
212
|
+
constructor(handler) {
|
|
213
|
+
super();
|
|
214
|
+
this._serviceName = exports.serviceName;
|
|
215
|
+
this._annotations = exports.annotations;
|
|
216
|
+
this._methodAnnotations = exports.methodAnnotations;
|
|
217
|
+
this._methodNames = exports.methodNames;
|
|
218
|
+
this._handler = handler;
|
|
219
|
+
}
|
|
220
|
+
process(input, output, context) {
|
|
221
|
+
return new Promise((resolve, reject) => {
|
|
222
|
+
const metadata = input.readMessageBegin();
|
|
223
|
+
const fieldName = metadata.fieldName;
|
|
224
|
+
const requestId = metadata.requestId;
|
|
225
|
+
const methodName = "process_" + fieldName;
|
|
226
|
+
switch (methodName) {
|
|
227
|
+
case "process_getNativePlatform": {
|
|
228
|
+
resolve(this.process_getNativePlatform(requestId, input, output, context));
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
default: {
|
|
232
|
+
input.skip(thrift.TType.STRUCT);
|
|
233
|
+
input.readMessageEnd();
|
|
234
|
+
const errMessage = "Unknown function " + fieldName;
|
|
235
|
+
const err = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN_METHOD, errMessage);
|
|
236
|
+
output.writeMessageBegin(fieldName, thrift.MessageType.EXCEPTION, requestId);
|
|
237
|
+
thrift.TApplicationExceptionCodec.encode(err, output);
|
|
238
|
+
output.writeMessageEnd();
|
|
239
|
+
resolve(output.flush());
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
process_getNativePlatform(requestId, input, output, context) {
|
|
246
|
+
return new Promise((resolve, reject) => {
|
|
247
|
+
try {
|
|
248
|
+
input.readMessageEnd();
|
|
249
|
+
resolve(this._handler.getNativePlatform(context));
|
|
250
|
+
}
|
|
251
|
+
catch (err) {
|
|
252
|
+
reject(err);
|
|
253
|
+
}
|
|
254
|
+
}).then((data) => {
|
|
255
|
+
const result = { success: data };
|
|
256
|
+
output.writeMessageBegin("getNativePlatform", thrift.MessageType.REPLY, requestId);
|
|
257
|
+
exports.GetNativePlatform__ResultCodec.encode(result, output);
|
|
258
|
+
output.writeMessageEnd();
|
|
259
|
+
return output.flush();
|
|
260
|
+
}).catch((err) => {
|
|
261
|
+
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
|
262
|
+
output.writeMessageBegin("getNativePlatform", thrift.MessageType.EXCEPTION, requestId);
|
|
263
|
+
thrift.TApplicationExceptionCodec.encode(result, output);
|
|
264
|
+
output.writeMessageEnd();
|
|
265
|
+
return output.flush();
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
exports.Processor = Processor;
|
|
270
|
+
Processor.serviceName = exports.serviceName;
|
|
271
|
+
Processor.annotations = exports.annotations;
|
|
272
|
+
Processor.methodAnnotations = exports.methodAnnotations;
|
|
273
|
+
Processor.methodNames = exports.methodNames;
|