Skip to content

Commit 62ff6b3

Browse files
Merge branch 'WORDSCLOUD_893' into 'master'
Wordscloud 893 See merge request words-cloud/words-cloud-node!3
2 parents 95e79e9 + a617b98 commit 62ff6b3

File tree

6 files changed

+64
-174
lines changed

6 files changed

+64
-174
lines changed

.gitignore

Lines changed: 11 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,16 @@
1+
# project files
2+
.vscode/*
13

2-
Temp/
3-
obj/
4-
classes/
5-
generated/
6-
*.suo
7-
bin/
8-
*_out_*
9-
* Out*
10-
* out*
11-
*.ldb
12-
Thumbs.db
13-
_ReSharper*/
14-
out/
15-
*.lic
16-
*.user
17-
Out/
18-
Out*/
19-
Data/*Out*
20-
TestResults/
21-
*.ide
22-
*.vsmdi
23-
test-results/
4+
# node packages
5+
package-lock.json
246
node_modules/
25-
*.userprefs
26-
packages/
27-
Plugins/Aspose_Words_NET_for_PHP/.idea/*
28-
Plugins/Aspose_Words_NET_for_PHP/vendor/*
29-
Plugins/Aspose_Words_NET_for_PHP/composer.lock
30-
*.gitattributes
31-
*.pyc
32-
# Built application files
33-
*.apk
34-
*.ap_
357

36-
# Files for the ART/Dalvik VM
37-
*.dex
38-
39-
# Java class files
40-
*.class
41-
42-
# Generated files
43-
bin/
44-
gen/
45-
out/
46-
47-
# Gradle files
48-
.gradle/
49-
build/
50-
51-
# Local configuration file (sdk path, etc)
52-
local.properties
53-
54-
# Proguard folder generated by Eclipse
55-
proguard/
56-
57-
# Log Files
58-
*.log
59-
60-
# Android Studio Navigation editor temp files
61-
.navigation/
62-
63-
# Android Studio captures folder
64-
captures/
65-
66-
# Intellij
67-
*.iml
68-
.idea/workspace.xml
69-
.idea/tasks.xml
70-
.idea/gradle.xml
71-
.idea/dictionaries
72-
.idea/libraries
73-
74-
# Keystore files
75-
*.jks
76-
77-
# External native build folder generated in Android Studio 2.2 and later
78-
.externalNativeBuild
79-
80-
# Google Services (e.g. APIs or Firebase)
81-
google-services.json
82-
83-
# Freeline
84-
freeline.py
85-
freeline/
86-
freeline_project_description.json
87-
88-
# Compiled class file
89-
*.class
90-
91-
# Log file
92-
*.log
93-
94-
# BlueJ files
95-
*.ctxt
96-
97-
# Mobile Tools for Java (J2ME)
98-
.mtj.tmp/
99-
100-
# Package Files #
101-
*.war
102-
*.ear
103-
*.zip
104-
*.tar.gz
105-
*.rar
8+
# credentials
9+
testConfig.json
10+
.npmrc
10611

107-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
108-
hs_err_pid*
12+
# build files
13+
dist/*
10914

110-
.DS_Store
111-
*.xcuserstate*StyleCop.Cache
112-
*StyleCop.Cache
113-
SDKs/NET/.vs/*
114-
SDKs/PHP/.idea/*
115-
SDKs/PHP/vendor/*
116-
SDKs/PHP/testReports/*
117-
SDKs/servercreds.json
118-
*/testConfig.json
119-
/dist/*
120-
/servercreds.json
121-
testConfig.json
122-
/ts-node-*
123-
reports/*
124-
/.npmrc
15+
# reports
16+
reports/*

Jenkinsfile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
parameters {
2-
string(name: 'branch', defaultValue: 'master', description: 'branch to test')
3-
string(name: 'testServerUrl', defaultValue: 'https://auckland-words-cloud-staging.dynabic.com', description: 'server url')
4-
}
1+
properties([
2+
parameters([string(defaultValue: 'master', description: 'the branch to build', name: 'branch', trim: true)])
3+
])
54

65
def runtests(dockerImageVersion)
76
{
87
dir(dockerImageVersion){
98
try {
109
stage('checkout'){
11-
checkout([$class: 'GitSCM', branches: [[name: '*/' + params.branch]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '9d6c4dfa-042c-4ed1-81c7-9175179dddda', url: 'https://github.com/aspose-words-cloud/aspose-words-cloud-node.git/']]])
10+
checkout([$class: 'GitSCM', branches: [[name: '*/' + params.branch]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-node.git']]])
1211
withCredentials([usernamePassword(credentialsId: '6839cbe8-39fa-40c0-86ce-90706f0bae5d', passwordVariable: 'AppKey', usernameVariable: 'AppSid')]) {
13-
sh 'echo "{\\"AppSid\\": \\"$AppSid\\",\\"AppKey\\": \\"$AppKey\\", \\"BaseUrl\\": \\"$testServerUrl\\"}" > testConfig.json'
12+
sh 'echo "{\\"AppSid\\": \\"$AppSid\\",\\"AppKey\\": \\"$AppKey\\"}" > testConfig.json'
1413
}
1514
}
1615

@@ -56,7 +55,6 @@ def runtests(dockerImageVersion)
5655
}
5756
}
5857

59-
node('billing-qa-ubuntu-16.04.4') {
60-
runtests("latest")
61-
runtests("6")
58+
node('words-linux') {
59+
runtests("latest")
6260
}

JenkinsfileRelease

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
node('billing-qa-ubuntu-16.04.4') {
1+
node('words-linux') {
22
try {
33
stage('checkout'){
4-
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '9d6c4dfa-042c-4ed1-81c7-9175179dddda', url: 'https://github.com/aspose-words-cloud/aspose-words-cloud-node.git/']]])
5-
withCredentials([usernamePassword(credentialsId: '6839cbe8-39fa-40c0-86ce-90706f0bae5d', passwordVariable: 'AppKey', usernameVariable: 'AppSid')]) {
6-
sh 'echo "{\\"AppSid\\": \\"$AppSid\\",\\"AppKey\\": \\"$AppKey\\", \\"BaseUrl\\": \\"https://auckland-words-cloud-staging.dynabic.com\\"}" > testConfig.json'
7-
}
4+
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-node.git']]])
85

9-
sh "git config user.email \"[email protected]\""
10-
sh "git config user.name \"jenkins\""
6+
sh "git config user.email \"[email protected]\""
7+
sh "git config user.name \"jenkins\""
8+
9+
withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', usernameVariable: 'gitUsername', passwordVariable: 'gitPass')]) {
10+
gitRepoUrl = "https://${gitUsername}:${gitPass}@git.auckland.dynabic.com/words-cloud/words-cloud-node.git"
11+
}
1112
}
1213

1314
docker.image('node:latest').inside{
@@ -37,10 +38,7 @@ node('billing-qa-ubuntu-16.04.4') {
3738
sh "git merge --no-ff --allow-unrelated-histories origin/master"
3839
sh "git diff --name-status"
3940
sh 'git commit -am "Merged master branch to testPackage" || exit 0'
40-
41-
withCredentials([usernamePassword(credentialsId: '9d6c4dfa-042c-4ed1-81c7-9175179dddda', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
42-
sh "git push https://WordsCloud:[email protected]/aspose-words-cloud/aspose-words-cloud-node testPackage"
43-
}
41+
sh "git push ${gitRepoUrl} testPackage"
4442
}
4543

4644
stage('add reference to new package'){
@@ -64,9 +62,7 @@ node('billing-qa-ubuntu-16.04.4') {
6462
sh "git ls-files --others --exclude-standard"
6563
sh "git add -A"
6664
sh 'git commit -am "new version of package added to repository" || exit 0'
67-
withCredentials([usernamePassword(credentialsId: '9d6c4dfa-042c-4ed1-81c7-9175179dddda', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
68-
sh "git push https://WordsCloud:[email protected]/aspose-words-cloud/aspose-words-cloud-node testPackage"
69-
}
65+
sh "git push ${gitRepoUrl} testPackage"
7066
}
7167

7268
} finally {
@@ -75,10 +71,9 @@ node('billing-qa-ubuntu-16.04.4') {
7571
}
7672

7773
stage('test package'){
78-
build job: 'words-sdk-nodejs',
74+
build job: 'words-node-sdk',
7975
parameters: [
80-
string(name: 'branch', value: 'testPackage'),
81-
string(name: 'testServerUrl', value: 'https://api.aspose.cloud')
76+
string(name: 'branch', value: 'testPackage')
8277
]
8378
}
8479

@@ -88,11 +83,18 @@ stage('wait for publish confirmation'){
8883
}
8984
}
9085

91-
node('billing-qa-ubuntu-16.04.4') {
86+
node('words-linux') {
9287
try {
9388
stage('checkout again'){
94-
checkout([$class: 'GitSCM', branches: [[name: '*/testPackage']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '9d6c4dfa-042c-4ed1-81c7-9175179dddda', url: 'https://github.com/aspose-words-cloud/aspose-words-cloud-node.git/']]])
89+
checkout([$class: 'GitSCM', branches: [[name: '*/testPackage']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-node.git']]])
9590

91+
sh "git config user.email \"[email protected]\""
92+
sh "git config user.name \"jenkins\""
93+
94+
withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', usernameVariable: 'gitUsername', passwordVariable: 'gitPass')]) {
95+
gitRepoUrl = "https://${gitUsername}:${gitPass}@git.auckland.dynabic.com/words-cloud/words-cloud-node.git"
96+
}
97+
9698
sh "git checkout testPackage"
9799
sh "git reset --hard origin/testPackage"
98100
}
@@ -108,8 +110,8 @@ node('billing-qa-ubuntu-16.04.4') {
108110
*/
109111
'HOME=.',
110112
]) {
111-
withCredentials([usernamePassword(credentialsId: '19f0eab9-c600-4746-a4bd-724efd2102c8', passwordVariable: 'npmPass', usernameVariable: 'npmLogin')]) {
112-
sh "echo //registry.npmjs.org/:_authToken=${npmPass} > .npmrc"
113+
withCredentials([string(credentialsId: '19f0eab9-c600-4746-a4bd-724efd2102c8', variable: 'npmToken')]) {
114+
sh "echo //registry.npmjs.org/:_authToken=${npmToken} > .npmrc"
113115
sh "npm publish ${packageName}"
114116
}
115117
}
@@ -134,20 +136,18 @@ node('billing-qa-ubuntu-16.04.4') {
134136

135137
sh "git diff --name-status"
136138
sh 'git commit -am "reference changed to published package" || exit 0'
137-
withCredentials([usernamePassword(credentialsId: '9d6c4dfa-042c-4ed1-81c7-9175179dddda', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
138-
sh "git push https://WordsCloud:[email protected]/aspose-words-cloud/aspose-words-cloud-node testPackage"
139-
}
139+
sh "git push ${gitRepoUrl} testPackage"
140+
}
141+
142+
stage('add version tag') {
143+
final fullVersion = packageName.substring(packageName.lastIndexOf('@') + 1, packageName.length())
144+
final version = fullVersion.substring(0, fullVersion.lastIndexOf('.'))
145+
146+
sh "git tag -a ${version} -m \"version ${version}\""
147+
sh "git push ${gitRepoUrl} ${version}"
140148
}
141149

142150
} finally {
143151
deleteDir()
144152
}
145-
}
146-
147-
stage('test published package'){
148-
build job: 'words-sdk-nodejs',
149-
parameters: [
150-
string(name: 'branch', value: 'testPackage'),
151-
string(name: 'testServerUrl', value: 'https://api.aspose.cloud')
152-
]
153-
}
153+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "asposewordscloud",
3-
"version": "19.2.0",
3+
"version": "19.9.0",
44
"description": "Aspose.Words Cloud SDK for Node.js",
55
"homepage": "https://products.aspose.cloud/words/cloud",
66
"author": {

test/documentElements/commentsTests.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe("comments", () => {
9090
});
9191
});
9292

93-
describe("putComment function", () => {
93+
describe("insertComment function", () => {
9494

9595
it("should return response with code 200", () => {
9696

@@ -108,7 +108,7 @@ describe("comments", () => {
108108
request.folder = remotePath;
109109

110110
const nodeLink = new NodeLink();
111-
nodeLink.nodeId = "0.0.3";
111+
nodeLink.nodeId = "0.3.0.3";
112112
const documentPosition = new DocumentPosition();
113113
documentPosition.node = nodeLink;
114114
documentPosition.offset = 0;
@@ -131,7 +131,7 @@ describe("comments", () => {
131131
});
132132
});
133133

134-
describe("postComment function", () => {
134+
describe("updateComment function", () => {
135135

136136
it("should return response with code 200", () => {
137137

@@ -150,7 +150,7 @@ describe("comments", () => {
150150

151151
request.commentIndex = 0;
152152
const nodeLink = new NodeLink();
153-
nodeLink.nodeId = "0.0.3";
153+
nodeLink.nodeId = "0.3.0";
154154
const documentPosition = new DocumentPosition();
155155
documentPosition.node = nodeLink;
156156
documentPosition.offset = 0;

test/documentElements/rangeTests.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ describe("range", () => {
4646
const request = new GetRangeTextRequest();
4747
request.name = remoteFileName;
4848
request.folder = remotePath;
49-
request.rangeStartIdentifier = "id0.0";
50-
request.rangeEndIdentifier = "id0.1";
49+
request.rangeStartIdentifier = "id0.0.0";
50+
request.rangeEndIdentifier = "id0.0.1";
5151

5252
// Act
5353
return wordsApi.getRangeText(request)
@@ -75,8 +75,8 @@ describe("range", () => {
7575
const request = new RemoveRangeRequest();
7676
request.name = remoteFileName;
7777
request.folder = remotePath;
78-
request.rangeStartIdentifier = "id0.0";
79-
request.rangeEndIdentifier = "id0.1";
78+
request.rangeStartIdentifier = "id0.0.0";
79+
request.rangeEndIdentifier = "id0.0.1";
8080

8181
// Act
8282
return wordsApi.removeRange(request)
@@ -103,8 +103,8 @@ describe("range", () => {
103103
const request = new ReplaceWithTextRequest();
104104
request.name = remoteFileName;
105105
request.folder = remotePath;
106-
request.rangeStartIdentifier = "id0.0";
107-
request.rangeEndIdentifier = "id0.1";
106+
request.rangeStartIdentifier = "id0.0.0";
107+
request.rangeEndIdentifier = "id0.0.1";
108108
request.rangeText = new ReplaceRange({text: "Replaced header"});
109109

110110
// Act
@@ -132,8 +132,8 @@ describe("range", () => {
132132
const request = new SaveAsRangeRequest();
133133
request.name = remoteFileName;
134134
request.folder = remotePath;
135-
request.rangeStartIdentifier = "id0.0";
136-
request.rangeEndIdentifier = "id0.1";
135+
request.rangeStartIdentifier = "id0.0.0";
136+
request.rangeEndIdentifier = "id0.0.1";
137137
request.documentParameters = new RangeDocument({documentName: remotePath + "/newDoc.docx"});
138138

139139
// Act

0 commit comments

Comments
 (0)