@typedb/driver-http 3.11.1 → 3.12.0-rc0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -136,11 +136,11 @@ var TypeDBHttpDriver = class {
136
136
  analyze(transactionId, query, analyzeOptions) {
137
137
  return this.apiPost(`/v1/transactions/${encodeURIComponent(transactionId)}/analyze`, { query, analyzeOptions });
138
138
  }
139
- query(transactionId, query, queryOptions) {
140
- return this.apiPost(`/v1/transactions/${encodeURIComponent(transactionId)}/query`, { query, queryOptions });
139
+ query(transactionId, query, queryOptions, givenRows) {
140
+ return this.apiPost(`/v1/transactions/${encodeURIComponent(transactionId)}/query`, { query, queryOptions, givenRows });
141
141
  }
142
- oneShotQuery(query, commit, databaseName, transactionType, transactionOptions, queryOptions) {
143
- return this.apiPost(`/v1/query`, { query, commit, databaseName, transactionType, transactionOptions, queryOptions });
142
+ oneShotQuery(query, commit, databaseName, transactionType, transactionOptions, queryOptions, givenRows) {
143
+ return this.apiPost(`/v1/query`, { query, commit, databaseName, transactionType, transactionOptions, queryOptions, givenRows });
144
144
  }
145
145
  health() {
146
146
  return this.apiGet(`/v1/health`);
package/dist/index.d.ts CHANGED
@@ -352,6 +352,12 @@ interface ConjunctionAnnotations {
352
352
  [name: VariableId]: VariableAnnotations;
353
353
  };
354
354
  }
355
+ interface Given {
356
+ variables: VariableId[];
357
+ variable_annotations: {
358
+ [name: VariableId]: VariableAnnotations;
359
+ };
360
+ }
355
361
  type AnalyzedFetch = {
356
362
  tag: "list";
357
363
  elements: AnalyzedFetch;
@@ -428,6 +434,7 @@ type QueryResponse = OkQueryResponse | ConceptRowsQueryResponse | ConceptDocumen
428
434
  interface AnalyzeResponse {
429
435
  source: string;
430
436
  preamble: AnalyzedFunction[];
437
+ given: Given | null;
431
438
  query: AnalyzedPipeline;
432
439
  fetch: AnalyzedFetch | null;
433
440
  }
@@ -477,8 +484,8 @@ declare class TypeDBHttpDriver {
477
484
  closeTransaction(transactionId: string): Promise<ApiResponse>;
478
485
  rollbackTransaction(transactionId: string): Promise<ApiResponse>;
479
486
  analyze(transactionId: string, query: string, analyzeOptions?: AnalyzeOptions): Promise<ApiResponse<AnalyzeResponse>>;
480
- query(transactionId: string, query: string, queryOptions?: QueryOptions): Promise<ApiResponse<QueryResponse>>;
481
- oneShotQuery(query: string, commit: boolean, databaseName: string, transactionType: TransactionType, transactionOptions?: TransactionOptions, queryOptions?: QueryOptions): Promise<ApiResponse<QueryResponse>>;
487
+ query(transactionId: string, query: string, queryOptions?: QueryOptions, givenRows?: GivenRows): Promise<ApiResponse<QueryResponse>>;
488
+ oneShotQuery(query: string, commit: boolean, databaseName: string, transactionType: TransactionType, transactionOptions?: TransactionOptions, queryOptions?: QueryOptions, givenRows?: GivenRows): Promise<ApiResponse<QueryResponse>>;
482
489
  health(): Promise<ApiResponse>;
483
490
  version(): Promise<ApiResponse<VersionResponse>>;
484
491
  getServers(): Promise<ApiResponse<ServersListResponse>>;
@@ -522,5 +529,9 @@ interface AnalyzeOptions {
522
529
  interface User {
523
530
  username: string;
524
531
  }
532
+ type GivenRowEntry = Value | Entity | Relation | Attribute | boolean | number | string;
533
+ type GivenRows = {
534
+ [varName: string]: GivenRowEntry;
535
+ }[];
525
536
 
526
- export { type AnalyzeOptions, type AnalyzeResponse, type AnalyzedConjunction, type AnalyzedFetch, type AnalyzedFunction, type AnalyzedPipeline, type Answer, type AnswerType, type ApiError, type ApiErrorResponse, type ApiOkResponse, type ApiResponse, type Attribute, type AttributeType, type Concept, type ConceptDocument, type ConceptDocumentsQueryResponse, type ConceptRow, type ConceptRowAnswer, type ConceptRowsQueryResponse, type ConceptRowsQueryResponseLegacy, type ConjunctionAnnotations, type ConstraintAny, type ConstraintComparison, type ConstraintExpression, type ConstraintExpressionLegacy, type ConstraintFunction, type ConstraintHas, type ConstraintIid, type ConstraintIs, type ConstraintIsa, type ConstraintIsaExact, type ConstraintKind, type ConstraintLabel, type ConstraintLinks, type ConstraintLinksLegacy, type ConstraintNot, type ConstraintOr, type ConstraintOwns, type ConstraintPlays, type ConstraintRelates, type ConstraintSpan, type ConstraintSub, type ConstraintSubExact, type ConstraintTry, type ConstraintValue, type ConstraintVertexAny, type ConstraintVertexLabel, type ConstraintVertexNamedRole, type ConstraintVertexValue, type ConstraintVertexVariable, type Database, type DatabasesListResponse, type Distribution, type DriverParams, type DriverParamsBasic, type DriverParamsTranslated, type EdgeKind, type Entity, type EntityType, type FetchAnnotationFieldEntry, type FunctionReturnStructure, type FunctionSingleReturnSelector, type InstantiableType, type MisdirectedError, type OkQueryResponse, type PipelineStage, type QueryConjunctionLegacy, type QueryOptions, type QueryResponse, type QueryResponseBase, type QueryStructureLegacy, type QueryType, type Reducer, type Relation, type RelationType, type ReplicationRole, type ReplicationStatus, type RoleType, type Server, type ServersListResponse, type SignInResponse, type ThingKind, type TransactionOpenResponse, type TransactionOptions, type TransactionType, type TranslatedAddress, type Type, TypeDBHttpDriver, type TypeKind, type User, type UsersListResponse, type Value, type ValueKind, type ValueType, type VariableAnnotations, type VariableId, type VariableInfo, type VersionResponse, allOrigins, driverError, getVariableName, hostPortFromOrigin, isApiError, isApiErrorResponse, isBasicParams, isMisdirectedError, isOkResponse, isQueryResponseLegacy, isTranslatedParams, remoteOrigin, resolveOrigin };
537
+ export { type AnalyzeOptions, type AnalyzeResponse, type AnalyzedConjunction, type AnalyzedFetch, type AnalyzedFunction, type AnalyzedPipeline, type Answer, type AnswerType, type ApiError, type ApiErrorResponse, type ApiOkResponse, type ApiResponse, type Attribute, type AttributeType, type Concept, type ConceptDocument, type ConceptDocumentsQueryResponse, type ConceptRow, type ConceptRowAnswer, type ConceptRowsQueryResponse, type ConceptRowsQueryResponseLegacy, type ConjunctionAnnotations, type ConstraintAny, type ConstraintComparison, type ConstraintExpression, type ConstraintExpressionLegacy, type ConstraintFunction, type ConstraintHas, type ConstraintIid, type ConstraintIs, type ConstraintIsa, type ConstraintIsaExact, type ConstraintKind, type ConstraintLabel, type ConstraintLinks, type ConstraintLinksLegacy, type ConstraintNot, type ConstraintOr, type ConstraintOwns, type ConstraintPlays, type ConstraintRelates, type ConstraintSpan, type ConstraintSub, type ConstraintSubExact, type ConstraintTry, type ConstraintValue, type ConstraintVertexAny, type ConstraintVertexLabel, type ConstraintVertexNamedRole, type ConstraintVertexValue, type ConstraintVertexVariable, type Database, type DatabasesListResponse, type Distribution, type DriverParams, type DriverParamsBasic, type DriverParamsTranslated, type EdgeKind, type Entity, type EntityType, type FetchAnnotationFieldEntry, type FunctionReturnStructure, type FunctionSingleReturnSelector, type Given, type GivenRowEntry, type GivenRows, type InstantiableType, type MisdirectedError, type OkQueryResponse, type PipelineStage, type QueryConjunctionLegacy, type QueryOptions, type QueryResponse, type QueryResponseBase, type QueryStructureLegacy, type QueryType, type Reducer, type Relation, type RelationType, type ReplicationRole, type ReplicationStatus, type RoleType, type Server, type ServersListResponse, type SignInResponse, type ThingKind, type TransactionOpenResponse, type TransactionOptions, type TransactionType, type TranslatedAddress, type Type, TypeDBHttpDriver, type TypeKind, type User, type UsersListResponse, type Value, type ValueKind, type ValueType, type VariableAnnotations, type VariableId, type VariableInfo, type VersionResponse, allOrigins, driverError, getVariableName, hostPortFromOrigin, isApiError, isApiErrorResponse, isBasicParams, isMisdirectedError, isOkResponse, isQueryResponseLegacy, isTranslatedParams, remoteOrigin, resolveOrigin };
package/dist/index.mjs CHANGED
@@ -136,11 +136,11 @@ var TypeDBHttpDriver = class {
136
136
  analyze(transactionId, query, analyzeOptions) {
137
137
  return this.apiPost(`/v1/transactions/${encodeURIComponent(transactionId)}/analyze`, { query, analyzeOptions });
138
138
  }
139
- query(transactionId, query, queryOptions) {
140
- return this.apiPost(`/v1/transactions/${encodeURIComponent(transactionId)}/query`, { query, queryOptions });
139
+ query(transactionId, query, queryOptions, givenRows) {
140
+ return this.apiPost(`/v1/transactions/${encodeURIComponent(transactionId)}/query`, { query, queryOptions, givenRows });
141
141
  }
142
- oneShotQuery(query, commit, databaseName, transactionType, transactionOptions, queryOptions) {
143
- return this.apiPost(`/v1/query`, { query, commit, databaseName, transactionType, transactionOptions, queryOptions });
142
+ oneShotQuery(query, commit, databaseName, transactionType, transactionOptions, queryOptions, givenRows) {
143
+ return this.apiPost(`/v1/query`, { query, commit, databaseName, transactionType, transactionOptions, queryOptions, givenRows });
144
144
  }
145
145
  health() {
146
146
  return this.apiGet(`/v1/health`);
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@typedb/driver-http", "version": "3.11.1", "description": "TypeDB HTTP Driver", "author": "TypeDB Community <community@typedb.com>", "license": "Apache-2.0", "homepage": "https://typedb.com", "repository": {"type": "git", "url": "https://github.com/typedb/typedb-driver"}, "bugs": {"url": "https://github.com/typedb/typedb-driver/issues"}, "keywords": ["database", "typedb"], "main": "dist/index.cjs", "module": "dist/index.mjs", "types": "dist/index.d.ts", "type": "module", "exports": {".": {"types": "./dist/index.d.ts", "import": "./dist/index.mjs", "require": "./dist/index.cjs"}}, "scripts": {"build:dev": "tsc", "build": "tsup", "test": "cucumber-js", "docs": "typedoc"}, "packageManager": "pnpm@8.15.9", "packageConfig": {"access": "public"}, "devDependencies": {"@cucumber/cucumber": "9.0.0", "@types/node": "24.0.12", "tsup": "8.5.0", "typedoc": "^0.28.7", "typescript": "5.8.3"}}
1
+ {"name": "@typedb/driver-http", "version": "3.12.0-rc0", "description": "TypeDB HTTP Driver", "author": "TypeDB Community <community@typedb.com>", "license": "Apache-2.0", "homepage": "https://typedb.com", "repository": {"type": "git", "url": "https://github.com/typedb/typedb-driver"}, "bugs": {"url": "https://github.com/typedb/typedb-driver/issues"}, "keywords": ["database", "typedb"], "main": "dist/index.cjs", "module": "dist/index.mjs", "types": "dist/index.d.ts", "type": "module", "exports": {".": {"types": "./dist/index.d.ts", "import": "./dist/index.mjs", "require": "./dist/index.cjs"}}, "scripts": {"build:dev": "tsc", "build": "tsup", "test": "cucumber-js", "docs": "typedoc"}, "packageManager": "pnpm@8.15.9", "packageConfig": {"access": "public"}, "devDependencies": {"@cucumber/cucumber": "9.0.0", "@types/node": "24.0.12", "tsup": "8.5.0", "typedoc": "^0.28.7", "typescript": "5.8.3"}}