@guardian/bridget 7.0.0 → 8.1.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,73 @@
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 IDisableArticleSwipe__Args {
12
+ disableSwipe: boolean;
13
+ }
14
+ export interface IDisableArticleSwipe__ArgsArgs {
15
+ disableSwipe: boolean;
16
+ }
17
+ export declare const DisableArticleSwipe__ArgsCodec: thrift.IStructCodec<IDisableArticleSwipe__ArgsArgs, IDisableArticleSwipe__Args>;
18
+ export declare class DisableArticleSwipe__Args extends thrift.StructLike implements IDisableArticleSwipe__Args {
19
+ disableSwipe: boolean;
20
+ readonly _annotations: thrift.IThriftAnnotations;
21
+ readonly _fieldAnnotations: thrift.IFieldAnnotations;
22
+ constructor(args: IDisableArticleSwipe__ArgsArgs);
23
+ static read(input: thrift.TProtocol): DisableArticleSwipe__Args;
24
+ static write(args: IDisableArticleSwipe__ArgsArgs, output: thrift.TProtocol): void;
25
+ write(output: thrift.TProtocol): void;
26
+ }
27
+ export interface IDisableArticleSwipe__Result {
28
+ success?: void;
29
+ }
30
+ export interface IDisableArticleSwipe__ResultArgs {
31
+ success?: void;
32
+ }
33
+ export declare const DisableArticleSwipe__ResultCodec: thrift.IStructCodec<IDisableArticleSwipe__ResultArgs, IDisableArticleSwipe__Result>;
34
+ export declare class DisableArticleSwipe__Result extends thrift.StructLike implements IDisableArticleSwipe__Result {
35
+ success?: void;
36
+ readonly _annotations: thrift.IThriftAnnotations;
37
+ readonly _fieldAnnotations: thrift.IFieldAnnotations;
38
+ constructor(args?: IDisableArticleSwipe__ResultArgs);
39
+ static read(input: thrift.TProtocol): DisableArticleSwipe__Result;
40
+ static write(args: IDisableArticleSwipe__ResultArgs, output: thrift.TProtocol): void;
41
+ write(output: thrift.TProtocol): void;
42
+ }
43
+ export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
44
+ static readonly serviceName: string;
45
+ static readonly annotations: thrift.IThriftAnnotations;
46
+ static readonly methodAnnotations: thrift.IMethodAnnotations;
47
+ static readonly methodNames: Array<string>;
48
+ readonly _serviceName: string;
49
+ readonly _annotations: thrift.IThriftAnnotations;
50
+ readonly _methodAnnotations: thrift.IMethodAnnotations;
51
+ readonly _methodNames: Array<string>;
52
+ readonly _methodParameters?: {
53
+ [methodName: string]: number;
54
+ };
55
+ disableArticleSwipe(disableSwipe: boolean, context?: Context): Promise<void>;
56
+ }
57
+ export interface IHandler<Context = any> {
58
+ disableArticleSwipe(disableSwipe: boolean, context?: Context): void | Promise<void>;
59
+ }
60
+ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
61
+ protected readonly _handler: IHandler<Context>;
62
+ static readonly serviceName: string;
63
+ static readonly annotations: thrift.IThriftAnnotations;
64
+ static readonly methodAnnotations: thrift.IMethodAnnotations;
65
+ static readonly methodNames: Array<string>;
66
+ readonly _serviceName: string;
67
+ readonly _annotations: thrift.IThriftAnnotations;
68
+ readonly _methodAnnotations: thrift.IMethodAnnotations;
69
+ readonly _methodNames: Array<string>;
70
+ constructor(handler: IHandler<Context>);
71
+ process(input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
72
+ process_disableArticleSwipe(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
73
+ }
package/Interaction.js ADDED
@@ -0,0 +1,295 @@
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.DisableArticleSwipe__Result = exports.DisableArticleSwipe__ResultCodec = exports.DisableArticleSwipe__Args = exports.DisableArticleSwipe__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 = "Interaction";
35
+ exports.annotations = {};
36
+ exports.methodAnnotations = {
37
+ disableArticleSwipe: {
38
+ annotations: {},
39
+ fieldAnnotations: {}
40
+ }
41
+ };
42
+ exports.methodNames = ["disableArticleSwipe"];
43
+ exports.methodParameters = {
44
+ disableArticleSwipe: 2
45
+ };
46
+ exports.DisableArticleSwipe__ArgsCodec = {
47
+ encode(args, output) {
48
+ const obj = {
49
+ disableSwipe: args.disableSwipe
50
+ };
51
+ output.writeStructBegin("DisableArticleSwipe__Args");
52
+ if (obj.disableSwipe != null) {
53
+ output.writeFieldBegin("disableSwipe", thrift.TType.BOOL, 1);
54
+ output.writeBool(obj.disableSwipe);
55
+ output.writeFieldEnd();
56
+ }
57
+ else {
58
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[disableSwipe] is unset!");
59
+ }
60
+ output.writeFieldStop();
61
+ output.writeStructEnd();
62
+ return;
63
+ },
64
+ decode(input) {
65
+ let _args = {};
66
+ input.readStructBegin();
67
+ while (true) {
68
+ const ret = input.readFieldBegin();
69
+ const fieldType = ret.fieldType;
70
+ const fieldId = ret.fieldId;
71
+ if (fieldType === thrift.TType.STOP) {
72
+ break;
73
+ }
74
+ switch (fieldId) {
75
+ case 1:
76
+ if (fieldType === thrift.TType.BOOL) {
77
+ const value_1 = input.readBool();
78
+ _args.disableSwipe = value_1;
79
+ }
80
+ else {
81
+ input.skip(fieldType);
82
+ }
83
+ break;
84
+ default: {
85
+ input.skip(fieldType);
86
+ }
87
+ }
88
+ input.readFieldEnd();
89
+ }
90
+ input.readStructEnd();
91
+ if (_args.disableSwipe !== undefined) {
92
+ return {
93
+ disableSwipe: _args.disableSwipe
94
+ };
95
+ }
96
+ else {
97
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read DisableArticleSwipe__Args from input");
98
+ }
99
+ }
100
+ };
101
+ class DisableArticleSwipe__Args extends thrift.StructLike {
102
+ constructor(args) {
103
+ super();
104
+ this._annotations = {};
105
+ this._fieldAnnotations = {};
106
+ if (args.disableSwipe != null) {
107
+ const value_2 = args.disableSwipe;
108
+ this.disableSwipe = value_2;
109
+ }
110
+ else {
111
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[disableSwipe] is unset!");
112
+ }
113
+ }
114
+ static read(input) {
115
+ return new DisableArticleSwipe__Args(exports.DisableArticleSwipe__ArgsCodec.decode(input));
116
+ }
117
+ static write(args, output) {
118
+ return exports.DisableArticleSwipe__ArgsCodec.encode(args, output);
119
+ }
120
+ write(output) {
121
+ return exports.DisableArticleSwipe__ArgsCodec.encode(this, output);
122
+ }
123
+ }
124
+ exports.DisableArticleSwipe__Args = DisableArticleSwipe__Args;
125
+ exports.DisableArticleSwipe__ResultCodec = {
126
+ encode(args, output) {
127
+ output.writeStructBegin("DisableArticleSwipe__Result");
128
+ output.writeFieldStop();
129
+ output.writeStructEnd();
130
+ return;
131
+ },
132
+ decode(input) {
133
+ let _args = {};
134
+ input.readStructBegin();
135
+ while (true) {
136
+ const ret = input.readFieldBegin();
137
+ const fieldType = ret.fieldType;
138
+ const fieldId = ret.fieldId;
139
+ if (fieldType === thrift.TType.STOP) {
140
+ break;
141
+ }
142
+ switch (fieldId) {
143
+ case 0:
144
+ if (fieldType === thrift.TType.VOID) {
145
+ input.skip(fieldType);
146
+ }
147
+ else {
148
+ input.skip(fieldType);
149
+ }
150
+ break;
151
+ default: {
152
+ input.skip(fieldType);
153
+ }
154
+ }
155
+ input.readFieldEnd();
156
+ }
157
+ input.readStructEnd();
158
+ return {
159
+ success: _args.success
160
+ };
161
+ }
162
+ };
163
+ class DisableArticleSwipe__Result extends thrift.StructLike {
164
+ constructor(args = {}) {
165
+ super();
166
+ this._annotations = {};
167
+ this._fieldAnnotations = {};
168
+ if (args.success != null) {
169
+ const value_3 = undefined;
170
+ this.success = value_3;
171
+ }
172
+ }
173
+ static read(input) {
174
+ return new DisableArticleSwipe__Result(exports.DisableArticleSwipe__ResultCodec.decode(input));
175
+ }
176
+ static write(args, output) {
177
+ return exports.DisableArticleSwipe__ResultCodec.encode(args, output);
178
+ }
179
+ write(output) {
180
+ return exports.DisableArticleSwipe__ResultCodec.encode(this, output);
181
+ }
182
+ }
183
+ exports.DisableArticleSwipe__Result = DisableArticleSwipe__Result;
184
+ class Client extends thrift.ThriftClient {
185
+ constructor() {
186
+ super(...arguments);
187
+ this._serviceName = exports.serviceName;
188
+ this._annotations = exports.annotations;
189
+ this._methodAnnotations = exports.methodAnnotations;
190
+ this._methodNames = exports.methodNames;
191
+ this._methodParameters = exports.methodParameters;
192
+ }
193
+ disableArticleSwipe(disableSwipe, context) {
194
+ const writer = new this.transport();
195
+ const output = new this.protocol(writer);
196
+ output.writeMessageBegin("disableArticleSwipe", thrift.MessageType.CALL, this.incrementRequestId());
197
+ const args = { disableSwipe };
198
+ exports.DisableArticleSwipe__ArgsCodec.encode(args, output);
199
+ output.writeMessageEnd();
200
+ return this.connection.send(writer.flush(), context).then((data) => {
201
+ const reader = this.transport.receiver(data);
202
+ const input = new this.protocol(reader);
203
+ try {
204
+ const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
205
+ if (fieldName === "disableArticleSwipe") {
206
+ if (messageType === thrift.MessageType.EXCEPTION) {
207
+ const err = thrift.TApplicationExceptionCodec.decode(input);
208
+ input.readMessageEnd();
209
+ return Promise.reject(err);
210
+ }
211
+ else {
212
+ const result = exports.DisableArticleSwipe__ResultCodec.decode(input);
213
+ input.readMessageEnd();
214
+ return Promise.resolve(result.success);
215
+ }
216
+ }
217
+ else {
218
+ return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.WRONG_METHOD_NAME, "Received a response to an unknown RPC function: " + fieldName));
219
+ }
220
+ }
221
+ catch (err) {
222
+ return Promise.reject(err);
223
+ }
224
+ });
225
+ }
226
+ }
227
+ exports.Client = Client;
228
+ Client.serviceName = exports.serviceName;
229
+ Client.annotations = exports.annotations;
230
+ Client.methodAnnotations = exports.methodAnnotations;
231
+ Client.methodNames = exports.methodNames;
232
+ class Processor extends thrift.ThriftProcessor {
233
+ constructor(handler) {
234
+ super();
235
+ this._serviceName = exports.serviceName;
236
+ this._annotations = exports.annotations;
237
+ this._methodAnnotations = exports.methodAnnotations;
238
+ this._methodNames = exports.methodNames;
239
+ this._handler = handler;
240
+ }
241
+ process(input, output, context) {
242
+ return new Promise((resolve, reject) => {
243
+ const metadata = input.readMessageBegin();
244
+ const fieldName = metadata.fieldName;
245
+ const requestId = metadata.requestId;
246
+ const methodName = "process_" + fieldName;
247
+ switch (methodName) {
248
+ case "process_disableArticleSwipe": {
249
+ resolve(this.process_disableArticleSwipe(requestId, input, output, context));
250
+ break;
251
+ }
252
+ default: {
253
+ input.skip(thrift.TType.STRUCT);
254
+ input.readMessageEnd();
255
+ const errMessage = "Unknown function " + fieldName;
256
+ const err = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN_METHOD, errMessage);
257
+ output.writeMessageBegin(fieldName, thrift.MessageType.EXCEPTION, requestId);
258
+ thrift.TApplicationExceptionCodec.encode(err, output);
259
+ output.writeMessageEnd();
260
+ resolve(output.flush());
261
+ break;
262
+ }
263
+ }
264
+ });
265
+ }
266
+ process_disableArticleSwipe(requestId, input, output, context) {
267
+ return new Promise((resolve, reject) => {
268
+ try {
269
+ const args = exports.DisableArticleSwipe__ArgsCodec.decode(input);
270
+ input.readMessageEnd();
271
+ resolve(this._handler.disableArticleSwipe(args.disableSwipe, context));
272
+ }
273
+ catch (err) {
274
+ reject(err);
275
+ }
276
+ }).then((data) => {
277
+ const result = { success: data };
278
+ output.writeMessageBegin("disableArticleSwipe", thrift.MessageType.REPLY, requestId);
279
+ exports.DisableArticleSwipe__ResultCodec.encode(result, output);
280
+ output.writeMessageEnd();
281
+ return output.flush();
282
+ }).catch((err) => {
283
+ const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
284
+ output.writeMessageBegin("disableArticleSwipe", thrift.MessageType.EXCEPTION, requestId);
285
+ thrift.TApplicationExceptionCodec.encode(result, output);
286
+ output.writeMessageEnd();
287
+ return output.flush();
288
+ });
289
+ }
290
+ }
291
+ exports.Processor = Processor;
292
+ Processor.serviceName = exports.serviceName;
293
+ Processor.annotations = exports.annotations;
294
+ Processor.methodAnnotations = exports.methodAnnotations;
295
+ Processor.methodNames = exports.methodNames;
package/Videos.d.ts CHANGED
@@ -58,17 +58,20 @@ export declare class SendVideoEvent__Args extends thrift.StructLike implements I
58
58
  static write(args: ISendVideoEvent__ArgsArgs, output: thrift.TProtocol): void;
59
59
  write(output: thrift.TProtocol): void;
60
60
  }
61
- export interface IFullscreen__Args {
61
+ export interface ISetFullscreen__Args {
62
+ isFullscreen: boolean;
62
63
  }
63
- export interface IFullscreen__ArgsArgs {
64
+ export interface ISetFullscreen__ArgsArgs {
65
+ isFullscreen: boolean;
64
66
  }
65
- export declare const Fullscreen__ArgsCodec: thrift.IStructCodec<IFullscreen__ArgsArgs, IFullscreen__Args>;
66
- export declare class Fullscreen__Args extends thrift.StructLike implements IFullscreen__Args {
67
+ export declare const SetFullscreen__ArgsCodec: thrift.IStructCodec<ISetFullscreen__ArgsArgs, ISetFullscreen__Args>;
68
+ export declare class SetFullscreen__Args extends thrift.StructLike implements ISetFullscreen__Args {
69
+ isFullscreen: boolean;
67
70
  readonly _annotations: thrift.IThriftAnnotations;
68
71
  readonly _fieldAnnotations: thrift.IFieldAnnotations;
69
- constructor(args?: IFullscreen__ArgsArgs);
70
- static read(input: thrift.TProtocol): Fullscreen__Args;
71
- static write(args: IFullscreen__ArgsArgs, output: thrift.TProtocol): void;
72
+ constructor(args: ISetFullscreen__ArgsArgs);
73
+ static read(input: thrift.TProtocol): SetFullscreen__Args;
74
+ static write(args: ISetFullscreen__ArgsArgs, output: thrift.TProtocol): void;
72
75
  write(output: thrift.TProtocol): void;
73
76
  }
74
77
  export interface IInsertVideos__Result {
@@ -119,20 +122,20 @@ export declare class SendVideoEvent__Result extends thrift.StructLike implements
119
122
  static write(args: ISendVideoEvent__ResultArgs, output: thrift.TProtocol): void;
120
123
  write(output: thrift.TProtocol): void;
121
124
  }
122
- export interface IFullscreen__Result {
123
- success?: void;
125
+ export interface ISetFullscreen__Result {
126
+ success?: boolean;
124
127
  }
125
- export interface IFullscreen__ResultArgs {
126
- success?: void;
128
+ export interface ISetFullscreen__ResultArgs {
129
+ success?: boolean;
127
130
  }
128
- export declare const Fullscreen__ResultCodec: thrift.IStructCodec<IFullscreen__ResultArgs, IFullscreen__Result>;
129
- export declare class Fullscreen__Result extends thrift.StructLike implements IFullscreen__Result {
130
- success?: void;
131
+ export declare const SetFullscreen__ResultCodec: thrift.IStructCodec<ISetFullscreen__ResultArgs, ISetFullscreen__Result>;
132
+ export declare class SetFullscreen__Result extends thrift.StructLike implements ISetFullscreen__Result {
133
+ success?: boolean;
131
134
  readonly _annotations: thrift.IThriftAnnotations;
132
135
  readonly _fieldAnnotations: thrift.IFieldAnnotations;
133
- constructor(args?: IFullscreen__ResultArgs);
134
- static read(input: thrift.TProtocol): Fullscreen__Result;
135
- static write(args: IFullscreen__ResultArgs, output: thrift.TProtocol): void;
136
+ constructor(args?: ISetFullscreen__ResultArgs);
137
+ static read(input: thrift.TProtocol): SetFullscreen__Result;
138
+ static write(args: ISetFullscreen__ResultArgs, output: thrift.TProtocol): void;
136
139
  write(output: thrift.TProtocol): void;
137
140
  }
138
141
  export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
@@ -150,13 +153,13 @@ export declare class Client<Context = any> extends thrift.ThriftClient<Context>
150
153
  insertVideos(videoSlots: Array<VideoSlot.IVideoSlotArgs>, context?: Context): Promise<void>;
151
154
  updateVideos(videoSlots: Array<VideoSlot.IVideoSlotArgs>, context?: Context): Promise<void>;
152
155
  sendVideoEvent(videoEvent: VideoEvent.IVideoEventArgs, context?: Context): Promise<void>;
153
- fullscreen(context?: Context): Promise<void>;
156
+ setFullscreen(isFullscreen: boolean, context?: Context): Promise<boolean>;
154
157
  }
155
158
  export interface IHandler<Context = any> {
156
159
  insertVideos(videoSlots: Array<VideoSlot.IVideoSlot>, context?: Context): void | Promise<void>;
157
160
  updateVideos(videoSlots: Array<VideoSlot.IVideoSlot>, context?: Context): void | Promise<void>;
158
161
  sendVideoEvent(videoEvent: VideoEvent.IVideoEvent, context?: Context): void | Promise<void>;
159
- fullscreen(context?: Context): void | Promise<void>;
162
+ setFullscreen(isFullscreen: boolean, context?: Context): boolean | Promise<boolean>;
160
163
  }
161
164
  export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
162
165
  protected readonly _handler: IHandler<Context>;
@@ -173,5 +176,5 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Con
173
176
  process_insertVideos(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
174
177
  process_updateVideos(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
175
178
  process_sendVideoEvent(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
176
- process_fullscreen(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
179
+ process_setFullscreen(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
177
180
  }
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.Fullscreen__Result = exports.Fullscreen__ResultCodec = exports.SendVideoEvent__Result = exports.SendVideoEvent__ResultCodec = exports.UpdateVideos__Result = exports.UpdateVideos__ResultCodec = exports.InsertVideos__Result = exports.InsertVideos__ResultCodec = exports.Fullscreen__Args = exports.Fullscreen__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.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;
27
27
  /* tslint:disable */
28
28
  /* eslint-disable */
29
29
  /*
@@ -48,17 +48,17 @@ exports.methodAnnotations = {
48
48
  annotations: {},
49
49
  fieldAnnotations: {}
50
50
  },
51
- fullscreen: {
51
+ setFullscreen: {
52
52
  annotations: {},
53
53
  fieldAnnotations: {}
54
54
  }
55
55
  };
56
- exports.methodNames = ["insertVideos", "updateVideos", "sendVideoEvent", "fullscreen"];
56
+ exports.methodNames = ["insertVideos", "updateVideos", "sendVideoEvent", "setFullscreen"];
57
57
  exports.methodParameters = {
58
58
  insertVideos: 2,
59
59
  updateVideos: 2,
60
60
  sendVideoEvent: 2,
61
- fullscreen: 1
61
+ setFullscreen: 2
62
62
  };
63
63
  exports.InsertVideos__ArgsCodec = {
64
64
  encode(args, output) {
@@ -327,14 +327,26 @@ class SendVideoEvent__Args extends thrift.StructLike {
327
327
  }
328
328
  }
329
329
  exports.SendVideoEvent__Args = SendVideoEvent__Args;
330
- exports.Fullscreen__ArgsCodec = {
330
+ exports.SetFullscreen__ArgsCodec = {
331
331
  encode(args, output) {
332
- output.writeStructBegin("Fullscreen__Args");
332
+ const obj = {
333
+ isFullscreen: args.isFullscreen
334
+ };
335
+ output.writeStructBegin("SetFullscreen__Args");
336
+ if (obj.isFullscreen != null) {
337
+ output.writeFieldBegin("isFullscreen", thrift.TType.BOOL, 1);
338
+ output.writeBool(obj.isFullscreen);
339
+ output.writeFieldEnd();
340
+ }
341
+ else {
342
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[isFullscreen] is unset!");
343
+ }
333
344
  output.writeFieldStop();
334
345
  output.writeStructEnd();
335
346
  return;
336
347
  },
337
348
  decode(input) {
349
+ let _args = {};
338
350
  input.readStructBegin();
339
351
  while (true) {
340
352
  const ret = input.readFieldBegin();
@@ -344,6 +356,15 @@ exports.Fullscreen__ArgsCodec = {
344
356
  break;
345
357
  }
346
358
  switch (fieldId) {
359
+ case 1:
360
+ if (fieldType === thrift.TType.BOOL) {
361
+ const value_15 = input.readBool();
362
+ _args.isFullscreen = value_15;
363
+ }
364
+ else {
365
+ input.skip(fieldType);
366
+ }
367
+ break;
347
368
  default: {
348
369
  input.skip(fieldType);
349
370
  }
@@ -351,26 +372,40 @@ exports.Fullscreen__ArgsCodec = {
351
372
  input.readFieldEnd();
352
373
  }
353
374
  input.readStructEnd();
354
- return {};
375
+ if (_args.isFullscreen !== undefined) {
376
+ return {
377
+ isFullscreen: _args.isFullscreen
378
+ };
379
+ }
380
+ else {
381
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read SetFullscreen__Args from input");
382
+ }
355
383
  }
356
384
  };
357
- class Fullscreen__Args extends thrift.StructLike {
358
- constructor(args = {}) {
385
+ class SetFullscreen__Args extends thrift.StructLike {
386
+ constructor(args) {
359
387
  super();
360
388
  this._annotations = {};
361
389
  this._fieldAnnotations = {};
390
+ if (args.isFullscreen != null) {
391
+ const value_16 = args.isFullscreen;
392
+ this.isFullscreen = value_16;
393
+ }
394
+ else {
395
+ throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[isFullscreen] is unset!");
396
+ }
362
397
  }
363
398
  static read(input) {
364
- return new Fullscreen__Args(exports.Fullscreen__ArgsCodec.decode(input));
399
+ return new SetFullscreen__Args(exports.SetFullscreen__ArgsCodec.decode(input));
365
400
  }
366
401
  static write(args, output) {
367
- return exports.Fullscreen__ArgsCodec.encode(args, output);
402
+ return exports.SetFullscreen__ArgsCodec.encode(args, output);
368
403
  }
369
404
  write(output) {
370
- return exports.Fullscreen__ArgsCodec.encode(this, output);
405
+ return exports.SetFullscreen__ArgsCodec.encode(this, output);
371
406
  }
372
407
  }
373
- exports.Fullscreen__Args = Fullscreen__Args;
408
+ exports.SetFullscreen__Args = SetFullscreen__Args;
374
409
  exports.InsertVideos__ResultCodec = {
375
410
  encode(args, output) {
376
411
  output.writeStructBegin("InsertVideos__Result");
@@ -415,8 +450,8 @@ class InsertVideos__Result extends thrift.StructLike {
415
450
  this._annotations = {};
416
451
  this._fieldAnnotations = {};
417
452
  if (args.success != null) {
418
- const value_15 = undefined;
419
- this.success = value_15;
453
+ const value_17 = undefined;
454
+ this.success = value_17;
420
455
  }
421
456
  }
422
457
  static read(input) {
@@ -474,8 +509,8 @@ class UpdateVideos__Result extends thrift.StructLike {
474
509
  this._annotations = {};
475
510
  this._fieldAnnotations = {};
476
511
  if (args.success != null) {
477
- const value_16 = undefined;
478
- this.success = value_16;
512
+ const value_18 = undefined;
513
+ this.success = value_18;
479
514
  }
480
515
  }
481
516
  static read(input) {
@@ -533,8 +568,8 @@ class SendVideoEvent__Result extends thrift.StructLike {
533
568
  this._annotations = {};
534
569
  this._fieldAnnotations = {};
535
570
  if (args.success != null) {
536
- const value_17 = undefined;
537
- this.success = value_17;
571
+ const value_19 = undefined;
572
+ this.success = value_19;
538
573
  }
539
574
  }
540
575
  static read(input) {
@@ -548,9 +583,17 @@ class SendVideoEvent__Result extends thrift.StructLike {
548
583
  }
549
584
  }
550
585
  exports.SendVideoEvent__Result = SendVideoEvent__Result;
551
- exports.Fullscreen__ResultCodec = {
586
+ exports.SetFullscreen__ResultCodec = {
552
587
  encode(args, output) {
553
- output.writeStructBegin("Fullscreen__Result");
588
+ const obj = {
589
+ success: args.success
590
+ };
591
+ output.writeStructBegin("SetFullscreen__Result");
592
+ if (obj.success != null) {
593
+ output.writeFieldBegin("success", thrift.TType.BOOL, 0);
594
+ output.writeBool(obj.success);
595
+ output.writeFieldEnd();
596
+ }
554
597
  output.writeFieldStop();
555
598
  output.writeStructEnd();
556
599
  return;
@@ -567,8 +610,9 @@ exports.Fullscreen__ResultCodec = {
567
610
  }
568
611
  switch (fieldId) {
569
612
  case 0:
570
- if (fieldType === thrift.TType.VOID) {
571
- input.skip(fieldType);
613
+ if (fieldType === thrift.TType.BOOL) {
614
+ const value_20 = input.readBool();
615
+ _args.success = value_20;
572
616
  }
573
617
  else {
574
618
  input.skip(fieldType);
@@ -586,27 +630,27 @@ exports.Fullscreen__ResultCodec = {
586
630
  };
587
631
  }
588
632
  };
589
- class Fullscreen__Result extends thrift.StructLike {
633
+ class SetFullscreen__Result extends thrift.StructLike {
590
634
  constructor(args = {}) {
591
635
  super();
592
636
  this._annotations = {};
593
637
  this._fieldAnnotations = {};
594
638
  if (args.success != null) {
595
- const value_18 = undefined;
596
- this.success = value_18;
639
+ const value_21 = args.success;
640
+ this.success = value_21;
597
641
  }
598
642
  }
599
643
  static read(input) {
600
- return new Fullscreen__Result(exports.Fullscreen__ResultCodec.decode(input));
644
+ return new SetFullscreen__Result(exports.SetFullscreen__ResultCodec.decode(input));
601
645
  }
602
646
  static write(args, output) {
603
- return exports.Fullscreen__ResultCodec.encode(args, output);
647
+ return exports.SetFullscreen__ResultCodec.encode(args, output);
604
648
  }
605
649
  write(output) {
606
- return exports.Fullscreen__ResultCodec.encode(this, output);
650
+ return exports.SetFullscreen__ResultCodec.encode(this, output);
607
651
  }
608
652
  }
609
- exports.Fullscreen__Result = Fullscreen__Result;
653
+ exports.SetFullscreen__Result = SetFullscreen__Result;
610
654
  class Client extends thrift.ThriftClient {
611
655
  constructor() {
612
656
  super(...arguments);
@@ -715,28 +759,33 @@ class Client extends thrift.ThriftClient {
715
759
  }
716
760
  });
717
761
  }
718
- fullscreen(context) {
762
+ setFullscreen(isFullscreen, context) {
719
763
  const writer = new this.transport();
720
764
  const output = new this.protocol(writer);
721
- output.writeMessageBegin("fullscreen", thrift.MessageType.CALL, this.incrementRequestId());
722
- const args = {};
723
- exports.Fullscreen__ArgsCodec.encode(args, output);
765
+ output.writeMessageBegin("setFullscreen", thrift.MessageType.CALL, this.incrementRequestId());
766
+ const args = { isFullscreen };
767
+ exports.SetFullscreen__ArgsCodec.encode(args, output);
724
768
  output.writeMessageEnd();
725
769
  return this.connection.send(writer.flush(), context).then((data) => {
726
770
  const reader = this.transport.receiver(data);
727
771
  const input = new this.protocol(reader);
728
772
  try {
729
773
  const { fieldName: fieldName, messageType: messageType } = input.readMessageBegin();
730
- if (fieldName === "fullscreen") {
774
+ if (fieldName === "setFullscreen") {
731
775
  if (messageType === thrift.MessageType.EXCEPTION) {
732
776
  const err = thrift.TApplicationExceptionCodec.decode(input);
733
777
  input.readMessageEnd();
734
778
  return Promise.reject(err);
735
779
  }
736
780
  else {
737
- const result = exports.Fullscreen__ResultCodec.decode(input);
781
+ const result = exports.SetFullscreen__ResultCodec.decode(input);
738
782
  input.readMessageEnd();
739
- return Promise.resolve(result.success);
783
+ if (result.success != null) {
784
+ return Promise.resolve(result.success);
785
+ }
786
+ else {
787
+ return Promise.reject(new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, "setFullscreen failed: unknown result"));
788
+ }
740
789
  }
741
790
  }
742
791
  else {
@@ -782,8 +831,8 @@ class Processor extends thrift.ThriftProcessor {
782
831
  resolve(this.process_sendVideoEvent(requestId, input, output, context));
783
832
  break;
784
833
  }
785
- case "process_fullscreen": {
786
- resolve(this.process_fullscreen(requestId, input, output, context));
834
+ case "process_setFullscreen": {
835
+ resolve(this.process_setFullscreen(requestId, input, output, context));
787
836
  break;
788
837
  }
789
838
  default: {
@@ -872,24 +921,25 @@ class Processor extends thrift.ThriftProcessor {
872
921
  return output.flush();
873
922
  });
874
923
  }
875
- process_fullscreen(requestId, input, output, context) {
924
+ process_setFullscreen(requestId, input, output, context) {
876
925
  return new Promise((resolve, reject) => {
877
926
  try {
927
+ const args = exports.SetFullscreen__ArgsCodec.decode(input);
878
928
  input.readMessageEnd();
879
- resolve(this._handler.fullscreen(context));
929
+ resolve(this._handler.setFullscreen(args.isFullscreen, context));
880
930
  }
881
931
  catch (err) {
882
932
  reject(err);
883
933
  }
884
934
  }).then((data) => {
885
935
  const result = { success: data };
886
- output.writeMessageBegin("fullscreen", thrift.MessageType.REPLY, requestId);
887
- exports.Fullscreen__ResultCodec.encode(result, output);
936
+ output.writeMessageBegin("setFullscreen", thrift.MessageType.REPLY, requestId);
937
+ exports.SetFullscreen__ResultCodec.encode(result, output);
888
938
  output.writeMessageEnd();
889
939
  return output.flush();
890
940
  }).catch((err) => {
891
941
  const result = new thrift.TApplicationException(thrift.TApplicationExceptionType.UNKNOWN, err.message);
892
- output.writeMessageBegin("fullscreen", thrift.MessageType.EXCEPTION, requestId);
942
+ output.writeMessageBegin("setFullscreen", thrift.MessageType.EXCEPTION, requestId);
893
943
  thrift.TApplicationExceptionCodec.encode(result, output);
894
944
  output.writeMessageEnd();
895
945
  return output.flush();
package/index.d.ts CHANGED
@@ -41,3 +41,5 @@ import * as Navigation from "./Navigation";
41
41
  export { Navigation as Navigation };
42
42
  import * as Newsletters from "./Newsletters";
43
43
  export { Newsletters as Newsletters };
44
+ import * as Interaction from "./Interaction";
45
+ export { Interaction as Interaction };
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.Newsletters = exports.Navigation = exports.Analytics = exports.Discussion = exports.Metrics = exports.Videos = exports.Gallery = exports.User = exports.Notifications = exports.Tag = exports.Acquisitions = exports.Commercial = exports.Environment = void 0;
29
+ exports.Interaction = exports.Newsletters = exports.Navigation = exports.Analytics = exports.Discussion = exports.Metrics = exports.Videos = exports.Gallery = exports.User = exports.Notifications = exports.Tag = exports.Acquisitions = exports.Commercial = exports.Environment = void 0;
30
30
  /* tslint:disable */
31
31
  /* eslint-disable */
32
32
  /*
@@ -76,3 +76,5 @@ const Navigation = __importStar(require("./Navigation"));
76
76
  exports.Navigation = Navigation;
77
77
  const Newsletters = __importStar(require("./Newsletters"));
78
78
  exports.Newsletters = Newsletters;
79
+ const Interaction = __importStar(require("./Interaction"));
80
+ exports.Interaction = Interaction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/bridget",
3
- "version": "7.0.0",
3
+ "version": "8.1.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {