Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ crate-type = ["cdylib"]

[dependencies]
anyhow = "1.0.99"
atlas-local = { git = "https://github.com/mongodb/atlas-local-lib.git", rev = "0cc744d3af8b39c5db674d6d8d227c1f453536b5" }
atlas-local = { git = "https://github.com/mongodb/atlas-local-lib.git", rev = "532d5f3c52788cb14f746e7b10edb3ce33dad89e" }
bollard = "0.19.2"
napi = { version = "^3.3.0", features = ["async", "anyhow"] }
napi-derive = "^3.2.5"
Expand Down
5 changes: 1 addition & 4 deletions __test__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ test('smoke test', async (t) => {
let getDeployment = await client.getDeployment(createDeploymentOptions.name)
t.is(getDeployment.name,createDeploymentOptions.name)

let getConnectionStringOptions = {
containerIdOrName: createDeploymentOptions.name,
}
let connString = await client.getConnectionString(getConnectionStringOptions)
let connString = await client.getConnectionString(createDeploymentOptions.name)
t.assert(connString === `mongodb://127.0.0.1:${getDeployment.portBindings.port}/?directConnection=true`)

// Count deployments after creation
Expand Down
8 changes: 1 addition & 7 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export declare class Client {
listDeployments(): Promise<Array<Deployment>>
deleteDeployment(deploymentName: string): Promise<void>
getDeployment(deploymentName: string): Promise<Deployment>
getConnectionString(options: GetConnectionStringOptions): Promise<string>
getConnectionString(deploymentName: string): Promise<string>
getDeploymentId(clusterIdOrName: string): Promise<string>
}

Expand Down Expand Up @@ -68,12 +68,6 @@ export interface Deployment {
telemetryBaseUrl?: string
}

export interface GetConnectionStringOptions {
containerIdOrName: string
dbUsername?: string
dbPassword?: string
}

export interface MongoDbPortBinding {
type: BindingType
ip: string
Expand Down
8 changes: 2 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,10 @@ impl Client {
}

#[napi]
pub async fn get_connection_string(
&self,
options: crate::models::get_connection_string::GetConnectionStringOptions,
) -> Result<String> {
let options: atlas_local::models::GetConnectionStringOptions = options.into();
pub async fn get_connection_string(&self, deployment_name: String) -> Result<String> {
self
.client
.get_connection_string(options)
.get_connection_string(deployment_name)
.await
.context("get connection string")
}
Expand Down
49 changes: 0 additions & 49 deletions src/models/get_connection_string.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/models/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
pub mod create_deployment;
pub mod get_connection_string;
pub mod list_deployments;