Module: devtools
Development tools library.
Installation
npm install --dev @composedb/devtools
Classes
Type Aliases
AbstractCompositeDefinition
Ƭ AbstractCompositeDefinition: Object
Type declaration
Name | Type |
---|---|
commonEmbeds | string [] |
models | Record <string , AbstractModelDefinition > |
AbstractCreateModelDefinition
Ƭ AbstractCreateModelDefinition: Object
Type declaration
Name | Type |
---|---|
action | "create" |
indices? | FieldsIndex [] |
model | ModelDefinition |
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
Name | Type | Description |
---|---|---|
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? | CompositeViewsDefinition | Additional views merged in the composite in addition to the ones present in the source composites. |
CompositeParams
Ƭ CompositeParams: Object
Composite instance creation parameters.
Type declaration
Name | Type | Description |
---|---|---|
commits | Record <string , StreamCommits > | Model streams commits, that can be pushed to any Ceramic node to ensure the Model streams used by a composite are available. |
definition | InternalCompositeDefinition | Internal metadata describing the composite. |
CreateParams
Ƭ CreateParams: Object
Composite creation parameters from a schema.
Type declaration
Name | Type | Description |
---|---|---|
ceramic | CeramicApi | Ceramic 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? | boolean | Whether to add the Models to the index or not. If true (default), the Ceramic instance must be authenticated with an admin DID. |
schema | string | Composite schema string. |
EnumFieldDefinition
Ƭ EnumFieldDefinition: FieldCommonDefinition
& { name
: string
; type
: "enum"
}
FieldCommonDefinition
Ƭ FieldCommonDefinition: Object
Type declaration
Name | Type |
---|---|
required | boolean |
FromJSONParams
Ƭ FromJSONParams: Object
Composite creation parameters from a JSON-encoded definition.
Type declaration
Name | Type | Description |
---|---|---|
ceramic | CeramicApi | Ceramic instance connected to the node where the Model stream will be pushed. |
definition | EncodedCompositeDefinition | JSON-encoded composite definition. |
index? | boolean | Whether 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
Name | Type |
---|---|
indices | FieldsIndex [] |
properties | ObjectFieldsDefinition |
references | string [] |
relations | ModelRelationsDefinitionV2 |
ObjectFieldDefinition
Ƭ ObjectFieldDefinition: ItemDefinition
| ListFieldDefinition
| ViewFieldDefinition
ObjectFieldsDefinition
Ƭ ObjectFieldsDefinition: Record
<string
, ObjectFieldDefinition
>
ObjectReferenceFieldDefinition
Ƭ ObjectReferenceFieldDefinition: FieldCommonDefinition
& { name
: string
; type
: "object"
}
ParsedCreateModelDefinition
Ƭ ParsedCreateModelDefinition: Object
Type declaration
Name | Type |
---|---|
accountRelation | ModelAccountRelationV2 |
action | "create" |
description | string |
implements | string [] |
interface | boolean |
relations | ModelRelationsDefinitionV2 |
ParsedLoadModelDefinition
Ƭ ParsedLoadModelDefinition: Object
Type declaration
Name | Type |
---|---|
action | "load" |
id | string |
interface | boolean |
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
Name | Type |
---|---|
enums | Record <string , string []> |
models | Record <string , ParsedModelDefinition > |
objects | Record <string , ObjectDefinition > |
ViewFieldDefinition
Ƭ ViewFieldDefinition: FieldCommonDefinition
& RuntimeViewField
Functions
createAbstractCompositeDefinition
▸ createAbstractCompositeDefinition(schema
): AbstractCompositeDefinition
Parameters
Name | Type |
---|---|
schema | string |