@ceramicstudio/idx-schemasdeprecated

npm install @ceramicstudio/idx-schemas

Usage no npm install needed!

<script type="module">
  import ceramicstudioIdxSchemas from 'https://cdn.skypack.dev/@ceramicstudio/idx-schemas';
</script>

README

IDX schemas

Installation

npm install @ceramicstudio/idx-schemas

Interfaces and types

CeramicApi

Ceramic API interface exported by the @ceramicnetwork/ceramic-common library

SchemaItem

interface SchemaItem {
  docId?: string
  name: string
  schema: Record<string, unknown>
}

PublishConfig

interface PublishConfig {
  ceramic: CeramicApi
  schemas: Array<SchemaItem>
}

Constants

schemas

A record of all the JSON schemas defined and used by IDX, with the following keys:

schemasList

An array of SchemaItem of the exported schemas

API

isSchemaSecure

Arguments

  1. schema: Record<string, unknown>: the JSON schema definition

Returns boolean

publishSchema

Creates or updates (if a docId is provided) a schema on the Ceramic network

Arguments

  1. ceramic: CeramicApi
  2. item: SchemaItem

Returns Promise<string> the docId of the published schema

publishSchemas

Creates or updates schemas on the Ceramic network

Arguments

  1. config: PublishConfig

Returns Promise<Record<string, string>> the name to docId record of the published schemas

License

Apache-2.0 OR MIT