@@ -15,8 +15,6 @@ module.exports = {
15
15
} ,
16
16
17
17
disconnect : function ( connectionInfo , logger , cb , app ) {
18
- const sshService = app . require ( '@hackolade/ssh-service' ) ;
19
- gremlinHelper . close ( sshService ) ;
20
18
cb ( ) ;
21
19
} ,
22
20
@@ -54,7 +52,6 @@ module.exports = {
54
52
} ,
55
53
56
54
getDbCollectionsNames : async function ( connectionInfo , logger , cb , app ) {
57
- const sshService = app . require ( '@hackolade/ssh-service' ) ;
58
55
try {
59
56
client = setUpDocumentClient ( connectionInfo ) ;
60
57
logger . log ( 'info' , connectionInfo , 'Reverse-Engineering connection settings' , connectionInfo . hiddenKeys ) ;
@@ -74,7 +71,7 @@ module.exports = {
74
71
) ;
75
72
const result = await collections . reduce ( async ( acc , collection ) => {
76
73
const res = await acc ;
77
- await gremlinHelper . connect ( { ...connectionInfo , collection : collection . id } , sshService ) ;
74
+ await gremlinHelper . connect ( { ...connectionInfo , collection : collection . id } ) ;
78
75
logger . log ( 'info' , '' , 'Connected to the Gremlin API' , connectionInfo . hiddenKeys ) ;
79
76
let collectionLabels ;
80
77
try {
@@ -85,7 +82,7 @@ module.exports = {
85
82
'Collection labels list' ,
86
83
connectionInfo . hiddenKeys ,
87
84
) ;
88
- gremlinHelper . close ( sshService ) ;
85
+ gremlinHelper . close ( ) ;
89
86
} catch ( err ) {
90
87
if ( err . message ?. includes ( 'NullReferenceException' ) ) {
91
88
logger . log (
@@ -94,7 +91,7 @@ module.exports = {
94
91
'Skipping document collection' ,
95
92
connectionInfo . hiddenKeys ,
96
93
) ;
97
- gremlinHelper . close ( sshService ) ;
94
+ gremlinHelper . close ( ) ;
98
95
return res ;
99
96
} else {
100
97
throw err ;
@@ -118,8 +115,6 @@ module.exports = {
118
115
} ,
119
116
120
117
getDbCollectionsData : async function ( data , logger , cb , app ) {
121
- const sshService = app . require ( '@hackolade/ssh-service' ) ;
122
-
123
118
try {
124
119
logger . clear ( ) ;
125
120
logger . log ( 'info' , data , 'connectionInfo' , data . hiddenKeys ) ;
@@ -171,7 +166,7 @@ module.exports = {
171
166
} ;
172
167
173
168
logger . log ( 'info' , { collection : collectionName } , 'Getting container nodes data' , data . hiddenKeys ) ;
174
- await gremlinHelper . connect ( { collection : collectionName } , sshService ) ;
169
+ await gremlinHelper . connect ( { collection : collectionName } ) ;
175
170
const nodesData = await getNodesData ( collectionName , labels , logger , {
176
171
recordSamplingSettings,
177
172
fieldInference,
@@ -202,7 +197,7 @@ module.exports = {
202
197
fieldInference ,
203
198
) ;
204
199
packages . relationships . push ( relationshipData ) ;
205
- gremlinHelper . close ( sshService ) ;
200
+ gremlinHelper . close ( ) ;
206
201
207
202
return packages ;
208
203
} ,
@@ -214,7 +209,7 @@ module.exports = {
214
209
215
210
cb ( null , packages . labels , modelInfo , [ ] . concat ( ...packages . relationships ) ) ;
216
211
} catch ( err ) {
217
- gremlinHelper . close ( sshService ) ;
212
+ gremlinHelper . close ( ) ;
218
213
logger . log ( 'error' , mapError ( err ) , 'Error' ) ;
219
214
cb ( mapError ( err ) ) ;
220
215
}
@@ -447,12 +442,12 @@ function createSchemaByPartitionKeyPath(path, documents = []) {
447
442
}
448
443
449
444
const setUpDocumentClient = connectionInfo => {
450
- const dbNameRegExp = / w s s : \/ \/ ( \S * ) .g r e m l i n \. c o s m o s \. / i;
445
+ const dbNameRegExp = / ( \S * ) .g r e m l i n \. c o s m o s \. a z u r e . c o m / i;
451
446
const dbName = dbNameRegExp . exec ( connectionInfo . gremlinEndpoint ) ;
452
447
if ( ! dbName ?. [ 1 ] ) {
453
- throw new Error ( 'Incorrect endpoint provided. Expected format: wss:// <account name>.gremlin.cosmos.' ) ;
448
+ throw new Error ( 'Incorrect endpoint provided. Expected format: <account name>.gremlin.cosmos.azurecom ' ) ;
454
449
}
455
- const endpoint = `https://${ dbName [ 1 ] } .documents.azure.com:443 /` ;
450
+ const endpoint = `https://${ dbName [ 1 ] } .documents.azure.com/` ;
456
451
const key = connectionInfo . accountKey ;
457
452
458
453
return new CosmosClient ( { endpoint, key } ) ;
0 commit comments