Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
**/node_modules
build/
test/data/esm_*
test/data/plugins
docs/
310 changes: 310 additions & 0 deletions docs/generated/api.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -1913,6 +1913,88 @@
"endIndex": 2
}
},
{
"kind": "PropertySignature",
"canonicalReference": "@openfunction/functions-framework!OpenFunctionContext#postPlugins:member",
"docComment": "/**\n * Optional post function exec plugins.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "postPlugins?: "
},
{
"kind": "Reference",
"text": "Array",
"canonicalReference": "!Array:interface"
},
{
"kind": "Content",
"text": "<string | "
},
{
"kind": "Reference",
"text": "Plugin",
"canonicalReference": "@openfunction/functions-framework!Plugin:class"
},
{
"kind": "Content",
"text": " | undefined>"
},
{
"kind": "Content",
"text": ";"
}
],
"isReadonly": false,
"isOptional": true,
"releaseTag": "Public",
"name": "postPlugins",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 5
}
},
{
"kind": "PropertySignature",
"canonicalReference": "@openfunction/functions-framework!OpenFunctionContext#prePlugins:member",
"docComment": "/**\n * Optional pre function exec plugins.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "prePlugins?: "
},
{
"kind": "Reference",
"text": "Array",
"canonicalReference": "!Array:interface"
},
{
"kind": "Content",
"text": "<string | "
},
{
"kind": "Reference",
"text": "Plugin",
"canonicalReference": "@openfunction/functions-framework!Plugin:class"
},
{
"kind": "Content",
"text": " | undefined>"
},
{
"kind": "Content",
"text": ";"
}
],
"isReadonly": false,
"isOptional": true,
"releaseTag": "Public",
"name": "prePlugins",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 5
}
},
{
"kind": "PropertySignature",
"canonicalReference": "@openfunction/functions-framework!OpenFunctionContext#runtime:member",
Expand DownExpand Up@@ -2489,6 +2571,234 @@
],
"implementsTokenRanges": []
},
{
"kind": "Class",
"canonicalReference": "@openfunction/functions-framework!Plugin_2:class",
"docComment": "/**\n * The OpenFunction's plugin template.\n *\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare class Plugin "
}
],
"releaseTag": "Public",
"name": "Plugin_2",
"preserveMemberOrder": false,
"members": [
{
"kind": "Method",
"canonicalReference": "@openfunction/functions-framework!Plugin_2#execPostHook:member(1)",
"docComment": "/**\n * post main function exec.\n *\n * @param ctx - The openfunction runtime .\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "execPostHook(ctx?: "
},
{
"kind": "Reference",
"text": "OpenFunctionRuntime",
"canonicalReference": "@openfunction/functions-framework!OpenFunctionRuntime:class"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "Promise",
"canonicalReference": "!Promise:interface"
},
{
"kind": "Content",
"text": "<void>"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 5
},
"releaseTag": "Public",
"isProtected": false,
"overloadIndex": 1,
"parameters": [
{
"parameterName": "ctx",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isOptional": true
}
],
"isOptional": false,
"name": "execPostHook"
},
{
"kind": "Method",
"canonicalReference": "@openfunction/functions-framework!Plugin_2#execPreHook:member(1)",
"docComment": "/**\n * pre main function exec.\n *\n * @param ctx - The openfunction runtime .\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "execPreHook(ctx?: "
},
{
"kind": "Reference",
"text": "OpenFunctionRuntime",
"canonicalReference": "@openfunction/functions-framework!OpenFunctionRuntime:class"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "Promise",
"canonicalReference": "!Promise:interface"
},
{
"kind": "Content",
"text": "<void>"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 5
},
"releaseTag": "Public",
"isProtected": false,
"overloadIndex": 1,
"parameters": [
{
"parameterName": "ctx",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isOptional": true
}
],
"isOptional": false,
"name": "execPreHook"
},
{
"kind": "Method",
"canonicalReference": "@openfunction/functions-framework!Plugin_2#get:member(1)",
"docComment": "/**\n * get instance filed value.\n *\n * @param filedName - the instace filedName\n *\n * @returns filed value.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "get(filedName: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"isProtected": false,
"overloadIndex": 1,
"parameters": [
{
"parameterName": "filedName",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isOptional": false
}
],
"isOptional": false,
"name": "get"
},
{
"kind": "Property",
"canonicalReference": "@openfunction/functions-framework!Plugin_2.OFN_PLUGIN_NAME:member",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "static OFN_PLUGIN_NAME: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ";"
}
],
"isReadonly": false,
"isOptional": false,
"releaseTag": "Public",
"name": "OFN_PLUGIN_NAME",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isStatic": true,
"isProtected": false
},
{
"kind": "Property",
"canonicalReference": "@openfunction/functions-framework!Plugin_2.OFN_PLUGIN_VERSION:member",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "static OFN_PLUGIN_VERSION: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ";"
}
],
"isReadonly": false,
"isOptional": false,
"releaseTag": "Public",
"name": "OFN_PLUGIN_VERSION",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isStatic": true,
"isProtected": false
}
],
"implementsTokenRanges": []
},
{
"kind": "Interface",
"canonicalReference": "@openfunction/functions-framework!Request_2:interface",
Expand Down
14 changes: 14 additions & 0 deletions docs/generated/api.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -136,6 +136,8 @@ export interface OpenFunctionContext {
name: string;
outputs?: OpenFunctionBinding;
port?: string;
postPlugins?: Array<string | Plugin_2 | undefined>;
prePlugins?: Array<string | Plugin_2 | undefined>;
runtime: `${RuntimeType}` | `${Capitalize<RuntimeType>}` | `${Uppercase<RuntimeType>}`;
version: string;
}
Expand All@@ -158,6 +160,18 @@ export abstract class OpenFunctionRuntime {
protected trigger?: OpenFunctionTrigger;
}

// @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;
}
export { Plugin_2 as Plugin }

// @public (undocumented)
interface Request_2 extends Request_3 {
rawBody?: Buffer;
Expand Down
Loading