@motiadev/core 0.1.0-beta → 0.1.0-beta.3
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/src/step-validator.js +3 -0
- package/dist/src/types.d.ts +15 -0
- package/package.json +1 -1
|
@@ -65,6 +65,7 @@ const eventSchema = zod_1.z
|
|
|
65
65
|
virtualEmits: emits.optional(),
|
|
66
66
|
input: zod_1.z.union([jsonSchema, zod_1.z.null()]).optional(),
|
|
67
67
|
flows: zod_1.z.array(zod_1.z.string()).optional(),
|
|
68
|
+
includeFiles: zod_1.z.array(zod_1.z.string()).optional(),
|
|
68
69
|
})
|
|
69
70
|
.strict();
|
|
70
71
|
const apiSchema = zod_1.z
|
|
@@ -79,6 +80,7 @@ const apiSchema = zod_1.z
|
|
|
79
80
|
virtualSubscribes: zod_1.z.array(zod_1.z.string()).optional(),
|
|
80
81
|
flows: zod_1.z.array(zod_1.z.string()).optional(),
|
|
81
82
|
bodySchema: zod_1.z.union([jsonSchema, zod_1.z.null()]).optional(),
|
|
83
|
+
includeFiles: zod_1.z.array(zod_1.z.string()).optional(),
|
|
82
84
|
})
|
|
83
85
|
.strict();
|
|
84
86
|
const cronSchema = zod_1.z
|
|
@@ -90,6 +92,7 @@ const cronSchema = zod_1.z
|
|
|
90
92
|
virtualEmits: emits.optional(),
|
|
91
93
|
emits: emits,
|
|
92
94
|
flows: zod_1.z.array(zod_1.z.string()).optional(),
|
|
95
|
+
includeFiles: zod_1.z.array(zod_1.z.string()).optional(),
|
|
93
96
|
})
|
|
94
97
|
.strict();
|
|
95
98
|
const validateStep = (step) => {
|
package/dist/src/types.d.ts
CHANGED
|
@@ -32,6 +32,11 @@ export type EventConfig<TInput extends ZodObject<any> = any> = {
|
|
|
32
32
|
virtualEmits?: Emit[];
|
|
33
33
|
input: TInput;
|
|
34
34
|
flows?: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Files to include in the step bundle.
|
|
37
|
+
* Needs to be relative to the step file.
|
|
38
|
+
*/
|
|
39
|
+
includeFiles?: string[];
|
|
35
40
|
};
|
|
36
41
|
export type NoopConfig = {
|
|
37
42
|
type: 'noop';
|
|
@@ -53,6 +58,11 @@ export type ApiRouteConfig = {
|
|
|
53
58
|
virtualSubscribes?: string[];
|
|
54
59
|
flows?: string[];
|
|
55
60
|
bodySchema?: ZodObject<any>;
|
|
61
|
+
/**
|
|
62
|
+
* Files to include in the step bundle.
|
|
63
|
+
* Needs to be relative to the step file.
|
|
64
|
+
*/
|
|
65
|
+
includeFiles?: string[];
|
|
56
66
|
};
|
|
57
67
|
export type ApiRequest = {
|
|
58
68
|
pathParams: Record<string, string>;
|
|
@@ -74,6 +84,11 @@ export type CronConfig = {
|
|
|
74
84
|
virtualEmits?: Emit[];
|
|
75
85
|
emits: Emit[];
|
|
76
86
|
flows?: string[];
|
|
87
|
+
/**
|
|
88
|
+
* Files to include in the step bundle.
|
|
89
|
+
* Needs to be relative to the step file.
|
|
90
|
+
*/
|
|
91
|
+
includeFiles?: string[];
|
|
77
92
|
};
|
|
78
93
|
export type CronHandler = (ctx: FlowContext) => Promise<void>;
|
|
79
94
|
export type StepHandler<T> = T extends EventConfig<any> ? EventHandler<T['input']> : T extends ApiRouteConfig ? ApiRouteHandler : T extends CronConfig ? CronHandler : never;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@motiadev/core",
|
|
3
3
|
"description": "Core functionality for the Motia framework, providing the foundation for building event-driven workflows.",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
|
-
"version": "0.1.0-beta",
|
|
5
|
+
"version": "0.1.0-beta.3",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"body-parser": "^1.20.3",
|
|
8
8
|
"colors": "^1.4.0",
|