Skip to content

Commit 0568b58

Browse files
authored
Merge branch 'main' into fix_get_conn_string_db_username_passowrd
2 parents 6aa0241 + 998d8a8 commit 0568b58

File tree

8 files changed

+169
-156
lines changed

8 files changed

+169
-156
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
authors = ["APIx DevTools team"]
44
edition = "2021"
55
name = "atlas_local"
6-
version = "0.0.0-preview.3"
6+
version = "0.0.0-preview.5"
77

88
[lib]
99
crate-type = ["cdylib"]

__test__/index.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ test('smoke test', async (t) => {
3737
let deployment = await client.createDeployment(createDeploymentOptions)
3838
t.is(deployment.name, createDeploymentOptions.name)
3939

40+
// Get the deployment id twice, make sure it's the same
41+
let deploymentId = await client.getDeploymentId(createDeploymentOptions.name)
42+
let deploymentId2 = await client.getDeploymentId(createDeploymentOptions.name)
43+
t.is(deploymentId, deploymentId2)
44+
4045
// Get deployment
4146
let getDeployment = await client.getDeployment(createDeploymentOptions.name)
4247
t.is(getDeployment.name,createDeploymentOptions.name)

deny.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ targets = [
3838
# they are connected to another crate in the graph that hasn't been pruned,
3939
# so it should be used with care. The identifiers are [Package ID Specifications]
4040
# (https://doc.rust-lang.org/cargo/reference/pkgid-spec.html)
41-
exclude = ["mongodb"]
41+
exclude = []
4242
# If true, metadata will be collected with `--all-features`. Note that this can't
4343
# be toggled off if true, if you want to conditionally enable `--all-features` it
4444
# is recommended to pass `--all-features` on the cmd line instead

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export declare class Client {
77
deleteDeployment(deploymentName: string): Promise<void>
88
getDeployment(deploymentName: string): Promise<Deployment>
99
getConnectionString(options: GetConnectionStringOptions): Promise<string>
10+
getDeploymentId(clusterIdOrName: string): Promise<string>
1011
}
1112

1213
export declare const enum BindingType {

index.js

Lines changed: 50 additions & 50 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mongodb-js-preview/atlas-local",
3-
"version": "0.0.0-preview.3",
3+
"version": "0.0.0-preview.5",
44
"description": "A Node.js library for managing MongoDB Atlas Local deployments using Docker. This library provides a high-level JavaScript/TypeScript interface to interact with MongoDB Atlas Local deployments, making it easy to develop and test applications against a local MongoDB Atlas environment.",
55
"main": "index.js",
66
"repository": {
@@ -61,6 +61,7 @@
6161
"@oxc-node/core": "^0.0.32",
6262
"@taplo/cli": "^0.7.0",
6363
"@tybys/wasm-util": "^0.10.0",
64+
"@types/node": "^24.5.2",
6465
"ava": "^6.4.1",
6566
"chalk": "^5.4.1",
6667
"husky": "^9.1.7",

src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,13 @@ impl Client {
7878
.await
7979
.context("get connection string")
8080
}
81+
82+
#[napi]
83+
pub async fn get_deployment_id(&self, cluster_id_or_name: String) -> Result<String> {
84+
self
85+
.client
86+
.get_deployment_id(&cluster_id_or_name)
87+
.await
88+
.context("get deployment id")
89+
}
8190
}

0 commit comments

Comments
 (0)