@dangl/avacloud-client-node 1.54.17-avacloud-preview → 1.54.18-beta0001-avacloud-preview

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/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ### Licence
2
2
 
3
- #### Copyright (c) 2024 Dangl IT GmbH, [https://www.dangl-it.com](https://www.dangl-it.com)
3
+ #### Copyright (c) 2025 Dangl IT GmbH, [https://www.dangl-it.com](https://www.dangl-it.com)
4
4
 
5
5
  This software shall only be used for non-commercial evaluation purposes.
6
6
  Please contact Dangl**IT** for a commercial licence.
package/api.d.ts CHANGED
@@ -1600,6 +1600,16 @@ export declare class XRechnungConversionApi {
1600
1600
  */
1601
1601
  xRechnungConversionConvertAvaToXRechnung(avaWrapper: AvaProjectWrapper): Promise<SwaggerResponse<FileResponse>>;
1602
1602
  protected processXRechnungConversionConvertAvaToXRechnung(response: Response): Promise<SwaggerResponse<FileResponse>>;
1603
+ /**
1604
+ * This will convert an Invoice object to a PDF file
1605
+ */
1606
+ xRechnungConversionConvertInvoiceToPdfInvoice(invoice: Invoice): Promise<SwaggerResponse<FileResponse>>;
1607
+ protected processXRechnungConversionConvertInvoiceToPdfInvoice(response: Response): Promise<SwaggerResponse<FileResponse>>;
1608
+ /**
1609
+ * This will convert an AVA wrapper object to a PDF file
1610
+ */
1611
+ xRechnungConversionConvertAvaToPdfInvoice(avaWrapper: AvaProjectWrapper): Promise<SwaggerResponse<FileResponse>>;
1612
+ protected processXRechnungConversionConvertAvaToPdfInvoice(response: Response): Promise<SwaggerResponse<FileResponse>>;
1603
1613
  }
1604
1614
  export declare class DanglIdentityApi {
1605
1615
  private http;
package/api.js CHANGED
@@ -5612,6 +5612,122 @@ class XRechnungConversionApi {
5612
5612
  }
5613
5613
  return Promise.resolve(new SwaggerResponse(status, _headers, null));
5614
5614
  }
5615
+ /**
5616
+ * This will convert an Invoice object to a PDF file
5617
+ */
5618
+ xRechnungConversionConvertInvoiceToPdfInvoice(invoice) {
5619
+ let url_ = this.baseUrl + "/conversion/xrechnung/invoice/pdf";
5620
+ url_ = url_.replace(/[?&]$/, "");
5621
+ const content_ = JSON.stringify(invoice);
5622
+ let options_ = {
5623
+ body: content_,
5624
+ method: "POST",
5625
+ headers: {
5626
+ "Content-Type": "application/json",
5627
+ "Accept": "application/json"
5628
+ }
5629
+ };
5630
+ if (this._accessToken) {
5631
+ options_.headers = options_.headers || {};
5632
+ options_.headers['Authorization'] = `Bearer ${this._accessToken}`;
5633
+ }
5634
+ return this.http.fetch(url_, options_).then((_response) => {
5635
+ return this.processXRechnungConversionConvertInvoiceToPdfInvoice(_response);
5636
+ });
5637
+ }
5638
+ processXRechnungConversionConvertInvoiceToPdfInvoice(response) {
5639
+ const status = response.status;
5640
+ let _headers = {};
5641
+ if (response.headers && response.headers.forEach) {
5642
+ response.headers.forEach((v, k) => _headers[k] = v);
5643
+ }
5644
+ ;
5645
+ if (status === 200 || status === 206) {
5646
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
5647
+ let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
5648
+ let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
5649
+ if (fileName) {
5650
+ fileName = decodeURIComponent(fileName);
5651
+ }
5652
+ else {
5653
+ fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
5654
+ fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
5655
+ }
5656
+ return response.blob().then(blob => { return new SwaggerResponse(status, _headers, { fileName: fileName, data: blob, status: status, headers: _headers }); });
5657
+ }
5658
+ else if (status === 400) {
5659
+ return response.text().then((_responseText) => {
5660
+ let result400 = null;
5661
+ let resultData400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5662
+ result400 = ApiError.fromJS(resultData400);
5663
+ return throwException("A server side error occurred.", status, _responseText, _headers, result400);
5664
+ });
5665
+ }
5666
+ else if (status !== 200 && status !== 204) {
5667
+ return response.text().then((_responseText) => {
5668
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5669
+ });
5670
+ }
5671
+ return Promise.resolve(new SwaggerResponse(status, _headers, null));
5672
+ }
5673
+ /**
5674
+ * This will convert an AVA wrapper object to a PDF file
5675
+ */
5676
+ xRechnungConversionConvertAvaToPdfInvoice(avaWrapper) {
5677
+ let url_ = this.baseUrl + "/conversion/xrechnung/ava-wrapper/pdf";
5678
+ url_ = url_.replace(/[?&]$/, "");
5679
+ const content_ = JSON.stringify(avaWrapper);
5680
+ let options_ = {
5681
+ body: content_,
5682
+ method: "POST",
5683
+ headers: {
5684
+ "Content-Type": "application/json",
5685
+ "Accept": "application/json"
5686
+ }
5687
+ };
5688
+ if (this._accessToken) {
5689
+ options_.headers = options_.headers || {};
5690
+ options_.headers['Authorization'] = `Bearer ${this._accessToken}`;
5691
+ }
5692
+ return this.http.fetch(url_, options_).then((_response) => {
5693
+ return this.processXRechnungConversionConvertAvaToPdfInvoice(_response);
5694
+ });
5695
+ }
5696
+ processXRechnungConversionConvertAvaToPdfInvoice(response) {
5697
+ const status = response.status;
5698
+ let _headers = {};
5699
+ if (response.headers && response.headers.forEach) {
5700
+ response.headers.forEach((v, k) => _headers[k] = v);
5701
+ }
5702
+ ;
5703
+ if (status === 200 || status === 206) {
5704
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
5705
+ let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
5706
+ let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
5707
+ if (fileName) {
5708
+ fileName = decodeURIComponent(fileName);
5709
+ }
5710
+ else {
5711
+ fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
5712
+ fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
5713
+ }
5714
+ return response.blob().then(blob => { return new SwaggerResponse(status, _headers, { fileName: fileName, data: blob, status: status, headers: _headers }); });
5715
+ }
5716
+ else if (status === 400) {
5717
+ return response.text().then((_responseText) => {
5718
+ let result400 = null;
5719
+ let resultData400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5720
+ result400 = ApiError.fromJS(resultData400);
5721
+ return throwException("A server side error occurred.", status, _responseText, _headers, result400);
5722
+ });
5723
+ }
5724
+ else if (status !== 200 && status !== 204) {
5725
+ return response.text().then((_responseText) => {
5726
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5727
+ });
5728
+ }
5729
+ return Promise.resolve(new SwaggerResponse(status, _headers, null));
5730
+ }
5615
5731
  }
5616
5732
  exports.XRechnungConversionApi = XRechnungConversionApi;
5617
5733
  class DanglIdentityApi {