This is an automated email from the ASF dual-hosted git repository.

suyanhanx pushed a commit to branch binding-nodejs-capability
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git


The following commit(s) were added to refs/heads/binding-nodejs-capability by 
this push:
     new f3d43656f fix u32 as size
f3d43656f is described below

commit f3d43656f25982cea6f9c63f9a40891fdf2ed8a2
Author: suyanhanx <[email protected]>
AuthorDate: Thu Nov 23 17:52:26 2023 +0800

    fix u32 as size
    
    Signed-off-by: suyanhanx <[email protected]>
---
 bindings/nodejs/index.d.ts        | 10 +++++-----
 bindings/nodejs/src/capability.rs | 22 ++++++++++++----------
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/bindings/nodejs/index.d.ts b/bindings/nodejs/index.d.ts
index 5e995e94a..0ef6a3e94 100644
--- a/bindings/nodejs/index.d.ts
+++ b/bindings/nodejs/index.d.ts
@@ -92,25 +92,25 @@ export class Capability {
    *
    * For example, AWS S3 supports 5GiB as max in write_multi.
    */
-  get writeMultiMaxSize(): number | null
+  get writeMultiMaxSize(): bigint | null
   /**
    * write_multi_min_size is the min size that services support in write_multi.
    *
    * For example, AWS S3 requires at least 5MiB in write_multi expect the last 
one.
    */
-  get writeMultiMinSize(): number | null
+  get writeMultiMinSize(): bigint | null
   /**
    * write_multi_align_size is the align size that services required in 
write_multi.
    *
    * For example, Google GCS requires align size to 256KiB in write_multi.
    */
-  get writeMultiAlignSize(): number | null
+  get writeMultiAlignSize(): bigint | null
   /**
    * write_total_max_size is the max size that services support in write_total.
    *
    * For example, Cloudflare D1 supports 1MB as max in write_total.
    */
-  get writeTotalMaxSize(): number | null
+  get writeTotalMaxSize(): bigint | null
   /** If operator supports create dir. */
   get createDir(): boolean
   /** If operator supports delete. */
@@ -142,7 +142,7 @@ export class Capability {
   /** If operator supports batch delete. */
   get batchDelete(): boolean
   /** The max operations that operator supports in batch. */
-  get batchMaxOperations(): number | null
+  get batchMaxOperations(): bigint | null
   /** If operator supports blocking. */
   get blocking(): boolean
 }
diff --git a/bindings/nodejs/src/capability.rs 
b/bindings/nodejs/src/capability.rs
index 98553b128..e1ea3906e 100644
--- a/bindings/nodejs/src/capability.rs
+++ b/bindings/nodejs/src/capability.rs
@@ -15,6 +15,8 @@
 // specific language governing permissions and limitations
 // under the License.
 
+
+
 /// Capability is used to describe what operations are supported
 /// by current Operator.
 ///
@@ -154,32 +156,32 @@ impl Capability {
     ///
     /// For example, AWS S3 supports 5GiB as max in write_multi.
     #[napi(getter)]
-    pub fn write_multi_max_size(&self) -> Option<u32> {
-        self.0.write_multi_max_size.map(|v| v as u32)
+    pub fn write_multi_max_size(&self) -> Option<usize> {
+        self.0.write_multi_max_size
     }
 
     /// write_multi_min_size is the min size that services support in 
write_multi.
     ///
     /// For example, AWS S3 requires at least 5MiB in write_multi expect the 
last one.
     #[napi(getter)]
-    pub fn write_multi_min_size(&self) -> Option<u32> {
-        self.0.write_multi_min_size.map(|v| v as u32)
+    pub fn write_multi_min_size(&self) -> Option<usize> {
+        self.0.write_multi_min_size
     }
 
     /// write_multi_align_size is the align size that services required in 
write_multi.
     ///
     /// For example, Google GCS requires align size to 256KiB in write_multi.
     #[napi(getter)]
-    pub fn write_multi_align_size(&self) -> Option<u32> {
-        self.0.write_multi_align_size.map(|v| v as u32)
+    pub fn write_multi_align_size(&self) -> Option<usize> {
+        self.0.write_multi_align_size
     }
 
     /// write_total_max_size is the max size that services support in 
write_total.
     ///
     /// For example, Cloudflare D1 supports 1MB as max in write_total.
     #[napi(getter)]
-    pub fn write_total_max_size(&self) -> Option<u32> {
-        self.0.write_total_max_size.map(|v| v as u32)
+    pub fn write_total_max_size(&self) -> Option<usize> {
+        self.0.write_total_max_size
     }
 
     /// If operator supports create dir.
@@ -274,8 +276,8 @@ impl Capability {
 
     /// The max operations that operator supports in batch.
     #[napi(getter)]
-    pub fn batch_max_operations(&self) -> Option<u32> {
-        self.0.batch_max_operations.map(|v| v as u32)
+    pub fn batch_max_operations(&self) -> Option<usize> {
+        self.0.batch_max_operations
     }
 
     /// If operator supports blocking.

Reply via email to