@guardian/bridget 2.8.0 → 2.9.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.
@@ -0,0 +1,7 @@
1
+ export declare enum SignInScreenReason {
2
+ accessDiscussion = 0,
3
+ postComment = 1,
4
+ recommendComment = 2,
5
+ replyToComment = 3,
6
+ reportComment = 4
7
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignInScreenReason = void 0;
4
+ /* tslint:disable */
5
+ /* eslint-disable */
6
+ /*
7
+ * Autogenerated by @creditkarma/thrift-typescript v3.7.6
8
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
9
+ */
10
+ var SignInScreenReason;
11
+ (function (SignInScreenReason) {
12
+ SignInScreenReason[SignInScreenReason["accessDiscussion"] = 0] = "accessDiscussion";
13
+ SignInScreenReason[SignInScreenReason["postComment"] = 1] = "postComment";
14
+ SignInScreenReason[SignInScreenReason["recommendComment"] = 2] = "recommendComment";
15
+ SignInScreenReason[SignInScreenReason["replyToComment"] = 3] = "replyToComment";
16
+ SignInScreenReason[SignInScreenReason["reportComment"] = 4] = "reportComment";
17
+ })(SignInScreenReason || (exports.SignInScreenReason = SignInScreenReason = {}));
@@ -0,0 +1,7 @@
1
+ export declare enum SignInScreenReferrer {
2
+ accessDiscussion = 0,
3
+ postComment = 1,
4
+ recommendComment = 2,
5
+ replyToComment = 3,
6
+ reportComment = 4
7
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignInScreenReferrer = void 0;
4
+ /* tslint:disable */
5
+ /* eslint-disable */
6
+ /*
7
+ * Autogenerated by @creditkarma/thrift-typescript v3.7.6
8
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
9
+ */
10
+ var SignInScreenReferrer;
11
+ (function (SignInScreenReferrer) {
12
+ SignInScreenReferrer[SignInScreenReferrer["accessDiscussion"] = 0] = "accessDiscussion";
13
+ SignInScreenReferrer[SignInScreenReferrer["postComment"] = 1] = "postComment";
14
+ SignInScreenReferrer[SignInScreenReferrer["recommendComment"] = 2] = "recommendComment";
15
+ SignInScreenReferrer[SignInScreenReferrer["replyToComment"] = 3] = "replyToComment";
16
+ SignInScreenReferrer[SignInScreenReferrer["reportComment"] = 4] = "reportComment";
17
+ })(SignInScreenReferrer || (exports.SignInScreenReferrer = SignInScreenReferrer = {}));
package/User.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
3
  import * as thrift from "@creditkarma/thrift-server-core";
4
+ import * as SignInScreenReason from "./SignInScreenReason";
5
+ import * as SignInScreenReferrer from "./SignInScreenReferrer";
4
6
  export declare const serviceName: string;
5
7
  export declare const annotations: thrift.IThriftAnnotations;
6
8
  export declare const methodAnnotations: thrift.IMethodAnnotations;
@@ -63,6 +65,38 @@ export declare class DoesCcpaApply__Args extends thrift.StructLike implements ID
63
65
  static write(args: IDoesCcpaApply__ArgsArgs, output: thrift.TProtocol): void;
64
66
  write(output: thrift.TProtocol): void;
65
67
  }
68
+ export interface IIsSignedIn__Args {
69
+ }
70
+ export interface IIsSignedIn__ArgsArgs {
71
+ }
72
+ export declare const IsSignedIn__ArgsCodec: thrift.IStructCodec<IIsSignedIn__ArgsArgs, IIsSignedIn__Args>;
73
+ export declare class IsSignedIn__Args extends thrift.StructLike implements IIsSignedIn__Args {
74
+ readonly _annotations: thrift.IThriftAnnotations;
75
+ readonly _fieldAnnotations: thrift.IFieldAnnotations;
76
+ constructor(args?: IIsSignedIn__ArgsArgs);
77
+ static read(input: thrift.TProtocol): IsSignedIn__Args;
78
+ static write(args: IIsSignedIn__ArgsArgs, output: thrift.TProtocol): void;
79
+ write(output: thrift.TProtocol): void;
80
+ }
81
+ export interface ISignIn__Args {
82
+ reason: SignInScreenReason.SignInScreenReason;
83
+ referrer: SignInScreenReferrer.SignInScreenReferrer;
84
+ }
85
+ export interface ISignIn__ArgsArgs {
86
+ reason: SignInScreenReason.SignInScreenReason;
87
+ referrer: SignInScreenReferrer.SignInScreenReferrer;
88
+ }
89
+ export declare const SignIn__ArgsCodec: thrift.IStructCodec<ISignIn__ArgsArgs, ISignIn__Args>;
90
+ export declare class SignIn__Args extends thrift.StructLike implements ISignIn__Args {
91
+ reason: SignInScreenReason.SignInScreenReason;
92
+ referrer: SignInScreenReferrer.SignInScreenReferrer;
93
+ readonly _annotations: thrift.IThriftAnnotations;
94
+ readonly _fieldAnnotations: thrift.IFieldAnnotations;
95
+ constructor(args: ISignIn__ArgsArgs);
96
+ static read(input: thrift.TProtocol): SignIn__Args;
97
+ static write(args: ISignIn__ArgsArgs, output: thrift.TProtocol): void;
98
+ write(output: thrift.TProtocol): void;
99
+ }
66
100
  export interface IIsPremium__Result {
67
101
  success?: boolean;
68
102
  }
@@ -127,6 +161,38 @@ export declare class DoesCcpaApply__Result extends thrift.StructLike implements
127
161
  static write(args: IDoesCcpaApply__ResultArgs, output: thrift.TProtocol): void;
128
162
  write(output: thrift.TProtocol): void;
129
163
  }
164
+ export interface IIsSignedIn__Result {
165
+ success?: boolean;
166
+ }
167
+ export interface IIsSignedIn__ResultArgs {
168
+ success?: boolean;
169
+ }
170
+ export declare const IsSignedIn__ResultCodec: thrift.IStructCodec<IIsSignedIn__ResultArgs, IIsSignedIn__Result>;
171
+ export declare class IsSignedIn__Result extends thrift.StructLike implements IIsSignedIn__Result {
172
+ success?: boolean;
173
+ readonly _annotations: thrift.IThriftAnnotations;
174
+ readonly _fieldAnnotations: thrift.IFieldAnnotations;
175
+ constructor(args?: IIsSignedIn__ResultArgs);
176
+ static read(input: thrift.TProtocol): IsSignedIn__Result;
177
+ static write(args: IIsSignedIn__ResultArgs, output: thrift.TProtocol): void;
178
+ write(output: thrift.TProtocol): void;
179
+ }
180
+ export interface ISignIn__Result {
181
+ success?: void;
182
+ }
183
+ export interface ISignIn__ResultArgs {
184
+ success?: void;
185
+ }
186
+ export declare const SignIn__ResultCodec: thrift.IStructCodec<ISignIn__ResultArgs, ISignIn__Result>;
187
+ export declare class SignIn__Result extends thrift.StructLike implements ISignIn__Result {
188
+ success?: void;
189
+ readonly _annotations: thrift.IThriftAnnotations;
190
+ readonly _fieldAnnotations: thrift.IFieldAnnotations;
191
+ constructor(args?: ISignIn__ResultArgs);
192
+ static read(input: thrift.TProtocol): SignIn__Result;
193
+ static write(args: ISignIn__ResultArgs, output: thrift.TProtocol): void;
194
+ write(output: thrift.TProtocol): void;
195
+ }
130
196
  export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
131
197
  static readonly serviceName: string;
132
198
  static readonly annotations: thrift.IThriftAnnotations;
@@ -143,12 +209,16 @@ export declare class Client<Context = any> extends thrift.ThriftClient<Context>
143
209
  filterSeenArticles(articleIds: Array<string>, context?: Context): Promise<Array<string>>;
144
210
  discussionId(context?: Context): Promise<string>;
145
211
  doesCcpaApply(context?: Context): Promise<boolean>;
212
+ isSignedIn(context?: Context): Promise<boolean>;
213
+ signIn(reason: SignInScreenReason.SignInScreenReason, referrer: SignInScreenReferrer.SignInScreenReferrer, context?: Context): Promise<void>;
146
214
  }
147
215
  export interface IHandler<Context = any> {
148
216
  isPremium(context?: Context): boolean | Promise<boolean>;
149
217
  filterSeenArticles(articleIds: Array<string>, context?: Context): Array<string> | Promise<Array<string>>;
150
218
  discussionId(context?: Context): string | Promise<string>;
151
219
  doesCcpaApply(context?: Context): boolean | Promise<boolean>;
220
+ isSignedIn(context?: Context): boolean | Promise<boolean>;
221
+ signIn(reason: SignInScreenReason.SignInScreenReason, referrer: SignInScreenReferrer.SignInScreenReferrer, context?: Context): void | Promise<void>;
152
222
  }
153
223
  export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
154
224
  protected readonly _handler: IHandler<Context>;
@@ -166,4 +236,6 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Con
166
236
  process_filterSeenArticles(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
167
237
  process_discussionId(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
168
238
  process_doesCcpaApply(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
239
+ process_isSignedIn(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
240
+ process_signIn(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
169
241
  }
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 value_7 = input.readBool();
316
- _args.success = value_7;
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 value_8 = args.success;
341
- this.success = value_8;
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((value_9) => {
365
- output.writeString(value_9);
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 value_10 = new Array();
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 value_11 = input.readString();
392
- value_10.push(value_11);
550
+ const value_15 = input.readString();
551
+ value_14.push(value_15);
393
552
  }
394
553
  input.readListEnd();
395
- _args.success = value_10;
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 value_12 = new Array();
420
- args.success.forEach((value_13) => {
421
- const value_14 = value_13;
422
- value_12.push(value_14);
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 = value_12;
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 value_15 = input.readString();
467
- _args.success = value_15;
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 value_16 = args.success;
492
- this.success = value_16;
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 value_17 = input.readBool();
535
- _args.success = value_17;
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 value_18 = args.success;
560
- this.success = value_18;
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,6 @@
1
1
  export * from "./PurchaseScreenReason";
2
+ export * from "./SignInScreenReason";
3
+ export * from "./SignInScreenReferrer";
2
4
  export * from "./Rect";
3
5
  export * from "./AdSlot";
4
6
  export * from "./Topic";
package/index.js CHANGED
@@ -34,6 +34,8 @@ 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);
37
39
  __exportStar(require("./Rect"), exports);
38
40
  __exportStar(require("./AdSlot"), exports);
39
41
  __exportStar(require("./Topic"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/bridget",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {