exlo 0.0.13 → 0.0.15
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/index.mjs +1 -1
- package/dist/defineConfig.mjs +1 -1
- package/dist/plugins/s3/actions/AbortMultipartUploadAction.d.ts +1 -1
- package/dist/plugins/s3/actions/CompleteMultipartUploadAction.d.ts +1 -1
- package/dist/plugins/s3/actions/CreateBucketAction.d.ts +2 -2
- package/dist/plugins/s3/actions/CreateMultipartUploadAction.d.ts +1 -1
- package/dist/plugins/s3/actions/DeleteBucketAction.d.ts +2 -2
- package/dist/plugins/s3/actions/DeleteBucketPolicyAction.d.ts +2 -2
- package/dist/plugins/s3/actions/DeleteBucketTaggingAction.d.ts +2 -2
- package/dist/plugins/s3/actions/DeleteObjectAction.d.ts +1 -1
- package/dist/plugins/s3/actions/DeleteObjectTaggingAction.d.ts +2 -2
- package/dist/plugins/s3/actions/GetBucketAclAction.d.ts +2 -2
- package/dist/plugins/s3/actions/GetBucketPolicy.d.ts +2 -2
- package/dist/plugins/s3/actions/GetBucketTaggingAction.d.ts +2 -2
- package/dist/plugins/s3/actions/GetObjectAclAction.d.ts +2 -2
- package/dist/plugins/s3/actions/GetObjectAction.d.ts +3 -3
- package/dist/plugins/s3/actions/GetObjectTaggingAction.d.ts +2 -2
- package/dist/plugins/s3/actions/HeadBucketAction.d.ts +2 -2
- package/dist/plugins/s3/actions/HeadObjectAction.d.ts +2 -2
- package/dist/plugins/s3/actions/ListBucketsAction.d.ts +2 -2
- package/dist/plugins/s3/actions/ListMultipartUploadsAction.d.ts +2 -2
- package/dist/plugins/s3/actions/ListObjectsAction.d.ts +4 -4
- package/dist/plugins/s3/actions/ListPartsAction.d.ts +2 -2
- package/dist/plugins/s3/actions/PutObjectAction.d.ts +2 -2
- package/dist/plugins/s3/actions/UnknownAction.d.ts +2 -2
- package/dist/plugins/s3/actions/localAction.d.ts +7 -2
- package/dist/plugins/s3/index.mjs +63 -63
- package/dist/standalone.js +1 -1
- package/dist/standalone.mjs +1 -1
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{readFile as I}from"node:fs/promises";import p from"node:path";import{pathToFileURL as O}from"node:url";import{parseArgs as Y}from"node:util";var j="exlo",b="0.0.
|
|
2
|
+
import{readFile as I}from"node:fs/promises";import p from"node:path";import{pathToFileURL as O}from"node:url";import{parseArgs as Y}from"node:util";var j="exlo",b="0.0.15";var g=!1,R=e=>{g=e},A=()=>g,l=(e,t)=>{g&&console.log(`\x1B[${e}m${t}\x1B[0m`)},C=e=>console.log(`\x1B[31m${e}\x1B[0m`),$=e=>l("32",e),q=e=>l("33",e),L=e=>l("36",e),S=e=>l("90",e),F=e=>l("94",e),_=e=>l("95",e),D=e=>g?console.log(e):void 0,n={GREEN:$,YELLOW:q,CYAN:L,BR_BLUE:F,RED:C,GREY:S,PINK:_,setDebug:R,getDebug:A,info:D};var y={config:{type:"string",short:"c",default:"exlo.config.ts",description:"Path to exlo 'defineConfig' file."},debug:{type:"boolean",default:!1,description:"Enable debug mode. When enabled exlo will print usefull informations."},create:{type:"boolean",default:!1,description:"Create exlo 'defineConfig' file based on passed options."},runtime:{type:"string",short:"r",description:"Lambda default runtime (ex: nodejs22.x, python3.7, ruby2.7 etc.)."},timeout:{type:"string",short:"t",default:"3",description:"Lambda default timeout."},port:{type:"string",short:"p",default:"0",description:"Lambda server port."},definitions:{type:"string",short:"d",description:"Path to .json, .mjs, .cjs file with Lambda function definitions."},functions:{type:"string",short:"f",multiple:!0,description:"Glob pattern to automatically find and define Lambda handlers."},exclude:{type:"string",short:"X",multiple:!0,default:[".(test|spec)."],description:"RegExp string to exclude found enteries from --functions."},"handler-name":{type:"string",default:"handler",description:"Handler function name. To be used with --functions."},env:{type:"string",short:"e",multiple:!0,default:[],description:"Environment variables to be injected into Lambdas. All existing AWS_* are automatically injected.",example:"-e API_KEY=supersecret -e API_URL=https://website.com"},"optimize-build":{type:"boolean",default:!1,description:"externalize dependencies and other stuff"},"shim-require":{type:"boolean",default:!1,description:"shim 'require()', '__dirname' and '__filename' when bundeling Lambdas with ESM format"},help:{type:"boolean",short:"h",skipFullPrint:!0},version:{type:"boolean",short:"v",skipFullPrint:!0},"esbuild-external":{type:"string",multiple:!0,skip:!0},"esbuild-resolveExtensions":{type:"string",multiple:!0,skip:!0},"esbuild-mainFields":{type:"string",multiple:!0,skip:!0},"esbuild-conditions":{type:"string",multiple:!0,skip:!0},"esbuild-entryPoints":{type:"string",multiple:!0,skip:!0},"esbuild-inject":{type:"string",multiple:!0,skip:!0},"esbuild-nodePaths":{type:"string",multiple:!0,skip:!0}};function M(){n.setDebug(!0),n.GREY("Usage examples:"),console.log("exlo -c exlo.config.ts"),console.log(`exlo -p 3000 --debug --functions "src/lambdas/**/*.ts"
|
|
3
3
|
`),n.BR_BLUE("Options:");for(let[e,t]of Object.entries(y)){let i=e;if(t.skip)continue;if(t.short&&(i+=`, -${t.short}`),t.skipFullPrint){n.CYAN(` --${i}
|
|
4
4
|
`);continue}let s=` type: ${t.type}`;t.description&&(s+=`
|
|
5
5
|
description: ${t.description}`),"default"in t&&(s+=`
|
package/dist/defineConfig.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var h="0.0.
|
|
1
|
+
var h="0.0.15";function k(e){let c=new Set;e.plugins&&(e.plugins=e.plugins.filter((i,a)=>typeof i!="object"||!i||!("name"in i)?!1:((!i.name||!i.name.length||typeof i.name!="string")&&(i.name=`plugin-${a}`,console.warn(`No Plugin name provided at index ${a}`)),c.has(i.name)?i.name=i.name+a:c.add(i.name),!0)));async function f({stop:i,lambdas:a,region:g,esbuild:v,getServices:y,setService:d,addLambda:p,log:l,setEndpoint:b,getEndpoint:x,getAwsProviderDefaults:C,setAwsProviderDefaults:S}){let r={build:{esbuild:e?.build?.esbuild??{},shimRequire:e?.build?.shimRequire,optimizeBuild:e?.build?.optimizeBuild},server:{port:e.server?.port,setEndpointEnvVar:e.server?.setEndpointEnvVar},onKill:[]};if(e.defaults&&typeof e.defaults=="object"&&!Array.isArray(e.defaults)&&S(e.defaults),e.functions&&typeof e.functions=="object"&&!Array.isArray(e.functions))for(let[m,s]of Object.entries(e.functions))p(m,s);e.services&&(e.services.sqs&&d("sqs",e.services.sqs),e.services.sns&&d("sns",e.services.sns),e.services.dynamodb&&d("dynamodb",e.services.dynamodb));let o={stop:i,lambdas:a,region:g,esbuild:v,options:e,config:r,getServices:y,setService:d,addLambda:p,log:l,setEndpoint:b,getEndpoint:x,getAwsProviderDefaults:C};if(e.plugins){r.server.onReady=async(s,n)=>{for(let t of e.plugins)if(t.server?.onReady)try{await t.server.onReady.call(o,s,n)}catch(u){l.RED(t.name),console.error(u)}},r.buildCallback=async(s,n)=>{for(let t of e.plugins)if(t.buildCallback)try{await t.buildCallback.call(o,s,n)}catch(u){l.RED(t.name),console.error(u),n||process.exit(1)}};let m=e.plugins.reduce((s,n)=>(n.server?.request?.length&&s.push(...n.server.request),s),[]);m?.length&&(r.server.request=m.map(s=>(s.callback=s.callback.bind(o),s)));for(let s of e.plugins)if(s.onKill&&r.onKill.push(s.onKill.bind(o)),s.onInit)try{await s.onInit.call(o)}catch(n){throw l.RED(s.name),n}}return r}return f.plugins=e.plugins??[],f}export{k as defineConfig,h as exloVersion};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
2
1
|
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
3
|
export declare class AbortMultipartUploadAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
bucket: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
2
1
|
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "http";
|
|
2
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
3
3
|
export declare class CompleteMultipartUploadAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
bucket: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
3
3
|
export declare class CreateBucketAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
bucket: string;
|
|
6
6
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
-
exec(res: ServerResponse): Promise<void>;
|
|
7
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
8
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
2
1
|
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "http";
|
|
2
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
3
3
|
export declare class CreateMultipartUploadAction extends S3GenericAction {
|
|
4
4
|
private url;
|
|
5
5
|
private headers;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
3
|
export declare class DeleteBucketAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
bucket: string;
|
|
6
6
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
-
exec(res: ServerResponse): Promise<void>;
|
|
7
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
8
8
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "http";
|
|
1
2
|
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
2
|
-
import type { IncomingHttpHeaders, ServerResponse } from "http";
|
|
3
3
|
export declare class DeleteBucketPolicyAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
bucket: string;
|
|
6
6
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
-
exec(res: ServerResponse): Promise<void>;
|
|
7
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
8
8
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "http";
|
|
1
2
|
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
2
|
-
import type { IncomingHttpHeaders, ServerResponse } from "http";
|
|
3
3
|
export declare class DeleteBucketTaggingAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
bucket: string;
|
|
6
6
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
-
exec(res: ServerResponse): Promise<void>;
|
|
7
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
8
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
2
1
|
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "http";
|
|
2
|
+
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
3
3
|
export declare class DeleteObjectAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
bucket: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
3
|
export declare class DeleteObjectTaggingAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
bucket: string;
|
|
6
6
|
key: string;
|
|
7
7
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
8
|
-
exec(res: ServerResponse): Promise<void>;
|
|
8
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
9
9
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
3
|
export declare class GetBucketAclAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
bucket: string;
|
|
6
6
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
-
exec(res: ServerResponse): Promise<void>;
|
|
7
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
8
8
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
3
|
export declare class GetBucketPolicyAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
bucket: string;
|
|
6
6
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
-
exec(res: ServerResponse): Promise<void>;
|
|
7
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
8
8
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
3
3
|
export declare class GetBucketTaggingAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
bucket: string;
|
|
6
6
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
-
exec(res: ServerResponse): Promise<void>;
|
|
7
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
8
8
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
3
|
export declare class GetObjectAclAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
bucket: string;
|
|
6
6
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
-
exec(res: ServerResponse): Promise<void>;
|
|
7
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
8
8
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
3
2
|
import type { LocalS3Object, S3LocalService } from "./localAction";
|
|
3
|
+
import { S3GenericAction } from "./localAction";
|
|
4
4
|
export declare const checkS3Conditions: ({ ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, }: {
|
|
5
5
|
ifMatch?: string;
|
|
6
6
|
ifNoneMatch?: string;
|
|
@@ -26,5 +26,5 @@ export declare class GetObjectAction extends S3GenericAction {
|
|
|
26
26
|
ifModifiedSince?: number;
|
|
27
27
|
ifUnmodifiedSince?: number;
|
|
28
28
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
29
|
-
exec(res: ServerResponse): Promise<void>;
|
|
29
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
30
30
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, S3LocalService } from "./localAction";
|
|
3
3
|
export declare class GetObjectTaggingAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
@@ -6,5 +6,5 @@ export declare class GetObjectTaggingAction extends S3GenericAction {
|
|
|
6
6
|
key: string;
|
|
7
7
|
versionId: string | null;
|
|
8
8
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
9
|
-
exec(res: ServerResponse): Promise<void>;
|
|
9
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
10
10
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
3
|
export declare class HeadBucketAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
bucket: string;
|
|
6
6
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
7
|
-
exec(res: ServerResponse): void;
|
|
7
|
+
exec(res: ServerResponse, req: IncomingMessage): void;
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
3
|
export declare class HeadObjectAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
@@ -14,5 +14,5 @@ export declare class HeadObjectAction extends S3GenericAction {
|
|
|
14
14
|
ifModifiedSince?: number;
|
|
15
15
|
ifUnmodifiedSince?: number;
|
|
16
16
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
17
|
-
exec(res: ServerResponse): Promise<void>;
|
|
17
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
18
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
3
|
export declare class ListBucketsAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
@@ -11,5 +11,5 @@ export declare class ListBucketsAction extends S3GenericAction {
|
|
|
11
11
|
private isValidRequest;
|
|
12
12
|
private createContinuationToken;
|
|
13
13
|
private getBucketNames;
|
|
14
|
-
exec(res: ServerResponse): Promise<void>;
|
|
14
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
15
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
3
|
export declare class ListMultipartUploadsAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
@@ -15,5 +15,5 @@ export declare class ListMultipartUploadsAction extends S3GenericAction {
|
|
|
15
15
|
private validateRequest;
|
|
16
16
|
private collectUploads;
|
|
17
17
|
private getUploads;
|
|
18
|
-
exec(res: ServerResponse): Promise<void>;
|
|
18
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
19
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
3
|
declare abstract class ListObjectsAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
@@ -12,13 +12,13 @@ declare abstract class ListObjectsAction extends S3GenericAction {
|
|
|
12
12
|
requestPayer: string | null;
|
|
13
13
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
14
14
|
getKeys(): string[];
|
|
15
|
-
isInvalidMaxKeys(res: ServerResponse): true | undefined;
|
|
15
|
+
isInvalidMaxKeys(res: ServerResponse, req: IncomingMessage): true | undefined;
|
|
16
16
|
}
|
|
17
17
|
export declare class ListObjectsV1Action extends ListObjectsAction {
|
|
18
18
|
localService: S3LocalService;
|
|
19
19
|
marker: string | null;
|
|
20
20
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
21
|
-
exec(res: ServerResponse): void;
|
|
21
|
+
exec(res: ServerResponse, req: IncomingMessage): void;
|
|
22
22
|
}
|
|
23
23
|
export declare class ListObjectsV2Action extends ListObjectsAction {
|
|
24
24
|
localService: S3LocalService;
|
|
@@ -26,6 +26,6 @@ export declare class ListObjectsV2Action extends ListObjectsAction {
|
|
|
26
26
|
fetchOwner: string | null;
|
|
27
27
|
startAfter: string | null;
|
|
28
28
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
29
|
-
exec(res: ServerResponse): void;
|
|
29
|
+
exec(res: ServerResponse, req: IncomingMessage): void;
|
|
30
30
|
}
|
|
31
31
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
3
|
export declare class ListPartsAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
@@ -10,5 +10,5 @@ export declare class ListPartsAction extends S3GenericAction {
|
|
|
10
10
|
maxParts: string;
|
|
11
11
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
12
12
|
private validateRequest;
|
|
13
|
-
exec(res: ServerResponse): Promise<void>;
|
|
13
|
+
exec(res: ServerResponse, req: IncomingMessage): Promise<void>;
|
|
14
14
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type LocalS3Object, S3GenericAction, S3LocalService } from "./localAction";
|
|
2
1
|
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import { type LocalS3Object, S3GenericAction, S3LocalService } from "./localAction";
|
|
3
3
|
export declare class PutObjectAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
bucket: string;
|
|
@@ -14,7 +14,7 @@ export declare class PutObjectAction extends S3GenericAction {
|
|
|
14
14
|
storageClass: LocalS3Object["StorageClass"];
|
|
15
15
|
tagging?: string;
|
|
16
16
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
17
|
-
validateRequest(res: ServerResponse): {
|
|
17
|
+
validateRequest(res: ServerResponse, req: IncomingMessage): {
|
|
18
18
|
tagsLen: number;
|
|
19
19
|
Tags: Record<string, string>;
|
|
20
20
|
} | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { IncomingHttpHeaders, ServerResponse } from "node:http";
|
|
1
|
+
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { S3GenericAction, type S3LocalService } from "./localAction";
|
|
3
3
|
export declare class UnknownAction extends S3GenericAction {
|
|
4
4
|
localService: S3LocalService;
|
|
5
5
|
constructor(url: URL, headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
6
|
-
exec(res: ServerResponse): void;
|
|
6
|
+
exec(res: ServerResponse, req: IncomingMessage): void;
|
|
7
7
|
}
|
|
@@ -79,14 +79,19 @@ export declare class S3LocalService {
|
|
|
79
79
|
saveState(): void;
|
|
80
80
|
static isValidBucketName(bucket: string): boolean;
|
|
81
81
|
removeObject(bucket: string, key: string, sourceIPAddress: string, requestId: string): Promise<void>;
|
|
82
|
+
setCorsHeaders(req: IncomingMessage, res: ServerResponse): void;
|
|
83
|
+
getCorsHeaders(req: IncomingMessage, array?: boolean): string[] | {
|
|
84
|
+
"access-control-allow-origin": string;
|
|
85
|
+
"access-control-allow-credentials": string;
|
|
86
|
+
} | undefined;
|
|
82
87
|
}
|
|
83
88
|
export declare abstract class S3GenericAction {
|
|
84
89
|
localService: S3LocalService;
|
|
85
90
|
requestId: string;
|
|
86
91
|
metadata: Record<string, any>;
|
|
87
92
|
constructor(headers: IncomingHttpHeaders, localService: S3LocalService);
|
|
88
|
-
isValidStorageClass(storage: any, res: ServerResponse): boolean;
|
|
89
|
-
hasNot(bucket: string, res: ServerResponse): true | undefined;
|
|
93
|
+
isValidStorageClass(storage: any, res: ServerResponse, req: IncomingMessage): boolean;
|
|
94
|
+
hasNot(bucket: string, res: ServerResponse, req: IncomingMessage): true | undefined;
|
|
90
95
|
abstract exec(res: ServerResponse, ...rest: any): Promise<void> | void;
|
|
91
96
|
}
|
|
92
97
|
export {};
|