npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sheetbase/models

v3.0.1

Published

Sheetbase commonly used models.

Downloads

53

Readme

Sheetbase Models

Commonly used sheet structures for using Google Spreadsheet with Sheetbase backend.

License Support me on Patreon PayPal Ask me anything

Install & usage

npm install --save @sheetbase/models

import { Post } from '@sheetbase/models';

const posts: Post[] = [];
const post: Post = {};

Models

:blue_heart: Category 101 :earth_asia:

Schema | Type | Sample

sheetbase db create categories

:blue_heart: Tag 102 :earth_asia:

Schema | Type | Sample

sheetbase db create tags

:blue_heart: Page 103 :earth_asia:

Schema | Type | Sample

sheetbase db create pages

:blue_heart: Post 104 :earth_asia:

Schema | Type | Sample

sheetbase db create posts

:blue_heart: Author 105 :earth_asia:

Schema | Type | Sample

sheetbase db create authors

:blue_heart: Thread 106 :earth_asia:

Schema | Type | Sample

sheetbase db create threads

:blue_heart: User 107 :x:

Schema | Type

sheetbase db create users

:blue_heart: Option 108 :earth_asia:

Schema | Type | Sample

sheetbase db create options

:green_heart: Bundle 111 :earth_asia:

Schema | Type | Sample

sheetbase db create bundles

:green_heart: Audio 112 :earth_asia:

Schema | Type | Sample

sheetbase db create audios

:green_heart: Video 113 :earth_asia:

Schema | Type | Sample

sheetbase db create videos

:green_heart: Product 114 :earth_asia:

Schema | Type | Sample

sheetbase db create products

:heart: Order 161 :x:

Schema | Type

sheetbase db create orders

:heart: Property 162 :x:

Schema | Type

sheetbase db create properties

:purple_heart: Notification 181 :earth_asia:

Schema | Type | Sample

sheetbase db create notifications

:purple_heart: Promotion 182 :earth_asia:

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.

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.

Built-in models

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

Custom models

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

Lisence

Sheetbase Models is released under the MIT license.