Skip to content

refactor: plugin system revolution #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2022
Merged
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
383 changes: 318 additions & 65 deletions docs/generated/api.json

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions docs/generated/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export interface LegacyEvent {
// @public
export interface OpenFunction {
// (undocumented)
(ctx: OpenFunctionRuntime, data: {}): any;
(ctx: OpenFunctionRuntime, data: object): any;
}

// @public
Expand All @@ -136,8 +136,8 @@ export interface OpenFunctionContext {
name: string;
outputs?: OpenFunctionBinding;
port?: string;
postPlugins?: Array<string | Plugin_2 | undefined>;
prePlugins?: Array<string | Plugin_2 | undefined>;
postPlugins?: string[];
prePlugins?: string[];
runtime: `${RuntimeType}` | `${Capitalize<RuntimeType>}` | `${Uppercase<RuntimeType>}`;
version: string;
}
Expand All @@ -146,6 +146,8 @@ export interface OpenFunctionContext {
export abstract class OpenFunctionRuntime {
constructor(context: OpenFunctionContext);
protected readonly context: OpenFunctionContext;
getPlugin(name: string): Plugin_2;
readonly locals: Record<string, any>;
static Parse(context: OpenFunctionContext): OpenFunctionRuntime;
static ProxyContext(context: OpenFunctionContext): OpenFunctionRuntime;
get req(): Request_3<ParamsDictionary, any, any, ParsedQs, Record<string, any>> | undefined;
Expand All @@ -158,17 +160,17 @@ export abstract class OpenFunctionRuntime {
};
// Warning: (ae-forgotten-export) The symbol "OpenFunctionTrigger" needs to be exported by the entry point index.d.ts
protected trigger?: OpenFunctionTrigger;
static WrapUserFunction(userFunction: OpenFunction, context: OpenFunctionContext | OpenFunctionRuntime): (data: any) => Promise<void>;
}

// @public
class Plugin_2 {
execPostHook(ctx?: OpenFunctionRuntime): Promise<void>;
execPreHook(ctx?: OpenFunctionRuntime): Promise<void>;
get(filedName: string): string;
// (undocumented)
static OFN_PLUGIN_NAME: string;
// (undocumented)
static OFN_PLUGIN_VERSION: string;
constructor(name: string, version?: string);
execPostHook(ctx: OpenFunctionRuntime | null, plugins: Record<string, Plugin_2>): Promise<void>;
execPreHook(ctx: OpenFunctionRuntime | null, plugins: Record<string, Plugin_2>): Promise<void>;
get(prop: string): any;
readonly name: string;
readonly version: string;
}
export { Plugin_2 as Plugin }

Expand Down
133 changes: 57 additions & 76 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@
"author": "OpenFunction",
"license": "Apache-2.0",
"devDependencies": {
"@microsoft/api-extractor": "^7.28.4",
"@microsoft/api-extractor": "^7.29.3",
"@types/body-parser": "1.19.2",
"@types/debug": "^4.1.7",
"@types/express": "4.17.13",
"@types/google-protobuf": "^3.15.6",
"@types/lodash": "^4.14.182",
"@types/lodash": "^4.14.184",
"@types/minimist": "1.2.2",
"@types/mocha": "9.1.1",
"@types/node": "14.18.11",
"@types/node-fetch": "^2.6.2",
"@types/on-finished": "2.3.1",
"@types/semver": "^7.3.10",
"@types/semver": "^7.3.12",
"@types/shelljs": "^0.8.11",
"@types/sinon": "10.0.11",
"@types/supertest": "2.0.12",
Expand Down
Loading