@tradecafe/offer-service-sdk 0.0.5 → 0.0.6

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,232 +1,232 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.VoidAuth = exports.OAuth = exports.ApiKeyAuth = exports.HttpBearerAuth = exports.HttpBasicAuth = exports.ObjectSerializer = void 0;
18
- __exportStar(require("./healthControllerPing200Response"), exports);
19
- __exportStar(require("./healthControllerPing200ResponseInfoValue"), exports);
20
- __exportStar(require("./healthControllerPing503Response"), exports);
21
- var healthControllerPing200Response_1 = require("./healthControllerPing200Response");
22
- var healthControllerPing200ResponseInfoValue_1 = require("./healthControllerPing200ResponseInfoValue");
23
- var healthControllerPing503Response_1 = require("./healthControllerPing503Response");
24
- var primitives = [
25
- "string",
26
- "boolean",
27
- "double",
28
- "integer",
29
- "long",
30
- "float",
31
- "number",
32
- "any"
33
- ];
34
- var enumsMap = {};
35
- var typeMap = {
36
- "HealthControllerPing200Response": healthControllerPing200Response_1.HealthControllerPing200Response,
37
- "HealthControllerPing200ResponseInfoValue": healthControllerPing200ResponseInfoValue_1.HealthControllerPing200ResponseInfoValue,
38
- "HealthControllerPing503Response": healthControllerPing503Response_1.HealthControllerPing503Response,
39
- };
40
- var ObjectSerializer = (function () {
41
- function ObjectSerializer() {
42
- }
43
- ObjectSerializer.findCorrectType = function (data, expectedType) {
44
- if (data == undefined) {
45
- return expectedType;
46
- }
47
- else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
48
- return expectedType;
49
- }
50
- else if (expectedType === "Date") {
51
- return expectedType;
52
- }
53
- else {
54
- if (enumsMap[expectedType]) {
55
- return expectedType;
56
- }
57
- if (!typeMap[expectedType]) {
58
- return expectedType;
59
- }
60
- var discriminatorProperty = typeMap[expectedType].discriminator;
61
- if (discriminatorProperty == null) {
62
- return expectedType;
63
- }
64
- else {
65
- if (data[discriminatorProperty]) {
66
- var discriminatorType = data[discriminatorProperty];
67
- if (typeMap[discriminatorType]) {
68
- return discriminatorType;
69
- }
70
- else {
71
- return expectedType;
72
- }
73
- }
74
- else {
75
- return expectedType;
76
- }
77
- }
78
- }
79
- };
80
- ObjectSerializer.serialize = function (data, type) {
81
- if (data == undefined) {
82
- return data;
83
- }
84
- else if (primitives.indexOf(type.toLowerCase()) !== -1) {
85
- return data;
86
- }
87
- else if (type.lastIndexOf("Array<", 0) === 0) {
88
- var subType = type.replace("Array<", "");
89
- subType = subType.substring(0, subType.length - 1);
90
- var transformedData = [];
91
- for (var index = 0; index < data.length; index++) {
92
- var datum = data[index];
93
- transformedData.push(ObjectSerializer.serialize(datum, subType));
94
- }
95
- return transformedData;
96
- }
97
- else if (type === "Date") {
98
- return data.toISOString();
99
- }
100
- else {
101
- if (enumsMap[type]) {
102
- return data;
103
- }
104
- if (!typeMap[type]) {
105
- return data;
106
- }
107
- type = this.findCorrectType(data, type);
108
- var attributeTypes = typeMap[type].getAttributeTypeMap();
109
- var instance = {};
110
- for (var index = 0; index < attributeTypes.length; index++) {
111
- var attributeType = attributeTypes[index];
112
- instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
113
- }
114
- return instance;
115
- }
116
- };
117
- ObjectSerializer.deserialize = function (data, type) {
118
- type = ObjectSerializer.findCorrectType(data, type);
119
- if (data == undefined) {
120
- return data;
121
- }
122
- else if (primitives.indexOf(type.toLowerCase()) !== -1) {
123
- return data;
124
- }
125
- else if (type.lastIndexOf("Array<", 0) === 0) {
126
- var subType = type.replace("Array<", "");
127
- subType = subType.substring(0, subType.length - 1);
128
- var transformedData = [];
129
- for (var index = 0; index < data.length; index++) {
130
- var datum = data[index];
131
- transformedData.push(ObjectSerializer.deserialize(datum, subType));
132
- }
133
- return transformedData;
134
- }
135
- else if (type === "Date") {
136
- return new Date(data);
137
- }
138
- else {
139
- if (enumsMap[type]) {
140
- return data;
141
- }
142
- if (!typeMap[type]) {
143
- return data;
144
- }
145
- var instance = new typeMap[type]();
146
- var attributeTypes = typeMap[type].getAttributeTypeMap();
147
- for (var index = 0; index < attributeTypes.length; index++) {
148
- var attributeType = attributeTypes[index];
149
- instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
150
- }
151
- return instance;
152
- }
153
- };
154
- return ObjectSerializer;
155
- }());
156
- exports.ObjectSerializer = ObjectSerializer;
157
- var HttpBasicAuth = (function () {
158
- function HttpBasicAuth() {
159
- this.username = '';
160
- this.password = '';
161
- }
162
- HttpBasicAuth.prototype.applyToRequest = function (requestOptions) {
163
- requestOptions.auth = {
164
- username: this.username, password: this.password
165
- };
166
- };
167
- return HttpBasicAuth;
168
- }());
169
- exports.HttpBasicAuth = HttpBasicAuth;
170
- var HttpBearerAuth = (function () {
171
- function HttpBearerAuth() {
172
- this.accessToken = '';
173
- }
174
- HttpBearerAuth.prototype.applyToRequest = function (requestOptions) {
175
- if (requestOptions && requestOptions.headers) {
176
- var accessToken = typeof this.accessToken === 'function'
177
- ? this.accessToken()
178
- : this.accessToken;
179
- requestOptions.headers["Authorization"] = "Bearer " + accessToken;
180
- }
181
- };
182
- return HttpBearerAuth;
183
- }());
184
- exports.HttpBearerAuth = HttpBearerAuth;
185
- var ApiKeyAuth = (function () {
186
- function ApiKeyAuth(location, paramName) {
187
- this.location = location;
188
- this.paramName = paramName;
189
- this.apiKey = '';
190
- }
191
- ApiKeyAuth.prototype.applyToRequest = function (requestOptions) {
192
- if (this.location == "query") {
193
- requestOptions.qs[this.paramName] = this.apiKey;
194
- }
195
- else if (this.location == "header" && requestOptions && requestOptions.headers) {
196
- requestOptions.headers[this.paramName] = this.apiKey;
197
- }
198
- else if (this.location == 'cookie' && requestOptions && requestOptions.headers) {
199
- if (requestOptions.headers['Cookie']) {
200
- requestOptions.headers['Cookie'] += '; ' + this.paramName + '=' + encodeURIComponent(this.apiKey);
201
- }
202
- else {
203
- requestOptions.headers['Cookie'] = this.paramName + '=' + encodeURIComponent(this.apiKey);
204
- }
205
- }
206
- };
207
- return ApiKeyAuth;
208
- }());
209
- exports.ApiKeyAuth = ApiKeyAuth;
210
- var OAuth = (function () {
211
- function OAuth() {
212
- this.accessToken = '';
213
- }
214
- OAuth.prototype.applyToRequest = function (requestOptions) {
215
- if (requestOptions && requestOptions.headers) {
216
- requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
217
- }
218
- };
219
- return OAuth;
220
- }());
221
- exports.OAuth = OAuth;
222
- var VoidAuth = (function () {
223
- function VoidAuth() {
224
- this.username = '';
225
- this.password = '';
226
- }
227
- VoidAuth.prototype.applyToRequest = function (_) {
228
- };
229
- return VoidAuth;
230
- }());
231
- exports.VoidAuth = VoidAuth;
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.VoidAuth = exports.OAuth = exports.ApiKeyAuth = exports.HttpBearerAuth = exports.HttpBasicAuth = exports.ObjectSerializer = void 0;
18
+ __exportStar(require("./healthControllerPing200Response"), exports);
19
+ __exportStar(require("./healthControllerPing200ResponseInfoValue"), exports);
20
+ __exportStar(require("./healthControllerPing503Response"), exports);
21
+ var healthControllerPing200Response_1 = require("./healthControllerPing200Response");
22
+ var healthControllerPing200ResponseInfoValue_1 = require("./healthControllerPing200ResponseInfoValue");
23
+ var healthControllerPing503Response_1 = require("./healthControllerPing503Response");
24
+ var primitives = [
25
+ "string",
26
+ "boolean",
27
+ "double",
28
+ "integer",
29
+ "long",
30
+ "float",
31
+ "number",
32
+ "any"
33
+ ];
34
+ var enumsMap = {};
35
+ var typeMap = {
36
+ "HealthControllerPing200Response": healthControllerPing200Response_1.HealthControllerPing200Response,
37
+ "HealthControllerPing200ResponseInfoValue": healthControllerPing200ResponseInfoValue_1.HealthControllerPing200ResponseInfoValue,
38
+ "HealthControllerPing503Response": healthControllerPing503Response_1.HealthControllerPing503Response,
39
+ };
40
+ var ObjectSerializer = (function () {
41
+ function ObjectSerializer() {
42
+ }
43
+ ObjectSerializer.findCorrectType = function (data, expectedType) {
44
+ if (data == undefined) {
45
+ return expectedType;
46
+ }
47
+ else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
48
+ return expectedType;
49
+ }
50
+ else if (expectedType === "Date") {
51
+ return expectedType;
52
+ }
53
+ else {
54
+ if (enumsMap[expectedType]) {
55
+ return expectedType;
56
+ }
57
+ if (!typeMap[expectedType]) {
58
+ return expectedType;
59
+ }
60
+ var discriminatorProperty = typeMap[expectedType].discriminator;
61
+ if (discriminatorProperty == null) {
62
+ return expectedType;
63
+ }
64
+ else {
65
+ if (data[discriminatorProperty]) {
66
+ var discriminatorType = data[discriminatorProperty];
67
+ if (typeMap[discriminatorType]) {
68
+ return discriminatorType;
69
+ }
70
+ else {
71
+ return expectedType;
72
+ }
73
+ }
74
+ else {
75
+ return expectedType;
76
+ }
77
+ }
78
+ }
79
+ };
80
+ ObjectSerializer.serialize = function (data, type) {
81
+ if (data == undefined) {
82
+ return data;
83
+ }
84
+ else if (primitives.indexOf(type.toLowerCase()) !== -1) {
85
+ return data;
86
+ }
87
+ else if (type.lastIndexOf("Array<", 0) === 0) {
88
+ var subType = type.replace("Array<", "");
89
+ subType = subType.substring(0, subType.length - 1);
90
+ var transformedData = [];
91
+ for (var index = 0; index < data.length; index++) {
92
+ var datum = data[index];
93
+ transformedData.push(ObjectSerializer.serialize(datum, subType));
94
+ }
95
+ return transformedData;
96
+ }
97
+ else if (type === "Date") {
98
+ return data.toISOString();
99
+ }
100
+ else {
101
+ if (enumsMap[type]) {
102
+ return data;
103
+ }
104
+ if (!typeMap[type]) {
105
+ return data;
106
+ }
107
+ type = this.findCorrectType(data, type);
108
+ var attributeTypes = typeMap[type].getAttributeTypeMap();
109
+ var instance = {};
110
+ for (var index = 0; index < attributeTypes.length; index++) {
111
+ var attributeType = attributeTypes[index];
112
+ instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
113
+ }
114
+ return instance;
115
+ }
116
+ };
117
+ ObjectSerializer.deserialize = function (data, type) {
118
+ type = ObjectSerializer.findCorrectType(data, type);
119
+ if (data == undefined) {
120
+ return data;
121
+ }
122
+ else if (primitives.indexOf(type.toLowerCase()) !== -1) {
123
+ return data;
124
+ }
125
+ else if (type.lastIndexOf("Array<", 0) === 0) {
126
+ var subType = type.replace("Array<", "");
127
+ subType = subType.substring(0, subType.length - 1);
128
+ var transformedData = [];
129
+ for (var index = 0; index < data.length; index++) {
130
+ var datum = data[index];
131
+ transformedData.push(ObjectSerializer.deserialize(datum, subType));
132
+ }
133
+ return transformedData;
134
+ }
135
+ else if (type === "Date") {
136
+ return new Date(data);
137
+ }
138
+ else {
139
+ if (enumsMap[type]) {
140
+ return data;
141
+ }
142
+ if (!typeMap[type]) {
143
+ return data;
144
+ }
145
+ var instance = new typeMap[type]();
146
+ var attributeTypes = typeMap[type].getAttributeTypeMap();
147
+ for (var index = 0; index < attributeTypes.length; index++) {
148
+ var attributeType = attributeTypes[index];
149
+ instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
150
+ }
151
+ return instance;
152
+ }
153
+ };
154
+ return ObjectSerializer;
155
+ }());
156
+ exports.ObjectSerializer = ObjectSerializer;
157
+ var HttpBasicAuth = (function () {
158
+ function HttpBasicAuth() {
159
+ this.username = '';
160
+ this.password = '';
161
+ }
162
+ HttpBasicAuth.prototype.applyToRequest = function (requestOptions) {
163
+ requestOptions.auth = {
164
+ username: this.username, password: this.password
165
+ };
166
+ };
167
+ return HttpBasicAuth;
168
+ }());
169
+ exports.HttpBasicAuth = HttpBasicAuth;
170
+ var HttpBearerAuth = (function () {
171
+ function HttpBearerAuth() {
172
+ this.accessToken = '';
173
+ }
174
+ HttpBearerAuth.prototype.applyToRequest = function (requestOptions) {
175
+ if (requestOptions && requestOptions.headers) {
176
+ var accessToken = typeof this.accessToken === 'function'
177
+ ? this.accessToken()
178
+ : this.accessToken;
179
+ requestOptions.headers["Authorization"] = "Bearer " + accessToken;
180
+ }
181
+ };
182
+ return HttpBearerAuth;
183
+ }());
184
+ exports.HttpBearerAuth = HttpBearerAuth;
185
+ var ApiKeyAuth = (function () {
186
+ function ApiKeyAuth(location, paramName) {
187
+ this.location = location;
188
+ this.paramName = paramName;
189
+ this.apiKey = '';
190
+ }
191
+ ApiKeyAuth.prototype.applyToRequest = function (requestOptions) {
192
+ if (this.location == "query") {
193
+ requestOptions.qs[this.paramName] = this.apiKey;
194
+ }
195
+ else if (this.location == "header" && requestOptions && requestOptions.headers) {
196
+ requestOptions.headers[this.paramName] = this.apiKey;
197
+ }
198
+ else if (this.location == 'cookie' && requestOptions && requestOptions.headers) {
199
+ if (requestOptions.headers['Cookie']) {
200
+ requestOptions.headers['Cookie'] += '; ' + this.paramName + '=' + encodeURIComponent(this.apiKey);
201
+ }
202
+ else {
203
+ requestOptions.headers['Cookie'] = this.paramName + '=' + encodeURIComponent(this.apiKey);
204
+ }
205
+ }
206
+ };
207
+ return ApiKeyAuth;
208
+ }());
209
+ exports.ApiKeyAuth = ApiKeyAuth;
210
+ var OAuth = (function () {
211
+ function OAuth() {
212
+ this.accessToken = '';
213
+ }
214
+ OAuth.prototype.applyToRequest = function (requestOptions) {
215
+ if (requestOptions && requestOptions.headers) {
216
+ requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
217
+ }
218
+ };
219
+ return OAuth;
220
+ }());
221
+ exports.OAuth = OAuth;
222
+ var VoidAuth = (function () {
223
+ function VoidAuth() {
224
+ this.username = '';
225
+ this.password = '';
226
+ }
227
+ VoidAuth.prototype.applyToRequest = function (_) {
228
+ };
229
+ return VoidAuth;
230
+ }());
231
+ exports.VoidAuth = VoidAuth;
232
232
  //# sourceMappingURL=models.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tradecafe/offer-service-sdk",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "NodeJS client for @tradecafe/offer-service-sdk",
5
5
  "repository": {
6
6
  "type": "git",