Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

desolid

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

desolid

Minimalistic Headless CMS

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Desolid: Minimalistic Headless CMS

Minimalistic Headless CMS

CMS model

The CMS models using a graphql file schema.graphql in the root directory. here you can see a simple example:

enum UserGroup {
    Admin # default
    User # default
    Editor
    Author
}

@Authorization(
    READ: "user.group = Editor || user.id = this.id",
    CREATE: "true",
    UPDATE: "user.group = Editor || user.id = this.id",
    DELETE: "user.group = Editor || user.id = this.id",
)
type User {
    id: ID!
    createdAt: DateTime! @createdAt
    updatedAt: DateTime! @updatedAt
    email: String! @unique
    phone: String @unique
    group: UserGroup!
    name: String!
    family: String!
    avatar: File
}

@Authorization(
    READ: "this.published || user.group = Editor || user.id = this.author",
    CREATE: "user.group in [Editor, Author]",
    UPDATE: "user.group = Editor || user.id = this.author",
    DELETE: "user.group = Editor || user.id = this.author",
)
type Post {
    id: ID!
    createdAt: DateTime! @createdAt
    updatedAt: DateTime! @updatedAt
    author: User!
    title: String!
    content: String!
    published: Boolean! @default(false)
    categories: [Category!]!
}

@Authorization(
    READ: "true",
    CREATE: "user.group = Editor",
    UPDATE: "user.group = Editor",
    DELETE: "user.group = Editor",
)
type Category {
    id: ID!
    createdAt: DateTime! @createdAt
    updatedAt: DateTime! @updatedAt
    name: String!
    posts: [Post!]!
}

Usgae

TODO: describe

Node

npm install -g desolid

Docker

Docker Compose

Primitive Scalars

  • ID
  • Int
  • Float
  • String
  • Datetime
  • Json
  • File

Authorization

Authorization describes using @Athorization directive. you can indicate the logic using javascript boolean operators:

@Authorization(
    READ: "this.published || user.group = Editor || user.id = this.author",
    CREATE: "user.group in [Editor, Author]",
    UPDATE: "user.group = Editor || user.id = this.author",
    DELETE: "user.group = Editor || user.id = this.author",
)
type Post {
    id: ID!
    createdAt: DateTime! @createdAt
    updatedAt: DateTime! @updatedAt
    author: User!
    title: String!
    content: String!
    published: Boolean! @default(false)
    categories: [Category!]!
}

2 objects are available in the scope:

  • user: refers to the authenticated user
  • this: refers to the selected model record

FAQs

Package last updated on 05 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc