Skip to content

Commit a6179cf

Browse files
committed
added option checkIfBucketExists to the addFile, addFileFromPath, addFileFromBuffer and addFileFromStream
1 parent 12e7c2a commit a6179cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2597
-2489
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ Fails if the bucket already exists. This is done because bucket names must be gl
705705
> origPath: "path/to/your/file.ext",
706706
> targetPath: "new-name.ext",
707707
> options: {
708-
> ACL: "public-read"
708+
> ACL: "public-read",
709709
> }
710710
>});
711711
>```
@@ -800,6 +800,7 @@ export type FilePathParams = {
800800
targetPath: string;
801801
options?: {
802802
[id: string]: any;
803+
checkIfBucketExists: boolean;
803804
ACL?: string; // for Cubbit S3
804805
};
805806
};
@@ -816,6 +817,8 @@ export interface ResultObject {
816817

817818
Copies a file from a local path `origPath` to the provided path `targetPath` in the storage. The value for `targetPath` needs to include at least a file name. You can provide extra storage-specific settings such as access rights using the `options` object.
818819

820+
By setting `checkIfBucketExists` to `false` you can skip the bucket check. This is useful when you have limited the access rights to the bucket.
821+
819822
The key `bucketName` is optional; if you don't pass a value the selected bucket will be used. The selected bucket is the bucket that you've passed with the config upon instantiation or that you've set afterwards using `setSelectedBucket`. If no bucket is selected the value of the `error` key in the result object will hold `"no bucket selected"`.
820823

821824
If the call is successful `value` will hold the string "ok".
@@ -840,6 +843,7 @@ export type FileBufferParams = {
840843
targetPath: string;
841844
options?: {
842845
[id: string]: any;
846+
checkIfBucketExists: boolean;
843847
ACL?: string; // for Cubbit S3
844848
};
845849
};
@@ -856,6 +860,8 @@ export interface ResultObject {
856860

857861
Copies a buffer to a file in the storage. The value for `targetPath` needs to include at least a file name. You can provide extra storage-specific settings such as access rights using the `options` object.
858862

863+
By setting `checkIfBucketExists` to `false` you can skip the bucket check. This is useful when you have limited the access rights to the bucket.
864+
859865
The key `bucketName` is optional; if you don't pass a value the selected bucket will be used. The selected bucket is the bucket that you've passed with the config upon instantiation or that you've set afterwards using `setSelectedBucket`. If no bucket is selected the value of the `error` key in the result object will hold `"no bucket selected"`.
860866

861867
If the call is successful `value` will hold the string "ok".
@@ -882,6 +888,7 @@ export type FileStreamParams = {
882888
targetPath: string;
883889
options?: {
884890
[id: string]: any;
891+
checkIfBucketExists: boolean;
885892
ACL?: string // for Cubbit S3
886893
};
887894
};
@@ -898,6 +905,8 @@ export interface ResultObject {
898905

899906
Allows you to stream a file directly to the storage. The value for `targetPath` needs to include at least a file name. You can provide extra storage-specific settings such as access rights using the `options` object.
900907

908+
By setting `checkIfBucketExists` to `false` you can skip the bucket check. This is useful when you have limited the access rights to the bucket.
909+
901910
The key `bucketName` is optional; if you don't pass a value the selected bucket will be used. The selected bucket is the bucket that you've passed with the config upon instantiation or that you've set afterwards using `setSelectedBucket`. If no bucket is selected the value of the `error` key in the result object will set to `"no bucket selected"`.
902911

903912
If the call is successful `value` will hold the string "ok".

build/src/AbstractAdapter.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/src/AbstractAdapter.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/src/AdapterAmazonS3.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/src/AdapterAmazonS3.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

publish/AdapterAmazonS3/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 3.0.2
2+
- added option `checkIfBucketExists` to the `addFile`, `addFileFromPath`, `addFileFromBuffer` and `addFileFromStream`
3+
- update @aws-sdk to 3.917.0
4+
15
# 3.0.0
26
- version bump to match the version of Storage and the API
37
- removed support for versioning (wasn't implemented consistently anyway)

0 commit comments

Comments
 (0)