@guardian/bridget 5.0.0 → 7.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.
@@ -1,170 +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.GetUserProfileResponseCodec = exports.GetUserProfileResponseType = 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
- const DiscussionUserProfile = __importStar(require("./DiscussionUserProfile"));
35
- var GetUserProfileResponseType;
36
- (function (GetUserProfileResponseType) {
37
- GetUserProfileResponseType["GetUserProfileResponseWithProfile"] = "profile";
38
- GetUserProfileResponseType["GetUserProfileResponseWithError"] = "error";
39
- })(GetUserProfileResponseType || (exports.GetUserProfileResponseType = GetUserProfileResponseType = {}));
40
- exports.GetUserProfileResponseCodec = {
41
- create(args) {
42
- let _fieldsSet = 0;
43
- let _returnValue = null;
44
- if (args.profile != null) {
45
- _fieldsSet++;
46
- const value_1 = new DiscussionUserProfile.DiscussionUserProfile(args.profile);
47
- _returnValue = { profile: value_1 };
48
- }
49
- if (args.error != null) {
50
- _fieldsSet++;
51
- const value_2 = args.error;
52
- _returnValue = { error: value_2 };
53
- }
54
- if (_fieldsSet > 1) {
55
- throw new thrift.TProtocolException(thrift.TProtocolExceptionType.INVALID_DATA, "TUnion cannot have more than one value");
56
- }
57
- else if (_fieldsSet < 1) {
58
- throw new thrift.TProtocolException(thrift.TProtocolExceptionType.INVALID_DATA, "TUnion must have one value set");
59
- }
60
- if (_returnValue !== null) {
61
- if (_returnValue.profile !== undefined) {
62
- return {
63
- __type: GetUserProfileResponseType.GetUserProfileResponseWithProfile,
64
- profile: _returnValue.profile
65
- };
66
- }
67
- else {
68
- return {
69
- __type: GetUserProfileResponseType.GetUserProfileResponseWithError,
70
- error: _returnValue.error
71
- };
72
- }
73
- }
74
- else {
75
- throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read data for TUnion");
76
- }
77
- },
78
- encode(args, output) {
79
- let _fieldsSet = 0;
80
- const obj = {
81
- profile: args.profile,
82
- error: args.error
83
- };
84
- output.writeStructBegin("GetUserProfileResponse");
85
- if (obj.profile != null) {
86
- _fieldsSet++;
87
- output.writeFieldBegin("profile", thrift.TType.STRUCT, 1);
88
- DiscussionUserProfile.DiscussionUserProfileCodec.encode(obj.profile, output);
89
- output.writeFieldEnd();
90
- }
91
- if (obj.error != null) {
92
- _fieldsSet++;
93
- output.writeFieldBegin("error", thrift.TType.I32, 2);
94
- output.writeI32(obj.error);
95
- output.writeFieldEnd();
96
- }
97
- output.writeFieldStop();
98
- output.writeStructEnd();
99
- if (_fieldsSet > 1) {
100
- throw new thrift.TProtocolException(thrift.TProtocolExceptionType.INVALID_DATA, "TUnion cannot have more than one value");
101
- }
102
- else if (_fieldsSet < 1) {
103
- throw new thrift.TProtocolException(thrift.TProtocolExceptionType.INVALID_DATA, "TUnion must have one value set");
104
- }
105
- return;
106
- },
107
- decode(input) {
108
- let _fieldsSet = 0;
109
- let _returnValue = null;
110
- input.readStructBegin();
111
- while (true) {
112
- const ret = input.readFieldBegin();
113
- const fieldType = ret.fieldType;
114
- const fieldId = ret.fieldId;
115
- if (fieldType === thrift.TType.STOP) {
116
- break;
117
- }
118
- switch (fieldId) {
119
- case 1:
120
- if (fieldType === thrift.TType.STRUCT) {
121
- _fieldsSet++;
122
- const value_3 = DiscussionUserProfile.DiscussionUserProfileCodec.decode(input);
123
- _returnValue = { profile: value_3 };
124
- }
125
- else {
126
- input.skip(fieldType);
127
- }
128
- break;
129
- case 2:
130
- if (fieldType === thrift.TType.I32) {
131
- _fieldsSet++;
132
- const value_4 = input.readI32();
133
- _returnValue = { error: value_4 };
134
- }
135
- else {
136
- input.skip(fieldType);
137
- }
138
- break;
139
- default: {
140
- input.skip(fieldType);
141
- }
142
- }
143
- input.readFieldEnd();
144
- }
145
- input.readStructEnd();
146
- if (_fieldsSet > 1) {
147
- throw new thrift.TProtocolException(thrift.TProtocolExceptionType.INVALID_DATA, "TUnion cannot have more than one value");
148
- }
149
- else if (_fieldsSet < 1) {
150
- throw new thrift.TProtocolException(thrift.TProtocolExceptionType.INVALID_DATA, "TUnion must have one value set");
151
- }
152
- if (_returnValue !== null) {
153
- if (_returnValue.profile !== undefined) {
154
- return {
155
- __type: GetUserProfileResponseType.GetUserProfileResponseWithProfile,
156
- profile: _returnValue.profile
157
- };
158
- }
159
- else {
160
- return {
161
- __type: GetUserProfileResponseType.GetUserProfileResponseWithError,
162
- error: _returnValue.error
163
- };
164
- }
165
- }
166
- else {
167
- throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read data for TUnion");
168
- }
169
- }
170
- };