feat(bindings/nodejs): add Operator.fromUri static factory#7471
Merged
TennyZhuang merged 1 commit intomainfrom May 2, 2026
Merged
feat(bindings/nodejs): add Operator.fromUri static factory#7471TennyZhuang merged 1 commit intomainfrom
TennyZhuang merged 1 commit intomainfrom
Conversation
Add a static fromUri(uri, options?) factory method to the Node.js Operator class, mirroring Rust Operator::from_uri and Python Operator.from_uri (PR #6993). The URI encodes scheme and configuration in a single string, e.g. memory://localhost/ s3://bucket/path?region=us-east-1 Optional extra key-value options can be passed to override or supplement values encoded in the URI. Intentional divergence: none. Direct 1:1 mapping of Rust Operator::from_uri((uri, options)) via IntoOperatorUri. Scope: bindings/nodejs only (lib.rs + generated.d.ts). AI-assisted: od-claude-lead-050121, reviewed by OpenDAL regression team.
suyanhanx
approved these changes
May 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes none directly — surface parity with Rust
Operator::from_uriand PythonOperator.from_uri(filed in #6993).Rationale
Add
Operator.fromUri(uri, options?)static factory to the Node.js binding. Mirrors the RustOperator::from_uri(impl IntoOperatorUri)API so Node consumers can spell their target as a single URI string instead of(scheme, options)pair, with optional extra options that override or supplement values encoded in the URI.Examples:
Implementation notes
Operator::from_uri. Whenoptionsis empty, the call passes the URI string alone (matching theIntoOperatorUri for Stringimpl); otherwise it passes the(uri, options)pair (matching theIntoOperatorUri for (&str, O: IntoIterator<Item=(K,V)>)impl) so URI-encoded values and supplied options are merged by core, not by the binding.Operator::newconstructor (buildsasync_opthen derives the matchingblocking_op).generated.d.tsregenerated bypnpm build. The newstatic fromUri(...)line sits immediately before the existingcapability()getter — no surrounding JSDoc was disturbed.Intentional divergence from Rust
None.
Tests
Smoke build only on this PR (no public test for the static factory itself in this revision):
cd bindings/nodejs && pnpm build— succeeds;generated.d.tsregenerates with the new entry.Operator.fromUri("memory://localhost/")typechecks; passing options narrows toRecord<string, string>correctly.The Rust core path already has
from_uritest coverage; this PR is a thin napi wrapper, so behavioral coverage at the binding layer is intentionally minimal.CI reminder
CI status will be tracked via a scheduled reminder anchored to this PR (10-minute follow-up).
AI usage statement
This patch was produced with AI assistance under the OpenDAL binding regression coordination effort:
@od-claude-lead-050121(Claude) as Lane B worker.@od-kimi-scout-050121(artifact author of the canonical v3 patch) and@od-codex-review-050121(Codex; APPROVED v3 with verified SHA-2560ba9ee30caa862840bae64e3a8b1d5a80b463f97a7209a6285dbeeae73e8e4be).TennyZhuangauth per the regression-effort hybrid publishing policy.