@guardian/bridget 8.7.7-2026-03-05 → 8.8.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/Videos.d.ts +32 -0
- package/Videos.js +185 -3
- package/index.d.ts +0 -2
- package/index.js +1 -3
- package/package.json +1 -1
- package/Audio.d.ts +0 -134
- package/Audio.js +0 -623
package/Videos.d.ts
CHANGED
|
@@ -74,6 +74,19 @@ export declare class SetFullscreen__Args extends thrift.StructLike implements IS
|
|
|
74
74
|
static write(args: ISetFullscreen__ArgsArgs, output: thrift.TProtocol): void;
|
|
75
75
|
write(output: thrift.TProtocol): void;
|
|
76
76
|
}
|
|
77
|
+
export interface IIsAutoplayEnabled__Args {
|
|
78
|
+
}
|
|
79
|
+
export interface IIsAutoplayEnabled__ArgsArgs {
|
|
80
|
+
}
|
|
81
|
+
export declare const IsAutoplayEnabled__ArgsCodec: thrift.IStructCodec<IIsAutoplayEnabled__ArgsArgs, IIsAutoplayEnabled__Args>;
|
|
82
|
+
export declare class IsAutoplayEnabled__Args extends thrift.StructLike implements IIsAutoplayEnabled__Args {
|
|
83
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
84
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
85
|
+
constructor(args?: IIsAutoplayEnabled__ArgsArgs);
|
|
86
|
+
static read(input: thrift.TProtocol): IsAutoplayEnabled__Args;
|
|
87
|
+
static write(args: IIsAutoplayEnabled__ArgsArgs, output: thrift.TProtocol): void;
|
|
88
|
+
write(output: thrift.TProtocol): void;
|
|
89
|
+
}
|
|
77
90
|
export interface IInsertVideos__Result {
|
|
78
91
|
success?: void;
|
|
79
92
|
}
|
|
@@ -138,6 +151,22 @@ export declare class SetFullscreen__Result extends thrift.StructLike implements
|
|
|
138
151
|
static write(args: ISetFullscreen__ResultArgs, output: thrift.TProtocol): void;
|
|
139
152
|
write(output: thrift.TProtocol): void;
|
|
140
153
|
}
|
|
154
|
+
export interface IIsAutoplayEnabled__Result {
|
|
155
|
+
success?: boolean;
|
|
156
|
+
}
|
|
157
|
+
export interface IIsAutoplayEnabled__ResultArgs {
|
|
158
|
+
success?: boolean;
|
|
159
|
+
}
|
|
160
|
+
export declare const IsAutoplayEnabled__ResultCodec: thrift.IStructCodec<IIsAutoplayEnabled__ResultArgs, IIsAutoplayEnabled__Result>;
|
|
161
|
+
export declare class IsAutoplayEnabled__Result extends thrift.StructLike implements IIsAutoplayEnabled__Result {
|
|
162
|
+
success?: boolean;
|
|
163
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
164
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
165
|
+
constructor(args?: IIsAutoplayEnabled__ResultArgs);
|
|
166
|
+
static read(input: thrift.TProtocol): IsAutoplayEnabled__Result;
|
|
167
|
+
static write(args: IIsAutoplayEnabled__ResultArgs, output: thrift.TProtocol): void;
|
|
168
|
+
write(output: thrift.TProtocol): void;
|
|
169
|
+
}
|
|
141
170
|
export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
|
|
142
171
|
static readonly serviceName: string;
|
|
143
172
|
static readonly annotations: thrift.IThriftAnnotations;
|
|
@@ -154,12 +183,14 @@ export declare class Client<Context = any> extends thrift.ThriftClient<Context>
|
|
|
154
183
|
updateVideos(videoSlots: Array<VideoSlot.IVideoSlotArgs>, context?: Context): Promise<void>;
|
|
155
184
|
sendVideoEvent(videoEvent: VideoEvent.IVideoEventArgs, context?: Context): Promise<void>;
|
|
156
185
|
setFullscreen(isFullscreen: boolean, context?: Context): Promise<boolean>;
|
|
186
|
+
isAutoplayEnabled(context?: Context): Promise<boolean>;
|
|
157
187
|
}
|
|
158
188
|
export interface IHandler<Context = any> {
|
|
159
189
|
insertVideos(videoSlots: Array<VideoSlot.IVideoSlot>, context?: Context): void | Promise<void>;
|
|
160
190
|
updateVideos(videoSlots: Array<VideoSlot.IVideoSlot>, context?: Context): void | Promise<void>;
|
|
161
191
|
sendVideoEvent(videoEvent: VideoEvent.IVideoEvent, context?: Context): void | Promise<void>;
|
|
162
192
|
setFullscreen(isFullscreen: boolean, context?: Context): boolean | Promise<boolean>;
|
|
193
|
+
isAutoplayEnabled(context?: Context): boolean | Promise<boolean>;
|
|
163
194
|
}
|
|
164
195
|
export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
|
|
165
196
|
protected readonly _handler: IHandler<Context>;
|
|
@@ -177,4 +208,5 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Con
|
|
|
177
208
|
process_updateVideos(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
178
209
|
process_sendVideoEvent(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
179
210
|
process_setFullscreen(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
211
|
+
process_isAutoplayEnabled(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
180
212
|
}
|
package/Videos.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.SetFullscreen__Result = exports.SetFullscreen__ResultCodec = exports.SendVideoEvent__Result = exports.SendVideoEvent__ResultCodec = exports.UpdateVideos__Result = exports.UpdateVideos__ResultCodec = exports.InsertVideos__Result = exports.InsertVideos__ResultCodec = exports.SetFullscreen__Args = exports.SetFullscreen__ArgsCodec = exports.SendVideoEvent__Args = exports.SendVideoEvent__ArgsCodec = exports.UpdateVideos__Args = exports.UpdateVideos__ArgsCodec = exports.InsertVideos__Args = exports.InsertVideos__ArgsCodec = exports.methodParameters = exports.methodNames = exports.methodAnnotations = exports.annotations = exports.serviceName = void 0;
|
|
26
|
+
exports.Processor = exports.Client = exports.IsAutoplayEnabled__Result = exports.IsAutoplayEnabled__ResultCodec = exports.SetFullscreen__Result = exports.SetFullscreen__ResultCodec = exports.SendVideoEvent__Result = exports.SendVideoEvent__ResultCodec = exports.UpdateVideos__Result = exports.UpdateVideos__ResultCodec = exports.InsertVideos__Result = exports.InsertVideos__ResultCodec = exports.IsAutoplayEnabled__Args = exports.IsAutoplayEnabled__ArgsCodec = exports.SetFullscreen__Args = exports.SetFullscreen__ArgsCodec = exports.SendVideoEvent__Args = exports.SendVideoEvent__ArgsCodec = exports.UpdateVideos__Args = exports.UpdateVideos__ArgsCodec = exports.InsertVideos__Args = exports.InsertVideos__ArgsCodec = exports.methodParameters = exports.methodNames = exports.methodAnnotations = exports.annotations = exports.serviceName = void 0;
|
|
27
27
|
/* tslint:disable */
|
|
28
28
|
/* eslint-disable */
|
|
29
29
|
/*
|
|
@@ -51,14 +51,19 @@ exports.methodAnnotations = {
|
|
|
51
51
|
setFullscreen: {
|
|
52
52
|
annotations: {},
|
|
53
53
|
fieldAnnotations: {}
|
|
54
|
+
},
|
|
55
|
+
isAutoplayEnabled: {
|
|
56
|
+
annotations: {},
|
|
57
|
+
fieldAnnotations: {}
|
|
54
58
|
}
|
|
55
59
|
};
|
|
56
|
-
exports.methodNames = ["insertVideos", "updateVideos", "sendVideoEvent", "setFullscreen"];
|
|
60
|
+
exports.methodNames = ["insertVideos", "updateVideos", "sendVideoEvent", "setFullscreen", "isAutoplayEnabled"];
|
|
57
61
|
exports.methodParameters = {
|
|
58
62
|
insertVideos: 2,
|
|
59
63
|
updateVideos: 2,
|
|
60
64
|
sendVideoEvent: 2,
|
|
61
|
-
setFullscreen: 2
|
|
65
|
+
setFullscreen: 2,
|
|
66
|
+
isAutoplayEnabled: 1
|
|
62
67
|
};
|
|
63
68
|
exports.InsertVideos__ArgsCodec = {
|
|
64
69
|
encode(args, output) {
|
|
@@ -406,6 +411,50 @@ class SetFullscreen__Args extends thrift.StructLike {
|
|
|
406
411
|
}
|
|
407
412
|
}
|
|
408
413
|
exports.SetFullscreen__Args = SetFullscreen__Args;
|
|
414
|
+
exports.IsAutoplayEnabled__ArgsCodec = {
|
|
415
|
+
encode(args, output) {
|
|
416
|
+
output.writeStructBegin("IsAutoplayEnabled__Args");
|
|
417
|
+
output.writeFieldStop();
|
|
418
|
+
output.writeStructEnd();
|
|
419
|
+
return;
|
|
420
|
+
},
|
|
421
|
+
decode(input) {
|
|
422
|
+
input.readStructBegin();
|
|
423
|
+
while (true) {
|
|
424
|
+
const ret = input.readFieldBegin();
|
|
425
|
+
const fieldType = ret.fieldType;
|
|
426
|
+
const fieldId = ret.fieldId;
|
|
427
|
+
if (fieldType === thrift.TType.STOP) {
|
|
428
|
+
break;
|
|
429
|
+
}
|
|
430
|
+
switch (fieldId) {
|
|
431
|
+
default: {
|
|
432
|
+
input.skip(fieldType);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
input.readFieldEnd();
|
|
436
|
+
}
|
|
437
|
+
input.readStructEnd();
|
|
438
|
+
return {};
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
class IsAutoplayEnabled__Args extends thrift.StructLike {
|
|
442
|
+
constructor(args = {}) {
|
|
443
|
+
super();
|
|
444
|
+
this._annotations = {};
|
|
445
|
+
this._fieldAnnotations = {};
|
|
446
|
+
}
|
|
447
|
+
static read(input) {
|
|
448
|
+
return new IsAutoplayEnabled__Args(exports.IsAutoplayEnabled__ArgsCodec.decode(input));
|
|
449
|
+
}
|
|
450
|
+
static write(args, output) {
|
|
451
|
+
return exports.IsAutoplayEnabled__ArgsCodec.encode(args, output);
|
|
452
|
+
}
|
|
453
|
+
write(output) {
|
|
454
|
+
return exports.IsAutoplayEnabled__ArgsCodec.encode(this, output);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
exports.IsAutoplayEnabled__Args = IsAutoplayEnabled__Args;
|
|
409
458
|
exports.InsertVideos__ResultCodec = {
|
|
410
459
|
encode(args, output) {
|
|
411
460
|
output.writeStructBegin("InsertVideos__Result");
|
|
@@ -651,6 +700,74 @@ class SetFullscreen__Result extends thrift.StructLike {
|
|
|
651
700
|
}
|
|
652
701
|
}
|
|
653
702
|
exports.SetFullscreen__Result = SetFullscreen__Result;
|
|
703
|
+
exports.IsAutoplayEnabled__ResultCodec = {
|
|
704
|
+
encode(args, output) {
|
|
705
|
+
const obj = {
|
|
706
|
+
success: args.success
|
|
707
|
+
};
|
|
708
|
+
output.writeStructBegin("IsAutoplayEnabled__Result");
|
|
709
|
+
if (obj.success != null) {
|
|
710
|
+
output.writeFieldBegin("success", thrift.TType.BOOL, 0);
|
|
711
|
+
output.writeBool(obj.success);
|
|
712
|
+
output.writeFieldEnd();
|
|
713
|
+
}
|
|
714
|
+
output.writeFieldStop();
|
|
715
|
+
output.writeStructEnd();
|
|
716
|
+
return;
|
|
717
|
+
},
|
|
718
|
+
decode(input) {
|
|
719
|
+
let _args = {};
|
|
720
|
+
input.readStructBegin();
|
|
721
|
+
while (true) {
|
|
722
|
+
const ret = input.readFieldBegin();
|
|
723
|
+
const fieldType = ret.fieldType;
|
|
724
|
+
const fieldId = ret.fieldId;
|
|
725
|
+
if (fieldType === thrift.TType.STOP) {
|
|
726
|
+
break;
|
|
727
|
+
}
|
|
728
|
+
switch (fieldId) {
|
|
729
|
+
case 0:
|
|
730
|
+
if (fieldType === thrift.TType.BOOL) {
|
|
731
|
+
const value_22 = input.readBool();
|
|
732
|
+
_args.success = value_22;
|
|
733
|
+
}
|
|
734
|
+
else {
|
|
735
|
+
input.skip(fieldType);
|
|
736
|
+
}
|
|
737
|
+
break;
|
|
738
|
+
default: {
|
|
739
|
+
input.skip(fieldType);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
input.readFieldEnd();
|
|
743
|
+
}
|
|
744
|
+
input.readStructEnd();
|
|
745
|
+
return {
|
|
746
|
+
success: _args.success
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
class IsAutoplayEnabled__Result extends thrift.StructLike {
|
|
751
|
+
constructor(args = {}) {
|
|
752
|
+
super();
|
|
753
|
+
this._annotations = {};
|
|
754
|
+
this._fieldAnnotations = {};
|
|
755
|
+
if (args.success != null) {
|
|
756
|
+
const value_23 = args.success;
|
|
757
|
+
this.success = value_23;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
static read(input) {
|
|
761
|
+
return new IsAutoplayEnabled__Result(exports.IsAutoplayEnabled__ResultCodec.decode(input));
|
|
762
|
+
}
|
|
763
|
+
static write(args, output) {
|
|
764
|
+
return exports.IsAutoplayEnabled__ResultCodec.encode(args, output);
|
|
765
|
+
}
|
|
766
|
+
write(output) {
|
|
767
|
+
return exports.IsAutoplayEnabled__ResultCodec.encode(this, output);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
exports.IsAutoplayEnabled__Result = IsAutoplayEnabled__Result;
|
|
654
771
|
class Client extends thrift.ThriftClient {
|
|
655
772
|
constructor() {
|
|
656
773
|
super(...arguments);
|
|
@@ -797,6 +914,44 @@ class Client extends thrift.ThriftClient {
|
|
|
797
914
|
}
|
|
798
915
|
});
|
|
799
916
|
}
|
|
917
|
+
isAutoplayEnabled(context) {
|
|
918
|
+
const writer = new this.transport();
|
|
919
|
+
const output = new this.protocol(writer);
|
|
920
|
+
output.writeMessageBegin("isAutoplayEnabled", thrift.MessageType.CALL, this.incrementRequestId());
|
|
921
|
+
const args = {};
|
|
922
|
+
exports.IsAutoplayEnabled__ArgsCodec.encode(args, output);
|
|
923
|
+
output.writeMessageEnd();
|
|
924
|
+
return this.connection.send(writer.flush(), context).then((data) => {
|
|
925
|
+
const reader = this.transport.receiver(data);
|
|
926
|
+
const input = new this.protocol(reader);
|
|
927
|
+
try {
|
|
928
|
+
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
|
|
929
|
+
if (fieldName === "isAutoplayEnabled") {
|
|
930
|
+
if (messageType === thrift.MessageType.EXCEPTION) {
|
|
931
|
+
const err = thrift.TApplicationExceptionCodec.decode(input);
|
|
932
|
+
input.readMessageEnd();
|
|
933
|
+
return Promise.reject(err);
|
|
934
|
+
}
|
|
935
|
+
else {
|
|
936
|
+
const result = exports.IsAutoplayEnabled__ResultCodec.decode(input);
|
|
937
|
+
input.readMessageEnd();
|
|
938
|
+
if (result.success != null) {
|
|
939
|
+
return Promise.resolve(result.success);
|
|
940
|
+
}
|
|
941
|
+
else {
|
|
942
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "isAutoplayEnabled failed: unknown result"));
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
else {
|
|
947
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
catch (err) {
|
|
951
|
+
return Promise.reject(err);
|
|
952
|
+
}
|
|
953
|
+
});
|
|
954
|
+
}
|
|
800
955
|
}
|
|
801
956
|
exports.Client = Client;
|
|
802
957
|
Client.serviceName = exports.serviceName;
|
|
@@ -835,6 +990,10 @@ class Processor extends thrift.ThriftProcessor {
|
|
|
835
990
|
resolve(this.process_setFullscreen(requestId, input, output, context));
|
|
836
991
|
break;
|
|
837
992
|
}
|
|
993
|
+
case "process_isAutoplayEnabled": {
|
|
994
|
+
resolve(this.process_isAutoplayEnabled(requestId, input, output, context));
|
|
995
|
+
break;
|
|
996
|
+
}
|
|
838
997
|
default: {
|
|
839
998
|
input.skip(thrift.TType.STRUCT);
|
|
840
999
|
input.readMessageEnd();
|
|
@@ -945,6 +1104,29 @@ class Processor extends thrift.ThriftProcessor {
|
|
|
945
1104
|
return output.flush();
|
|
946
1105
|
});
|
|
947
1106
|
}
|
|
1107
|
+
process_isAutoplayEnabled(requestId, input, output, context) {
|
|
1108
|
+
return new Promise((resolve, reject) => {
|
|
1109
|
+
try {
|
|
1110
|
+
input.readMessageEnd();
|
|
1111
|
+
resolve(this._handler.isAutoplayEnabled(context));
|
|
1112
|
+
}
|
|
1113
|
+
catch (err) {
|
|
1114
|
+
reject(err);
|
|
1115
|
+
}
|
|
1116
|
+
}).then((data) => {
|
|
1117
|
+
const result = { success: data };
|
|
1118
|
+
output.writeMessageBegin("isAutoplayEnabled", thrift.MessageType.REPLY, requestId);
|
|
1119
|
+
exports.IsAutoplayEnabled__ResultCodec.encode(result, output);
|
|
1120
|
+
output.writeMessageEnd();
|
|
1121
|
+
return output.flush();
|
|
1122
|
+
}).catch((err) => {
|
|
1123
|
+
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
|
1124
|
+
output.writeMessageBegin("isAutoplayEnabled", thrift.MessageType.EXCEPTION, requestId);
|
|
1125
|
+
thrift.TApplicationExceptionCodec.encode(result, output);
|
|
1126
|
+
output.writeMessageEnd();
|
|
1127
|
+
return output.flush();
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
948
1130
|
}
|
|
949
1131
|
exports.Processor = Processor;
|
|
950
1132
|
Processor.serviceName = exports.serviceName;
|
package/index.d.ts
CHANGED
|
@@ -28,8 +28,6 @@ import * as Notifications from "./Notifications";
|
|
|
28
28
|
export { Notifications as Notifications };
|
|
29
29
|
import * as ListenToArticle from "./ListenToArticle";
|
|
30
30
|
export { ListenToArticle as ListenToArticle };
|
|
31
|
-
import * as Audio from "./Audio";
|
|
32
|
-
export { Audio as Audio };
|
|
33
31
|
import * as User from "./User";
|
|
34
32
|
export { User as User };
|
|
35
33
|
import * as Gallery from "./Gallery";
|
package/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
26
|
return result;
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.Interactives = exports.Interaction = exports.Newsletters = exports.Navigation = exports.AbTesting = exports.Analytics = exports.Discussion = exports.Metrics = exports.Videos = exports.Gallery = exports.User = exports.
|
|
29
|
+
exports.Interactives = exports.Interaction = exports.Newsletters = exports.Navigation = exports.AbTesting = exports.Analytics = exports.Discussion = exports.Metrics = exports.Videos = exports.Gallery = exports.User = exports.ListenToArticle = exports.Notifications = exports.Tag = exports.Acquisitions = exports.Commercial = exports.Environment = void 0;
|
|
30
30
|
/* tslint:disable */
|
|
31
31
|
/* eslint-disable */
|
|
32
32
|
/*
|
|
@@ -63,8 +63,6 @@ const Notifications = __importStar(require("./Notifications"));
|
|
|
63
63
|
exports.Notifications = Notifications;
|
|
64
64
|
const ListenToArticle = __importStar(require("./ListenToArticle"));
|
|
65
65
|
exports.ListenToArticle = ListenToArticle;
|
|
66
|
-
const Audio = __importStar(require("./Audio"));
|
|
67
|
-
exports.Audio = Audio;
|
|
68
66
|
const User = __importStar(require("./User"));
|
|
69
67
|
exports.User = User;
|
|
70
68
|
const Gallery = __importStar(require("./Gallery"));
|
package/package.json
CHANGED
package/Audio.d.ts
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
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
|
-
}
|
|
13
|
-
export interface IIsAvailable__ArgsArgs {
|
|
14
|
-
}
|
|
15
|
-
export declare const IsAvailable__ArgsCodec: thrift.IStructCodec<IIsAvailable__ArgsArgs, IIsAvailable__Args>;
|
|
16
|
-
export declare class IsAvailable__Args extends thrift.StructLike implements IIsAvailable__Args {
|
|
17
|
-
readonly _annotations: thrift.IThriftAnnotations;
|
|
18
|
-
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
19
|
-
constructor(args?: IIsAvailable__ArgsArgs);
|
|
20
|
-
static read(input: thrift.TProtocol): IsAvailable__Args;
|
|
21
|
-
static write(args: IIsAvailable__ArgsArgs, output: thrift.TProtocol): void;
|
|
22
|
-
write(output: thrift.TProtocol): void;
|
|
23
|
-
}
|
|
24
|
-
export interface IPlay__Args {
|
|
25
|
-
}
|
|
26
|
-
export interface IPlay__ArgsArgs {
|
|
27
|
-
}
|
|
28
|
-
export declare const Play__ArgsCodec: thrift.IStructCodec<IPlay__ArgsArgs, IPlay__Args>;
|
|
29
|
-
export declare class Play__Args extends thrift.StructLike implements IPlay__Args {
|
|
30
|
-
readonly _annotations: thrift.IThriftAnnotations;
|
|
31
|
-
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
32
|
-
constructor(args?: IPlay__ArgsArgs);
|
|
33
|
-
static read(input: thrift.TProtocol): Play__Args;
|
|
34
|
-
static write(args: IPlay__ArgsArgs, output: thrift.TProtocol): void;
|
|
35
|
-
write(output: thrift.TProtocol): void;
|
|
36
|
-
}
|
|
37
|
-
export interface IIsPlaying__Args {
|
|
38
|
-
}
|
|
39
|
-
export interface IIsPlaying__ArgsArgs {
|
|
40
|
-
}
|
|
41
|
-
export declare const IsPlaying__ArgsCodec: thrift.IStructCodec<IIsPlaying__ArgsArgs, IIsPlaying__Args>;
|
|
42
|
-
export declare class IsPlaying__Args extends thrift.StructLike implements IIsPlaying__Args {
|
|
43
|
-
readonly _annotations: thrift.IThriftAnnotations;
|
|
44
|
-
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
45
|
-
constructor(args?: IIsPlaying__ArgsArgs);
|
|
46
|
-
static read(input: thrift.TProtocol): IsPlaying__Args;
|
|
47
|
-
static write(args: IIsPlaying__ArgsArgs, output: thrift.TProtocol): void;
|
|
48
|
-
write(output: thrift.TProtocol): void;
|
|
49
|
-
}
|
|
50
|
-
export interface IIsAvailable__Result {
|
|
51
|
-
success?: boolean;
|
|
52
|
-
}
|
|
53
|
-
export interface IIsAvailable__ResultArgs {
|
|
54
|
-
success?: boolean;
|
|
55
|
-
}
|
|
56
|
-
export declare const IsAvailable__ResultCodec: thrift.IStructCodec<IIsAvailable__ResultArgs, IIsAvailable__Result>;
|
|
57
|
-
export declare class IsAvailable__Result extends thrift.StructLike implements IIsAvailable__Result {
|
|
58
|
-
success?: boolean;
|
|
59
|
-
readonly _annotations: thrift.IThriftAnnotations;
|
|
60
|
-
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
61
|
-
constructor(args?: IIsAvailable__ResultArgs);
|
|
62
|
-
static read(input: thrift.TProtocol): IsAvailable__Result;
|
|
63
|
-
static write(args: IIsAvailable__ResultArgs, output: thrift.TProtocol): void;
|
|
64
|
-
write(output: thrift.TProtocol): void;
|
|
65
|
-
}
|
|
66
|
-
export interface IPlay__Result {
|
|
67
|
-
success?: void;
|
|
68
|
-
}
|
|
69
|
-
export interface IPlay__ResultArgs {
|
|
70
|
-
success?: void;
|
|
71
|
-
}
|
|
72
|
-
export declare const Play__ResultCodec: thrift.IStructCodec<IPlay__ResultArgs, IPlay__Result>;
|
|
73
|
-
export declare class Play__Result extends thrift.StructLike implements IPlay__Result {
|
|
74
|
-
success?: void;
|
|
75
|
-
readonly _annotations: thrift.IThriftAnnotations;
|
|
76
|
-
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
77
|
-
constructor(args?: IPlay__ResultArgs);
|
|
78
|
-
static read(input: thrift.TProtocol): Play__Result;
|
|
79
|
-
static write(args: IPlay__ResultArgs, output: thrift.TProtocol): void;
|
|
80
|
-
write(output: thrift.TProtocol): void;
|
|
81
|
-
}
|
|
82
|
-
export interface IIsPlaying__Result {
|
|
83
|
-
success?: boolean;
|
|
84
|
-
}
|
|
85
|
-
export interface IIsPlaying__ResultArgs {
|
|
86
|
-
success?: boolean;
|
|
87
|
-
}
|
|
88
|
-
export declare const IsPlaying__ResultCodec: thrift.IStructCodec<IIsPlaying__ResultArgs, IIsPlaying__Result>;
|
|
89
|
-
export declare class IsPlaying__Result extends thrift.StructLike implements IIsPlaying__Result {
|
|
90
|
-
success?: boolean;
|
|
91
|
-
readonly _annotations: thrift.IThriftAnnotations;
|
|
92
|
-
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
93
|
-
constructor(args?: IIsPlaying__ResultArgs);
|
|
94
|
-
static read(input: thrift.TProtocol): IsPlaying__Result;
|
|
95
|
-
static write(args: IIsPlaying__ResultArgs, output: thrift.TProtocol): void;
|
|
96
|
-
write(output: thrift.TProtocol): void;
|
|
97
|
-
}
|
|
98
|
-
export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
|
|
99
|
-
static readonly serviceName: string;
|
|
100
|
-
static readonly annotations: thrift.IThriftAnnotations;
|
|
101
|
-
static readonly methodAnnotations: thrift.IMethodAnnotations;
|
|
102
|
-
static readonly methodNames: Array<string>;
|
|
103
|
-
readonly _serviceName: string;
|
|
104
|
-
readonly _annotations: thrift.IThriftAnnotations;
|
|
105
|
-
readonly _methodAnnotations: thrift.IMethodAnnotations;
|
|
106
|
-
readonly _methodNames: Array<string>;
|
|
107
|
-
readonly _methodParameters?: {
|
|
108
|
-
[methodName: string]: number;
|
|
109
|
-
};
|
|
110
|
-
isAvailable(context?: Context): Promise<boolean>;
|
|
111
|
-
play(context?: Context): Promise<void>;
|
|
112
|
-
isPlaying(context?: Context): Promise<boolean>;
|
|
113
|
-
}
|
|
114
|
-
export interface IHandler<Context = any> {
|
|
115
|
-
isAvailable(context?: Context): boolean | Promise<boolean>;
|
|
116
|
-
play(context?: Context): void | Promise<void>;
|
|
117
|
-
isPlaying(context?: Context): boolean | Promise<boolean>;
|
|
118
|
-
}
|
|
119
|
-
export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
|
|
120
|
-
protected readonly _handler: IHandler<Context>;
|
|
121
|
-
static readonly serviceName: string;
|
|
122
|
-
static readonly annotations: thrift.IThriftAnnotations;
|
|
123
|
-
static readonly methodAnnotations: thrift.IMethodAnnotations;
|
|
124
|
-
static readonly methodNames: Array<string>;
|
|
125
|
-
readonly _serviceName: string;
|
|
126
|
-
readonly _annotations: thrift.IThriftAnnotations;
|
|
127
|
-
readonly _methodAnnotations: thrift.IMethodAnnotations;
|
|
128
|
-
readonly _methodNames: Array<string>;
|
|
129
|
-
constructor(handler: IHandler<Context>);
|
|
130
|
-
process(input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
131
|
-
process_isAvailable(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
132
|
-
process_play(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
133
|
-
process_isPlaying(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
134
|
-
}
|
package/Audio.js
DELETED
|
@@ -1,623 +0,0 @@
|
|
|
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.IsPlaying__Result = exports.IsPlaying__ResultCodec = exports.Play__Result = exports.Play__ResultCodec = exports.IsAvailable__Result = exports.IsAvailable__ResultCodec = exports.IsPlaying__Args = exports.IsPlaying__ArgsCodec = exports.Play__Args = exports.Play__ArgsCodec = exports.IsAvailable__Args = exports.IsAvailable__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 = "Audio";
|
|
35
|
-
exports.annotations = {};
|
|
36
|
-
exports.methodAnnotations = {
|
|
37
|
-
isAvailable: {
|
|
38
|
-
annotations: {},
|
|
39
|
-
fieldAnnotations: {}
|
|
40
|
-
},
|
|
41
|
-
play: {
|
|
42
|
-
annotations: {},
|
|
43
|
-
fieldAnnotations: {}
|
|
44
|
-
},
|
|
45
|
-
isPlaying: {
|
|
46
|
-
annotations: {},
|
|
47
|
-
fieldAnnotations: {}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
exports.methodNames = ["isAvailable", "play", "isPlaying"];
|
|
51
|
-
exports.methodParameters = {
|
|
52
|
-
isAvailable: 1,
|
|
53
|
-
play: 1,
|
|
54
|
-
isPlaying: 1
|
|
55
|
-
};
|
|
56
|
-
exports.IsAvailable__ArgsCodec = {
|
|
57
|
-
encode(args, output) {
|
|
58
|
-
output.writeStructBegin("IsAvailable__Args");
|
|
59
|
-
output.writeFieldStop();
|
|
60
|
-
output.writeStructEnd();
|
|
61
|
-
return;
|
|
62
|
-
},
|
|
63
|
-
decode(input) {
|
|
64
|
-
input.readStructBegin();
|
|
65
|
-
while (true) {
|
|
66
|
-
const ret = input.readFieldBegin();
|
|
67
|
-
const fieldType = ret.fieldType;
|
|
68
|
-
const fieldId = ret.fieldId;
|
|
69
|
-
if (fieldType === thrift.TType.STOP) {
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
switch (fieldId) {
|
|
73
|
-
default: {
|
|
74
|
-
input.skip(fieldType);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
input.readFieldEnd();
|
|
78
|
-
}
|
|
79
|
-
input.readStructEnd();
|
|
80
|
-
return {};
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
class IsAvailable__Args extends thrift.StructLike {
|
|
84
|
-
constructor(args = {}) {
|
|
85
|
-
super();
|
|
86
|
-
this._annotations = {};
|
|
87
|
-
this._fieldAnnotations = {};
|
|
88
|
-
}
|
|
89
|
-
static read(input) {
|
|
90
|
-
return new IsAvailable__Args(exports.IsAvailable__ArgsCodec.decode(input));
|
|
91
|
-
}
|
|
92
|
-
static write(args, output) {
|
|
93
|
-
return exports.IsAvailable__ArgsCodec.encode(args, output);
|
|
94
|
-
}
|
|
95
|
-
write(output) {
|
|
96
|
-
return exports.IsAvailable__ArgsCodec.encode(this, output);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
exports.IsAvailable__Args = IsAvailable__Args;
|
|
100
|
-
exports.Play__ArgsCodec = {
|
|
101
|
-
encode(args, output) {
|
|
102
|
-
output.writeStructBegin("Play__Args");
|
|
103
|
-
output.writeFieldStop();
|
|
104
|
-
output.writeStructEnd();
|
|
105
|
-
return;
|
|
106
|
-
},
|
|
107
|
-
decode(input) {
|
|
108
|
-
input.readStructBegin();
|
|
109
|
-
while (true) {
|
|
110
|
-
const ret = input.readFieldBegin();
|
|
111
|
-
const fieldType = ret.fieldType;
|
|
112
|
-
const fieldId = ret.fieldId;
|
|
113
|
-
if (fieldType === thrift.TType.STOP) {
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
switch (fieldId) {
|
|
117
|
-
default: {
|
|
118
|
-
input.skip(fieldType);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
input.readFieldEnd();
|
|
122
|
-
}
|
|
123
|
-
input.readStructEnd();
|
|
124
|
-
return {};
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
class Play__Args extends thrift.StructLike {
|
|
128
|
-
constructor(args = {}) {
|
|
129
|
-
super();
|
|
130
|
-
this._annotations = {};
|
|
131
|
-
this._fieldAnnotations = {};
|
|
132
|
-
}
|
|
133
|
-
static read(input) {
|
|
134
|
-
return new Play__Args(exports.Play__ArgsCodec.decode(input));
|
|
135
|
-
}
|
|
136
|
-
static write(args, output) {
|
|
137
|
-
return exports.Play__ArgsCodec.encode(args, output);
|
|
138
|
-
}
|
|
139
|
-
write(output) {
|
|
140
|
-
return exports.Play__ArgsCodec.encode(this, output);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
exports.Play__Args = Play__Args;
|
|
144
|
-
exports.IsPlaying__ArgsCodec = {
|
|
145
|
-
encode(args, output) {
|
|
146
|
-
output.writeStructBegin("IsPlaying__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 IsPlaying__Args extends thrift.StructLike {
|
|
172
|
-
constructor(args = {}) {
|
|
173
|
-
super();
|
|
174
|
-
this._annotations = {};
|
|
175
|
-
this._fieldAnnotations = {};
|
|
176
|
-
}
|
|
177
|
-
static read(input) {
|
|
178
|
-
return new IsPlaying__Args(exports.IsPlaying__ArgsCodec.decode(input));
|
|
179
|
-
}
|
|
180
|
-
static write(args, output) {
|
|
181
|
-
return exports.IsPlaying__ArgsCodec.encode(args, output);
|
|
182
|
-
}
|
|
183
|
-
write(output) {
|
|
184
|
-
return exports.IsPlaying__ArgsCodec.encode(this, output);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
exports.IsPlaying__Args = IsPlaying__Args;
|
|
188
|
-
exports.IsAvailable__ResultCodec = {
|
|
189
|
-
encode(args, output) {
|
|
190
|
-
const obj = {
|
|
191
|
-
success: args.success
|
|
192
|
-
};
|
|
193
|
-
output.writeStructBegin("IsAvailable__Result");
|
|
194
|
-
if (obj.success != null) {
|
|
195
|
-
output.writeFieldBegin("success", thrift.TType.BOOL, 0);
|
|
196
|
-
output.writeBool(obj.success);
|
|
197
|
-
output.writeFieldEnd();
|
|
198
|
-
}
|
|
199
|
-
output.writeFieldStop();
|
|
200
|
-
output.writeStructEnd();
|
|
201
|
-
return;
|
|
202
|
-
},
|
|
203
|
-
decode(input) {
|
|
204
|
-
let _args = {};
|
|
205
|
-
input.readStructBegin();
|
|
206
|
-
while (true) {
|
|
207
|
-
const ret = input.readFieldBegin();
|
|
208
|
-
const fieldType = ret.fieldType;
|
|
209
|
-
const fieldId = ret.fieldId;
|
|
210
|
-
if (fieldType === thrift.TType.STOP) {
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
switch (fieldId) {
|
|
214
|
-
case 0:
|
|
215
|
-
if (fieldType === thrift.TType.BOOL) {
|
|
216
|
-
const value_1 = input.readBool();
|
|
217
|
-
_args.success = value_1;
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
input.skip(fieldType);
|
|
221
|
-
}
|
|
222
|
-
break;
|
|
223
|
-
default: {
|
|
224
|
-
input.skip(fieldType);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
input.readFieldEnd();
|
|
228
|
-
}
|
|
229
|
-
input.readStructEnd();
|
|
230
|
-
return {
|
|
231
|
-
success: _args.success
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
class IsAvailable__Result extends thrift.StructLike {
|
|
236
|
-
constructor(args = {}) {
|
|
237
|
-
super();
|
|
238
|
-
this._annotations = {};
|
|
239
|
-
this._fieldAnnotations = {};
|
|
240
|
-
if (args.success != null) {
|
|
241
|
-
const value_2 = args.success;
|
|
242
|
-
this.success = value_2;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
static read(input) {
|
|
246
|
-
return new IsAvailable__Result(exports.IsAvailable__ResultCodec.decode(input));
|
|
247
|
-
}
|
|
248
|
-
static write(args, output) {
|
|
249
|
-
return exports.IsAvailable__ResultCodec.encode(args, output);
|
|
250
|
-
}
|
|
251
|
-
write(output) {
|
|
252
|
-
return exports.IsAvailable__ResultCodec.encode(this, output);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
exports.IsAvailable__Result = IsAvailable__Result;
|
|
256
|
-
exports.Play__ResultCodec = {
|
|
257
|
-
encode(args, output) {
|
|
258
|
-
output.writeStructBegin("Play__Result");
|
|
259
|
-
output.writeFieldStop();
|
|
260
|
-
output.writeStructEnd();
|
|
261
|
-
return;
|
|
262
|
-
},
|
|
263
|
-
decode(input) {
|
|
264
|
-
let _args = {};
|
|
265
|
-
input.readStructBegin();
|
|
266
|
-
while (true) {
|
|
267
|
-
const ret = input.readFieldBegin();
|
|
268
|
-
const fieldType = ret.fieldType;
|
|
269
|
-
const fieldId = ret.fieldId;
|
|
270
|
-
if (fieldType === thrift.TType.STOP) {
|
|
271
|
-
break;
|
|
272
|
-
}
|
|
273
|
-
switch (fieldId) {
|
|
274
|
-
case 0:
|
|
275
|
-
if (fieldType === thrift.TType.VOID) {
|
|
276
|
-
input.skip(fieldType);
|
|
277
|
-
}
|
|
278
|
-
else {
|
|
279
|
-
input.skip(fieldType);
|
|
280
|
-
}
|
|
281
|
-
break;
|
|
282
|
-
default: {
|
|
283
|
-
input.skip(fieldType);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
input.readFieldEnd();
|
|
287
|
-
}
|
|
288
|
-
input.readStructEnd();
|
|
289
|
-
return {
|
|
290
|
-
success: _args.success
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
class Play__Result extends thrift.StructLike {
|
|
295
|
-
constructor(args = {}) {
|
|
296
|
-
super();
|
|
297
|
-
this._annotations = {};
|
|
298
|
-
this._fieldAnnotations = {};
|
|
299
|
-
if (args.success != null) {
|
|
300
|
-
const value_3 = undefined;
|
|
301
|
-
this.success = value_3;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
static read(input) {
|
|
305
|
-
return new Play__Result(exports.Play__ResultCodec.decode(input));
|
|
306
|
-
}
|
|
307
|
-
static write(args, output) {
|
|
308
|
-
return exports.Play__ResultCodec.encode(args, output);
|
|
309
|
-
}
|
|
310
|
-
write(output) {
|
|
311
|
-
return exports.Play__ResultCodec.encode(this, output);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
exports.Play__Result = Play__Result;
|
|
315
|
-
exports.IsPlaying__ResultCodec = {
|
|
316
|
-
encode(args, output) {
|
|
317
|
-
const obj = {
|
|
318
|
-
success: args.success
|
|
319
|
-
};
|
|
320
|
-
output.writeStructBegin("IsPlaying__Result");
|
|
321
|
-
if (obj.success != null) {
|
|
322
|
-
output.writeFieldBegin("success", thrift.TType.BOOL, 0);
|
|
323
|
-
output.writeBool(obj.success);
|
|
324
|
-
output.writeFieldEnd();
|
|
325
|
-
}
|
|
326
|
-
output.writeFieldStop();
|
|
327
|
-
output.writeStructEnd();
|
|
328
|
-
return;
|
|
329
|
-
},
|
|
330
|
-
decode(input) {
|
|
331
|
-
let _args = {};
|
|
332
|
-
input.readStructBegin();
|
|
333
|
-
while (true) {
|
|
334
|
-
const ret = input.readFieldBegin();
|
|
335
|
-
const fieldType = ret.fieldType;
|
|
336
|
-
const fieldId = ret.fieldId;
|
|
337
|
-
if (fieldType === thrift.TType.STOP) {
|
|
338
|
-
break;
|
|
339
|
-
}
|
|
340
|
-
switch (fieldId) {
|
|
341
|
-
case 0:
|
|
342
|
-
if (fieldType === thrift.TType.BOOL) {
|
|
343
|
-
const value_4 = input.readBool();
|
|
344
|
-
_args.success = value_4;
|
|
345
|
-
}
|
|
346
|
-
else {
|
|
347
|
-
input.skip(fieldType);
|
|
348
|
-
}
|
|
349
|
-
break;
|
|
350
|
-
default: {
|
|
351
|
-
input.skip(fieldType);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
input.readFieldEnd();
|
|
355
|
-
}
|
|
356
|
-
input.readStructEnd();
|
|
357
|
-
return {
|
|
358
|
-
success: _args.success
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
};
|
|
362
|
-
class IsPlaying__Result extends thrift.StructLike {
|
|
363
|
-
constructor(args = {}) {
|
|
364
|
-
super();
|
|
365
|
-
this._annotations = {};
|
|
366
|
-
this._fieldAnnotations = {};
|
|
367
|
-
if (args.success != null) {
|
|
368
|
-
const value_5 = args.success;
|
|
369
|
-
this.success = value_5;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
static read(input) {
|
|
373
|
-
return new IsPlaying__Result(exports.IsPlaying__ResultCodec.decode(input));
|
|
374
|
-
}
|
|
375
|
-
static write(args, output) {
|
|
376
|
-
return exports.IsPlaying__ResultCodec.encode(args, output);
|
|
377
|
-
}
|
|
378
|
-
write(output) {
|
|
379
|
-
return exports.IsPlaying__ResultCodec.encode(this, output);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
exports.IsPlaying__Result = IsPlaying__Result;
|
|
383
|
-
class Client extends thrift.ThriftClient {
|
|
384
|
-
constructor() {
|
|
385
|
-
super(...arguments);
|
|
386
|
-
this._serviceName = exports.serviceName;
|
|
387
|
-
this._annotations = exports.annotations;
|
|
388
|
-
this._methodAnnotations = exports.methodAnnotations;
|
|
389
|
-
this._methodNames = exports.methodNames;
|
|
390
|
-
this._methodParameters = exports.methodParameters;
|
|
391
|
-
}
|
|
392
|
-
isAvailable(context) {
|
|
393
|
-
const writer = new this.transport();
|
|
394
|
-
const output = new this.protocol(writer);
|
|
395
|
-
output.writeMessageBegin("isAvailable", thrift.MessageType.CALL, this.incrementRequestId());
|
|
396
|
-
const args = {};
|
|
397
|
-
exports.IsAvailable__ArgsCodec.encode(args, output);
|
|
398
|
-
output.writeMessageEnd();
|
|
399
|
-
return this.connection.send(writer.flush(), context).then((data) => {
|
|
400
|
-
const reader = this.transport.receiver(data);
|
|
401
|
-
const input = new this.protocol(reader);
|
|
402
|
-
try {
|
|
403
|
-
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
|
|
404
|
-
if (fieldName === "isAvailable") {
|
|
405
|
-
if (messageType === thrift.MessageType.EXCEPTION) {
|
|
406
|
-
const err = thrift.TApplicationExceptionCodec.decode(input);
|
|
407
|
-
input.readMessageEnd();
|
|
408
|
-
return Promise.reject(err);
|
|
409
|
-
}
|
|
410
|
-
else {
|
|
411
|
-
const result = exports.IsAvailable__ResultCodec.decode(input);
|
|
412
|
-
input.readMessageEnd();
|
|
413
|
-
if (result.success != null) {
|
|
414
|
-
return Promise.resolve(result.success);
|
|
415
|
-
}
|
|
416
|
-
else {
|
|
417
|
-
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "isAvailable failed: unknown result"));
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
else {
|
|
422
|
-
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
catch (err) {
|
|
426
|
-
return Promise.reject(err);
|
|
427
|
-
}
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
play(context) {
|
|
431
|
-
const writer = new this.transport();
|
|
432
|
-
const output = new this.protocol(writer);
|
|
433
|
-
output.writeMessageBegin("play", thrift.MessageType.CALL, this.incrementRequestId());
|
|
434
|
-
const args = {};
|
|
435
|
-
exports.Play__ArgsCodec.encode(args, output);
|
|
436
|
-
output.writeMessageEnd();
|
|
437
|
-
return this.connection.send(writer.flush(), context).then((data) => {
|
|
438
|
-
const reader = this.transport.receiver(data);
|
|
439
|
-
const input = new this.protocol(reader);
|
|
440
|
-
try {
|
|
441
|
-
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
|
|
442
|
-
if (fieldName === "play") {
|
|
443
|
-
if (messageType === thrift.MessageType.EXCEPTION) {
|
|
444
|
-
const err = thrift.TApplicationExceptionCodec.decode(input);
|
|
445
|
-
input.readMessageEnd();
|
|
446
|
-
return Promise.reject(err);
|
|
447
|
-
}
|
|
448
|
-
else {
|
|
449
|
-
const result = exports.Play__ResultCodec.decode(input);
|
|
450
|
-
input.readMessageEnd();
|
|
451
|
-
return Promise.resolve(result.success);
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
else {
|
|
455
|
-
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
catch (err) {
|
|
459
|
-
return Promise.reject(err);
|
|
460
|
-
}
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
isPlaying(context) {
|
|
464
|
-
const writer = new this.transport();
|
|
465
|
-
const output = new this.protocol(writer);
|
|
466
|
-
output.writeMessageBegin("isPlaying", thrift.MessageType.CALL, this.incrementRequestId());
|
|
467
|
-
const args = {};
|
|
468
|
-
exports.IsPlaying__ArgsCodec.encode(args, output);
|
|
469
|
-
output.writeMessageEnd();
|
|
470
|
-
return this.connection.send(writer.flush(), context).then((data) => {
|
|
471
|
-
const reader = this.transport.receiver(data);
|
|
472
|
-
const input = new this.protocol(reader);
|
|
473
|
-
try {
|
|
474
|
-
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
|
|
475
|
-
if (fieldName === "isPlaying") {
|
|
476
|
-
if (messageType === thrift.MessageType.EXCEPTION) {
|
|
477
|
-
const err = thrift.TApplicationExceptionCodec.decode(input);
|
|
478
|
-
input.readMessageEnd();
|
|
479
|
-
return Promise.reject(err);
|
|
480
|
-
}
|
|
481
|
-
else {
|
|
482
|
-
const result = exports.IsPlaying__ResultCodec.decode(input);
|
|
483
|
-
input.readMessageEnd();
|
|
484
|
-
if (result.success != null) {
|
|
485
|
-
return Promise.resolve(result.success);
|
|
486
|
-
}
|
|
487
|
-
else {
|
|
488
|
-
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "isPlaying failed: unknown result"));
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
else {
|
|
493
|
-
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
catch (err) {
|
|
497
|
-
return Promise.reject(err);
|
|
498
|
-
}
|
|
499
|
-
});
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
exports.Client = Client;
|
|
503
|
-
Client.serviceName = exports.serviceName;
|
|
504
|
-
Client.annotations = exports.annotations;
|
|
505
|
-
Client.methodAnnotations = exports.methodAnnotations;
|
|
506
|
-
Client.methodNames = exports.methodNames;
|
|
507
|
-
class Processor extends thrift.ThriftProcessor {
|
|
508
|
-
constructor(handler) {
|
|
509
|
-
super();
|
|
510
|
-
this._serviceName = exports.serviceName;
|
|
511
|
-
this._annotations = exports.annotations;
|
|
512
|
-
this._methodAnnotations = exports.methodAnnotations;
|
|
513
|
-
this._methodNames = exports.methodNames;
|
|
514
|
-
this._handler = handler;
|
|
515
|
-
}
|
|
516
|
-
process(input, output, context) {
|
|
517
|
-
return new Promise((resolve, reject) => {
|
|
518
|
-
const metadata = input.readMessageBegin();
|
|
519
|
-
const fieldName = metadata.fieldName;
|
|
520
|
-
const requestId = metadata.requestId;
|
|
521
|
-
const methodName = "process_" + fieldName;
|
|
522
|
-
switch (methodName) {
|
|
523
|
-
case "process_isAvailable": {
|
|
524
|
-
resolve(this.process_isAvailable(requestId, input, output, context));
|
|
525
|
-
break;
|
|
526
|
-
}
|
|
527
|
-
case "process_play": {
|
|
528
|
-
resolve(this.process_play(requestId, input, output, context));
|
|
529
|
-
break;
|
|
530
|
-
}
|
|
531
|
-
case "process_isPlaying": {
|
|
532
|
-
resolve(this.process_isPlaying(requestId, input, output, context));
|
|
533
|
-
break;
|
|
534
|
-
}
|
|
535
|
-
default: {
|
|
536
|
-
input.skip(thrift.TType.STRUCT);
|
|
537
|
-
input.readMessageEnd();
|
|
538
|
-
const errMessage = "Unknown function " + fieldName;
|
|
539
|
-
const err = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN_METHOD, errMessage);
|
|
540
|
-
output.writeMessageBegin(fieldName, thrift.MessageType.EXCEPTION, requestId);
|
|
541
|
-
thrift.TApplicationExceptionCodec.encode(err, output);
|
|
542
|
-
output.writeMessageEnd();
|
|
543
|
-
resolve(output.flush());
|
|
544
|
-
break;
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
process_isAvailable(requestId, input, output, context) {
|
|
550
|
-
return new Promise((resolve, reject) => {
|
|
551
|
-
try {
|
|
552
|
-
input.readMessageEnd();
|
|
553
|
-
resolve(this._handler.isAvailable(context));
|
|
554
|
-
}
|
|
555
|
-
catch (err) {
|
|
556
|
-
reject(err);
|
|
557
|
-
}
|
|
558
|
-
}).then((data) => {
|
|
559
|
-
const result = { success: data };
|
|
560
|
-
output.writeMessageBegin("isAvailable", thrift.MessageType.REPLY, requestId);
|
|
561
|
-
exports.IsAvailable__ResultCodec.encode(result, output);
|
|
562
|
-
output.writeMessageEnd();
|
|
563
|
-
return output.flush();
|
|
564
|
-
}).catch((err) => {
|
|
565
|
-
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
|
566
|
-
output.writeMessageBegin("isAvailable", thrift.MessageType.EXCEPTION, requestId);
|
|
567
|
-
thrift.TApplicationExceptionCodec.encode(result, output);
|
|
568
|
-
output.writeMessageEnd();
|
|
569
|
-
return output.flush();
|
|
570
|
-
});
|
|
571
|
-
}
|
|
572
|
-
process_play(requestId, input, output, context) {
|
|
573
|
-
return new Promise((resolve, reject) => {
|
|
574
|
-
try {
|
|
575
|
-
input.readMessageEnd();
|
|
576
|
-
resolve(this._handler.play(context));
|
|
577
|
-
}
|
|
578
|
-
catch (err) {
|
|
579
|
-
reject(err);
|
|
580
|
-
}
|
|
581
|
-
}).then((data) => {
|
|
582
|
-
const result = { success: data };
|
|
583
|
-
output.writeMessageBegin("play", thrift.MessageType.REPLY, requestId);
|
|
584
|
-
exports.Play__ResultCodec.encode(result, output);
|
|
585
|
-
output.writeMessageEnd();
|
|
586
|
-
return output.flush();
|
|
587
|
-
}).catch((err) => {
|
|
588
|
-
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
|
589
|
-
output.writeMessageBegin("play", thrift.MessageType.EXCEPTION, requestId);
|
|
590
|
-
thrift.TApplicationExceptionCodec.encode(result, output);
|
|
591
|
-
output.writeMessageEnd();
|
|
592
|
-
return output.flush();
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
process_isPlaying(requestId, input, output, context) {
|
|
596
|
-
return new Promise((resolve, reject) => {
|
|
597
|
-
try {
|
|
598
|
-
input.readMessageEnd();
|
|
599
|
-
resolve(this._handler.isPlaying(context));
|
|
600
|
-
}
|
|
601
|
-
catch (err) {
|
|
602
|
-
reject(err);
|
|
603
|
-
}
|
|
604
|
-
}).then((data) => {
|
|
605
|
-
const result = { success: data };
|
|
606
|
-
output.writeMessageBegin("isPlaying", thrift.MessageType.REPLY, requestId);
|
|
607
|
-
exports.IsPlaying__ResultCodec.encode(result, output);
|
|
608
|
-
output.writeMessageEnd();
|
|
609
|
-
return output.flush();
|
|
610
|
-
}).catch((err) => {
|
|
611
|
-
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
|
612
|
-
output.writeMessageBegin("isPlaying", thrift.MessageType.EXCEPTION, requestId);
|
|
613
|
-
thrift.TApplicationExceptionCodec.encode(result, output);
|
|
614
|
-
output.writeMessageEnd();
|
|
615
|
-
return output.flush();
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
exports.Processor = Processor;
|
|
620
|
-
Processor.serviceName = exports.serviceName;
|
|
621
|
-
Processor.annotations = exports.annotations;
|
|
622
|
-
Processor.methodAnnotations = exports.methodAnnotations;
|
|
623
|
-
Processor.methodNames = exports.methodNames;
|