@kensio/yulin 1.10.2 → 1.10.4
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/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-config.d.ts +8 -17
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-config.d.ts.map +1 -1
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-config.js +24 -102
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-config.js.map +1 -1
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-cors-config.d.ts +13 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-cors-config.d.ts.map +1 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-cors-config.js +76 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-cors-config.js.map +1 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-custom-headers.d.ts +17 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-custom-headers.d.ts.map +1 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-custom-headers.js +45 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-custom-headers.js.map +1 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-field-reader.d.ts +37 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-field-reader.d.ts.map +1 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-field-reader.js +75 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-field-reader.js.map +1 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-headers.d.ts +11 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-headers.d.ts.map +1 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-headers.js +30 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-headers.js.map +1 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-values.d.ts +19 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-values.d.ts.map +1 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-values.js +72 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-values.js.map +1 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-server-timing.d.ts +13 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-server-timing.d.ts.map +1 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-server-timing.js +24 -0
- package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-server-timing.js.map +1 -0
- package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts +2 -0
- package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts.map +1 -1
- package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.js.map +1 -1
- package/dist/service/cloudfront/command/update-distribution/update-distribution.handler.d.ts +2 -0
- package/dist/service/cloudfront/command/update-distribution/update-distribution.handler.d.ts.map +1 -1
- package/dist/service/cloudfront/command/update-distribution/update-distribution.handler.js.map +1 -1
- package/dist/service/cloudfront/controller/response-headers/sim-cf-response-headers-applicator.d.ts +1 -1
- package/dist/service/cloudfront/controller/response-headers/sim-cf-response-headers-applicator.d.ts.map +1 -1
- package/dist/service/cloudfront/controller/response-headers/sim-cf-response-headers-applicator.js +2 -2
- package/dist/service/cloudfront/controller/response-headers/sim-cf-response-headers-applicator.js.map +1 -1
- package/dist/service/cloudfront/controller/sim-cloudfront-controller.d.ts +1 -0
- package/dist/service/cloudfront/controller/sim-cloudfront-controller.d.ts.map +1 -1
- package/dist/service/cloudfront/controller/sim-cloudfront-controller.js +8 -1
- package/dist/service/cloudfront/controller/sim-cloudfront-controller.js.map +1 -1
- package/dist/service/cloudfront/controller/sim-cloudfront-error-response.d.ts +22 -0
- package/dist/service/cloudfront/controller/sim-cloudfront-error-response.d.ts.map +1 -0
- package/dist/service/cloudfront/controller/sim-cloudfront-error-response.js +31 -0
- package/dist/service/cloudfront/controller/sim-cloudfront-error-response.js.map +1 -0
- package/dist/service/cloudfront/controller/sim-cloudfront-request-pipeline.d.ts.map +1 -1
- package/dist/service/cloudfront/controller/sim-cloudfront-request-pipeline.js +1 -1
- package/dist/service/cloudfront/controller/sim-cloudfront-request-pipeline.js.map +1 -1
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.d.ts +9 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.d.ts.map +1 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.js +34 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.js.map +1 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.d.ts +29 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.d.ts.map +1 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.js +51 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.js.map +1 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.d.ts +2 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.d.ts.map +1 -1
- package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.js +3 -1
- package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.js.map +1 -1
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.d.ts +3 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.d.ts.map +1 -1
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.js +7 -32
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.js.map +1 -1
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.d.ts +14 -1
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.d.ts.map +1 -1
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.js +16 -1
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.js.map +1 -1
- package/dist/service/cloudfront/distribution/sim-cf-distribution-reconfigurer.d.ts +7 -3
- package/dist/service/cloudfront/distribution/sim-cf-distribution-reconfigurer.d.ts.map +1 -1
- package/dist/service/cloudfront/distribution/sim-cf-distribution-reconfigurer.js +6 -3
- package/dist/service/cloudfront/distribution/sim-cf-distribution-reconfigurer.js.map +1 -1
- package/dist/service/cloudfront/error/sim-cloudfront.error.d.ts +11 -0
- package/dist/service/cloudfront/error/sim-cloudfront.error.d.ts.map +1 -1
- package/dist/service/cloudfront/error/sim-cloudfront.error.js +13 -0
- package/dist/service/cloudfront/error/sim-cloudfront.error.js.map +1 -1
- package/dist/service/cloudfront/origin/s3/sim-cf-s3-origin-responses.d.ts.map +1 -1
- package/dist/service/cloudfront/origin/s3/sim-cf-s3-origin-responses.js +7 -1
- package/dist/service/cloudfront/origin/s3/sim-cf-s3-origin-responses.js.map +1 -1
- package/dist/service/cloudfront/response-headers-policy/sim-cf-cors-origin-pattern.d.ts +27 -0
- package/dist/service/cloudfront/response-headers-policy/sim-cf-cors-origin-pattern.d.ts.map +1 -0
- package/dist/service/cloudfront/response-headers-policy/sim-cf-cors-origin-pattern.js +70 -0
- package/dist/service/cloudfront/response-headers-policy/sim-cf-cors-origin-pattern.js.map +1 -0
- package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy-cors.d.ts +44 -0
- package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy-cors.d.ts.map +1 -0
- package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy-cors.js +111 -0
- package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy-cors.js.map +1 -0
- package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy.d.ts +10 -2
- package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy.d.ts.map +1 -1
- package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy.js +14 -2
- package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy.js.map +1 -1
- package/dist/service/cloudfront/sim-cloudfront-commands.d.ts +3 -0
- package/dist/service/cloudfront/sim-cloudfront-commands.d.ts.map +1 -1
- package/dist/service/cloudfront/sim-cloudfront-commands.js +3 -0
- package/dist/service/cloudfront/sim-cloudfront-commands.js.map +1 -1
- package/dist/service/cloudfront/sim-cloudfront.d.ts.map +1 -1
- package/dist/service/cloudfront/sim-cloudfront.js +1 -0
- package/dist/service/cloudfront/sim-cloudfront.js.map +1 -1
- package/dist/service/rekognition/label/sim-rekognition-label-declaration.d.ts +1 -1
- package/dist/service/rekognition/moderation/sim-rekognition-moderation-taxonomy.d.ts +2 -2
- package/dist/service/rekognition/moderation/sim-rekognition-moderation-taxonomy.js +3 -3
- package/dist/service/rekognition/moderation/sim-rekognition-moderation-taxonomy.js.map +1 -1
- package/dist/service/rekognition/sim-rekognition.d.ts +4 -4
- package/dist/service/rekognition/sim-rekognition.js +4 -4
- package/dist/service/s3/bucket/sim-s3-bucket-access.d.ts +16 -0
- package/dist/service/s3/bucket/sim-s3-bucket-access.d.ts.map +1 -1
- package/dist/service/s3/bucket/sim-s3-bucket-access.js +22 -1
- package/dist/service/s3/bucket/sim-s3-bucket-access.js.map +1 -1
- package/dist/service/s3/command/get-object/get-object-loader.d.ts +2 -1
- package/dist/service/s3/command/get-object/get-object-loader.d.ts.map +1 -1
- package/dist/service/s3/command/get-object/get-object-loader.js +5 -1
- package/dist/service/s3/command/get-object/get-object-loader.js.map +1 -1
- package/dist/service/s3/command/get-object/get-object.command.d.ts +5 -0
- package/dist/service/s3/command/get-object/get-object.command.d.ts.map +1 -1
- package/dist/service/s3/command/list-objects/list-objects-page-builder.d.ts +3 -3
- package/dist/service/s3/command/list-objects/list-objects-page-builder.d.ts.map +1 -1
- package/dist/service/s3/command/list-objects/list-objects-page-builder.js +13 -17
- package/dist/service/s3/command/list-objects/list-objects-page-builder.js.map +1 -1
- package/dist/service/s3/command/list-objects/list-objects.command.d.ts +3 -8
- package/dist/service/s3/command/list-objects/list-objects.command.d.ts.map +1 -1
- package/dist/service/s3/command/list-objects/list-objects.handler.d.ts +3 -0
- package/dist/service/s3/command/list-objects/list-objects.handler.d.ts.map +1 -1
- package/dist/service/s3/command/list-objects/list-objects.handler.js +6 -2
- package/dist/service/s3/command/list-objects/list-objects.handler.js.map +1 -1
- package/dist/service/s3/command/list-objects-v2/list-objects-v2-continuation-token.d.ts +20 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2-continuation-token.d.ts.map +1 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2-continuation-token.js +29 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2-continuation-token.js.map +1 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.d.ts +31 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.d.ts.map +1 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.js +48 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.js.map +1 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2.command.d.ts +41 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2.command.d.ts.map +1 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2.command.js +2 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2.command.js.map +1 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.d.ts +41 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.d.ts.map +1 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.js +64 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.js.map +1 -0
- package/dist/service/s3/command/object/sim-s3-object-commands.d.ts +8 -0
- package/dist/service/s3/command/object/sim-s3-object-commands.d.ts.map +1 -1
- package/dist/service/s3/command/object/sim-s3-object-commands.js +13 -0
- package/dist/service/s3/command/object/sim-s3-object-commands.js.map +1 -1
- package/dist/service/s3/command/put-object/put-object-builder.d.ts +10 -0
- package/dist/service/s3/command/put-object/put-object-builder.d.ts.map +1 -1
- package/dist/service/s3/command/put-object/put-object-builder.js +8 -0
- package/dist/service/s3/command/put-object/put-object-builder.js.map +1 -1
- package/dist/service/s3/command/put-object/put-object.command.d.ts +4 -0
- package/dist/service/s3/command/put-object/put-object.command.d.ts.map +1 -1
- package/dist/service/s3/command/put-object/put-object.handler.d.ts.map +1 -1
- package/dist/service/s3/command/put-object/put-object.handler.js +4 -1
- package/dist/service/s3/command/put-object/put-object.handler.js.map +1 -1
- package/dist/service/s3/command/sim-s3-bucket-command-state.d.ts +4 -1
- package/dist/service/s3/command/sim-s3-bucket-command-state.d.ts.map +1 -1
- package/dist/service/s3/command/sim-s3-command.types.d.ts +2 -1
- package/dist/service/s3/command/sim-s3-command.types.d.ts.map +1 -1
- package/dist/service/s3/notification/event/sim-s3-object-event-builder.d.ts.map +1 -1
- package/dist/service/s3/notification/event/sim-s3-object-event-builder.js +1 -2
- package/dist/service/s3/notification/event/sim-s3-object-event-builder.js.map +1 -1
- package/dist/service/s3/object/s3-object-etag.d.ts +20 -0
- package/dist/service/s3/object/s3-object-etag.d.ts.map +1 -0
- package/dist/service/s3/object/s3-object-etag.js +25 -0
- package/dist/service/s3/object/s3-object-etag.js.map +1 -0
- package/dist/service/s3/object/s3-object-listing-limits.d.ts +26 -0
- package/dist/service/s3/object/s3-object-listing-limits.d.ts.map +1 -0
- package/dist/service/s3/object/s3-object-listing-limits.js +46 -0
- package/dist/service/s3/object/s3-object-listing-limits.js.map +1 -0
- package/dist/service/s3/object/s3-object-listing.d.ts +51 -0
- package/dist/service/s3/object/s3-object-listing.d.ts.map +1 -0
- package/dist/service/s3/object/s3-object-listing.js +64 -0
- package/dist/service/s3/object/s3-object-listing.js.map +1 -0
- package/dist/service/s3/object/s3-object-response-headers.d.ts +23 -6
- package/dist/service/s3/object/s3-object-response-headers.d.ts.map +1 -1
- package/dist/service/s3/object/s3-object-response-headers.js +18 -8
- package/dist/service/s3/object/s3-object-response-headers.js.map +1 -1
- package/dist/service/s3/object/s3-object-summary.d.ts +33 -0
- package/dist/service/s3/object/s3-object-summary.d.ts.map +1 -0
- package/dist/service/s3/object/s3-object-summary.js +40 -0
- package/dist/service/s3/object/s3-object-summary.js.map +1 -0
- package/dist/service/s3/object/s3-object.d.ts +25 -0
- package/dist/service/s3/object/s3-object.d.ts.map +1 -1
- package/dist/service/s3/object/s3-object.js +31 -1
- package/dist/service/s3/object/s3-object.js.map +1 -1
- package/dist/service/s3/sdk/sim-s3-sdk-command-router.d.ts.map +1 -1
- package/dist/service/s3/sdk/sim-s3-sdk-command-router.js +4 -0
- package/dist/service/s3/sdk/sim-s3-sdk-command-router.js.map +1 -1
- package/dist/service/s3/serve/sim-s3-rest-object-reader.d.ts.map +1 -1
- package/dist/service/s3/serve/sim-s3-rest-object-reader.js +6 -1
- package/dist/service/s3/serve/sim-s3-rest-object-reader.js.map +1 -1
- package/dist/service/s3/serve/website/sim-s3-website-object-loader.d.ts.map +1 -1
- package/dist/service/s3/serve/website/sim-s3-website-object-loader.js +6 -1
- package/dist/service/s3/serve/website/sim-s3-website-object-loader.js.map +1 -1
- package/dist/service/s3/serve/website/sim-s3-website-object.d.ts +13 -4
- package/dist/service/s3/serve/website/sim-s3-website-object.d.ts.map +1 -1
- package/dist/service/s3/serve/website/sim-s3-website-object.js +15 -6
- package/dist/service/s3/serve/website/sim-s3-website-object.js.map +1 -1
- package/dist/service/s3/sim-s3-commands.d.ts +6 -0
- package/dist/service/s3/sim-s3-commands.d.ts.map +1 -1
- package/dist/service/s3/sim-s3-commands.js +2 -0
- package/dist/service/s3/sim-s3-commands.js.map +1 -1
- package/dist/service/s3/sim-s3.d.ts +24 -34
- package/dist/service/s3/sim-s3.d.ts.map +1 -1
- package/dist/service/s3/sim-s3.js +32 -40
- package/dist/service/s3/sim-s3.js.map +1 -1
- package/dist/service/s3/storage/filesystem/filesystem-path-exists.d.ts +8 -0
- package/dist/service/s3/storage/filesystem/filesystem-path-exists.d.ts.map +1 -1
- package/dist/service/s3/storage/filesystem/filesystem-path-exists.js +11 -1
- package/dist/service/s3/storage/filesystem/filesystem-path-exists.js.map +1 -1
- package/dist/service/s3/storage/filesystem/s3-filesystem-object-file.d.ts +19 -0
- package/dist/service/s3/storage/filesystem/s3-filesystem-object-file.d.ts.map +1 -0
- package/dist/service/s3/storage/filesystem/s3-filesystem-object-file.js +55 -0
- package/dist/service/s3/storage/filesystem/s3-filesystem-object-file.js.map +1 -0
- package/dist/service/s3/storage/filesystem/s3-filesystem-object-keys.d.ts +14 -4
- package/dist/service/s3/storage/filesystem/s3-filesystem-object-keys.d.ts.map +1 -1
- package/dist/service/s3/storage/filesystem/s3-filesystem-object-keys.js +27 -5
- package/dist/service/s3/storage/filesystem/s3-filesystem-object-keys.js.map +1 -1
- package/dist/service/s3/storage/filesystem/s3-filesystem-storage.d.ts +1 -2
- package/dist/service/s3/storage/filesystem/s3-filesystem-storage.d.ts.map +1 -1
- package/dist/service/s3/storage/filesystem/s3-filesystem-storage.js +10 -36
- package/dist/service/s3/storage/filesystem/s3-filesystem-storage.js.map +1 -1
- package/dist/service/sns/signature/sim-sns-certificate.d.ts +9 -3
- package/dist/service/sns/signature/sim-sns-certificate.d.ts.map +1 -1
- package/dist/service/sns/signature/sim-sns-certificate.js +13 -8
- package/dist/service/sns/signature/sim-sns-certificate.js.map +1 -1
- package/dist/service/sns/signature/sim-sns-der.d.ts +16 -0
- package/dist/service/sns/signature/sim-sns-der.d.ts.map +1 -1
- package/dist/service/sns/signature/sim-sns-der.js +23 -0
- package/dist/service/sns/signature/sim-sns-der.js.map +1 -1
- package/package.json +1 -1
- package/dist/service/s3/notification/event/sim-s3-object-etag.d.ts +0 -8
- package/dist/service/s3/notification/event/sim-s3-object-etag.d.ts.map +0 -1
- package/dist/service/s3/notification/event/sim-s3-object-etag.js +0 -11
- package/dist/service/s3/notification/event/sim-s3-object-etag.js.map +0 -1
|
@@ -4,6 +4,7 @@ import { SimS3NoSuchBucket } from "../../error/sim-s3.error.js";
|
|
|
4
4
|
import { SimIamAllowAllAuth, } from "../../../iam/authorize/sim-iam-inter-service-auth-z.js";
|
|
5
5
|
import { PutObjectAuthorizer } from "./put-object-authorizer.js";
|
|
6
6
|
import { PutObjectBuilder } from "./put-object-builder.js";
|
|
7
|
+
import { simS3QuotedETag } from "../../object/s3-object-etag.js";
|
|
7
8
|
/**
|
|
8
9
|
* Simulated S3 PutObjectCommand handler.
|
|
9
10
|
*
|
|
@@ -12,7 +13,7 @@ import { PutObjectBuilder } from "./put-object-builder.js";
|
|
|
12
13
|
export class PutObjectCommandHandler {
|
|
13
14
|
buckets;
|
|
14
15
|
authorizer;
|
|
15
|
-
objectBuilder
|
|
16
|
+
objectBuilder;
|
|
16
17
|
background;
|
|
17
18
|
notifications;
|
|
18
19
|
constructor(properties) {
|
|
@@ -20,6 +21,7 @@ export class PutObjectCommandHandler {
|
|
|
20
21
|
this.buckets = buckets;
|
|
21
22
|
this.authorizer = new PutObjectAuthorizer({ iam });
|
|
22
23
|
this.background = background;
|
|
24
|
+
this.objectBuilder = new PutObjectBuilder({ clock: background });
|
|
23
25
|
this.notifications = properties.notifications;
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
@@ -51,6 +53,7 @@ export class PutObjectCommandHandler {
|
|
|
51
53
|
// an intercepted SDK client and the REST endpoint alike.
|
|
52
54
|
this.notifications.objectCreated({ bucket, object, caller });
|
|
53
55
|
return {
|
|
56
|
+
ETag: simS3QuotedETag(object.etag),
|
|
54
57
|
$metadata: {},
|
|
55
58
|
};
|
|
56
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"put-object.handler.js","sourceRoot":"","sources":["../../../../../src/service/s3/command/put-object/put-object.handler.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAEL,eAAe,GAChB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EACL,kBAAkB,GAEnB,MAAM,wDAAwD,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"put-object.handler.js","sourceRoot":"","sources":["../../../../../src/service/s3/command/put-object/put-object.handler.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAEL,eAAe,GAChB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EACL,kBAAkB,GAEnB,MAAM,wDAAwD,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AASjE;;;;GAIG;AACH,MAAM,OAAO,uBAAuB;IAIjB,OAAO,CAAoC;IAC3C,UAAU,CAAsB;IAChC,aAAa,CAAmB;IAChC,UAAU,CAAsB;IAChC,aAAa,CAAsB;IAEpD,YAAY,UAA6C;QACvD,MAAM,EACJ,OAAO,EACP,GAAG,GAAG,IAAI,kBAAkB,EAAE,EAC9B,UAAU,GAAG,IAAI,eAAe,EAAE,GACnC,GAAG,UAAU,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,IAAI,mBAAmB,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,IAAI,gBAAgB,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;QACjE,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;IAChD,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,MAAM,CACV,OAA4B,EAC5B,OAA6B;QAE7B,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC;QACrE,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,4BAA4B,CAAC,CAAC;QAE/D,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,MAAyB,CAAC;QAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,iBAAiB,CAAC,sBAAsB,UAAU,EAAE,CAAC,CAAC;QAClE,CAAC;QAED,oEAAoE;QACpE,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QAEjC,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CACtC,MAAM,EACN,OAAO,CAAC,KAAK,CAAC,GAAG,EACjB,OAAO,CACR,CAAC;QAEF,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAE/B,0EAA0E;QAC1E,yDAAyD;QACzD,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAE7D,OAAO;YACL,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC;YAClC,SAAS,EAAE,EAAE;SACd,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -3,6 +3,7 @@ import type { SimIamInterServiceAuthZ } from "../../iam/authorize/sim-iam-inter-
|
|
|
3
3
|
import type { SimS3Bucket, SimS3BucketName } from "../bucket/sim-s3-bucket.js";
|
|
4
4
|
import type { SimS3NotificationDestinations } from "../notification/destination/sim-s3-notification-destination.js";
|
|
5
5
|
import type { SimS3ObjectNotifier } from "../notification/sim-s3-object-notifier.js";
|
|
6
|
+
import type { SimS3ObjectListingLimits } from "../object/s3-object-listing-limits.js";
|
|
6
7
|
/**
|
|
7
8
|
* The state and collaborators every Bucket-scoped command handler is built
|
|
8
9
|
* with.
|
|
@@ -11,7 +12,8 @@ import type { SimS3ObjectNotifier } from "../notification/sim-s3-object-notifier
|
|
|
11
12
|
* runs, so the same Bucket map, IAM and background scheduler are shared across
|
|
12
13
|
* every command of one simulated S3 scope. The notifier is shared for the same
|
|
13
14
|
* reason and one more: sequence numbers and the delivery ceiling only mean
|
|
14
|
-
* anything if every Object command counts into the same one.
|
|
15
|
+
* anything if every Object command counts into the same one. So is the page
|
|
16
|
+
* size of a listing, so that both versions of the operation agree on it.
|
|
15
17
|
*/
|
|
16
18
|
export interface SimS3BucketCommandState {
|
|
17
19
|
readonly buckets: Map<SimS3BucketName, SimS3Bucket>;
|
|
@@ -19,5 +21,6 @@ export interface SimS3BucketCommandState {
|
|
|
19
21
|
readonly background: BackgroundScheduler;
|
|
20
22
|
readonly notificationDestinations: SimS3NotificationDestinations;
|
|
21
23
|
readonly notifications: SimS3ObjectNotifier;
|
|
24
|
+
readonly listing: SimS3ObjectListingLimits;
|
|
22
25
|
}
|
|
23
26
|
//# sourceMappingURL=sim-s3-bucket-command-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-s3-bucket-command-state.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/command/sim-s3-bucket-command-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AACnG,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gEAAgE,CAAC;AACpH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-s3-bucket-command-state.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/command/sim-s3-bucket-command-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AACnG,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gEAAgE,CAAC;AACpH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAEtF;;;;;;;;;;GAUG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;IACpD,QAAQ,CAAC,GAAG,EAAE,uBAAuB,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,QAAQ,CAAC,wBAAwB,EAAE,6BAA6B,CAAC;IACjE,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAC;CAC5C"}
|
|
@@ -15,7 +15,8 @@ export type { SimGetBucketNotificationConfigurationCommand, SimGetBucketNotifica
|
|
|
15
15
|
export type { SimGetObjectCommand, SimGetObjectCommandOutput, } from "./get-object/get-object.command.js";
|
|
16
16
|
export type { SimGetPublicAccessBlockCommand, SimGetPublicAccessBlockCommandOutput, } from "./get-public-access-block/get-public-access-block.command.js";
|
|
17
17
|
export type { SimListBucketsCommand, SimListBucketsCommandOutput, } from "./list-buckets/list-buckets.command.js";
|
|
18
|
-
export type { SimListObjectsCommand, SimListObjectsCommandOutput, } from "./list-objects/list-objects.command.js";
|
|
18
|
+
export type { SimListObjectsCommand, SimListObjectsCommandOutput, SimS3ObjectSummary, } from "./list-objects/list-objects.command.js";
|
|
19
|
+
export type { SimListObjectsV2Command, SimListObjectsV2CommandOutput, } from "./list-objects-v2/list-objects-v2.command.js";
|
|
19
20
|
export type { SimPutBucketNotificationConfigurationCommand, SimPutBucketNotificationConfigurationCommandOutput, } from "./put-bucket-notification-configuration/put-bucket-notification-configuration.command.js";
|
|
20
21
|
export type { SimPutBucketPolicyCommand, SimPutBucketPolicyCommandOutput, } from "./put-bucket-policy/put-bucket-policy.command.js";
|
|
21
22
|
export type { SimPutBucketWebsiteCommand, SimPutBucketWebsiteCommandOutput, } from "./put-bucket-website/put-bucket-website.command.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-s3-command.types.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/command/sim-s3-command.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,0CAA0C,CAAC;AAClD,YAAY,EACV,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,0CAA0C,CAAC;AAClD,YAAY,EACV,4BAA4B,EAC5B,kCAAkC,GACnC,MAAM,wDAAwD,CAAC;AAChE,YAAY,EACV,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,0CAA0C,CAAC;AAClD,YAAY,EACV,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,4CAA4C,CAAC;AACpD,YAAY,EACV,iCAAiC,EACjC,uCAAuC,GACxC,MAAM,oEAAoE,CAAC;AAC5E,YAAY,EACV,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,kDAAkD,CAAC;AAC1D,YAAY,EACV,4CAA4C,EAC5C,kDAAkD,GACnD,MAAM,0FAA0F,CAAC;AAClG,YAAY,EACV,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,YAAY,EACV,8BAA8B,EAC9B,oCAAoC,GACrC,MAAM,8DAA8D,CAAC;AACtE,YAAY,EACV,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,wCAAwC,CAAC;AAChD,YAAY,EACV,qBAAqB,EACrB,2BAA2B,
|
|
1
|
+
{"version":3,"file":"sim-s3-command.types.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/command/sim-s3-command.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,0CAA0C,CAAC;AAClD,YAAY,EACV,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,0CAA0C,CAAC;AAClD,YAAY,EACV,4BAA4B,EAC5B,kCAAkC,GACnC,MAAM,wDAAwD,CAAC;AAChE,YAAY,EACV,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,0CAA0C,CAAC;AAClD,YAAY,EACV,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,4CAA4C,CAAC;AACpD,YAAY,EACV,iCAAiC,EACjC,uCAAuC,GACxC,MAAM,oEAAoE,CAAC;AAC5E,YAAY,EACV,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,kDAAkD,CAAC;AAC1D,YAAY,EACV,4CAA4C,EAC5C,kDAAkD,GACnD,MAAM,0FAA0F,CAAC;AAClG,YAAY,EACV,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,YAAY,EACV,8BAA8B,EAC9B,oCAAoC,GACrC,MAAM,8DAA8D,CAAC;AACtE,YAAY,EACV,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,wCAAwC,CAAC;AAChD,YAAY,EACV,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,GACnB,MAAM,wCAAwC,CAAC;AAChD,YAAY,EACV,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,8CAA8C,CAAC;AACtD,YAAY,EACV,4CAA4C,EAC5C,kDAAkD,GACnD,MAAM,0FAA0F,CAAC;AAClG,YAAY,EACV,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,kDAAkD,CAAC;AAC1D,YAAY,EACV,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,oDAAoD,CAAC;AAC5D,YAAY,EACV,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,YAAY,EACV,8BAA8B,EAC9B,oCAAoC,GACrC,MAAM,8DAA8D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-s3-object-event-builder.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/notification/event/sim-s3-object-event-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAC3F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AAErG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-s3-object-event-builder.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/notification/event/sim-s3-object-event-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAC3F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AAErG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAG7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,sBAAsB,CAAC;IAC3C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACtC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,UAAU,iCAAiC;IACzC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,qBAAa,uBAAuB;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAW;IACjC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+B;IAE1D,YAAY,UAAU,EAAE,iCAAiC,EAExD;IAED;;;OAGG;IACH,UAAU,CAAC,KAAK,EAAE,uBAAuB,GAAG,gBAAgB,CAS3D;IAED;;;OAGG;IACH,UAAU,CAAC,KAAK,EAAE,uBAAuB,GAAG,gBAAgB,CAO3D;IAED,OAAO,CAAC,KAAK;CAmBd"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { simS3BucketArn } from "../../bucket/sim-s3-bucket-arn.js";
|
|
2
2
|
import { SimS3ObjectSequencers } from "../sim-s3-object-sequencers.js";
|
|
3
3
|
import { simS3EventPrincipalId } from "./sim-s3-event-principal.js";
|
|
4
|
-
import { simS3ObjectETag } from "./sim-s3-object-etag.js";
|
|
5
4
|
import { SimS3ObjectEvent } from "./sim-s3-object-event.js";
|
|
6
5
|
/**
|
|
7
6
|
* Turns something that happened to an Object into the event a destination is
|
|
@@ -28,7 +27,7 @@ export class SimS3ObjectEventBuilder {
|
|
|
28
27
|
key: input.object.key,
|
|
29
28
|
caller: input.caller,
|
|
30
29
|
size: input.object.body.length,
|
|
31
|
-
eTag:
|
|
30
|
+
eTag: input.object.etag,
|
|
32
31
|
});
|
|
33
32
|
}
|
|
34
33
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-s3-object-event-builder.js","sourceRoot":"","sources":["../../../../../src/service/s3/notification/event/sim-s3-object-event-builder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAGnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sim-s3-object-event-builder.js","sourceRoot":"","sources":["../../../../../src/service/s3/notification/event/sim-s3-object-event-builder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAGnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAqC5D;;;;;;;GAOG;AACH,MAAM,OAAO,uBAAuB;IACjB,KAAK,CAAW;IAChB,UAAU,GAAG,IAAI,qBAAqB,EAAE,CAAC;IAE1D,YAAY,UAA6C;QACvD,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;IAChC,CAAC;IAED;;;OAGG;IACH,UAAU,CAAC,KAA8B;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC;YAChB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,SAAS,EAAE,sBAAsB;YACjC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;YACrB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM;YAC9B,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;SACxB,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,UAAU,CAAC,KAA8B;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC;YAChB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,SAAS,EAAE,yBAAyB;YACpC,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,MAA8B;QAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC;QACpD,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;QAE5C,OAAO,IAAI,gBAAgB,CAAC;YAC1B,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,uEAAuE;YACvE,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;YAC3B,UAAU;YACV,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC;YACrC,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,cAAc,EAAE,KAAK,CAAC,SAAS;YAC/B,WAAW,EAAE,qBAAqB,CAAC,MAAM,CAAC,MAAM,CAAC;YACjD,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC;YACvD,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ETag real S3 gives an Object uploaded in one part.
|
|
3
|
+
*
|
|
4
|
+
* It is the MD5 of the bytes, in hex, and stays that under SSE-S3. An Object
|
|
5
|
+
* uploaded in several parts gets `<md5-of-the-part-md5s>-<partCount>` instead,
|
|
6
|
+
* which is why a tool comparing content hashes checks for the `-N` suffix
|
|
7
|
+
* before trusting an ETag. Simulated S3 has no multipart upload, so an ETag
|
|
8
|
+
* here never carries one.
|
|
9
|
+
*/
|
|
10
|
+
export declare function simS3ObjectETag(body: Buffer): string;
|
|
11
|
+
/**
|
|
12
|
+
* The ETag as a response carries it, which real S3 quotes.
|
|
13
|
+
*
|
|
14
|
+
* S3 is inconsistent about this, and deliberately so: on the wire an ETag is an
|
|
15
|
+
* HTTP entity tag and keeps its quotes, which the SDK hands to the caller
|
|
16
|
+
* unchanged, while the `eTag` of an Object event notification record does not.
|
|
17
|
+
* Holding the digest and quoting it on the way out keeps both of them right.
|
|
18
|
+
*/
|
|
19
|
+
export declare function simS3QuotedETag(etag: string): string;
|
|
20
|
+
//# sourceMappingURL=s3-object-etag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-object-etag.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object-etag.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
/**
|
|
3
|
+
* The ETag real S3 gives an Object uploaded in one part.
|
|
4
|
+
*
|
|
5
|
+
* It is the MD5 of the bytes, in hex, and stays that under SSE-S3. An Object
|
|
6
|
+
* uploaded in several parts gets `<md5-of-the-part-md5s>-<partCount>` instead,
|
|
7
|
+
* which is why a tool comparing content hashes checks for the `-N` suffix
|
|
8
|
+
* before trusting an ETag. Simulated S3 has no multipart upload, so an ETag
|
|
9
|
+
* here never carries one.
|
|
10
|
+
*/
|
|
11
|
+
export function simS3ObjectETag(body) {
|
|
12
|
+
return createHash("md5").update(body).digest("hex");
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The ETag as a response carries it, which real S3 quotes.
|
|
16
|
+
*
|
|
17
|
+
* S3 is inconsistent about this, and deliberately so: on the wire an ETag is an
|
|
18
|
+
* HTTP entity tag and keeps its quotes, which the SDK hands to the caller
|
|
19
|
+
* unchanged, while the `eTag` of an Object event notification record does not.
|
|
20
|
+
* Holding the digest and quoting it on the way out keeps both of them right.
|
|
21
|
+
*/
|
|
22
|
+
export function simS3QuotedETag(etag) {
|
|
23
|
+
return `"${etag}"`;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=s3-object-etag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-object-etag.js","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object-etag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,IAAI,GAAG,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How much of a Bucket one page of an Object listing may return.
|
|
3
|
+
*
|
|
4
|
+
* Real S3 fixes this at a thousand keys and gives nobody a way to change it.
|
|
5
|
+
* The simulation keeps that default and does allow it to be changed, because a
|
|
6
|
+
* caller that never continues a listing is a caller whose pagination has never
|
|
7
|
+
* run, and provoking one honestly would mean storing a thousand and one
|
|
8
|
+
* Objects first.
|
|
9
|
+
*
|
|
10
|
+
* It lives on the shared command state rather than being handed to each
|
|
11
|
+
* listing, so both versions of the operation see the same page size and a
|
|
12
|
+
* change reaches whichever of them the caller uses.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SimS3ObjectListingLimits {
|
|
15
|
+
private maxKeys;
|
|
16
|
+
constructor(maxKeysPerPage?: number);
|
|
17
|
+
/**
|
|
18
|
+
* The most keys a page of a listing will hold.
|
|
19
|
+
*/
|
|
20
|
+
get maxKeysPerPage(): number;
|
|
21
|
+
/**
|
|
22
|
+
* Change how many keys a page of a listing holds from here on.
|
|
23
|
+
*/
|
|
24
|
+
configureMaxKeysPerPage(maxKeys: number): void;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=s3-object-listing-limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-object-listing-limits.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object-listing-limits.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,OAAO,CAAS;IAExB,YAAY,cAAc,GAAE,MAAmC,EAE9D;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED;;OAEG;IACH,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE7C;CACF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { simS3DefaultMaxKeysPerPage } from "./s3-object-listing.js";
|
|
2
|
+
/**
|
|
3
|
+
* How much of a Bucket one page of an Object listing may return.
|
|
4
|
+
*
|
|
5
|
+
* Real S3 fixes this at a thousand keys and gives nobody a way to change it.
|
|
6
|
+
* The simulation keeps that default and does allow it to be changed, because a
|
|
7
|
+
* caller that never continues a listing is a caller whose pagination has never
|
|
8
|
+
* run, and provoking one honestly would mean storing a thousand and one
|
|
9
|
+
* Objects first.
|
|
10
|
+
*
|
|
11
|
+
* It lives on the shared command state rather than being handed to each
|
|
12
|
+
* listing, so both versions of the operation see the same page size and a
|
|
13
|
+
* change reaches whichever of them the caller uses.
|
|
14
|
+
*/
|
|
15
|
+
export class SimS3ObjectListingLimits {
|
|
16
|
+
maxKeys;
|
|
17
|
+
constructor(maxKeysPerPage = simS3DefaultMaxKeysPerPage) {
|
|
18
|
+
this.maxKeys = usableMaxKeysPerPage(maxKeysPerPage);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The most keys a page of a listing will hold.
|
|
22
|
+
*/
|
|
23
|
+
get maxKeysPerPage() {
|
|
24
|
+
return this.maxKeys;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Change how many keys a page of a listing holds from here on.
|
|
28
|
+
*/
|
|
29
|
+
configureMaxKeysPerPage(maxKeys) {
|
|
30
|
+
this.maxKeys = usableMaxKeysPerPage(maxKeys);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Refuse a page size no listing could return anything from.
|
|
35
|
+
*
|
|
36
|
+
* A cap below one key leaves every listing empty and truncated, which looks
|
|
37
|
+
* like a Bucket problem rather than the configuration mistake it is.
|
|
38
|
+
*/
|
|
39
|
+
function usableMaxKeysPerPage(maxKeys) {
|
|
40
|
+
if (!Number.isSafeInteger(maxKeys) || maxKeys < 1) {
|
|
41
|
+
throw new Error(`Simulated S3 needs a whole number of keys per listing page, ` +
|
|
42
|
+
`of at least one, rather than ${maxKeys}`);
|
|
43
|
+
}
|
|
44
|
+
return maxKeys;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=s3-object-listing-limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-object-listing-limits.js","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object-listing-limits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,wBAAwB;IAC3B,OAAO,CAAS;IAExB,YAAY,cAAc,GAAW,0BAA0B;QAC7D,IAAI,CAAC,OAAO,GAAG,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,uBAAuB,CAAC,OAAe;QACrC,IAAI,CAAC,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;CACF;AAED;;;;;GAKG;AACH,SAAS,oBAAoB,CAAC,OAAe;IAC3C,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CACb,8DAA8D;YAC5D,gCAAgC,OAAO,EAAE,CAC5C,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { SimS3Object } from "./s3-object.js";
|
|
2
|
+
/**
|
|
3
|
+
* The most keys real S3 returns in one page of a listing.
|
|
4
|
+
*
|
|
5
|
+
* A caller asking for more gets this many, which is the whole reason listing
|
|
6
|
+
* code has to handle a continuation at all.
|
|
7
|
+
*/
|
|
8
|
+
export declare const simS3DefaultMaxKeysPerPage = 1000;
|
|
9
|
+
interface SimS3ObjectPageRequest {
|
|
10
|
+
readonly objects: readonly SimS3Object[];
|
|
11
|
+
/** The key to resume after, exclusive, or nothing to start at the first. */
|
|
12
|
+
readonly startAfter?: string | undefined;
|
|
13
|
+
readonly maxKeys: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* One page of a Bucket listing, and whether the Bucket holds more.
|
|
17
|
+
*/
|
|
18
|
+
export interface SimS3ObjectPage {
|
|
19
|
+
readonly objects: readonly SimS3Object[];
|
|
20
|
+
readonly isTruncated: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The key the next page resumes after, which is there exactly when the
|
|
23
|
+
* listing is truncated, so a caller cannot be offered one that goes nowhere.
|
|
24
|
+
*/
|
|
25
|
+
readonly resumeAfter: string | undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Order a Bucket's Objects and take the page a listing asked for.
|
|
29
|
+
*
|
|
30
|
+
* ListObjects and ListObjectsV2 share this because they share it in real S3:
|
|
31
|
+
* they differ in how a caller names where to resume and in how the response
|
|
32
|
+
* reports it, never in which keys come back.
|
|
33
|
+
*
|
|
34
|
+
* S3 orders keys by their UTF-8 bytes and resumes strictly after the key it is
|
|
35
|
+
* given, whether or not the Bucket still holds that key. Both are done here by
|
|
36
|
+
* comparing the strings directly, which agrees with S3 for every key that is
|
|
37
|
+
* not made of characters outside the basic multilingual plane.
|
|
38
|
+
*/
|
|
39
|
+
export declare function simS3ObjectPage(request: SimS3ObjectPageRequest): SimS3ObjectPage;
|
|
40
|
+
/**
|
|
41
|
+
* How many keys a listing will actually return.
|
|
42
|
+
*
|
|
43
|
+
* Real S3 treats MaxKeys as an upper bound it is free to lower, and never
|
|
44
|
+
* returns more than a page holds however many the caller asks for. A request
|
|
45
|
+
* that names no MaxKeys is asking for a full page. Asking for none is allowed
|
|
46
|
+
* and answers with none; asking for fewer than none is refused, as real S3
|
|
47
|
+
* refuses it, rather than being read as some number of keys from the end.
|
|
48
|
+
*/
|
|
49
|
+
export declare function simS3EffectiveMaxKeys(requestedMaxKeys: number | undefined, maxKeysPerPage: number): number;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=s3-object-listing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-object-listing.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object-listing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,4EAA4E;IAC5E,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,sBAAsB,GAC9B,eAAe,CAyBjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,cAAc,EAAE,MAAM,GACrB,MAAM,CAQR"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { SimS3InvalidArgument } from "../error/sim-s3.error.js";
|
|
2
|
+
/**
|
|
3
|
+
* The most keys real S3 returns in one page of a listing.
|
|
4
|
+
*
|
|
5
|
+
* A caller asking for more gets this many, which is the whole reason listing
|
|
6
|
+
* code has to handle a continuation at all.
|
|
7
|
+
*/
|
|
8
|
+
export const simS3DefaultMaxKeysPerPage = 1000;
|
|
9
|
+
/**
|
|
10
|
+
* Order a Bucket's Objects and take the page a listing asked for.
|
|
11
|
+
*
|
|
12
|
+
* ListObjects and ListObjectsV2 share this because they share it in real S3:
|
|
13
|
+
* they differ in how a caller names where to resume and in how the response
|
|
14
|
+
* reports it, never in which keys come back.
|
|
15
|
+
*
|
|
16
|
+
* S3 orders keys by their UTF-8 bytes and resumes strictly after the key it is
|
|
17
|
+
* given, whether or not the Bucket still holds that key. Both are done here by
|
|
18
|
+
* comparing the strings directly, which agrees with S3 for every key that is
|
|
19
|
+
* not made of characters outside the basic multilingual plane.
|
|
20
|
+
*/
|
|
21
|
+
export function simS3ObjectPage(request) {
|
|
22
|
+
const ordered = request.objects.toSorted(compareObjectKeys);
|
|
23
|
+
const startAfter = request.startAfter;
|
|
24
|
+
const remaining = startAfter === undefined
|
|
25
|
+
? ordered
|
|
26
|
+
: ordered.filter((object) => object.key > startAfter);
|
|
27
|
+
// A negative page size would slice keys off the end rather than take none,
|
|
28
|
+
// so a page with no room is empty rather than backwards.
|
|
29
|
+
const objects = remaining.slice(0, Math.max(0, request.maxKeys));
|
|
30
|
+
const lastKey = objects.at(-1)?.key;
|
|
31
|
+
// A page that returned no keys has nowhere for a caller to carry on from, so
|
|
32
|
+
// it is complete however much the Bucket still holds. Reporting it truncated
|
|
33
|
+
// would offer a continuation that cannot exist, and a caller looping until
|
|
34
|
+
// the listing is complete would never stop.
|
|
35
|
+
const isTruncated = lastKey !== undefined && objects.length < remaining.length;
|
|
36
|
+
return {
|
|
37
|
+
objects,
|
|
38
|
+
isTruncated,
|
|
39
|
+
resumeAfter: isTruncated ? lastKey : undefined,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* How many keys a listing will actually return.
|
|
44
|
+
*
|
|
45
|
+
* Real S3 treats MaxKeys as an upper bound it is free to lower, and never
|
|
46
|
+
* returns more than a page holds however many the caller asks for. A request
|
|
47
|
+
* that names no MaxKeys is asking for a full page. Asking for none is allowed
|
|
48
|
+
* and answers with none; asking for fewer than none is refused, as real S3
|
|
49
|
+
* refuses it, rather than being read as some number of keys from the end.
|
|
50
|
+
*/
|
|
51
|
+
export function simS3EffectiveMaxKeys(requestedMaxKeys, maxKeysPerPage) {
|
|
52
|
+
if (requestedMaxKeys !== undefined && requestedMaxKeys < 0) {
|
|
53
|
+
throw new SimS3InvalidArgument(`MaxKeys must not be negative, rather than ${requestedMaxKeys}`);
|
|
54
|
+
}
|
|
55
|
+
return Math.min(requestedMaxKeys ?? maxKeysPerPage, maxKeysPerPage);
|
|
56
|
+
}
|
|
57
|
+
function compareObjectKeys(a, b) {
|
|
58
|
+
/* v8 ignore if -- a Bucket holds one Object per key, so no two keys are equal */
|
|
59
|
+
if (a.key === b.key) {
|
|
60
|
+
return 0;
|
|
61
|
+
}
|
|
62
|
+
return a.key < b.key ? -1 : 1;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=s3-object-listing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-object-listing.js","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object-listing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAsB/C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAC7B,OAA+B;IAE/B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC5D,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,MAAM,SAAS,GACb,UAAU,KAAK,SAAS;QACtB,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,GAAG,UAAU,CAAC,CAAC;IAE1D,2EAA2E;IAC3E,yDAAyD;IACzD,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;IAEpC,6EAA6E;IAC7E,6EAA6E;IAC7E,2EAA2E;IAC3E,4CAA4C;IAC5C,MAAM,WAAW,GACf,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;IAE7D,OAAO;QACL,OAAO;QACP,WAAW;QACX,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;KAC/C,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,gBAAoC,EACpC,cAAsB;IAEtB,IAAI,gBAAgB,KAAK,SAAS,IAAI,gBAAgB,GAAG,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,oBAAoB,CAC5B,6CAA6C,gBAAgB,EAAE,CAChE,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,gBAAgB,IAAI,cAAc,EAAE,cAAc,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,iBAAiB,CAAC,CAAc,EAAE,CAAc;IACvD,iFAAiF;IACjF,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC;QACpB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -1,17 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an endpoint knows about the Object it is about to serve.
|
|
3
|
+
*/
|
|
4
|
+
export interface SimS3ObjectResponseDescription {
|
|
5
|
+
/** The system metadata S3 was told when the Object was written. */
|
|
6
|
+
readonly metadata?: Readonly<Record<string, string>> | undefined;
|
|
7
|
+
/** The length of the body being served, in bytes. */
|
|
8
|
+
readonly bodyLength: number;
|
|
9
|
+
/** The Object's ETag, quoted as an HTTP entity tag. */
|
|
10
|
+
readonly etag?: string | undefined;
|
|
11
|
+
/** When S3 last wrote the Object. */
|
|
12
|
+
readonly lastModified?: Date | undefined;
|
|
13
|
+
}
|
|
1
14
|
/**
|
|
2
15
|
* The headers S3 sets on a read from what it was told when the Object was
|
|
3
16
|
* written.
|
|
4
17
|
*
|
|
5
|
-
* S3 keeps
|
|
6
|
-
* unchanged, on every read. That matters most for `Content-Encoding`: an
|
|
7
|
-
* stored as brotli and served without its encoding header is bytes no
|
|
8
|
-
* can decode. `Cache-Control` matters for a different reason, being the
|
|
9
|
-
* one of these a caller can set per Object rather than per response.
|
|
18
|
+
* S3 keeps the metadata ones as Object system metadata and hands them straight
|
|
19
|
+
* back, unchanged, on every read. That matters most for `Content-Encoding`: an
|
|
20
|
+
* Object stored as brotli and served without its encoding header is bytes no
|
|
21
|
+
* client can decode. `Cache-Control` matters for a different reason, being the
|
|
22
|
+
* only one of these a caller can set per Object rather than per response.
|
|
23
|
+
*
|
|
24
|
+
* `ETag` and `Last-Modified` are not metadata but facts about the stored bytes,
|
|
25
|
+
* and are what makes a conditional request or a content-hash comparison
|
|
26
|
+
* possible over HTTP.
|
|
10
27
|
*
|
|
11
28
|
* Every path that serves an Object goes through here, so they agree on what
|
|
12
29
|
* reading one looks like.
|
|
13
30
|
*
|
|
14
31
|
* https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html
|
|
15
32
|
*/
|
|
16
|
-
export declare function simS3ObjectResponseHeaders(
|
|
33
|
+
export declare function simS3ObjectResponseHeaders(description: SimS3ObjectResponseDescription): Record<string, string>;
|
|
17
34
|
//# sourceMappingURL=s3-object-response-headers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3-object-response-headers.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object-response-headers.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"s3-object-response-headers.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object-response-headers.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;IACjE,qDAAqD;IACrD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,qCAAqC;IACrC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,8BAA8B,GAC1C,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAsBxB"}
|
|
@@ -3,27 +3,37 @@ import { simS3SystemMetadataHeaders } from "./s3-system-metadata.js";
|
|
|
3
3
|
* The headers S3 sets on a read from what it was told when the Object was
|
|
4
4
|
* written.
|
|
5
5
|
*
|
|
6
|
-
* S3 keeps
|
|
7
|
-
* unchanged, on every read. That matters most for `Content-Encoding`: an
|
|
8
|
-
* stored as brotli and served without its encoding header is bytes no
|
|
9
|
-
* can decode. `Cache-Control` matters for a different reason, being the
|
|
10
|
-
* one of these a caller can set per Object rather than per response.
|
|
6
|
+
* S3 keeps the metadata ones as Object system metadata and hands them straight
|
|
7
|
+
* back, unchanged, on every read. That matters most for `Content-Encoding`: an
|
|
8
|
+
* Object stored as brotli and served without its encoding header is bytes no
|
|
9
|
+
* client can decode. `Cache-Control` matters for a different reason, being the
|
|
10
|
+
* only one of these a caller can set per Object rather than per response.
|
|
11
|
+
*
|
|
12
|
+
* `ETag` and `Last-Modified` are not metadata but facts about the stored bytes,
|
|
13
|
+
* and are what makes a conditional request or a content-hash comparison
|
|
14
|
+
* possible over HTTP.
|
|
11
15
|
*
|
|
12
16
|
* Every path that serves an Object goes through here, so they agree on what
|
|
13
17
|
* reading one looks like.
|
|
14
18
|
*
|
|
15
19
|
* https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html
|
|
16
20
|
*/
|
|
17
|
-
export function simS3ObjectResponseHeaders(
|
|
21
|
+
export function simS3ObjectResponseHeaders(description) {
|
|
18
22
|
const headers = {
|
|
19
|
-
"content-length": String(bodyLength),
|
|
23
|
+
"content-length": String(description.bodyLength),
|
|
20
24
|
};
|
|
21
25
|
for (const header of simS3SystemMetadataHeaders) {
|
|
22
|
-
const value = metadata?.[header.name];
|
|
26
|
+
const value = description.metadata?.[header.name];
|
|
23
27
|
if (value !== undefined) {
|
|
24
28
|
headers[header.name] = value;
|
|
25
29
|
}
|
|
26
30
|
}
|
|
31
|
+
if (description.etag !== undefined) {
|
|
32
|
+
headers["etag"] = description.etag;
|
|
33
|
+
}
|
|
34
|
+
if (description.lastModified !== undefined) {
|
|
35
|
+
headers["last-modified"] = description.lastModified.toUTCString();
|
|
36
|
+
}
|
|
27
37
|
return headers;
|
|
28
38
|
}
|
|
29
39
|
//# sourceMappingURL=s3-object-response-headers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3-object-response-headers.js","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object-response-headers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"s3-object-response-headers.js","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object-response-headers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAgBrE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,0BAA0B,CACxC,WAA2C;IAE3C,MAAM,OAAO,GAA2B;QACtC,gBAAgB,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC;KACjD,CAAC;IAEF,KAAK,MAAM,MAAM,IAAI,0BAA0B,EAAE,CAAC;QAChD,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAElD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,IAAI,WAAW,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACnC,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC;IACrC,CAAC;IAED,IAAI,WAAW,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QAC3C,OAAO,CAAC,eAAe,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IACpE,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { SimS3Object } from "./s3-object.js";
|
|
2
|
+
/**
|
|
3
|
+
* One Object as a listing describes it.
|
|
4
|
+
*
|
|
5
|
+
* Both list operations answer with these, because ListObjects and
|
|
6
|
+
* ListObjectsV2 differ in how a caller asks for a page and how the page is
|
|
7
|
+
* bounded, never in what an Object in one looks like.
|
|
8
|
+
*/
|
|
9
|
+
export interface SimS3ObjectSummary {
|
|
10
|
+
readonly Key?: string;
|
|
11
|
+
readonly Size?: number;
|
|
12
|
+
readonly ETag?: string;
|
|
13
|
+
readonly LastModified?: Date;
|
|
14
|
+
readonly StorageClass?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Describe a stored Object the way a listing does.
|
|
18
|
+
*
|
|
19
|
+
* The ETag is the quoted form, matching what GetObject and PutObject answer
|
|
20
|
+
* with, so a caller can compare a listed Object against one it has read without
|
|
21
|
+
* having to know that S3 quotes an entity tag in one place and not another.
|
|
22
|
+
*/
|
|
23
|
+
export declare function simS3ObjectSummary(object: SimS3Object): SimS3ObjectSummary;
|
|
24
|
+
/**
|
|
25
|
+
* Describe the Objects on a page of a listing, or nothing when it holds none.
|
|
26
|
+
*
|
|
27
|
+
* A listing that found no keys has no `Contents` at all in real S3, rather than
|
|
28
|
+
* an empty one, which is why every caller written against it reaches for
|
|
29
|
+
* `Contents ?? []`. Answering with an empty array here would let a caller that
|
|
30
|
+
* skipped the guard pass a test and fail against AWS.
|
|
31
|
+
*/
|
|
32
|
+
export declare function simS3ObjectSummaries(objects: readonly SimS3Object[]): SimS3ObjectSummary[] | undefined;
|
|
33
|
+
//# sourceMappingURL=s3-object-summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-object-summary.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object-summary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAYlD;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,kBAAkB,CAQ1E;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,WAAW,EAAE,GAC9B,kBAAkB,EAAE,GAAG,SAAS,CAIlC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { simS3QuotedETag } from "./s3-object-etag.js";
|
|
2
|
+
/**
|
|
3
|
+
* The storage class S3 reports for an Object nobody asked to store elsewhere.
|
|
4
|
+
*
|
|
5
|
+
* Storage classes are not simulated, and this is the one real S3 puts an Object
|
|
6
|
+
* in unless told otherwise. It is reported rather than omitted because a
|
|
7
|
+
* listing that leaves it out reads as an Object of unknown class, which is a
|
|
8
|
+
* different thing from a Standard one.
|
|
9
|
+
*/
|
|
10
|
+
const defaultStorageClass = "STANDARD";
|
|
11
|
+
/**
|
|
12
|
+
* Describe a stored Object the way a listing does.
|
|
13
|
+
*
|
|
14
|
+
* The ETag is the quoted form, matching what GetObject and PutObject answer
|
|
15
|
+
* with, so a caller can compare a listed Object against one it has read without
|
|
16
|
+
* having to know that S3 quotes an entity tag in one place and not another.
|
|
17
|
+
*/
|
|
18
|
+
export function simS3ObjectSummary(object) {
|
|
19
|
+
return {
|
|
20
|
+
Key: object.key,
|
|
21
|
+
Size: object.body.length,
|
|
22
|
+
ETag: simS3QuotedETag(object.etag),
|
|
23
|
+
LastModified: object.lastModified,
|
|
24
|
+
StorageClass: defaultStorageClass,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Describe the Objects on a page of a listing, or nothing when it holds none.
|
|
29
|
+
*
|
|
30
|
+
* A listing that found no keys has no `Contents` at all in real S3, rather than
|
|
31
|
+
* an empty one, which is why every caller written against it reaches for
|
|
32
|
+
* `Contents ?? []`. Answering with an empty array here would let a caller that
|
|
33
|
+
* skipped the guard pass a test and fail against AWS.
|
|
34
|
+
*/
|
|
35
|
+
export function simS3ObjectSummaries(objects) {
|
|
36
|
+
return objects.length === 0
|
|
37
|
+
? undefined
|
|
38
|
+
: objects.map((object) => simS3ObjectSummary(object));
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=s3-object-summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-object-summary.js","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object-summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD;;;;;;;GAOG;AACH,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAiBvC;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAmB;IACpD,OAAO;QACL,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM;QACxB,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC;QAClC,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,YAAY,EAAE,mBAAmB;KAClC,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAA+B;IAE/B,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC;QACzB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -9,6 +9,7 @@ interface SimS3ObjectProperties {
|
|
|
9
9
|
readonly key?: string;
|
|
10
10
|
readonly body?: Buffer;
|
|
11
11
|
readonly metadata?: SimS3ObjectMetadata;
|
|
12
|
+
readonly lastModified?: Date;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Simulated S3 object.
|
|
@@ -17,7 +18,31 @@ export declare class SimS3Object {
|
|
|
17
18
|
readonly key: string;
|
|
18
19
|
readonly body: Buffer;
|
|
19
20
|
readonly metadata: SimS3ObjectMetadata;
|
|
21
|
+
private readonly writtenAt;
|
|
20
22
|
constructor(properties?: SimS3ObjectProperties);
|
|
23
|
+
/**
|
|
24
|
+
* When S3 last wrote these bytes.
|
|
25
|
+
*
|
|
26
|
+
* The write path passes the simulation's own clock, so a frozen clock dates
|
|
27
|
+
* an Object at the instant it was frozen at, and filesystem-backed storage
|
|
28
|
+
* passes the file's modification time. The default is for an Object made
|
|
29
|
+
* outside either, which has no clock to ask and is being made now.
|
|
30
|
+
*
|
|
31
|
+
* A copy, because a Date is mutable and every read of an Object hands this
|
|
32
|
+
* one out: a caller that adjusted the Date it was given would otherwise
|
|
33
|
+
* change what the Bucket reports from then on.
|
|
34
|
+
*/
|
|
35
|
+
get lastModified(): Date;
|
|
36
|
+
/**
|
|
37
|
+
* The ETag S3 identifies this Object's content by.
|
|
38
|
+
*
|
|
39
|
+
* Held as the bare digest rather than the quoted form a response carries,
|
|
40
|
+
* because the two surfaces disagree about the quotes and only one of them can
|
|
41
|
+
* be the stored value. It is computed on each read rather than kept, since a
|
|
42
|
+
* Buffer can be written to in place and an ETag remembered from before that
|
|
43
|
+
* would describe bytes the Bucket no longer holds.
|
|
44
|
+
*/
|
|
45
|
+
get etag(): string;
|
|
21
46
|
}
|
|
22
47
|
export {};
|
|
23
48
|
//# sourceMappingURL=s3-object.d.ts.map
|