@guardian/bridget 8.4.0 → 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/ListenToArticle.d.ts +178 -0
- package/ListenToArticle.js +963 -0
- package/index.d.ts +2 -0
- package/index.js +3 -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,178 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import * as thrift from "@creditkarma/thrift-server-core";
|
|
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 IIsAvailable__Args {
|
|
12
|
+
articleId: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IIsAvailable__ArgsArgs {
|
|
15
|
+
articleId: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const IsAvailable__ArgsCodec: thrift.IStructCodec<IIsAvailable__ArgsArgs, IIsAvailable__Args>;
|
|
18
|
+
export declare class IsAvailable__Args extends thrift.StructLike implements IIsAvailable__Args {
|
|
19
|
+
articleId: string;
|
|
20
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
21
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
22
|
+
constructor(args: IIsAvailable__ArgsArgs);
|
|
23
|
+
static read(input: thrift.TProtocol): IsAvailable__Args;
|
|
24
|
+
static write(args: IIsAvailable__ArgsArgs, output: thrift.TProtocol): void;
|
|
25
|
+
write(output: thrift.TProtocol): void;
|
|
26
|
+
}
|
|
27
|
+
export interface IPlay__Args {
|
|
28
|
+
articleId: string;
|
|
29
|
+
}
|
|
30
|
+
export interface IPlay__ArgsArgs {
|
|
31
|
+
articleId: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const Play__ArgsCodec: thrift.IStructCodec<IPlay__ArgsArgs, IPlay__Args>;
|
|
34
|
+
export declare class Play__Args extends thrift.StructLike implements IPlay__Args {
|
|
35
|
+
articleId: string;
|
|
36
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
37
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
38
|
+
constructor(args: IPlay__ArgsArgs);
|
|
39
|
+
static read(input: thrift.TProtocol): Play__Args;
|
|
40
|
+
static write(args: IPlay__ArgsArgs, output: thrift.TProtocol): void;
|
|
41
|
+
write(output: thrift.TProtocol): void;
|
|
42
|
+
}
|
|
43
|
+
export interface IIsPlaying__Args {
|
|
44
|
+
articleId: string;
|
|
45
|
+
}
|
|
46
|
+
export interface IIsPlaying__ArgsArgs {
|
|
47
|
+
articleId: string;
|
|
48
|
+
}
|
|
49
|
+
export declare const IsPlaying__ArgsCodec: thrift.IStructCodec<IIsPlaying__ArgsArgs, IIsPlaying__Args>;
|
|
50
|
+
export declare class IsPlaying__Args extends thrift.StructLike implements IIsPlaying__Args {
|
|
51
|
+
articleId: string;
|
|
52
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
53
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
54
|
+
constructor(args: IIsPlaying__ArgsArgs);
|
|
55
|
+
static read(input: thrift.TProtocol): IsPlaying__Args;
|
|
56
|
+
static write(args: IIsPlaying__ArgsArgs, output: thrift.TProtocol): void;
|
|
57
|
+
write(output: thrift.TProtocol): void;
|
|
58
|
+
}
|
|
59
|
+
export interface IPause__Args {
|
|
60
|
+
articleId: string;
|
|
61
|
+
}
|
|
62
|
+
export interface IPause__ArgsArgs {
|
|
63
|
+
articleId: string;
|
|
64
|
+
}
|
|
65
|
+
export declare const Pause__ArgsCodec: thrift.IStructCodec<IPause__ArgsArgs, IPause__Args>;
|
|
66
|
+
export declare class Pause__Args extends thrift.StructLike implements IPause__Args {
|
|
67
|
+
articleId: string;
|
|
68
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
69
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
70
|
+
constructor(args: IPause__ArgsArgs);
|
|
71
|
+
static read(input: thrift.TProtocol): Pause__Args;
|
|
72
|
+
static write(args: IPause__ArgsArgs, output: thrift.TProtocol): void;
|
|
73
|
+
write(output: thrift.TProtocol): void;
|
|
74
|
+
}
|
|
75
|
+
export interface IIsAvailable__Result {
|
|
76
|
+
success?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface IIsAvailable__ResultArgs {
|
|
79
|
+
success?: boolean;
|
|
80
|
+
}
|
|
81
|
+
export declare const IsAvailable__ResultCodec: thrift.IStructCodec<IIsAvailable__ResultArgs, IIsAvailable__Result>;
|
|
82
|
+
export declare class IsAvailable__Result extends thrift.StructLike implements IIsAvailable__Result {
|
|
83
|
+
success?: boolean;
|
|
84
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
85
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
86
|
+
constructor(args?: IIsAvailable__ResultArgs);
|
|
87
|
+
static read(input: thrift.TProtocol): IsAvailable__Result;
|
|
88
|
+
static write(args: IIsAvailable__ResultArgs, output: thrift.TProtocol): void;
|
|
89
|
+
write(output: thrift.TProtocol): void;
|
|
90
|
+
}
|
|
91
|
+
export interface IPlay__Result {
|
|
92
|
+
success?: boolean;
|
|
93
|
+
}
|
|
94
|
+
export interface IPlay__ResultArgs {
|
|
95
|
+
success?: boolean;
|
|
96
|
+
}
|
|
97
|
+
export declare const Play__ResultCodec: thrift.IStructCodec<IPlay__ResultArgs, IPlay__Result>;
|
|
98
|
+
export declare class Play__Result extends thrift.StructLike implements IPlay__Result {
|
|
99
|
+
success?: boolean;
|
|
100
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
101
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
102
|
+
constructor(args?: IPlay__ResultArgs);
|
|
103
|
+
static read(input: thrift.TProtocol): Play__Result;
|
|
104
|
+
static write(args: IPlay__ResultArgs, output: thrift.TProtocol): void;
|
|
105
|
+
write(output: thrift.TProtocol): void;
|
|
106
|
+
}
|
|
107
|
+
export interface IIsPlaying__Result {
|
|
108
|
+
success?: boolean;
|
|
109
|
+
}
|
|
110
|
+
export interface IIsPlaying__ResultArgs {
|
|
111
|
+
success?: boolean;
|
|
112
|
+
}
|
|
113
|
+
export declare const IsPlaying__ResultCodec: thrift.IStructCodec<IIsPlaying__ResultArgs, IIsPlaying__Result>;
|
|
114
|
+
export declare class IsPlaying__Result extends thrift.StructLike implements IIsPlaying__Result {
|
|
115
|
+
success?: boolean;
|
|
116
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
117
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
118
|
+
constructor(args?: IIsPlaying__ResultArgs);
|
|
119
|
+
static read(input: thrift.TProtocol): IsPlaying__Result;
|
|
120
|
+
static write(args: IIsPlaying__ResultArgs, output: thrift.TProtocol): void;
|
|
121
|
+
write(output: thrift.TProtocol): void;
|
|
122
|
+
}
|
|
123
|
+
export interface IPause__Result {
|
|
124
|
+
success?: boolean;
|
|
125
|
+
}
|
|
126
|
+
export interface IPause__ResultArgs {
|
|
127
|
+
success?: boolean;
|
|
128
|
+
}
|
|
129
|
+
export declare const Pause__ResultCodec: thrift.IStructCodec<IPause__ResultArgs, IPause__Result>;
|
|
130
|
+
export declare class Pause__Result extends thrift.StructLike implements IPause__Result {
|
|
131
|
+
success?: boolean;
|
|
132
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
133
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
134
|
+
constructor(args?: IPause__ResultArgs);
|
|
135
|
+
static read(input: thrift.TProtocol): Pause__Result;
|
|
136
|
+
static write(args: IPause__ResultArgs, output: thrift.TProtocol): void;
|
|
137
|
+
write(output: thrift.TProtocol): void;
|
|
138
|
+
}
|
|
139
|
+
export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
|
|
140
|
+
static readonly serviceName: string;
|
|
141
|
+
static readonly annotations: thrift.IThriftAnnotations;
|
|
142
|
+
static readonly methodAnnotations: thrift.IMethodAnnotations;
|
|
143
|
+
static readonly methodNames: Array<string>;
|
|
144
|
+
readonly _serviceName: string;
|
|
145
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
146
|
+
readonly _methodAnnotations: thrift.IMethodAnnotations;
|
|
147
|
+
readonly _methodNames: Array<string>;
|
|
148
|
+
readonly _methodParameters?: {
|
|
149
|
+
[methodName: string]: number;
|
|
150
|
+
};
|
|
151
|
+
isAvailable(articleId: string, context?: Context): Promise<boolean>;
|
|
152
|
+
play(articleId: string, context?: Context): Promise<boolean>;
|
|
153
|
+
isPlaying(articleId: string, context?: Context): Promise<boolean>;
|
|
154
|
+
pause(articleId: string, context?: Context): Promise<boolean>;
|
|
155
|
+
}
|
|
156
|
+
export interface IHandler<Context = any> {
|
|
157
|
+
isAvailable(articleId: string, context?: Context): boolean | Promise<boolean>;
|
|
158
|
+
play(articleId: string, context?: Context): boolean | Promise<boolean>;
|
|
159
|
+
isPlaying(articleId: string, context?: Context): boolean | Promise<boolean>;
|
|
160
|
+
pause(articleId: string, context?: Context): boolean | Promise<boolean>;
|
|
161
|
+
}
|
|
162
|
+
export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
|
|
163
|
+
protected readonly _handler: IHandler<Context>;
|
|
164
|
+
static readonly serviceName: string;
|
|
165
|
+
static readonly annotations: thrift.IThriftAnnotations;
|
|
166
|
+
static readonly methodAnnotations: thrift.IMethodAnnotations;
|
|
167
|
+
static readonly methodNames: Array<string>;
|
|
168
|
+
readonly _serviceName: string;
|
|
169
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
170
|
+
readonly _methodAnnotations: thrift.IMethodAnnotations;
|
|
171
|
+
readonly _methodNames: Array<string>;
|
|
172
|
+
constructor(handler: IHandler<Context>);
|
|
173
|
+
process(input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
174
|
+
process_isAvailable(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
175
|
+
process_play(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
176
|
+
process_isPlaying(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
177
|
+
process_pause(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
178
|
+
}
|