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 = "df190245295e6675949fb5c63a164fadc0007dab" }
atlas-local = { git = "https://github.com/mongodb/atlas-local-lib.git", rev = "f874fe90553e5158034aea0587669f0e8ac75127" }
bollard = "0.19.2"
napi = { version = "^3.3.0", features = ["async", "anyhow"] }
napi-derive = "^3.2.5"
Expand Down
5 changes: 5 additions & 0 deletions __test__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ test('smoke test', async (t) => {
let deployment = await client.createDeployment(createDeploymentOptions)
t.is(deployment.name, createDeploymentOptions.name)

// Get the deployment id twice, make sure it's the same
let deploymentId = await client.getDeploymentId(createDeploymentOptions.name)
let deploymentId2 = await client.getDeploymentId(createDeploymentOptions.name)
t.is(deploymentId, deploymentId2)

// Get deployment
let getDeployment = await client.getDeployment(createDeploymentOptions.name)
t.is(getDeployment.name,createDeploymentOptions.name)
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export declare class Client {
deleteDeployment(deploymentName: string): Promise<void>
getDeployment(deploymentName: string): Promise<Deployment>
getConnectionString(options: GetConnectionStringOptions): Promise<string>
getDeploymentId(clusterIdOrName: string): Promise<string>
}

export declare const enum BindingType {
Expand Down
100 changes: 50 additions & 50 deletions index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"@oxc-node/core": "^0.0.32",
"@taplo/cli": "^0.7.0",
"@tybys/wasm-util": "^0.10.0",
"@types/node": "^24.5.2",
"ava": "^6.4.1",
"chalk": "^5.4.1",
"husky": "^9.1.7",
Expand Down
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,13 @@ impl Client {
.await
.context("get connection string")
}

#[napi]
pub async fn get_deployment_id(&self, cluster_id_or_name: String) -> Result<String> {
self
.client
.get_deployment_id(&cluster_id_or_name)
.await
.context("get deployment id")
}
}
Loading