Skip to main content
Version: 0.8.x

Module: devtools

Development tools library.

Installation

npm install --dev @composedb/devtools

Classes

Type Aliases

AbstractCompositeDefinition

Ƭ AbstractCompositeDefinition: Object

Type declaration

NameType
commonEmbedsstring[]
modelsRecord<string, AbstractModelDefinition>

AbstractCreateModelDefinition

Ƭ AbstractCreateModelDefinition: Object

Type declaration

NameType
action"create"
indices?FieldsIndex[]
modelModelDefinition

AbstractLoadModelDefinition

Ƭ AbstractLoadModelDefinition: ParsedLoadModelDefinition & { indices?: FieldsIndex[] ; views: ModelViewsDefinitionV2 }


AbstractModelDefinition

Ƭ AbstractModelDefinition: AbstractCreateModelDefinition | AbstractLoadModelDefinition


AnySchema

Ƭ AnySchema: ScalarSchema | JSONSchema.Array | JSONSchema.Object


CompositeInput

Ƭ CompositeInput: Composite | CompositeParams

Supported composite input when comparing or merging composites.


CompositeOptions

Ƭ CompositeOptions: Object

Supported options for merging composites.

Type declaration

NameTypeDescription
aliases?Record<string, string>Additional Models aliases merged in the composite in addition to the ones present in the source composites.
commonEmbeds?"all" | "none" | Iterable<string>Behavior to apply for merging common embeds: - none (default) will not set an common embed - all will merge all the common embeds found in any composite - explicit embed names to set as common embeds
views?CompositeViewsDefinitionAdditional views merged in the composite in addition to the ones present in the source composites.

CompositeParams

Ƭ CompositeParams: Object

Composite instance creation parameters.

Type declaration

NameTypeDescription
commitsRecord<string, StreamCommits>Model streams commits, that can be pushed to any Ceramic node to ensure the Model streams used by a composite are available.
definitionInternalCompositeDefinitionInternal metadata describing the composite.

CreateParams

Ƭ CreateParams: Object

Composite creation parameters from a schema.

Type declaration

NameTypeDescription
ceramicCeramicAPICeramic instance connected to the node the new Model streams must be created on. The Ceramic instance must have an authenticated DID attached to it in order to create Models, using the did:key method.
index?booleanWhether to add the Models to the index or not. If true (default), the Ceramic instance must be authenticated with an admin DID.
schemastringComposite schema string.

EnumFieldDefinition

Ƭ EnumFieldDefinition: FieldCommonDefinition & { name: string ; type: "enum" }


FieldCommonDefinition

Ƭ FieldCommonDefinition: Object

Type declaration

NameType
immutable?boolean
requiredboolean

FromJSONParams

Ƭ FromJSONParams: Object

Composite creation parameters from a JSON-encoded definition.

Type declaration

NameTypeDescription
ceramicCeramicAPICeramic instance connected to the node where the Model stream will be pushed.
definitionEncodedCompositeDefinitionJSON-encoded composite definition.
index?booleanWhether to add the Models to the index or not. If true, the Ceramic instance must be authenticated with an admin DID. Defaults to false.

FromModelsParams

Ƭ FromModelsParams: CompositeOptions & { ceramic: CeramicAPI ; index?: boolean ; models: string[] }

Composite creation parameters from existing models.


ItemDefinition

Ƭ ItemDefinition: ReferenceFieldDefinition | ScalarFieldDefinition


ListFieldDefinition

Ƭ ListFieldDefinition: FieldCommonDefinition & { item: ItemDefinition ; maxLength: number ; minLength?: number ; type: "list" }


ObjectDefinition

Ƭ ObjectDefinition: Object

Type declaration

NameType
indicesFieldsIndex[]
propertiesObjectFieldsDefinition
referencesstring[]
relationsModelRelationsDefinitionV2

ObjectFieldDefinition

Ƭ ObjectFieldDefinition: ItemDefinition | ListFieldDefinition | ViewFieldDefinition


ObjectFieldsDefinition

Ƭ ObjectFieldsDefinition: Record<string, ObjectFieldDefinition>


ObjectReferenceFieldDefinition

Ƭ ObjectReferenceFieldDefinition: FieldCommonDefinition & { name: string ; type: "object" }


ParsedCreateModelDefinition

Ƭ ParsedCreateModelDefinition: Object

Type declaration

NameType
accountRelationModelAccountRelationV2
action"create"
descriptionstring
immutableFieldsstring[]
implementsstring[]
interfaceboolean
relationsModelRelationsDefinitionV2

ParsedLoadModelDefinition

Ƭ ParsedLoadModelDefinition: Object

Type declaration

NameType
action"load"
idstring
interfaceboolean

ParsedModelDefinition

Ƭ ParsedModelDefinition: ParsedCreateModelDefinition | ParsedLoadModelDefinition


ReferenceFieldDefinition

Ƭ ReferenceFieldDefinition: EnumFieldDefinition | ObjectReferenceFieldDefinition


ReferenceFieldType

Ƭ ReferenceFieldType: ReferenceFieldDefinition["type"]


ScalarFieldDefinition

Ƭ ScalarFieldDefinition: FieldCommonDefinition & { schema: ScalarSchema ; type: "scalar" }


ScalarSchema

Ƭ ScalarSchema: JSONSchema.Boolean | JSONSchema.Integer | JSONSchema.Number | JSONSchema.String


SchemaDefinition

Ƭ SchemaDefinition: Object

Type declaration

NameType
enumsRecord<string, string[]>
modelsRecord<string, ParsedModelDefinition>
objectsRecord<string, ObjectDefinition>

ViewFieldDefinition

Ƭ ViewFieldDefinition: FieldCommonDefinition & RuntimeViewField

Functions

createAbstractCompositeDefinition

createAbstractCompositeDefinition(schema): AbstractCompositeDefinition

Parameters

NameType
schemastring

Returns

AbstractCompositeDefinition