0.6.0 • Published 5 months ago

notion-api-zod-schema v0.6.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

Zod Schemas for the Notion-API Data-Structures

Zod schemas for the Notion API data sctructure. This is an unofficial package made for personal use only. If you have any suggestions on how to improve this make sure to add an issue or even better, a pull request.

Enjoy!

Installation

npm install notion-api-zod-schemas

Usage

import { z } from 'zod'
import {
	NotionMultiSelectSchema,
	NotionPageSchema,
	NotionTimeSchema,
	NotionTitleSchema,
	NotionUrlSchema,
} from 'notion-api-zod-schema'

const CustomSchema = NotionPageSchema.extend({
	properties: z.object({
		Created: NotionTimeSchema,
		URL: NotionUrlSchema,
		Tags: NotionMultiSelectSchema,
		Name: NotionTitleSchema,
	}),
})
type CustomType = z.infer<typeof CustomSchema>

CustomSchema.parse({
  ... // Your data here
})
0.5.0

5 months ago

0.6.0

5 months ago

0.4.0

9 months ago

0.3.0

9 months ago

0.2.0

9 months ago

0.1.7

9 months ago

0.1.6

9 months ago

0.1.4

9 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.1.0

9 months ago