@emilgroup/billing-sdk-node 1.17.1-beta.1 → 1.17.1

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.
@@ -0,0 +1,396 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * EMIL BillingService
6
+ * The EMIL BillingService API description
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ * Contact: kontakt@emil.de
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __assign = (this && this.__assign) || function () {
31
+ __assign = Object.assign || function(t) {
32
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
33
+ s = arguments[i];
34
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
+ t[p] = s[p];
36
+ }
37
+ return t;
38
+ };
39
+ return __assign.apply(this, arguments);
40
+ };
41
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
+ return new (P || (P = Promise))(function (resolve, reject) {
44
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48
+ });
49
+ };
50
+ var __generator = (this && this.__generator) || function (thisArg, body) {
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
+ function verb(n) { return function (v) { return step([n, v]); }; }
54
+ function step(op) {
55
+ if (f) throw new TypeError("Generator is already executing.");
56
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
+ if (y = 0, t) op = [op[0] & 2, t.value];
59
+ switch (op[0]) {
60
+ case 0: case 1: t = op; break;
61
+ case 4: _.label++; return { value: op[1], done: false };
62
+ case 5: _.label++; y = op[1]; op = [0]; continue;
63
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
+ default:
65
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
+ if (t[2]) _.ops.pop();
70
+ _.trys.pop(); continue;
71
+ }
72
+ op = body.call(thisArg, _);
73
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
+ }
76
+ };
77
+ var __importDefault = (this && this.__importDefault) || function (mod) {
78
+ return (mod && mod.__esModule) ? mod : { "default": mod };
79
+ };
80
+ Object.defineProperty(exports, "__esModule", { value: true });
81
+ exports.DraftInvoiceApi = exports.DraftInvoiceApiFactory = exports.DraftInvoiceApiFp = exports.DraftInvoiceApiAxiosParamCreator = void 0;
82
+ var axios_1 = __importDefault(require("axios"));
83
+ // Some imports not used depending on template conditions
84
+ // @ts-ignore
85
+ var common_1 = require("../common");
86
+ // @ts-ignore
87
+ var base_1 = require("../base");
88
+ // URLSearchParams not necessarily used
89
+ // @ts-ignore
90
+ var url_1 = require("url");
91
+ var FormData = require('form-data');
92
+ /**
93
+ * DraftInvoiceApi - axios parameter creator
94
+ * @export
95
+ */
96
+ var DraftInvoiceApiAxiosParamCreator = function (configuration) {
97
+ var _this = this;
98
+ return {
99
+ /**
100
+ *
101
+ * @param {CreateDraftInvoiceRequestDto} createDraftInvoiceRequestDto
102
+ * @param {string} [authorization] Bearer Token
103
+ * @param {*} [options] Override http request option.
104
+ * @throws {RequiredError}
105
+ */
106
+ createDraftInvoice: function (createDraftInvoiceRequestDto, authorization, options) {
107
+ if (options === void 0) { options = {}; }
108
+ return __awaiter(_this, void 0, void 0, function () {
109
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
110
+ return __generator(this, function (_a) {
111
+ switch (_a.label) {
112
+ case 0:
113
+ // verify required parameter 'createDraftInvoiceRequestDto' is not null or undefined
114
+ (0, common_1.assertParamExists)('createDraftInvoice', 'createDraftInvoiceRequestDto', createDraftInvoiceRequestDto);
115
+ localVarPath = "/billingservice/v1/draft-invoices";
116
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
117
+ if (configuration) {
118
+ baseOptions = configuration.baseOptions;
119
+ baseAccessToken = configuration.accessToken;
120
+ }
121
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
122
+ localVarHeaderParameter = {};
123
+ localVarQueryParameter = {};
124
+ // authentication bearer required
125
+ // http bearer authentication required
126
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
127
+ case 1:
128
+ // authentication bearer required
129
+ // http bearer authentication required
130
+ _a.sent();
131
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
132
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
133
+ }
134
+ localVarHeaderParameter['Content-Type'] = 'application/json';
135
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
136
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
137
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
138
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createDraftInvoiceRequestDto, localVarRequestOptions, configuration);
139
+ return [2 /*return*/, {
140
+ url: (0, common_1.toPathString)(localVarUrlObj),
141
+ options: localVarRequestOptions,
142
+ }];
143
+ }
144
+ });
145
+ });
146
+ },
147
+ /**
148
+ *
149
+ * @param {string} [authorization] Bearer Token
150
+ * @param {*} [options] Override http request option.
151
+ * @throws {RequiredError}
152
+ */
153
+ deleteAllDraftInvoices: function (authorization, options) {
154
+ if (options === void 0) { options = {}; }
155
+ return __awaiter(_this, void 0, void 0, function () {
156
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
157
+ return __generator(this, function (_a) {
158
+ switch (_a.label) {
159
+ case 0:
160
+ localVarPath = "/billingservice/v1/draft-invoices";
161
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
162
+ if (configuration) {
163
+ baseOptions = configuration.baseOptions;
164
+ baseAccessToken = configuration.accessToken;
165
+ }
166
+ localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
167
+ localVarHeaderParameter = {};
168
+ localVarQueryParameter = {};
169
+ // authentication bearer required
170
+ // http bearer authentication required
171
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
172
+ case 1:
173
+ // authentication bearer required
174
+ // http bearer authentication required
175
+ _a.sent();
176
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
177
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
178
+ }
179
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
180
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
181
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
182
+ return [2 /*return*/, {
183
+ url: (0, common_1.toPathString)(localVarUrlObj),
184
+ options: localVarRequestOptions,
185
+ }];
186
+ }
187
+ });
188
+ });
189
+ },
190
+ /**
191
+ *
192
+ * @param {object} body
193
+ * @param {string} [authorization] Bearer Token
194
+ * @param {*} [options] Override http request option.
195
+ * @throws {RequiredError}
196
+ */
197
+ deleteDraftInvoice: function (body, authorization, options) {
198
+ if (options === void 0) { options = {}; }
199
+ return __awaiter(_this, void 0, void 0, function () {
200
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
201
+ return __generator(this, function (_a) {
202
+ switch (_a.label) {
203
+ case 0:
204
+ // verify required parameter 'body' is not null or undefined
205
+ (0, common_1.assertParamExists)('deleteDraftInvoice', 'body', body);
206
+ localVarPath = "/billingservice/v1/draft-invoices/code";
207
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
208
+ if (configuration) {
209
+ baseOptions = configuration.baseOptions;
210
+ baseAccessToken = configuration.accessToken;
211
+ }
212
+ localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
213
+ localVarHeaderParameter = {};
214
+ localVarQueryParameter = {};
215
+ // authentication bearer required
216
+ // http bearer authentication required
217
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
218
+ case 1:
219
+ // authentication bearer required
220
+ // http bearer authentication required
221
+ _a.sent();
222
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
223
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
224
+ }
225
+ localVarHeaderParameter['Content-Type'] = 'application/json';
226
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
227
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
228
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
229
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
230
+ return [2 /*return*/, {
231
+ url: (0, common_1.toPathString)(localVarUrlObj),
232
+ options: localVarRequestOptions,
233
+ }];
234
+ }
235
+ });
236
+ });
237
+ },
238
+ };
239
+ };
240
+ exports.DraftInvoiceApiAxiosParamCreator = DraftInvoiceApiAxiosParamCreator;
241
+ /**
242
+ * DraftInvoiceApi - functional programming interface
243
+ * @export
244
+ */
245
+ var DraftInvoiceApiFp = function (configuration) {
246
+ var localVarAxiosParamCreator = (0, exports.DraftInvoiceApiAxiosParamCreator)(configuration);
247
+ return {
248
+ /**
249
+ *
250
+ * @param {CreateDraftInvoiceRequestDto} createDraftInvoiceRequestDto
251
+ * @param {string} [authorization] Bearer Token
252
+ * @param {*} [options] Override http request option.
253
+ * @throws {RequiredError}
254
+ */
255
+ createDraftInvoice: function (createDraftInvoiceRequestDto, authorization, options) {
256
+ return __awaiter(this, void 0, void 0, function () {
257
+ var localVarAxiosArgs;
258
+ return __generator(this, function (_a) {
259
+ switch (_a.label) {
260
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createDraftInvoice(createDraftInvoiceRequestDto, authorization, options)];
261
+ case 1:
262
+ localVarAxiosArgs = _a.sent();
263
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
264
+ }
265
+ });
266
+ });
267
+ },
268
+ /**
269
+ *
270
+ * @param {string} [authorization] Bearer Token
271
+ * @param {*} [options] Override http request option.
272
+ * @throws {RequiredError}
273
+ */
274
+ deleteAllDraftInvoices: function (authorization, options) {
275
+ return __awaiter(this, void 0, void 0, function () {
276
+ var localVarAxiosArgs;
277
+ return __generator(this, function (_a) {
278
+ switch (_a.label) {
279
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteAllDraftInvoices(authorization, options)];
280
+ case 1:
281
+ localVarAxiosArgs = _a.sent();
282
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
283
+ }
284
+ });
285
+ });
286
+ },
287
+ /**
288
+ *
289
+ * @param {object} body
290
+ * @param {string} [authorization] Bearer Token
291
+ * @param {*} [options] Override http request option.
292
+ * @throws {RequiredError}
293
+ */
294
+ deleteDraftInvoice: function (body, authorization, options) {
295
+ return __awaiter(this, void 0, void 0, function () {
296
+ var localVarAxiosArgs;
297
+ return __generator(this, function (_a) {
298
+ switch (_a.label) {
299
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteDraftInvoice(body, authorization, options)];
300
+ case 1:
301
+ localVarAxiosArgs = _a.sent();
302
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
303
+ }
304
+ });
305
+ });
306
+ },
307
+ };
308
+ };
309
+ exports.DraftInvoiceApiFp = DraftInvoiceApiFp;
310
+ /**
311
+ * DraftInvoiceApi - factory interface
312
+ * @export
313
+ */
314
+ var DraftInvoiceApiFactory = function (configuration, basePath, axios) {
315
+ var localVarFp = (0, exports.DraftInvoiceApiFp)(configuration);
316
+ return {
317
+ /**
318
+ *
319
+ * @param {CreateDraftInvoiceRequestDto} createDraftInvoiceRequestDto
320
+ * @param {string} [authorization] Bearer Token
321
+ * @param {*} [options] Override http request option.
322
+ * @throws {RequiredError}
323
+ */
324
+ createDraftInvoice: function (createDraftInvoiceRequestDto, authorization, options) {
325
+ return localVarFp.createDraftInvoice(createDraftInvoiceRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
326
+ },
327
+ /**
328
+ *
329
+ * @param {string} [authorization] Bearer Token
330
+ * @param {*} [options] Override http request option.
331
+ * @throws {RequiredError}
332
+ */
333
+ deleteAllDraftInvoices: function (authorization, options) {
334
+ return localVarFp.deleteAllDraftInvoices(authorization, options).then(function (request) { return request(axios, basePath); });
335
+ },
336
+ /**
337
+ *
338
+ * @param {object} body
339
+ * @param {string} [authorization] Bearer Token
340
+ * @param {*} [options] Override http request option.
341
+ * @throws {RequiredError}
342
+ */
343
+ deleteDraftInvoice: function (body, authorization, options) {
344
+ return localVarFp.deleteDraftInvoice(body, authorization, options).then(function (request) { return request(axios, basePath); });
345
+ },
346
+ };
347
+ };
348
+ exports.DraftInvoiceApiFactory = DraftInvoiceApiFactory;
349
+ /**
350
+ * DraftInvoiceApi - object-oriented interface
351
+ * @export
352
+ * @class DraftInvoiceApi
353
+ * @extends {BaseAPI}
354
+ */
355
+ var DraftInvoiceApi = /** @class */ (function (_super) {
356
+ __extends(DraftInvoiceApi, _super);
357
+ function DraftInvoiceApi() {
358
+ return _super !== null && _super.apply(this, arguments) || this;
359
+ }
360
+ /**
361
+ *
362
+ * @param {DraftInvoiceApiCreateDraftInvoiceRequest} requestParameters Request parameters.
363
+ * @param {*} [options] Override http request option.
364
+ * @throws {RequiredError}
365
+ * @memberof DraftInvoiceApi
366
+ */
367
+ DraftInvoiceApi.prototype.createDraftInvoice = function (requestParameters, options) {
368
+ var _this = this;
369
+ return (0, exports.DraftInvoiceApiFp)(this.configuration).createDraftInvoice(requestParameters.createDraftInvoiceRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
370
+ };
371
+ /**
372
+ *
373
+ * @param {DraftInvoiceApiDeleteAllDraftInvoicesRequest} requestParameters Request parameters.
374
+ * @param {*} [options] Override http request option.
375
+ * @throws {RequiredError}
376
+ * @memberof DraftInvoiceApi
377
+ */
378
+ DraftInvoiceApi.prototype.deleteAllDraftInvoices = function (requestParameters, options) {
379
+ var _this = this;
380
+ if (requestParameters === void 0) { requestParameters = {}; }
381
+ return (0, exports.DraftInvoiceApiFp)(this.configuration).deleteAllDraftInvoices(requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
382
+ };
383
+ /**
384
+ *
385
+ * @param {DraftInvoiceApiDeleteDraftInvoiceRequest} requestParameters Request parameters.
386
+ * @param {*} [options] Override http request option.
387
+ * @throws {RequiredError}
388
+ * @memberof DraftInvoiceApi
389
+ */
390
+ DraftInvoiceApi.prototype.deleteDraftInvoice = function (requestParameters, options) {
391
+ var _this = this;
392
+ return (0, exports.DraftInvoiceApiFp)(this.configuration).deleteDraftInvoice(requestParameters.body, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
393
+ };
394
+ return DraftInvoiceApi;
395
+ }(base_1.BaseAPI));
396
+ exports.DraftInvoiceApi = DraftInvoiceApi;