chitralverma opened a new pull request, #9414:
URL: https://github.com/apache/opendal/pull/9414

   # Which issue does this PR close?
   
   Part of #9322 (tracker: #9320).
   
   # Rationale for this change
   
   Node.js does not expose the core `ListOptions::glob` field. No Node.js 
caller is known. This PR gives parity with Java (#9234) and .NET (since #7629), 
as #9320 plans.
   
   # What changes are included in this PR?
   
   - `ListOptions` gets the optional member `glob?: string`. The generated 
conversion passes it to core.
   - The `glob` JSDoc comes from core in Node.js names: `Self::recursive` reads 
`recursive`, and `ConfigInvalid` reads "an error whose message includes 
`ConfigInvalid`".
   - The Rust-only `SimulateLayer` and `auto-simulate` text reads "otherwise 
OpenDAL evaluates patterns client-side". The Node.js binding builds core with 
default features, so simulation is always on.
   - Tests: the surface test adds `glob?: string` to the exact member set. The 
sync and async list suites check that `glob: '*.txt'` returns only the matching 
file.
   
   # Are there any user-facing changes?
   
   - `list`, `listSync`, `lister`, and `listerSync` accept `glob`.
   - Type check only: mapped types such as `Required<ListOptions>` or 
`Record<keyof ListOptions, X>` get a `glob` member. Code that fills them fully 
must add `glob`. Object literals and `implements ListOptions` classes compile 
without change.
   - Behavior: napi ignores unknown members, so before this PR a `glob` value 
had no effect. Now `glob` filters the result, and an empty or malformed pattern 
fails with `ConfigInvalid`.
   
   Verified: `generated.d.ts` vs `main` only adds `glob?: string` and its 
JSDoc. TypeScript probes (literal, `implements`, `Partial`, `keyof` array) 
compile against both versions, and `Required` and `Record` fail as stated. Each 
`glob` doc claim holds on `memory` (simulated) and `fs` (native) through all 
four list methods. Each new test and guard fails under a mutation. All 
`ci_odev` generators, fmt and `git diff --exit-code`; dev and Node.js tests and 
clippy; typedoc.
   
   Not verified: the simulated `glob` failure without `listWithRecursive` 
(Node.js cannot reach it, because default simulation always supplies 
recursion); services other than `memory` and `fs`; Linux.
   
   # Breaking changes
   
   None
   
   # AI Usage Statement
   
   - **Harness:** Claude Code via T3 Code | **Model:** Claude Opus 5.5 | 
**Effort:** to confirm
   - **Role:** Implemented the generator change and tests, verified the docs on 
a real build, drafted this text. No Node.js caller is known, so the change 
rests on parity. The author reviews every change and claim.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to