Comparing version 9.0.0-preview.2 to 9.0.0-preview.3
@@ -18,3 +18,2 @@ "use strict"; | ||
const aql_js_1 = require("./aql.js"); | ||
const cursor_js_1 = require("./cursor.js"); | ||
const documents_js_1 = require("./documents.js"); | ||
@@ -401,125 +400,8 @@ const error_js_1 = require("./error.js"); | ||
} | ||
traversal(startVertex, options) { | ||
return this._db.request({ | ||
method: "POST", | ||
path: "/_api/traversal", | ||
body: { | ||
...options, | ||
startVertex, | ||
edgeCollection: this._name, | ||
}, | ||
}, (res) => res.parsedBody.result); | ||
} | ||
//#endregion | ||
//#region simple queries | ||
list(type = "id") { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/all-keys", | ||
body: { type, collection: this._name }, | ||
}, (res) => new cursor_js_1.BatchedArrayCursor(this._db, res.parsedBody, res.arangojsHostUrl) | ||
.items); | ||
} | ||
all(options) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/all", | ||
body: { | ||
...options, | ||
collection: this._name, | ||
}, | ||
}, (res) => new cursor_js_1.BatchedArrayCursor(this._db, res.parsedBody, res.arangojsHostUrl) | ||
.items); | ||
} | ||
any() { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/any", | ||
body: { collection: this._name }, | ||
}, (res) => res.parsedBody.document); | ||
} | ||
byExample(example, options) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/by-example", | ||
body: { | ||
...options, | ||
example, | ||
collection: this._name, | ||
}, | ||
}, (res) => new cursor_js_1.BatchedArrayCursor(this._db, res.parsedBody, res.arangojsHostUrl) | ||
.items); | ||
} | ||
firstExample(example) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/first-example", | ||
body: { | ||
example, | ||
collection: this._name, | ||
}, | ||
}, (res) => res.parsedBody.document); | ||
} | ||
removeByExample(example, options) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/remove-by-example", | ||
body: { | ||
...options, | ||
example, | ||
collection: this._name, | ||
}, | ||
}); | ||
} | ||
replaceByExample(example, newValue, options) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/replace-by-example", | ||
body: { | ||
...options, | ||
example, | ||
newValue, | ||
collection: this._name, | ||
}, | ||
}); | ||
} | ||
updateByExample(example, newValue, options) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/update-by-example", | ||
body: { | ||
...options, | ||
example, | ||
newValue, | ||
collection: this._name, | ||
}, | ||
}); | ||
} | ||
lookupByKeys(keys) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/lookup-by-keys", | ||
body: { | ||
keys, | ||
collection: this._name, | ||
}, | ||
}, (res) => res.parsedBody.documents); | ||
} | ||
removeByKeys(keys, options) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/remove-by-keys", | ||
body: { | ||
options: options, | ||
keys, | ||
collection: this._name, | ||
}, | ||
}); | ||
} | ||
//#endregion | ||
//#region indexes | ||
indexes(withHidden = false) { | ||
indexes(options) { | ||
return this._db.request({ | ||
path: "/_api/index", | ||
search: { collection: this._name, withHidden: String(withHidden) }, | ||
search: { collection: this._name, ...options }, | ||
}, (res) => res.parsedBody.indexes); | ||
@@ -546,16 +428,2 @@ } | ||
} | ||
fulltext(attribute, query, { index, ...options } = {}) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/fulltext", | ||
body: { | ||
...options, | ||
index: index ? (0, indexes_js_1._indexHandle)(index, this._name) : undefined, | ||
attribute, | ||
query, | ||
collection: this._name, | ||
}, | ||
}, (res) => new cursor_js_1.BatchedArrayCursor(this._db, res.parsedBody, res.arangojsHostUrl) | ||
.items); | ||
} | ||
compact() { | ||
@@ -562,0 +430,0 @@ return this._db.request({ |
@@ -103,3 +103,3 @@ "use strict"; | ||
this._headers.set("x-arango-version", String(this._arangoVersion)); | ||
this._headers.set("x-arango-driver", `arangojs/9.0.0-preview.2 (cloud)`); | ||
this._headers.set("x-arango-driver", `arangojs/9.0.0-preview.3 (cloud)`); | ||
this._loadBalancingStrategy = config.loadBalancingStrategy ?? "NONE"; | ||
@@ -106,0 +106,0 @@ this._precaptureStackTraces = Boolean(config.precaptureStackTraces); |
@@ -15,3 +15,3 @@ /** | ||
*/ | ||
import { ArangoCollection, DocumentCollection, EdgeCollection, TraversalOptions } from "./collection.js"; | ||
import { ArangoCollection, DocumentCollection, EdgeCollection } from "./collection.js"; | ||
import { Database } from "./database.js"; | ||
@@ -1137,36 +1137,3 @@ import { Document, DocumentData, DocumentMetadata, DocumentSelector, Edge, EdgeData, Patch } from "./documents.js"; | ||
removeEdgeDefinition(collection: string | ArangoCollection, dropCollection?: boolean): Promise<GraphInfo>; | ||
/** | ||
* Performs a traversal starting from the given `startVertex` and following | ||
* edges contained in this graph. | ||
* | ||
* See also {@link collection.EdgeCollection#traversal}. | ||
* | ||
* @param startVertex - Document `_id` of a vertex in this graph. | ||
* @param options - Options for performing the traversal. | ||
* | ||
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and are | ||
* no longer supported in ArangoDB 3.12. They can be replaced with AQL queries. | ||
* | ||
* @example | ||
* ```js | ||
* const db = new Database(); | ||
* const graph = db.graph("my-graph"); | ||
* const collection = graph.edgeCollection("edges").collection; | ||
* await collection.import([ | ||
* ["_key", "_from", "_to"], | ||
* ["x", "vertices/a", "vertices/b"], | ||
* ["y", "vertices/b", "vertices/c"], | ||
* ["z", "vertices/c", "vertices/d"], | ||
* ]); | ||
* const startVertex = "vertices/a"; | ||
* const cursor = await db.query(aql` | ||
* FOR vertex IN OUTBOUND ${startVertex} GRAPH ${graph} | ||
* RETURN vertex._key | ||
* `); | ||
* const result = await cursor.all(); | ||
* console.log(result); // ["a", "b", "c", "d"] | ||
* ``` | ||
*/ | ||
traversal(startVertex: string, options?: TraversalOptions): Promise<any>; | ||
} | ||
//# sourceMappingURL=graph.d.ts.map |
@@ -785,47 +785,4 @@ "use strict"; | ||
} | ||
/** | ||
* Performs a traversal starting from the given `startVertex` and following | ||
* edges contained in this graph. | ||
* | ||
* See also {@link collection.EdgeCollection#traversal}. | ||
* | ||
* @param startVertex - Document `_id` of a vertex in this graph. | ||
* @param options - Options for performing the traversal. | ||
* | ||
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and are | ||
* no longer supported in ArangoDB 3.12. They can be replaced with AQL queries. | ||
* | ||
* @example | ||
* ```js | ||
* const db = new Database(); | ||
* const graph = db.graph("my-graph"); | ||
* const collection = graph.edgeCollection("edges").collection; | ||
* await collection.import([ | ||
* ["_key", "_from", "_to"], | ||
* ["x", "vertices/a", "vertices/b"], | ||
* ["y", "vertices/b", "vertices/c"], | ||
* ["z", "vertices/c", "vertices/d"], | ||
* ]); | ||
* const startVertex = "vertices/a"; | ||
* const cursor = await db.query(aql` | ||
* FOR vertex IN OUTBOUND ${startVertex} GRAPH ${graph} | ||
* RETURN vertex._key | ||
* `); | ||
* const result = await cursor.all(); | ||
* console.log(result); // ["a", "b", "c", "d"] | ||
* ``` | ||
*/ | ||
traversal(startVertex, options) { | ||
return this._db.request({ | ||
method: "POST", | ||
path: `/_api/traversal`, | ||
body: { | ||
...options, | ||
startVertex, | ||
graphName: this._name, | ||
}, | ||
}, (res) => res.parsedBody.result); | ||
} | ||
} | ||
exports.Graph = Graph; | ||
//# sourceMappingURL=graph.js.map |
@@ -529,2 +529,10 @@ /** | ||
unique: boolean; | ||
/** | ||
* Additional stats about this index. | ||
*/ | ||
figures?: Record<string, any>; | ||
/** | ||
* Progress of this index if it is still being created. | ||
*/ | ||
progress?: number; | ||
}; | ||
@@ -639,2 +647,6 @@ /** | ||
export type Index = GeoIndex | PersistentIndex | PrimaryIndex | TtlIndex | MdiIndex | InvertedIndex; | ||
export type IndexDetails = Index & { | ||
figures?: Record<string, any>; | ||
progress?: number; | ||
}; | ||
export type ObjectWithId = { | ||
@@ -641,0 +653,0 @@ [key: string]: any; |
@@ -15,3 +15,2 @@ /** | ||
import { isAqlLiteral, isAqlQuery } from "./aql.js"; | ||
import { BatchedArrayCursor } from "./cursor.js"; | ||
import { _documentHandle, } from "./documents.js"; | ||
@@ -396,125 +395,8 @@ import { HttpError, isArangoError } from "./error.js"; | ||
} | ||
traversal(startVertex, options) { | ||
return this._db.request({ | ||
method: "POST", | ||
path: "/_api/traversal", | ||
body: { | ||
...options, | ||
startVertex, | ||
edgeCollection: this._name, | ||
}, | ||
}, (res) => res.parsedBody.result); | ||
} | ||
//#endregion | ||
//#region simple queries | ||
list(type = "id") { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/all-keys", | ||
body: { type, collection: this._name }, | ||
}, (res) => new BatchedArrayCursor(this._db, res.parsedBody, res.arangojsHostUrl) | ||
.items); | ||
} | ||
all(options) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/all", | ||
body: { | ||
...options, | ||
collection: this._name, | ||
}, | ||
}, (res) => new BatchedArrayCursor(this._db, res.parsedBody, res.arangojsHostUrl) | ||
.items); | ||
} | ||
any() { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/any", | ||
body: { collection: this._name }, | ||
}, (res) => res.parsedBody.document); | ||
} | ||
byExample(example, options) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/by-example", | ||
body: { | ||
...options, | ||
example, | ||
collection: this._name, | ||
}, | ||
}, (res) => new BatchedArrayCursor(this._db, res.parsedBody, res.arangojsHostUrl) | ||
.items); | ||
} | ||
firstExample(example) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/first-example", | ||
body: { | ||
example, | ||
collection: this._name, | ||
}, | ||
}, (res) => res.parsedBody.document); | ||
} | ||
removeByExample(example, options) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/remove-by-example", | ||
body: { | ||
...options, | ||
example, | ||
collection: this._name, | ||
}, | ||
}); | ||
} | ||
replaceByExample(example, newValue, options) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/replace-by-example", | ||
body: { | ||
...options, | ||
example, | ||
newValue, | ||
collection: this._name, | ||
}, | ||
}); | ||
} | ||
updateByExample(example, newValue, options) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/update-by-example", | ||
body: { | ||
...options, | ||
example, | ||
newValue, | ||
collection: this._name, | ||
}, | ||
}); | ||
} | ||
lookupByKeys(keys) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/lookup-by-keys", | ||
body: { | ||
keys, | ||
collection: this._name, | ||
}, | ||
}, (res) => res.parsedBody.documents); | ||
} | ||
removeByKeys(keys, options) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/remove-by-keys", | ||
body: { | ||
options: options, | ||
keys, | ||
collection: this._name, | ||
}, | ||
}); | ||
} | ||
//#endregion | ||
//#region indexes | ||
indexes(withHidden = false) { | ||
indexes(options) { | ||
return this._db.request({ | ||
path: "/_api/index", | ||
search: { collection: this._name, withHidden: String(withHidden) }, | ||
search: { collection: this._name, ...options }, | ||
}, (res) => res.parsedBody.indexes); | ||
@@ -541,16 +423,2 @@ } | ||
} | ||
fulltext(attribute, query, { index, ...options } = {}) { | ||
return this._db.request({ | ||
method: "PUT", | ||
path: "/_api/simple/fulltext", | ||
body: { | ||
...options, | ||
index: index ? _indexHandle(index, this._name) : undefined, | ||
attribute, | ||
query, | ||
collection: this._name, | ||
}, | ||
}, (res) => new BatchedArrayCursor(this._db, res.parsedBody, res.arangojsHostUrl) | ||
.items); | ||
} | ||
compact() { | ||
@@ -557,0 +425,0 @@ return this._db.request({ |
@@ -99,3 +99,3 @@ /** | ||
this._headers.set("x-arango-version", String(this._arangoVersion)); | ||
this._headers.set("x-arango-driver", `arangojs/9.0.0-preview.2 (cloud)`); | ||
this._headers.set("x-arango-driver", `arangojs/9.0.0-preview.3 (cloud)`); | ||
this._loadBalancingStrategy = config.loadBalancingStrategy ?? "NONE"; | ||
@@ -102,0 +102,0 @@ this._precaptureStackTraces = Boolean(config.precaptureStackTraces); |
@@ -15,3 +15,3 @@ /** | ||
*/ | ||
import { ArangoCollection, DocumentCollection, EdgeCollection, TraversalOptions } from "./collection.js"; | ||
import { ArangoCollection, DocumentCollection, EdgeCollection } from "./collection.js"; | ||
import { Database } from "./database.js"; | ||
@@ -1137,36 +1137,3 @@ import { Document, DocumentData, DocumentMetadata, DocumentSelector, Edge, EdgeData, Patch } from "./documents.js"; | ||
removeEdgeDefinition(collection: string | ArangoCollection, dropCollection?: boolean): Promise<GraphInfo>; | ||
/** | ||
* Performs a traversal starting from the given `startVertex` and following | ||
* edges contained in this graph. | ||
* | ||
* See also {@link collection.EdgeCollection#traversal}. | ||
* | ||
* @param startVertex - Document `_id` of a vertex in this graph. | ||
* @param options - Options for performing the traversal. | ||
* | ||
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and are | ||
* no longer supported in ArangoDB 3.12. They can be replaced with AQL queries. | ||
* | ||
* @example | ||
* ```js | ||
* const db = new Database(); | ||
* const graph = db.graph("my-graph"); | ||
* const collection = graph.edgeCollection("edges").collection; | ||
* await collection.import([ | ||
* ["_key", "_from", "_to"], | ||
* ["x", "vertices/a", "vertices/b"], | ||
* ["y", "vertices/b", "vertices/c"], | ||
* ["z", "vertices/c", "vertices/d"], | ||
* ]); | ||
* const startVertex = "vertices/a"; | ||
* const cursor = await db.query(aql` | ||
* FOR vertex IN OUTBOUND ${startVertex} GRAPH ${graph} | ||
* RETURN vertex._key | ||
* `); | ||
* const result = await cursor.all(); | ||
* console.log(result); // ["a", "b", "c", "d"] | ||
* ``` | ||
*/ | ||
traversal(startVertex: string, options?: TraversalOptions): Promise<any>; | ||
} | ||
//# sourceMappingURL=graph.d.ts.map |
@@ -779,46 +779,3 @@ /** | ||
} | ||
/** | ||
* Performs a traversal starting from the given `startVertex` and following | ||
* edges contained in this graph. | ||
* | ||
* See also {@link collection.EdgeCollection#traversal}. | ||
* | ||
* @param startVertex - Document `_id` of a vertex in this graph. | ||
* @param options - Options for performing the traversal. | ||
* | ||
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and are | ||
* no longer supported in ArangoDB 3.12. They can be replaced with AQL queries. | ||
* | ||
* @example | ||
* ```js | ||
* const db = new Database(); | ||
* const graph = db.graph("my-graph"); | ||
* const collection = graph.edgeCollection("edges").collection; | ||
* await collection.import([ | ||
* ["_key", "_from", "_to"], | ||
* ["x", "vertices/a", "vertices/b"], | ||
* ["y", "vertices/b", "vertices/c"], | ||
* ["z", "vertices/c", "vertices/d"], | ||
* ]); | ||
* const startVertex = "vertices/a"; | ||
* const cursor = await db.query(aql` | ||
* FOR vertex IN OUTBOUND ${startVertex} GRAPH ${graph} | ||
* RETURN vertex._key | ||
* `); | ||
* const result = await cursor.all(); | ||
* console.log(result); // ["a", "b", "c", "d"] | ||
* ``` | ||
*/ | ||
traversal(startVertex, options) { | ||
return this._db.request({ | ||
method: "POST", | ||
path: `/_api/traversal`, | ||
body: { | ||
...options, | ||
startVertex, | ||
graphName: this._name, | ||
}, | ||
}, (res) => res.parsedBody.result); | ||
} | ||
} | ||
//# sourceMappingURL=graph.js.map |
@@ -529,2 +529,10 @@ /** | ||
unique: boolean; | ||
/** | ||
* Additional stats about this index. | ||
*/ | ||
figures?: Record<string, any>; | ||
/** | ||
* Progress of this index if it is still being created. | ||
*/ | ||
progress?: number; | ||
}; | ||
@@ -639,2 +647,6 @@ /** | ||
export type Index = GeoIndex | PersistentIndex | PrimaryIndex | TtlIndex | MdiIndex | InvertedIndex; | ||
export type IndexDetails = Index & { | ||
figures?: Record<string, any>; | ||
progress?: number; | ||
}; | ||
export type ObjectWithId = { | ||
@@ -641,0 +653,0 @@ [key: string]: any; |
@@ -24,2 +24,9 @@ # Migrating | ||
### Simple queries | ||
Simple queries like the `removeByExample` and `firstExample` methods have been | ||
removed from the collections API. These methods were deprecated in ArangoDB 3.4 | ||
and can be replaced with AQL queries. For examples for replicating each | ||
method's behavior in AQL, see the documentation for these methods in ArangoJS 8. | ||
### Request and Response changes | ||
@@ -26,0 +33,0 @@ |
{ | ||
"name": "arangojs", | ||
"version": "9.0.0-preview.2", | ||
"version": "9.0.0-preview.3", | ||
"engines": { | ||
@@ -37,3 +37,3 @@ "node": ">=18" | ||
"module": "esm/index.js", | ||
"types": "esm/index.d.ts", | ||
"types": "index.d.ts", | ||
"exports": { | ||
@@ -43,3 +43,3 @@ ".": { | ||
"require": "./cjs/index.js", | ||
"types": "./esm/index.d.ts" | ||
"types": "./index.d.ts" | ||
}, | ||
@@ -49,3 +49,3 @@ "./*": { | ||
"require": "./cjs/*.js", | ||
"types": "./esm/*.d.ts" | ||
"types": "./*.d.ts" | ||
}, | ||
@@ -55,3 +55,3 @@ "./lib/*": { | ||
"require": "./cjs/lib/*.js", | ||
"types": "./esm/lib/*.d.ts" | ||
"types": "./lib/*.d.ts" | ||
} | ||
@@ -61,2 +61,3 @@ }, | ||
"**/*", | ||
"!test/**", | ||
"!cjs/test/**", | ||
@@ -63,0 +64,0 @@ "!esm/test/**" |
@@ -67,3 +67,3 @@ # ArangoDB JavaScript Driver | ||
`); | ||
console.log("My pokemons, let me show you them:"); | ||
console.log("My pokemans, let me show you them:"); | ||
for await (const pokemon of pokemons) { | ||
@@ -70,0 +70,0 @@ console.log(pokemon.name); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3557037
228
55177