@segha/catalog
v5.0.4
Published
Schemas for Petroglyph Catalog
Readme
@segha/catalog
Schemas for Petroglyph Catalog
Requirements
zod
Installation
pnpm add @segha/catalogUsage
import { ArticleSchema, BookSchema, CatalogArticleSchema, ... } from '@segha/catalog';
// Validate data
const result = ArticleSchema.parse(data);
// Infer TypeScript types
type Article = z.infer<typeof ArticleSchema>;Schemas
- Article
- Book
- CatalogArticle
- CatalogBook
- CatalogClothing
- CatalogMovie
- CatalogWikipedia
- Clothing
- DetailedArticle
- DetailedBook
- DetailedClothing
- DetailedMovie
- DetailedWikipedia
- MetaArticle
- MetaBook
- MetaClothing
- MetaMovie
- MetaWikipedia
- Movie
- Note
- Wikipedia
API Reference
Article
Article
Object containing the following properties:
| Property | Description | Type |
| :------------------ | :--------------------- | :------------------------------------------------------- |
| title (*) | Title of the article | string |
| description | Description | string |
| excerpt | Extract of the article | string |
| author (*) | Authors | Array<string> |
| published | Year of publication | string |
| status (*) | Reading status | 'Pending' \| 'In Progress' \| 'Read' \| 'Consolidated' |
| projects (*) | Projects | Array<string> |
| topics (*) | Topics | Array<string> |
| rating (*) | Rating of the article | number |
| type (*) | | '[[Sources]]' |
| format (*) | | '[[Articles]]' |
| areas (*) | | Array<'[[Knowledge]]'> |
| color (*) | | '#3171B2' |
| icon (*) | | 'newspaper' |
| banner | | string |
| url (*) | URL of the article | string |
(*) Required.
Book
Book
Object containing the following properties:
| Property | Description | Type |
| :------------------------ | :----------------------------------- | :------------------------------------------------------- |
| title (*) | Title of the book | string |
| subtitle | Subtitle of the book | string |
| description | Description of the book | string |
| author (*) | Authors | Array<string> |
| published (*) | Year of publication | string |
| categories (*) | Categories | Array<string> |
| status (*) | Reading status | 'Pending' \| 'In Progress' \| 'Read' \| 'Consolidated' |
| topics (*) | Topics | Array<string> |
| rating (*) | Rating of the book | number |
| online_rating (*) | Online rating | number |
| last_time_read (*) | Last time read | string |
| times_read (*) | Times read | number |
| type (*) | | '[[Sources]]' |
| format (*) | | '[[Books]]' |
| areas (*) | | Array<'[[Knowledge]]'> |
| color (*) | | '#3171B2' |
| icon (*) | | 'book' |
| cover | | string |
| url (*) | URL of the book in Amazon or similar | string |
| read_url (*) | URL of the reading of the book | string |
(*) Required.
CatalogArticle
Article: Data obtained from catalogation
Object containing the following properties:
| Property | Description | Type |
| :---------------- | :--------------------- | :-------------- |
| title (*) | Title of the article | string |
| description | Description | string |
| excerpt | Extract of the article | string |
| author (*) | Authors | Array<string> |
| published | Year of publication | string |
(*) Required.
CatalogBook
Book: Data obtained from catalogation
Object containing the following properties:
| Property | Description | Type |
| :-------------------- | :---------------------- | :-------------- |
| title (*) | Title of the book | string |
| subtitle | Subtitle of the book | string |
| description | Description of the book | string |
| author (*) | Authors | Array<string> |
| published (*) | Year of publication | string |
| categories (*) | Categories | Array<string> |
(*) Required.
CatalogClothing
Clothing item: Catalogable data
Object containing the following properties:
| Property | Description | Type |
| :----------------------- | :------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| name (*) | Descriptive name of the clothing item | string |
| garment (*) | Garment Type | 'Undershirts' \| 'Boxers' \| 'Panties' \| 'Bras' \| 'Socks' \| 'T-Shirts' \| 'Polo Shirts' \| 'Shirts' \| 'Blouses' \| 'Tops' \| 'Sweaters' \| 'Hoodies' \| 'Cardigans' \| 'Jackets' \| 'Pants' \| 'Jeans' \| 'Chinos' \| 'Skirts' \| 'Shorts' \| 'Blazers' \| ... |
| slot (*) | Outfit part | 'Top' \| 'Bottom' \| 'Full Body' \| 'Outer' \| 'Footwear' \| 'Accessories' |
| variants | Structural Details | Array<'Sleeveless' \| 'Short Sleeves' \| 'Long Sleeves' \| 'Round Neck' \| 'V-Neck' \| 'High Neck' \| 'Shirt Collar' \| 'Polo Collar' \| 'Boat Neck' \| 'Mandarin Collar' \| 'Funnel Neck' \| 'Hood' \| 'Overshirt' \| 'Cropped' \| 'Long' \| 'Straight Leg' \| 'Skinny' \| 'Wide' \| 'Cargo' \| 'Flared' \| ...> |
| fit | Fit | 'Fitted' \| 'Slim' \| 'Regular' \| 'Relaxed' \| 'Loose' \| 'Oversized' |
| primary_color (*) | Primary color | 'White' \| 'Black' \| 'Gray' \| 'Beige' \| 'Brown' \| 'Blue' \| 'Green' \| 'Red' \| 'Burgundy' \| 'Pink' \| 'Yellow' \| 'Orange' \| 'Purple' \| 'Camel' \| 'Khaki' \| 'Navy' \| 'Cream' \| 'Gold' \| 'Silver' \| 'Bronze' |
| secondary_color | Secondary color | 'White' \| 'Black' \| 'Gray' \| 'Beige' \| 'Brown' \| 'Blue' \| 'Green' \| 'Red' \| 'Burgundy' \| 'Pink' \| 'Yellow' \| 'Orange' \| 'Purple' \| 'Camel' \| 'Khaki' \| 'Navy' \| 'Cream' \| 'Gold' \| 'Silver' \| 'Bronze' |
| pattern | Pattern | 'Solid' \| 'Stripes' \| 'Plaid' \| 'Polka Dots' \| 'Animal Print' \| 'Floral' \| 'Geometric' \| 'Camouflage' \| 'Graphic Print' \| 'Gradient' |
| materials | Materials | Array<'Cotton' \| 'Linen' \| 'Wool' \| 'Silk' \| 'Leather' \| 'Cashmere' \| 'Suede' \| 'Polyester' \| 'Nylon' \| 'Elastane' \| 'Viscose' \| 'Synthetic Leather' \| 'Gore-Tex' \| 'Denim' \| 'Knit' \| 'Fleece' \| 'Tweed' \| 'Satin' \| 'Velvet' \| 'Jacquard' \| ...> |
| layer (*) | Thermal Layer | 'Base' \| 'Mid' \| 'Outer' |
| season | Seasons | 'Winter' \| 'Summer' \| 'Spring/Fall' \| 'All Year' |
| use_case | Use cases | Array<'Capsule' \| 'Favorite' \| 'Basic' \| 'Sport' \| 'Work' \| 'Event' \| 'Travel' \| 'Home' \| 'Party' \| 'Beach' \| 'Rain' \| 'Extreme Cold'> |
| formality | Formality | 'Very Casual' \| 'Casual' \| 'Smart Casual' \| 'Formal' \| 'Black Tie' |
| brand | The brand of the clothing | string |
(*) Required.
CatalogMovie
Movie: Data obtained from catalogation
Object containing the following properties:
| Property | Description | Type |
| :--------------------- | :------------------------------------------- | :-------------- |
| title (*) | Title of the movie | string |
| description (*) | Description of the movie | string |
| author (*) | Authors. Writers, directors, producers, etc. | Array<string> |
| actors (*) | Actors | Array<string> |
| published (*) | Year of publication | string |
| genres (*) | Genres | Array<string> |
(*) Required.
CatalogWikipedia
Wikipedia entry: Data obtainable from cataloging
Object containing the following properties:
| Property | Description | Type |
| :---------------- | :--------------------------- | :-------------- |
| title (*) | Title of the Wikipedia entry | string |
| description | Description | string |
| excerpt | Extract of the article | string |
| author (*) | Authors | Array<string> |
| published | Year of publication | string |
(*) Required.
Clothing
Clothing item
Object containing the following properties:
| Property | Description | Type | Default |
| :----------------------- | :------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------- |
| name (*) | Descriptive name of the clothing item | string | |
| garment (*) | Garment Type | 'Undershirts' \| 'Boxers' \| 'Panties' \| 'Bras' \| 'Socks' \| 'T-Shirts' \| 'Polo Shirts' \| 'Shirts' \| 'Blouses' \| 'Tops' \| 'Sweaters' \| 'Hoodies' \| 'Cardigans' \| 'Jackets' \| 'Pants' \| 'Jeans' \| 'Chinos' \| 'Skirts' \| 'Shorts' \| 'Blazers' \| ... | |
| slot (*) | Outfit part | 'Top' \| 'Bottom' \| 'Full Body' \| 'Outer' \| 'Footwear' \| 'Accessories' | |
| variants | Structural Details | Array<'Sleeveless' \| 'Short Sleeves' \| 'Long Sleeves' \| 'Round Neck' \| 'V-Neck' \| 'High Neck' \| 'Shirt Collar' \| 'Polo Collar' \| 'Boat Neck' \| 'Mandarin Collar' \| 'Funnel Neck' \| 'Hood' \| 'Overshirt' \| 'Cropped' \| 'Long' \| 'Straight Leg' \| 'Skinny' \| 'Wide' \| 'Cargo' \| 'Flared' \| ...> | |
| fit | Fit | 'Fitted' \| 'Slim' \| 'Regular' \| 'Relaxed' \| 'Loose' \| 'Oversized' | |
| primary_color (*) | Primary color | 'White' \| 'Black' \| 'Gray' \| 'Beige' \| 'Brown' \| 'Blue' \| 'Green' \| 'Red' \| 'Burgundy' \| 'Pink' \| 'Yellow' \| 'Orange' \| 'Purple' \| 'Camel' \| 'Khaki' \| 'Navy' \| 'Cream' \| 'Gold' \| 'Silver' \| 'Bronze' | |
| secondary_color | Secondary color | 'White' \| 'Black' \| 'Gray' \| 'Beige' \| 'Brown' \| 'Blue' \| 'Green' \| 'Red' \| 'Burgundy' \| 'Pink' \| 'Yellow' \| 'Orange' \| 'Purple' \| 'Camel' \| 'Khaki' \| 'Navy' \| 'Cream' \| 'Gold' \| 'Silver' \| 'Bronze' | |
| pattern | Pattern | 'Solid' \| 'Stripes' \| 'Plaid' \| 'Polka Dots' \| 'Animal Print' \| 'Floral' \| 'Geometric' \| 'Camouflage' \| 'Graphic Print' \| 'Gradient' | |
| materials | Materials | Array<'Cotton' \| 'Linen' \| 'Wool' \| 'Silk' \| 'Leather' \| 'Cashmere' \| 'Suede' \| 'Polyester' \| 'Nylon' \| 'Elastane' \| 'Viscose' \| 'Synthetic Leather' \| 'Gore-Tex' \| 'Denim' \| 'Knit' \| 'Fleece' \| 'Tweed' \| 'Satin' \| 'Velvet' \| 'Jacquard' \| ...> | |
| layer (*) | Thermal Layer | 'Base' \| 'Mid' \| 'Outer' | |
| season | Seasons | 'Winter' \| 'Summer' \| 'Spring/Fall' \| 'All Year' | |
| use_case | Use cases | Array<'Capsule' \| 'Favorite' \| 'Basic' \| 'Sport' \| 'Work' \| 'Event' \| 'Travel' \| 'Home' \| 'Party' \| 'Beach' \| 'Rain' \| 'Extreme Cold'> | |
| formality | Formality | 'Very Casual' \| 'Casual' \| 'Smart Casual' \| 'Formal' \| 'Black Tie' | |
| brand | The brand of the clothing | string | |
| cares | Care Instructions | Array<'Hand Wash' \| 'Machine Wash' \| 'Dry Clean' \| 'Cold' \| 'Hot' \| 'Ironing' \| 'Steam Ironing'> | |
| status | Status | 'New' \| 'Good' \| 'Worn' \| 'Damaged' \| 'Retire' | 'Good' |
| size (*) | | '28' \| '30' \| '32' \| '34' \| '36' \| '37' \| '38' \| '39' \| '40' \| '41' \| '42' \| '43' \| '44' \| '45' \| '46' \| '48' \| 'XS' \| 'S' \| 'M' \| 'L' \| ... | |
| measurements | Measurements | Array<number> | |
| type (*) | | '[[Resources]]' | |
| subtype (*) | | '[[Clothes]]' | |
| areas (*) | | Array<'[[Home]]'> | |
| color (*) | | '#CB6120' | |
| icon (*) | | 'shirt' | |
| cover | | string | |
(*) Required.
DetailedArticle
Article: Additional data
Object containing the following properties:
| Property | Description | Type |
| :------------------ | :-------------------- | :------------------------------------------------------- |
| status (*) | Reading status | 'Pending' \| 'In Progress' \| 'Read' \| 'Consolidated' |
| projects (*) | Projects | Array<string> |
| topics (*) | Topics | Array<string> |
| rating (*) | Rating of the article | number |
(*) Required.
DetailedBook
Book: Additional data
Object containing the following properties:
| Property | Description | Type |
| :------------------------ | :----------------- | :------------------------------------------------------- |
| status (*) | Reading status | 'Pending' \| 'In Progress' \| 'Read' \| 'Consolidated' |
| topics (*) | Topics | Array<string> |
| rating (*) | Rating of the book | number |
| online_rating (*) | Online rating | number |
| last_time_read (*) | Last time read | string |
| times_read (*) | Times read | number |
(*) Required.
DetailedClothing
Clothing item: Additional hard-to-obtain data
Object containing the following properties:
| Property | Description | Type | Default |
| :-------------- | :---------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
| cares | Care Instructions | Array<'Hand Wash' \| 'Machine Wash' \| 'Dry Clean' \| 'Cold' \| 'Hot' \| 'Ironing' \| 'Steam Ironing'> | |
| status | Status | 'New' \| 'Good' \| 'Worn' \| 'Damaged' \| 'Retire' | 'Good' |
| size (*) | | '28' \| '30' \| '32' \| '34' \| '36' \| '37' \| '38' \| '39' \| '40' \| '41' \| '42' \| '43' \| '44' \| '45' \| '46' \| '48' \| 'XS' \| 'S' \| 'M' \| 'L' \| ... | |
| measurements | Measurements | Array<number> | |
(*) Required.
DetailedMovie
Movie: Additional data
Object containing the following properties:
| Property | Description | Type |
| :--------------------------- | :------------------ | :------------------------------------------ |
| status (*) | Watching status | 'Pending' \| 'In Progress' \| 'Completed' |
| topics (*) | Topics | Array<string> |
| rating (*) | Rating of the movie | number |
| online_rating (*) | Online rating | number |
| last_time_watched (*) | Last time watched | string |
| times_watched (*) | Times watched | number |
(*) Required.
DetailedWikipedia
Wikipedia entry: Additional data
Object containing the following properties:
| Property | Description | Type |
| :------------------ | :-------------------- | :------------------------------------------------------- |
| status (*) | Reading status | 'Pending' \| 'In Progress' \| 'Read' \| 'Consolidated' |
| projects (*) | Projects | Array<string> |
| topics (*) | Topics | Array<string> |
| rating (*) | Rating of the article | number |
(*) Required.
MetaArticle
Article: Metadata of Note
Object containing the following properties:
| Property | Description | Type |
| :---------------- | :----------------- | :----------------------- |
| type (*) | | '[[Sources]]' |
| format (*) | | '[[Articles]]' |
| areas (*) | | Array<'[[Knowledge]]'> |
| color (*) | | '#3171B2' |
| icon (*) | | 'newspaper' |
| banner | | string |
| url (*) | URL of the article | string |
(*) Required.
MetaBook
Book: Metadata of Note
Object containing the following properties:
| Property | Description | Type |
| :------------------ | :----------------------------------- | :----------------------- |
| type (*) | | '[[Sources]]' |
| format (*) | | '[[Books]]' |
| areas (*) | | Array<'[[Knowledge]]'> |
| color (*) | | '#3171B2' |
| icon (*) | | 'book' |
| cover | | string |
| url (*) | URL of the book in Amazon or similar | string |
| read_url (*) | URL of the reading of the book | string |
(*) Required.
MetaClothing
Clothing item: Note metadata
Object containing the following properties:
| Property | Type |
| :----------------- | :------------------ |
| type (*) | '[[Resources]]' |
| subtype (*) | '[[Clothes]]' |
| areas (*) | Array<'[[Home]]'> |
| color (*) | '#CB6120' |
| icon (*) | 'shirt' |
| cover | string |
(*) Required.
MetaMovie
Movie: Metadata of Note
Object containing the following properties:
| Property | Description | Type |
| :------------------- | :---------------------------------- | :------------------------ |
| type (*) | | '[[Sources]]' |
| format (*) | | '[[Movies]]' |
| areas (*) | | Array<'[[Creativity]]'> |
| color (*) | | '#BE9207' |
| icon (*) | | 'movie' |
| cover | | string |
| url (*) | URL of the movie in IMDB or similar | string |
| watch_url (*) | URL of the movie in streaming | string |
(*) Required.
MetaWikipedia
Wikipedia entry: Metadata of Note
Object containing the following properties:
| Property | Description | Type | Default |
| :------------------ | :----------------- | :--------------------------- | :------------ |
| type (*) | | '[[Sources]]' | |
| format (*) | | '[[Encyclopedia Entries]]' | |
| areas (*) | | Array<'[[Knowledge]]'> | |
| color (*) | | '#3171B2' | |
| icon | Lucide icon. | string | 'wikipedia' |
| banner | | string | |
| url (*) | URL of the article | string | |
| platform (*) | | 'Wikipedia' | |
(*) Required.
Movie
Movie
Object containing the following properties:
| Property | Description | Type |
| :--------------------------- | :------------------------------------------- | :------------------------------------------ |
| title (*) | Title of the movie | string |
| description (*) | Description of the movie | string |
| author (*) | Authors. Writers, directors, producers, etc. | Array<string> |
| actors (*) | Actors | Array<string> |
| published (*) | Year of publication | string |
| genres (*) | Genres | Array<string> |
| status (*) | Watching status | 'Pending' \| 'In Progress' \| 'Completed' |
| topics (*) | Topics | Array<string> |
| rating (*) | Rating of the movie | number |
| online_rating (*) | Online rating | number |
| last_time_watched (*) | Last time watched | string |
| times_watched (*) | Times watched | number |
| type (*) | | '[[Sources]]' |
| format (*) | | '[[Movies]]' |
| areas (*) | | Array<'[[Creativity]]'> |
| color (*) | | '#BE9207' |
| icon (*) | | 'movie' |
| cover | | string |
| url (*) | URL of the movie in IMDB or similar | string |
| watch_url (*) | URL of the movie in streaming | string |
(*) Required.
Note
Note: Union of all note types
Union of the following possible types:
Wikipedia
Wikipedia entry
Object containing the following properties:
| Property | Description | Type | Default |
| :------------------ | :--------------------------- | :------------------------------------------------------- | :------------ |
| title (*) | Title of the Wikipedia entry | string | |
| description | Description | string | |
| excerpt | Extract of the article | string | |
| author (*) | Authors | Array<string> | |
| published | Year of publication | string | |
| status (*) | Reading status | 'Pending' \| 'In Progress' \| 'Read' \| 'Consolidated' | |
| projects (*) | Projects | Array<string> | |
| topics (*) | Topics | Array<string> | |
| rating (*) | Rating of the article | number | |
| type (*) | | '[[Sources]]' | |
| format (*) | | '[[Encyclopedia Entries]]' | |
| areas (*) | | Array<'[[Knowledge]]'> | |
| color (*) | | '#3171B2' | |
| icon | Lucide icon. | string | 'wikipedia' |
| banner | | string | |
| url (*) | URL of the article | string | |
| platform (*) | | 'Wikipedia' | |
(*) Required.
