-
-
Notifications
You must be signed in to change notification settings - Fork 889
feat: index json schemas on tasks and schemaTask #2351
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
Changes from 13 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
f24423e
Add payload schema handling for task indexing
ericallam 4b840a2
Refactor: Remove getSchemaToJsonSchema in favor of schemaToJsonSchema
ericallam a86dd5e
Add support for Zod 4 in schema-to-json
ericallam 9350900
Revise schema-to-json for bundle safety and tests
ericallam 3935c1e
Refine JSON Schema typing across packages
ericallam bfd3645
Add JSON Schema examples using various libraries
ericallam 7d7a3c4
Refactor SDK to encapsulate schema-to-json package
ericallam 6b1ff95
Add JSONSchema type for payloadSchema in tasks
ericallam 7b224f4
Add JSON schema testing and revert package dependencies
ericallam 05ad00f
Refactor JSON Schema test files for clarity
ericallam 9cb8e24
Fixed some stuff
ericallam 66f136d
WIP
ericallam 6472427
we now convert schema to jsonSchema on the CLI side via the indexing
ericallam 5371af6
Remove the json-schema-test reference project
ericallam 4bdc59b
Improve schema-to-json peer deps and fix effect schema
ericallam 1b4d0e1
Explain the casting and match the version numbers
ericallam e1dd635
Fixed a bunch more schema stuff
ericallam 56e5d26
Don't clean files that might be written to
ericallam 6dfb3dd
Don't use a custom version of vitest in the new package
ericallam 002755d
fix attw in schema-to-json
ericallam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...isma/migrations/20250730084611_add_payload_schema_to_background_worker_task/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| -- AlterTable | ||
| ALTER TABLE "BackgroundWorkerTask" ADD COLUMN "payloadSchema" JSONB; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| /** | ||
| * JSON Schema type definition - compatible with JSON Schema Draft 7 | ||
| * Based on the JSONSchema7 type from @types/json-schema but defined inline to avoid import issues | ||
| */ | ||
| export interface JSONSchema { | ||
| $id?: string; | ||
| $ref?: string; | ||
| $schema?: string; | ||
| $comment?: string; | ||
|
|
||
| type?: JSONSchemaType | JSONSchemaType[]; | ||
| enum?: any[]; | ||
| const?: any; | ||
|
|
||
| // Number/Integer validations | ||
| multipleOf?: number; | ||
| maximum?: number; | ||
| exclusiveMaximum?: number; | ||
| minimum?: number; | ||
| exclusiveMinimum?: number; | ||
|
|
||
| // String validations | ||
| maxLength?: number; | ||
| minLength?: number; | ||
| pattern?: string; | ||
| format?: string; | ||
|
|
||
| // Array validations | ||
| items?: JSONSchema | JSONSchema[]; | ||
| additionalItems?: JSONSchema | boolean; | ||
| maxItems?: number; | ||
| minItems?: number; | ||
| uniqueItems?: boolean; | ||
| contains?: JSONSchema; | ||
|
|
||
| // Object validations | ||
| maxProperties?: number; | ||
| minProperties?: number; | ||
| required?: string[]; | ||
| properties?: Record<string, JSONSchema>; | ||
| patternProperties?: Record<string, JSONSchema>; | ||
| additionalProperties?: JSONSchema | boolean; | ||
| dependencies?: Record<string, JSONSchema | string[]>; | ||
| propertyNames?: JSONSchema; | ||
|
|
||
| // Conditional schemas | ||
| if?: JSONSchema; | ||
| then?: JSONSchema; | ||
| else?: JSONSchema; | ||
|
|
||
| // Boolean logic | ||
| allOf?: JSONSchema[]; | ||
| anyOf?: JSONSchema[]; | ||
| oneOf?: JSONSchema[]; | ||
| not?: JSONSchema; | ||
|
|
||
| // Metadata | ||
| title?: string; | ||
| description?: string; | ||
| default?: any; | ||
| readOnly?: boolean; | ||
| writeOnly?: boolean; | ||
| examples?: any[]; | ||
|
|
||
| // Additional properties for extensibility | ||
| [key: string]: any; | ||
| } | ||
|
|
||
| export type JSONSchemaType = | ||
| | "string" | ||
| | "number" | ||
| | "integer" | ||
| | "boolean" | ||
| | "object" | ||
| | "array" | ||
| | "null"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| node_modules | ||
| dist | ||
| .tshy | ||
| .tshy-build | ||
| *.log | ||
| .DS_Store |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.