asposewordscloud
Version:
Aspose.Words Cloud SDK for Node.js
139 lines (138 loc) • 5.56 kB
JavaScript
/*
* --------------------------------------------------------------------------------
* <copyright company="Aspose" file="document.ts">
* Copyright (c) 2025 Aspose.Words for Cloud
* </copyright>
* <summary>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* </summary>
* --------------------------------------------------------------------------------
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.Document = exports.importsMapDocument = void 0;
const documentProperties_1 = require("./documentProperties");
const link_1 = require("./link");
exports.importsMapDocument = {
DocumentProperties: documentProperties_1.DocumentProperties,
Link: link_1.Link,
};
/**
* Represents Words document DTO.
*/
class Document {
/**
* Returns attribute type map
*/
static getAttributeTypeMap() {
return Document.attributeTypeMap;
}
constructor(init) {
Object.assign(this, init);
}
collectFilesContent(_resultFilesContent) {
}
validate() {
var _a;
if (this.isEncrypted === null || this.isEncrypted === undefined) {
throw new Error('Property IsEncrypted in Document is required.');
}
if (this.isSigned === null || this.isSigned === undefined) {
throw new Error('Property IsSigned in Document is required.');
}
if (this.sourceFormat === null || this.sourceFormat === undefined) {
throw new Error('Property SourceFormat in Document is required.');
}
if (this.links !== null && this.links !== undefined) {
for (let elementLinks of this.links) {
elementLinks === null || elementLinks === void 0 ? void 0 : elementLinks.validate();
}
}
(_a = this.documentProperties) === null || _a === void 0 ? void 0 : _a.validate();
}
}
exports.Document = Document;
/**
* Attribute type map
*/
Document.attributeTypeMap = [
{
name: "links",
baseName: "Links",
type: "Array<Link>",
},
{
name: "documentProperties",
baseName: "DocumentProperties",
type: "DocumentProperties",
},
{
name: "fileName",
baseName: "FileName",
type: "string",
},
{
name: "isEncrypted",
baseName: "IsEncrypted",
type: "boolean",
},
{
name: "isSigned",
baseName: "IsSigned",
type: "boolean",
},
{
name: "sourceFormat",
baseName: "SourceFormat",
type: "Document.SourceFormatEnum",
}
];
/**
* Enums for Document
*/
// tslint:disable:quotemark
// tslint:disable-next-line:no-namespace
(function (Document) {
let SourceFormatEnum;
(function (SourceFormatEnum) {
SourceFormatEnum[SourceFormatEnum["Unknown"] = 'Unknown'] = "Unknown";
SourceFormatEnum[SourceFormatEnum["Doc"] = 'Doc'] = "Doc";
SourceFormatEnum[SourceFormatEnum["Dot"] = 'Dot'] = "Dot";
SourceFormatEnum[SourceFormatEnum["DocPreWord60"] = 'DocPreWord60'] = "DocPreWord60";
SourceFormatEnum[SourceFormatEnum["Docx"] = 'Docx'] = "Docx";
SourceFormatEnum[SourceFormatEnum["Docm"] = 'Docm'] = "Docm";
SourceFormatEnum[SourceFormatEnum["Dotx"] = 'Dotx'] = "Dotx";
SourceFormatEnum[SourceFormatEnum["Dotm"] = 'Dotm'] = "Dotm";
SourceFormatEnum[SourceFormatEnum["FlatOpc"] = 'FlatOpc'] = "FlatOpc";
SourceFormatEnum[SourceFormatEnum["Rtf"] = 'Rtf'] = "Rtf";
SourceFormatEnum[SourceFormatEnum["WordML"] = 'WordML'] = "WordML";
SourceFormatEnum[SourceFormatEnum["Html"] = 'Html'] = "Html";
SourceFormatEnum[SourceFormatEnum["Mhtml"] = 'Mhtml'] = "Mhtml";
SourceFormatEnum[SourceFormatEnum["Epub"] = 'Epub'] = "Epub";
SourceFormatEnum[SourceFormatEnum["Text"] = 'Text'] = "Text";
SourceFormatEnum[SourceFormatEnum["Odt"] = 'Odt'] = "Odt";
SourceFormatEnum[SourceFormatEnum["Ott"] = 'Ott'] = "Ott";
SourceFormatEnum[SourceFormatEnum["Pdf"] = 'Pdf'] = "Pdf";
SourceFormatEnum[SourceFormatEnum["Xps"] = 'Xps'] = "Xps";
SourceFormatEnum[SourceFormatEnum["Tiff"] = 'Tiff'] = "Tiff";
SourceFormatEnum[SourceFormatEnum["Svg"] = 'Svg'] = "Svg";
SourceFormatEnum[SourceFormatEnum["Azw3"] = 'Azw3'] = "Azw3";
})(SourceFormatEnum = Document.SourceFormatEnum || (Document.SourceFormatEnum = {}));
})(Document = exports.Document || (exports.Document = {}));
// tslint:enable:quotemark
;