@p7m/billing-backend 0.1.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.
- package/README.md +176 -0
- package/dist/ApiClient.js +703 -0
- package/dist/api/BankAccountApi.js +115 -0
- package/dist/api/CustomerApi.js +199 -0
- package/dist/api/InvoiceApi.js +233 -0
- package/dist/index.js +139 -0
- package/dist/model/BankAccount.js +178 -0
- package/dist/model/BankAccountData.js +130 -0
- package/dist/model/Currency.js +160 -0
- package/dist/model/CurrencyData.js +130 -0
- package/dist/model/Customer.js +307 -0
- package/dist/model/CustomerData.js +130 -0
- package/dist/model/DetailedInvoice.js +146 -0
- package/dist/model/Invoice.js +389 -0
- package/dist/model/InvoiceData.js +130 -0
- package/dist/model/InvoicePosition.js +238 -0
- package/dist/model/NewBankAccount.js +140 -0
- package/dist/model/NewCustomer.js +269 -0
- package/dist/model/NewInvoice.js +164 -0
- package/dist/model/NewInvoicePosition.js +196 -0
- package/dist/model/Salutation.js +68 -0
- package/package.json +46 -0
@@ -0,0 +1,115 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = void 0;
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
8
|
+
var _BankAccount = _interopRequireDefault(require("../model/BankAccount"));
|
9
|
+
var _BankAccountData = _interopRequireDefault(require("../model/BankAccountData"));
|
10
|
+
var _NewBankAccount = _interopRequireDefault(require("../model/NewBankAccount"));
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
12
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
13
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
14
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
15
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
18
|
+
* Billing Backend
|
19
|
+
* # API for managing billing of customers The purpose of this API is to manage customers, articles, recurring billing, and payments. The caller has to be authenticated with the system and provide a JWT token in the Authorization header of the HTTP request. When using the API you typically get this token by authenticating first with OAuth 2.0. When you are trying this API using the Swagger interface, you need to click the `Authorize` button and then again the Authorize button in the pop-up that gets opened.
|
20
|
+
*
|
21
|
+
* The version of the OpenAPI document: 0.1.1
|
22
|
+
* Contact: tech@p7m.de
|
23
|
+
*
|
24
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
25
|
+
* https://openapi-generator.tech
|
26
|
+
* Do not edit the class manually.
|
27
|
+
*
|
28
|
+
*/
|
29
|
+
/**
|
30
|
+
* BankAccount service.
|
31
|
+
* @module api/BankAccountApi
|
32
|
+
* @version 0.1.1
|
33
|
+
*/
|
34
|
+
var BankAccountApi = exports["default"] = /*#__PURE__*/function () {
|
35
|
+
/**
|
36
|
+
* Constructs a new BankAccountApi.
|
37
|
+
* @alias module:api/BankAccountApi
|
38
|
+
* @class
|
39
|
+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
40
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
41
|
+
*/
|
42
|
+
function BankAccountApi(apiClient) {
|
43
|
+
_classCallCheck(this, BankAccountApi);
|
44
|
+
this.apiClient = apiClient || _ApiClient["default"].instance;
|
45
|
+
}
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Get a list of all bank accounts
|
49
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BankAccountData} and HTTP response
|
50
|
+
*/
|
51
|
+
return _createClass(BankAccountApi, [{
|
52
|
+
key: "getBankAccountsWithHttpInfo",
|
53
|
+
value: function getBankAccountsWithHttpInfo() {
|
54
|
+
var postBody = null;
|
55
|
+
var pathParams = {};
|
56
|
+
var queryParams = {};
|
57
|
+
var headerParams = {};
|
58
|
+
var formParams = {};
|
59
|
+
var authNames = ['oauth'];
|
60
|
+
var contentTypes = [];
|
61
|
+
var accepts = ['application/json'];
|
62
|
+
var returnType = _BankAccountData["default"];
|
63
|
+
return this.apiClient.callApi('/bankaccounts', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
64
|
+
}
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Get a list of all bank accounts
|
68
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BankAccountData}
|
69
|
+
*/
|
70
|
+
}, {
|
71
|
+
key: "getBankAccounts",
|
72
|
+
value: function getBankAccounts() {
|
73
|
+
return this.getBankAccountsWithHttpInfo().then(function (response_and_data) {
|
74
|
+
return response_and_data.data;
|
75
|
+
});
|
76
|
+
}
|
77
|
+
|
78
|
+
/**
|
79
|
+
* Create a new bank account
|
80
|
+
* @param {module:model/NewBankAccount} newBankAccount Bank account to create
|
81
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BankAccount} and HTTP response
|
82
|
+
*/
|
83
|
+
}, {
|
84
|
+
key: "postBankAccountsWithHttpInfo",
|
85
|
+
value: function postBankAccountsWithHttpInfo(newBankAccount) {
|
86
|
+
var postBody = newBankAccount;
|
87
|
+
// verify the required parameter 'newBankAccount' is set
|
88
|
+
if (newBankAccount === undefined || newBankAccount === null) {
|
89
|
+
throw new Error("Missing the required parameter 'newBankAccount' when calling postBankAccounts");
|
90
|
+
}
|
91
|
+
var pathParams = {};
|
92
|
+
var queryParams = {};
|
93
|
+
var headerParams = {};
|
94
|
+
var formParams = {};
|
95
|
+
var authNames = ['oauth'];
|
96
|
+
var contentTypes = ['application/json'];
|
97
|
+
var accepts = ['application/json'];
|
98
|
+
var returnType = _BankAccount["default"];
|
99
|
+
return this.apiClient.callApi('/bankaccounts', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
100
|
+
}
|
101
|
+
|
102
|
+
/**
|
103
|
+
* Create a new bank account
|
104
|
+
* @param {module:model/NewBankAccount} newBankAccount Bank account to create
|
105
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BankAccount}
|
106
|
+
*/
|
107
|
+
}, {
|
108
|
+
key: "postBankAccounts",
|
109
|
+
value: function postBankAccounts(newBankAccount) {
|
110
|
+
return this.postBankAccountsWithHttpInfo(newBankAccount).then(function (response_and_data) {
|
111
|
+
return response_and_data.data;
|
112
|
+
});
|
113
|
+
}
|
114
|
+
}]);
|
115
|
+
}();
|
@@ -0,0 +1,199 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = void 0;
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
8
|
+
var _Customer = _interopRequireDefault(require("../model/Customer"));
|
9
|
+
var _CustomerData = _interopRequireDefault(require("../model/CustomerData"));
|
10
|
+
var _NewCustomer = _interopRequireDefault(require("../model/NewCustomer"));
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
12
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
13
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
14
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
15
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
18
|
+
* Billing Backend
|
19
|
+
* # API for managing billing of customers The purpose of this API is to manage customers, articles, recurring billing, and payments. The caller has to be authenticated with the system and provide a JWT token in the Authorization header of the HTTP request. When using the API you typically get this token by authenticating first with OAuth 2.0. When you are trying this API using the Swagger interface, you need to click the `Authorize` button and then again the Authorize button in the pop-up that gets opened.
|
20
|
+
*
|
21
|
+
* The version of the OpenAPI document: 0.1.1
|
22
|
+
* Contact: tech@p7m.de
|
23
|
+
*
|
24
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
25
|
+
* https://openapi-generator.tech
|
26
|
+
* Do not edit the class manually.
|
27
|
+
*
|
28
|
+
*/
|
29
|
+
/**
|
30
|
+
* Customer service.
|
31
|
+
* @module api/CustomerApi
|
32
|
+
* @version 0.1.1
|
33
|
+
*/
|
34
|
+
var CustomerApi = exports["default"] = /*#__PURE__*/function () {
|
35
|
+
/**
|
36
|
+
* Constructs a new CustomerApi.
|
37
|
+
* @alias module:api/CustomerApi
|
38
|
+
* @class
|
39
|
+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
40
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
41
|
+
*/
|
42
|
+
function CustomerApi(apiClient) {
|
43
|
+
_classCallCheck(this, CustomerApi);
|
44
|
+
this.apiClient = apiClient || _ApiClient["default"].instance;
|
45
|
+
}
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Get a list of all customers
|
49
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CustomerData} and HTTP response
|
50
|
+
*/
|
51
|
+
return _createClass(CustomerApi, [{
|
52
|
+
key: "getCustomersWithHttpInfo",
|
53
|
+
value: function getCustomersWithHttpInfo() {
|
54
|
+
var postBody = null;
|
55
|
+
var pathParams = {};
|
56
|
+
var queryParams = {};
|
57
|
+
var headerParams = {};
|
58
|
+
var formParams = {};
|
59
|
+
var authNames = ['oauth'];
|
60
|
+
var contentTypes = [];
|
61
|
+
var accepts = ['application/json'];
|
62
|
+
var returnType = _CustomerData["default"];
|
63
|
+
return this.apiClient.callApi('/customers', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
64
|
+
}
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Get a list of all customers
|
68
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CustomerData}
|
69
|
+
*/
|
70
|
+
}, {
|
71
|
+
key: "getCustomers",
|
72
|
+
value: function getCustomers() {
|
73
|
+
return this.getCustomersWithHttpInfo().then(function (response_and_data) {
|
74
|
+
return response_and_data.data;
|
75
|
+
});
|
76
|
+
}
|
77
|
+
|
78
|
+
/**
|
79
|
+
* Request a single customer by its ID
|
80
|
+
* @param {String} customerId ID of the customer
|
81
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Customer} and HTTP response
|
82
|
+
*/
|
83
|
+
}, {
|
84
|
+
key: "getCustomersIdWithHttpInfo",
|
85
|
+
value: function getCustomersIdWithHttpInfo(customerId) {
|
86
|
+
var postBody = null;
|
87
|
+
// verify the required parameter 'customerId' is set
|
88
|
+
if (customerId === undefined || customerId === null) {
|
89
|
+
throw new Error("Missing the required parameter 'customerId' when calling getCustomersId");
|
90
|
+
}
|
91
|
+
var pathParams = {
|
92
|
+
'customer_id': customerId
|
93
|
+
};
|
94
|
+
var queryParams = {};
|
95
|
+
var headerParams = {};
|
96
|
+
var formParams = {};
|
97
|
+
var authNames = ['oauth'];
|
98
|
+
var contentTypes = [];
|
99
|
+
var accepts = ['application/json'];
|
100
|
+
var returnType = _Customer["default"];
|
101
|
+
return this.apiClient.callApi('/customers/{customer_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
102
|
+
}
|
103
|
+
|
104
|
+
/**
|
105
|
+
* Request a single customer by its ID
|
106
|
+
* @param {String} customerId ID of the customer
|
107
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Customer}
|
108
|
+
*/
|
109
|
+
}, {
|
110
|
+
key: "getCustomersId",
|
111
|
+
value: function getCustomersId(customerId) {
|
112
|
+
return this.getCustomersIdWithHttpInfo(customerId).then(function (response_and_data) {
|
113
|
+
return response_and_data.data;
|
114
|
+
});
|
115
|
+
}
|
116
|
+
|
117
|
+
/**
|
118
|
+
* Create a new customer
|
119
|
+
* @param {module:model/NewCustomer} newCustomer Customer to create
|
120
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Customer} and HTTP response
|
121
|
+
*/
|
122
|
+
}, {
|
123
|
+
key: "postCustomersWithHttpInfo",
|
124
|
+
value: function postCustomersWithHttpInfo(newCustomer) {
|
125
|
+
var postBody = newCustomer;
|
126
|
+
// verify the required parameter 'newCustomer' is set
|
127
|
+
if (newCustomer === undefined || newCustomer === null) {
|
128
|
+
throw new Error("Missing the required parameter 'newCustomer' when calling postCustomers");
|
129
|
+
}
|
130
|
+
var pathParams = {};
|
131
|
+
var queryParams = {};
|
132
|
+
var headerParams = {};
|
133
|
+
var formParams = {};
|
134
|
+
var authNames = ['oauth'];
|
135
|
+
var contentTypes = ['application/json'];
|
136
|
+
var accepts = ['application/json'];
|
137
|
+
var returnType = _Customer["default"];
|
138
|
+
return this.apiClient.callApi('/customers', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
139
|
+
}
|
140
|
+
|
141
|
+
/**
|
142
|
+
* Create a new customer
|
143
|
+
* @param {module:model/NewCustomer} newCustomer Customer to create
|
144
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Customer}
|
145
|
+
*/
|
146
|
+
}, {
|
147
|
+
key: "postCustomers",
|
148
|
+
value: function postCustomers(newCustomer) {
|
149
|
+
return this.postCustomersWithHttpInfo(newCustomer).then(function (response_and_data) {
|
150
|
+
return response_and_data.data;
|
151
|
+
});
|
152
|
+
}
|
153
|
+
|
154
|
+
/**
|
155
|
+
* Update an existing customer
|
156
|
+
* @param {String} customerId ID of the customer
|
157
|
+
* @param {module:model/NewCustomer} newCustomer Customer to update
|
158
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Customer} and HTTP response
|
159
|
+
*/
|
160
|
+
}, {
|
161
|
+
key: "pubCustomersIdWithHttpInfo",
|
162
|
+
value: function pubCustomersIdWithHttpInfo(customerId, newCustomer) {
|
163
|
+
var postBody = newCustomer;
|
164
|
+
// verify the required parameter 'customerId' is set
|
165
|
+
if (customerId === undefined || customerId === null) {
|
166
|
+
throw new Error("Missing the required parameter 'customerId' when calling pubCustomersId");
|
167
|
+
}
|
168
|
+
// verify the required parameter 'newCustomer' is set
|
169
|
+
if (newCustomer === undefined || newCustomer === null) {
|
170
|
+
throw new Error("Missing the required parameter 'newCustomer' when calling pubCustomersId");
|
171
|
+
}
|
172
|
+
var pathParams = {
|
173
|
+
'customer_id': customerId
|
174
|
+
};
|
175
|
+
var queryParams = {};
|
176
|
+
var headerParams = {};
|
177
|
+
var formParams = {};
|
178
|
+
var authNames = ['oauth'];
|
179
|
+
var contentTypes = ['application/json'];
|
180
|
+
var accepts = ['application/json'];
|
181
|
+
var returnType = _Customer["default"];
|
182
|
+
return this.apiClient.callApi('/customers/{customer_id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
183
|
+
}
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Update an existing customer
|
187
|
+
* @param {String} customerId ID of the customer
|
188
|
+
* @param {module:model/NewCustomer} newCustomer Customer to update
|
189
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Customer}
|
190
|
+
*/
|
191
|
+
}, {
|
192
|
+
key: "pubCustomersId",
|
193
|
+
value: function pubCustomersId(customerId, newCustomer) {
|
194
|
+
return this.pubCustomersIdWithHttpInfo(customerId, newCustomer).then(function (response_and_data) {
|
195
|
+
return response_and_data.data;
|
196
|
+
});
|
197
|
+
}
|
198
|
+
}]);
|
199
|
+
}();
|
@@ -0,0 +1,233 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = void 0;
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
8
|
+
var _CurrencyData = _interopRequireDefault(require("../model/CurrencyData"));
|
9
|
+
var _DetailedInvoice = _interopRequireDefault(require("../model/DetailedInvoice"));
|
10
|
+
var _Invoice = _interopRequireDefault(require("../model/Invoice"));
|
11
|
+
var _InvoiceData = _interopRequireDefault(require("../model/InvoiceData"));
|
12
|
+
var _NewInvoice = _interopRequireDefault(require("../model/NewInvoice"));
|
13
|
+
var _NewInvoicePosition = _interopRequireDefault(require("../model/NewInvoicePosition"));
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
15
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
16
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
17
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
18
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
20
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
21
|
+
* Billing Backend
|
22
|
+
* # API for managing billing of customers The purpose of this API is to manage customers, articles, recurring billing, and payments. The caller has to be authenticated with the system and provide a JWT token in the Authorization header of the HTTP request. When using the API you typically get this token by authenticating first with OAuth 2.0. When you are trying this API using the Swagger interface, you need to click the `Authorize` button and then again the Authorize button in the pop-up that gets opened.
|
23
|
+
*
|
24
|
+
* The version of the OpenAPI document: 0.1.1
|
25
|
+
* Contact: tech@p7m.de
|
26
|
+
*
|
27
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
28
|
+
* https://openapi-generator.tech
|
29
|
+
* Do not edit the class manually.
|
30
|
+
*
|
31
|
+
*/
|
32
|
+
/**
|
33
|
+
* Invoice service.
|
34
|
+
* @module api/InvoiceApi
|
35
|
+
* @version 0.1.1
|
36
|
+
*/
|
37
|
+
var InvoiceApi = exports["default"] = /*#__PURE__*/function () {
|
38
|
+
/**
|
39
|
+
* Constructs a new InvoiceApi.
|
40
|
+
* @alias module:api/InvoiceApi
|
41
|
+
* @class
|
42
|
+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
43
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
44
|
+
*/
|
45
|
+
function InvoiceApi(apiClient) {
|
46
|
+
_classCallCheck(this, InvoiceApi);
|
47
|
+
this.apiClient = apiClient || _ApiClient["default"].instance;
|
48
|
+
}
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Get a list of all (available) currencies
|
52
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CurrencyData} and HTTP response
|
53
|
+
*/
|
54
|
+
return _createClass(InvoiceApi, [{
|
55
|
+
key: "getCurrenciesWithHttpInfo",
|
56
|
+
value: function getCurrenciesWithHttpInfo() {
|
57
|
+
var postBody = null;
|
58
|
+
var pathParams = {};
|
59
|
+
var queryParams = {};
|
60
|
+
var headerParams = {};
|
61
|
+
var formParams = {};
|
62
|
+
var authNames = ['oauth'];
|
63
|
+
var contentTypes = [];
|
64
|
+
var accepts = ['application/json'];
|
65
|
+
var returnType = _CurrencyData["default"];
|
66
|
+
return this.apiClient.callApi('/currencies', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
67
|
+
}
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Get a list of all (available) currencies
|
71
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CurrencyData}
|
72
|
+
*/
|
73
|
+
}, {
|
74
|
+
key: "getCurrencies",
|
75
|
+
value: function getCurrencies() {
|
76
|
+
return this.getCurrenciesWithHttpInfo().then(function (response_and_data) {
|
77
|
+
return response_and_data.data;
|
78
|
+
});
|
79
|
+
}
|
80
|
+
|
81
|
+
/**
|
82
|
+
* Get a list of all invoices
|
83
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/InvoiceData} and HTTP response
|
84
|
+
*/
|
85
|
+
}, {
|
86
|
+
key: "getInvoicesWithHttpInfo",
|
87
|
+
value: function getInvoicesWithHttpInfo() {
|
88
|
+
var postBody = null;
|
89
|
+
var pathParams = {};
|
90
|
+
var queryParams = {};
|
91
|
+
var headerParams = {};
|
92
|
+
var formParams = {};
|
93
|
+
var authNames = ['oauth'];
|
94
|
+
var contentTypes = [];
|
95
|
+
var accepts = ['application/json'];
|
96
|
+
var returnType = _InvoiceData["default"];
|
97
|
+
return this.apiClient.callApi('/invoices', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
98
|
+
}
|
99
|
+
|
100
|
+
/**
|
101
|
+
* Get a list of all invoices
|
102
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/InvoiceData}
|
103
|
+
*/
|
104
|
+
}, {
|
105
|
+
key: "getInvoices",
|
106
|
+
value: function getInvoices() {
|
107
|
+
return this.getInvoicesWithHttpInfo().then(function (response_and_data) {
|
108
|
+
return response_and_data.data;
|
109
|
+
});
|
110
|
+
}
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Get a single invoice by its ID
|
114
|
+
* @param {String} invoiceId ID of the invoice
|
115
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DetailedInvoice} and HTTP response
|
116
|
+
*/
|
117
|
+
}, {
|
118
|
+
key: "getInvoicesIdWithHttpInfo",
|
119
|
+
value: function getInvoicesIdWithHttpInfo(invoiceId) {
|
120
|
+
var postBody = null;
|
121
|
+
// verify the required parameter 'invoiceId' is set
|
122
|
+
if (invoiceId === undefined || invoiceId === null) {
|
123
|
+
throw new Error("Missing the required parameter 'invoiceId' when calling getInvoicesId");
|
124
|
+
}
|
125
|
+
var pathParams = {
|
126
|
+
'invoice_id': invoiceId
|
127
|
+
};
|
128
|
+
var queryParams = {};
|
129
|
+
var headerParams = {};
|
130
|
+
var formParams = {};
|
131
|
+
var authNames = ['oauth'];
|
132
|
+
var contentTypes = [];
|
133
|
+
var accepts = ['application/json'];
|
134
|
+
var returnType = _DetailedInvoice["default"];
|
135
|
+
return this.apiClient.callApi('/invoices/{invoice_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
136
|
+
}
|
137
|
+
|
138
|
+
/**
|
139
|
+
* Get a single invoice by its ID
|
140
|
+
* @param {String} invoiceId ID of the invoice
|
141
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DetailedInvoice}
|
142
|
+
*/
|
143
|
+
}, {
|
144
|
+
key: "getInvoicesId",
|
145
|
+
value: function getInvoicesId(invoiceId) {
|
146
|
+
return this.getInvoicesIdWithHttpInfo(invoiceId).then(function (response_and_data) {
|
147
|
+
return response_and_data.data;
|
148
|
+
});
|
149
|
+
}
|
150
|
+
|
151
|
+
/**
|
152
|
+
* Create a new invoice
|
153
|
+
* @param {module:model/NewInvoice} newInvoice Invoice to create
|
154
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Invoice} and HTTP response
|
155
|
+
*/
|
156
|
+
}, {
|
157
|
+
key: "postInvoicesWithHttpInfo",
|
158
|
+
value: function postInvoicesWithHttpInfo(newInvoice) {
|
159
|
+
var postBody = newInvoice;
|
160
|
+
// verify the required parameter 'newInvoice' is set
|
161
|
+
if (newInvoice === undefined || newInvoice === null) {
|
162
|
+
throw new Error("Missing the required parameter 'newInvoice' when calling postInvoices");
|
163
|
+
}
|
164
|
+
var pathParams = {};
|
165
|
+
var queryParams = {};
|
166
|
+
var headerParams = {};
|
167
|
+
var formParams = {};
|
168
|
+
var authNames = ['oauth'];
|
169
|
+
var contentTypes = ['application/json'];
|
170
|
+
var accepts = ['application/json'];
|
171
|
+
var returnType = _Invoice["default"];
|
172
|
+
return this.apiClient.callApi('/invoices', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
173
|
+
}
|
174
|
+
|
175
|
+
/**
|
176
|
+
* Create a new invoice
|
177
|
+
* @param {module:model/NewInvoice} newInvoice Invoice to create
|
178
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Invoice}
|
179
|
+
*/
|
180
|
+
}, {
|
181
|
+
key: "postInvoices",
|
182
|
+
value: function postInvoices(newInvoice) {
|
183
|
+
return this.postInvoicesWithHttpInfo(newInvoice).then(function (response_and_data) {
|
184
|
+
return response_and_data.data;
|
185
|
+
});
|
186
|
+
}
|
187
|
+
|
188
|
+
/**
|
189
|
+
* Create a new invoice position
|
190
|
+
* @param {String} invoiceId ID of the invoice
|
191
|
+
* @param {module:model/NewInvoicePosition} newInvoicePosition Invoice position to create
|
192
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/NewInvoicePosition} and HTTP response
|
193
|
+
*/
|
194
|
+
}, {
|
195
|
+
key: "postInvoicesInvoiceIdWithHttpInfo",
|
196
|
+
value: function postInvoicesInvoiceIdWithHttpInfo(invoiceId, newInvoicePosition) {
|
197
|
+
var postBody = newInvoicePosition;
|
198
|
+
// verify the required parameter 'invoiceId' is set
|
199
|
+
if (invoiceId === undefined || invoiceId === null) {
|
200
|
+
throw new Error("Missing the required parameter 'invoiceId' when calling postInvoicesInvoiceId");
|
201
|
+
}
|
202
|
+
// verify the required parameter 'newInvoicePosition' is set
|
203
|
+
if (newInvoicePosition === undefined || newInvoicePosition === null) {
|
204
|
+
throw new Error("Missing the required parameter 'newInvoicePosition' when calling postInvoicesInvoiceId");
|
205
|
+
}
|
206
|
+
var pathParams = {
|
207
|
+
'invoice_id': invoiceId
|
208
|
+
};
|
209
|
+
var queryParams = {};
|
210
|
+
var headerParams = {};
|
211
|
+
var formParams = {};
|
212
|
+
var authNames = ['oauth'];
|
213
|
+
var contentTypes = ['application/json'];
|
214
|
+
var accepts = ['application/json'];
|
215
|
+
var returnType = _NewInvoicePosition["default"];
|
216
|
+
return this.apiClient.callApi('/invoices/{invoice_id}', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
217
|
+
}
|
218
|
+
|
219
|
+
/**
|
220
|
+
* Create a new invoice position
|
221
|
+
* @param {String} invoiceId ID of the invoice
|
222
|
+
* @param {module:model/NewInvoicePosition} newInvoicePosition Invoice position to create
|
223
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/NewInvoicePosition}
|
224
|
+
*/
|
225
|
+
}, {
|
226
|
+
key: "postInvoicesInvoiceId",
|
227
|
+
value: function postInvoicesInvoiceId(invoiceId, newInvoicePosition) {
|
228
|
+
return this.postInvoicesInvoiceIdWithHttpInfo(invoiceId, newInvoicePosition).then(function (response_and_data) {
|
229
|
+
return response_and_data.data;
|
230
|
+
});
|
231
|
+
}
|
232
|
+
}]);
|
233
|
+
}();
|