Skip to content

Commit 5ecff10

Browse files
Regenerated after API update
1 parent 615bf70 commit 5ecff10

File tree

10 files changed

+137
-88
lines changed

10 files changed

+137
-88
lines changed

src/model/bookmarkInsert.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
import { AttributeInfo } from '../internal/attributeInfo';
2929
import { ModelInterface } from './modelInterface';
3030
import { BookmarkData } from './bookmarkData';
31-
import { DocumentPosition } from './documentPosition';
31+
import { NewDocumentPosition } from './newDocumentPosition';
3232

3333
export const importsMapBookmarkInsert = {
3434
BookmarkData,
35-
DocumentPosition,
35+
NewDocumentPosition,
3636
};
3737

3838
/**
@@ -46,12 +46,12 @@ export class BookmarkInsert extends BookmarkData {
4646
{
4747
name: "endRange",
4848
baseName: "EndRange",
49-
type: "DocumentPosition",
49+
type: "NewDocumentPosition",
5050
},
5151
{
5252
name: "startRange",
5353
baseName: "StartRange",
54-
type: "DocumentPosition",
54+
type: "NewDocumentPosition",
5555
}
5656
];
5757

@@ -65,12 +65,12 @@ export class BookmarkInsert extends BookmarkData {
6565
/**
6666
* Gets or sets the link to end bookmark node.
6767
*/
68-
public endRange: DocumentPosition;
68+
public endRange: NewDocumentPosition;
6969

7070
/**
7171
* Gets or sets the link to start bookmark node.
7272
*/
73-
public startRange: DocumentPosition;
73+
public startRange: NewDocumentPosition;
7474

7575
public constructor(init?: Partial< BookmarkInsert >) {
7676
super(init);

src/model/commentBase.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727

2828
import { AttributeInfo } from '../internal/attributeInfo';
2929
import { ModelInterface } from './modelInterface';
30-
import { DocumentPosition } from './documentPosition';
30+
import { NewDocumentPosition } from './newDocumentPosition';
3131

3232
export const importsMapCommentBase = {
33-
DocumentPosition,
33+
NewDocumentPosition,
3434
};
3535

3636
/**
@@ -59,12 +59,12 @@ export abstract class CommentBase implements ModelInterface {
5959
{
6060
name: "rangeEnd",
6161
baseName: "RangeEnd",
62-
type: "DocumentPosition",
62+
type: "NewDocumentPosition",
6363
},
6464
{
6565
name: "rangeStart",
6666
baseName: "RangeStart",
67-
type: "DocumentPosition",
67+
type: "NewDocumentPosition",
6868
},
6969
{
7070
name: "text",
@@ -98,12 +98,12 @@ export abstract class CommentBase implements ModelInterface {
9898
/**
9999
* Gets or sets the link to comment range end node.
100100
*/
101-
public rangeEnd: DocumentPosition;
101+
public rangeEnd: NewDocumentPosition;
102102

103103
/**
104104
* Gets or sets the link to comment range start node.
105105
*/
106-
public rangeStart: DocumentPosition;
106+
public rangeStart: NewDocumentPosition;
107107

108108
/**
109109
* Gets or sets text of the comment.

src/model/drawingObjectInsert.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727

2828
import { AttributeInfo } from '../internal/attributeInfo';
2929
import { ModelInterface } from './modelInterface';
30-
import { DocumentPosition } from './documentPosition';
30+
import { NewDocumentPosition } from './newDocumentPosition';
3131

3232
export const importsMapDrawingObjectInsert = {
33-
DocumentPosition,
33+
NewDocumentPosition,
3434
};
3535

3636
/**
@@ -54,7 +54,7 @@ export class DrawingObjectInsert implements ModelInterface {
5454
{
5555
name: "position",
5656
baseName: "Position",
57-
type: "DocumentPosition",
57+
type: "NewDocumentPosition",
5858
},
5959
{
6060
name: "relativeHorizontalPosition",
@@ -103,7 +103,7 @@ export class DrawingObjectInsert implements ModelInterface {
103103
/**
104104
* Gets or sets the position, before which the DrawingObject will be inserted.
105105
*/
106-
public position: DocumentPosition;
106+
public position: NewDocumentPosition;
107107

108108
/**
109109
* Gets or sets the relative horizontal position, from which the distance to the image is measured.

src/model/footnoteBase.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727

2828
import { AttributeInfo } from '../internal/attributeInfo';
2929
import { ModelInterface } from './modelInterface';
30-
import { DocumentPosition } from './documentPosition';
30+
import { NewDocumentPosition } from './newDocumentPosition';
3131

3232
export const importsMapFootnoteBase = {
33-
DocumentPosition,
33+
NewDocumentPosition,
3434
};
3535

3636
/**
@@ -49,7 +49,7 @@ export abstract class FootnoteBase implements ModelInterface {
4949
{
5050
name: "position",
5151
baseName: "Position",
52-
type: "DocumentPosition",
52+
type: "NewDocumentPosition",
5353
},
5454
{
5555
name: "referenceMark",
@@ -78,7 +78,7 @@ export abstract class FootnoteBase implements ModelInterface {
7878
/**
7979
* Gets or sets the link to comment range start node.
8080
*/
81-
public position: DocumentPosition;
81+
public position: NewDocumentPosition;
8282

8383
/**
8484
* Gets or sets the custom reference mark to be used for this footnote.

src/model/model.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ import * as importedMarkdownSaveOptionsData from './markdownSaveOptionsData';
179179
import * as importedMetafileRenderingOptionsData from './metafileRenderingOptionsData';
180180
import * as importedMhtmlSaveOptionsData from './mhtmlSaveOptionsData';
181181
import * as importedModificationOperationResult from './modificationOperationResult';
182+
import * as importedNewDocumentPosition from './newDocumentPosition';
182183
import * as importedNodeLink from './nodeLink';
183184
import * as importedOdtSaveOptionsData from './odtSaveOptionsData';
184185
import * as importedOfficeMathLink from './officeMathLink';
@@ -460,6 +461,7 @@ export * from './markdownSaveOptionsData';
460461
export * from './metafileRenderingOptionsData';
461462
export * from './mhtmlSaveOptionsData';
462463
export * from './modificationOperationResult';
464+
export * from './newDocumentPosition';
463465
export * from './nodeLink';
464466
export * from './odtSaveOptionsData';
465467
export * from './officeMathLink';
@@ -871,6 +873,7 @@ const typeMap = {
871873
MetafileRenderingOptionsData: importedMetafileRenderingOptionsData.MetafileRenderingOptionsData,
872874
MhtmlSaveOptionsData: importedMhtmlSaveOptionsData.MhtmlSaveOptionsData,
873875
ModificationOperationResult: importedModificationOperationResult.ModificationOperationResult,
876+
NewDocumentPosition: importedNewDocumentPosition.NewDocumentPosition,
874877
NodeLink: importedNodeLink.NodeLink,
875878
OdtSaveOptionsData: importedOdtSaveOptionsData.OdtSaveOptionsData,
876879
OfficeMathLink: importedOfficeMathLink.OfficeMathLink,

src/model/newDocumentPosition.ts

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="newDocumentPosition.ts">
4+
* Copyright (c) 2023 Aspose.Words for Cloud
5+
* </copyright>
6+
* <summary>
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in all
15+
* copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
* SOFTWARE.
24+
* </summary>
25+
* --------------------------------------------------------------------------------
26+
*/
27+
28+
import { AttributeInfo } from '../internal/attributeInfo';
29+
import { ModelInterface } from './modelInterface';
30+
31+
export const importsMapNewDocumentPosition = {
32+
};
33+
34+
/**
35+
* DTO container with a new position in the document tree.
36+
*/
37+
export class NewDocumentPosition implements ModelInterface {
38+
/**
39+
* Attribute type map
40+
*/
41+
public static attributeTypeMap: Array<AttributeInfo> = [
42+
{
43+
name: "nodeId",
44+
baseName: "NodeId",
45+
type: "string",
46+
},
47+
{
48+
name: "offset",
49+
baseName: "Offset",
50+
type: "number",
51+
}
52+
];
53+
54+
/**
55+
* Returns attribute type map
56+
*/
57+
public static getAttributeTypeMap() {
58+
return NewDocumentPosition.attributeTypeMap;
59+
}
60+
61+
/**
62+
* Gets or sets the node id.
63+
*/
64+
public nodeId: string;
65+
66+
/**
67+
* Gets or sets the offset in the node.
68+
*/
69+
public offset: number;
70+
71+
public constructor(init?: Partial< NewDocumentPosition >) {
72+
Object.assign(this, init);
73+
}
74+
75+
public collectFilesContent(_resultFilesContent: Array<any>) {
76+
}
77+
}
78+

src/model/tableInsert.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727

2828
import { AttributeInfo } from '../internal/attributeInfo';
2929
import { ModelInterface } from './modelInterface';
30-
import { DocumentPosition } from './documentPosition';
30+
import { NewDocumentPosition } from './newDocumentPosition';
3131

3232
export const importsMapTableInsert = {
33-
DocumentPosition,
33+
NewDocumentPosition,
3434
};
3535

3636
/**
@@ -49,7 +49,7 @@ export class TableInsert implements ModelInterface {
4949
{
5050
name: "position",
5151
baseName: "Position",
52-
type: "DocumentPosition",
52+
type: "NewDocumentPosition",
5353
},
5454
{
5555
name: "rowsCount",
@@ -73,7 +73,7 @@ export class TableInsert implements ModelInterface {
7373
/**
7474
* Gets or sets the position to insert the table. The table will be inserted before the specified position.
7575
*/
76-
public position: DocumentPosition;
76+
public position: NewDocumentPosition;
7777

7878
/**
7979
* Gets or sets the number of rows. The default value is 2.

src/model/tableInsertDto.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727

2828
import { AttributeInfo } from '../internal/attributeInfo';
2929
import { ModelInterface } from './modelInterface';
30-
import { DocumentPosition } from './documentPosition';
30+
import { NewDocumentPosition } from './newDocumentPosition';
3131

3232
export const importsMapTableInsertDto = {
33-
DocumentPosition,
33+
NewDocumentPosition,
3434
};
3535

3636
/**
@@ -49,7 +49,7 @@ export class TableInsertDto implements ModelInterface {
4949
{
5050
name: "position",
5151
baseName: "Position",
52-
type: "DocumentPosition",
52+
type: "NewDocumentPosition",
5353
},
5454
{
5555
name: "rowsCount",
@@ -73,7 +73,7 @@ export class TableInsertDto implements ModelInterface {
7373
/**
7474
* Gets or sets the position to insert the table. The table will be inserted before the specified position.
7575
*/
76-
public position: DocumentPosition;
76+
public position: NewDocumentPosition;
7777

7878
/**
7979
* Gets or sets the number of rows. The default value is 2.

test/bookmark/bookmarkTests.ts

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -306,17 +306,13 @@ describe("bookmark", () => {
306306
BaseTest.localBaseTestDataFolder + localFile
307307
).then((result0) => {
308308
expect(result0.response.statusMessage).to.equal("OK");
309-
const requestBookmarkStartRangeNode = new model.NodeLink({
310-
nodeId: "0.0.0.0"
309+
const requestBookmarkStartRange = new model.NewDocumentPosition({
310+
nodeId: "0.0.0.0",
311+
offset: 0
311312
})
312-
const requestBookmarkStartRange = new model.DocumentPosition({
313-
node: requestBookmarkStartRangeNode
314-
})
315-
const requestBookmarkEndRangeNode = new model.NodeLink({
316-
nodeId: "0.0.0.0"
317-
})
318-
const requestBookmarkEndRange = new model.DocumentPosition({
319-
node: requestBookmarkEndRangeNode
313+
const requestBookmarkEndRange = new model.NewDocumentPosition({
314+
nodeId: "0.0.0.0",
315+
offset: 0
320316
})
321317
const requestBookmark = new model.BookmarkInsert({
322318
startRange: requestBookmarkStartRange,
@@ -347,17 +343,13 @@ describe("bookmark", () => {
347343
it("should return response with code 200", () => {
348344
const wordsApi = BaseTest.initializeWordsApi();
349345
const requestDocument = fs.createReadStream(BaseTest.localBaseTestDataFolder + localFile);
350-
const requestBookmarkStartRangeNode = new model.NodeLink({
351-
nodeId: "0.0.0.0"
352-
})
353-
const requestBookmarkStartRange = new model.DocumentPosition({
354-
node: requestBookmarkStartRangeNode
355-
})
356-
const requestBookmarkEndRangeNode = new model.NodeLink({
357-
nodeId: "0.0.0.0"
346+
const requestBookmarkStartRange = new model.NewDocumentPosition({
347+
nodeId: "0.0.0.0",
348+
offset: 0
358349
})
359-
const requestBookmarkEndRange = new model.DocumentPosition({
360-
node: requestBookmarkEndRangeNode
350+
const requestBookmarkEndRange = new model.NewDocumentPosition({
351+
nodeId: "0.0.0.0",
352+
offset: 0
361353
})
362354
const requestBookmark = new model.BookmarkInsert({
363355
startRange: requestBookmarkStartRange,

0 commit comments

Comments
 (0)