@emilgroup/discount-sdk-node 1.12.1-beta.18 → 1.12.1-beta.19
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/README.md +2 -2
- package/api/campaigns-api.ts +33 -88
- package/api/health-api.ts +1 -1
- package/api/policy-vouchers-api.ts +24 -64
- package/api/vouchers-api.ts +15 -40
- package/base.ts +0 -4
- package/common.ts +2 -3
- package/dist/api/campaigns-api.d.ts +11 -11
- package/dist/api/campaigns-api.js +85 -153
- package/dist/api/health-api.d.ts +1 -1
- package/dist/api/health-api.js +1 -1
- package/dist/api/policy-vouchers-api.d.ts +8 -8
- package/dist/api/policy-vouchers-api.js +62 -112
- package/dist/api/vouchers-api.d.ts +5 -5
- package/dist/api/vouchers-api.js +38 -67
- package/dist/base.d.ts +0 -1
- package/dist/base.js +0 -3
- package/dist/common.d.ts +1 -1
- package/dist/common.js +0 -1
- package/package.json +2 -2
package/dist/api/vouchers-api.js
CHANGED
|
@@ -107,10 +107,9 @@ var VouchersApiAxiosParamCreator = function (configuration) {
|
|
|
107
107
|
createVoucher: function (createVoucherRequestDto, authorization, options) {
|
|
108
108
|
if (options === void 0) { options = {}; }
|
|
109
109
|
return __awaiter(_this, void 0, void 0, function () {
|
|
110
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
switch (_b.label) {
|
|
110
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
111
|
+
return __generator(this, function (_a) {
|
|
112
|
+
switch (_a.label) {
|
|
114
113
|
case 0:
|
|
115
114
|
// verify required parameter 'createVoucherRequestDto' is not null or undefined
|
|
116
115
|
(0, common_1.assertParamExists)('createVoucher', 'createVoucherRequestDto', createVoucherRequestDto);
|
|
@@ -125,19 +124,13 @@ var VouchersApiAxiosParamCreator = function (configuration) {
|
|
|
125
124
|
localVarQueryParameter = {};
|
|
126
125
|
// authentication bearer required
|
|
127
126
|
// http bearer authentication required
|
|
128
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
129
|
-
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
130
|
-
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
131
|
-
];
|
|
127
|
+
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
132
128
|
case 1:
|
|
133
129
|
// authentication bearer required
|
|
134
130
|
// http bearer authentication required
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
139
|
-
if (authorizationValue || authorizationKeepEmpty) {
|
|
140
|
-
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
131
|
+
_a.sent();
|
|
132
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
133
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
141
134
|
}
|
|
142
135
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
143
136
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
@@ -163,10 +156,9 @@ var VouchersApiAxiosParamCreator = function (configuration) {
|
|
|
163
156
|
deleteVoucher: function (code, authorization, options) {
|
|
164
157
|
if (options === void 0) { options = {}; }
|
|
165
158
|
return __awaiter(_this, void 0, void 0, function () {
|
|
166
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
switch (_b.label) {
|
|
159
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
160
|
+
return __generator(this, function (_a) {
|
|
161
|
+
switch (_a.label) {
|
|
170
162
|
case 0:
|
|
171
163
|
// verify required parameter 'code' is not null or undefined
|
|
172
164
|
(0, common_1.assertParamExists)('deleteVoucher', 'code', code);
|
|
@@ -182,19 +174,13 @@ var VouchersApiAxiosParamCreator = function (configuration) {
|
|
|
182
174
|
localVarQueryParameter = {};
|
|
183
175
|
// authentication bearer required
|
|
184
176
|
// http bearer authentication required
|
|
185
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
186
|
-
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
187
|
-
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
188
|
-
];
|
|
177
|
+
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
189
178
|
case 1:
|
|
190
179
|
// authentication bearer required
|
|
191
180
|
// http bearer authentication required
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
196
|
-
if (authorizationValue || authorizationKeepEmpty) {
|
|
197
|
-
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
181
|
+
_a.sent();
|
|
182
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
183
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
198
184
|
}
|
|
199
185
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
200
186
|
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
@@ -219,10 +205,9 @@ var VouchersApiAxiosParamCreator = function (configuration) {
|
|
|
219
205
|
getVoucher: function (code, authorization, expand, options) {
|
|
220
206
|
if (options === void 0) { options = {}; }
|
|
221
207
|
return __awaiter(_this, void 0, void 0, function () {
|
|
222
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
switch (_b.label) {
|
|
208
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
209
|
+
return __generator(this, function (_a) {
|
|
210
|
+
switch (_a.label) {
|
|
226
211
|
case 0:
|
|
227
212
|
// verify required parameter 'code' is not null or undefined
|
|
228
213
|
(0, common_1.assertParamExists)('getVoucher', 'code', code);
|
|
@@ -242,15 +227,12 @@ var VouchersApiAxiosParamCreator = function (configuration) {
|
|
|
242
227
|
case 1:
|
|
243
228
|
// authentication bearer required
|
|
244
229
|
// http bearer authentication required
|
|
245
|
-
|
|
230
|
+
_a.sent();
|
|
246
231
|
if (expand !== undefined) {
|
|
247
232
|
localVarQueryParameter['expand'] = expand;
|
|
248
233
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
252
|
-
if (authorizationValue || authorizationKeepEmpty) {
|
|
253
|
-
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
234
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
235
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
254
236
|
}
|
|
255
237
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
256
238
|
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
@@ -280,10 +262,9 @@ var VouchersApiAxiosParamCreator = function (configuration) {
|
|
|
280
262
|
listVouchers: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
|
|
281
263
|
if (options === void 0) { options = {}; }
|
|
282
264
|
return __awaiter(_this, void 0, void 0, function () {
|
|
283
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
switch (_b.label) {
|
|
265
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
266
|
+
return __generator(this, function (_a) {
|
|
267
|
+
switch (_a.label) {
|
|
287
268
|
case 0:
|
|
288
269
|
localVarPath = "/discountservice/v1/vouchers";
|
|
289
270
|
localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
@@ -300,7 +281,7 @@ var VouchersApiAxiosParamCreator = function (configuration) {
|
|
|
300
281
|
case 1:
|
|
301
282
|
// authentication bearer required
|
|
302
283
|
// http bearer authentication required
|
|
303
|
-
|
|
284
|
+
_a.sent();
|
|
304
285
|
if (pageSize !== undefined) {
|
|
305
286
|
localVarQueryParameter['pageSize'] = pageSize;
|
|
306
287
|
}
|
|
@@ -322,11 +303,8 @@ var VouchersApiAxiosParamCreator = function (configuration) {
|
|
|
322
303
|
if (filters !== undefined) {
|
|
323
304
|
localVarQueryParameter['filters'] = filters;
|
|
324
305
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
328
|
-
if (authorizationValue || authorizationKeepEmpty) {
|
|
329
|
-
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
306
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
307
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
330
308
|
}
|
|
331
309
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
332
310
|
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
@@ -351,10 +329,9 @@ var VouchersApiAxiosParamCreator = function (configuration) {
|
|
|
351
329
|
updateVoucher: function (code, updateVoucherRequestDto, authorization, options) {
|
|
352
330
|
if (options === void 0) { options = {}; }
|
|
353
331
|
return __awaiter(_this, void 0, void 0, function () {
|
|
354
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter,
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
switch (_b.label) {
|
|
332
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
333
|
+
return __generator(this, function (_a) {
|
|
334
|
+
switch (_a.label) {
|
|
358
335
|
case 0:
|
|
359
336
|
// verify required parameter 'code' is not null or undefined
|
|
360
337
|
(0, common_1.assertParamExists)('updateVoucher', 'code', code);
|
|
@@ -372,19 +349,13 @@ var VouchersApiAxiosParamCreator = function (configuration) {
|
|
|
372
349
|
localVarQueryParameter = {};
|
|
373
350
|
// authentication bearer required
|
|
374
351
|
// http bearer authentication required
|
|
375
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
376
|
-
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
377
|
-
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
378
|
-
];
|
|
352
|
+
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
379
353
|
case 1:
|
|
380
354
|
// authentication bearer required
|
|
381
355
|
// http bearer authentication required
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
386
|
-
if (authorizationValue || authorizationKeepEmpty) {
|
|
387
|
-
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
356
|
+
_a.sent();
|
|
357
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
358
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
388
359
|
}
|
|
389
360
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
390
361
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
@@ -619,7 +590,7 @@ var VouchersApi = /** @class */ (function (_super) {
|
|
|
619
590
|
*/
|
|
620
591
|
VouchersApi.prototype.createVoucher = function (requestParameters, options) {
|
|
621
592
|
var _this = this;
|
|
622
|
-
return (0, exports.VouchersApiFp)(this.configuration).createVoucher(requestParameters.createVoucherRequestDto, requestParameters.authorization,
|
|
593
|
+
return (0, exports.VouchersApiFp)(this.configuration).createVoucher(requestParameters.createVoucherRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
623
594
|
};
|
|
624
595
|
/**
|
|
625
596
|
* This will delete a voucher.
|
|
@@ -631,7 +602,7 @@ var VouchersApi = /** @class */ (function (_super) {
|
|
|
631
602
|
*/
|
|
632
603
|
VouchersApi.prototype.deleteVoucher = function (requestParameters, options) {
|
|
633
604
|
var _this = this;
|
|
634
|
-
return (0, exports.VouchersApiFp)(this.configuration).deleteVoucher(requestParameters.code, requestParameters.authorization,
|
|
605
|
+
return (0, exports.VouchersApiFp)(this.configuration).deleteVoucher(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
635
606
|
};
|
|
636
607
|
/**
|
|
637
608
|
* This will get a voucher.
|
|
@@ -643,7 +614,7 @@ var VouchersApi = /** @class */ (function (_super) {
|
|
|
643
614
|
*/
|
|
644
615
|
VouchersApi.prototype.getVoucher = function (requestParameters, options) {
|
|
645
616
|
var _this = this;
|
|
646
|
-
return (0, exports.VouchersApiFp)(this.configuration).getVoucher(requestParameters.code, requestParameters.authorization, requestParameters.expand,
|
|
617
|
+
return (0, exports.VouchersApiFp)(this.configuration).getVoucher(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
647
618
|
};
|
|
648
619
|
/**
|
|
649
620
|
* Returns a list of Vouchers you have previously created. The Vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
@@ -656,7 +627,7 @@ var VouchersApi = /** @class */ (function (_super) {
|
|
|
656
627
|
VouchersApi.prototype.listVouchers = function (requestParameters, options) {
|
|
657
628
|
var _this = this;
|
|
658
629
|
if (requestParameters === void 0) { requestParameters = {}; }
|
|
659
|
-
return (0, exports.VouchersApiFp)(this.configuration).listVouchers(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters,
|
|
630
|
+
return (0, exports.VouchersApiFp)(this.configuration).listVouchers(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
660
631
|
};
|
|
661
632
|
/**
|
|
662
633
|
* This will update a voucher.
|
|
@@ -668,7 +639,7 @@ var VouchersApi = /** @class */ (function (_super) {
|
|
|
668
639
|
*/
|
|
669
640
|
VouchersApi.prototype.updateVoucher = function (requestParameters, options) {
|
|
670
641
|
var _this = this;
|
|
671
|
-
return (0, exports.VouchersApiFp)(this.configuration).updateVoucher(requestParameters.code, requestParameters.updateVoucherRequestDto, requestParameters.authorization,
|
|
642
|
+
return (0, exports.VouchersApiFp)(this.configuration).updateVoucher(requestParameters.code, requestParameters.updateVoucherRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
672
643
|
};
|
|
673
644
|
return VouchersApi;
|
|
674
645
|
}(base_1.BaseAPI));
|
package/dist/base.d.ts
CHANGED
|
@@ -63,7 +63,6 @@ export declare class BaseAPI {
|
|
|
63
63
|
protected configuration: Configuration;
|
|
64
64
|
private username?;
|
|
65
65
|
private password?;
|
|
66
|
-
protected withOwner(options?: AxiosRequestConfig): AxiosRequestConfig;
|
|
67
66
|
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
68
67
|
initialize(env?: Environment, targetWorkspace?: string): Promise<void>;
|
|
69
68
|
private loadCredentials;
|
package/dist/base.js
CHANGED
|
@@ -163,9 +163,6 @@ var BaseAPI = /** @class */ (function () {
|
|
|
163
163
|
}
|
|
164
164
|
this.attachInterceptor(axios);
|
|
165
165
|
}
|
|
166
|
-
BaseAPI.prototype.withOwner = function (options) {
|
|
167
|
-
return __assign({}, options);
|
|
168
|
-
};
|
|
169
166
|
BaseAPI.prototype.initialize = function (env, targetWorkspace) {
|
|
170
167
|
if (env === void 0) { env = Environment.Production; }
|
|
171
168
|
return __awaiter(this, void 0, void 0, function () {
|
package/dist/common.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export declare const toPathString: (url: URL) => string;
|
|
|
63
63
|
*
|
|
64
64
|
* @export
|
|
65
65
|
*/
|
|
66
|
-
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T, any, {}
|
|
66
|
+
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T, any, {}>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
|
|
67
67
|
/**
|
|
68
68
|
* EMIL DiscountService
|
|
69
69
|
* The EMIL DiscountService API description
|
package/dist/common.js
CHANGED
|
@@ -234,7 +234,6 @@ exports.toPathString = toPathString;
|
|
|
234
234
|
* @export
|
|
235
235
|
*/
|
|
236
236
|
var createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
237
|
-
// Typed by hand: since axios 1.20, request() returns an internal axios type that SDK declarations cannot name.
|
|
238
237
|
return function (axios, basePath) {
|
|
239
238
|
if (axios === void 0) { axios = globalAxios; }
|
|
240
239
|
if (basePath === void 0) { basePath = BASE_PATH; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emilgroup/discount-sdk-node",
|
|
3
|
-
"version": "1.12.1-beta.
|
|
3
|
+
"version": "1.12.1-beta.19",
|
|
4
4
|
"description": "OpenAPI client for @emilgroup/discount-sdk-node",
|
|
5
5
|
"author": "OpenAPI-Generator Contributors",
|
|
6
6
|
"keywords": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"prepare": "npm run build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"axios": "1.
|
|
21
|
+
"axios": "1.18.0",
|
|
22
22
|
"form-data": "^4.0.0",
|
|
23
23
|
"url": "^0.11.0"
|
|
24
24
|
},
|