@itarius-ug/docuware-api-client
Advanced tools
Comparing version 2.2.0 to 2.2.1
/// <reference types="node" resolution-mode="require"/> | ||
import { Options } from "ky"; | ||
import type { Data, DialogExpression, Document, DocuWareConfiguration, FileCabinet } from "./contracts.js"; | ||
@@ -27,7 +28,7 @@ export declare class DocuWare { | ||
}): Promise<void>; | ||
appendFilesToDocument(fileCabinetId: string, documentId: number, files: string | string[]): Promise<void>; | ||
appendFilesToDocument(fileCabinetId: string, documentId: number, files: string | string[], options?: Pick<Options, "timeout">): Promise<void>; | ||
appendBufferToDocument(fileCabinetId: string, documentId: number, buffer: { | ||
name: string; | ||
content: Buffer; | ||
}): Promise<void>; | ||
}, options?: Pick<Options, "timeout">): Promise<void>; | ||
} |
@@ -89,3 +89,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
try { | ||
yield __classPrivateFieldGet(this, _DocuWare_instances, "m", _DocuWare_post).call(this, configuration.revocation_endpoint, { body: searchParams }); | ||
yield __classPrivateFieldGet(this, _DocuWare_instances, "m", _DocuWare_post).call(this, configuration.revocation_endpoint, { | ||
body: searchParams, | ||
}); | ||
__classPrivateFieldSet(this, _DocuWare_token, null, "f"); | ||
@@ -181,3 +183,3 @@ __classPrivateFieldSet(this, _DocuWare_expiration, null, "f"); | ||
} | ||
appendFilesToDocument(fileCabinetId, documentId, files) { | ||
appendFilesToDocument(fileCabinetId, documentId, files, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -188,21 +190,15 @@ if (!Array.isArray(files)) { | ||
for (const file of files) { | ||
yield __classPrivateFieldGet(this, _DocuWare_instances, "m", _DocuWare_post).call(this, `${__classPrivateFieldGet(this, _DocuWare_baseUrl, "f")}/filecabinets/${fileCabinetId}/Sections?DocId=${documentId}`, { | ||
headers: { | ||
yield __classPrivateFieldGet(this, _DocuWare_instances, "m", _DocuWare_post).call(this, `${__classPrivateFieldGet(this, _DocuWare_baseUrl, "f")}/filecabinets/${fileCabinetId}/Sections?DocId=${documentId}`, Object.assign({ headers: { | ||
"Content-Disposition": `file; filename="${basename(file)}"`, | ||
"X-File-ModifiedDate": new Date().toISOString(), | ||
}, | ||
body: yield readFile(file), | ||
}); | ||
}, body: yield readFile(file) }, (options !== null && options !== void 0 ? options : {}))); | ||
} | ||
}); | ||
} | ||
appendBufferToDocument(fileCabinetId, documentId, buffer) { | ||
appendBufferToDocument(fileCabinetId, documentId, buffer, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield __classPrivateFieldGet(this, _DocuWare_instances, "m", _DocuWare_post).call(this, `${__classPrivateFieldGet(this, _DocuWare_baseUrl, "f")}/filecabinets/${fileCabinetId}/Sections?DocId=${documentId}`, { | ||
headers: { | ||
yield __classPrivateFieldGet(this, _DocuWare_instances, "m", _DocuWare_post).call(this, `${__classPrivateFieldGet(this, _DocuWare_baseUrl, "f")}/filecabinets/${fileCabinetId}/Sections?DocId=${documentId}`, Object.assign({ headers: { | ||
"Content-Disposition": `file; filename="${buffer.name}"`, | ||
"X-File-ModifiedDate": new Date().toISOString(), | ||
}, | ||
body: buffer.content, | ||
}); | ||
}, body: buffer.content }, (options !== null && options !== void 0 ? options : {}))); | ||
}); | ||
@@ -209,0 +205,0 @@ } |
{ | ||
"name": "@itarius-ug/docuware-api-client", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "A TypeScript wrapper for the DocuWare REST API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49907
454