minio / minio-js

MinIO Client SDK for Javascript
https://docs.min.io/docs/javascript-client-quickstart-guide.html
Apache License 2.0
962 stars 282 forks source link

`LifecycleRule` is incorrectly typed #1357

Open Aloso opened 1 week ago

Aloso commented 1 week ago

I had the following (working) code using minio@^7:

client.setBucketLifecycle(bucket, {
    Rule: [
        {
            ID: 'BucketPathExpireRule',
            Status: 'Enabled',
            Filter: {
                Prefix: 'combined-documents',
            },
            Expiration: {
                Days: 1,
            },
        },
    ],
});

When upgrading to minio@^8, I noticed a type error: The LifecycleRule type has no property Filter, instead, it has a RuleFilter property. However, after renaming it, the code stopped working:

S3Error: The XML you provided was not well-formed or did not validate against our published schema

prakashsvmx commented 1 week ago

thank you for reporting:

Yes. the key need renaming in the repo.