Typescript HTTP Driver

Connection

Database

Fields
Name Type Description

name

string

Driver Params

DriverParams

DriverParams: DriverParamsBasic | DriverParamsTranslated

DriverParamsBasic

Fields
Name Type Description

addresses

string

password

string

username

string

DriverParamsTranslated

Fields
Name Type Description

password

string

translatedAddresses

TranslatedAddress

username

string

TransactionOptions

Fields
Name Type Description

schemaLockAcquireTimeoutMillis

number

transactionTimeoutMillis

number

TransactionType

TransactionType: "read" | "write" | "schema"

TranslatedAddress

Fields
Name Type Description

external

string

internal

string

TypeDBHttpDriver

TypeDBHttpDriver

new TypeDBHttpDriver(params: DriverParams): TypeDBHttpDriver
Input parameters
Name Description Type

params

DriverParams

Returns

TypeDBHttpDriver

analyze

analyze( transactionId: string, query: string, analyzeOptions?: AnalyzeOptions, ): Promise<ApiResponse<AnalyzeResponse>>
Input parameters
Name Description Type

transactionId

string

query

string

analyzeOptions

AnalyzeOptions

Returns

Promise<ApiResponse<AnalyzeResponse>>

closeTransaction

closeTransaction(transactionId: string): Promise<ApiResponse>
Input parameters
Name Description Type

transactionId

string

Returns

Promise<ApiResponse>

commitTransaction

commitTransaction(transactionId: string): Promise<ApiResponse>
Input parameters
Name Description Type

transactionId

string

Returns

Promise<ApiResponse>

createDatabase

createDatabase(name: string): Promise<ApiResponse>
Input parameters
Name Description Type

name

string

Returns

Promise<ApiResponse>

createUser

createUser(username: string, password: string): Promise<ApiResponse>
Input parameters
Name Description Type

username

string

password

string

Returns

Promise<ApiResponse>

deleteDatabase

deleteDatabase(name: string): Promise<ApiResponse>
Input parameters
Name Description Type

name

string

Returns

Promise<ApiResponse>

deleteUser

deleteUser(username: string): Promise<ApiResponse>
Input parameters
Name Description Type

username

string

Returns

Promise<ApiResponse>

getCurrentUser

getCurrentUser(): Promise<ApiResponse<User>>
Returns

Promise<ApiResponse<User>>

getDatabase

getDatabase(name: string): Promise<ApiResponse<Database>>
Input parameters
Name Description Type

name

string

Returns

Promise<ApiResponse<Database>>

getDatabaseSchema

getDatabaseSchema(name: string): Promise<ApiResponse<string>>
Input parameters
Name Description Type

name

string

Returns

Promise<ApiResponse<string>>

getDatabaseTypeSchema

getDatabaseTypeSchema(name: string): Promise<ApiResponse<string>>
Input parameters
Name Description Type

name

string

Returns

Promise<ApiResponse<string>>

getDatabases

getDatabases(): Promise<ApiResponse<DatabasesListResponse>>
Returns

Promise<ApiResponse<DatabasesListResponse>>

getUser

getUser(username: string): Promise<ApiResponse<User>>
Input parameters
Name Description Type

username

string

Returns

Promise<ApiResponse<User>>

getUsers

getUsers(): Promise<ApiResponse<UsersListResponse>>
Returns

Promise<ApiResponse<UsersListResponse>>

health

health(): Promise<ApiResponse>
Returns

Promise<ApiResponse>

oneShotQuery

oneShotQuery( query: string, commit: boolean, databaseName: string, transactionType: TransactionType, transactionOptions?: TransactionOptions, queryOptions?: QueryOptions, ): Promise<ApiResponse<QueryResponse>>
Input parameters
Name Description Type

query

string

commit

boolean

databaseName

string

transactionType

TransactionType

transactionOptions

TransactionOptions

queryOptions

QueryOptions

Returns

Promise<ApiResponse<QueryResponse>>

openTransaction

openTransaction( databaseName: string, transactionType: TransactionType, transactionOptions?: TransactionOptions, ): Promise<ApiResponse<TransactionOpenResponse>>
Input parameters
Name Description Type

databaseName

string

transactionType

TransactionType

transactionOptions

TransactionOptions

Returns

Promise<ApiResponse<TransactionOpenResponse>>

query

query( transactionId: string, query: string, queryOptions?: QueryOptions, ): Promise<ApiResponse<QueryResponse>>
Input parameters
Name Description Type

transactionId

string

query

string

queryOptions

QueryOptions

Returns

Promise<ApiResponse<QueryResponse>>

rollbackTransaction

rollbackTransaction(transactionId: string): Promise<ApiResponse>
Input parameters
Name Description Type

transactionId

string

Returns

Promise<ApiResponse>

updateUser

updateUser(username: string, password: string): Promise<ApiResponse>
Input parameters
Name Description Type

username

string

password

string

Returns

Promise<ApiResponse>

version

version(): Promise<ApiResponse<VersionResponse>>
Returns

Promise<ApiResponse<VersionResponse>>

User

Fields
Name Type Description

username

string

Static Functions

isBasicParams

isBasicParams(params: DriverParams): params is DriverParamsBasic
Input parameters
Name Description Type

params

DriverParams

Returns

params is DriverParamsBasic

isTranslatedParams

isTranslatedParams(params: DriverParams): params is DriverParamsTranslated
Input parameters
Name Description Type

params

DriverParams

Returns

params is DriverParamsTranslated

remoteOrigin

remoteOrigin(params: DriverParams): string
Input parameters
Name Description Type

params

DriverParams

Returns

string

Response

Answer

Answer: ConceptRowAnswer | ConceptDocument

AnswerType

AnswerType: "ok" | "conceptRows" | "conceptDocuments"

ApiError

Fields
Name Type Description

code

string

message

string

ApiErrorResponse

Fields
Name Type Description

err

ApiError

status

number

ApiOkResponse<OK_RES>

Fields
Name Type Description

ok

OK_RES

ApiResponse<OK_RES>

ApiResponse: ApiOkResponse<OK_RES> | ApiErrorResponse

ConceptDocumentsQueryResponse

Fields
Name Type Description

answerType

"conceptDocuments"

answers

Object

comment

string

query

AnalyzedPipeline

queryType

QueryType

ConceptRow

Fields
Name Type Description

[varName: string]

Concept

ConceptRowAnswer

Fields
Name Type Description

data

ConceptRow

involvedBlocks

number

ConceptRowsQueryResponse

Fields
Name Type Description

answerType

"conceptRows"

answers

ConceptRowAnswer

comment

string

query

AnalyzedPipeline

queryType

QueryType

DatabasesListResponse

Fields
Name Type Description

databases

Database

Distribution

Distribution: "TypeDB Cluster" | "TypeDB CE"

OkQueryResponse

Fields
Name Type Description

answerType

"ok"

comment

string

query

AnalyzedPipeline

queryType

QueryType

SignInResponse

Fields
Name Type Description

token

string

TransactionOpenResponse

Fields
Name Type Description

transactionId

string

UsersListResponse

Fields
Name Type Description

users

User

VersionResponse

Fields
Name Type Description

distribution

Distribution

version

string

Static Functions

isApiError

isApiError(err: any): err is ApiError
Input parameters
Name Description Type

err

any

Returns

err is ApiError

isApiErrorResponse

isApiErrorResponse(res: ApiResponse): res is ApiErrorResponse
Input parameters
Name Description Type

res

ApiResponse

Returns

res is ApiErrorResponse

isOkResponse

isOkResponse<OK_RES>(res: ApiResponse<OK_RES>): res is ApiOkResponse<OK_RES>
Input parameters
Name Description Type

res

ApiResponse

Returns

res is ApiOkResponse<OK_RES>

Concept

Attribute

Fields
Name Type Description

iid

string

kind

"attribute"

type

AttributeType

value

any

valueType

ValueType

AttributeType

Fields
Name Type Description

kind

"attributeType"

label

string

valueType

ValueType

Concept

Concept: Type | Entity | Relation | Attribute | Value

ConceptDocument

ConceptDocument: Object

EdgeKind

EdgeKind:
 | "isa"
 | "has"
 | "links"
 | "sub"
 | "owns"
 | "relates"
 | "plays"
 | "isaExact"
 | "subExact"
 | "assigned"
 | "argument"

Entity

Fields
Name Type Description

iid

string

kind

"entity"

type

EntityType

EntityType

Fields
Name Type Description

kind

"entityType"

label

string

InstantiableType

InstantiableType: EntityType | RelationType | AttributeType

Relation

Fields
Name Type Description

iid

string

kind

"relation"

type

RelationType

RelationType

Fields
Name Type Description

kind

"relationType"

label

string

RoleType

Fields
Name Type Description

kind

"roleType"

label

string

ThingKind

ThingKind: "entity" | "relation" | "attribute"

Type

Type: InstantiableType | RoleType

TypeKind

TypeKind: "entityType" | "relationType" | "attributeType" | "roleType"

Value

Fields
Name Type Description

kind

"value"

value

any

valueType

ValueType

ValueKind

ValueKind: "value"

ValueType

ValueType:
 | "boolean"
 | "integer"
 | "double"
 | "decimal"
 | "date"
 | "datetime"
 | "datetime-tz"
 | "duration"
 | "string"
 | "struct"

Query Structure

Query Constraints

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintAny.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintIsa.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintIsaExact.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintHas.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintLinks.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintSub.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintSubExact.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintOwns.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintExpression.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintFunction.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintComparison.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintIs.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintIid.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintKind.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintValue.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintLabel.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintPlays.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintRelates.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryConstraintSpan.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryOptions.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryResponse.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryResponseBase.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryStructure.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryType.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryVariableInfo.adoc[]

Query Vertices

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryVertex.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryVertexKind.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryVertexLabel.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryVertexValue.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/QueryVertexVariable.adoc[]

Unresolved include directive in modules/ROOT/partials/http-ts/api-reference.adoc - include::3.x@external-typedb-driver::partial$http-ts/query-structure/query-structureStaticFunctions.adoc[]