Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
node_modules
.DS_Store
.serverless
dist
*.log
coverage
.nyc_output
__pycache__
__pycache__
17 changes: 17 additions & 0 deletions dist/@types/localhost.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Cors } from './serverless';
export interface HttpFunc {
name: string;
qualifiedName: string;
handler: string;
runtime: string;
memorySize: number;
timeout: number;
events: {
method: string;
path: string;
cors?: Cors;
}[];
environment: {
[key: string]: string;
};
}
3 changes: 3 additions & 0 deletions dist/@types/localhost.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/@types/localhost.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 72 additions & 0 deletions dist/@types/serverless.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
export interface CommandOption {
usage: string;
shortcut: string;
required?: boolean;
}
export interface CommandDescription {
usage: string;
lifecycleEvents?: string[];
commands?: {
[key: string]: CommandDescription;
};
options?: {
[key: string]: CommandOption;
};
}
export interface Serverless {
cli: {
log(args: any): any;
consoleLog(args: any): any;
};
service: {
service: string;
provider: {
name: string;
runtime?: string;
memorySize?: number;
timeout?: number;
environment?: {
[key: string]: string;
};
};
package?: Package;
getAllFunctions: () => string[];
functions: {
[key: string]: FunctionConfig;
};
};
getProvider(name: string): Provider;
pluginManager: {
spawn(cmd: string, options?: object): Promise<void>;
};
}
export declare type Cors = boolean | {
origin?: string;
headers?: string[];
allowCredentials?: boolean;
};
export interface FunctionConfig {
name: string;
handler: string;
runtime?: string;
events?: {
[key: string]: any;
}[];
package?: Package;
memorySize?: number;
timeout?: number;
environment?: {
[key: string]: string;
};
}
export interface Package {
artifact?: string;
disable?: boolean;
}
export interface Provider {
getStage(): string;
}
export interface Options {
port?: number;
debugPort?: number;
}
3 changes: 3 additions & 0 deletions dist/@types/serverless.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/@types/serverless.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions dist/docker.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// <reference types="node" />
import * as Dockerode from 'dockerode';
import { ContainerCreateOptions } from 'dockerode';
import { HttpFunc } from './@types/localhost';
export declare function demux(logs: Buffer, stderr: (d: any) => void, stdout: (d: any) => void): void;
export declare function pull(docker: Dockerode, image: string): Promise<void>;
export declare function runtimeImage(runtime: string): string;
export declare function debugSupported(runtime: string): boolean;
export declare function containerArgs(dockerImage: string, event: string, func: HttpFunc, region: string, debugPort?: number): ContainerCreateOptions;
172 changes: 172 additions & 0 deletions dist/docker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/docker.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/http.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export declare function isHttpEvent(config: object): boolean;
export declare function translateMethod(method: string): string;
export declare function translatePath(apiGatewayPath: string): string;
17 changes: 17 additions & 0 deletions dist/http.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/http.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import * as debug from 'debug';
import * as Dockerode from 'dockerode';
import * as express from 'express';
import { HttpFunc } from './@types/localhost';
import { CommandDescription, FunctionConfig, Options, Serverless } from './@types/serverless';
declare const _default: {
new (serverless: Serverless, options: Options): {
readonly serverless: Serverless;
readonly options: Options;
readonly commands: {
[key: string]: CommandDescription;
};
readonly hooks: {
[key: string]: any;
};
readonly debug: debug.IDebugger;
httpFunc(name: string, runtime: string, env: {
[key: string]: string;
}, func: FunctionConfig): HttpFunc;
respond(funcResponse: string, response: express.Response): void;
httpFunctions(): HttpFunc[];
bootstrap(docker: Dockerode, funcs: HttpFunc[]): Promise<express.Application>;
start(): Promise<any>;
};
};
export = _default;
Loading