Comparing version 8.3.0 to 8.4.0
import { ArangoCollection } from "./collection"; | ||
import { Graph } from "./graph"; | ||
import { View } from "./view"; | ||
declare const type: unique symbol; | ||
/** | ||
@@ -8,3 +9,4 @@ * Generic AQL query object consisting of an AQL query string and its bind | ||
*/ | ||
export interface AqlQuery { | ||
export interface AqlQuery<T = any> { | ||
[type]?: T; | ||
/** | ||
@@ -29,3 +31,3 @@ * An AQL query string. | ||
*/ | ||
export interface GeneratedAqlQuery extends AqlQuery { | ||
export interface GeneratedAqlQuery<T = any> extends AqlQuery<T> { | ||
/** | ||
@@ -169,3 +171,3 @@ * @internal | ||
*/ | ||
export declare function aql(templateStrings: TemplateStringsArray, ...args: AqlValue[]): GeneratedAqlQuery; | ||
export declare function aql<T = any>(templateStrings: TemplateStringsArray, ...args: AqlValue[]): GeneratedAqlQuery<T>; | ||
/** | ||
@@ -289,2 +291,3 @@ * Marks an arbitrary scalar value (i.e. a string, number or boolean) as | ||
export declare function join(values: AqlValue[], sep?: string): GeneratedAqlQuery; | ||
export {}; | ||
//# sourceMappingURL=aql.d.ts.map |
@@ -17,9 +17,75 @@ # Changelog | ||
## [8.4.0] - 2023-07-10 | ||
### Changed | ||
- Fetching additional cursor results now uses `POST` instead of `PUT` (DE-605) | ||
The `POST` route was deprecated and the `PUT` route is supported in all | ||
actively maintained versions of ArangoDB. | ||
- User management methods now use database-relative URLs (DE-606) | ||
Previously these methods would make requests without a database prefix, | ||
implicitly using the `_system` database. | ||
- `aql` template strings now take a generic type argument | ||
This allows explictly setting the item type of the `ArrayCursor` returned by | ||
`db.query` when using `aql` template strings. Note that like when setting | ||
the type on `db.query` directly, arangojs can make no guarantees that the | ||
type matches the actual data returned by the query. | ||
```ts | ||
const numbers = await db.query(aql<{ index: number; squared: number }>` | ||
FOR i IN 1..1000 | ||
RETURN { | ||
index: i, | ||
squared: i * i | ||
} | ||
`); | ||
const first = await numbers.next(); // { index: number; squared: number; } | ||
console.log(first.index, first.squared); // 1 1 | ||
``` | ||
### Fixed | ||
- Fixed `listUsers` behavior ([#782](https://github.com/arangodb/arangojs/issues/782)) | ||
- Fixed `graph.create` not correctly handling `isDisjoint` option | ||
### Added | ||
- Added missing attributes to `QueryInfo` and `MultiExplainResult.stats` types (DE-607) | ||
- Added cluster rebalancing methods to `Database` (DE-583) | ||
- Added `db.withTransaction` helper method for streaming transactions ([#786](https://github.com/arangodb/arangojs/discussions/786)) | ||
This method allows using streaming transactions without having to manually | ||
begin and commit or abort the transaction. | ||
```ts | ||
const vertices = db.collection("vertices"); | ||
const edges = db.collection("edges"); | ||
const info = await db.withTransaction([vertices, edges], async (step) => { | ||
const start = await step(() => vertices.document("a")); | ||
const end = await step(() => vertices.document("b")); | ||
return await step(() => edges.save({ _from: start._id, _to: end._id })); | ||
}); | ||
``` | ||
## [8.3.1] - 2023-06-05 | ||
### Changed | ||
- Added note that Simple Queries traversals are removed in ArangoDB 3.12. | ||
## [8.3.0] - 2023-05-11 | ||
## Fixed | ||
### Fixed | ||
- Fixed `updateUser` and `replaceUser` behavior ([#783](https://github.com/arangodb/arangojs/issues/783)) | ||
## Added | ||
### Added | ||
@@ -223,3 +289,3 @@ - Added `renewAuthToken` method to `Database` ([#784](https://github.com/arangodb/arangojs/issues/784)) | ||
`); | ||
const first = await numbers.next(); | ||
const first = await numbers.next(); // { index: number; squared: number; } | ||
console.log(first.index, first.squared); // 1 1 | ||
@@ -1644,2 +1710,4 @@ ``` | ||
[8.4.0]: https://github.com/arangodb/arangojs/compare/v8.3.1...v8.4.0 | ||
[8.3.1]: https://github.com/arangodb/arangojs/compare/v8.3.0...v8.3.1 | ||
[8.3.0]: https://github.com/arangodb/arangojs/compare/v8.2.1...v8.3.0 | ||
@@ -1646,0 +1714,0 @@ [8.2.1]: https://github.com/arangodb/arangojs/compare/v8.2.0...v8.2.1 |
@@ -454,3 +454,3 @@ "use strict"; | ||
"x-arango-version": String(this._arangoVersion), | ||
"x-arango-driver": `arangojs/8.3.0 (cloud)`, | ||
"x-arango-driver": `arangojs/8.4.0 (cloud)`, | ||
}; | ||
@@ -457,0 +457,0 @@ if (this._transactionId) { |
@@ -82,11 +82,6 @@ "use strict"; | ||
const body = await this._db.request({ | ||
...(this._nextBatchId | ||
? { | ||
method: "POST", | ||
path: `/_api/cursor/${encodeURIComponent(this._id)}/${this._nextBatchId}`, | ||
} | ||
: { | ||
method: "PUT", | ||
path: `/_api/cursor/${encodeURIComponent(this._id)}`, | ||
}), | ||
method: "POST", | ||
path: this._nextBatchId | ||
? `/_api/cursor/${encodeURIComponent(this._id)}/${this._nextBatchId}` | ||
: `/_api/cursor/${encodeURIComponent(this._id)}`, | ||
hostUrl: this._hostUrl, | ||
@@ -93,0 +88,0 @@ allowDirtyRead: this._allowDirtyRead, |
@@ -1145,4 +1145,4 @@ /** | ||
* | ||
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be | ||
* replaced with AQL queries. | ||
* @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. | ||
* | ||
@@ -1149,0 +1149,0 @@ * @example |
@@ -456,3 +456,3 @@ "use strict"; | ||
create(edgeDefinitions, options = {}) { | ||
const { orphanCollections, satellites, waitForSync, isSmart, isDisjoint, ...opts } = options; | ||
const { orphanCollections, satellites, waitForSync, isSmart, ...opts } = options; | ||
return this._db.request({ | ||
@@ -468,3 +468,2 @@ method: "POST", | ||
isSmart, | ||
isDisjoint, | ||
name: this._name, | ||
@@ -787,4 +786,4 @@ options: { ...opts, satellites: satellites?.map(collection_1.collectionToString) }, | ||
* | ||
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be | ||
* replaced with AQL queries. | ||
* @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. | ||
* | ||
@@ -791,0 +790,0 @@ * @example |
{ | ||
"name": "arangojs", | ||
"version": "8.3.0", | ||
"version": "8.4.0", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=14" |
@@ -59,3 +59,3 @@ /** | ||
*/ | ||
request(options?: RequestOptions): Promise<any>; | ||
request(options?: RequestOptions): Promise<ArangojsResponse>; | ||
/** | ||
@@ -62,0 +62,0 @@ * Performs a DELETE request against the given path relative to this route |
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 too big to display
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 too big to display
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
2240806
20821