-
Notifications
You must be signed in to change notification settings - Fork 3
Simplify function schemas #196
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,9 +16,9 @@ export const FunctionConfigSchema = z.object({ | |
| entry: z.string().min(1, "Entry point cannot be empty"), | ||
| }); | ||
|
|
||
| export const FunctionSchema = FunctionConfigSchema.extend({ | ||
| export const BackendFunctionSchema = FunctionConfigSchema.extend({ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's call in |
||
| entryPath: z.string().min(1, "Entry path cannot be empty"), | ||
| files: z.array(z.string()).min(1, "Function must have at least one file"), | ||
| filePaths: z.array(z.string()).min(1, "Function must have at least one file"), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }); | ||
|
|
||
| export const FunctionDeploySchema = z.object({ | ||
|
|
@@ -38,7 +38,7 @@ export const DeployFunctionsResponseSchema = z.object({ | |
| }); | ||
|
|
||
| export type FunctionConfig = z.infer<typeof FunctionConfigSchema>; | ||
| export type BackendFunction = z.infer<typeof FunctionSchema>; | ||
| export type BackendFunction = z.infer<typeof BackendFunctionSchema>; | ||
| export type FunctionFile = z.infer<typeof FunctionFileSchema>; | ||
| export type FunctionDeploy = z.infer<typeof FunctionDeploySchema>; | ||
| export type DeployFunctionsResponse = z.infer< | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's enough to validate it based on paths - this is not user providing us with arbitrary data. It's our code