Skip to main content
Version: 0.4.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"
modelModelDefinition

AbstractLoadModelDefinition

Ƭ AbstractLoadModelDefinition: ParsedLoadModelDefinition & { views: ModelViewsDefinition }


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
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
propertiesObjectFieldsDefinition
referencesstring[]
relationsModelRelationsDefinition

ObjectFieldDefinition

Ƭ ObjectFieldDefinition: ItemDefinition | ListFieldDefinition | ViewFieldDefinition


ObjectFieldsDefinition

Ƭ ObjectFieldsDefinition: Record<string, ObjectFieldDefinition>


ObjectReferenceFieldDefinition

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


ParsedCreateModelDefinition

Ƭ ParsedCreateModelDefinition: Object

Type declaration

NameType
accountRelationModelAccountRelation
action"create"
descriptionstring
relationsModelRelationsDefinition

ParsedLoadModelDefinition

Ƭ ParsedLoadModelDefinition: Object

Type declaration

NameType
action"load"
idstring

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[]>
interfacesRecord<string, ObjectDefinition>
modelsRecord<string, ParsedModelDefinition>
objectsRecord<string, ObjectDefinition>

ViewFieldDefinition

Ƭ ViewFieldDefinition: FieldCommonDefinition & RuntimeViewField

Functions

createAbstractCompositeDefinition

createAbstractCompositeDefinition(schema): AbstractCompositeDefinition

Parameters

NameType
schemastring

Returns

AbstractCompositeDefinition