@dangl/avacloud-client-node 1.62.1-avacloud-preview → 1.63.0-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/api.d.ts +34 -2
- package/api.js +121 -2
- package/api.js.map +1 -1
- package/api.ts +134 -2
- package/package.json +1 -1
package/api.ts
CHANGED
|
@@ -5939,6 +5939,82 @@ export class XRechnungConversionApi {
|
|
|
5939
5939
|
}
|
|
5940
5940
|
return Promise.resolve<SwaggerResponse<FileResponse>>(new SwaggerResponse(status, _headers, null as any));
|
|
5941
5941
|
}
|
|
5942
|
+
|
|
5943
|
+
/**
|
|
5944
|
+
* This is a generated method that accepts an options object, it simply calls the generated method with the parameter list
|
|
5945
|
+
*/
|
|
5946
|
+
xRechnungConversionMergeInvoiceIntoPdfFileWithRequestObject(pdfEmbeddModel: PostXRechnungPdfEmbedd, options?: { targetFormat?: DestinationXRechnungFormat | undefined, disablePriceRounding?: boolean | undefined }): Promise<SwaggerResponse<FileResponse>> {
|
|
5947
|
+
return this.xRechnungConversionMergeInvoiceIntoPdfFile(pdfEmbeddModel, options?.targetFormat, options?.disablePriceRounding);
|
|
5948
|
+
}
|
|
5949
|
+
|
|
5950
|
+
/**
|
|
5951
|
+
* This will embedd an XRechnung file into an existing PDF file as an attachment.
|
|
5952
|
+
* @param targetFormat (optional) The target format for the XRechnung export. Defaults to Ubl. Options are:
|
|
5953
|
+
Ubl, CrossIndustryInvoice and FacturX (ZUGFerd)
|
|
5954
|
+
* @param disablePriceRounding (optional) If this is enabled, then the price values in the XRechnung export will not be rounded.
|
|
5955
|
+
Otherwise, prices will by default be rounded to two decimal places.
|
|
5956
|
+
*/
|
|
5957
|
+
xRechnungConversionMergeInvoiceIntoPdfFile(pdfEmbeddModel: PostXRechnungPdfEmbedd, targetFormat?: DestinationXRechnungFormat | undefined, disablePriceRounding?: boolean | undefined): Promise<SwaggerResponse<FileResponse>> {
|
|
5958
|
+
let url_ = this.baseUrl + "/conversion/xrechnung/merge?";
|
|
5959
|
+
if (targetFormat === null)
|
|
5960
|
+
throw new Error("The parameter 'targetFormat' cannot be null.");
|
|
5961
|
+
else if (targetFormat !== undefined)
|
|
5962
|
+
url_ += "TargetFormat=" + encodeURIComponent("" + targetFormat) + "&";
|
|
5963
|
+
if (disablePriceRounding === null)
|
|
5964
|
+
throw new Error("The parameter 'disablePriceRounding' cannot be null.");
|
|
5965
|
+
else if (disablePriceRounding !== undefined)
|
|
5966
|
+
url_ += "DisablePriceRounding=" + encodeURIComponent("" + disablePriceRounding) + "&";
|
|
5967
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5968
|
+
|
|
5969
|
+
const content_ = JSON.stringify(pdfEmbeddModel);
|
|
5970
|
+
|
|
5971
|
+
let options_: RequestInit = {
|
|
5972
|
+
body: content_,
|
|
5973
|
+
method: "POST",
|
|
5974
|
+
headers: {
|
|
5975
|
+
"Content-Type": "application/json",
|
|
5976
|
+
"Accept": "application/json"
|
|
5977
|
+
}
|
|
5978
|
+
};
|
|
5979
|
+
|
|
5980
|
+
if (this._accessToken) {
|
|
5981
|
+
options_.headers = options_.headers || {};
|
|
5982
|
+
options_.headers['Authorization'] = `Bearer ${this._accessToken}`;
|
|
5983
|
+
}
|
|
5984
|
+
|
|
5985
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
5986
|
+
return this.processXRechnungConversionMergeInvoiceIntoPdfFile(_response);
|
|
5987
|
+
});
|
|
5988
|
+
}
|
|
5989
|
+
|
|
5990
|
+
protected processXRechnungConversionMergeInvoiceIntoPdfFile(response: Response): Promise<SwaggerResponse<FileResponse>> {
|
|
5991
|
+
const status = response.status;
|
|
5992
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
5993
|
+
if (status === 200 || status === 206) {
|
|
5994
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
5995
|
+
let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
|
|
5996
|
+
let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
|
|
5997
|
+
if (fileName) {
|
|
5998
|
+
fileName = decodeURIComponent(fileName);
|
|
5999
|
+
} else {
|
|
6000
|
+
fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
6001
|
+
fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
6002
|
+
}
|
|
6003
|
+
return response.blob().then(blob => { return new SwaggerResponse(status, _headers, { fileName: fileName, data: blob, status: status, headers: _headers }); });
|
|
6004
|
+
} else if (status === 400) {
|
|
6005
|
+
return response.text().then((_responseText) => {
|
|
6006
|
+
let result400: any = null;
|
|
6007
|
+
let resultData400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
6008
|
+
result400 = ApiError.fromJS(resultData400);
|
|
6009
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
6010
|
+
});
|
|
6011
|
+
} else if (status !== 200 && status !== 204) {
|
|
6012
|
+
return response.text().then((_responseText) => {
|
|
6013
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6014
|
+
});
|
|
6015
|
+
}
|
|
6016
|
+
return Promise.resolve<SwaggerResponse<FileResponse>>(new SwaggerResponse(status, _headers, null as any));
|
|
6017
|
+
}
|
|
5942
6018
|
}
|
|
5943
6019
|
|
|
5944
6020
|
export class DanglIdentityApi {
|
|
@@ -14098,7 +14174,6 @@ export enum PaymentType {
|
|
|
14098
14174
|
JPElectronicallyRecordedMonetaryClaims = "JPElectronicallyRecordedMonetaryClaims",
|
|
14099
14175
|
}
|
|
14100
14176
|
|
|
14101
|
-
/** Represents a payment means for an invoice */
|
|
14102
14177
|
export class PaymentMeans implements IPaymentMeans {
|
|
14103
14178
|
/** BT-84
|
|
14104
14179
|
This is typically the IBAN or account number
|
|
@@ -14185,7 +14260,6 @@ https://github.com/itplr-kosit/validator-configuration-xrechnung/issues/53 */
|
|
|
14185
14260
|
}
|
|
14186
14261
|
}
|
|
14187
14262
|
|
|
14188
|
-
/** Represents a payment means for an invoice */
|
|
14189
14263
|
export interface IPaymentMeans {
|
|
14190
14264
|
/** BT-84
|
|
14191
14265
|
This is typically the IBAN or account number
|
|
@@ -16000,6 +16074,64 @@ export enum DestinationXRechnungFormat {
|
|
|
16000
16074
|
FacturX = "FacturX",
|
|
16001
16075
|
}
|
|
16002
16076
|
|
|
16077
|
+
/** This model is a wrapper for both an invoice and a PDF file as Base64 string */
|
|
16078
|
+
export class PostXRechnungPdfEmbedd implements IPostXRechnungPdfEmbedd {
|
|
16079
|
+
/** The invoice to be embedded into the PDF file */
|
|
16080
|
+
invoice!: Invoice;
|
|
16081
|
+
/** The PDF file as Base64 string */
|
|
16082
|
+
pdfFileBase64!: string;
|
|
16083
|
+
|
|
16084
|
+
constructor(data?: IPostXRechnungPdfEmbedd) {
|
|
16085
|
+
if (data) {
|
|
16086
|
+
for (var property in data) {
|
|
16087
|
+
if (data.hasOwnProperty(property))
|
|
16088
|
+
(<any>this)[property] = (<any>data)[property];
|
|
16089
|
+
}
|
|
16090
|
+
this.invoice = data.invoice && !(<any>data.invoice).toJSON ? new Invoice(data.invoice) : <Invoice>this.invoice;
|
|
16091
|
+
}
|
|
16092
|
+
if (!data) {
|
|
16093
|
+
this.invoice = new Invoice();
|
|
16094
|
+
}
|
|
16095
|
+
}
|
|
16096
|
+
|
|
16097
|
+
init?(_data?: any) {
|
|
16098
|
+
if (_data) {
|
|
16099
|
+
this.invoice = _data["invoice"] ? Invoice.fromJS(_data["invoice"]) : new Invoice();
|
|
16100
|
+
this.pdfFileBase64 = _data["pdfFileBase64"];
|
|
16101
|
+
}
|
|
16102
|
+
}
|
|
16103
|
+
|
|
16104
|
+
static fromJS(data: any): PostXRechnungPdfEmbedd {
|
|
16105
|
+
data = typeof data === 'object' ? data : {};
|
|
16106
|
+
let result = new PostXRechnungPdfEmbedd();
|
|
16107
|
+
result.init!(data);
|
|
16108
|
+
return result;
|
|
16109
|
+
}
|
|
16110
|
+
|
|
16111
|
+
toJSON?(data?: any) {
|
|
16112
|
+
data = typeof data === 'object' ? data : {};
|
|
16113
|
+
if (this.invoice) {
|
|
16114
|
+
if (typeof this.invoice.toJSON !== "undefined") {
|
|
16115
|
+
data["invoice"] = this.invoice.toJSON();
|
|
16116
|
+
} else {
|
|
16117
|
+
data["invoice"] = this.invoice;
|
|
16118
|
+
}
|
|
16119
|
+
} else {
|
|
16120
|
+
data["invoice"] = <any>undefined;
|
|
16121
|
+
}
|
|
16122
|
+
data["pdfFileBase64"] = this.pdfFileBase64;
|
|
16123
|
+
return data;
|
|
16124
|
+
}
|
|
16125
|
+
}
|
|
16126
|
+
|
|
16127
|
+
/** This model is a wrapper for both an invoice and a PDF file as Base64 string */
|
|
16128
|
+
export interface IPostXRechnungPdfEmbedd {
|
|
16129
|
+
/** The invoice to be embedded into the PDF file */
|
|
16130
|
+
invoice: IInvoice;
|
|
16131
|
+
/** The PDF file as Base64 string */
|
|
16132
|
+
pdfFileBase64: string;
|
|
16133
|
+
}
|
|
16134
|
+
|
|
16003
16135
|
export class LoginPost implements ILoginPost {
|
|
16004
16136
|
identifier!: string;
|
|
16005
16137
|
password!: string;
|