@guardian/bridget 4.0.0 → 6.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 +117 -6
- package/Discussion.js +742 -46
- package/DiscussionServiceResponse.d.ts +27 -0
- package/{DiscussionResponse.js → DiscussionServiceResponse.js} +17 -18
- package/index.d.ts +1 -2
- package/index.js +1 -2
- package/package.json +1 -1
- package/DiscussionApiResponse.d.ts +0 -26
- package/DiscussionApiResponse.js +0 -184
- package/DiscussionResponse.d.ts +0 -28
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as thrift from "@creditkarma/thrift-server-core";
|
|
2
|
+
import * as DiscussionNativeError from "./DiscussionNativeError";
|
|
3
|
+
export declare enum DiscussionServiceResponseType {
|
|
4
|
+
DiscussionServiceResponseWithResponse = "response",
|
|
5
|
+
DiscussionServiceResponseWithError = "error"
|
|
6
|
+
}
|
|
7
|
+
export type DiscussionServiceResponse = IDiscussionServiceResponseWithResponse | IDiscussionServiceResponseWithError;
|
|
8
|
+
export interface IDiscussionServiceResponseWithResponse {
|
|
9
|
+
__type: DiscussionServiceResponseType.DiscussionServiceResponseWithResponse;
|
|
10
|
+
response: string;
|
|
11
|
+
error?: undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface IDiscussionServiceResponseWithError {
|
|
14
|
+
__type: DiscussionServiceResponseType.DiscussionServiceResponseWithError;
|
|
15
|
+
response?: undefined;
|
|
16
|
+
error: DiscussionNativeError.DiscussionNativeError;
|
|
17
|
+
}
|
|
18
|
+
export type DiscussionServiceResponseArgs = IDiscussionServiceResponseWithResponseArgs | IDiscussionServiceResponseWithErrorArgs;
|
|
19
|
+
export interface IDiscussionServiceResponseWithResponseArgs {
|
|
20
|
+
response: string;
|
|
21
|
+
error?: undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface IDiscussionServiceResponseWithErrorArgs {
|
|
24
|
+
response?: undefined;
|
|
25
|
+
error: DiscussionNativeError.DiscussionNativeError;
|
|
26
|
+
}
|
|
27
|
+
export declare const DiscussionServiceResponseCodec: thrift.IStructToolkit<DiscussionServiceResponseArgs, DiscussionServiceResponse>;
|
|
@@ -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.
|
|
26
|
+
exports.DiscussionServiceResponseCodec = exports.DiscussionServiceResponseType = void 0;
|
|
27
27
|
/* tslint:disable */
|
|
28
28
|
/* eslint-disable */
|
|
29
29
|
/*
|
|
@@ -31,19 +31,18 @@ exports.DiscussionResponseCodec = exports.DiscussionResponseType = void 0;
|
|
|
31
31
|
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
32
32
|
*/
|
|
33
33
|
const thrift = __importStar(require("@creditkarma/thrift-server-core"));
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
exports.DiscussionResponseCodec = {
|
|
34
|
+
var DiscussionServiceResponseType;
|
|
35
|
+
(function (DiscussionServiceResponseType) {
|
|
36
|
+
DiscussionServiceResponseType["DiscussionServiceResponseWithResponse"] = "response";
|
|
37
|
+
DiscussionServiceResponseType["DiscussionServiceResponseWithError"] = "error";
|
|
38
|
+
})(DiscussionServiceResponseType || (exports.DiscussionServiceResponseType = DiscussionServiceResponseType = {}));
|
|
39
|
+
exports.DiscussionServiceResponseCodec = {
|
|
41
40
|
create(args) {
|
|
42
41
|
let _fieldsSet = 0;
|
|
43
42
|
let _returnValue = null;
|
|
44
43
|
if (args.response != null) {
|
|
45
44
|
_fieldsSet++;
|
|
46
|
-
const value_1 =
|
|
45
|
+
const value_1 = args.response;
|
|
47
46
|
_returnValue = { response: value_1 };
|
|
48
47
|
}
|
|
49
48
|
if (args.error != null) {
|
|
@@ -60,13 +59,13 @@ exports.DiscussionResponseCodec = {
|
|
|
60
59
|
if (_returnValue !== null) {
|
|
61
60
|
if (_returnValue.response !== undefined) {
|
|
62
61
|
return {
|
|
63
|
-
__type:
|
|
62
|
+
__type: DiscussionServiceResponseType.DiscussionServiceResponseWithResponse,
|
|
64
63
|
response: _returnValue.response
|
|
65
64
|
};
|
|
66
65
|
}
|
|
67
66
|
else {
|
|
68
67
|
return {
|
|
69
|
-
__type:
|
|
68
|
+
__type: DiscussionServiceResponseType.DiscussionServiceResponseWithError,
|
|
70
69
|
error: _returnValue.error
|
|
71
70
|
};
|
|
72
71
|
}
|
|
@@ -81,11 +80,11 @@ exports.DiscussionResponseCodec = {
|
|
|
81
80
|
response: args.response,
|
|
82
81
|
error: args.error
|
|
83
82
|
};
|
|
84
|
-
output.writeStructBegin("
|
|
83
|
+
output.writeStructBegin("DiscussionServiceResponse");
|
|
85
84
|
if (obj.response != null) {
|
|
86
85
|
_fieldsSet++;
|
|
87
|
-
output.writeFieldBegin("response", thrift.TType.
|
|
88
|
-
|
|
86
|
+
output.writeFieldBegin("response", thrift.TType.STRING, 1);
|
|
87
|
+
output.writeString(obj.response);
|
|
89
88
|
output.writeFieldEnd();
|
|
90
89
|
}
|
|
91
90
|
if (obj.error != null) {
|
|
@@ -117,9 +116,9 @@ exports.DiscussionResponseCodec = {
|
|
|
117
116
|
}
|
|
118
117
|
switch (fieldId) {
|
|
119
118
|
case 1:
|
|
120
|
-
if (fieldType === thrift.TType.
|
|
119
|
+
if (fieldType === thrift.TType.STRING) {
|
|
121
120
|
_fieldsSet++;
|
|
122
|
-
const value_3 =
|
|
121
|
+
const value_3 = input.readString();
|
|
123
122
|
_returnValue = { response: value_3 };
|
|
124
123
|
}
|
|
125
124
|
else {
|
|
@@ -152,13 +151,13 @@ exports.DiscussionResponseCodec = {
|
|
|
152
151
|
if (_returnValue !== null) {
|
|
153
152
|
if (_returnValue.response !== undefined) {
|
|
154
153
|
return {
|
|
155
|
-
__type:
|
|
154
|
+
__type: DiscussionServiceResponseType.DiscussionServiceResponseWithResponse,
|
|
156
155
|
response: _returnValue.response
|
|
157
156
|
};
|
|
158
157
|
}
|
|
159
158
|
else {
|
|
160
159
|
return {
|
|
161
|
-
__type:
|
|
160
|
+
__type: DiscussionServiceResponseType.DiscussionServiceResponseWithError,
|
|
162
161
|
error: _returnValue.error
|
|
163
162
|
};
|
|
164
163
|
}
|
package/index.d.ts
CHANGED
|
@@ -11,9 +11,8 @@ export * from "./MaybeEpic";
|
|
|
11
11
|
export * from "./VideoSlot";
|
|
12
12
|
export * from "./MetricPaint";
|
|
13
13
|
export * from "./MetricFont";
|
|
14
|
-
export * from "./DiscussionApiResponse";
|
|
15
14
|
export * from "./Metric";
|
|
16
|
-
export * from "./
|
|
15
|
+
export * from "./DiscussionServiceResponse";
|
|
17
16
|
import * as Environment from "./Environment";
|
|
18
17
|
export { Environment as Environment };
|
|
19
18
|
import * as Commercial from "./Commercial";
|
package/index.js
CHANGED
|
@@ -46,9 +46,8 @@ __exportStar(require("./MaybeEpic"), exports);
|
|
|
46
46
|
__exportStar(require("./VideoSlot"), exports);
|
|
47
47
|
__exportStar(require("./MetricPaint"), exports);
|
|
48
48
|
__exportStar(require("./MetricFont"), exports);
|
|
49
|
-
__exportStar(require("./DiscussionApiResponse"), exports);
|
|
50
49
|
__exportStar(require("./Metric"), exports);
|
|
51
|
-
__exportStar(require("./
|
|
50
|
+
__exportStar(require("./DiscussionServiceResponse"), exports);
|
|
52
51
|
const Environment = __importStar(require("./Environment"));
|
|
53
52
|
exports.Environment = Environment;
|
|
54
53
|
const Commercial = __importStar(require("./Commercial"));
|
package/package.json
CHANGED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as thrift from "@creditkarma/thrift-server-core";
|
|
2
|
-
export interface IDiscussionApiResponse {
|
|
3
|
-
status: string;
|
|
4
|
-
statusCode: number;
|
|
5
|
-
message: string;
|
|
6
|
-
errorCode?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface IDiscussionApiResponseArgs {
|
|
9
|
-
status: string;
|
|
10
|
-
statusCode: number;
|
|
11
|
-
message: string;
|
|
12
|
-
errorCode?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare const DiscussionApiResponseCodec: thrift.IStructCodec<IDiscussionApiResponseArgs, IDiscussionApiResponse>;
|
|
15
|
-
export declare class DiscussionApiResponse extends thrift.StructLike implements IDiscussionApiResponse {
|
|
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: IDiscussionApiResponseArgs);
|
|
23
|
-
static read(input: thrift.TProtocol): DiscussionApiResponse;
|
|
24
|
-
static write(args: IDiscussionApiResponseArgs, output: thrift.TProtocol): void;
|
|
25
|
-
write(output: thrift.TProtocol): void;
|
|
26
|
-
}
|
package/DiscussionApiResponse.js
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
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.DiscussionApiResponse = exports.DiscussionApiResponseCodec = 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.DiscussionApiResponseCodec = {
|
|
35
|
-
encode(args, output) {
|
|
36
|
-
const obj = {
|
|
37
|
-
status: args.status,
|
|
38
|
-
statusCode: args.statusCode,
|
|
39
|
-
message: args.message,
|
|
40
|
-
errorCode: args.errorCode
|
|
41
|
-
};
|
|
42
|
-
output.writeStructBegin("DiscussionApiResponse");
|
|
43
|
-
if (obj.status != null) {
|
|
44
|
-
output.writeFieldBegin("status", thrift.TType.STRING, 1);
|
|
45
|
-
output.writeString(obj.status);
|
|
46
|
-
output.writeFieldEnd();
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[status] is unset!");
|
|
50
|
-
}
|
|
51
|
-
if (obj.statusCode != null) {
|
|
52
|
-
output.writeFieldBegin("statusCode", thrift.TType.I32, 2);
|
|
53
|
-
output.writeI32(obj.statusCode);
|
|
54
|
-
output.writeFieldEnd();
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[statusCode] is unset!");
|
|
58
|
-
}
|
|
59
|
-
if (obj.message != null) {
|
|
60
|
-
output.writeFieldBegin("message", thrift.TType.STRING, 3);
|
|
61
|
-
output.writeString(obj.message);
|
|
62
|
-
output.writeFieldEnd();
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[message] is unset!");
|
|
66
|
-
}
|
|
67
|
-
if (obj.errorCode != null) {
|
|
68
|
-
output.writeFieldBegin("errorCode", thrift.TType.STRING, 4);
|
|
69
|
-
output.writeString(obj.errorCode);
|
|
70
|
-
output.writeFieldEnd();
|
|
71
|
-
}
|
|
72
|
-
output.writeFieldStop();
|
|
73
|
-
output.writeStructEnd();
|
|
74
|
-
return;
|
|
75
|
-
},
|
|
76
|
-
decode(input) {
|
|
77
|
-
let _args = {};
|
|
78
|
-
input.readStructBegin();
|
|
79
|
-
while (true) {
|
|
80
|
-
const ret = input.readFieldBegin();
|
|
81
|
-
const fieldType = ret.fieldType;
|
|
82
|
-
const fieldId = ret.fieldId;
|
|
83
|
-
if (fieldType === thrift.TType.STOP) {
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
switch (fieldId) {
|
|
87
|
-
case 1:
|
|
88
|
-
if (fieldType === thrift.TType.STRING) {
|
|
89
|
-
const value_1 = input.readString();
|
|
90
|
-
_args.status = value_1;
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
input.skip(fieldType);
|
|
94
|
-
}
|
|
95
|
-
break;
|
|
96
|
-
case 2:
|
|
97
|
-
if (fieldType === thrift.TType.I32) {
|
|
98
|
-
const value_2 = input.readI32();
|
|
99
|
-
_args.statusCode = value_2;
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
input.skip(fieldType);
|
|
103
|
-
}
|
|
104
|
-
break;
|
|
105
|
-
case 3:
|
|
106
|
-
if (fieldType === thrift.TType.STRING) {
|
|
107
|
-
const value_3 = input.readString();
|
|
108
|
-
_args.message = value_3;
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
input.skip(fieldType);
|
|
112
|
-
}
|
|
113
|
-
break;
|
|
114
|
-
case 4:
|
|
115
|
-
if (fieldType === thrift.TType.STRING) {
|
|
116
|
-
const value_4 = input.readString();
|
|
117
|
-
_args.errorCode = value_4;
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
input.skip(fieldType);
|
|
121
|
-
}
|
|
122
|
-
break;
|
|
123
|
-
default: {
|
|
124
|
-
input.skip(fieldType);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
input.readFieldEnd();
|
|
128
|
-
}
|
|
129
|
-
input.readStructEnd();
|
|
130
|
-
if (_args.status !== undefined && _args.statusCode !== undefined && _args.message !== undefined) {
|
|
131
|
-
return {
|
|
132
|
-
status: _args.status,
|
|
133
|
-
statusCode: _args.statusCode,
|
|
134
|
-
message: _args.message,
|
|
135
|
-
errorCode: _args.errorCode
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read DiscussionApiResponse from input");
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
class DiscussionApiResponse extends thrift.StructLike {
|
|
144
|
-
constructor(args) {
|
|
145
|
-
super();
|
|
146
|
-
this._annotations = {};
|
|
147
|
-
this._fieldAnnotations = {};
|
|
148
|
-
if (args.status != null) {
|
|
149
|
-
const value_5 = args.status;
|
|
150
|
-
this.status = value_5;
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[status] is unset!");
|
|
154
|
-
}
|
|
155
|
-
if (args.statusCode != null) {
|
|
156
|
-
const value_6 = args.statusCode;
|
|
157
|
-
this.statusCode = value_6;
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[statusCode] is unset!");
|
|
161
|
-
}
|
|
162
|
-
if (args.message != null) {
|
|
163
|
-
const value_7 = args.message;
|
|
164
|
-
this.message = value_7;
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[message] is unset!");
|
|
168
|
-
}
|
|
169
|
-
if (args.errorCode != null) {
|
|
170
|
-
const value_8 = args.errorCode;
|
|
171
|
-
this.errorCode = value_8;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
static read(input) {
|
|
175
|
-
return new DiscussionApiResponse(exports.DiscussionApiResponseCodec.decode(input));
|
|
176
|
-
}
|
|
177
|
-
static write(args, output) {
|
|
178
|
-
return exports.DiscussionApiResponseCodec.encode(args, output);
|
|
179
|
-
}
|
|
180
|
-
write(output) {
|
|
181
|
-
return exports.DiscussionApiResponseCodec.encode(this, output);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
exports.DiscussionApiResponse = DiscussionApiResponse;
|
package/DiscussionResponse.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as thrift from "@creditkarma/thrift-server-core";
|
|
2
|
-
import * as DiscussionApiResponse from "./DiscussionApiResponse";
|
|
3
|
-
import * as DiscussionNativeError from "./DiscussionNativeError";
|
|
4
|
-
export declare enum DiscussionResponseType {
|
|
5
|
-
DiscussionResponseWithResponse = "response",
|
|
6
|
-
DiscussionResponseWithError = "error"
|
|
7
|
-
}
|
|
8
|
-
export type DiscussionResponse = IDiscussionResponseWithResponse | IDiscussionResponseWithError;
|
|
9
|
-
export interface IDiscussionResponseWithResponse {
|
|
10
|
-
__type: DiscussionResponseType.DiscussionResponseWithResponse;
|
|
11
|
-
response: DiscussionApiResponse.IDiscussionApiResponse;
|
|
12
|
-
error?: undefined;
|
|
13
|
-
}
|
|
14
|
-
export interface IDiscussionResponseWithError {
|
|
15
|
-
__type: DiscussionResponseType.DiscussionResponseWithError;
|
|
16
|
-
response?: undefined;
|
|
17
|
-
error: DiscussionNativeError.DiscussionNativeError;
|
|
18
|
-
}
|
|
19
|
-
export type DiscussionResponseArgs = IDiscussionResponseWithResponseArgs | IDiscussionResponseWithErrorArgs;
|
|
20
|
-
export interface IDiscussionResponseWithResponseArgs {
|
|
21
|
-
response: DiscussionApiResponse.IDiscussionApiResponseArgs;
|
|
22
|
-
error?: undefined;
|
|
23
|
-
}
|
|
24
|
-
export interface IDiscussionResponseWithErrorArgs {
|
|
25
|
-
response?: undefined;
|
|
26
|
-
error: DiscussionNativeError.DiscussionNativeError;
|
|
27
|
-
}
|
|
28
|
-
export declare const DiscussionResponseCodec: thrift.IStructToolkit<DiscussionResponseArgs, DiscussionResponse>;
|