opendal icon indicating copy to clipboard operation
opendal copied to clipboard

feat(bindings/nodejs): Add WriteOptions support for new options API

Open kingsword09 opened this issue 6 months ago • 3 comments

Which issue does this PR close?

Related to https://github.com/apache/opendal/issues/6281.

Rationale for this change

This PR adds support for opendal::options::WriteOptions conversion in the nodejs bindings. This is part of the migration to the new options API outlined in RFC-6213 (https://github.com/apache/opendal/pull/6213).

What changes are included in this PR?

  • Added a complete mapping and conversion of opendal::options::WriteOptions
  • behavior tests mirroring Rust's async_write.rs test suite
  • Added the capabilities to support the options

Are there any user-facing changes?

Yes, users can now add options to their write requests

kingsword09 avatar Jun 21 '25 04:06 kingsword09

The following attributes do not appear to be implemented yet and are inconsistent with the test case results, which will cause the test to fail:

  • if_match (It's possible that I'm not using AWS's official S3 service but a third-party adapted S3 service, and this third-party service has this issue?)
  • ~~if_not_exists~~

kingsword09 avatar Jun 21 '25 12:06 kingsword09

The same error occurs in the Rust tests within the core:

image

kingsword09 avatar Jun 21 '25 15:06 kingsword09

  • It's possible that I'm not using AWS's official S3 service but a third-party adapted S3 service, and this third-party service has this issue?

Yep, not all s3 compatible services have the same feature.

Xuanwo avatar Jun 25 '25 09:06 Xuanwo

Thank you @kingsword09 for working on this, I think we can resolve the conflicts and get ready for merging.

Xuanwo avatar Jul 11 '25 07:07 Xuanwo

Thank you @kingsword09 for working on this, I think we can resolve the conflicts and get ready for merging.

Merged!

kingsword09 avatar Jul 11 '25 08:07 kingsword09