@awsless/awsless 0.0.158 → 0.0.160

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/bin.js CHANGED
@@ -4453,6 +4453,17 @@ var Bucket = class extends Resource {
4453
4453
  ...this.attr("IndexDocument", this.props.website.indexDocument),
4454
4454
  ...this.attr("ErrorDocument", this.props.website.errorDocument)
4455
4455
  }
4456
+ } : {},
4457
+ ...this.props.cors ? {
4458
+ CorsConfiguration: {
4459
+ CorsRules: this.props.cors.map((rule) => ({
4460
+ ...this.attr("MaxAge", rule.maxAge),
4461
+ ...this.attr("AllowedHeaders", rule.headers),
4462
+ ...this.attr("AllowedMethods", rule.methods),
4463
+ ...this.attr("AllowedOrigins", rule.origins),
4464
+ ...this.attr("ExposedHeaders", rule.exposeHeaders)
4465
+ }))
4466
+ }
4456
4467
  } : {}
4457
4468
  };
4458
4469
  }
@@ -4902,7 +4913,7 @@ import { Body, PutObjectProps, BodyStream } from '@awsless/s3'
4902
4913
  type Store<Name extends string> = {
4903
4914
  readonly name: Name
4904
4915
  readonly put: (key: string, body: Body, options?: Pick<PutObjectProps, 'metadata' | 'storageClass'>) => Promise<void>
4905
- readonly get: (key: string) => Promise<BodyStream>
4916
+ readonly get: (key: string) => Promise<BodyStream | undefined>
4906
4917
  readonly delete: (key: string) => Promise<void>
4907
4918
  }
4908
4919
  `;
@@ -4927,7 +4938,17 @@ var storePlugin = definePlugin({
4927
4938
  for (const id of stackConfig.stores || []) {
4928
4939
  const bucket = new Bucket(id, {
4929
4940
  name: `store-${config2.app.name}-${stack.name}-${id}`,
4930
- accessControl: "private"
4941
+ accessControl: "private",
4942
+ cors: [
4943
+ // ---------------------------------------------
4944
+ // support for presigned post requests
4945
+ // ---------------------------------------------
4946
+ {
4947
+ origins: ["*"],
4948
+ methods: ["POST"]
4949
+ }
4950
+ // ---------------------------------------------
4951
+ ]
4931
4952
  });
4932
4953
  const custom = new CustomResource(id, {
4933
4954
  serviceToken: bootstrap2.import("feature-delete-bucket"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.158",
3
+ "version": "0.0.160",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -28,11 +28,11 @@
28
28
  }
29
29
  },
30
30
  "peerDependencies": {
31
- "@awsless/redis": "^0.0.10",
32
- "@awsless/sns": "^0.0.7",
33
31
  "@awsless/lambda": "^0.0.18",
34
- "@awsless/s3": "^0.0.8",
32
+ "@awsless/redis": "^0.0.10",
33
+ "@awsless/s3": "^0.0.10",
35
34
  "@awsless/ssm": "^0.0.7",
35
+ "@awsless/sns": "^0.0.7",
36
36
  "@awsless/sqs": "^0.0.7",
37
37
  "@awsless/validate": "^0.0.13",
38
38
  "@awsless/weak-cache": "^0.0.1"