New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@contentrain/types

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentrain/types

Core type definitions for Contentrain SDK.

  • 1.0.0
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

@contentrain/types

Core type definitions for Contentrain SDK.

Installation

npm install @contentrain/types

Usage

import type {
  ContentrainBaseModel,
  ContentrainConfig,
  ContentrainField,
  ContentrainModelMetadata
} from '@contentrain/types'

// Model metadata example
const metadata: ContentrainModelMetadata = {
  modelId: 'posts',
  fields: [
    {
      id: 'title',
      type: 'string',
      required: true,
      componentId: 'single-line-text'
    }
  ],
  localization: true
}

// Content model example
interface Post extends ContentrainBaseModel {
  title: string
  content: string
}

Type Definitions

ContentrainConfig

Configuration type for the SDK.

interface ContentrainConfig {
  contentPath?: string
  modelsPath?: string
  assetsPath?: string
  locale?: string
}

ContentrainModelMetadata

Type definition for model metadata.

interface ContentrainModelMetadata {
  modelId: string
  fields: ContentrainField[]
  localization?: boolean
}

ContentrainField

Type definition for model fields.

interface ContentrainField {
  id: string
  type: string
  required: boolean
  componentId: string
  relation?: {
    model: string
    multiple: boolean
  }
}

ContentrainBaseModel

Base type that all content models inherit from.

interface ContentrainBaseModel {
  ID: string
  createdAt: string
  updatedAt: string
  status: string
  scheduled: boolean
}

License

MIT

FAQs

Package last updated on 04 Jan 2025

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