exlo 0.0.1
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/cli.d.ts +2 -0
- package/dist/cli.mjs +11 -0
- package/dist/config.d.ts +35 -0
- package/dist/defineConfig.d.ts +125 -0
- package/dist/defineConfig.mjs +1 -0
- package/dist/lib/esbuild/buildOptimizer.d.ts +9 -0
- package/dist/lib/esbuild/knownCjs.d.ts +1 -0
- package/dist/lib/esbuild/mergeEsbuildConfig.d.ts +2 -0
- package/dist/lib/esbuild/parseCustomEsbuild.d.ts +2 -0
- package/dist/lib/parseEvents/ddbStream.d.ts +17 -0
- package/dist/lib/parseEvents/endpoints.d.ts +29 -0
- package/dist/lib/parseEvents/funcUrl.d.ts +2 -0
- package/dist/lib/parseEvents/index.d.ts +16 -0
- package/dist/lib/parseEvents/sqs.d.ts +11 -0
- package/dist/lib/runtime/bufferedStreamResponse.d.ts +24 -0
- package/dist/lib/runtime/callDestinations.d.ts +12 -0
- package/dist/lib/runtime/eventSourceMapping/base.d.ts +66 -0
- package/dist/lib/runtime/eventSourceMapping/base.mjs +1 -0
- package/dist/lib/runtime/eventSourceMapping/errors/eventSourceMappingError.d.ts +5 -0
- package/dist/lib/runtime/eventSourceMapping/esmBatch.d.ts +15 -0
- package/dist/lib/runtime/eventSourceMapping/filter/compileFilterPolicy.d.ts +12 -0
- package/dist/lib/runtime/eventSourceMapping/filter/compileFilterPolicy.test.d.ts +1 -0
- package/dist/lib/runtime/eventSourceMapping/filter/compileWildcard.d.ts +1 -0
- package/dist/lib/runtime/eventSourceMapping/filter/compileWildcard.test.d.ts +1 -0
- package/dist/lib/runtime/eventSourceMapping/filter/expandDotPathsWithStrictConflicts.d.ts +1 -0
- package/dist/lib/runtime/eventSourceMapping/filter/expandDotPathsWithStrictConflicts.test.d.ts +1 -0
- package/dist/lib/runtime/eventSourceMapping/filter/matchesFilterPolicy.d.ts +2 -0
- package/dist/lib/runtime/eventSourceMapping/filter/matchesFilterPolicy.test.d.ts +1 -0
- package/dist/lib/runtime/eventSourceMapping/sqs.d.ts +19 -0
- package/dist/lib/runtime/eventSourceMapping/utils.d.ts +6 -0
- package/dist/lib/runtime/rapidApi.d.ts +97 -0
- package/dist/lib/runtime/runners/index.d.ts +25 -0
- package/dist/lib/runtime/runners/node/awslambda.d.ts +11 -0
- package/dist/lib/runtime/runners/node/index.d.ts +1 -0
- package/dist/lib/runtime/runners/node/index.js +19 -0
- package/dist/lib/runtime/runners/node/runner.d.ts +34 -0
- package/dist/lib/runtime/runners/node/streamResponse.d.ts +90 -0
- package/dist/lib/runtime/runners/node/utils.d.ts +39 -0
- package/dist/lib/runtime/runners/python/runner.d.ts +48 -0
- package/dist/lib/runtime/runners/ruby/runner.d.ts +43 -0
- package/dist/lib/server/daemon.d.ts +27 -0
- package/dist/lib/server/handlers.d.ts +13 -0
- package/dist/lib/services/index.d.ts +10 -0
- package/dist/lib/utils/amazonifyHeaders.d.ts +3 -0
- package/dist/lib/utils/colorize.d.ts +12 -0
- package/dist/lib/utils/getPackageInstalledDir.d.ts +1 -0
- package/dist/lib/utils/readDefineConfig.d.ts +6 -0
- package/dist/main.d.ts +80 -0
- package/dist/plugins/lambda/events/alb.d.ts +44 -0
- package/dist/plugins/lambda/events/apg.d.ts +111 -0
- package/dist/plugins/lambda/events/common.d.ts +114 -0
- package/dist/plugins/lambda/functionUrlInvoke.d.ts +3 -0
- package/dist/plugins/lambda/htmlStatusMsg.d.ts +4 -0
- package/dist/plugins/lambda/index.d.ts +3 -0
- package/dist/plugins/lambda/invokeRequests.d.ts +3 -0
- package/dist/plugins/lambda/lambdaApi.d.ts +6 -0
- package/dist/plugins/lambda/responseStreamingInvoke.d.ts +3 -0
- package/dist/plugins/lambda/streamEncoder.d.ts +19 -0
- package/dist/plugins/lambda/utils.d.ts +29 -0
- package/dist/plugins/restApi/compileAjvSchema.d.ts +1 -0
- package/dist/plugins/restApi/errors.d.ts +32 -0
- package/dist/plugins/restApi/findRequestResource.d.ts +9 -0
- package/dist/plugins/restApi/findRequestResource.test.d.ts +1 -0
- package/dist/plugins/restApi/index.d.ts +8 -0
- package/dist/plugins/restApi/index.mjs +1 -0
- package/dist/plugins/restApi/resourcesFromOpenApi.d.ts +4 -0
- package/dist/plugins/restApi/restApiServer.d.ts +265 -0
- package/dist/plugins/restApi/restApiServer.test.d.ts +1 -0
- package/dist/plugins/restApi/utils.d.ts +9 -0
- package/dist/plugins/s3/actions/AbortMultipartUploadAction.d.ts +10 -0
- package/dist/plugins/s3/actions/CompleteMultipartUploadAction.d.ts +15 -0
- package/dist/plugins/s3/actions/CopyObjectAction.d.ts +24 -0
- package/dist/plugins/s3/actions/CreateBucketAction.d.ts +8 -0
- package/dist/plugins/s3/actions/CreateMultipartUploadAction.d.ts +13 -0
- package/dist/plugins/s3/actions/DeleteBucketAction.d.ts +8 -0
- package/dist/plugins/s3/actions/DeleteBucketPolicyAction.d.ts +8 -0
- package/dist/plugins/s3/actions/DeleteBucketTaggingAction.d.ts +8 -0
- package/dist/plugins/s3/actions/DeleteObjectAction.d.ts +10 -0
- package/dist/plugins/s3/actions/DeleteObjectTaggingAction.d.ts +9 -0
- package/dist/plugins/s3/actions/DeleteObjectsAction.d.ts +8 -0
- package/dist/plugins/s3/actions/GetBucketAclAction.d.ts +8 -0
- package/dist/plugins/s3/actions/GetBucketPolicy.d.ts +8 -0
- package/dist/plugins/s3/actions/GetBucketTaggingAction.d.ts +8 -0
- package/dist/plugins/s3/actions/GetObjectAclAction.d.ts +8 -0
- package/dist/plugins/s3/actions/GetObjectAction.d.ts +30 -0
- package/dist/plugins/s3/actions/GetObjectTaggingAction.d.ts +10 -0
- package/dist/plugins/s3/actions/HeadBucketAction.d.ts +8 -0
- package/dist/plugins/s3/actions/HeadObjectAction.d.ts +18 -0
- package/dist/plugins/s3/actions/ListBucketsAction.d.ts +15 -0
- package/dist/plugins/s3/actions/ListMultipartUploadsAction.d.ts +19 -0
- package/dist/plugins/s3/actions/ListObjectsAction.d.ts +31 -0
- package/dist/plugins/s3/actions/ListPartsAction.d.ts +14 -0
- package/dist/plugins/s3/actions/PutBucketAclAction.d.ts +11 -0
- package/dist/plugins/s3/actions/PutBucketCorsAction.d.ts +8 -0
- package/dist/plugins/s3/actions/PutBucketPolicyAction.d.ts +9 -0
- package/dist/plugins/s3/actions/PutBucketTaggingAction.d.ts +8 -0
- package/dist/plugins/s3/actions/PutObjectAclAction.d.ts +8 -0
- package/dist/plugins/s3/actions/PutObjectAction.d.ts +22 -0
- package/dist/plugins/s3/actions/PutObjectTaggingAction.d.ts +9 -0
- package/dist/plugins/s3/actions/UnknownAction.d.ts +7 -0
- package/dist/plugins/s3/actions/UploadPartAction.d.ts +12 -0
- package/dist/plugins/s3/actions/localAction.d.ts +92 -0
- package/dist/plugins/s3/calulcateETag.d.ts +1 -0
- package/dist/plugins/s3/commons/constants.d.ts +6 -0
- package/dist/plugins/s3/commons/utils.d.ts +3 -0
- package/dist/plugins/s3/errors/notFound.d.ts +8 -0
- package/dist/plugins/s3/errors/s3Error.d.ts +65 -0
- package/dist/plugins/s3/getLocalStoragePath.d.ts +1 -0
- package/dist/plugins/s3/index.d.ts +32 -0
- package/dist/plugins/s3/index.mjs +97 -0
- package/dist/plugins/s3/lib/createS3Server.d.ts +38 -0
- package/dist/plugins/s3/parsers/parseDeleteRequest.d.ts +10 -0
- package/dist/plugins/s3/parsers/parseGetRequest.d.ts +14 -0
- package/dist/plugins/s3/parsers/parseHeadRequest.d.ts +5 -0
- package/dist/plugins/s3/parsers/parsePostRequest.d.ts +7 -0
- package/dist/plugins/s3/parsers/parsePutRequest.d.ts +14 -0
- package/dist/plugins/s3/triggerEvent.d.ts +12 -0
- package/dist/plugins/sns/errors.d.ts +26 -0
- package/dist/plugins/sns/filter.d.ts +1 -0
- package/dist/plugins/sns/filter.test.d.ts +1 -0
- package/dist/plugins/sns/index.d.ts +23 -0
- package/dist/plugins/sns/index.mjs +106 -0
- package/dist/plugins/sns/parsers/parseCreateTopic.d.ts +2 -0
- package/dist/plugins/sns/parsers/parseMessage.d.ts +18 -0
- package/dist/plugins/sns/parsers/parsePublishMessage.d.ts +6 -0
- package/dist/plugins/sns/parsers/parsePublishMessageBatch.d.ts +9 -0
- package/dist/plugins/sns/parsers/parseSubscribe.d.ts +17 -0
- package/dist/plugins/sns/parsers/parseSubscriptionArn.d.ts +6 -0
- package/dist/plugins/sns/parsers/parseTopicArn.d.ts +4 -0
- package/dist/plugins/sns/server.d.ts +36 -0
- package/dist/plugins/sns/server.test.d.ts +1 -0
- package/dist/plugins/sns/subscriber/index.d.ts +61 -0
- package/dist/plugins/sns/subscriber/validateConfig.d.ts +0 -0
- package/dist/plugins/sns/topic.d.ts +91 -0
- package/dist/plugins/sns/utils.d.ts +20 -0
- package/dist/plugins/sns/validateFilterPolicy.d.ts +19 -0
- package/dist/plugins/sns/validateFilterPolicy.test.d.ts +1 -0
- package/dist/plugins/sqs/index.d.ts +16 -0
- package/dist/plugins/sqs/index.mjs +1 -0
- package/dist/plugins/sqs/types.d.ts +11 -0
- package/dist/plugins/sqs/utils.d.ts +7 -0
- package/dist/plugins/vitest/coverage.d.ts +6 -0
- package/dist/plugins/vitest/index.d.ts +29 -0
- package/dist/plugins/vitest/index.mjs +1 -0
- package/dist/standalone.d.ts +17 -0
- package/dist/standalone.js +13 -0
- package/dist/standalone.mjs +13 -0
- package/dist/standalone_types.d.ts +190 -0
- package/package.json +119 -0
- package/src/lib/runtime/runners/python/index.py +105 -0
- package/src/lib/runtime/runners/ruby/index.rb +67 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
3
|
+
export declare class CreateBucketAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
+
exec(res: ServerResponse): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
2
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "http";
|
|
3
|
+
export declare class CreateMultipartUploadAction extends S3GenericAction {
|
|
4
|
+
private url;
|
|
5
|
+
private headers;
|
|
6
|
+
localService: S3LocalService;
|
|
7
|
+
bucket: string;
|
|
8
|
+
key: string;
|
|
9
|
+
version: string | null;
|
|
10
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
11
|
+
private generateUploadId;
|
|
12
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
export declare class DeleteBucketAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
+
exec(res: ServerResponse): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
2
|
+
import type { IncomingHttpHeaders, ServerResponse } from "http";
|
|
3
|
+
export declare class DeleteBucketPolicyAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
+
exec(res: ServerResponse): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
2
|
+
import type { IncomingHttpHeaders, ServerResponse } from "http";
|
|
3
|
+
export declare class DeleteBucketTaggingAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
+
exec(res: ServerResponse): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
2
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "http";
|
|
3
|
+
export declare class DeleteObjectAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
key: string;
|
|
7
|
+
version: string | null;
|
|
8
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
9
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
export declare class DeleteObjectTaggingAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
key: string;
|
|
7
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
8
|
+
exec(res: ServerResponse): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "http";
|
|
2
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
3
|
+
export declare class DeleteObjectsAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
export declare class GetBucketAclAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
+
exec(res: ServerResponse): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
export declare class GetBucketPolicyAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
+
exec(res: ServerResponse): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
3
|
+
export declare class GetBucketTaggingAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
+
exec(res: ServerResponse): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
export declare class GetObjectAclAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
+
exec(res: ServerResponse): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { S3GenericAction } from "./localAction";
|
|
2
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
3
|
+
import type { LocalS3Object, S3LocalService } from "./localAction";
|
|
4
|
+
export declare const checkS3Conditions: ({ ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, }: {
|
|
5
|
+
ifMatch?: string;
|
|
6
|
+
ifNoneMatch?: string;
|
|
7
|
+
ifModifiedSince?: number;
|
|
8
|
+
ifUnmodifiedSince?: number;
|
|
9
|
+
}, { ETag, LastModified }: LocalS3Object) => 200 | {
|
|
10
|
+
statusCode: number;
|
|
11
|
+
Code: string;
|
|
12
|
+
Condition: string;
|
|
13
|
+
};
|
|
14
|
+
export declare class GetObjectAction extends S3GenericAction {
|
|
15
|
+
localService: S3LocalService;
|
|
16
|
+
bucketPath: string;
|
|
17
|
+
bucket: string;
|
|
18
|
+
key: string;
|
|
19
|
+
versionId: string | null;
|
|
20
|
+
partNumber: number | null;
|
|
21
|
+
hasPartNumber: boolean;
|
|
22
|
+
hasRange: boolean;
|
|
23
|
+
range?: [number, number];
|
|
24
|
+
ifMatch?: string;
|
|
25
|
+
ifNoneMatch?: string;
|
|
26
|
+
ifModifiedSince?: number;
|
|
27
|
+
ifUnmodifiedSince?: number;
|
|
28
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
29
|
+
exec(res: ServerResponse): Promise<void>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
3
|
+
export declare class GetObjectTaggingAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
key: string;
|
|
7
|
+
versionId: string | null;
|
|
8
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
9
|
+
exec(res: ServerResponse): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
export declare class HeadBucketAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
+
exec(res: ServerResponse): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
export declare class HeadObjectAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
filePath: string;
|
|
6
|
+
bucketPath: string;
|
|
7
|
+
bucket: string;
|
|
8
|
+
key: string;
|
|
9
|
+
versionId: string | null;
|
|
10
|
+
partNumber: number | null;
|
|
11
|
+
range?: [number, number];
|
|
12
|
+
ifMatch?: string;
|
|
13
|
+
ifNoneMatch?: string;
|
|
14
|
+
ifModifiedSince?: number;
|
|
15
|
+
ifUnmodifiedSince?: number;
|
|
16
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
17
|
+
exec(res: ServerResponse): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
export declare class ListBucketsAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucketRegion?: string;
|
|
6
|
+
continuationToken?: string;
|
|
7
|
+
rawMaxBuckets?: string;
|
|
8
|
+
prefix?: string;
|
|
9
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
10
|
+
private isValidToken;
|
|
11
|
+
private isValidRequest;
|
|
12
|
+
private createContinuationToken;
|
|
13
|
+
private getBucketNames;
|
|
14
|
+
exec(res: ServerResponse): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
export declare class ListMultipartUploadsAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
delimiter: string | null;
|
|
7
|
+
encodingType: string | null;
|
|
8
|
+
hasEncodingType: boolean;
|
|
9
|
+
maxUploads: string;
|
|
10
|
+
hasMaxUploads: boolean;
|
|
11
|
+
prefix: string | null;
|
|
12
|
+
keyMarker: string | null;
|
|
13
|
+
uploadIdMarker: string | null;
|
|
14
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
15
|
+
private validateRequest;
|
|
16
|
+
private collectUploads;
|
|
17
|
+
private getUploads;
|
|
18
|
+
exec(res: ServerResponse): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
declare abstract class ListObjectsAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
delimiter: string | null;
|
|
7
|
+
encodingType: string | null;
|
|
8
|
+
maxKeys: string | number;
|
|
9
|
+
prefix: string | null;
|
|
10
|
+
expectedOwner: string | null;
|
|
11
|
+
optionalObjectAttributes: string | null;
|
|
12
|
+
requestPayer: string | null;
|
|
13
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
14
|
+
getKeys(): string[];
|
|
15
|
+
isInvalidMaxKeys(res: ServerResponse): true | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare class ListObjectsV1Action extends ListObjectsAction {
|
|
18
|
+
localService: S3LocalService;
|
|
19
|
+
marker: string | null;
|
|
20
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
21
|
+
exec(res: ServerResponse): void;
|
|
22
|
+
}
|
|
23
|
+
export declare class ListObjectsV2Action extends ListObjectsAction {
|
|
24
|
+
localService: S3LocalService;
|
|
25
|
+
continuationToken: string | null;
|
|
26
|
+
fetchOwner: string | null;
|
|
27
|
+
startAfter: string | null;
|
|
28
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
29
|
+
exec(res: ServerResponse): void;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
export declare class ListPartsAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
key: string;
|
|
7
|
+
uploadId: string | null;
|
|
8
|
+
partNumberMarker: string;
|
|
9
|
+
hasPartNumberMarker: boolean;
|
|
10
|
+
maxParts: string;
|
|
11
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
12
|
+
private validateRequest;
|
|
13
|
+
exec(res: ServerResponse): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
3
|
+
export declare class PutBucketAclAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
private static aclHeaders;
|
|
7
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
8
|
+
private collectBody;
|
|
9
|
+
private getAclHeaders;
|
|
10
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
export declare class PutBucketCorsAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
export declare class PutBucketPolicyAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
+
private collectBody;
|
|
8
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
3
|
+
export declare class PutBucketTaggingAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
export declare class PutObjectAclAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type LocalS3Object, S3GenericAction, S3LocalService } from "./localAction";
|
|
2
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
3
|
+
export declare class PutObjectAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
key: string;
|
|
7
|
+
contentType: string;
|
|
8
|
+
cacheControl?: string;
|
|
9
|
+
contentDisposition?: string;
|
|
10
|
+
contentEncoding?: string;
|
|
11
|
+
contentLanguage?: string;
|
|
12
|
+
websiteRedirectLocation?: string;
|
|
13
|
+
expires?: number;
|
|
14
|
+
storageClass: LocalS3Object["StorageClass"];
|
|
15
|
+
tagging?: string;
|
|
16
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
17
|
+
validateRequest(res: ServerResponse): {
|
|
18
|
+
tagsLen: number;
|
|
19
|
+
Tags: Record<string, string>;
|
|
20
|
+
} | undefined;
|
|
21
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
3
|
+
export declare class PutObjectTaggingAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
key: string;
|
|
7
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
8
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
|
+
export declare class UnknownAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
6
|
+
exec(res: ServerResponse): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
3
|
+
export declare class UploadPartAction extends S3GenericAction {
|
|
4
|
+
localService: S3LocalService;
|
|
5
|
+
bucket: string;
|
|
6
|
+
key: string;
|
|
7
|
+
uploadId: string | null;
|
|
8
|
+
partNumber: string;
|
|
9
|
+
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
10
|
+
private validateRequest;
|
|
11
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import { XMLBuilder, XMLParser } from "fast-xml-parser";
|
|
3
|
+
import type { ILambda } from "../../../defineConfig";
|
|
4
|
+
export interface BucketConfig {
|
|
5
|
+
versioning?: "Enabled" | "Suspended";
|
|
6
|
+
tags?: Record<string, string>;
|
|
7
|
+
policy?: Record<string, any>;
|
|
8
|
+
acl: {
|
|
9
|
+
headers?: Record<string, string | string[]>;
|
|
10
|
+
accessControlPolicy: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare const StorageClass: readonly ["STANDARD", "REDUCED_REDUNDANCY", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER", "DEEP_ARCHIVE", "OUTPOSTS", "GLACIER_IR", "SNOW"];
|
|
14
|
+
export type LocalS3Object = {
|
|
15
|
+
currentKey: string;
|
|
16
|
+
type?: string;
|
|
17
|
+
cacheControl?: string;
|
|
18
|
+
contentDisposition?: string;
|
|
19
|
+
contentEncoding?: string;
|
|
20
|
+
contentLanguage?: string;
|
|
21
|
+
expires?: number;
|
|
22
|
+
websiteRedirectLocation?: string;
|
|
23
|
+
StorageClass: (typeof StorageClass)[number];
|
|
24
|
+
ETag: string;
|
|
25
|
+
LastModified: number;
|
|
26
|
+
size: number;
|
|
27
|
+
metadata: Record<string, any>;
|
|
28
|
+
versions: Record<string, {
|
|
29
|
+
multipartUploadId?: string;
|
|
30
|
+
}>;
|
|
31
|
+
tags?: Record<string, any>;
|
|
32
|
+
};
|
|
33
|
+
export interface IMultipartUploadStorage {
|
|
34
|
+
uploadId: string;
|
|
35
|
+
aborted: boolean;
|
|
36
|
+
completed: boolean;
|
|
37
|
+
key: string;
|
|
38
|
+
initDate: string;
|
|
39
|
+
data: Omit<LocalS3Object, "ETag" | "size" | "LastModified">;
|
|
40
|
+
parts: {
|
|
41
|
+
partNumber: number;
|
|
42
|
+
filePath: string;
|
|
43
|
+
eTag: string;
|
|
44
|
+
size: number;
|
|
45
|
+
lastModified: string;
|
|
46
|
+
}[];
|
|
47
|
+
}
|
|
48
|
+
interface LocalS3PersistenceV2 {
|
|
49
|
+
version: number;
|
|
50
|
+
buckets: {
|
|
51
|
+
[name: string]: {
|
|
52
|
+
date: number;
|
|
53
|
+
objects: {
|
|
54
|
+
[key: string]: LocalS3Object;
|
|
55
|
+
};
|
|
56
|
+
multipartUploads: {
|
|
57
|
+
[uploadId: string]: IMultipartUploadStorage;
|
|
58
|
+
};
|
|
59
|
+
} & BucketConfig;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export declare class S3LocalService {
|
|
63
|
+
localStoragePath: string;
|
|
64
|
+
persist: boolean;
|
|
65
|
+
port: number;
|
|
66
|
+
static XMLBuilder: XMLBuilder;
|
|
67
|
+
static XMLParser: XMLParser;
|
|
68
|
+
static genLocalKey(bucket: string, key: string, version?: string): string;
|
|
69
|
+
static getTagsFromRequest(req: IncomingMessage, RequestId: string, type: "Bucket" | "Object"): Promise<Record<string, string> | undefined>;
|
|
70
|
+
persistence: LocalS3PersistenceV2;
|
|
71
|
+
callableLambdas: ILambda[];
|
|
72
|
+
accountId: string;
|
|
73
|
+
ownerId: string;
|
|
74
|
+
region: string;
|
|
75
|
+
allowToDeleteNonEmptyBuckets: boolean;
|
|
76
|
+
constructor(localStoragePath: string, persist: boolean | undefined, port: number);
|
|
77
|
+
bootstrap(): Promise<void>;
|
|
78
|
+
createBucket(bucketName: string, config?: Partial<BucketConfig>): Promise<void>;
|
|
79
|
+
saveState(): void;
|
|
80
|
+
static isValidBucketName(bucket: string): boolean;
|
|
81
|
+
removeObject(bucket: string, key: string, sourceIPAddress: string, requestId: string): Promise<void>;
|
|
82
|
+
}
|
|
83
|
+
export declare abstract class S3GenericAction {
|
|
84
|
+
localService: S3LocalService;
|
|
85
|
+
requestId: string;
|
|
86
|
+
metadata: Record<string, any>;
|
|
87
|
+
constructor(headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
88
|
+
isValidStorageClass(storage: any, res: ServerResponse): boolean;
|
|
89
|
+
hasNot(bucket: string, res: ServerResponse): true | undefined;
|
|
90
|
+
abstract exec(res: ServerResponse, ...rest: any): Promise<void> | void;
|
|
91
|
+
}
|
|
92
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const calulcateETag: (content: string | Buffer) => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const TAG_KEY_MIN_LEN = 1;
|
|
2
|
+
export declare const TAG_KEY_MAX_LEN = 128;
|
|
3
|
+
export declare const TAG_VALUE_MIN_LEN = 0;
|
|
4
|
+
export declare const TAG_VALUE_MAX_LEN = 256;
|
|
5
|
+
export declare const MAX_BUCKET_TAGS = 50;
|
|
6
|
+
export declare const MAX_OBJECT_TAGS = 10;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export declare class S3Error extends Error {
|
|
2
|
+
statusCode?: number;
|
|
3
|
+
Code: string;
|
|
4
|
+
SenderFault: boolean;
|
|
5
|
+
RequestId: string;
|
|
6
|
+
constructor({ Code, Message, SenderFault, RequestId, statusCode, }: {
|
|
7
|
+
Code: string;
|
|
8
|
+
Message: string;
|
|
9
|
+
SenderFault?: boolean;
|
|
10
|
+
statusCode?: number;
|
|
11
|
+
RequestId: string;
|
|
12
|
+
});
|
|
13
|
+
toXml(info?: string): string;
|
|
14
|
+
static genericError({ Code, Message, RequestId, info, }: {
|
|
15
|
+
Code: string;
|
|
16
|
+
Message: string;
|
|
17
|
+
RequestId: string;
|
|
18
|
+
info?: string;
|
|
19
|
+
}): string;
|
|
20
|
+
}
|
|
21
|
+
export declare class InvalidTag extends S3Error {
|
|
22
|
+
TagKey: string;
|
|
23
|
+
constructor({ TagKey, Message, RequestId }: {
|
|
24
|
+
TagKey: string;
|
|
25
|
+
Message: string;
|
|
26
|
+
RequestId: string;
|
|
27
|
+
});
|
|
28
|
+
toXml(): string;
|
|
29
|
+
}
|
|
30
|
+
export declare class MalformedXML extends S3Error {
|
|
31
|
+
constructor(RequestId: string);
|
|
32
|
+
}
|
|
33
|
+
export declare class BadRequest extends S3Error {
|
|
34
|
+
constructor({ Message, RequestId }: {
|
|
35
|
+
Message: string;
|
|
36
|
+
RequestId: string;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export declare class InvalidArgument extends S3Error {
|
|
40
|
+
ArgumentName: string;
|
|
41
|
+
ArgumentValue?: string | number | boolean | null;
|
|
42
|
+
constructor({ Message, RequestId, ArgumentName, ArgumentValue, }: {
|
|
43
|
+
Message: string;
|
|
44
|
+
RequestId: string;
|
|
45
|
+
ArgumentName: string;
|
|
46
|
+
ArgumentValue?: string | number | boolean | null;
|
|
47
|
+
});
|
|
48
|
+
toXml(): string;
|
|
49
|
+
}
|
|
50
|
+
export declare class InvalidPartNumber extends S3Error {
|
|
51
|
+
PartNumberRequested: number;
|
|
52
|
+
ActualPartCount: number;
|
|
53
|
+
constructor({ RequestId, PartNumberRequested, ActualPartCount, }: {
|
|
54
|
+
RequestId: string;
|
|
55
|
+
PartNumberRequested: number;
|
|
56
|
+
ActualPartCount: number;
|
|
57
|
+
});
|
|
58
|
+
toXml(): string;
|
|
59
|
+
}
|
|
60
|
+
export declare class NoSuchTagSet extends S3Error {
|
|
61
|
+
constructor(RequestId: string);
|
|
62
|
+
}
|
|
63
|
+
export declare class UnsupportedCommand extends S3Error {
|
|
64
|
+
constructor(command: string, RequestId: string);
|
|
65
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getLocalStoragePath: (storagePath?: string) => string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ExloPlugin } from "../../defineConfig";
|
|
2
|
+
import { type BucketConfig } from "./actions/localAction";
|
|
3
|
+
export interface IS3PluginOptions {
|
|
4
|
+
/**
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
allowToDeleteNonEmptyBuckets?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Directory where S3 related files will be stored.
|
|
10
|
+
* This directory will be created on app start.
|
|
11
|
+
*
|
|
12
|
+
* Use `persist` option to keep/remove it on app exit.
|
|
13
|
+
* @default "./.exlo/s3"
|
|
14
|
+
*/
|
|
15
|
+
localStorageDir?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Indicates if `localStorageDir` shoud be persistent.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
persist?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Set `AWS_ENDPOINT_URL_S3` env variable inside lambdas
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
setEndpointEnvVar?: boolean;
|
|
26
|
+
port?: number;
|
|
27
|
+
buckets?: {
|
|
28
|
+
[bucketName: string]: Partial<BucketConfig>;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
declare const s3Plugin: (options?: IS3PluginOptions) => ExloPlugin;
|
|
32
|
+
export { s3Plugin };
|