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:
BasicProfile
: see Basic Profile CIPDefinition
(CIP to be defined)DocIdDocIdMap
: see DocId to DocId Map CIPDocIdMap
: see DocId Map CIPIdentityIndex
see Identity Index CIPStringMap
: see String Map CIP
schemasList
An array of SchemaItem
of the exported schemas
API
isSchemaSecure
Arguments
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
ceramic: CeramicApi
item: SchemaItem
Returns Promise<string>
the docId of the published schema
publishSchemas
Creates or updates schemas on the Ceramic network
Arguments
config: PublishConfig
Returns Promise<Record<string, string>>
the name to docId record of the published schemas
License
Apache-2.0 OR MIT