New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

minio

Package Overview
Dependencies
Maintainers
4
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minio - npm Package Compare versions

Comparing version 4.0.0 to 5.0.0

2

dist/main/signing.js

@@ -274,3 +274,3 @@ /*

if (expires > 604800) {
throw new errors.ExpiresParamError('expires param cannot be alrger than 7 days');
throw new errors.ExpiresParamError('expires param cannot be greater than 7 days');
}

@@ -277,0 +277,0 @@

@@ -36,3 +36,2 @@ /*

exports.getNotificationTransformer = getNotificationTransformer;
exports.getBucketPolicyTransformer = getBucketPolicyTransformer;

@@ -267,10 +266,2 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

}
// Parses GET BucketPolicy response.
function getBucketPolicyTransformer() {
return getConcater(function (response) {
return JSON.parse(response);
});
}
//# sourceMappingURL=transformers.js.map

@@ -108,13 +108,3 @@ # JavaScript Client API Reference [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io)

|`bucketName` | _string_ | Name of the bucket. |
| `region` | _string_ | Default value is us-east-1 Region where the bucket is created. Valid values are listed below: |
| | |us-east-1 |
| | |us-west-1 |
| | |us-west-2 |
| | |eu-west-1 |
| | |eu-central-1|
| | |ap-southeast-1|
| | |ap-northeast-1|
| | |ap-southeast-2|
| | |sa-east-1|
| | |cn-north-1|
| `region` | _string_ | Region where the bucket is created. This parameter is optional. Default value is us-east-1. |
|`callback(err)` |_function_ | Callback function with `err` as the error argument. `err` is null if the bucket is successfully created. If no callback is passed, a `Promise` is returned. |

@@ -166,3 +156,3 @@

<a name="bucketExists"></a>
#### bucketExists(bucketName[, callback])
#### bucketExists(bucketName, callback)

@@ -178,3 +168,3 @@ Checks if a bucket exists.

| `bucketName` | _string_ | Name of the bucket. |
| `callback(err)` | _function_ | `err` is `null` if the bucket exists. `err.code` is `NoSuchBucket` in case the bucket does not exist. If no callback is passed, a `Promise` is returned. |
| `callback(err, exists)` | _function_ | `exists` is a boolean which indicates whether `bucketName` exists or not. `err` is set when an error occurs during the operation. |

@@ -185,9 +175,9 @@ __Example__

```js
minioClient.bucketExists('mybucket', function(err) {
minioClient.bucketExists('mybucket', function(err, exists) {
if (err) {
if (err.code == 'NoSuchBucket') return console.log("bucket does not exist.")
return console.log(err)
return console.log(err)
}
// if err is null it indicates that the bucket exists.
console.log('Bucket exists.')
if (exists) {
return console.log('Bucket exists.')
}
})

@@ -589,3 +579,3 @@ ```

| `stat.contentType` | _string_ | Content-Type of the object.|
| `stat.lastModified` | _string_ | Last Modified time stamp.|
| `stat.lastModified` | _Date_ | Last Modified time stamp.|

@@ -886,14 +876,14 @@

// Create a new notification object
var bucketNotification = new Notify.BucketNotification();
var bucketNotification = new Minio.NotificationConfig();
// Setup a new topic configuration
var arn = Notify.newARN('aws', 'sns', 'us-west-2', '408065449417', 'TestTopic')
var topic = new Notify.TopicConfig(arn)
var arn = Minio.buildARN('aws', 'sns', 'us-west-2', '408065449417', 'TestTopic')
var topic = new Minio.TopicConfig(arn)
topic.addFilterSuffix('.jpg')
topic.addFilterPrefix('myphotos/')
topic.addEvent(Notify.ObjectReducedRedundancyLostObject)
topic.addEvent(Notify.ObjectCreatedAll)
topic.addEvent(Minio.ObjectReducedRedundancyLostObject)
topic.addEvent(Minio.ObjectCreatedAll)
// Add the topic to the overall notification object
bucketNotification.addTopicConfiguration(topic)
bucketNotification.add(topic)

@@ -962,3 +952,3 @@ minioClient.setBucketNotification('mybucket', bucketNotification, function(err) {

<a name="getBucketPolicy"></a>
### getBucketPolicy(bucketName, objectPrefix[, callback])
### getBucketPolicy(bucketName [, callback])

@@ -975,13 +965,11 @@ Get the bucket policy associated with the specified bucket. If `objectPrefix`

| `bucketName` | _string_ | Name of the bucket |
| `objectPrefix` | _string_ | Prefix of objects in the bucket with which to filter permissions off of. Use `''` for entire bucket. |
| `callback(err, policy)` | _function_ | Callback function is called with non `null` err value in case of error. `policy` will be the string representation of the bucket policy (`minio.Policy.NONE`, `minio.Policy.READONLY`, `minio.Policy.WRITEONLY`, or `minio.Policy.READWRITE`). If no callback is passed, a `Promise` is returned. |
| `callback(err, policy)` | _function_ | Callback function is called with non `null` err value in case of error. `policy` is the [bucket policy](https://github.com/minio/minio/blob/master/docs/bucket/policy/README.md). If no callback is passed, a `Promise` is returned. |
```js
// Retrieve bucket policy of 'my-bucketname' that applies to all objects that
// start with 'img-'.
minioClient.getBucketPolicy('my-bucketname', 'img-', function(err, policy) {
// Retrieve bucket policy of 'my-bucketname'
minioClient.getBucketPolicy('my-bucketname', function(err, policy) {
if (err) throw err
console.log(`Bucket policy: ${policy}`)
console.log(`Bucket policy file: ${policy}`)
})

@@ -991,7 +979,5 @@ ```

<a name="setBucketPolicy"></a>
### setBucketPolicy(bucketName, objectPrefix, bucketPolicy[, callback])
### setBucketPolicy(bucketName, bucketPolicy[, callback])
Set the bucket policy associated with the specified bucket. If `objectPrefix`
is not empty, the bucket policy will only be assigned to objects that fit the
given prefix.
Set the bucket policy on the specified bucket. [bucketPolicy](https://github.com/minio/minio/blob/master/docs/bucket/policy/README.md) is detailed here.

@@ -1003,5 +989,4 @@ __Parameters__

|---|---|---|
| `bucketName` | _string_ | Name of the bucket |
| `objectPrefix` | _string_ | Prefix of objects in the bucket to modify permissions of. Use `''` for entire bucket. |
| `bucketPolicy` | _string_ | The bucket policy. This can be: `minio.Policy.NONE`, `minio.Policy.READONLY`, `minio.Policy.WRITEONLY`, or `minio.Policy.READWRITE`. |
| `bucketName` | _string_ | Name of the bucket. |
| `bucketPolicy` | _string_ | bucket policy. |
| `callback(err)` | _function_ | Callback function is called with non `null` err value in case of error. If no callback is passed, a `Promise` is returned. |

@@ -1011,8 +996,7 @@

```js
// Set the bucket policy of `my-bucketname` to `readonly` (only allow retrieval),
// but only for objects that start with 'img-'.
minioClient.setBucketPolicy('my-bucketname', 'img-', minio.Policy.READONLY, function(err) {
// Set the bucket policy of `my-bucketname`
minioClient.setBucketPolicy('my-bucketname', JSON.stringify(policy), function(err) {
if (err) throw err
console.log('Set bucket policy to \'readonly\'.')
console.log('Bucket policy set')
})

@@ -1019,0 +1003,0 @@ ```

@@ -241,3 +241,4 @@ # JavaScript Client API参考文档 [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io)

| ---- | ---- | ---- |
| `obj.key` | _string_ | 对象名称。 |
| `obj.name` | _string_ | 对象名称。 |
| `obj.prefix` | _string_ | 对象名称的前缀。 |
| `obj.size` | _number_ | 对象的大小。 |

@@ -281,3 +282,4 @@ | `obj.etag` | _string_ |对象的etag值。 |

| ---- | ---- | ---- |
| `obj.key` | _string_ | 对象名称。 |
| `obj.name` | _string_ | 对象名称。 |
| `obj.prefix` | _string_ | 对象名称的前缀。 |
| `obj.size` | _number_ | 对象的大小。 |

@@ -284,0 +286,0 @@ | `obj.etag` | _string_ |对象的etag值。 |

@@ -29,7 +29,9 @@ /*

s3Client.bucketExists('my-bucketname', function(e) {
if (e) {
return console.log(e)
s3Client.bucketExists('my-bucketname', function(err, exists) {
if (err) {
return console.log(err)
}
console.log("True")
if (exists) {
console.log("Bucket exists.")
}
})

@@ -29,5 +29,3 @@ /*

// Retrieves the bucket policy and logs it to the console.
// The second argument is the prefix for objects, leave empty if you don't
// want to filter based on object-specific permissions.
s3Client.getBucketPolicy('my-bucketname', '', (err, policy) => {
s3Client.getBucketPolicy('testbucket', (err, policy) => {
if (err) throw err

@@ -34,0 +32,0 @@

@@ -28,11 +28,46 @@ /*

// Sets the bucket policy to 'readonly'. This means that objects can only be
// retrieved rather than created, modified, or destroyed in this bucket.
// Bucket policy - GET requests on "testbucket" bucket will not need authentication.
var policy = `
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:GetBucketLocation",
"s3:ListBucket"
],
"Effect": "Allow",
"Principal": {
"AWS": [
"*"
]
},
"Resource": [
"arn:aws:s3:::testbucket"
],
"Sid": ""
},
{
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Principal": {
"AWS": [
"*"
]
},
"Resource": [
"arn:aws:s3:::testbucket/*"
],
"Sid": ""
}
]
}
`
// The second parameter is for filtering based on objects — you can leave this
// empty if you'd like the permissions to apply to the entire bucket.
s3Client.setBucketPolicy('my-bucketname', '', Minio.Policy.READONLY, (err) => {
s3Client.setBucketPolicy('testbucket', policy, (err) => {
if (err) throw err
console.log('Set bucket policy to \'readonly\'.')
console.log('Set bucket policy')
})
{
"name": "minio",
"version": "4.0.0",
"version": "5.0.0",
"description": "S3 Compatible Cloud Storage client",

@@ -5,0 +5,0 @@ "main": "./dist/main/minio.js",

@@ -27,2 +27,8 @@ # Minio JavaScript Library for Amazon S3 Compatible Cloud Storage [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io)

## Using with TypeScript
```sh
npm install --save-dev @types/minio
```
## Initialize Minio Client

@@ -29,0 +35,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc