@emilgroup/billing-v2-sdk 0.0.0-stage → 1.0.1-beta.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.
Files changed (265) hide show
  1. package/.openapi-generator/FILES +93 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +50 -2
  5. package/api/bill-runs-api.ts +468 -0
  6. package/api/bills-api.ts +145 -0
  7. package/api/invoices-api.ts +1530 -0
  8. package/api/jobs-api.ts +756 -0
  9. package/api/policy-billings-api.ts +591 -0
  10. package/api.ts +35 -0
  11. package/base.ts +588 -0
  12. package/common.ts +199 -0
  13. package/configuration.ts +130 -0
  14. package/dist/api/bill-runs-api.d.ts +266 -0
  15. package/dist/api/bill-runs-api.js +466 -0
  16. package/dist/api/bills-api.d.ts +87 -0
  17. package/dist/api/bills-api.js +207 -0
  18. package/dist/api/invoices-api.d.ts +847 -0
  19. package/dist/api/invoices-api.js +1353 -0
  20. package/dist/api/jobs-api.d.ts +426 -0
  21. package/dist/api/jobs-api.js +708 -0
  22. package/dist/api/policy-billings-api.d.ts +332 -0
  23. package/dist/api/policy-billings-api.js +561 -0
  24. package/dist/api.d.ts +16 -0
  25. package/dist/api.js +34 -0
  26. package/dist/base.d.ts +120 -0
  27. package/dist/base.js +604 -0
  28. package/dist/common.d.ts +91 -0
  29. package/dist/common.js +277 -0
  30. package/dist/configuration.d.ts +106 -0
  31. package/dist/configuration.js +54 -0
  32. package/dist/index.d.ts +15 -0
  33. package/dist/index.js +36 -0
  34. package/dist/models/any.d.ts +25 -0
  35. package/dist/models/any.js +15 -0
  36. package/dist/models/bill-item.d.ts +132 -0
  37. package/dist/models/bill-item.js +15 -0
  38. package/dist/models/bill-run.d.ts +145 -0
  39. package/dist/models/bill-run.js +15 -0
  40. package/dist/models/bill.d.ts +194 -0
  41. package/dist/models/bill.js +15 -0
  42. package/dist/models/cancel-job-response.d.ts +25 -0
  43. package/dist/models/cancel-job-response.js +15 -0
  44. package/dist/models/create-correction-invoices-request.d.ts +72 -0
  45. package/dist/models/create-correction-invoices-request.js +15 -0
  46. package/dist/models/create-correction-invoices-response.d.ts +31 -0
  47. package/dist/models/create-correction-invoices-response.js +15 -0
  48. package/dist/models/create-detail-export-job-request.d.ts +56 -0
  49. package/dist/models/create-detail-export-job-request.js +15 -0
  50. package/dist/models/create-detail-export-job-response.d.ts +25 -0
  51. package/dist/models/create-detail-export-job-response.js +15 -0
  52. package/dist/models/create-estimated-invoice-for-interval-request.d.ts +42 -0
  53. package/dist/models/create-estimated-invoice-for-interval-request.js +15 -0
  54. package/dist/models/create-estimated-invoice-for-interval-response.d.ts +25 -0
  55. package/dist/models/create-estimated-invoice-for-interval-response.js +15 -0
  56. package/dist/models/create-estimated-invoice-request.d.ts +36 -0
  57. package/dist/models/create-estimated-invoice-request.js +15 -0
  58. package/dist/models/create-estimated-invoice-response.d.ts +25 -0
  59. package/dist/models/create-estimated-invoice-response.js +15 -0
  60. package/dist/models/create-export-job-request.d.ts +68 -0
  61. package/dist/models/create-export-job-request.js +15 -0
  62. package/dist/models/create-export-job-response.d.ts +25 -0
  63. package/dist/models/create-export-job-response.js +15 -0
  64. package/dist/models/create-initial-invoice-request.d.ts +72 -0
  65. package/dist/models/create-initial-invoice-request.js +15 -0
  66. package/dist/models/create-initial-invoice-response.d.ts +25 -0
  67. package/dist/models/create-initial-invoice-response.js +15 -0
  68. package/dist/models/create-invoice-request.d.ts +67 -0
  69. package/dist/models/create-invoice-request.js +15 -0
  70. package/dist/models/create-invoice-response.d.ts +25 -0
  71. package/dist/models/create-invoice-response.js +15 -0
  72. package/dist/models/create-invoice-status-body.d.ts +24 -0
  73. package/dist/models/create-invoice-status-body.js +15 -0
  74. package/dist/models/create-invoice-status-response.d.ts +25 -0
  75. package/dist/models/create-invoice-status-response.js +15 -0
  76. package/dist/models/create-item-request.d.ts +36 -0
  77. package/dist/models/create-item-request.js +15 -0
  78. package/dist/models/create-policy-billing-request.d.ts +42 -0
  79. package/dist/models/create-policy-billing-request.js +15 -0
  80. package/dist/models/create-policy-billing-response.d.ts +25 -0
  81. package/dist/models/create-policy-billing-response.js +15 -0
  82. package/dist/models/create-recurring-invoice-request.d.ts +72 -0
  83. package/dist/models/create-recurring-invoice-request.js +15 -0
  84. package/dist/models/create-recurring-invoice-response.d.ts +31 -0
  85. package/dist/models/create-recurring-invoice-response.js +15 -0
  86. package/dist/models/create-termination-invoice-request.d.ts +60 -0
  87. package/dist/models/create-termination-invoice-request.js +15 -0
  88. package/dist/models/create-termination-invoice-response.d.ts +25 -0
  89. package/dist/models/create-termination-invoice-response.js +15 -0
  90. package/dist/models/create-withdraw-invoice-request.d.ts +48 -0
  91. package/dist/models/create-withdraw-invoice-request.js +15 -0
  92. package/dist/models/create-withdraw-invoice-response.d.ts +25 -0
  93. package/dist/models/create-withdraw-invoice-response.js +15 -0
  94. package/dist/models/estimate-history-entry.d.ts +36 -0
  95. package/dist/models/estimate-history-entry.js +15 -0
  96. package/dist/models/export-column.d.ts +36 -0
  97. package/dist/models/export-column.js +15 -0
  98. package/dist/models/filter-field.d.ts +110 -0
  99. package/dist/models/filter-field.js +15 -0
  100. package/dist/models/filter-value.d.ts +37 -0
  101. package/dist/models/filter-value.js +15 -0
  102. package/dist/models/get-bill-response.d.ts +25 -0
  103. package/dist/models/get-bill-response.js +15 -0
  104. package/dist/models/get-bill-run-filter-catalog-response.d.ts +31 -0
  105. package/dist/models/get-bill-run-filter-catalog-response.js +15 -0
  106. package/dist/models/get-bill-run-response.d.ts +25 -0
  107. package/dist/models/get-bill-run-response.js +15 -0
  108. package/dist/models/get-invoice-filter-catalog-response.d.ts +31 -0
  109. package/dist/models/get-invoice-filter-catalog-response.js +15 -0
  110. package/dist/models/get-invoice-response.d.ts +25 -0
  111. package/dist/models/get-invoice-response.js +15 -0
  112. package/dist/models/get-job-download-response.d.ts +25 -0
  113. package/dist/models/get-job-download-response.js +15 -0
  114. package/dist/models/get-job-filter-catalog-response.d.ts +31 -0
  115. package/dist/models/get-job-filter-catalog-response.js +15 -0
  116. package/dist/models/get-job-response.d.ts +25 -0
  117. package/dist/models/get-job-response.js +15 -0
  118. package/dist/models/get-policies-billing-date-filter-catalog-response.d.ts +31 -0
  119. package/dist/models/get-policies-billing-date-filter-catalog-response.js +15 -0
  120. package/dist/models/get-policies-billing-filter-catalog-response.d.ts +31 -0
  121. package/dist/models/get-policies-billing-filter-catalog-response.js +15 -0
  122. package/dist/models/get-policy-billing-response.d.ts +25 -0
  123. package/dist/models/get-policy-billing-response.js +15 -0
  124. package/dist/models/highlight.d.ts +30 -0
  125. package/dist/models/highlight.js +15 -0
  126. package/dist/models/index.d.ts +75 -0
  127. package/dist/models/index.js +91 -0
  128. package/dist/models/invoice-item.d.ts +204 -0
  129. package/dist/models/invoice-item.js +15 -0
  130. package/dist/models/invoice-payment.d.ts +108 -0
  131. package/dist/models/invoice-payment.js +15 -0
  132. package/dist/models/invoice-payments.d.ts +25 -0
  133. package/dist/models/invoice-payments.js +15 -0
  134. package/dist/models/invoice-status.d.ts +54 -0
  135. package/dist/models/invoice-status.js +15 -0
  136. package/dist/models/invoice.d.ts +275 -0
  137. package/dist/models/invoice.js +15 -0
  138. package/dist/models/job-download.d.ts +36 -0
  139. package/dist/models/job-download.js +15 -0
  140. package/dist/models/job-error.d.ts +30 -0
  141. package/dist/models/job-error.js +15 -0
  142. package/dist/models/job-progress.d.ts +36 -0
  143. package/dist/models/job-progress.js +15 -0
  144. package/dist/models/job.d.ts +134 -0
  145. package/dist/models/job.js +15 -0
  146. package/dist/models/list-bill-runs-response.d.ts +37 -0
  147. package/dist/models/list-bill-runs-response.js +15 -0
  148. package/dist/models/list-invoices-response.d.ts +37 -0
  149. package/dist/models/list-invoices-response.js +15 -0
  150. package/dist/models/list-jobs-response.d.ts +37 -0
  151. package/dist/models/list-jobs-response.js +15 -0
  152. package/dist/models/list-policies-billing-dates-response.d.ts +37 -0
  153. package/dist/models/list-policies-billing-dates-response.js +15 -0
  154. package/dist/models/list-policies-billings-response.d.ts +37 -0
  155. package/dist/models/list-policies-billings-response.js +15 -0
  156. package/dist/models/list-request.d.ts +60 -0
  157. package/dist/models/list-request.js +15 -0
  158. package/dist/models/localized-text.d.ts +30 -0
  159. package/dist/models/localized-text.js +15 -0
  160. package/dist/models/match.d.ts +69 -0
  161. package/dist/models/match.js +15 -0
  162. package/dist/models/payment-term.d.ts +42 -0
  163. package/dist/models/payment-term.js +15 -0
  164. package/dist/models/policy-billing.d.ts +139 -0
  165. package/dist/models/policy-billing.js +15 -0
  166. package/dist/models/request-bill-run-request.d.ts +30 -0
  167. package/dist/models/request-bill-run-request.js +15 -0
  168. package/dist/models/request-bill-run-response.d.ts +25 -0
  169. package/dist/models/request-bill-run-response.js +15 -0
  170. package/dist/models/resolved-billing-config.d.ts +130 -0
  171. package/dist/models/resolved-billing-config.js +15 -0
  172. package/dist/models/revert-invoice-request.d.ts +24 -0
  173. package/dist/models/revert-invoice-request.js +15 -0
  174. package/dist/models/revert-invoice-response.d.ts +25 -0
  175. package/dist/models/revert-invoice-response.js +15 -0
  176. package/dist/models/slice.d.ts +30 -0
  177. package/dist/models/slice.js +15 -0
  178. package/dist/models/status.d.ts +37 -0
  179. package/dist/models/status.js +15 -0
  180. package/dist/models/tax.d.ts +30 -0
  181. package/dist/models/tax.js +15 -0
  182. package/dist/models/update-policy-billing-body.d.ts +24 -0
  183. package/dist/models/update-policy-billing-body.js +15 -0
  184. package/dist/models/update-policy-billing-response.d.ts +25 -0
  185. package/dist/models/update-policy-billing-response.js +15 -0
  186. package/git_push.sh +57 -0
  187. package/index.ts +19 -0
  188. package/models/any.ts +32 -0
  189. package/models/bill-item.ts +138 -0
  190. package/models/bill-run.ts +151 -0
  191. package/models/bill.ts +200 -0
  192. package/models/cancel-job-response.ts +31 -0
  193. package/models/create-correction-invoices-request.ts +78 -0
  194. package/models/create-correction-invoices-response.ts +37 -0
  195. package/models/create-detail-export-job-request.ts +60 -0
  196. package/models/create-detail-export-job-response.ts +31 -0
  197. package/models/create-estimated-invoice-for-interval-request.ts +48 -0
  198. package/models/create-estimated-invoice-for-interval-response.ts +31 -0
  199. package/models/create-estimated-invoice-request.ts +42 -0
  200. package/models/create-estimated-invoice-response.ts +31 -0
  201. package/models/create-export-job-request.ts +74 -0
  202. package/models/create-export-job-response.ts +31 -0
  203. package/models/create-initial-invoice-request.ts +78 -0
  204. package/models/create-initial-invoice-response.ts +31 -0
  205. package/models/create-invoice-request.ts +73 -0
  206. package/models/create-invoice-response.ts +31 -0
  207. package/models/create-invoice-status-body.ts +30 -0
  208. package/models/create-invoice-status-response.ts +31 -0
  209. package/models/create-item-request.ts +42 -0
  210. package/models/create-policy-billing-request.ts +48 -0
  211. package/models/create-policy-billing-response.ts +31 -0
  212. package/models/create-recurring-invoice-request.ts +78 -0
  213. package/models/create-recurring-invoice-response.ts +37 -0
  214. package/models/create-termination-invoice-request.ts +66 -0
  215. package/models/create-termination-invoice-response.ts +31 -0
  216. package/models/create-withdraw-invoice-request.ts +54 -0
  217. package/models/create-withdraw-invoice-response.ts +31 -0
  218. package/models/estimate-history-entry.ts +42 -0
  219. package/models/export-column.ts +42 -0
  220. package/models/filter-field.ts +116 -0
  221. package/models/filter-value.ts +43 -0
  222. package/models/get-bill-response.ts +31 -0
  223. package/models/get-bill-run-filter-catalog-response.ts +37 -0
  224. package/models/get-bill-run-response.ts +31 -0
  225. package/models/get-invoice-filter-catalog-response.ts +37 -0
  226. package/models/get-invoice-response.ts +31 -0
  227. package/models/get-job-download-response.ts +31 -0
  228. package/models/get-job-filter-catalog-response.ts +37 -0
  229. package/models/get-job-response.ts +31 -0
  230. package/models/get-policies-billing-date-filter-catalog-response.ts +37 -0
  231. package/models/get-policies-billing-filter-catalog-response.ts +37 -0
  232. package/models/get-policy-billing-response.ts +31 -0
  233. package/models/highlight.ts +36 -0
  234. package/models/index.ts +75 -0
  235. package/models/invoice-item.ts +210 -0
  236. package/models/invoice-payment.ts +114 -0
  237. package/models/invoice-payments.ts +31 -0
  238. package/models/invoice-status.ts +60 -0
  239. package/models/invoice.ts +281 -0
  240. package/models/job-download.ts +42 -0
  241. package/models/job-error.ts +36 -0
  242. package/models/job-progress.ts +42 -0
  243. package/models/job.ts +140 -0
  244. package/models/list-bill-runs-response.ts +43 -0
  245. package/models/list-invoices-response.ts +43 -0
  246. package/models/list-jobs-response.ts +43 -0
  247. package/models/list-policies-billing-dates-response.ts +43 -0
  248. package/models/list-policies-billings-response.ts +43 -0
  249. package/models/list-request.ts +66 -0
  250. package/models/localized-text.ts +36 -0
  251. package/models/match.ts +75 -0
  252. package/models/payment-term.ts +48 -0
  253. package/models/policy-billing.ts +145 -0
  254. package/models/request-bill-run-request.ts +36 -0
  255. package/models/request-bill-run-response.ts +31 -0
  256. package/models/resolved-billing-config.ts +134 -0
  257. package/models/revert-invoice-request.ts +30 -0
  258. package/models/revert-invoice-response.ts +31 -0
  259. package/models/slice.ts +36 -0
  260. package/models/status.ts +43 -0
  261. package/models/tax.ts +36 -0
  262. package/models/update-policy-billing-body.ts +30 -0
  263. package/models/update-policy-billing-response.ts +31 -0
  264. package/package.json +25 -4
  265. package/tsconfig.json +23 -0
package/common.ts ADDED
@@ -0,0 +1,199 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EMIL Billing Service
5
+ * The billing service: bills, bill runs, invoices and policy billings.
6
+ *
7
+ * The version of the OpenAPI document: 2.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import { Configuration } from "./configuration";
17
+ import { RequiredError, RequestArgs } from "./base";
18
+ import { AxiosInstance, AxiosResponse } from 'axios';
19
+ /**
20
+ *
21
+ * @export
22
+ */
23
+ export const DUMMY_BASE_URL = 'https://example.com'
24
+
25
+ /**
26
+ *
27
+ * @throws {RequiredError}
28
+ * @export
29
+ */
30
+ export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
31
+ if (paramValue === null || paramValue === undefined) {
32
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
33
+ }
34
+ }
35
+
36
+ /**
37
+ *
38
+ * @export
39
+ */
40
+ export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
41
+ if (configuration && configuration.apiKey) {
42
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
43
+ ? await configuration.apiKey(keyParamName)
44
+ : await configuration.apiKey;
45
+ object[keyParamName] = localVarApiKeyValue;
46
+ }
47
+ }
48
+
49
+ /**
50
+ *
51
+ * @export
52
+ */
53
+ export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
54
+ if (configuration && (configuration.username || configuration.password)) {
55
+ object["auth"] = { username: configuration.username, password: configuration.password };
56
+ }
57
+ }
58
+
59
+ /**
60
+ *
61
+ * @export
62
+ */
63
+ export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
64
+ if (configuration && configuration.accessToken) {
65
+ const accessToken = typeof configuration.accessToken === 'function'
66
+ ? await configuration.accessToken()
67
+ : await configuration.accessToken;
68
+ object["Authorization"] = configuration.getBearerToken(accessToken);
69
+ }
70
+ }
71
+
72
+ /**
73
+ *
74
+ * @export
75
+ */
76
+ export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
77
+ if (configuration && configuration.accessToken) {
78
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
79
+ ? await configuration.accessToken(name, scopes)
80
+ : await configuration.accessToken;
81
+ object["Authorization"] = configuration.getBearerToken(localVarAccessTokenValue);
82
+ }
83
+ }
84
+
85
+ /**
86
+ *
87
+ * @export
88
+ */
89
+ export const setSearchParams = function (url: URL, ...objects: any[]) {
90
+ const searchParams = new URLSearchParams(url.search);
91
+ for (const object of objects) {
92
+ for (const key in object) {
93
+ if (Array.isArray(object[key])) {
94
+ searchParams.delete(key);
95
+ for (const item of object[key]) {
96
+ searchParams.append(key, item);
97
+ }
98
+ } else {
99
+ searchParams.set(key, object[key]);
100
+ }
101
+ }
102
+ }
103
+ url.search = searchParams.toString();
104
+ }
105
+
106
+ /**
107
+ *
108
+ * @export
109
+ */
110
+ export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
111
+ const nonString = typeof value !== 'string';
112
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
113
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
114
+ : nonString;
115
+ return needsSerialization
116
+ ? JSON.stringify(value !== undefined ? value : {})
117
+ : (value || "");
118
+ }
119
+
120
+ /**
121
+ *
122
+ * @export
123
+ */
124
+ export const toPathString = function (url: URL) {
125
+ return url.pathname + url.search + url.hash
126
+ }
127
+
128
+ /**
129
+ *
130
+ * @export
131
+ */
132
+ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
133
+ // Typed by hand: since axios 1.20, request() returns an internal axios type that SDK declarations cannot name.
134
+ return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH): Promise<R> => {
135
+ const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url};
136
+ return axios.request<T, R>(axiosRequestArgs) as Promise<R>;
137
+ };
138
+ }
139
+
140
+ /* tslint:disable */
141
+ /* eslint-disable */
142
+ /**
143
+ * EMIL Billing Service
144
+ * The billing service: bills, bill runs, invoices and policy billings.
145
+ *
146
+ * The version of the OpenAPI document: 2.0
147
+ *
148
+ *
149
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
150
+ * https://openapi-generator.tech
151
+ * Do not edit the class manually.
152
+ */
153
+
154
+
155
+ export interface IStorageConverter<D, SD> {
156
+ toStorageData( data: D ): SD;
157
+ fromStorageData( storageData: SD ): D;
158
+ }
159
+
160
+ export interface IStorage {
161
+ get<T>( key: string, converter?: IStorageConverter<T, any> ): T | null;
162
+ set<T>( key: string, value: T, converter?: IStorageConverter<T, any> ): void;
163
+ }
164
+
165
+ export class LocalStorage implements IStorage {
166
+ readonly storage: Storage;
167
+
168
+ constructor() {
169
+ this.storage = localStorage;
170
+ }
171
+
172
+ get<T>( key: string, converter?: IStorageConverter<T, any> ): T | null {
173
+ const jsonValue = this.storage.getItem( key );
174
+ if ( jsonValue === null ) {
175
+ return null;
176
+ }
177
+ const value = JSON.parse( jsonValue );
178
+ if ( converter !== undefined ) {
179
+ return converter.fromStorageData( value );
180
+ } else {
181
+ return value as T;
182
+ }
183
+ }
184
+
185
+ set<T>( key: string, value: T, converter?: IStorageConverter<T, any> ): void {
186
+ let valueToStore: any = value;
187
+ if ( converter !== undefined ) {
188
+ valueToStore = converter.toStorageData( value );
189
+ }
190
+ const jsonValue = JSON.stringify( valueToStore );
191
+ this.storage.setItem( key, jsonValue );
192
+ }
193
+ }
194
+
195
+ let _defaultStorage: IStorage = null;
196
+
197
+ export const defaultStorage = (): IStorage => {
198
+ return _defaultStorage || (_defaultStorage = new LocalStorage());
199
+ };
@@ -0,0 +1,130 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EMIL Billing Service
5
+ * The billing service: bills, bill runs, invoices and policy billings.
6
+ *
7
+ * The version of the OpenAPI document: 2.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ export interface ConfigurationParameters {
17
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
18
+ username?: string;
19
+ password?: string;
20
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
21
+ basePath?: string;
22
+ baseOptions?: any;
23
+ formDataCtor?: new () => any;
24
+ cookieAuth?: boolean;
25
+ account?: string;
26
+ }
27
+
28
+ export class Configuration {
29
+ /**
30
+ * parameter for apiKey security
31
+ * @param name security name
32
+ * @memberof Configuration
33
+ */
34
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
35
+ /**
36
+ * parameter for basic security
37
+ *
38
+ * @type {string}
39
+ * @memberof Configuration
40
+ */
41
+ username?: string;
42
+ /**
43
+ * parameter for basic security
44
+ *
45
+ * @type {string}
46
+ * @memberof Configuration
47
+ */
48
+ password?: string;
49
+ /**
50
+ * parameter for oauth2 security
51
+ * @param name security name
52
+ * @param scopes oauth2 scope
53
+ * @memberof Configuration
54
+ */
55
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
56
+ /**
57
+ * override base path
58
+ *
59
+ * @type {string}
60
+ * @memberof Configuration
61
+ */
62
+ basePath?: string;
63
+ /**
64
+ * base options for axios calls
65
+ *
66
+ * @type {any}
67
+ * @memberof Configuration
68
+ */
69
+ baseOptions?: any;
70
+ /**
71
+ * The FormData constructor that will be used to create multipart form data
72
+ * requests. You can inject this here so that execution environments that
73
+ * do not support the FormData class can still run the generated client.
74
+ *
75
+ * @type {new () => FormData}
76
+ */
77
+ formDataCtor?: new () => any;
78
+
79
+ /**
80
+ * Use a server session when authservice makes one; otherwise the token, as without this option.
81
+ * Set `account` too, so each SDK object keeps its own account.
82
+ *
83
+ * @type {boolean}
84
+ * @memberof Configuration
85
+ */
86
+ cookieAuth?: boolean;
87
+ /**
88
+ * The session account (Cognito sub) this app shows, so the SDK never takes another tab's account.
89
+ *
90
+ * @type {string}
91
+ * @memberof Configuration
92
+ */
93
+ account?: string;
94
+
95
+ constructor(param: ConfigurationParameters = {}) {
96
+ this.apiKey = param.apiKey;
97
+ this.username = param.username;
98
+ this.password = param.password;
99
+ this.accessToken = param.accessToken;
100
+ this.basePath = param.basePath;
101
+ this.baseOptions = param.baseOptions;
102
+ this.formDataCtor = param.formDataCtor;
103
+ this.cookieAuth = param.cookieAuth;
104
+ this.account = param.account;
105
+ }
106
+
107
+ /**
108
+ * Check if the given MIME is a JSON MIME.
109
+ * JSON MIME examples:
110
+ * application/json
111
+ * application/json; charset=UTF8
112
+ * APPLICATION/JSON
113
+ * application/vnd.company+json
114
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
115
+ * @return True if the given MIME is JSON, false otherwise.
116
+ */
117
+ public isJsonMime(mime: string): boolean {
118
+ const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
119
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
120
+ }
121
+
122
+ /**
123
+ * Returns "Bearer" token.
124
+ * @param token - access token.
125
+ * @return Bearer token.
126
+ */
127
+ public getBearerToken(token?: string): string {
128
+ return ('' + token).startsWith("Bearer") ? token : "Bearer " + token;
129
+ }
130
+ }
@@ -0,0 +1,266 @@
1
+ /**
2
+ * EMIL Billing Service
3
+ * The billing service: bills, bill runs, invoices and policy billings.
4
+ *
5
+ * The version of the OpenAPI document: 2.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
13
+ import { Configuration } from '../configuration';
14
+ import { RequestArgs, BaseAPI } from '../base';
15
+ import { GetBillRunFilterCatalogResponse } from '../models';
16
+ import { GetBillRunResponse } from '../models';
17
+ import { ListBillRunsResponse } from '../models';
18
+ import { RequestBillRunRequest } from '../models';
19
+ import { RequestBillRunResponse } from '../models';
20
+ /**
21
+ * BillRunsApi - axios parameter creator
22
+ * @export
23
+ */
24
+ export declare const BillRunsApiAxiosParamCreator: (configuration?: Configuration) => {
25
+ /**
26
+ *
27
+ * @summary Returns one bill run.
28
+ * @param {string} code The run\&#39;s code.
29
+ * @param {*} [options] Override http request option.
30
+ * @throws {RequiredError}
31
+ */
32
+ billingServiceGetBillRun: (code: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
33
+ /**
34
+ *
35
+ * @summary Returns the filter catalog of the bill run list.
36
+ * @param {*} [options] Override http request option.
37
+ * @throws {RequiredError}
38
+ */
39
+ billingServiceGetBillRunFilterCatalog: (options?: AxiosRequestConfig) => Promise<RequestArgs>;
40
+ /**
41
+ *
42
+ * @summary Lists bill runs.
43
+ * @param {number} [pageSize]
44
+ * @param {string} [pageToken]
45
+ * @param {string} [filter]
46
+ * @param {string} [search]
47
+ * @param {string} [order]
48
+ * @param {string} [expand]
49
+ * @param {string} [filters]
50
+ * @param {*} [options] Override http request option.
51
+ * @throws {RequiredError}
52
+ */
53
+ billingServiceListBillRuns: (pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
54
+ /**
55
+ * It runs `kind` for `runDate` (today when empty). The run is finished when the call returns, and the response is the finished run. `kind` is `INVOICE`, `ESTIMATE` or `RECONCILE`. Only one run of a kind can run at a time.
56
+ * @summary Runs a bill run now.
57
+ * @param {RequestBillRunRequest} body The request of &#x60;RequestBillRun&#x60;.
58
+ * @param {*} [options] Override http request option.
59
+ * @throws {RequiredError}
60
+ */
61
+ billingServiceRequestBillRun: (body: RequestBillRunRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
62
+ };
63
+ /**
64
+ * BillRunsApi - functional programming interface
65
+ * @export
66
+ */
67
+ export declare const BillRunsApiFp: (configuration?: Configuration) => {
68
+ /**
69
+ *
70
+ * @summary Returns one bill run.
71
+ * @param {string} code The run\&#39;s code.
72
+ * @param {*} [options] Override http request option.
73
+ * @throws {RequiredError}
74
+ */
75
+ billingServiceGetBillRun(code: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetBillRunResponse>>;
76
+ /**
77
+ *
78
+ * @summary Returns the filter catalog of the bill run list.
79
+ * @param {*} [options] Override http request option.
80
+ * @throws {RequiredError}
81
+ */
82
+ billingServiceGetBillRunFilterCatalog(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetBillRunFilterCatalogResponse>>;
83
+ /**
84
+ *
85
+ * @summary Lists bill runs.
86
+ * @param {number} [pageSize]
87
+ * @param {string} [pageToken]
88
+ * @param {string} [filter]
89
+ * @param {string} [search]
90
+ * @param {string} [order]
91
+ * @param {string} [expand]
92
+ * @param {string} [filters]
93
+ * @param {*} [options] Override http request option.
94
+ * @throws {RequiredError}
95
+ */
96
+ billingServiceListBillRuns(pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListBillRunsResponse>>;
97
+ /**
98
+ * It runs `kind` for `runDate` (today when empty). The run is finished when the call returns, and the response is the finished run. `kind` is `INVOICE`, `ESTIMATE` or `RECONCILE`. Only one run of a kind can run at a time.
99
+ * @summary Runs a bill run now.
100
+ * @param {RequestBillRunRequest} body The request of &#x60;RequestBillRun&#x60;.
101
+ * @param {*} [options] Override http request option.
102
+ * @throws {RequiredError}
103
+ */
104
+ billingServiceRequestBillRun(body: RequestBillRunRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RequestBillRunResponse>>;
105
+ };
106
+ /**
107
+ * BillRunsApi - factory interface
108
+ * @export
109
+ */
110
+ export declare const BillRunsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
111
+ /**
112
+ *
113
+ * @summary Returns one bill run.
114
+ * @param {string} code The run\&#39;s code.
115
+ * @param {*} [options] Override http request option.
116
+ * @throws {RequiredError}
117
+ */
118
+ billingServiceGetBillRun(code: string, options?: any): AxiosPromise<GetBillRunResponse>;
119
+ /**
120
+ *
121
+ * @summary Returns the filter catalog of the bill run list.
122
+ * @param {*} [options] Override http request option.
123
+ * @throws {RequiredError}
124
+ */
125
+ billingServiceGetBillRunFilterCatalog(options?: any): AxiosPromise<GetBillRunFilterCatalogResponse>;
126
+ /**
127
+ *
128
+ * @summary Lists bill runs.
129
+ * @param {number} [pageSize]
130
+ * @param {string} [pageToken]
131
+ * @param {string} [filter]
132
+ * @param {string} [search]
133
+ * @param {string} [order]
134
+ * @param {string} [expand]
135
+ * @param {string} [filters]
136
+ * @param {*} [options] Override http request option.
137
+ * @throws {RequiredError}
138
+ */
139
+ billingServiceListBillRuns(pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListBillRunsResponse>;
140
+ /**
141
+ * It runs `kind` for `runDate` (today when empty). The run is finished when the call returns, and the response is the finished run. `kind` is `INVOICE`, `ESTIMATE` or `RECONCILE`. Only one run of a kind can run at a time.
142
+ * @summary Runs a bill run now.
143
+ * @param {RequestBillRunRequest} body The request of &#x60;RequestBillRun&#x60;.
144
+ * @param {*} [options] Override http request option.
145
+ * @throws {RequiredError}
146
+ */
147
+ billingServiceRequestBillRun(body: RequestBillRunRequest, options?: any): AxiosPromise<RequestBillRunResponse>;
148
+ };
149
+ /**
150
+ * Request parameters for billingServiceGetBillRun operation in BillRunsApi.
151
+ * @export
152
+ * @interface BillRunsApiBillingServiceGetBillRunRequest
153
+ */
154
+ export interface BillRunsApiBillingServiceGetBillRunRequest {
155
+ /**
156
+ * The run\&#39;s code.
157
+ * @type {string}
158
+ * @memberof BillRunsApiBillingServiceGetBillRun
159
+ */
160
+ readonly code: string;
161
+ }
162
+ /**
163
+ * Request parameters for billingServiceListBillRuns operation in BillRunsApi.
164
+ * @export
165
+ * @interface BillRunsApiBillingServiceListBillRunsRequest
166
+ */
167
+ export interface BillRunsApiBillingServiceListBillRunsRequest {
168
+ /**
169
+ *
170
+ * @type {number}
171
+ * @memberof BillRunsApiBillingServiceListBillRuns
172
+ */
173
+ readonly pageSize?: number;
174
+ /**
175
+ *
176
+ * @type {string}
177
+ * @memberof BillRunsApiBillingServiceListBillRuns
178
+ */
179
+ readonly pageToken?: string;
180
+ /**
181
+ *
182
+ * @type {string}
183
+ * @memberof BillRunsApiBillingServiceListBillRuns
184
+ */
185
+ readonly filter?: string;
186
+ /**
187
+ *
188
+ * @type {string}
189
+ * @memberof BillRunsApiBillingServiceListBillRuns
190
+ */
191
+ readonly search?: string;
192
+ /**
193
+ *
194
+ * @type {string}
195
+ * @memberof BillRunsApiBillingServiceListBillRuns
196
+ */
197
+ readonly order?: string;
198
+ /**
199
+ *
200
+ * @type {string}
201
+ * @memberof BillRunsApiBillingServiceListBillRuns
202
+ */
203
+ readonly expand?: string;
204
+ /**
205
+ *
206
+ * @type {string}
207
+ * @memberof BillRunsApiBillingServiceListBillRuns
208
+ */
209
+ readonly filters?: string;
210
+ }
211
+ /**
212
+ * Request parameters for billingServiceRequestBillRun operation in BillRunsApi.
213
+ * @export
214
+ * @interface BillRunsApiBillingServiceRequestBillRunRequest
215
+ */
216
+ export interface BillRunsApiBillingServiceRequestBillRunRequest {
217
+ /**
218
+ * The request of &#x60;RequestBillRun&#x60;.
219
+ * @type {RequestBillRunRequest}
220
+ * @memberof BillRunsApiBillingServiceRequestBillRun
221
+ */
222
+ readonly body: RequestBillRunRequest;
223
+ }
224
+ /**
225
+ * BillRunsApi - object-oriented interface
226
+ * @export
227
+ * @class BillRunsApi
228
+ * @extends {BaseAPI}
229
+ */
230
+ export declare class BillRunsApi extends BaseAPI {
231
+ /**
232
+ *
233
+ * @summary Returns one bill run.
234
+ * @param {BillRunsApiBillingServiceGetBillRunRequest} requestParameters Request parameters.
235
+ * @param {*} [options] Override http request option.
236
+ * @throws {RequiredError}
237
+ * @memberof BillRunsApi
238
+ */
239
+ billingServiceGetBillRun(requestParameters: BillRunsApiBillingServiceGetBillRunRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetBillRunResponse, any, {}, any>>;
240
+ /**
241
+ *
242
+ * @summary Returns the filter catalog of the bill run list.
243
+ * @param {*} [options] Override http request option.
244
+ * @throws {RequiredError}
245
+ * @memberof BillRunsApi
246
+ */
247
+ billingServiceGetBillRunFilterCatalog(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetBillRunFilterCatalogResponse, any, {}, any>>;
248
+ /**
249
+ *
250
+ * @summary Lists bill runs.
251
+ * @param {BillRunsApiBillingServiceListBillRunsRequest} requestParameters Request parameters.
252
+ * @param {*} [options] Override http request option.
253
+ * @throws {RequiredError}
254
+ * @memberof BillRunsApi
255
+ */
256
+ billingServiceListBillRuns(requestParameters?: BillRunsApiBillingServiceListBillRunsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListBillRunsResponse, any, {}, any>>;
257
+ /**
258
+ * It runs `kind` for `runDate` (today when empty). The run is finished when the call returns, and the response is the finished run. `kind` is `INVOICE`, `ESTIMATE` or `RECONCILE`. Only one run of a kind can run at a time.
259
+ * @summary Runs a bill run now.
260
+ * @param {BillRunsApiBillingServiceRequestBillRunRequest} requestParameters Request parameters.
261
+ * @param {*} [options] Override http request option.
262
+ * @throws {RequiredError}
263
+ * @memberof BillRunsApi
264
+ */
265
+ billingServiceRequestBillRun(requestParameters: BillRunsApiBillingServiceRequestBillRunRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<RequestBillRunResponse, any, {}, any>>;
266
+ }