Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
dynabic-billing-team committed Dec 11, 2023
2 parents 554bf6d + 8a46fde commit 1bb3974
Show file tree
Hide file tree
Showing 21 changed files with 1,490 additions and 127 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ Feel free to explore the [Developer's Guide](https://docs.aspose.cloud/display/w
- Add & remove watermarks and protection.
- Read & write access to Document Object Model.

## Enhancements in Version 23.12

- Properties Name, Text, StartRange, EndRange marked as required for InsertBookmark operation.
- Implemented DeleteOfficeMathObjects operation to delete all office math objects from document.
- Parameter ProtectionRequest was removed from the UnprotectDocument operation. Now removing protection from a document does not require a password.
- Model ProtectionRequest marked as deprecated, please use ProtectionRequestV2 instead for perform ProtectDocument operation. To change the password or protection type of protected document, the old password is no required.


## Enhancements in Version 23.11

- Support of required properties in models.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "asposewordscloud",
"version": "23.11.0",
"version": "23.12.0",
"description": "Aspose.Words Cloud SDK for Node.js",
"homepage": "https://products.aspose.cloud/words/cloud",
"author": {
Expand Down
77 changes: 75 additions & 2 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,39 @@ export class WordsApi implements Encryptor {
return Promise.resolve(result);
}

/**
* Removes all office math objects from the document.
* @param requestObj contains request parameters
*/
public async deleteOfficeMathObjects(requestObj: model.DeleteOfficeMathObjectsRequest): Promise< http.IncomingMessage > {
if (requestObj === null || requestObj === undefined) {
throw new Error('Required parameter "request" was null or undefined when calling deleteOfficeMathObjects.');
}

const requestOptions = await requestObj.createRequestOptions(this.configuration, this);

const response = await invokeApiMethod(requestOptions, this.configuration);
return Promise.resolve(response);
}

/**
* Removes all office math objects from the document.
* @param requestObj contains request parameters
*/
public async deleteOfficeMathObjectsOnline(requestObj: model.DeleteOfficeMathObjectsOnlineRequest): Promise< model.WordsIncomingMessage< Map<string, Buffer> > > {
if (requestObj === null || requestObj === undefined) {
throw new Error('Required parameter "request" was null or undefined when calling deleteOfficeMathObjectsOnline.');
}

const requestOptions = await requestObj.createRequestOptions(this.configuration, this);

const response = await invokeApiMethod(requestOptions, this.configuration);
const result = new model.WordsIncomingMessage< Map<string, Buffer> >();
result.response = response;
result.body = requestObj.createResponse(response.body, response.headers);
return Promise.resolve(result);
}

/**
* Removes a paragraph from the document node.
* @param requestObj contains request parameters
Expand Down Expand Up @@ -4419,8 +4452,27 @@ export class WordsApi implements Encryptor {
return Promise.resolve(result);
}

/**
* Insert a watermark to the document.
* @param requestObj contains request parameters
*/
public async insertWatermark(requestObj: model.InsertWatermarkRequest): Promise< model.WordsIncomingMessage< model.DocumentResponse > > {
if (requestObj === null || requestObj === undefined) {
throw new Error('Required parameter "request" was null or undefined when calling insertWatermark.');
}

const requestOptions = await requestObj.createRequestOptions(this.configuration, this);

const response = await invokeApiMethod(requestOptions, this.configuration);
const result = new model.WordsIncomingMessage< model.DocumentResponse >();
result.response = response;
result.body = requestObj.createResponse(response.body, response.headers);
return Promise.resolve(result);
}

/**
* Inserts a new watermark image to the document.
* @deprecated This operation is deprecated and is used for backward compatibility only. Please use InsertWatermark instead.
* @param requestObj contains request parameters
*/
public async insertWatermarkImage(requestObj: model.InsertWatermarkImageRequest): Promise< model.WordsIncomingMessage< model.DocumentResponse > > {
Expand All @@ -4439,6 +4491,7 @@ export class WordsApi implements Encryptor {

/**
* Inserts a new watermark image to the document.
* @deprecated This operation is deprecated and is used for backward compatibility only. Please use InsertWatermark instead.
* @param requestObj contains request parameters
*/
public async insertWatermarkImageOnline(requestObj: model.InsertWatermarkImageOnlineRequest): Promise< model.WordsIncomingMessage< model.InsertWatermarkImageOnlineResponse > > {
Expand All @@ -4455,8 +4508,27 @@ export class WordsApi implements Encryptor {
return Promise.resolve(result);
}

/**
* Insert a watermark to the document.
* @param requestObj contains request parameters
*/
public async insertWatermarkOnline(requestObj: model.InsertWatermarkOnlineRequest): Promise< model.WordsIncomingMessage< model.InsertWatermarkOnlineResponse > > {
if (requestObj === null || requestObj === undefined) {
throw new Error('Required parameter "request" was null or undefined when calling insertWatermarkOnline.');
}

const requestOptions = await requestObj.createRequestOptions(this.configuration, this);

const response = await invokeApiMethod(requestOptions, this.configuration);
const result = new model.WordsIncomingMessage< model.InsertWatermarkOnlineResponse >();
result.response = response;
result.body = requestObj.createResponse(response.body, response.headers);
return Promise.resolve(result);
}

/**
* Inserts a new watermark text to the document.
* @deprecated This operation is deprecated and is used for backward compatibility only. Please use InsertWatermark instead.
* @param requestObj contains request parameters
*/
public async insertWatermarkText(requestObj: model.InsertWatermarkTextRequest): Promise< model.WordsIncomingMessage< model.DocumentResponse > > {
Expand All @@ -4475,6 +4547,7 @@ export class WordsApi implements Encryptor {

/**
* Inserts a new watermark text to the document.
* @deprecated This operation is deprecated and is used for backward compatibility only. Please use InsertWatermark instead.
* @param requestObj contains request parameters
*/
public async insertWatermarkTextOnline(requestObj: model.InsertWatermarkTextOnlineRequest): Promise< model.WordsIncomingMessage< model.InsertWatermarkTextOnlineResponse > > {
Expand Down Expand Up @@ -4588,7 +4661,7 @@ export class WordsApi implements Encryptor {
}

/**
* Adds protection to the document.
* Changes the document protection. The previous protection will be overwritten if it exist.
* @param requestObj contains request parameters
*/
public async protectDocument(requestObj: model.ProtectDocumentRequest): Promise< model.WordsIncomingMessage< model.ProtectionDataResponse > > {
Expand All @@ -4606,7 +4679,7 @@ export class WordsApi implements Encryptor {
}

/**
* Adds protection to the document.
* Changes the document protection. The previous protection will be overwritten if it exist.
* @param requestObj contains request parameters
*/
public async protectDocumentOnline(requestObj: model.ProtectDocumentOnlineRequest): Promise< model.WordsIncomingMessage< model.ProtectDocumentOnlineResponse > > {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/requestHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async function invokeApiMethodInternal(requestOptions: request.OptionsWithUri, c
requestOptions.timeout = 1000 * confguration.timeout;

requestOptions.headers["x-aspose-client"] = "nodejs sdk";
requestOptions.headers["x-aspose-client-version"] = "23.11";
requestOptions.headers["x-aspose-client-version"] = "23.12";
requestOptions.encoding = null;

requestOptions.uri = encodeURI(requestOptions.uri.toString());
Expand Down
44 changes: 38 additions & 6 deletions src/model/bookmarkInsert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,30 @@

import { AttributeInfo } from '../internal/attributeInfo';
import { ModelInterface } from './modelInterface';
import { BookmarkData } from './bookmarkData';
import { NewDocumentPosition } from './newDocumentPosition';

export const importsMapBookmarkInsert = {
BookmarkData,
NewDocumentPosition,
};

/**
* Represents a bookmark to insert.
*/
export class BookmarkInsert extends BookmarkData {
export class BookmarkInsert implements ModelInterface {
/**
* Attribute type map
*/
public static attributeTypeMap: Array<AttributeInfo> = [
{
name: "name",
baseName: "Name",
type: "string",
},
{
name: "text",
baseName: "Text",
type: "string",
},
{
name: "startRange",
baseName: "StartRange",
Expand All @@ -59,9 +67,19 @@ export class BookmarkInsert extends BookmarkData {
* Returns attribute type map
*/
public static getAttributeTypeMap() {
return super.getAttributeTypeMap().concat(BookmarkInsert.attributeTypeMap);
return BookmarkInsert.attributeTypeMap;
}

/**
* Gets or sets the name of the bookmark.
*/
public name: string;

/**
* Gets or sets text, enclosed in the bookmark.
*/
public text: string;

/**
* Gets or sets the link to start bookmark node.
*/
Expand All @@ -73,15 +91,29 @@ export class BookmarkInsert extends BookmarkData {
public endRange: NewDocumentPosition;

public constructor(init?: Partial< BookmarkInsert >) {
super(init);
Object.assign(this, init);
}

public collectFilesContent(_resultFilesContent: Array<any>) {
}

public validate() {
super.validate();
if (this.name === null || this.name === undefined)
{
throw new Error('Property Name in BookmarkInsert is required.');
}
if (this.text === null || this.text === undefined)
{
throw new Error('Property Text in BookmarkInsert is required.');
}
if (this.startRange === null || this.startRange === undefined)
{
throw new Error('Property StartRange in BookmarkInsert is required.');
}
if (this.endRange === null || this.endRange === undefined)
{
throw new Error('Property EndRange in BookmarkInsert is required.');
}

this.startRange?.validate();

Expand Down
26 changes: 24 additions & 2 deletions src/model/compareData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
import { AttributeInfo } from '../internal/attributeInfo';
import { ModelInterface } from './modelInterface';
import { CompareOptions } from './compareOptions';
import { FileReference } from './fileReference';

export const importsMapCompareData = {
CompareOptions,
FileReference,
};

/**
Expand Down Expand Up @@ -61,6 +63,11 @@ export class CompareData implements ModelInterface {
baseName: "DateTime",
type: "Date",
},
{
name: "fileReference",
baseName: "FileReference",
type: "FileReference",
},
{
name: "resultDocumentFormat",
baseName: "ResultDocumentFormat",
Expand Down Expand Up @@ -95,6 +102,11 @@ export class CompareData implements ModelInterface {
*/
public dateTime: Date;

/**
* Gets or sets the file reference.
*/
public fileReference: FileReference;

/**
* Gets or sets the result document format.
*/
Expand All @@ -105,23 +117,33 @@ export class CompareData implements ModelInterface {
}

public collectFilesContent(_resultFilesContent: Array<any>) {
if (this.fileReference)
{
this.fileReference.collectFilesContent(_resultFilesContent);
}


}

public validate() {
if (this.author === null || this.author === undefined)
{
throw new Error('Property Author in CompareData is required.');
}
if (this.comparingWithDocument === null || this.comparingWithDocument === undefined)
if (this.fileReference === null || this.fileReference === undefined)
{
throw new Error('Property ComparingWithDocument in CompareData is required.');
throw new Error('Property FileReference in CompareData is required.');
}

this.compareOptions?.validate();





this.fileReference?.validate();


}
}

Loading

0 comments on commit 1bb3974

Please sign in to comment.