WIP: added more options in meta on creation of schedule#5
Merged
PriyanshuPz merged 2 commits intomasterfrom Oct 3, 2025
Merged
WIP: added more options in meta on creation of schedule#5PriyanshuPz merged 2 commits intomasterfrom
PriyanshuPz merged 2 commits intomasterfrom
Conversation
Member
Author
|
@mdkaifansari04 You can use this schema and metadata field in post model export const JSON_PARSER = {
'sch.0.1': {
version: 'sch.0.1',
schema: z.object({
version: z.literal('sch.0.1'),
postType: z.string(),
prompt: z.string().optional(),
unsplashTags: z.array(z.string()).optional(),
}),
parse: (data: any) => {
return JSON_PARSER['sch.0.1'].schema.parse(data);
},
},
} |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
related: Post0HQ/studio#7
This pull request introduces support for enhanced post metadata in the scheduling workflow, including structured validation and parsing of post types, prompts, and Unsplash tags. The changes add new schema definitions, update DTOs, and ensure metadata is consistently stored and validated throughout the scheduling process.
Metadata schema and parsing improvements:
src/lib/prism_json.tsto define strict schemas for post metadata usingzod, supporting multiple schema versions and providing a unified parsing function (parseJsonV).ScheduleServiceto use the new schema for validating and storing metadata incontentParamsandmetadatafields. [1] [2] [3]DTO and type enhancements:
PostTypeenum and corresponding fields (postType,prompt,unsplashTags) toCreateScheduleDto, ensuring type safety and validation for new metadata properties. [1] [2]Service integration updates:
ScheduleServiceto extract and handle new metadata fields fromCreateScheduleDtowhen creating schedules and schedule times.ScheduleServiceto ensure user-based schedule access remains enforced.