@guardian/bridget 8.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.
- package/Interaction.d.ts +73 -0
- package/Interaction.js +295 -0
- package/index.d.ts +2 -0
- package/index.js +3 -1
- package/package.json +1 -1
package/Interaction.d.ts
ADDED
|
@@ -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/index.d.ts
CHANGED
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;
|