@faasjs/func 0.0.2-beta.452 → 0.0.2-beta.454
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/index.d.ts +12 -12
- package/package.json +3 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Logger } from '@faasjs/logger';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
type Handler<TEvent = any, TContext = any, TResult = any> = (data: InvokeData<TEvent, TContext>) => Promise<TResult>;
|
|
4
|
+
type Next = () => Promise<void>;
|
|
5
|
+
type ExportedHandler<TEvent = any, TContext = any, TResult = any> = (event: TEvent, context?: TContext, callback?: (...args: any) => any) => Promise<TResult>;
|
|
6
|
+
type Plugin = {
|
|
7
7
|
[key: string]: any;
|
|
8
8
|
readonly type: string;
|
|
9
9
|
readonly name: string;
|
|
@@ -11,13 +11,13 @@ declare type Plugin = {
|
|
|
11
11
|
onMount?: (data: MountData, next: Next) => void | Promise<void>;
|
|
12
12
|
onInvoke?: (data: InvokeData, next: Next) => void | Promise<void>;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
type ProviderConfig = {
|
|
15
15
|
type: string;
|
|
16
16
|
config: {
|
|
17
17
|
[key: string]: any;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
type Config = {
|
|
21
21
|
[key: string]: any;
|
|
22
22
|
providers?: {
|
|
23
23
|
[key: string]: ProviderConfig;
|
|
@@ -33,7 +33,7 @@ declare type Config = {
|
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
|
|
36
|
+
type DeployData = {
|
|
37
37
|
[key: string]: any;
|
|
38
38
|
root: string;
|
|
39
39
|
filename: string;
|
|
@@ -58,13 +58,13 @@ declare type DeployData = {
|
|
|
58
58
|
};
|
|
59
59
|
logger?: Logger;
|
|
60
60
|
};
|
|
61
|
-
|
|
61
|
+
type MountData = {
|
|
62
62
|
[key: string]: any;
|
|
63
63
|
config: Config;
|
|
64
64
|
event: any;
|
|
65
65
|
context: any;
|
|
66
66
|
};
|
|
67
|
-
|
|
67
|
+
type InvokeData<TEvent = any, TContext = any, TResult = any> = {
|
|
68
68
|
[key: string]: any;
|
|
69
69
|
event: TEvent;
|
|
70
70
|
context: TContext;
|
|
@@ -74,8 +74,8 @@ declare type InvokeData<TEvent = any, TContext = any, TResult = any> = {
|
|
|
74
74
|
handler?: Handler<TEvent, TContext, TResult>;
|
|
75
75
|
config: Config;
|
|
76
76
|
};
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
type LifeCycleKey = 'onDeploy' | 'onMount' | 'onInvoke';
|
|
78
|
+
type FuncConfig<TEvent = any, TContext = any, TResult = any> = {
|
|
79
79
|
plugins?: Plugin[];
|
|
80
80
|
handler?: Handler<TEvent, TContext, TResult>;
|
|
81
81
|
};
|
|
@@ -124,7 +124,7 @@ declare class Func<TEvent = any, TContext = any, TResult = any> {
|
|
|
124
124
|
handler: ExportedHandler<TEvent, TContext, TResult>;
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
type UseifyPlugin = {
|
|
128
128
|
mount?: (data: {
|
|
129
129
|
config: Config;
|
|
130
130
|
}) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/func",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.454",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,12 +22,8 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@faasjs/deep_merge": "^0.0.2-beta.
|
|
26
|
-
"@faasjs/logger": "^0.0.2-beta.
|
|
27
|
-
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"tsup": "*",
|
|
30
|
-
"typescript": "*"
|
|
25
|
+
"@faasjs/deep_merge": "^0.0.2-beta.454",
|
|
26
|
+
"@faasjs/logger": "^0.0.2-beta.454"
|
|
31
27
|
},
|
|
32
28
|
"engines": {
|
|
33
29
|
"npm": ">=8.0.0",
|