@itarius-ug/docuware-api-client
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -22,2 +22,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
var _DocuWare_instances, _DocuWare_username, _DocuWare_password, _DocuWare_impersonateName, _DocuWare_baseUrl, _DocuWare_token, _DocuWare_expiration, _DocuWare_userAgent, _DocuWare_send, _DocuWare_get, _DocuWare_post, _DocuWare_put, _DocuWare_isExpired; | ||
import { fileTypeFromBuffer } from "file-type"; | ||
import { readFile } from "fs/promises"; | ||
@@ -36,3 +37,3 @@ import ky from "ky"; | ||
_DocuWare_expiration.set(this, null); | ||
_DocuWare_userAgent.set(this, "itarius/docuware-api-client"); | ||
_DocuWare_userAgent.set(this, "@itarius-ug/docuware-api-client"); | ||
__classPrivateFieldSet(this, _DocuWare_baseUrl, `${configuration.baseUrl}/DocuWare/Platform`, "f"); | ||
@@ -43,3 +44,3 @@ __classPrivateFieldSet(this, _DocuWare_username, configuration.username, "f"); | ||
if (userAgent) { | ||
__classPrivateFieldSet(this, _DocuWare_userAgent, `itarius/docuware-api-client - ${userAgent}`, "f"); | ||
__classPrivateFieldSet(this, _DocuWare_userAgent, userAgent, "f"); | ||
} | ||
@@ -199,6 +200,11 @@ } | ||
appendBufferToDocument(fileCabinetId, documentId, buffer, options) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { mime } = (_a = (yield fileTypeFromBuffer(buffer.content))) !== null && _a !== void 0 ? _a : { | ||
mime: "text/plain", | ||
}; | ||
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(), | ||
"Content-Type": mime, | ||
}, body: buffer.content }, (options !== null && options !== void 0 ? options : {}))); | ||
@@ -205,0 +211,0 @@ }); |
{ | ||
"name": "@itarius-ug/docuware-api-client", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "A TypeScript wrapper for the DocuWare REST API", | ||
@@ -26,3 +26,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"ky": "^1.5.0" | ||
"file-type": "^19.4.1", | ||
"ky": "^1.6.0" | ||
}, | ||
@@ -29,0 +30,0 @@ "devDependencies": { |
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
50175
460
2
+ Addedfile-type@^19.4.1
+ Added@sec-ant/readable-stream@0.4.1(transitive)
+ Added@tokenizer/token@0.3.0(transitive)
+ Addedfile-type@19.6.0(transitive)
+ Addedget-stream@9.0.1(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedis-stream@4.0.1(transitive)
+ Addedpeek-readable@5.3.1(transitive)
+ Addedstrtok3@9.1.1(transitive)
+ Addedtoken-types@6.0.0(transitive)
+ Addeduint8array-extras@1.4.0(transitive)
Updatedky@^1.6.0