Typescript HTTP Driver
Connection
Driver Params
DriverTlsConfig
class
TLS settings for https addresses. Without them, the driver trusts the certificate authorities that the runtime trusts by default.
| Name | Type | Description |
|---|---|---|
|
|
The path to the PEM file with the certificate of the CA that signed the servers' certificates. When set, the driver trusts only this CA, and every address must use https. The file is read on the first request, and requests fail with HDR3 if it cannot be used. Supported in Node.js only: browsers trust the certificates of their own trust store. |
TransactionOptions
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
TypeDBHttpDriver
class
method TypeDBHttpDriver
new TypeDBHttpDriver(params: DriverParams): TypeDBHttpDriver
| Name | Description | Type |
|---|---|---|
|
|
TypeDBHttpDriver
method analyze
analyze( transactionId: string, query: string, analyzeOptions?: AnalyzeOptions, ): Promise<ApiResponse<AnalyzeResponse>>
| Name | Description | Type |
|---|---|---|
|
|
|
|
|
|
|
|
Promise<ApiResponse<AnalyzeResponse>>
method closeTransaction
closeTransaction(transactionId: string): Promise<ApiResponse>
| Name | Description | Type |
|---|---|---|
|
|
Promise<ApiResponse>
method commitTransaction
commitTransaction(transactionId: string): Promise<ApiResponse>
| Name | Description | Type |
|---|---|---|
|
|
Promise<ApiResponse>
method createDatabase
createDatabase(name: string): Promise<ApiResponse>
| Name | Description | Type |
|---|---|---|
|
|
Promise<ApiResponse>
method createUser
createUser(username: string, password: string): Promise<ApiResponse>
| Name | Description | Type |
|---|---|---|
|
|
|
|
|
Promise<ApiResponse>
method deleteDatabase
deleteDatabase(name: string): Promise<ApiResponse>
| Name | Description | Type |
|---|---|---|
|
|
Promise<ApiResponse>
method deleteUser
deleteUser(username: string): Promise<ApiResponse>
| Name | Description | Type |
|---|---|---|
|
|
Promise<ApiResponse>
method getCurrentUser
getCurrentUser(): Promise<ApiResponse<User>>
Promise<ApiResponse<User>>
method getDatabase
getDatabase(name: string): Promise<ApiResponse<Database>>
| Name | Description | Type |
|---|---|---|
|
|
Promise<ApiResponse<Database>>
method getDatabaseSchema
getDatabaseSchema(name: string): Promise<ApiResponse<string>>
| Name | Description | Type |
|---|---|---|
|
|
Promise<ApiResponse<string>>
method getDatabaseTypeSchema
getDatabaseTypeSchema(name: string): Promise<ApiResponse<string>>
| Name | Description | Type |
|---|---|---|
|
|
Promise<ApiResponse<string>>
method getDatabases
getDatabases(): Promise<ApiResponse<DatabasesListResponse>>
Promise<ApiResponse<DatabasesListResponse>>
method getServers
getServers(): Promise<ApiResponse<ServersListResponse>>
Promise<ApiResponse<ServersListResponse>>
method getUser
getUser(username: string): Promise<ApiResponse<User>>
| Name | Description | Type |
|---|---|---|
|
|
Promise<ApiResponse<User>>
method getUsers
getUsers(): Promise<ApiResponse<UsersListResponse>>
Promise<ApiResponse<UsersListResponse>>
method oneShotQuery
oneShotQuery( query: string, commit: boolean, databaseName: string, transactionType: TransactionType, transactionOptions?: TransactionOptions, queryOptions?: QueryOptions, givenRows?: GivenRows, ): Promise<ApiResponse<QueryResponse>>
| Name | Description | Type |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Promise<ApiResponse<QueryResponse>>
method openTransaction
openTransaction( databaseName: string, transactionType: TransactionType, transactionOptions?: TransactionOptions, ): Promise<ApiResponse<TransactionOpenResponse>>
| Name | Description | Type |
|---|---|---|
|
|
|
|
|
|
|
|
Promise<ApiResponse<TransactionOpenResponse>>
method query
query( transactionId: string, query: string, queryOptions?: QueryOptions, givenRows?: GivenRows, ): Promise<ApiResponse<QueryResponse>>
| Name | Description | Type |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
Promise<ApiResponse<QueryResponse>>
method rollbackTransaction
rollbackTransaction(transactionId: string): Promise<ApiResponse>
| Name | Description | Type |
|---|---|---|
|
|
Promise<ApiResponse>
Static Functions
class
method allOrigins
allOrigins(params: DriverParams): string[]
Return all configured origins for connection error fallback.
| Name | Description | Type |
|---|---|---|
|
|
string[]
method hostPortFromOrigin
hostPortFromOrigin(origin: string): string
| Name | Description | Type |
|---|---|---|
|
|
string
method isBasicParams
isBasicParams(params: DriverParams): params is DriverParamsBasic
| Name | Description | Type |
|---|---|---|
|
|
params is DriverParamsBasic
method isTranslatedParams
isTranslatedParams(params: DriverParams): params is DriverParamsTranslated
| Name | Description | Type |
|---|---|---|
|
|
params is DriverParamsTranslated
Response
ConceptDocumentsQueryResponse
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ConceptRowsQueryResponse
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OkQueryResponse
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
Static Functions
class
method driverError
driverError(code: string, message: string): ApiErrorResponse
| Name | Description | Type |
|---|---|---|
|
|
|
|
|
ApiErrorResponse
method isApiError
isApiError(err: any): err is ApiError
| Name | Description | Type |
|---|---|---|
|
|
err is ApiError
method isApiErrorResponse
isApiErrorResponse(res: ApiResponse): res is ApiErrorResponse
| Name | Description | Type |
|---|---|---|
|
|
res is ApiErrorResponse
method isMisdirectedError
isMisdirectedError(err: any): err is MisdirectedError
| Name | Description | Type |
|---|---|---|
|
|
err is MisdirectedError
method isOkResponse
isOkResponse<OK_RES>(res: ApiResponse<OK_RES>): res is ApiOkResponse<OK_RES>
| Name | Description | Type |
|---|---|---|
|
|
res is ApiOkResponse<OK_RES>
method parseJson
parseJson(text: string): any
Parses JSON, returning a bigint for any integer a number cannot hold exactly. Otherwise behaves as JSON.parse, which reads every number as a double and so rounds integers beyond 2^53.
The type of an integer therefore depends on its magnitude: a number below 2^53 and a bigint from there up, so compare with == rather than === if either is possible.
| Name | Description | Type |
|---|---|---|
|
|
any
Concept
Attribute
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AttributeType
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
Analyze
AnalyzedConjunction
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
AnalyzedFetch
class
AnalyzedFetch:
| { elements: AnalyzedFetch; tag: "list" }
| { possibleFields: FetchAnnotationFieldEntry[]; tag: "object" }
| { tag: "value"; valueTypes: ValueType[] }
AnalyzedFunction
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AnalyzedPipeline
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
ConjunctionAnnotations
class
| Name | Type | Description |
|---|---|---|
|
|
ConstraintAny
class
ConstraintAny:
| ConstraintIsa
| ConstraintIsaExact
| ConstraintHas
| ConstraintLinks
| ConstraintSub
| ConstraintSubExact
| ConstraintOwns
| ConstraintRelates
| ConstraintPlays
| ConstraintExpression
| ConstraintFunction
| ConstraintComparison
| ConstraintIs
| ConstraintIid
| ConstraintDeleteConcepts
| ConstraintKind
| ConstraintValue
| ConstraintIsSet
| ConstraintLabel
| ConstraintOr
| ConstraintNot
| ConstraintTry
ConstraintComparison
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ConstraintExpression
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ConstraintFunction
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ConstraintHas
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
ConstraintIid
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
ConstraintIs
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
ConstraintIsa
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
ConstraintIsaExact
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
ConstraintKind
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
ConstraintLabel
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
ConstraintLinks
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ConstraintOwns
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
ConstraintPlays
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
ConstraintRelates
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
ConstraintSub
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
ConstraintSubExact
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
ConstraintValue
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
ConstraintVertexAny
class
ConstraintVertexAny:
| ConstraintVertexVariable
| ConstraintVertexLabel
| ConstraintVertexValue
| ConstraintVertexNamedRole
ConstraintVertexNamedRole
class
| Name | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
|
FunctionReturnStructure
class
FunctionReturnStructure:
| {
selector: FunctionSingleReturnSelector;
tag: "single";
variables: VariableId[];
}
| { tag: "stream"; variables: VariableId[] }
| { tag: "check" }
| { reducers: Reducer[]; tag: "reduce" }
PipelineStage
class
PipelineStage:
| { block: ConjunctionIndex; tag: "match" }
| { block: ConjunctionIndex; tag: "insert" }
| {
block: ConjunctionIndex;
deletedVariables: VariableId[];
tag: "delete";
}
| { block: ConjunctionIndex; tag: "put" }
| { block: ConjunctionIndex; tag: "update" }
| { tag: "select"; variables: VariableId[] }
| {
tag: "sort";
variables: { tag: "Ascending" | "Descending"; variable: VariableId }[];
}
| { tag: "require"; variables: VariableId }
| { offset: number; tag: "offset" }
| { limit: number; tag: "limit" }
| { tag: "distinct" }
| {
groupby: VariableId[];
reducers: { assigned: VariableId; reducer: Reducer }[];
tag: "reduce";
}