@kensio/yulin 1.20.3 → 1.20.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/README.md +39 -39
- package/dist/service/cloudfront/origin/s3/sim-cf-s3-origin-object-loader.d.ts.map +1 -1
- package/dist/service/cloudfront/origin/s3/sim-cf-s3-origin-object-loader.js +7 -2
- package/dist/service/cloudfront/origin/s3/sim-cf-s3-origin-object-loader.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 +4 -2
- 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 +6 -1
- package/dist/service/s3/command/get-object/get-object.command.d.ts.map +1 -1
- package/dist/service/s3/command/head-object/head-object-loader.d.ts.map +1 -1
- package/dist/service/s3/command/head-object/head-object-loader.js +2 -1
- package/dist/service/s3/command/head-object/head-object-loader.js.map +1 -1
- package/dist/service/s3/command/head-object/head-object.command.d.ts +2 -1
- package/dist/service/s3/command/head-object/head-object.command.d.ts.map +1 -1
- package/dist/service/s3/object/s3-object.d.ts +14 -0
- package/dist/service/s3/object/s3-object.d.ts.map +1 -1
- package/dist/service/s3/object/s3-object.js +18 -0
- package/dist/service/s3/object/s3-object.js.map +1 -1
- package/dist/service/s3/object/s3-system-metadata-read.d.ts +56 -0
- package/dist/service/s3/object/s3-system-metadata-read.d.ts.map +1 -0
- package/dist/service/s3/object/s3-system-metadata-read.js +66 -0
- package/dist/service/s3/object/s3-system-metadata-read.js.map +1 -0
- package/dist/service/s3/object/s3-system-metadata.d.ts +17 -0
- package/dist/service/s3/object/s3-system-metadata.d.ts.map +1 -1
- package/dist/service/s3/object/s3-system-metadata.js +17 -0
- package/dist/service/s3/object/s3-system-metadata.js.map +1 -1
- package/dist/service/s3/object/s3-write-metadata.d.ts +9 -5
- package/dist/service/s3/object/s3-write-metadata.d.ts.map +1 -1
- package/dist/service/s3/object/s3-write-metadata.js +16 -7
- package/dist/service/s3/object/s3-write-metadata.js.map +1 -1
- package/dist/service/s3/serve/api/sim-s3-api-head-output.d.ts.map +1 -1
- package/dist/service/s3/serve/api/sim-s3-api-head-output.js +2 -1
- package/dist/service/s3/serve/api/sim-s3-api-head-output.js.map +1 -1
- package/dist/service/s3/serve/api/sim-s3-api-object-output.d.ts.map +1 -1
- package/dist/service/s3/serve/api/sim-s3-api-object-output.js +2 -1
- package/dist/service/s3/serve/api/sim-s3-api-object-output.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 +2 -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 +2 -1
- package/dist/service/s3/serve/website/sim-s3-website-object-loader.js.map +1 -1
- package/dist/service/s3/storage/filesystem/s3-filesystem-object-metadata.d.ts.map +1 -1
- package/dist/service/s3/storage/filesystem/s3-filesystem-object-metadata.js +3 -2
- package/dist/service/s3/storage/filesystem/s3-filesystem-object-metadata.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,43 +19,43 @@ npm i -D @kensio/yulin
|
|
|
19
19
|
|
|
20
20
|
## Service specific docs
|
|
21
21
|
|
|
22
|
-
- [ACM](
|
|
23
|
-
- [API Gateway HTTP APIs](
|
|
24
|
-
- [API Gateway REST APIs](
|
|
25
|
-
- [CloudFormation](
|
|
26
|
-
- [CloudFront](
|
|
27
|
-
- [CloudWatch metrics](
|
|
28
|
-
- [Cognito user pools](
|
|
29
|
-
- [DynamoDB](
|
|
30
|
-
- [ECR](
|
|
31
|
-
- [ECS](
|
|
32
|
-
- [EventBridge](
|
|
33
|
-
- [IAM](
|
|
34
|
-
- [KMS](
|
|
35
|
-
- [Lambda](
|
|
36
|
-
- [CloudWatch Logs](
|
|
37
|
-
- [Personalize](
|
|
38
|
-
- [Rekognition](
|
|
39
|
-
- [Route53](
|
|
40
|
-
- [S3](
|
|
41
|
-
- [Scheduler](
|
|
42
|
-
- [Secrets Manager](
|
|
43
|
-
- [SES](
|
|
44
|
-
- [SNS](
|
|
45
|
-
- [SQS](
|
|
46
|
-
- [SSM Parameter Store](
|
|
47
|
-
- [Step Functions](
|
|
48
|
-
- [STS](
|
|
49
|
-
- [WAFv2](
|
|
22
|
+
- [ACM](https://yulinsim.dev/services/acm/ "Simulated ACM docs")
|
|
23
|
+
- [API Gateway HTTP APIs](https://yulinsim.dev/services/apigatewayv2/ "Simulated API Gateway HTTP API docs")
|
|
24
|
+
- [API Gateway REST APIs](https://yulinsim.dev/services/apigateway/ "Simulated API Gateway REST API docs")
|
|
25
|
+
- [CloudFormation](https://yulinsim.dev/services/cloudformation/ "Simulated CloudFormation docs")
|
|
26
|
+
- [CloudFront](https://yulinsim.dev/services/cloudfront/ "Simulated CloudFront docs")
|
|
27
|
+
- [CloudWatch metrics](https://yulinsim.dev/services/cloudwatch/ "Simulated CloudWatch metrics docs")
|
|
28
|
+
- [Cognito user pools](https://yulinsim.dev/services/cognito/ "Simulated Cognito user pools docs")
|
|
29
|
+
- [DynamoDB](https://yulinsim.dev/services/dynamodb/ "Simulated DynamoDB docs")
|
|
30
|
+
- [ECR](https://yulinsim.dev/services/ecr/ "Simulated ECR docs")
|
|
31
|
+
- [ECS](https://yulinsim.dev/services/ecs/ "Simulated ECS docs")
|
|
32
|
+
- [EventBridge](https://yulinsim.dev/services/eventbridge/ "Simulated EventBridge docs")
|
|
33
|
+
- [IAM](https://yulinsim.dev/services/iam/ "Simulated IAM docs")
|
|
34
|
+
- [KMS](https://yulinsim.dev/services/kms/ "Simulated KMS docs")
|
|
35
|
+
- [Lambda](https://yulinsim.dev/services/lambda/ "Simulated Lambda docs")
|
|
36
|
+
- [CloudWatch Logs](https://yulinsim.dev/services/logs/ "Simulated CloudWatch Logs docs")
|
|
37
|
+
- [Personalize](https://yulinsim.dev/services/personalize/ "Simulated Amazon Personalize docs")
|
|
38
|
+
- [Rekognition](https://yulinsim.dev/services/rekognition/ "Simulated Rekognition docs")
|
|
39
|
+
- [Route53](https://yulinsim.dev/services/route53/ "Simulated Route53 docs")
|
|
40
|
+
- [S3](https://yulinsim.dev/services/s3/ "Simulated S3 docs")
|
|
41
|
+
- [Scheduler](https://yulinsim.dev/services/scheduler/ "Simulated EventBridge Scheduler docs")
|
|
42
|
+
- [Secrets Manager](https://yulinsim.dev/services/secretsmanager/ "Simulated Secrets Manager docs")
|
|
43
|
+
- [SES](https://yulinsim.dev/services/ses/ "Simulated SES docs")
|
|
44
|
+
- [SNS](https://yulinsim.dev/services/sns/ "Simulated SNS docs")
|
|
45
|
+
- [SQS](https://yulinsim.dev/services/sqs/ "Simulated SQS docs")
|
|
46
|
+
- [SSM Parameter Store](https://yulinsim.dev/services/ssm/ "Simulated SSM Parameter Store docs")
|
|
47
|
+
- [Step Functions](https://yulinsim.dev/services/stepfunctions/ "Simulated Step Functions docs")
|
|
48
|
+
- [STS](https://yulinsim.dev/services/sts/ "Simulated STS docs")
|
|
49
|
+
- [WAFv2](https://yulinsim.dev/services/wafv2/ "Simulated WAFv2 docs")
|
|
50
50
|
|
|
51
51
|
## Feature specific docs
|
|
52
52
|
|
|
53
|
-
- [AI skill](
|
|
54
|
-
- [The AWS CLI](
|
|
55
|
-
- [AWS SDK interception](
|
|
56
|
-
- [Serving on localhost](
|
|
57
|
-
- [Simulated time](
|
|
58
|
-
- [Terraform](
|
|
53
|
+
- [AI skill](https://yulinsim.dev/ai-skill/ "Yulin AI skill docs")
|
|
54
|
+
- [The AWS CLI](https://yulinsim.dev/cli/ "The AWS CLI against simulated AWS docs")
|
|
55
|
+
- [AWS SDK interception](https://yulinsim.dev/sdk/ "Simulated AWS SDK docs")
|
|
56
|
+
- [Serving on localhost](https://yulinsim.dev/serve/ "Serving simulated AWS on localhost docs")
|
|
57
|
+
- [Simulated time](https://yulinsim.dev/time/ "Simulated time docs")
|
|
58
|
+
- [Terraform](https://yulinsim.dev/terraform/ "Deploying Terraform into simulated AWS docs")
|
|
59
59
|
|
|
60
60
|
## Usage
|
|
61
61
|
|
|
@@ -105,7 +105,7 @@ Each `SimSdk` owns its own isolated simulated AWS, available as `simSdk.simAws`
|
|
|
105
105
|
to seed or inspect simulated state directly. To share state with an existing simulation, wrap it
|
|
106
106
|
with `new SimSdk({ simAws })`.
|
|
107
107
|
|
|
108
|
-
See the [simulated AWS SDK docs](
|
|
108
|
+
See the [simulated AWS SDK docs](https://yulinsim.dev/sdk/ "Simulated AWS SDK docs") for full usage.
|
|
109
109
|
|
|
110
110
|
### Direct interaction with simulated AWS
|
|
111
111
|
|
|
@@ -235,7 +235,7 @@ A URL a simulated service gives out is fetched as it is, with no `localUrl(...)`
|
|
|
235
235
|
hostname a simulated Route53 answers for is requested by its own name. Both routes go through the
|
|
236
236
|
same authentication, routing and service code. Reach for `serveSimAws` when the request comes from
|
|
237
237
|
outside the process. See the
|
|
238
|
-
[serving docs](
|
|
238
|
+
[serving docs](https://yulinsim.dev/serve/ "Serving simulated AWS on localhost docs") for how to choose.
|
|
239
239
|
|
|
240
240
|
#### Restarting a served environment
|
|
241
241
|
|
|
@@ -282,7 +282,7 @@ yulin watch -- tsx dev.ts
|
|
|
282
282
|
|
|
283
283
|
It watches the working directory. It also watches the paths Yulin is holding that a module graph
|
|
284
284
|
never mentions, a directory mounted into a Bucket and a synthesized template. See the
|
|
285
|
-
[serving docs](
|
|
285
|
+
[serving docs](https://yulinsim.dev/serve/ "Serving simulated AWS on localhost docs") for what gets the script, what
|
|
286
286
|
is watched, and what is not.
|
|
287
287
|
|
|
288
288
|
#### Update a stack when its template changes
|
|
@@ -304,7 +304,7 @@ await simAws.cloudFormation().deployTemplateFile({
|
|
|
304
304
|
Resources the change left alone keep what they hold, so simulated S3, DynamoDB and SQS survive a
|
|
305
305
|
`cdk synth`. Under `yulin watch` the template is left to the process watching it, and never triggers
|
|
306
306
|
a restart. See the
|
|
307
|
-
[CloudFormation docs](
|
|
307
|
+
[CloudFormation docs](https://yulinsim.dev/services/cloudformation/ "Simulated CloudFormation docs") for what an
|
|
308
308
|
update does to each resource.
|
|
309
309
|
|
|
310
310
|
### Control simulated time
|
|
@@ -337,7 +337,7 @@ await simAws.clock().advanceBy({ minutes: 20 });
|
|
|
337
337
|
Advancing runs whatever falls due during the interval and returns once the simulation has settled.
|
|
338
338
|
The next line can assert. Time belongs to the `SimAws` instance, so moving it never disturbs another
|
|
339
339
|
simulation, or the real clock. See the
|
|
340
|
-
[simulated time docs](
|
|
340
|
+
[simulated time docs](https://yulinsim.dev/time/ "Simulated time docs") for full usage.
|
|
341
341
|
|
|
342
342
|
## What is Yulin?
|
|
343
343
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cf-s3-origin-object-loader.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/origin/s3/sim-cf-s3-origin-object-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAEzF,OAAO,
|
|
1
|
+
{"version":3,"file":"sim-cf-s3-origin-object-loader.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/origin/s3/sim-cf-s3-origin-object-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAI9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExE;;;;;;;;;;;GAWG;AACH,qBAAa,yBAAyB;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkB;IAE7C,YAAY,YAAY,EAAE,mBAAmB,EAG5C;IAED;;;;;;;OAOG;IACG,IAAI,CACR,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,mBAAmB,GAClC,OAAO,CAAC,WAAW,GAAG,kBAAkB,GAAG,SAAS,CAAC,CA6BvD;CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SimIamAccessDenied } from "../../../iam/error/sim-iam.error.js";
|
|
2
2
|
import { SimS3NoSuchKey } from "../../../s3/error/sim-s3.error.js";
|
|
3
|
-
import { SimS3Object
|
|
3
|
+
import { SimS3Object } from "../../../s3/object/s3-object.js";
|
|
4
|
+
import { simS3WriteMetadata } from "../../../s3/object/s3-write-metadata.js";
|
|
4
5
|
import { simS3BodyToBuffer } from "../../../s3/storage/s3-body-buffer.js";
|
|
5
6
|
/**
|
|
6
7
|
* Reads Objects for a CloudFront S3 Origin.
|
|
@@ -32,10 +33,14 @@ export class SimCfS3OriginObjectLoader {
|
|
|
32
33
|
async load(objectKey, requestOptions) {
|
|
33
34
|
try {
|
|
34
35
|
const output = await this.simS3.getObject({ input: { Bucket: this.bucketName, Key: objectKey } }, requestOptions);
|
|
36
|
+
// A read answers with the same metadata members a write carries, so the
|
|
37
|
+
// Object the Origin serves is rebuilt from them the way one being stored
|
|
38
|
+
// would be. Reading only `Metadata` would drop the content type and the
|
|
39
|
+
// encoding, and the Distribution would serve bytes no client can decode.
|
|
35
40
|
return new SimS3Object({
|
|
36
41
|
key: objectKey,
|
|
37
42
|
body: await simS3BodyToBuffer(output.Body),
|
|
38
|
-
metadata:
|
|
43
|
+
metadata: simS3WriteMetadata(output),
|
|
39
44
|
});
|
|
40
45
|
}
|
|
41
46
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cf-s3-origin-object-loader.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/origin/s3/sim-cf-s3-origin-object-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAGzE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,
|
|
1
|
+
{"version":3,"file":"sim-cf-s3-origin-object-loader.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/origin/s3/sim-cf-s3-origin-object-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAGzE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAG1E;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,yBAAyB;IACnB,KAAK,CAAQ;IACb,UAAU,CAAkB;IAE7C,YAAY,YAAiC;QAC3C,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC;IACnD,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI,CACR,SAAiB,EACjB,cAAmC;QAEnC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CACvC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EACtD,cAAc,CACf,CAAC;YAEF,wEAAwE;YACxE,yEAAyE;YACzE,wEAAwE;YACxE,yEAAyE;YACzE,OAAO,IAAI,WAAW,CAAC;gBACrB,GAAG,EAAE,SAAS;gBACd,IAAI,EAAE,MAAM,iBAAiB,CAAC,MAAM,CAAC,IAA6B,CAAC;gBACnE,QAAQ,EAAE,kBAAkB,CAAC,MAAM,CAAC;aACrC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,cAAc,EAAE,CAAC;gBACpC,OAAO,SAAS,CAAC;YACnB,CAAC;YAED,IAAI,KAAK,YAAY,kBAAkB,EAAE,CAAC;gBACxC,OAAO,KAAK,CAAC;YACf,CAAC;YAED,kEAAkE;YAClE,wDAAwD;YACxD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -13,7 +13,8 @@ import type { SimGetObjectCommandOutput } from "./get-object.command.js";
|
|
|
13
13
|
* - a missing storage entry becomes the S3 NoSuchKey error;
|
|
14
14
|
* - the stored Buffer, or the part of it the read asked for, becomes the
|
|
15
15
|
* readable response body;
|
|
16
|
-
* -
|
|
16
|
+
* - what S3 was told about the Object becomes the response's own fields, and
|
|
17
|
+
* what the caller attached to it becomes the response metadata;
|
|
17
18
|
* - the Object's content hash and write time become its ETag and LastModified.
|
|
18
19
|
*
|
|
19
20
|
* Bucket resolution remains in the command handler because AWS request ordering
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-object-loader.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/command/get-object/get-object-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAOjE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEzE
|
|
1
|
+
{"version":3,"file":"get-object-loader.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/command/get-object/get-object-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAOjE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,eAAe;IAC1B;;;OAGG;IACG,IAAI,CACR,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,MAAM,EACX,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,yBAAyB,CAAC,CA4BpC;CACF"}
|
|
@@ -15,7 +15,8 @@ import { simS3ContentRange, simS3ReadObjectRange, } from "../../object/s3-object
|
|
|
15
15
|
* - a missing storage entry becomes the S3 NoSuchKey error;
|
|
16
16
|
* - the stored Buffer, or the part of it the read asked for, becomes the
|
|
17
17
|
* readable response body;
|
|
18
|
-
* -
|
|
18
|
+
* - what S3 was told about the Object becomes the response's own fields, and
|
|
19
|
+
* what the caller attached to it becomes the response metadata;
|
|
19
20
|
* - the Object's content hash and write time become its ETag and LastModified.
|
|
20
21
|
*
|
|
21
22
|
* Bucket resolution remains in the command handler because AWS request ordering
|
|
@@ -37,8 +38,9 @@ export class GetObjectLoader {
|
|
|
37
38
|
? object.body
|
|
38
39
|
: object.body.subarray(range.start, range.end + 1);
|
|
39
40
|
return {
|
|
41
|
+
...object.metadata.system,
|
|
40
42
|
Body: Readable.from([body]),
|
|
41
|
-
Metadata: object.metadata.
|
|
43
|
+
Metadata: object.metadata.userDefined,
|
|
42
44
|
// The ETag identifies the Object rather than the bytes being sent. A
|
|
43
45
|
// client reading it in pieces compares the value across them to see
|
|
44
46
|
// whether the Object changed underneath it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-object-loader.js","sourceRoot":"","sources":["../../../../../src/service/s3/command/get-object/get-object-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EACL,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AAGzC
|
|
1
|
+
{"version":3,"file":"get-object-loader.js","sourceRoot":"","sources":["../../../../../src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AAE,IAAI,CAAC,MAAM;YAC1B,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI;gBACzB,YAAY,EAAE,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC;aAC7C,CAAC;YACF,SAAS,EAAE,EAAE;SACd,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Readable } from "node:stream";
|
|
2
2
|
import type { SimResponseMetadata } from "../../../aws/metadata/response-metadata.type.js";
|
|
3
|
+
import type { SimS3SystemMetadataOutput } from "../../object/s3-system-metadata-read.js";
|
|
3
4
|
/**
|
|
4
5
|
* Minimal structural sim S3 GetObject command.
|
|
5
6
|
*/
|
|
@@ -29,8 +30,12 @@ export interface SimGetObjectCommandInput {
|
|
|
29
30
|
* ranged read reports the size of its slice. `ContentRange` says which bytes
|
|
30
31
|
* of the Object those are, and is set only for a read that asked for some of
|
|
31
32
|
* them.
|
|
33
|
+
*
|
|
34
|
+
* The system metadata fields it extends are what S3 was told about the Object
|
|
35
|
+
* when it was written. `Metadata` is what the caller attached to it, and holds
|
|
36
|
+
* nothing else.
|
|
32
37
|
*/
|
|
33
|
-
export interface SimGetObjectCommandOutput {
|
|
38
|
+
export interface SimGetObjectCommandOutput extends SimS3SystemMetadataOutput {
|
|
34
39
|
readonly Body?: Readable;
|
|
35
40
|
readonly Metadata?: Record<string, string>;
|
|
36
41
|
readonly ETag?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-object.command.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/command/get-object/get-object.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"get-object.command.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/command/get-object/get-object.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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AC3B;;OAEG;IACG,QAAQ,CACZ,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,0BAA0B,CAAC,
|
|
1
|
+
{"version":3,"file":"head-object-loader.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/command/head-object/head-object-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAGjE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAE3E;;;;;;;GAOG;AACH,qBAAa,gBAAgB;IAC3B;;OAEG;IACG,QAAQ,CACZ,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,0BAA0B,CAAC,CAcrC;CACF"}
|
|
@@ -18,8 +18,9 @@ export class HeadObjectLoader {
|
|
|
18
18
|
throw new SimS3NotFound(`No S3 Object named ${key}`);
|
|
19
19
|
}
|
|
20
20
|
return {
|
|
21
|
+
...object.metadata.system,
|
|
21
22
|
ContentLength: object.body.length,
|
|
22
|
-
Metadata: object.metadata.
|
|
23
|
+
Metadata: object.metadata.userDefined,
|
|
23
24
|
ETag: simS3QuotedETag(object.etag),
|
|
24
25
|
LastModified: object.lastModified,
|
|
25
26
|
$metadata: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"head-object-loader.js","sourceRoot":"","sources":["../../../../../src/service/s3/command/head-object/head-object-loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE;;;;;;;GAOG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;OAEG;IACH,KAAK,CAAC,QAAQ,CACZ,MAAmB,EACnB,GAAW;QAEX,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC3C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,aAAa,CAAC,sBAAsB,GAAG,EAAE,CAAC,CAAC;QACvD,CAAC;QAED,OAAO;YACL,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM;YACjC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"head-object-loader.js","sourceRoot":"","sources":["../../../../../src/service/s3/command/head-object/head-object-loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE;;;;;;;GAOG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;OAEG;IACH,KAAK,CAAC,QAAQ,CACZ,MAAmB,EACnB,GAAW;QAEX,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC3C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,aAAa,CAAC,sBAAsB,GAAG,EAAE,CAAC,CAAC;QACvD,CAAC;QAED,OAAO;YACL,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM;YACzB,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM;YACjC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW;YACrC,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC;YAClC,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,SAAS,EAAE,EAAE;SACd,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SimResponseMetadata } from "../../../aws/metadata/response-metadata.type.js";
|
|
2
|
+
import type { SimS3SystemMetadataOutput } from "../../object/s3-system-metadata-read.js";
|
|
2
3
|
/**
|
|
3
4
|
* Minimal structural sim S3 HeadObject command.
|
|
4
5
|
*/
|
|
@@ -19,7 +20,7 @@ export interface SimHeadObjectCommandInput {
|
|
|
19
20
|
* the Object itself, so this is a GetObject output without its body and with
|
|
20
21
|
* the length that body would have had.
|
|
21
22
|
*/
|
|
22
|
-
export interface SimHeadObjectCommandOutput {
|
|
23
|
+
export interface SimHeadObjectCommandOutput extends SimS3SystemMetadataOutput {
|
|
23
24
|
readonly ContentLength?: number;
|
|
24
25
|
readonly Metadata?: Record<string, string>;
|
|
25
26
|
readonly ETag?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"head-object.command.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/command/head-object/head-object.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"head-object.command.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/command/head-object/head-object.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEzF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,yBAAyB,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,0BAA2B,SAAQ,yBAAyB;IAC3E,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;CACzC"}
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
+
import { type SimS3SystemMetadataOutput } from "./s3-system-metadata-read.js";
|
|
1
2
|
/**
|
|
2
3
|
* Simulated S3 object metadata.
|
|
4
|
+
*
|
|
5
|
+
* Held as one map of header names because that is the form every endpoint
|
|
6
|
+
* serving the Object wants it in. A read through the SDK wants the two halves
|
|
7
|
+
* apart, since S3 answers with what it knows about the Object in fields of its
|
|
8
|
+
* own and keeps `Metadata` for what the caller attached.
|
|
3
9
|
*/
|
|
4
10
|
export declare class SimS3ObjectMetadata {
|
|
5
11
|
readonly values: Record<string, string>;
|
|
6
12
|
constructor(values?: Record<string, string>);
|
|
13
|
+
/**
|
|
14
|
+
* What S3 knows about the Object, as the fields a read hands it back in.
|
|
15
|
+
*/
|
|
16
|
+
get system(): SimS3SystemMetadataOutput;
|
|
17
|
+
/**
|
|
18
|
+
* What the caller attached to the Object, under the keys it was given with.
|
|
19
|
+
*/
|
|
20
|
+
get userDefined(): Record<string, string>;
|
|
7
21
|
}
|
|
8
22
|
interface SimS3ObjectProperties {
|
|
9
23
|
readonly key?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3-object.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"s3-object.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;GAOG;AACH,qBAAa,mBAAmB;aACF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAA1D,YAA4B,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EAAI;IAEnE;;OAEG;IACH,IAAI,MAAM,IAAI,yBAAyB,CAEtC;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExC;CACF;AAED,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IACxC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,qBAAa,WAAW;IACtB,SAAgB,GAAG,EAAE,MAAM,CAAC;IAC5B,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,QAAQ,EAAE,mBAAmB,CAAC;IAE9C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAO;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;IAE/C,YAAY,UAAU,GAAE,qBAA0B,EAajD;IAED;;;;;;;;;;;OAWG;IACH,IAAI,YAAY,IAAI,IAAI,CAEvB;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
|
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
import { simS3ObjectETag } from "./s3-object-etag.js";
|
|
2
|
+
import { simS3SystemMetadataOutput, simS3UserDefinedMetadata, } from "./s3-system-metadata-read.js";
|
|
2
3
|
/**
|
|
3
4
|
* Simulated S3 object metadata.
|
|
5
|
+
*
|
|
6
|
+
* Held as one map of header names because that is the form every endpoint
|
|
7
|
+
* serving the Object wants it in. A read through the SDK wants the two halves
|
|
8
|
+
* apart, since S3 answers with what it knows about the Object in fields of its
|
|
9
|
+
* own and keeps `Metadata` for what the caller attached.
|
|
4
10
|
*/
|
|
5
11
|
export class SimS3ObjectMetadata {
|
|
6
12
|
values;
|
|
7
13
|
constructor(values = {}) {
|
|
8
14
|
this.values = values;
|
|
9
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* What S3 knows about the Object, as the fields a read hands it back in.
|
|
18
|
+
*/
|
|
19
|
+
get system() {
|
|
20
|
+
return simS3SystemMetadataOutput(this.values);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* What the caller attached to the Object, under the keys it was given with.
|
|
24
|
+
*/
|
|
25
|
+
get userDefined() {
|
|
26
|
+
return simS3UserDefinedMetadata(this.values);
|
|
27
|
+
}
|
|
10
28
|
}
|
|
11
29
|
/**
|
|
12
30
|
* Simulated S3 object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3-object.js","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"s3-object.js","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GAEzB,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;GAOG;AACH,MAAM,OAAO,mBAAmB;IACF,MAAM;IAAlC,YAA4B,MAAM,GAA2B,EAAE;sBAAnC,MAAM;IAAgC,CAAC;IAEnE;;OAEG;IACH,IAAI,MAAM;QACR,OAAO,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,IAAI,WAAW;QACb,OAAO,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;CACF;AAcD;;GAEG;AACH,MAAM,OAAO,WAAW;IACN,GAAG,CAAS;IACZ,IAAI,CAAS;IACb,QAAQ,CAAsB;IAE7B,SAAS,CAAO;IAChB,SAAS,CAAqB;IAE/C,YAAY,UAAU,GAA0B,EAAE;QAChD,MAAM,EACJ,GAAG,GAAG,aAAa,EACnB,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EACtB,QAAQ,GAAG,IAAI,mBAAmB,EAAE,EACpC,YAAY,GAAG,IAAI,IAAI,EAAE,GAC1B,GAAG,UAAU,CAAC;QAEf,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC;IACnC,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,YAAY;QACd,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,SAAS,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;CACF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type SimS3SystemMetadataField } from "./s3-system-metadata.js";
|
|
2
|
+
/**
|
|
3
|
+
* The field a read of an Object hands a system metadata header back in.
|
|
4
|
+
*
|
|
5
|
+
* The same names a write sets them with, apart from the expiry. The SDK reads
|
|
6
|
+
* that header into `ExpiresString` and parses it into `Expires` alongside, so
|
|
7
|
+
* the two are separate fields on the way out where they are one on the way in.
|
|
8
|
+
*/
|
|
9
|
+
export type SimS3SystemMetadataOutputField = Exclude<SimS3SystemMetadataField, "Expires"> | "ExpiresString";
|
|
10
|
+
/**
|
|
11
|
+
* What a read of an Object says about it, beyond the bytes themselves.
|
|
12
|
+
*
|
|
13
|
+
* S3 answers a `GetObject` or a `HeadObject` with these as fields of their
|
|
14
|
+
* own. They are what S3 knows about the Object. `Metadata` is what the caller
|
|
15
|
+
* attached to it.
|
|
16
|
+
*/
|
|
17
|
+
export interface SimS3SystemMetadataOutput {
|
|
18
|
+
readonly CacheControl?: string;
|
|
19
|
+
readonly ContentDisposition?: string;
|
|
20
|
+
readonly ContentEncoding?: string;
|
|
21
|
+
readonly ContentLanguage?: string;
|
|
22
|
+
readonly ContentType?: string;
|
|
23
|
+
/** The expiry header, parsed as the SDK parses it. */
|
|
24
|
+
readonly Expires?: Date;
|
|
25
|
+
/** The expiry header as S3 stored it. */
|
|
26
|
+
readonly ExpiresString?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Describe an Object's stored headers as the fields a read of it carries.
|
|
30
|
+
*
|
|
31
|
+
* A header the Object does not hold leaves its field absent rather than
|
|
32
|
+
* present and undefined, so a caller can tell a header S3 has nothing to say
|
|
33
|
+
* about from one it reports as empty.
|
|
34
|
+
*/
|
|
35
|
+
export declare function simS3SystemMetadataOutput(headers: Readonly<Record<string, string>>): SimS3SystemMetadataOutput;
|
|
36
|
+
/**
|
|
37
|
+
* The headers to serve an Object with, from what a read of it answered.
|
|
38
|
+
*
|
|
39
|
+
* The endpoints that serve an Object read it through the ordinary GetObject
|
|
40
|
+
* command, so what they build a response from is the read's own fields. This
|
|
41
|
+
* puts them back under the header names the response carries.
|
|
42
|
+
*
|
|
43
|
+
* The values are checked on the way through, because a read output reaches
|
|
44
|
+
* here loosely typed from the SDK-facing router (which has only the command
|
|
45
|
+
* name to go on).
|
|
46
|
+
*/
|
|
47
|
+
export declare function simS3SystemMetadataHeadersFrom(output: Readonly<Partial<Record<SimS3SystemMetadataOutputField, unknown>>>): Record<string, string>;
|
|
48
|
+
/**
|
|
49
|
+
* The metadata a caller attached to an Object, under the keys it used.
|
|
50
|
+
*
|
|
51
|
+
* Stored under the `x-amz-meta-` prefix and answered without it, which is what
|
|
52
|
+
* real S3 does with a read's `Metadata`. A key naming a header S3 sets itself
|
|
53
|
+
* survives the round trip and stays out of the Object's own fields.
|
|
54
|
+
*/
|
|
55
|
+
export declare function simS3UserDefinedMetadata(headers: Readonly<Record<string, string>>): Record<string, string>;
|
|
56
|
+
//# sourceMappingURL=s3-system-metadata-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-system-metadata-read.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-system-metadata-read.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAE9B,MAAM,yBAAyB,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,MAAM,8BAA8B,GACtC,OAAO,CAAC,wBAAwB,EAAE,SAAS,CAAC,GAC5C,eAAe,CAAC;AAEpB;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,sDAAsD;IACtD,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;IACxB,yCAAyC;IACzC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACxC,yBAAyB,CAgB3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,8BAA8B,EAAE,OAAO,CAAC,CAAC,CAAC,GACzE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYxB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACxC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUxB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { simS3SystemMetadataHeaders, simS3UserMetadataPrefix, } from "./s3-system-metadata.js";
|
|
2
|
+
/**
|
|
3
|
+
* Describe an Object's stored headers as the fields a read of it carries.
|
|
4
|
+
*
|
|
5
|
+
* A header the Object does not hold leaves its field absent rather than
|
|
6
|
+
* present and undefined, so a caller can tell a header S3 has nothing to say
|
|
7
|
+
* about from one it reports as empty.
|
|
8
|
+
*/
|
|
9
|
+
export function simS3SystemMetadataOutput(headers) {
|
|
10
|
+
const output = {};
|
|
11
|
+
for (const header of simS3SystemMetadataHeaders) {
|
|
12
|
+
const value = headers[header.name];
|
|
13
|
+
if (value !== undefined) {
|
|
14
|
+
output[outputFieldOf(header)] = value;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (output.ExpiresString !== undefined) {
|
|
18
|
+
output.Expires = new Date(output.ExpiresString);
|
|
19
|
+
}
|
|
20
|
+
return output;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The headers to serve an Object with, from what a read of it answered.
|
|
24
|
+
*
|
|
25
|
+
* The endpoints that serve an Object read it through the ordinary GetObject
|
|
26
|
+
* command, so what they build a response from is the read's own fields. This
|
|
27
|
+
* puts them back under the header names the response carries.
|
|
28
|
+
*
|
|
29
|
+
* The values are checked on the way through, because a read output reaches
|
|
30
|
+
* here loosely typed from the SDK-facing router (which has only the command
|
|
31
|
+
* name to go on).
|
|
32
|
+
*/
|
|
33
|
+
export function simS3SystemMetadataHeadersFrom(output) {
|
|
34
|
+
const headers = {};
|
|
35
|
+
for (const header of simS3SystemMetadataHeaders) {
|
|
36
|
+
const value = output[outputFieldOf(header)];
|
|
37
|
+
if (typeof value === "string") {
|
|
38
|
+
headers[header.name] = value;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return headers;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The metadata a caller attached to an Object, under the keys it used.
|
|
45
|
+
*
|
|
46
|
+
* Stored under the `x-amz-meta-` prefix and answered without it, which is what
|
|
47
|
+
* real S3 does with a read's `Metadata`. A key naming a header S3 sets itself
|
|
48
|
+
* survives the round trip and stays out of the Object's own fields.
|
|
49
|
+
*/
|
|
50
|
+
export function simS3UserDefinedMetadata(headers) {
|
|
51
|
+
const metadata = {};
|
|
52
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
53
|
+
if (key.startsWith(simS3UserMetadataPrefix)) {
|
|
54
|
+
metadata[key.slice(simS3UserMetadataPrefix.length)] = value;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return metadata;
|
|
58
|
+
}
|
|
59
|
+
/** The output field a stored header is reported in. */
|
|
60
|
+
function outputFieldOf(header) {
|
|
61
|
+
if (header.field === "Expires") {
|
|
62
|
+
return "ExpiresString";
|
|
63
|
+
}
|
|
64
|
+
return header.field;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=s3-system-metadata-read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-system-metadata-read.js","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-system-metadata-read.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,GAGxB,MAAM,yBAAyB,CAAC;AAgCjC;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAyC;IAEzC,MAAM,MAAM,GAAqC,EAAE,CAAC;IAEpD,KAAK,MAAM,MAAM,IAAI,0BAA0B,EAAE,CAAC;QAChD,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEnC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC;QACxC,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QACvC,MAAM,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,8BAA8B,CAC5C,MAA0E;IAE1E,MAAM,OAAO,GAA2B,EAAE,CAAC;IAE3C,KAAK,MAAM,MAAM,IAAI,0BAA0B,EAAE,CAAC;QAChD,MAAM,KAAK,GAAG,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;QAE5C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,OAAyC;IAEzC,MAAM,QAAQ,GAA2B,EAAE,CAAC;IAE5C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACnD,IAAI,GAAG,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE,CAAC;YAC5C,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC;QAC9D,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,uDAAuD;AACvD,SAAS,aAAa,CACpB,MAAiC;IAEjC,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,OAAO,MAAM,CAAC,KAAK,CAAC;AACtB,CAAC"}
|
|
@@ -38,6 +38,23 @@ export type SimS3SystemMetadataValues = Partial<Record<SimS3SystemMetadataField,
|
|
|
38
38
|
* a deployment or the console guesses one from the file extension.
|
|
39
39
|
*/
|
|
40
40
|
export declare const simS3SystemMetadataHeaders: readonly SimS3SystemMetadataHeader[];
|
|
41
|
+
/**
|
|
42
|
+
* The prefix S3 carries user-defined metadata under.
|
|
43
|
+
*
|
|
44
|
+
* It is what keeps a caller's own key from colliding with a header S3 sets
|
|
45
|
+
* itself. A write attaching `content-type` as user metadata is stored under
|
|
46
|
+
* `x-amz-meta-content-type` and is a different thing from the Object's content
|
|
47
|
+
* type.
|
|
48
|
+
*/
|
|
49
|
+
export declare const simS3UserMetadataPrefix = "x-amz-meta-";
|
|
50
|
+
/**
|
|
51
|
+
* The type S3 gives an Object whose write named none.
|
|
52
|
+
*
|
|
53
|
+
* S3 guesses nothing from the key, so a `.txt` file uploaded without a content
|
|
54
|
+
* type is served as bytes. Tooling that appears to guess, such as `aws s3
|
|
55
|
+
* sync`, sets the header itself before the upload.
|
|
56
|
+
*/
|
|
57
|
+
export declare const simS3DefaultContentType = "binary/octet-stream";
|
|
41
58
|
/**
|
|
42
59
|
* Read system metadata written as headers back into the fields it is declared
|
|
43
60
|
* with.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3-system-metadata.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-system-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,qBAAa,yBAAyB;aAElB,KAAK,EAAE,wBAAwB;aAC/B,IAAI,EAAE,MAAM;IAF9B,YACkB,KAAK,EAAE,wBAAwB,EAC/B,IAAI,EAAE,MAAM,EAC1B;CACL;AAED;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAChC,cAAc,GACd,oBAAoB,GACpB,iBAAiB,GACjB,iBAAiB,GACjB,aAAa,GACb,SAAS,CAAC;AAEd;;;;;;;GAOG;AACH,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,MAAM,CAAC,wBAAwB,EAAE,MAAM,CAAC,CACzC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,yBAAyB,EAQxE,CAAC;AAEJ;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,yBAAyB,CAY3B"}
|
|
1
|
+
{"version":3,"file":"s3-system-metadata.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-system-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,qBAAa,yBAAyB;aAElB,KAAK,EAAE,wBAAwB;aAC/B,IAAI,EAAE,MAAM;IAF9B,YACkB,KAAK,EAAE,wBAAwB,EAC/B,IAAI,EAAE,MAAM,EAC1B;CACL;AAED;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAChC,cAAc,GACd,oBAAoB,GACpB,iBAAiB,GACjB,iBAAiB,GACjB,aAAa,GACb,SAAS,CAAC;AAEd;;;;;;;GAOG;AACH,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,MAAM,CAAC,wBAAwB,EAAE,MAAM,CAAC,CACzC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,yBAAyB,EAQxE,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,gBAAgB,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAE7D;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,yBAAyB,CAY3B"}
|
|
@@ -32,6 +32,23 @@ export const simS3SystemMetadataHeaders = [
|
|
|
32
32
|
new SimS3SystemMetadataHeader("ContentType", "content-type"),
|
|
33
33
|
new SimS3SystemMetadataHeader("Expires", "expires"),
|
|
34
34
|
];
|
|
35
|
+
/**
|
|
36
|
+
* The prefix S3 carries user-defined metadata under.
|
|
37
|
+
*
|
|
38
|
+
* It is what keeps a caller's own key from colliding with a header S3 sets
|
|
39
|
+
* itself. A write attaching `content-type` as user metadata is stored under
|
|
40
|
+
* `x-amz-meta-content-type` and is a different thing from the Object's content
|
|
41
|
+
* type.
|
|
42
|
+
*/
|
|
43
|
+
export const simS3UserMetadataPrefix = "x-amz-meta-";
|
|
44
|
+
/**
|
|
45
|
+
* The type S3 gives an Object whose write named none.
|
|
46
|
+
*
|
|
47
|
+
* S3 guesses nothing from the key, so a `.txt` file uploaded without a content
|
|
48
|
+
* type is served as bytes. Tooling that appears to guess, such as `aws s3
|
|
49
|
+
* sync`, sets the header itself before the upload.
|
|
50
|
+
*/
|
|
51
|
+
export const simS3DefaultContentType = "binary/octet-stream";
|
|
35
52
|
/**
|
|
36
53
|
* Read system metadata written as headers back into the fields it is declared
|
|
37
54
|
* with.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3-system-metadata.js","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-system-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,OAAO,yBAAyB;IAElB,KAAK;IACL,IAAI;IAFtB,YACkB,KAA+B,EAC/B,IAAY;qBADZ,KAAK;oBACL,IAAI;IACnB,CAAC;CACL;AA4BD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GACrC;IACE,IAAI,yBAAyB,CAAC,cAAc,EAAE,eAAe,CAAC;IAC9D,IAAI,yBAAyB,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;IAC1E,IAAI,yBAAyB,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;IACpE,IAAI,yBAAyB,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;IACpE,IAAI,yBAAyB,CAAC,aAAa,EAAE,cAAc,CAAC;IAC5D,IAAI,yBAAyB,CAAC,SAAS,EAAE,SAAS,CAAC;CACpD,CAAC;AAEJ;;;;;;;;GAQG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAoC;IAEpC,MAAM,MAAM,GAA8B,EAAE,CAAC;IAE7C,KAAK,MAAM,MAAM,IAAI,0BAA0B,EAAE,CAAC;QAChD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEvC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"s3-system-metadata.js","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-system-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,OAAO,yBAAyB;IAElB,KAAK;IACL,IAAI;IAFtB,YACkB,KAA+B,EAC/B,IAAY;qBADZ,KAAK;oBACL,IAAI;IACnB,CAAC;CACL;AA4BD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GACrC;IACE,IAAI,yBAAyB,CAAC,cAAc,EAAE,eAAe,CAAC;IAC9D,IAAI,yBAAyB,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;IAC1E,IAAI,yBAAyB,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;IACpE,IAAI,yBAAyB,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;IACpE,IAAI,yBAAyB,CAAC,aAAa,EAAE,cAAc,CAAC;IAC5D,IAAI,yBAAyB,CAAC,SAAS,EAAE,SAAS,CAAC;CACpD,CAAC;AAEJ;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAE7D;;;;;;;;GAQG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAoC;IAEpC,MAAM,MAAM,GAA8B,EAAE,CAAC;IAE7C,KAAK,MAAM,MAAM,IAAI,0BAA0B,EAAE,CAAC;QAChD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEvC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -23,11 +23,15 @@ export interface SimS3ObjectWriteMetadata {
|
|
|
23
23
|
/**
|
|
24
24
|
* Convert the metadata members of a write into what an Object stores.
|
|
25
25
|
*
|
|
26
|
-
* User-defined metadata is
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
26
|
+
* User-defined metadata is stored under the `x-amz-meta-` prefix S3 carries it
|
|
27
|
+
* with, which keeps a caller's own `content-type` key apart from the Object's
|
|
28
|
+
* content type. System metadata is read by the same list of headers a read
|
|
29
|
+
* returns, under the lowercase key that read looks the value up by, so a write
|
|
30
|
+
* and a read agree on what S3 remembers about an Object. An omitted header
|
|
31
|
+
* leaves its key absent rather than assigning an undefined value.
|
|
32
|
+
*
|
|
33
|
+
* Content type is the exception, because S3 gives an Object one whether the
|
|
34
|
+
* write named it or not.
|
|
31
35
|
*/
|
|
32
36
|
export declare function simS3WriteMetadata(input: SimS3ObjectWriteMetadata): SimS3ObjectMetadata;
|
|
33
37
|
//# sourceMappingURL=s3-write-metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3-write-metadata.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-write-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"s3-write-metadata.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-write-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAOrD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IACvD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACrC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,wBAAwB,GAC9B,mBAAmB,CAmBrB"}
|
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
import { SimS3ObjectMetadata } from "./s3-object.js";
|
|
2
|
-
import { simS3SystemMetadataHeaders } from "./s3-system-metadata.js";
|
|
2
|
+
import { simS3DefaultContentType, simS3SystemMetadataHeaders, simS3UserMetadataPrefix, } from "./s3-system-metadata.js";
|
|
3
3
|
/**
|
|
4
4
|
* Convert the metadata members of a write into what an Object stores.
|
|
5
5
|
*
|
|
6
|
-
* User-defined metadata is
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* User-defined metadata is stored under the `x-amz-meta-` prefix S3 carries it
|
|
7
|
+
* with, which keeps a caller's own `content-type` key apart from the Object's
|
|
8
|
+
* content type. System metadata is read by the same list of headers a read
|
|
9
|
+
* returns, under the lowercase key that read looks the value up by, so a write
|
|
10
|
+
* and a read agree on what S3 remembers about an Object. An omitted header
|
|
11
|
+
* leaves its key absent rather than assigning an undefined value.
|
|
12
|
+
*
|
|
13
|
+
* Content type is the exception, because S3 gives an Object one whether the
|
|
14
|
+
* write named it or not.
|
|
11
15
|
*/
|
|
12
16
|
export function simS3WriteMetadata(input) {
|
|
13
|
-
const metadata = {
|
|
17
|
+
const metadata = {};
|
|
18
|
+
const userDefined = Object.entries(input.Metadata ?? {});
|
|
19
|
+
for (const [key, value] of userDefined) {
|
|
20
|
+
metadata[`${simS3UserMetadataPrefix}${key}`] = value;
|
|
21
|
+
}
|
|
14
22
|
for (const header of simS3SystemMetadataHeaders) {
|
|
15
23
|
const value = metadataValue(input[header.field]);
|
|
16
24
|
if (value !== undefined) {
|
|
17
25
|
metadata[header.name] = value;
|
|
18
26
|
}
|
|
19
27
|
}
|
|
28
|
+
metadata["content-type"] ??= simS3DefaultContentType;
|
|
20
29
|
return new SimS3ObjectMetadata(metadata);
|
|
21
30
|
}
|
|
22
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3-write-metadata.js","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-write-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,
|
|
1
|
+
{"version":3,"file":"s3-write-metadata.js","sourceRoot":"","sources":["../../../../src/service/s3/object/s3-write-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAwBjC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAA+B;IAE/B,MAAM,QAAQ,GAA2B,EAAE,CAAC;IAC5C,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;IAEzD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,WAAW,EAAE,CAAC;QACvC,QAAQ,CAAC,GAAG,uBAAuB,GAAG,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;IACvD,CAAC;IAED,KAAK,MAAM,MAAM,IAAI,0BAA0B,EAAE,CAAC;QAChD,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAEjD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QAChC,CAAC;IACH,CAAC;IAED,QAAQ,CAAC,cAAc,CAAC,KAAK,uBAAuB,CAAC;IAErD,OAAO,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;GAMG;AACH,SAAS,aAAa,CAAC,KAAgC;IACrD,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-s3-api-head-output.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/serve/api/sim-s3-api-head-output.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sim-s3-api-head-output.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/serve/api/sim-s3-api-head-output.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,QAAQ,CAUV;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,QAAQ,CAQV"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { simS3ObjectResponseHeaders } from "../../object/s3-object-response-headers.js";
|
|
2
|
+
import { simS3SystemMetadataHeadersFrom } from "../../object/s3-system-metadata-read.js";
|
|
2
3
|
/**
|
|
3
4
|
* The responses a HEAD is answered with.
|
|
4
5
|
*
|
|
@@ -16,7 +17,7 @@ export function simS3HeadObjectResponse(output) {
|
|
|
16
17
|
return new Response(undefined, {
|
|
17
18
|
status: 200,
|
|
18
19
|
headers: simS3ObjectResponseHeaders({
|
|
19
|
-
metadata: output
|
|
20
|
+
metadata: simS3SystemMetadataHeadersFrom(output),
|
|
20
21
|
bodyLength: output["ContentLength"] ?? 0,
|
|
21
22
|
etag: output["ETag"],
|
|
22
23
|
lastModified: output["LastModified"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-s3-api-head-output.js","sourceRoot":"","sources":["../../../../../src/service/s3/serve/api/sim-s3-api-head-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-s3-api-head-output.js","sourceRoot":"","sources":["../../../../../src/service/s3/serve/api/sim-s3-api-head-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAEzF;;;;;;GAMG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAA+B;IAE/B,OAAO,IAAI,QAAQ,CAAC,SAAS,EAAE;QAC7B,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,0BAA0B,CAAC;YAClC,QAAQ,EAAE,8BAA8B,CAAC,MAAM,CAAC;YAChD,UAAU,EAAG,MAAM,CAAC,eAAe,CAAwB,IAAI,CAAC;YAChE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAuB;YAC1C,YAAY,EAAE,MAAM,CAAC,cAAc,CAAqB;SACzD,CAAC;KACH,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAA+B;IAE/B,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;IAEtC,OAAO,IAAI,QAAQ,CAAC,SAAS,EAAE;QAC7B,MAAM,EAAE,GAAG;QACX,OAAO,EACL,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE;KACtE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-s3-api-object-output.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/serve/api/sim-s3-api-object-output.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sim-s3-api-object-output.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/serve/api/sim-s3-api-object-output.ts"],"names":[],"mappings":"AAIA,UAAU,gBAAgB;IACxB,QAAQ,CAAC,gBAAgB,CAAC,EACtB;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,CAAA;KAAE,GACxD,SAAS,CAAC;CACf;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAQnE;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,QAAQ,CAAC,CAcnB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { xmlDocument, xmlValue } from "../../../../util/xml/xml-writer.js";
|
|
2
2
|
import { simS3ObjectResponseHeaders } from "../../object/s3-object-response-headers.js";
|
|
3
|
+
import { simS3SystemMetadataHeadersFrom } from "../../object/s3-system-metadata-read.js";
|
|
3
4
|
/**
|
|
4
5
|
* Write a finished copy as the document real S3 answers it with.
|
|
5
6
|
*
|
|
@@ -25,7 +26,7 @@ export async function simS3GetObjectResponse(output) {
|
|
|
25
26
|
return new Response(body, {
|
|
26
27
|
status: contentRange === undefined ? 200 : 206,
|
|
27
28
|
headers: simS3ObjectResponseHeaders({
|
|
28
|
-
metadata: output
|
|
29
|
+
metadata: simS3SystemMetadataHeadersFrom(output),
|
|
29
30
|
bodyLength: body.length,
|
|
30
31
|
etag: output["ETag"],
|
|
31
32
|
lastModified: output["LastModified"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-s3-api-object-output.js","sourceRoot":"","sources":["../../../../../src/service/s3/serve/api/sim-s3-api-object-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-s3-api-object-output.js","sourceRoot":"","sources":["../../../../../src/service/s3/serve/api/sim-s3-api-object-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAQzF;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAwB;IACzD,MAAM,MAAM,GAAG,MAAM,CAAC,gBAAgB,IAAI,EAAE,CAAC;IAE7C,OAAO,WAAW,CAChB,kBAAkB,EAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC;QAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC,YAAY,CAAC,CAChD,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAA+B;IAE/B,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACnD,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,CAAuB,CAAC;IAElE,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE;QACxB,MAAM,EAAE,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;QAC9C,OAAO,EAAE,0BAA0B,CAAC;YAClC,QAAQ,EAAE,8BAA8B,CAAC,MAAM,CAAC;YAChD,UAAU,EAAE,IAAI,CAAC,MAAM;YACvB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAuB;YAC1C,YAAY,EAAE,MAAM,CAAC,cAAc,CAAqB;YACxD,YAAY;SACb,CAAC;KACH,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,eAAe,CAAC,IAAa;IAC1C,2DAA2D;IAC3D,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,IAAiC,EAAE,CAAC;QAC5D,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-s3-rest-object-reader.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/serve/sim-s3-rest-object-reader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-s3-rest-object-reader.d.ts","sourceRoot":"","sources":["../../../../src/service/s3/serve/sim-s3-rest-object-reader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAIhG;;;;;;;;;;;GAWG;AACH,qBAAa,qBAAqB;IAChC;;OAEG;IACG,IAAI,CACR,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,oBAAoB,EAC3B,cAAc,EAAE,oBAAoB,GACnC,OAAO,CAAC,QAAQ,CAAC,CAgCnB;CACF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { simS3ObjectResponseHeaders } from "../object/s3-object-response-headers.js";
|
|
2
|
+
import { simS3SystemMetadataHeadersFrom } from "../object/s3-system-metadata-read.js";
|
|
2
3
|
/**
|
|
3
4
|
* Answers a `GET` or `HEAD` at the simulated S3 REST endpoint.
|
|
4
5
|
*
|
|
@@ -27,7 +28,7 @@ export class SimS3RestObjectReader {
|
|
|
27
28
|
}, { caller: serviceRequest.caller.toCaller() });
|
|
28
29
|
const body = await bodyBytes(output.Body);
|
|
29
30
|
const headers = simS3ObjectResponseHeaders({
|
|
30
|
-
metadata: output
|
|
31
|
+
metadata: simS3SystemMetadataHeadersFrom(output),
|
|
31
32
|
bodyLength: body.length,
|
|
32
33
|
etag: output.ETag,
|
|
33
34
|
lastModified: output.LastModified,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-s3-rest-object-reader.js","sourceRoot":"","sources":["../../../../src/service/s3/serve/sim-s3-rest-object-reader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-s3-rest-object-reader.js","sourceRoot":"","sources":["../../../../src/service/s3/serve/sim-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AAI,QAAQ,CAAC,IAAI,EAAE;YACxB,MAAM,EAAE,MAAM,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;YACrD,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF;AAED;;GAEG;AACH,KAAK,UAAU,SAAS,CACtB,IAAsE;IAEtE,2DAA2D;IAC3D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAmB,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-s3-website-object-loader.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/serve/website/sim-s3-website-object-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AACnG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-s3-website-object-loader.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/serve/website/sim-s3-website-object-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AACnG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,UAAU,kCAAkC;IAC1C,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkB;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IAEtC,YAAY,UAAU,EAAE,kCAAkC,EAIzD;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,CACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,iBAAiB,EACxB,cAAc,EAAE,oBAAoB,GACnC,wBAAwB,CAW1B;IAED;;;;;OAKG;IACG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAoBrE;IAED;;;;;;;;OAQG;IACG,eAAe,CACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAUzC;CACF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SimIamAccessDenied } from "../../../iam/error/sim-iam.error.js";
|
|
2
2
|
import { SimS3NoSuchKey } from "../../error/sim-s3.error.js";
|
|
3
|
+
import { simS3SystemMetadataHeadersFrom } from "../../object/s3-system-metadata-read.js";
|
|
3
4
|
import { simS3BodyToBuffer } from "../../storage/s3-body-buffer.js";
|
|
4
5
|
import { SimS3WebsiteObject } from "./sim-s3-website-object.js";
|
|
5
6
|
/**
|
|
@@ -44,7 +45,7 @@ export class SimS3WebsiteObjectLoader {
|
|
|
44
45
|
const output = await this.simS3.getObject({ input: { Bucket: this.bucketName, Key: objectKey } }, { caller: this.caller });
|
|
45
46
|
return new SimS3WebsiteObject({
|
|
46
47
|
body: await simS3BodyToBuffer(output.Body),
|
|
47
|
-
metadata: output
|
|
48
|
+
metadata: simS3SystemMetadataHeadersFrom(output),
|
|
48
49
|
etag: output.ETag,
|
|
49
50
|
lastModified: output.LastModified,
|
|
50
51
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-s3-website-object-loader.js","sourceRoot":"","sources":["../../../../../src/service/s3/serve/website/sim-s3-website-object-loader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAGzE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-s3-website-object-loader.js","sourceRoot":"","sources":["../../../../../src/service/s3/serve/website/sim-s3-website-object-loader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAGzE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAEzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAQhE;;;;;;;;GAQG;AACH,MAAM,OAAO,wBAAwB;IAClB,KAAK,CAAQ;IACb,UAAU,CAAkB;IAC5B,MAAM,CAAe;IAEtC,YAAY,UAA8C;QACxD,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9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iB;QAEjB,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,kBAAkB,EAAE,CAAC;gBACxC,OAAO,SAAS,CAAC;YACnB,CAAC;YAED,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3-filesystem-object-metadata.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/storage/filesystem/s3-filesystem-object-metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"s3-filesystem-object-metadata.d.ts","sourceRoot":"","sources":["../../../../../src/service/s3/storage/filesystem/s3-filesystem-object-metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,MAAM,EACX,eAAe,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,GACrD,mBAAmB,CAUrB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { SimS3ObjectMetadata } from "../../object/s3-object.js";
|
|
3
|
+
import { simS3DefaultContentType } from "../../object/s3-system-metadata.js";
|
|
3
4
|
/**
|
|
4
5
|
* Make up reasonable metadata for an Object based on the file on disk.
|
|
5
6
|
*
|
|
@@ -11,10 +12,10 @@ import { SimS3ObjectMetadata } from "../../object/s3-object.js";
|
|
|
11
12
|
export function metadataForFilesystemS3ObjectKey(key, declaredHeaders = {}) {
|
|
12
13
|
return new SimS3ObjectMetadata({
|
|
13
14
|
// Octet-stream for anything the table below has never heard of, which is
|
|
14
|
-
// what S3 reports for an
|
|
15
|
+
// what S3 reports for an Object whose type it was never told. That case
|
|
15
16
|
// arrives by way of `additionalFileExtensions`: the table is the web's own
|
|
16
17
|
// types, and the option exists for files that are not one of them.
|
|
17
|
-
"content-type": contentTypeForFilesystemS3ObjectKey(key) ??
|
|
18
|
+
"content-type": contentTypeForFilesystemS3ObjectKey(key) ?? simS3DefaultContentType,
|
|
18
19
|
...declaredHeaders,
|
|
19
20
|
});
|
|
20
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3-filesystem-object-metadata.js","sourceRoot":"","sources":["../../../../../src/service/s3/storage/filesystem/s3-filesystem-object-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"s3-filesystem-object-metadata.js","sourceRoot":"","sources":["../../../../../src/service/s3/storage/filesystem/s3-filesystem-object-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E;;;;;;;GAOG;AACH,MAAM,UAAU,gCAAgC,CAC9C,GAAW,EACX,eAAe,GAAqC,EAAE;IAEtD,OAAO,IAAI,mBAAmB,CAAC;QAC7B,yEAAyE;QACzE,wEAAwE;QACxE,2EAA2E;QAC3E,mEAAmE;QACnE,cAAc,EACZ,mCAAmC,CAAC,GAAG,CAAC,IAAI,uBAAuB;QACrE,GAAG,eAAe;KACnB,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAS,mCAAmC,CAAC,GAAW;IACtD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;IAElD,OAAO,uBAAuB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAChD,CA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