@guardian/bridget 2.8.1 → 3.0.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/Discussion.d.ts +9 -155
- package/Discussion.js +54 -968
- package/DiscussionApiResponse.d.ts +26 -0
- package/{CommentResponse.js → DiscussionApiResponse.js} +9 -9
- package/DiscussionNativeError.d.ts +3 -0
- package/DiscussionNativeError.js +13 -0
- package/DiscussionResponse.d.ts +28 -0
- package/DiscussionResponse.js +170 -0
- package/SignInScreenReason.d.ts +7 -0
- package/SignInScreenReason.js +17 -0
- package/SignInScreenReferrer.d.ts +7 -0
- package/SignInScreenReferrer.js +17 -0
- package/User.d.ts +72 -0
- package/User.js +438 -26
- package/index.d.ts +5 -1
- package/index.js +5 -1
- package/package.json +1 -1
- package/CommentResponse.d.ts +0 -26
package/User.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.DoesCcpaApply__Result = exports.DoesCcpaApply__ResultCodec = exports.DiscussionId__Result = exports.DiscussionId__ResultCodec = exports.FilterSeenArticles__Result = exports.FilterSeenArticles__ResultCodec = exports.IsPremium__Result = exports.IsPremium__ResultCodec = exports.DoesCcpaApply__Args = exports.DoesCcpaApply__ArgsCodec = exports.DiscussionId__Args = exports.DiscussionId__ArgsCodec = exports.FilterSeenArticles__Args = exports.FilterSeenArticles__ArgsCodec = exports.IsPremium__Args = exports.IsPremium__ArgsCodec = exports.methodParameters = exports.methodNames = exports.methodAnnotations = exports.annotations = exports.serviceName = void 0;
|
|
26
|
+
exports.Processor = exports.Client = exports.SignIn__Result = exports.SignIn__ResultCodec = exports.IsSignedIn__Result = exports.IsSignedIn__ResultCodec = exports.DoesCcpaApply__Result = exports.DoesCcpaApply__ResultCodec = exports.DiscussionId__Result = exports.DiscussionId__ResultCodec = exports.FilterSeenArticles__Result = exports.FilterSeenArticles__ResultCodec = exports.IsPremium__Result = exports.IsPremium__ResultCodec = exports.SignIn__Args = exports.SignIn__ArgsCodec = exports.IsSignedIn__Args = exports.IsSignedIn__ArgsCodec = exports.DoesCcpaApply__Args = exports.DoesCcpaApply__ArgsCodec = exports.DiscussionId__Args = exports.DiscussionId__ArgsCodec = exports.FilterSeenArticles__Args = exports.FilterSeenArticles__ArgsCodec = exports.IsPremium__Args = exports.IsPremium__ArgsCodec = exports.methodParameters = exports.methodNames = exports.methodAnnotations = exports.annotations = exports.serviceName = void 0;
|
|
27
27
|
/* tslint:disable */
|
|
28
28
|
/* eslint-disable */
|
|
29
29
|
/*
|
|
@@ -49,14 +49,24 @@ exports.methodAnnotations = {
|
|
|
49
49
|
doesCcpaApply: {
|
|
50
50
|
annotations: {},
|
|
51
51
|
fieldAnnotations: {}
|
|
52
|
+
},
|
|
53
|
+
isSignedIn: {
|
|
54
|
+
annotations: {},
|
|
55
|
+
fieldAnnotations: {}
|
|
56
|
+
},
|
|
57
|
+
signIn: {
|
|
58
|
+
annotations: {},
|
|
59
|
+
fieldAnnotations: {}
|
|
52
60
|
}
|
|
53
61
|
};
|
|
54
|
-
exports.methodNames = ["isPremium", "filterSeenArticles", "discussionId", "doesCcpaApply"];
|
|
62
|
+
exports.methodNames = ["isPremium", "filterSeenArticles", "discussionId", "doesCcpaApply", "isSignedIn", "signIn"];
|
|
55
63
|
exports.methodParameters = {
|
|
56
64
|
isPremium: 1,
|
|
57
65
|
filterSeenArticles: 2,
|
|
58
66
|
discussionId: 1,
|
|
59
|
-
doesCcpaApply: 1
|
|
67
|
+
doesCcpaApply: 1,
|
|
68
|
+
isSignedIn: 1,
|
|
69
|
+
signIn: 3
|
|
60
70
|
};
|
|
61
71
|
exports.IsPremium__ArgsCodec = {
|
|
62
72
|
encode(args, output) {
|
|
@@ -284,6 +294,155 @@ class DoesCcpaApply__Args extends thrift.StructLike {
|
|
|
284
294
|
}
|
|
285
295
|
}
|
|
286
296
|
exports.DoesCcpaApply__Args = DoesCcpaApply__Args;
|
|
297
|
+
exports.IsSignedIn__ArgsCodec = {
|
|
298
|
+
encode(args, output) {
|
|
299
|
+
output.writeStructBegin("IsSignedIn__Args");
|
|
300
|
+
output.writeFieldStop();
|
|
301
|
+
output.writeStructEnd();
|
|
302
|
+
return;
|
|
303
|
+
},
|
|
304
|
+
decode(input) {
|
|
305
|
+
input.readStructBegin();
|
|
306
|
+
while (true) {
|
|
307
|
+
const ret = input.readFieldBegin();
|
|
308
|
+
const fieldType = ret.fieldType;
|
|
309
|
+
const fieldId = ret.fieldId;
|
|
310
|
+
if (fieldType === thrift.TType.STOP) {
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
switch (fieldId) {
|
|
314
|
+
default: {
|
|
315
|
+
input.skip(fieldType);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
input.readFieldEnd();
|
|
319
|
+
}
|
|
320
|
+
input.readStructEnd();
|
|
321
|
+
return {};
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
class IsSignedIn__Args extends thrift.StructLike {
|
|
325
|
+
constructor(args = {}) {
|
|
326
|
+
super();
|
|
327
|
+
this._annotations = {};
|
|
328
|
+
this._fieldAnnotations = {};
|
|
329
|
+
}
|
|
330
|
+
static read(input) {
|
|
331
|
+
return new IsSignedIn__Args(exports.IsSignedIn__ArgsCodec.decode(input));
|
|
332
|
+
}
|
|
333
|
+
static write(args, output) {
|
|
334
|
+
return exports.IsSignedIn__ArgsCodec.encode(args, output);
|
|
335
|
+
}
|
|
336
|
+
write(output) {
|
|
337
|
+
return exports.IsSignedIn__ArgsCodec.encode(this, output);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
exports.IsSignedIn__Args = IsSignedIn__Args;
|
|
341
|
+
exports.SignIn__ArgsCodec = {
|
|
342
|
+
encode(args, output) {
|
|
343
|
+
const obj = {
|
|
344
|
+
reason: args.reason,
|
|
345
|
+
referrer: args.referrer
|
|
346
|
+
};
|
|
347
|
+
output.writeStructBegin("SignIn__Args");
|
|
348
|
+
if (obj.reason != null) {
|
|
349
|
+
output.writeFieldBegin("reason", thrift.TType.I32, 1);
|
|
350
|
+
output.writeI32(obj.reason);
|
|
351
|
+
output.writeFieldEnd();
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[reason] is unset!");
|
|
355
|
+
}
|
|
356
|
+
if (obj.referrer != null) {
|
|
357
|
+
output.writeFieldBegin("referrer", thrift.TType.I32, 2);
|
|
358
|
+
output.writeI32(obj.referrer);
|
|
359
|
+
output.writeFieldEnd();
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[referrer] is unset!");
|
|
363
|
+
}
|
|
364
|
+
output.writeFieldStop();
|
|
365
|
+
output.writeStructEnd();
|
|
366
|
+
return;
|
|
367
|
+
},
|
|
368
|
+
decode(input) {
|
|
369
|
+
let _args = {};
|
|
370
|
+
input.readStructBegin();
|
|
371
|
+
while (true) {
|
|
372
|
+
const ret = input.readFieldBegin();
|
|
373
|
+
const fieldType = ret.fieldType;
|
|
374
|
+
const fieldId = ret.fieldId;
|
|
375
|
+
if (fieldType === thrift.TType.STOP) {
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
switch (fieldId) {
|
|
379
|
+
case 1:
|
|
380
|
+
if (fieldType === thrift.TType.I32) {
|
|
381
|
+
const value_7 = input.readI32();
|
|
382
|
+
_args.reason = value_7;
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
input.skip(fieldType);
|
|
386
|
+
}
|
|
387
|
+
break;
|
|
388
|
+
case 2:
|
|
389
|
+
if (fieldType === thrift.TType.I32) {
|
|
390
|
+
const value_8 = input.readI32();
|
|
391
|
+
_args.referrer = value_8;
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
input.skip(fieldType);
|
|
395
|
+
}
|
|
396
|
+
break;
|
|
397
|
+
default: {
|
|
398
|
+
input.skip(fieldType);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
input.readFieldEnd();
|
|
402
|
+
}
|
|
403
|
+
input.readStructEnd();
|
|
404
|
+
if (_args.reason !== undefined && _args.referrer !== undefined) {
|
|
405
|
+
return {
|
|
406
|
+
reason: _args.reason,
|
|
407
|
+
referrer: _args.referrer
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
else {
|
|
411
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read SignIn__Args from input");
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
class SignIn__Args extends thrift.StructLike {
|
|
416
|
+
constructor(args) {
|
|
417
|
+
super();
|
|
418
|
+
this._annotations = {};
|
|
419
|
+
this._fieldAnnotations = {};
|
|
420
|
+
if (args.reason != null) {
|
|
421
|
+
const value_9 = args.reason;
|
|
422
|
+
this.reason = value_9;
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[reason] is unset!");
|
|
426
|
+
}
|
|
427
|
+
if (args.referrer != null) {
|
|
428
|
+
const value_10 = args.referrer;
|
|
429
|
+
this.referrer = value_10;
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[referrer] is unset!");
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
static read(input) {
|
|
436
|
+
return new SignIn__Args(exports.SignIn__ArgsCodec.decode(input));
|
|
437
|
+
}
|
|
438
|
+
static write(args, output) {
|
|
439
|
+
return exports.SignIn__ArgsCodec.encode(args, output);
|
|
440
|
+
}
|
|
441
|
+
write(output) {
|
|
442
|
+
return exports.SignIn__ArgsCodec.encode(this, output);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
exports.SignIn__Args = SignIn__Args;
|
|
287
446
|
exports.IsPremium__ResultCodec = {
|
|
288
447
|
encode(args, output) {
|
|
289
448
|
const obj = {
|
|
@@ -312,8 +471,8 @@ exports.IsPremium__ResultCodec = {
|
|
|
312
471
|
switch (fieldId) {
|
|
313
472
|
case 0:
|
|
314
473
|
if (fieldType === thrift.TType.BOOL) {
|
|
315
|
-
const
|
|
316
|
-
_args.success =
|
|
474
|
+
const value_11 = input.readBool();
|
|
475
|
+
_args.success = value_11;
|
|
317
476
|
}
|
|
318
477
|
else {
|
|
319
478
|
input.skip(fieldType);
|
|
@@ -337,8 +496,8 @@ class IsPremium__Result extends thrift.StructLike {
|
|
|
337
496
|
this._annotations = {};
|
|
338
497
|
this._fieldAnnotations = {};
|
|
339
498
|
if (args.success != null) {
|
|
340
|
-
const
|
|
341
|
-
this.success =
|
|
499
|
+
const value_12 = args.success;
|
|
500
|
+
this.success = value_12;
|
|
342
501
|
}
|
|
343
502
|
}
|
|
344
503
|
static read(input) {
|
|
@@ -361,8 +520,8 @@ exports.FilterSeenArticles__ResultCodec = {
|
|
|
361
520
|
if (obj.success != null) {
|
|
362
521
|
output.writeFieldBegin("success", thrift.TType.LIST, 0);
|
|
363
522
|
output.writeListBegin(thrift.TType.STRING, obj.success.length);
|
|
364
|
-
obj.success.forEach((
|
|
365
|
-
output.writeString(
|
|
523
|
+
obj.success.forEach((value_13) => {
|
|
524
|
+
output.writeString(value_13);
|
|
366
525
|
});
|
|
367
526
|
output.writeListEnd();
|
|
368
527
|
output.writeFieldEnd();
|
|
@@ -384,15 +543,15 @@ exports.FilterSeenArticles__ResultCodec = {
|
|
|
384
543
|
switch (fieldId) {
|
|
385
544
|
case 0:
|
|
386
545
|
if (fieldType === thrift.TType.LIST) {
|
|
387
|
-
const
|
|
546
|
+
const value_14 = new Array();
|
|
388
547
|
const metadata_2 = input.readListBegin();
|
|
389
548
|
const size_2 = metadata_2.size;
|
|
390
549
|
for (let i_2 = 0; i_2 < size_2; i_2++) {
|
|
391
|
-
const
|
|
392
|
-
|
|
550
|
+
const value_15 = input.readString();
|
|
551
|
+
value_14.push(value_15);
|
|
393
552
|
}
|
|
394
553
|
input.readListEnd();
|
|
395
|
-
_args.success =
|
|
554
|
+
_args.success = value_14;
|
|
396
555
|
}
|
|
397
556
|
else {
|
|
398
557
|
input.skip(fieldType);
|
|
@@ -416,12 +575,12 @@ class FilterSeenArticles__Result extends thrift.StructLike {
|
|
|
416
575
|
this._annotations = {};
|
|
417
576
|
this._fieldAnnotations = {};
|
|
418
577
|
if (args.success != null) {
|
|
419
|
-
const
|
|
420
|
-
args.success.forEach((
|
|
421
|
-
const
|
|
422
|
-
|
|
578
|
+
const value_16 = new Array();
|
|
579
|
+
args.success.forEach((value_17) => {
|
|
580
|
+
const value_18 = value_17;
|
|
581
|
+
value_16.push(value_18);
|
|
423
582
|
});
|
|
424
|
-
this.success =
|
|
583
|
+
this.success = value_16;
|
|
425
584
|
}
|
|
426
585
|
}
|
|
427
586
|
static read(input) {
|
|
@@ -463,8 +622,8 @@ exports.DiscussionId__ResultCodec = {
|
|
|
463
622
|
switch (fieldId) {
|
|
464
623
|
case 0:
|
|
465
624
|
if (fieldType === thrift.TType.STRING) {
|
|
466
|
-
const
|
|
467
|
-
_args.success =
|
|
625
|
+
const value_19 = input.readString();
|
|
626
|
+
_args.success = value_19;
|
|
468
627
|
}
|
|
469
628
|
else {
|
|
470
629
|
input.skip(fieldType);
|
|
@@ -488,8 +647,8 @@ class DiscussionId__Result extends thrift.StructLike {
|
|
|
488
647
|
this._annotations = {};
|
|
489
648
|
this._fieldAnnotations = {};
|
|
490
649
|
if (args.success != null) {
|
|
491
|
-
const
|
|
492
|
-
this.success =
|
|
650
|
+
const value_20 = args.success;
|
|
651
|
+
this.success = value_20;
|
|
493
652
|
}
|
|
494
653
|
}
|
|
495
654
|
static read(input) {
|
|
@@ -531,8 +690,8 @@ exports.DoesCcpaApply__ResultCodec = {
|
|
|
531
690
|
switch (fieldId) {
|
|
532
691
|
case 0:
|
|
533
692
|
if (fieldType === thrift.TType.BOOL) {
|
|
534
|
-
const
|
|
535
|
-
_args.success =
|
|
693
|
+
const value_21 = input.readBool();
|
|
694
|
+
_args.success = value_21;
|
|
536
695
|
}
|
|
537
696
|
else {
|
|
538
697
|
input.skip(fieldType);
|
|
@@ -556,8 +715,8 @@ class DoesCcpaApply__Result extends thrift.StructLike {
|
|
|
556
715
|
this._annotations = {};
|
|
557
716
|
this._fieldAnnotations = {};
|
|
558
717
|
if (args.success != null) {
|
|
559
|
-
const
|
|
560
|
-
this.success =
|
|
718
|
+
const value_22 = args.success;
|
|
719
|
+
this.success = value_22;
|
|
561
720
|
}
|
|
562
721
|
}
|
|
563
722
|
static read(input) {
|
|
@@ -571,6 +730,133 @@ class DoesCcpaApply__Result extends thrift.StructLike {
|
|
|
571
730
|
}
|
|
572
731
|
}
|
|
573
732
|
exports.DoesCcpaApply__Result = DoesCcpaApply__Result;
|
|
733
|
+
exports.IsSignedIn__ResultCodec = {
|
|
734
|
+
encode(args, output) {
|
|
735
|
+
const obj = {
|
|
736
|
+
success: args.success
|
|
737
|
+
};
|
|
738
|
+
output.writeStructBegin("IsSignedIn__Result");
|
|
739
|
+
if (obj.success != null) {
|
|
740
|
+
output.writeFieldBegin("success", thrift.TType.BOOL, 0);
|
|
741
|
+
output.writeBool(obj.success);
|
|
742
|
+
output.writeFieldEnd();
|
|
743
|
+
}
|
|
744
|
+
output.writeFieldStop();
|
|
745
|
+
output.writeStructEnd();
|
|
746
|
+
return;
|
|
747
|
+
},
|
|
748
|
+
decode(input) {
|
|
749
|
+
let _args = {};
|
|
750
|
+
input.readStructBegin();
|
|
751
|
+
while (true) {
|
|
752
|
+
const ret = input.readFieldBegin();
|
|
753
|
+
const fieldType = ret.fieldType;
|
|
754
|
+
const fieldId = ret.fieldId;
|
|
755
|
+
if (fieldType === thrift.TType.STOP) {
|
|
756
|
+
break;
|
|
757
|
+
}
|
|
758
|
+
switch (fieldId) {
|
|
759
|
+
case 0:
|
|
760
|
+
if (fieldType === thrift.TType.BOOL) {
|
|
761
|
+
const value_23 = input.readBool();
|
|
762
|
+
_args.success = value_23;
|
|
763
|
+
}
|
|
764
|
+
else {
|
|
765
|
+
input.skip(fieldType);
|
|
766
|
+
}
|
|
767
|
+
break;
|
|
768
|
+
default: {
|
|
769
|
+
input.skip(fieldType);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
input.readFieldEnd();
|
|
773
|
+
}
|
|
774
|
+
input.readStructEnd();
|
|
775
|
+
return {
|
|
776
|
+
success: _args.success
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
};
|
|
780
|
+
class IsSignedIn__Result extends thrift.StructLike {
|
|
781
|
+
constructor(args = {}) {
|
|
782
|
+
super();
|
|
783
|
+
this._annotations = {};
|
|
784
|
+
this._fieldAnnotations = {};
|
|
785
|
+
if (args.success != null) {
|
|
786
|
+
const value_24 = args.success;
|
|
787
|
+
this.success = value_24;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
static read(input) {
|
|
791
|
+
return new IsSignedIn__Result(exports.IsSignedIn__ResultCodec.decode(input));
|
|
792
|
+
}
|
|
793
|
+
static write(args, output) {
|
|
794
|
+
return exports.IsSignedIn__ResultCodec.encode(args, output);
|
|
795
|
+
}
|
|
796
|
+
write(output) {
|
|
797
|
+
return exports.IsSignedIn__ResultCodec.encode(this, output);
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
exports.IsSignedIn__Result = IsSignedIn__Result;
|
|
801
|
+
exports.SignIn__ResultCodec = {
|
|
802
|
+
encode(args, output) {
|
|
803
|
+
output.writeStructBegin("SignIn__Result");
|
|
804
|
+
output.writeFieldStop();
|
|
805
|
+
output.writeStructEnd();
|
|
806
|
+
return;
|
|
807
|
+
},
|
|
808
|
+
decode(input) {
|
|
809
|
+
let _args = {};
|
|
810
|
+
input.readStructBegin();
|
|
811
|
+
while (true) {
|
|
812
|
+
const ret = input.readFieldBegin();
|
|
813
|
+
const fieldType = ret.fieldType;
|
|
814
|
+
const fieldId = ret.fieldId;
|
|
815
|
+
if (fieldType === thrift.TType.STOP) {
|
|
816
|
+
break;
|
|
817
|
+
}
|
|
818
|
+
switch (fieldId) {
|
|
819
|
+
case 0:
|
|
820
|
+
if (fieldType === thrift.TType.VOID) {
|
|
821
|
+
input.skip(fieldType);
|
|
822
|
+
}
|
|
823
|
+
else {
|
|
824
|
+
input.skip(fieldType);
|
|
825
|
+
}
|
|
826
|
+
break;
|
|
827
|
+
default: {
|
|
828
|
+
input.skip(fieldType);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
input.readFieldEnd();
|
|
832
|
+
}
|
|
833
|
+
input.readStructEnd();
|
|
834
|
+
return {
|
|
835
|
+
success: _args.success
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
};
|
|
839
|
+
class SignIn__Result extends thrift.StructLike {
|
|
840
|
+
constructor(args = {}) {
|
|
841
|
+
super();
|
|
842
|
+
this._annotations = {};
|
|
843
|
+
this._fieldAnnotations = {};
|
|
844
|
+
if (args.success != null) {
|
|
845
|
+
const value_25 = undefined;
|
|
846
|
+
this.success = value_25;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
static read(input) {
|
|
850
|
+
return new SignIn__Result(exports.SignIn__ResultCodec.decode(input));
|
|
851
|
+
}
|
|
852
|
+
static write(args, output) {
|
|
853
|
+
return exports.SignIn__ResultCodec.encode(args, output);
|
|
854
|
+
}
|
|
855
|
+
write(output) {
|
|
856
|
+
return exports.SignIn__ResultCodec.encode(this, output);
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
exports.SignIn__Result = SignIn__Result;
|
|
574
860
|
class Client extends thrift.ThriftClient {
|
|
575
861
|
constructor() {
|
|
576
862
|
super(...arguments);
|
|
@@ -732,6 +1018,77 @@ class Client extends thrift.ThriftClient {
|
|
|
732
1018
|
}
|
|
733
1019
|
});
|
|
734
1020
|
}
|
|
1021
|
+
isSignedIn(context) {
|
|
1022
|
+
const writer = new this.transport();
|
|
1023
|
+
const output = new this.protocol(writer);
|
|
1024
|
+
output.writeMessageBegin("isSignedIn", thrift.MessageType.CALL, this.incrementRequestId());
|
|
1025
|
+
const args = {};
|
|
1026
|
+
exports.IsSignedIn__ArgsCodec.encode(args, output);
|
|
1027
|
+
output.writeMessageEnd();
|
|
1028
|
+
return this.connection.send(writer.flush(), context).then((data) => {
|
|
1029
|
+
const reader = this.transport.receiver(data);
|
|
1030
|
+
const input = new this.protocol(reader);
|
|
1031
|
+
try {
|
|
1032
|
+
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
|
|
1033
|
+
if (fieldName === "isSignedIn") {
|
|
1034
|
+
if (messageType === thrift.MessageType.EXCEPTION) {
|
|
1035
|
+
const err = thrift.TApplicationExceptionCodec.decode(input);
|
|
1036
|
+
input.readMessageEnd();
|
|
1037
|
+
return Promise.reject(err);
|
|
1038
|
+
}
|
|
1039
|
+
else {
|
|
1040
|
+
const result = exports.IsSignedIn__ResultCodec.decode(input);
|
|
1041
|
+
input.readMessageEnd();
|
|
1042
|
+
if (result.success != null) {
|
|
1043
|
+
return Promise.resolve(result.success);
|
|
1044
|
+
}
|
|
1045
|
+
else {
|
|
1046
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "isSignedIn failed: unknown result"));
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
else {
|
|
1051
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
catch (err) {
|
|
1055
|
+
return Promise.reject(err);
|
|
1056
|
+
}
|
|
1057
|
+
});
|
|
1058
|
+
}
|
|
1059
|
+
signIn(reason, referrer, context) {
|
|
1060
|
+
const writer = new this.transport();
|
|
1061
|
+
const output = new this.protocol(writer);
|
|
1062
|
+
output.writeMessageBegin("signIn", thrift.MessageType.CALL, this.incrementRequestId());
|
|
1063
|
+
const args = { reason, referrer };
|
|
1064
|
+
exports.SignIn__ArgsCodec.encode(args, output);
|
|
1065
|
+
output.writeMessageEnd();
|
|
1066
|
+
return this.connection.send(writer.flush(), context).then((data) => {
|
|
1067
|
+
const reader = this.transport.receiver(data);
|
|
1068
|
+
const input = new this.protocol(reader);
|
|
1069
|
+
try {
|
|
1070
|
+
const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
|
|
1071
|
+
if (fieldName === "signIn") {
|
|
1072
|
+
if (messageType === thrift.MessageType.EXCEPTION) {
|
|
1073
|
+
const err = thrift.TApplicationExceptionCodec.decode(input);
|
|
1074
|
+
input.readMessageEnd();
|
|
1075
|
+
return Promise.reject(err);
|
|
1076
|
+
}
|
|
1077
|
+
else {
|
|
1078
|
+
const result = exports.SignIn__ResultCodec.decode(input);
|
|
1079
|
+
input.readMessageEnd();
|
|
1080
|
+
return Promise.resolve(result.success);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
else {
|
|
1084
|
+
return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
catch (err) {
|
|
1088
|
+
return Promise.reject(err);
|
|
1089
|
+
}
|
|
1090
|
+
});
|
|
1091
|
+
}
|
|
735
1092
|
}
|
|
736
1093
|
exports.Client = Client;
|
|
737
1094
|
Client.serviceName = exports.serviceName;
|
|
@@ -770,6 +1127,14 @@ class Processor extends thrift.ThriftProcessor {
|
|
|
770
1127
|
resolve(this.process_doesCcpaApply(requestId, input, output, context));
|
|
771
1128
|
break;
|
|
772
1129
|
}
|
|
1130
|
+
case "process_isSignedIn": {
|
|
1131
|
+
resolve(this.process_isSignedIn(requestId, input, output, context));
|
|
1132
|
+
break;
|
|
1133
|
+
}
|
|
1134
|
+
case "process_signIn": {
|
|
1135
|
+
resolve(this.process_signIn(requestId, input, output, context));
|
|
1136
|
+
break;
|
|
1137
|
+
}
|
|
773
1138
|
default: {
|
|
774
1139
|
input.skip(thrift.TType.STRUCT);
|
|
775
1140
|
input.readMessageEnd();
|
|
@@ -877,6 +1242,53 @@ class Processor extends thrift.ThriftProcessor {
|
|
|
877
1242
|
return output.flush();
|
|
878
1243
|
});
|
|
879
1244
|
}
|
|
1245
|
+
process_isSignedIn(requestId, input, output, context) {
|
|
1246
|
+
return new Promise((resolve, reject) => {
|
|
1247
|
+
try {
|
|
1248
|
+
input.readMessageEnd();
|
|
1249
|
+
resolve(this._handler.isSignedIn(context));
|
|
1250
|
+
}
|
|
1251
|
+
catch (err) {
|
|
1252
|
+
reject(err);
|
|
1253
|
+
}
|
|
1254
|
+
}).then((data) => {
|
|
1255
|
+
const result = { success: data };
|
|
1256
|
+
output.writeMessageBegin("isSignedIn", thrift.MessageType.REPLY, requestId);
|
|
1257
|
+
exports.IsSignedIn__ResultCodec.encode(result, output);
|
|
1258
|
+
output.writeMessageEnd();
|
|
1259
|
+
return output.flush();
|
|
1260
|
+
}).catch((err) => {
|
|
1261
|
+
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
|
1262
|
+
output.writeMessageBegin("isSignedIn", thrift.MessageType.EXCEPTION, requestId);
|
|
1263
|
+
thrift.TApplicationExceptionCodec.encode(result, output);
|
|
1264
|
+
output.writeMessageEnd();
|
|
1265
|
+
return output.flush();
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
process_signIn(requestId, input, output, context) {
|
|
1269
|
+
return new Promise((resolve, reject) => {
|
|
1270
|
+
try {
|
|
1271
|
+
const args = exports.SignIn__ArgsCodec.decode(input);
|
|
1272
|
+
input.readMessageEnd();
|
|
1273
|
+
resolve(this._handler.signIn(args.reason, args.referrer, context));
|
|
1274
|
+
}
|
|
1275
|
+
catch (err) {
|
|
1276
|
+
reject(err);
|
|
1277
|
+
}
|
|
1278
|
+
}).then((data) => {
|
|
1279
|
+
const result = { success: data };
|
|
1280
|
+
output.writeMessageBegin("signIn", thrift.MessageType.REPLY, requestId);
|
|
1281
|
+
exports.SignIn__ResultCodec.encode(result, output);
|
|
1282
|
+
output.writeMessageEnd();
|
|
1283
|
+
return output.flush();
|
|
1284
|
+
}).catch((err) => {
|
|
1285
|
+
const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
|
1286
|
+
output.writeMessageBegin("signIn", thrift.MessageType.EXCEPTION, requestId);
|
|
1287
|
+
thrift.TApplicationExceptionCodec.encode(result, output);
|
|
1288
|
+
output.writeMessageEnd();
|
|
1289
|
+
return output.flush();
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
880
1292
|
}
|
|
881
1293
|
exports.Processor = Processor;
|
|
882
1294
|
Processor.serviceName = exports.serviceName;
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export * from "./PurchaseScreenReason";
|
|
2
|
+
export * from "./SignInScreenReason";
|
|
3
|
+
export * from "./SignInScreenReferrer";
|
|
4
|
+
export * from "./DiscussionNativeError";
|
|
2
5
|
export * from "./Rect";
|
|
3
6
|
export * from "./AdSlot";
|
|
4
7
|
export * from "./Topic";
|
|
@@ -8,8 +11,9 @@ export * from "./MaybeEpic";
|
|
|
8
11
|
export * from "./VideoSlot";
|
|
9
12
|
export * from "./MetricPaint";
|
|
10
13
|
export * from "./MetricFont";
|
|
11
|
-
export * from "./
|
|
14
|
+
export * from "./DiscussionApiResponse";
|
|
12
15
|
export * from "./Metric";
|
|
16
|
+
export * from "./DiscussionResponse";
|
|
13
17
|
import * as Environment from "./Environment";
|
|
14
18
|
export { Environment as Environment };
|
|
15
19
|
import * as Commercial from "./Commercial";
|
package/index.js
CHANGED
|
@@ -34,6 +34,9 @@ exports.Newsletters = exports.Navigation = exports.Analytics = exports.Discussio
|
|
|
34
34
|
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
35
35
|
*/
|
|
36
36
|
__exportStar(require("./PurchaseScreenReason"), exports);
|
|
37
|
+
__exportStar(require("./SignInScreenReason"), exports);
|
|
38
|
+
__exportStar(require("./SignInScreenReferrer"), exports);
|
|
39
|
+
__exportStar(require("./DiscussionNativeError"), exports);
|
|
37
40
|
__exportStar(require("./Rect"), exports);
|
|
38
41
|
__exportStar(require("./AdSlot"), exports);
|
|
39
42
|
__exportStar(require("./Topic"), exports);
|
|
@@ -43,8 +46,9 @@ __exportStar(require("./MaybeEpic"), exports);
|
|
|
43
46
|
__exportStar(require("./VideoSlot"), exports);
|
|
44
47
|
__exportStar(require("./MetricPaint"), exports);
|
|
45
48
|
__exportStar(require("./MetricFont"), exports);
|
|
46
|
-
__exportStar(require("./
|
|
49
|
+
__exportStar(require("./DiscussionApiResponse"), exports);
|
|
47
50
|
__exportStar(require("./Metric"), exports);
|
|
51
|
+
__exportStar(require("./DiscussionResponse"), exports);
|
|
48
52
|
const Environment = __importStar(require("./Environment"));
|
|
49
53
|
exports.Environment = Environment;
|
|
50
54
|
const Commercial = __importStar(require("./Commercial"));
|
package/package.json
CHANGED
package/CommentResponse.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as thrift from "@creditkarma/thrift-server-core";
|
|
2
|
-
export interface ICommentResponse {
|
|
3
|
-
status: string;
|
|
4
|
-
statusCode: number;
|
|
5
|
-
message: string;
|
|
6
|
-
errorCode?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ICommentResponseArgs {
|
|
9
|
-
status: string;
|
|
10
|
-
statusCode: number;
|
|
11
|
-
message: string;
|
|
12
|
-
errorCode?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare const CommentResponseCodec: thrift.IStructCodec<ICommentResponseArgs, ICommentResponse>;
|
|
15
|
-
export declare class CommentResponse extends thrift.StructLike implements ICommentResponse {
|
|
16
|
-
status: string;
|
|
17
|
-
statusCode: number;
|
|
18
|
-
message: string;
|
|
19
|
-
errorCode?: string;
|
|
20
|
-
readonly _annotations: thrift.IThriftAnnotations;
|
|
21
|
-
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
22
|
-
constructor(args: ICommentResponseArgs);
|
|
23
|
-
static read(input: thrift.TProtocol): CommentResponse;
|
|
24
|
-
static write(args: ICommentResponseArgs, output: thrift.TProtocol): void;
|
|
25
|
-
write(output: thrift.TProtocol): void;
|
|
26
|
-
}
|