Sheetbase commonly used models.
npm install @sheetbase/modelsnpm install --save @sheetbase/models
ts
import { Post } from '@sheetbase/models';
const posts: Post[] = [];
const post: Post = {};
`
Models
$3
Schema | Type | Sample
sheetbase db create categories
$3
Schema | Type | Sample
sheetbase db create tags
$3
Schema | Type | Sample
sheetbase db create pages
$3
Schema | Type | Sample
sheetbase db create posts
$3
Schema | Type | Sample
sheetbase db create authors
$3
Schema | Type | Sample
sheetbase db create threads
$3
Schema | Type
sheetbase db create users
$3
Schema | Type | Sample
sheetbase db create options
$3
Schema | Type | Sample
sheetbase db create bundles
$3
Schema | Type | Sample
sheetbase db create audios
$3
Schema | Type | Sample
sheetbase db create videos
$3
Schema | Type | Sample
sheetbase db create products
$3
Schema | Type
sheetbase db create orders
$3
Schema | Type
sheetbase db create properties
$3
Schema | Type | Sample
sheetbase db create notifications
$3
Schema | Type | Sample
sheetbase db create promotions
Field order
Sheet fields are sorted by groups.
- Ids: #, title, $key
- type
- Status: status
- createdAt, updatedAt
- authors
- Images: thumbnail, image
- Content: description | excerpt, content
- (Specific properties)
- locale
- origin
- parents
- relationships
- Taxonomies: categories, tags, ...
- Rating: rating
- Sharing: sharing
- Statistics: viewCount, likeCount, commentCount
- keywords
- Extras: meta
Schema
Every model is defined in a .json file. File name is a plural string of a content type (categories, posts, ...) and is used as the model name.
`ts
export interface Schema {
gid: string | number; // will be corverted to string
public?: boolean;
dataUrl?: string;
schema: SchemaItem[];
}
export interface SchemaItem {
name: string;
width?: number;
note?: string;
}
`
Gid
A Google Sheets sheet is indentified by its name (categories, posts, ...) or its gid (a string number as can be seen in the url #gid=0). @sheetbase/client uses the gid to request the public data accordingly.
$3
A built-in model names its gid with 3 characters string number, prefix by 1.
- :blue_heart: 10x: major sheets
- :green_heart: 11x-15x: custom content public sheets
- :heart: 16x-17x: private sheets
- :purple_heart: 18x-19x: miscellaneous sheets
$3
You can use any string number (from 1-9 characters) for your custom models, but it should not starts with 1 for 3 characters gid.
Suggested covention:
- :green_heart: [2-9]1x-[2-9]5x: custom content public sheets
- :heart: [2-9]6x-[2-9]7x: private sheets
- :purple_heart: [2-9]8x-[2-9]9x`: miscellaneous sheets