@yopdev/dev-server 1.3.7 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/s3.d.ts +2 -2
- package/dist/src/s3.js +6 -1
- package/package.json +1 -1
package/dist/src/s3.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S3Client } from '@aws-sdk/client-s3';
|
|
1
|
+
import { CORSConfiguration, S3Client } from '@aws-sdk/client-s3';
|
|
2
2
|
import { AwsConfig } from './config';
|
|
3
3
|
export declare class S3 {
|
|
4
4
|
readonly client: S3Client;
|
|
5
5
|
constructor(aws: AwsConfig);
|
|
6
|
-
createBucket: (name: string) => Promise<import("@aws-sdk/client-s3").
|
|
6
|
+
createBucket: (name: string, cors?: CORSConfiguration) => Promise<import("@aws-sdk/client-s3").PutBucketCorsCommandOutput>;
|
|
7
7
|
}
|
package/dist/src/s3.js
CHANGED
|
@@ -54,11 +54,16 @@ var LOGGER = logging_1.LoggerFactory.create('S3');
|
|
|
54
54
|
var S3 = /** @class */ (function () {
|
|
55
55
|
function S3(aws) {
|
|
56
56
|
var _this = this;
|
|
57
|
-
this.createBucket = function (name) { return __awaiter(_this, void 0, void 0, function () {
|
|
57
|
+
this.createBucket = function (name, cors) { return __awaiter(_this, void 0, void 0, function () {
|
|
58
|
+
var _this = this;
|
|
58
59
|
return __generator(this, function (_a) {
|
|
59
60
|
return [2 /*return*/, this.client.send(new client_s3_1.CreateBucketCommand({
|
|
60
61
|
Bucket: name,
|
|
61
62
|
}))
|
|
63
|
+
.then(function () { return cors && _this.client.send(new client_s3_1.PutBucketCorsCommand({
|
|
64
|
+
Bucket: name,
|
|
65
|
+
CORSConfiguration: cors
|
|
66
|
+
})); })
|
|
62
67
|
.tap(function () { return LOGGER.debug('bucket %s created', name); })];
|
|
63
68
|
});
|
|
64
69
|
}); };
|