@guardian/bridget 8.5.0 → 8.5.1
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 +0 -32
- package/Environment.js +3 -185
- package/package.json +1 -1
package/Environment.d.ts
CHANGED
|
@@ -34,19 +34,6 @@ 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
|
-
}
|
|
50
37
|
export interface INativeThriftPackageVersion__Result {
|
|
51
38
|
success?: string;
|
|
52
39
|
}
|
|
@@ -79,22 +66,6 @@ export declare class IsMyGuardianEnabled__Result extends thrift.StructLike imple
|
|
|
79
66
|
static write(args: IIsMyGuardianEnabled__ResultArgs, output: thrift.TProtocol): void;
|
|
80
67
|
write(output: thrift.TProtocol): void;
|
|
81
68
|
}
|
|
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
|
-
}
|
|
98
69
|
export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
|
|
99
70
|
static readonly serviceName: string;
|
|
100
71
|
static readonly annotations: thrift.IThriftAnnotations;
|
|
@@ -109,12 +80,10 @@ export declare class Client<Context = any> extends thrift.ThriftClient<Context>
|
|
|
109
80
|
};
|
|
110
81
|
nativeThriftPackageVersion(context?: Context): Promise<string>;
|
|
111
82
|
isMyGuardianEnabled(context?: Context): Promise<boolean>;
|
|
112
|
-
isListenToArticleEnabled(context?: Context): Promise<boolean>;
|
|
113
83
|
}
|
|
114
84
|
export interface IHandler<Context = any> {
|
|
115
85
|
nativeThriftPackageVersion(context?: Context): string | Promise<string>;
|
|
116
86
|
isMyGuardianEnabled(context?: Context): boolean | Promise<boolean>;
|
|
117
|
-
isListenToArticleEnabled(context?: Context): boolean | Promise<boolean>;
|
|
118
87
|
}
|
|
119
88
|
export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
|
|
120
89
|
protected readonly _handler: IHandler<Context>;
|
|
@@ -130,5 +99,4 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Con
|
|
|
130
99
|
process(input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
131
100
|
process_nativeThriftPackageVersion(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
|
|
132
101
|
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>;
|
|
134
102
|
}
|
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.
|
|
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;
|
|
27
27
|
/* tslint:disable */
|
|
28
28
|
/* eslint-disable */
|
|
29
29
|
/*
|
|
@@ -41,17 +41,12 @@ exports.methodAnnotations = {
|
|
|
41
41
|
isMyGuardianEnabled: {
|
|
42
42
|
annotations: {},
|
|
43
43
|
fieldAnnotations: {}
|
|
44
|
-
},
|
|
45
|
-
isListenToArticleEnabled: {
|
|
46
|
-
annotations: {},
|
|
47
|
-
fieldAnnotations: {}
|
|
48
44
|
}
|
|
49
45
|
};
|
|
50
|
-
exports.methodNames = ["nativeThriftPackageVersion", "isMyGuardianEnabled"
|
|
46
|
+
exports.methodNames = ["nativeThriftPackageVersion", "isMyGuardianEnabled"];
|
|
51
47
|
exports.methodParameters = {
|
|
52
48
|
nativeThriftPackageVersion: 1,
|
|
53
|
-
isMyGuardianEnabled: 1
|
|
54
|
-
isListenToArticleEnabled: 1
|
|
49
|
+
isMyGuardianEnabled: 1
|
|
55
50
|
};
|
|
56
51
|
exports.NativeThriftPackageVersion__ArgsCodec = {
|
|
57
52
|
encode(args, output) {
|
|
@@ -141,50 +136,6 @@ class IsMyGuardianEnabled__Args extends thrift.StructLike {
|
|
|
141
136
|
}
|
|
142
137
|
}
|
|
143
138
|
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;
|
|
188
139
|
exports.NativeThriftPackageVersion__ResultCodec = {
|
|
189
140
|
encode(args, output) {
|
|
190
141
|
const obj = {
|
|
@@ -321,74 +272,6 @@ class IsMyGuardianEnabled__Result extends thrift.StructLike {
|
|
|
321
272
|
}
|
|
322
273
|
}
|
|
323
274
|
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;
|
|
392
275
|
class Client extends thrift.ThriftClient {
|
|
393
276
|
constructor() {
|
|
394
277
|
super(...arguments);
|
|
@@ -474,44 +357,6 @@ class Client extends thrift.ThriftClient {
|
|
|
474
357
|
}
|
|
475
358
|
});
|
|
476
359
|
}
|
|
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
|
-
}
|
|
515
360
|
}
|
|
516
361
|
exports.Client = Client;
|
|
517
362
|
Client.serviceName = exports.serviceName;
|
|
@@ -542,10 +387,6 @@ class Processor extends thrift.ThriftProcessor {
|
|
|
542
387
|
resolve(this.process_isMyGuardianEnabled(requestId, input, output, context));
|
|
543
388
|
break;
|
|
544
389
|
}
|
|
545
|
-
case "process_isListenToArticleEnabled": {
|
|
546
|
-
resolve(this.process_isListenToArticleEnabled(requestId, input, output, context));
|
|
547
|
-
break;
|
|
548
|
-
}
|
|
549
390
|
default: {
|
|
550
391
|
input.skip(thrift.TType.STRUCT);
|
|
551
392
|
input.readMessageEnd();
|
|
@@ -606,29 +447,6 @@ class Processor extends thrift.ThriftProcessor {
|
|
|
606
447
|
return output.flush();
|
|
607
448
|
});
|
|
608
449
|
}
|
|
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
|
-
}
|
|
632
450
|
}
|
|
633
451
|
exports.Processor = Processor;
|
|
634
452
|
Processor.serviceName = exports.serviceName;
|