arangojs 9.2.0 → 10.0.0-alpha.1
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/CHANGELOG.md +395 -0
- package/MIGRATING.md +50 -0
- package/README.md +91 -27
- package/administration.d.ts +346 -0
- package/administration.d.ts.map +1 -0
- package/analyzers.d.ts +711 -0
- package/analyzers.d.ts.map +1 -0
- package/aql.d.ts +5 -5
- package/aql.d.ts.map +1 -1
- package/cjs/administration.d.ts +346 -0
- package/cjs/administration.d.ts.map +1 -0
- package/cjs/administration.js +13 -0
- package/cjs/administration.js.map +1 -0
- package/cjs/analyzers.d.ts +711 -0
- package/cjs/analyzers.d.ts.map +1 -0
- package/cjs/{analyzer.js → analyzers.js} +35 -9
- package/cjs/analyzers.js.map +1 -0
- package/cjs/aql.d.ts +5 -5
- package/cjs/aql.d.ts.map +1 -1
- package/cjs/aql.js +33 -10
- package/cjs/aql.js.map +1 -1
- package/cjs/cluster.d.ts +178 -0
- package/cjs/cluster.d.ts.map +1 -0
- package/cjs/cluster.js +13 -0
- package/cjs/cluster.js.map +1 -0
- package/cjs/{collection.d.ts → collections.d.ts} +395 -865
- package/cjs/collections.d.ts.map +1 -0
- package/cjs/{collection.js → collections.js} +89 -62
- package/cjs/collections.js.map +1 -0
- package/cjs/configuration.d.ts +181 -0
- package/cjs/configuration.d.ts.map +1 -0
- package/cjs/configuration.js +12 -0
- package/cjs/configuration.js.map +1 -0
- package/cjs/connection.d.ts +240 -227
- package/cjs/connection.d.ts.map +1 -1
- package/cjs/connection.js +435 -208
- package/cjs/connection.js.map +1 -1
- package/{esm/cursor.d.ts → cjs/cursors.d.ts} +69 -62
- package/cjs/cursors.d.ts.map +1 -0
- package/cjs/{cursor.js → cursors.js} +57 -48
- package/cjs/cursors.js.map +1 -0
- package/cjs/{database.d.ts → databases.d.ts} +285 -2096
- package/cjs/databases.d.ts.map +1 -0
- package/cjs/{database.js → databases.js} +212 -242
- package/cjs/databases.js.map +1 -0
- package/cjs/documents.d.ts +445 -13
- package/cjs/documents.d.ts.map +1 -1
- package/cjs/documents.js +2 -1
- package/cjs/documents.js.map +1 -1
- package/cjs/errors.d.ts +207 -0
- package/cjs/errors.d.ts.map +1 -0
- package/cjs/errors.js +320 -0
- package/cjs/errors.js.map +1 -0
- package/cjs/foxx-manifest.d.ts +1 -1
- package/cjs/foxx-manifest.d.ts.map +1 -1
- package/cjs/foxx-manifest.js +1 -1
- package/cjs/foxx-manifest.js.map +1 -1
- package/cjs/{graph.d.ts → graphs.d.ts} +125 -112
- package/cjs/graphs.d.ts.map +1 -0
- package/cjs/{graph.js → graphs.js} +110 -81
- package/cjs/graphs.js.map +1 -0
- package/cjs/hot-backups.d.ts +68 -0
- package/cjs/hot-backups.d.ts.map +1 -0
- package/cjs/hot-backups.js +12 -0
- package/cjs/hot-backups.js.map +1 -0
- package/cjs/index.d.ts +9 -9
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +28 -5
- package/cjs/index.js.map +1 -1
- package/cjs/indexes.d.ts +267 -327
- package/cjs/indexes.d.ts.map +1 -1
- package/cjs/indexes.js +2 -1
- package/cjs/indexes.js.map +1 -1
- package/{esm/job.d.ts → cjs/jobs.d.ts} +24 -13
- package/cjs/jobs.d.ts.map +1 -0
- package/cjs/{job.js → jobs.js} +8 -6
- package/cjs/jobs.js.map +1 -0
- package/cjs/lib/util.d.ts +50 -0
- package/cjs/lib/util.d.ts.map +1 -0
- package/cjs/lib/util.js +108 -0
- package/cjs/lib/util.js.map +1 -0
- package/cjs/lib/{linkedList.d.ts → x3-linkedlist.d.ts} +1 -1
- package/cjs/lib/x3-linkedlist.d.ts.map +1 -0
- package/cjs/lib/{linkedList.js → x3-linkedlist.js} +1 -1
- package/cjs/lib/x3-linkedlist.js.map +1 -0
- package/cjs/logs.d.ts +92 -0
- package/cjs/logs.d.ts.map +1 -0
- package/cjs/logs.js +26 -0
- package/cjs/logs.js.map +1 -0
- package/cjs/queries.d.ts +502 -0
- package/cjs/queries.d.ts.map +1 -0
- package/cjs/queries.js +13 -0
- package/cjs/queries.js.map +1 -0
- package/cjs/{route.d.ts → routes.d.ts} +33 -33
- package/cjs/routes.d.ts.map +1 -0
- package/cjs/routes.js +143 -0
- package/cjs/routes.js.map +1 -0
- package/cjs/services.d.ts +514 -0
- package/cjs/services.d.ts.map +1 -0
- package/cjs/services.js +4 -0
- package/cjs/services.js.map +1 -0
- package/{esm/transaction.d.ts → cjs/transactions.d.ts} +118 -15
- package/cjs/transactions.d.ts.map +1 -0
- package/cjs/{transaction.js → transactions.js} +83 -9
- package/cjs/transactions.js.map +1 -0
- package/cjs/users.d.ts +96 -0
- package/cjs/users.d.ts.map +1 -0
- package/cjs/users.js +4 -0
- package/cjs/users.js.map +1 -0
- package/{view.d.ts → cjs/views.d.ts} +209 -202
- package/cjs/views.d.ts.map +1 -0
- package/cjs/{view.js → views.js} +44 -13
- package/cjs/views.js.map +1 -0
- package/cluster.d.ts +178 -0
- package/cluster.d.ts.map +1 -0
- package/{collection.d.ts → collections.d.ts} +395 -865
- package/collections.d.ts.map +1 -0
- package/configuration.d.ts +181 -0
- package/configuration.d.ts.map +1 -0
- package/connection.d.ts +240 -227
- package/connection.d.ts.map +1 -1
- package/{cursor.d.ts → cursors.d.ts} +69 -62
- package/cursors.d.ts.map +1 -0
- package/{database.d.ts → databases.d.ts} +285 -2096
- package/databases.d.ts.map +1 -0
- package/documents.d.ts +445 -13
- package/documents.d.ts.map +1 -1
- package/errors.d.ts +207 -0
- package/errors.d.ts.map +1 -0
- package/esm/administration.d.ts +346 -0
- package/esm/administration.d.ts.map +1 -0
- package/esm/administration.js +12 -0
- package/esm/administration.js.map +1 -0
- package/esm/analyzers.d.ts +711 -0
- package/esm/analyzers.d.ts.map +1 -0
- package/esm/{analyzer.js → analyzers.js} +12 -9
- package/esm/analyzers.js.map +1 -0
- package/esm/aql.d.ts +5 -5
- package/esm/aql.d.ts.map +1 -1
- package/esm/aql.js +10 -10
- package/esm/aql.js.map +1 -1
- package/esm/cluster.d.ts +178 -0
- package/esm/cluster.d.ts.map +1 -0
- package/esm/cluster.js +12 -0
- package/esm/cluster.js.map +1 -0
- package/esm/{collection.d.ts → collections.d.ts} +395 -865
- package/esm/collections.d.ts.map +1 -0
- package/esm/{collection.js → collections.js} +66 -62
- package/esm/collections.js.map +1 -0
- package/esm/configuration.d.ts +181 -0
- package/esm/configuration.d.ts.map +1 -0
- package/esm/configuration.js +8 -0
- package/esm/configuration.js.map +1 -0
- package/esm/connection.d.ts +240 -227
- package/esm/connection.d.ts.map +1 -1
- package/esm/connection.js +406 -205
- package/esm/connection.js.map +1 -1
- package/{cjs/cursor.d.ts → esm/cursors.d.ts} +69 -62
- package/esm/cursors.d.ts.map +1 -0
- package/esm/{cursor.js → cursors.js} +52 -43
- package/esm/cursors.js.map +1 -0
- package/esm/{database.d.ts → databases.d.ts} +285 -2096
- package/esm/databases.d.ts.map +1 -0
- package/esm/{database.js → databases.js} +188 -241
- package/esm/databases.js.map +1 -0
- package/esm/documents.d.ts +445 -13
- package/esm/documents.d.ts.map +1 -1
- package/esm/documents.js +2 -1
- package/esm/documents.js.map +1 -1
- package/esm/errors.d.ts +207 -0
- package/esm/errors.d.ts.map +1 -0
- package/esm/errors.js +283 -0
- package/esm/errors.js.map +1 -0
- package/esm/foxx-manifest.d.ts +1 -1
- package/esm/foxx-manifest.d.ts.map +1 -1
- package/esm/foxx-manifest.js +1 -1
- package/esm/foxx-manifest.js.map +1 -1
- package/esm/{graph.d.ts → graphs.d.ts} +125 -112
- package/esm/graphs.d.ts.map +1 -0
- package/esm/{graph.js → graphs.js} +85 -79
- package/esm/graphs.js.map +1 -0
- package/esm/hot-backups.d.ts +68 -0
- package/esm/hot-backups.d.ts.map +1 -0
- package/esm/hot-backups.js +11 -0
- package/esm/hot-backups.js.map +1 -0
- package/esm/index.d.ts +9 -9
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +4 -4
- package/esm/index.js.map +1 -1
- package/esm/indexes.d.ts +267 -327
- package/esm/indexes.d.ts.map +1 -1
- package/esm/indexes.js +2 -1
- package/esm/indexes.js.map +1 -1
- package/{job.d.ts → esm/jobs.d.ts} +24 -13
- package/esm/jobs.d.ts.map +1 -0
- package/esm/{job.js → jobs.js} +8 -6
- package/esm/jobs.js.map +1 -0
- package/esm/lib/util.d.ts +50 -0
- package/esm/lib/util.d.ts.map +1 -0
- package/esm/lib/util.js +99 -0
- package/esm/lib/util.js.map +1 -0
- package/{lib/linkedList.d.ts → esm/lib/x3-linkedlist.d.ts} +1 -1
- package/esm/lib/x3-linkedlist.d.ts.map +1 -0
- package/esm/lib/{linkedList.js → x3-linkedlist.js} +1 -1
- package/esm/lib/x3-linkedlist.js.map +1 -0
- package/esm/logs.d.ts +92 -0
- package/esm/logs.d.ts.map +1 -0
- package/esm/logs.js +23 -0
- package/esm/logs.js.map +1 -0
- package/esm/queries.d.ts +502 -0
- package/esm/queries.d.ts.map +1 -0
- package/esm/queries.js +12 -0
- package/esm/queries.js.map +1 -0
- package/esm/{route.d.ts → routes.d.ts} +33 -33
- package/esm/routes.d.ts.map +1 -0
- package/esm/routes.js +116 -0
- package/esm/routes.js.map +1 -0
- package/esm/services.d.ts +514 -0
- package/esm/services.d.ts.map +1 -0
- package/esm/services.js +3 -0
- package/esm/services.js.map +1 -0
- package/{transaction.d.ts → esm/transactions.d.ts} +118 -15
- package/esm/transactions.d.ts.map +1 -0
- package/esm/{transaction.js → transactions.js} +58 -8
- package/esm/transactions.js.map +1 -0
- package/esm/users.d.ts +96 -0
- package/esm/users.d.ts.map +1 -0
- package/esm/users.js +3 -0
- package/esm/users.js.map +1 -0
- package/esm/{view.d.ts → views.d.ts} +209 -202
- package/esm/views.d.ts.map +1 -0
- package/esm/{view.js → views.js} +21 -13
- package/esm/views.js.map +1 -0
- package/foxx-manifest.d.ts +1 -1
- package/foxx-manifest.d.ts.map +1 -1
- package/{graph.d.ts → graphs.d.ts} +125 -112
- package/graphs.d.ts.map +1 -0
- package/hot-backups.d.ts +68 -0
- package/hot-backups.d.ts.map +1 -0
- package/index.d.ts +9 -9
- package/index.d.ts.map +1 -1
- package/indexes.d.ts +267 -327
- package/indexes.d.ts.map +1 -1
- package/{cjs/job.d.ts → jobs.d.ts} +24 -13
- package/jobs.d.ts.map +1 -0
- package/lib/util.d.ts +50 -0
- package/lib/util.d.ts.map +1 -0
- package/{esm/lib/linkedList.d.ts → lib/x3-linkedlist.d.ts} +1 -1
- package/lib/x3-linkedlist.d.ts.map +1 -0
- package/logs.d.ts +92 -0
- package/logs.d.ts.map +1 -0
- package/package.json +4 -1
- package/queries.d.ts +502 -0
- package/queries.d.ts.map +1 -0
- package/{route.d.ts → routes.d.ts} +33 -33
- package/routes.d.ts.map +1 -0
- package/services.d.ts +514 -0
- package/services.d.ts.map +1 -0
- package/{cjs/transaction.d.ts → transactions.d.ts} +118 -15
- package/transactions.d.ts.map +1 -0
- package/users.d.ts +96 -0
- package/users.d.ts.map +1 -0
- package/{cjs/view.d.ts → views.d.ts} +209 -202
- package/views.d.ts.map +1 -0
- package/analyzer.d.ts +0 -954
- package/analyzer.d.ts.map +0 -1
- package/cjs/analyzer.d.ts +0 -954
- package/cjs/analyzer.d.ts.map +0 -1
- package/cjs/analyzer.js.map +0 -1
- package/cjs/collection.d.ts.map +0 -1
- package/cjs/collection.js.map +0 -1
- package/cjs/cursor.d.ts.map +0 -1
- package/cjs/cursor.js.map +0 -1
- package/cjs/database.d.ts.map +0 -1
- package/cjs/database.js.map +0 -1
- package/cjs/error.d.ts +0 -94
- package/cjs/error.d.ts.map +0 -1
- package/cjs/error.js +0 -189
- package/cjs/error.js.map +0 -1
- package/cjs/graph.d.ts.map +0 -1
- package/cjs/graph.js.map +0 -1
- package/cjs/job.d.ts.map +0 -1
- package/cjs/job.js.map +0 -1
- package/cjs/lib/joinPath.d.ts +0 -11
- package/cjs/lib/joinPath.d.ts.map +0 -1
- package/cjs/lib/joinPath.js +0 -23
- package/cjs/lib/joinPath.js.map +0 -1
- package/cjs/lib/linkedList.d.ts.map +0 -1
- package/cjs/lib/linkedList.js.map +0 -1
- package/cjs/lib/mergeHeaders.d.ts +0 -12
- package/cjs/lib/mergeHeaders.d.ts.map +0 -1
- package/cjs/lib/mergeHeaders.js +0 -22
- package/cjs/lib/mergeHeaders.js.map +0 -1
- package/cjs/lib/normalizeUrl.d.ts +0 -11
- package/cjs/lib/normalizeUrl.d.ts.map +0 -1
- package/cjs/lib/normalizeUrl.js +0 -23
- package/cjs/lib/normalizeUrl.js.map +0 -1
- package/cjs/lib/request.d.ts +0 -66
- package/cjs/lib/request.d.ts.map +0 -1
- package/cjs/lib/request.js +0 -100
- package/cjs/lib/request.js.map +0 -1
- package/cjs/route.d.ts.map +0 -1
- package/cjs/route.js +0 -128
- package/cjs/route.js.map +0 -1
- package/cjs/transaction.d.ts.map +0 -1
- package/cjs/transaction.js.map +0 -1
- package/cjs/view.d.ts.map +0 -1
- package/cjs/view.js.map +0 -1
- package/collection.d.ts.map +0 -1
- package/cursor.d.ts.map +0 -1
- package/database.d.ts.map +0 -1
- package/error.d.ts +0 -94
- package/error.d.ts.map +0 -1
- package/esm/analyzer.d.ts +0 -954
- package/esm/analyzer.d.ts.map +0 -1
- package/esm/analyzer.js.map +0 -1
- package/esm/collection.d.ts.map +0 -1
- package/esm/collection.js.map +0 -1
- package/esm/cursor.d.ts.map +0 -1
- package/esm/cursor.js.map +0 -1
- package/esm/database.d.ts.map +0 -1
- package/esm/database.js.map +0 -1
- package/esm/error.d.ts +0 -94
- package/esm/error.d.ts.map +0 -1
- package/esm/error.js +0 -181
- package/esm/error.js.map +0 -1
- package/esm/graph.d.ts.map +0 -1
- package/esm/graph.js.map +0 -1
- package/esm/job.d.ts.map +0 -1
- package/esm/job.js.map +0 -1
- package/esm/lib/joinPath.d.ts +0 -11
- package/esm/lib/joinPath.d.ts.map +0 -1
- package/esm/lib/joinPath.js +0 -19
- package/esm/lib/joinPath.js.map +0 -1
- package/esm/lib/linkedList.d.ts.map +0 -1
- package/esm/lib/linkedList.js.map +0 -1
- package/esm/lib/mergeHeaders.d.ts +0 -12
- package/esm/lib/mergeHeaders.d.ts.map +0 -1
- package/esm/lib/mergeHeaders.js +0 -18
- package/esm/lib/mergeHeaders.js.map +0 -1
- package/esm/lib/normalizeUrl.d.ts +0 -11
- package/esm/lib/normalizeUrl.d.ts.map +0 -1
- package/esm/lib/normalizeUrl.js +0 -19
- package/esm/lib/normalizeUrl.js.map +0 -1
- package/esm/lib/request.d.ts +0 -66
- package/esm/lib/request.d.ts.map +0 -1
- package/esm/lib/request.js +0 -96
- package/esm/lib/request.js.map +0 -1
- package/esm/route.d.ts.map +0 -1
- package/esm/route.js +0 -124
- package/esm/route.js.map +0 -1
- package/esm/transaction.d.ts.map +0 -1
- package/esm/transaction.js.map +0 -1
- package/esm/view.d.ts.map +0 -1
- package/esm/view.js.map +0 -1
- package/graph.d.ts.map +0 -1
- package/job.d.ts.map +0 -1
- package/lib/joinPath.d.ts +0 -11
- package/lib/joinPath.d.ts.map +0 -1
- package/lib/linkedList.d.ts.map +0 -1
- package/lib/mergeHeaders.d.ts +0 -12
- package/lib/mergeHeaders.d.ts.map +0 -1
- package/lib/normalizeUrl.d.ts +0 -11
- package/lib/normalizeUrl.d.ts.map +0 -1
- package/lib/request.d.ts +0 -66
- package/lib/request.d.ts.map +0 -1
- package/route.d.ts.map +0 -1
- package/transaction.d.ts.map +0 -1
- package/view.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,397 @@ This driver uses semantic versioning:
|
|
|
14
14
|
- A change in the major version (e.g. 1.Y.Z -> 2.0.0) indicates _breaking_
|
|
15
15
|
changes that require changes in your code to upgrade.
|
|
16
16
|
|
|
17
|
+
## [10.0.0-alpha.1] - 2024-12-09
|
|
18
|
+
|
|
19
|
+
This is a major release and breaks backwards compatibility.
|
|
20
|
+
|
|
21
|
+
See [the migration guide](./MIGRATING.md#v9-to-v10) for detailed instructions
|
|
22
|
+
for upgrading your code to arangojs v10.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- Renamed `CollectionDropOptions` type to `DropCollectionOptions`
|
|
27
|
+
|
|
28
|
+
- Renamed `CollectionTruncateOptions` type to `TruncateCollectionOptions`
|
|
29
|
+
|
|
30
|
+
- Renamed `Config` type to `ConfigOptions`
|
|
31
|
+
|
|
32
|
+
- Renamed `path` option to `pathname` in `RequestOptions` type
|
|
33
|
+
|
|
34
|
+
This affects the `db.waitForPropagation` and `route.request` methods.
|
|
35
|
+
|
|
36
|
+
- Removed `basePath` option from `RequestOptions` type
|
|
37
|
+
|
|
38
|
+
This affects the `db.waitForPropagation` and `route.request` methods.
|
|
39
|
+
|
|
40
|
+
- Renamed `route.path` property to `route.pathname`
|
|
41
|
+
|
|
42
|
+
- Changed error type constructor signatures
|
|
43
|
+
|
|
44
|
+
The `request` property is now always positional and the `options` property
|
|
45
|
+
is always optional.
|
|
46
|
+
|
|
47
|
+
- Moved configuration related types to new `config` module
|
|
48
|
+
|
|
49
|
+
The following types were moved: `Config`, `LoadBalancingStrategy`,
|
|
50
|
+
`BasicAuthCredentials` and `BearerAuthCredentials`.
|
|
51
|
+
|
|
52
|
+
- Moved `ArangoErrorResponse` type to `connection` module
|
|
53
|
+
|
|
54
|
+
The type is now also no longer marked as internal.
|
|
55
|
+
|
|
56
|
+
- Moved configuration related types to new `configuration` module
|
|
57
|
+
|
|
58
|
+
The following types were moved: `ConfigOptions`, `LoadBalancingStrategy`,
|
|
59
|
+
`BasicAuthCredentials` and `BearerAuthCredentials`.
|
|
60
|
+
|
|
61
|
+
- Moved internal utility functions to new `lib/util` module
|
|
62
|
+
|
|
63
|
+
These methods are all still marked as internal and should not be used
|
|
64
|
+
directly.
|
|
65
|
+
|
|
66
|
+
- Closing a connection now closes all open requests
|
|
67
|
+
|
|
68
|
+
Previously in certain situations only the most recent request would be
|
|
69
|
+
closed per server. Note that this still merely aborts the requests but
|
|
70
|
+
does not guarantee the underlying connections are closed as these are
|
|
71
|
+
handled by Node.js or the browser natively.
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
|
|
75
|
+
- Restored support for Unix domain sockets
|
|
76
|
+
|
|
77
|
+
Using Unix domain sockets requires the `undici` library to be installed.
|
|
78
|
+
|
|
79
|
+
- Restored support for `config.agentOptions`
|
|
80
|
+
|
|
81
|
+
The `config.agentOptions` option can now be used to create a custom `undici`
|
|
82
|
+
agent if the `undici` library is installed.
|
|
83
|
+
|
|
84
|
+
## [10.0.0-alpha.0] - 2024-11-28
|
|
85
|
+
|
|
86
|
+
This is a major release and breaks backwards compatibility.
|
|
87
|
+
|
|
88
|
+
See [the migration guide](./MIGRATING.md#v9-to-v10) for detailed instructions
|
|
89
|
+
for upgrading your code to arangojs v10.
|
|
90
|
+
|
|
91
|
+
### Removed
|
|
92
|
+
|
|
93
|
+
- Removed unused `CreateUserOptions` type
|
|
94
|
+
|
|
95
|
+
The actual type used by the `db.createUser` method is still `UserOptions`.
|
|
96
|
+
|
|
97
|
+
- Removed unused `IndexDetails` type
|
|
98
|
+
|
|
99
|
+
This type was intended to be returned by `collection.indexes` when the
|
|
100
|
+
`withStats` option is set to `true` but the `figures` property is already
|
|
101
|
+
included in the current return type.
|
|
102
|
+
|
|
103
|
+
### Changed
|
|
104
|
+
|
|
105
|
+
- Changed `QueueTimeMetrics` type to an interface
|
|
106
|
+
|
|
107
|
+
- Changed `CursorExtras` and `CursorStats` interfaces to types
|
|
108
|
+
|
|
109
|
+
- Changed `GraphVertexCollection` and `GraphEdgeCollection` generic types to
|
|
110
|
+
take separate `EntryResultType` and `EntryInputType` type parameters
|
|
111
|
+
|
|
112
|
+
- Changed `db.collection`, `db.createCollection` and `db.createEdgeCollection`
|
|
113
|
+
methods to take separate `EntryResultType` and `EntryInputType` type
|
|
114
|
+
parameters
|
|
115
|
+
|
|
116
|
+
These type parameters are used to narrow the the returned collection type.
|
|
117
|
+
|
|
118
|
+
- Renamed `db.listServiceScripts` method to `db.getServiceScripts`
|
|
119
|
+
- Renamed `db.listHotBackups` method to `db.getHotBackups`
|
|
120
|
+
- Renamed `db.getLogMessages` method to `db.listLogMessages`
|
|
121
|
+
- Renamed `db.listFunctions` method to `db.listUserFunctions`
|
|
122
|
+
- Renamed `db.createFunction` method to `db.createUserFunction`
|
|
123
|
+
- Renamed `db.dropFunction` method to `db.dropUserFunction`
|
|
124
|
+
- Changed `db.removeUser` method to return `void`
|
|
125
|
+
|
|
126
|
+
#### Module renaming
|
|
127
|
+
|
|
128
|
+
- Renamed most modules to plural form for consistency
|
|
129
|
+
|
|
130
|
+
The following modules were renamed:
|
|
131
|
+
|
|
132
|
+
- `arangojs/analyzer` -> `arangojs/analyzers`
|
|
133
|
+
- `arangojs/collection` -> `arangojs/collections`
|
|
134
|
+
- `arangojs/cursor` -> `arangojs/cursors`
|
|
135
|
+
- `arangojs/database` -> `arangojs/databases`
|
|
136
|
+
- `arangojs/error` -> `arangojs/errors`
|
|
137
|
+
- `arangojs/graph` -> `arangojs/graphs`
|
|
138
|
+
- `arangojs/job` -> `arangojs/jobs`
|
|
139
|
+
- `arangojs/route` -> `arangojs/routes`
|
|
140
|
+
- `arangojs/transaction` -> `arangojs/transactions`
|
|
141
|
+
- `arangojs/view` -> `arangojs/views`
|
|
142
|
+
|
|
143
|
+
#### Moved types
|
|
144
|
+
|
|
145
|
+
- Moved document related types from `arangojs/collection` module to
|
|
146
|
+
`arangojs/documents` module
|
|
147
|
+
|
|
148
|
+
The following types were moved: `DocumentOperationFailure`,
|
|
149
|
+
`DocumentOperationMetadata`, `DocumentExistsOptions`,
|
|
150
|
+
`CollectionReadOptions`, `CollectionBatchReadOptions`,
|
|
151
|
+
`CollectionInsertOptions`, `CollectionReplaceOptions`,
|
|
152
|
+
`CollectionUpdateOptions`, `CollectionRemoveOptions`,
|
|
153
|
+
`CollectionImportOptions`, `CollectionEdgesOptions`,
|
|
154
|
+
`CollectionImportResult` and `CollectionEdgesResult`
|
|
155
|
+
|
|
156
|
+
- Moved index related types from `arangojs/collection` module to
|
|
157
|
+
`arangojs/indexes` module
|
|
158
|
+
|
|
159
|
+
The following types were moved: `IndexListOptions`.
|
|
160
|
+
|
|
161
|
+
- Moved transaction related types from `arangojs/database` module to
|
|
162
|
+
`arangojs/transactions` module
|
|
163
|
+
|
|
164
|
+
The following types were moved: `TransactionCollections`,
|
|
165
|
+
`TransactionOptions` and `TransactionDetails`.
|
|
166
|
+
|
|
167
|
+
- Moved cluster related types from `arangojs/database` module to new
|
|
168
|
+
`arangojs/clusters` module
|
|
169
|
+
|
|
170
|
+
The following types were moved: `ClusterImbalanceInfo`,
|
|
171
|
+
`ClusterRebalanceState`, `ClusterRebalanceOptions`, `ClusterRebalanceMove`
|
|
172
|
+
and `ClusterRebalanceResult`.
|
|
173
|
+
|
|
174
|
+
- Moved hot backup related types from `arangojs/database` module to new
|
|
175
|
+
`arangojs/hot-backups` module
|
|
176
|
+
|
|
177
|
+
The following types were moved: `HotBackupOptions`, `HotBackupResult` and
|
|
178
|
+
`HotBackupList`.
|
|
179
|
+
|
|
180
|
+
- Moved query related types from `arangojs/database` module to new
|
|
181
|
+
`arangojs/queries` module
|
|
182
|
+
|
|
183
|
+
The following types were moved: `QueryOptions`, `ExplainOptions`,
|
|
184
|
+
`ExplainPlan`, `ExplainStats`, `SingleExplainResult`, `MultiExplainResult`,
|
|
185
|
+
`AstNode`, `ParseResult`, `QueryOptimizerRule`, `QueryTracking`,
|
|
186
|
+
`QueryTrackingOptions`, `QueryInfo` and `AqlUserFunction`.
|
|
187
|
+
|
|
188
|
+
- Moved service related types from `arangojs/database` module to new
|
|
189
|
+
`arangojs/services` module
|
|
190
|
+
|
|
191
|
+
The following types were moved: `InstallServiceOptions`,
|
|
192
|
+
`ReplaceServiceOptions`, `UpgradeServiceOptions`, `UninstallServiceOptions`,
|
|
193
|
+
`ServiceSummary`, `ServiceInfo`, `ServiceConfiguration`,
|
|
194
|
+
`SingleServiceDependency`, `MultiServiceDependency`, `ServiceTestStats`,
|
|
195
|
+
`ServiceTestStreamTest`, `ServiceTestStreamReport`, `ServiceTestSuiteTest`,
|
|
196
|
+
`ServiceTestSuite`, `ServiceTestSuiteReport`, `ServiceTestXunitTest`,
|
|
197
|
+
`ServiceTestXunitReport`, `ServiceTestTapReport`, `ServiceTestDefaultTest`,
|
|
198
|
+
`ServiceTestDefaultReport` and `SwaggerJson`.
|
|
199
|
+
|
|
200
|
+
- Moved user related types from `arangojs/database` module to new
|
|
201
|
+
`arangojs/users` module
|
|
202
|
+
|
|
203
|
+
The following types were moved: `AccessLevel`, `ArangoUser`, `UserOptions`,
|
|
204
|
+
`UserAccessLevelOptions` and `CreateDatabaseUser`.
|
|
205
|
+
|
|
206
|
+
- Moved server administration related types from `arangojs/database` module to
|
|
207
|
+
new `arangojs/administration` module
|
|
208
|
+
|
|
209
|
+
The following types were moved: `QueueTimeMetrics` and `VersionInfo`.
|
|
210
|
+
|
|
211
|
+
#### Renamed types
|
|
212
|
+
|
|
213
|
+
- Renamed `Index` types to `IndexDescription` for consistency
|
|
214
|
+
|
|
215
|
+
The specific index types were also renamed accordingly:
|
|
216
|
+
|
|
217
|
+
- `Index` -> `IndexDescription`
|
|
218
|
+
- `GeoIndex` -> `GeoIndexDescription`
|
|
219
|
+
- `PersistentIndex` -> `PersistentIndexDescription`
|
|
220
|
+
- `PrimaryIndex` -> `PrimaryIndexDescription`
|
|
221
|
+
- `TtlIndex` -> `TtlIndexDescription`
|
|
222
|
+
- `MdiIndex` -> `MdiIndexDescription`
|
|
223
|
+
- `InvertedIndex` -> `InvertedIndexDescription`
|
|
224
|
+
- `InternalArangosearchIndex` -> `ArangosearchIndexDescription`
|
|
225
|
+
- `InternalIndex` -> `InternalIndexDescription`
|
|
226
|
+
- `HiddenIndex` -> `HiddenIndexDescription`
|
|
227
|
+
|
|
228
|
+
Note that the "Internal" prefix was dropped from `ArangosearchIndexDescription`
|
|
229
|
+
to more accurately reflect the index type name. The index type still refers
|
|
230
|
+
to an internal index, however.
|
|
231
|
+
|
|
232
|
+
- Renamed various types for consistency:
|
|
233
|
+
|
|
234
|
+
- `AqlUserFunction` -> `UserFunctionDescription`
|
|
235
|
+
- `CollectionMetadata` -> `CollectionDescription`
|
|
236
|
+
- `DatabaseInfo` -> `DatabaseDescription`
|
|
237
|
+
- `GraphInfo` -> `GraphDescription`
|
|
238
|
+
- `ServiceInfo` -> `ServiceDescription`
|
|
239
|
+
- `QueryInfo` -> `QueryDescription`
|
|
240
|
+
- `QueryTracking` -> `QueryTrackingInfo`
|
|
241
|
+
- `TransactionDetails` -> `TransactionInfo`
|
|
242
|
+
- `TransactionCollections` -> `TransactionCollectionOptions`
|
|
243
|
+
- `CreateDatabaseUser` -> `CreateDatabaseUserOptions`
|
|
244
|
+
|
|
245
|
+
- Index operations:
|
|
246
|
+
- `IndexListOptions` -> `ListIndexesOptions`
|
|
247
|
+
|
|
248
|
+
- Collection document operations:
|
|
249
|
+
- `DocumentExistsOptions` -> `DocumentExistsOptions`
|
|
250
|
+
- `CollectionReadOptions` -> `ReadDocumentOptions`
|
|
251
|
+
- `CollectionBatchReadOptions` -> `BulkReadDocumentsOptions`
|
|
252
|
+
- `CollectionInsertOptions` -> `InsertDocumentOptions`
|
|
253
|
+
- `CollectionReplaceOptions` -> `ReplaceDocumentOptions`
|
|
254
|
+
- `CollectionUpdateOptions` -> `UpdateDocumentOptions`
|
|
255
|
+
- `CollectionRemoveOptions` -> `RemoveDocumentOptions`
|
|
256
|
+
- `CollectionImportOptions` -> `ImportDocumentsOptions`
|
|
257
|
+
- `CollectionEdgesOptions` -> `DocumentEdgesOptions`
|
|
258
|
+
- `CollectionImportResult` -> `ImportDocumentsResult`
|
|
259
|
+
- `CollectionEdgesResult` -> `DocumentEdgesResult`
|
|
260
|
+
|
|
261
|
+
- Graph collection document operation:
|
|
262
|
+
- `GraphCollectionReadOptions` -> `ReadGraphDocumentOptions`
|
|
263
|
+
- `GraphCollectionInsertOptions` -> `CreateGraphDocumentOptions`
|
|
264
|
+
- `GraphCollectionReplaceOptions` -> `ReplaceGraphDocumentOptions`
|
|
265
|
+
- `GraphCollectionRemoveOptions` -> `RemoveGraphDocumentOptions`
|
|
266
|
+
- `ViewPatchPropertiesOptions` -> `UpdateViewPropertiesOptions`
|
|
267
|
+
|
|
268
|
+
- View operations:
|
|
269
|
+
- `ArangoSearchViewPatchPropertiesOptions` -> `UpdateArangoSearchViewPropertiesOptions`
|
|
270
|
+
- `SearchAliasViewPatchPropertiesOptions` -> `UpdateSearchAliasViewPropertiesOptions`
|
|
271
|
+
- `SearchAliasViewPatchIndexOptions` -> `UpdateSearchAliasViewIndexOptions`
|
|
272
|
+
- `ArangoSearchViewStoredValueOptions` -> `CreateArangoSearchViewStoredValueOptions`
|
|
273
|
+
|
|
274
|
+
- Renamed `ArrayCursor` and `BatchedArrayCursor` classes to `Cursor` and
|
|
275
|
+
`BatchCursor` respectively
|
|
276
|
+
|
|
277
|
+
The previous name was misleading because it conflicted with how the ArangoDB
|
|
278
|
+
distinguishes between array cursors and streaming cursors in the interactive
|
|
279
|
+
shell. This distinction does not apply to the driver.
|
|
280
|
+
|
|
281
|
+
- Renamed various types to reduce ambiguity:
|
|
282
|
+
|
|
283
|
+
- `ObjectWithId` (in `indexes` module) -> `ObjectWithIndexId`
|
|
284
|
+
- `ObjectWithId` (in `documents` module) -> `ObjectWithDocumentId`
|
|
285
|
+
- `ObjectWithKey` (in `documents` module) -> `ObjectWithDocumentKey`
|
|
286
|
+
|
|
287
|
+
#### Error handling
|
|
288
|
+
|
|
289
|
+
- Errors encountered before a request completes are now wrapped in a
|
|
290
|
+
`NetworkError` or a subclass thereof
|
|
291
|
+
|
|
292
|
+
This should help making it easier to diagnose network issues and distinguish
|
|
293
|
+
the relevant error conditions.
|
|
294
|
+
|
|
295
|
+
The originating error can still be accessed using the `cause` property of the
|
|
296
|
+
`NetworkError` error.
|
|
297
|
+
|
|
298
|
+
- `HttpError` now extends the `NetworkError` class
|
|
299
|
+
|
|
300
|
+
This allows treating all non-`ArangoError` errors as one category of errors,
|
|
301
|
+
even when there is no server response available.
|
|
302
|
+
|
|
303
|
+
- `db.waitForPropagation` now throws a `PropagationTimeoutError` error when
|
|
304
|
+
invoked with a `timeout` option and the timeout duration is exceeded
|
|
305
|
+
|
|
306
|
+
The method would previously throw the most recent error encountered while
|
|
307
|
+
waiting for replication. The originating error can still be accessed using
|
|
308
|
+
the `cause` property of the `PropagationTimeoutError` error.
|
|
309
|
+
|
|
310
|
+
- `db.waitForPropagation` now respects the `timeout` option more strictly
|
|
311
|
+
|
|
312
|
+
Previously the method would only time out if the timeout duration was
|
|
313
|
+
exceeded after the most recent request failed. Now the timeout is
|
|
314
|
+
recalculated and passed on to each request, preventing it from exceeding
|
|
315
|
+
the specified duration.
|
|
316
|
+
|
|
317
|
+
If the propagation timed out due to an underlying request exceeding the
|
|
318
|
+
timeout duration, the `cause` property of the `PropagationTimeoutError`
|
|
319
|
+
error will be a `ResponseTimeoutError` error.
|
|
320
|
+
|
|
321
|
+
- `config.beforeRequest` and `config.afterResponse` callbacks can now return
|
|
322
|
+
promises
|
|
323
|
+
|
|
324
|
+
If the callback returns a promise, it will be awaited before the request
|
|
325
|
+
and response cycle proceeds. If either callback throws an error or returns
|
|
326
|
+
a promise that is rejected, that error will be thrown instead.
|
|
327
|
+
|
|
328
|
+
- `config.afterResponse` callback signature changed
|
|
329
|
+
|
|
330
|
+
The callback signature previously used the internal `ArangojsResponse` type.
|
|
331
|
+
The new signature uses the `Response` type of the Fetch API with an
|
|
332
|
+
additional `request` property to more accurately represent the actual value
|
|
333
|
+
it receives as the `parsedBody` property will never be present.
|
|
334
|
+
|
|
335
|
+
- `response` property on `ArangoError` is now optional
|
|
336
|
+
|
|
337
|
+
This property should always be present but this allows using the error in
|
|
338
|
+
situations where a response might not be available.
|
|
339
|
+
|
|
340
|
+
### Added
|
|
341
|
+
|
|
342
|
+
- Added `BatchCursor#itemsView` property and `BatchCursorItemsView` interface
|
|
343
|
+
|
|
344
|
+
This property provides a low-level interface for consuming the items of the
|
|
345
|
+
cursor and is used by the regular item-wise `Cursor` class internally.
|
|
346
|
+
|
|
347
|
+
- Added `onError` option to `Config` (DE-955)
|
|
348
|
+
|
|
349
|
+
This option can be used to specify a callback function that will be invoked
|
|
350
|
+
whenever a request results in an error. Unlike `afterResponse`, this callback
|
|
351
|
+
will be invoked even if the request completed but returned an error status.
|
|
352
|
+
In this case the error will be the `HttpError` or `ArangoError` representing
|
|
353
|
+
the error response.
|
|
354
|
+
|
|
355
|
+
If the `onError` callback throws an error or returns a promise that is
|
|
356
|
+
rejected, that error will be thrown instead.
|
|
357
|
+
|
|
358
|
+
- Added `NetworkError` class
|
|
359
|
+
|
|
360
|
+
This is the common base class for all errors (including `HttpError`) that
|
|
361
|
+
occur while making a request. The originating error can be accessed using the
|
|
362
|
+
`cause` property. The request object can be accessed using the `request`
|
|
363
|
+
property.
|
|
364
|
+
|
|
365
|
+
Note that `ArangoError` and the new `PropagationTimeoutError` error type
|
|
366
|
+
do not extend `NetworkError` but may wrap an underlying error, which can
|
|
367
|
+
be accessed using the `cause` property.
|
|
368
|
+
|
|
369
|
+
- Added `ResponseTimeoutError` class
|
|
370
|
+
|
|
371
|
+
This error extends `NetworkError` and is thrown when a request deliberately
|
|
372
|
+
times out using the `timeout` option.
|
|
373
|
+
|
|
374
|
+
- Added `RequestAbortedError` class
|
|
375
|
+
|
|
376
|
+
This error extends `NetworkError` and is thrown when a request is aborted
|
|
377
|
+
by using the `db.close` method.
|
|
378
|
+
|
|
379
|
+
- Added `FetchFailedError` class
|
|
380
|
+
|
|
381
|
+
This error extends `NetworkError` and is thrown when a request fails because
|
|
382
|
+
the underlying `fetch` call fails (usually with a `TypeError`).
|
|
383
|
+
|
|
384
|
+
In Node.js the root cause of this error (e.g. a network failure) can often be
|
|
385
|
+
found in the `cause` property of the originating error, i.e. the `cause`
|
|
386
|
+
property of the `cause` property of this error.
|
|
387
|
+
|
|
388
|
+
In browsers the root cause is usually not exposed directly but can often
|
|
389
|
+
be diagnosed by examining the developer console or network tab.
|
|
390
|
+
|
|
391
|
+
- Added `PropagationTimeoutError` class
|
|
392
|
+
|
|
393
|
+
This error does not extend `NetworkError` but wraps the most recent error
|
|
394
|
+
encountered while waiting for replication, which can be accessed using the
|
|
395
|
+
`cause` property. This error is only thrown when `db.waitForPropagation`
|
|
396
|
+
is invoked with a `timeout` option and the timeout duration is exceeded.
|
|
397
|
+
|
|
398
|
+
- Added `ProcessedResponse` type
|
|
399
|
+
|
|
400
|
+
This type replaces the previously internal `ArangojsResponse` type and
|
|
401
|
+
extends the native `Response` type with additional properties.
|
|
402
|
+
|
|
403
|
+
- Added optional `ArangoError#request` property
|
|
404
|
+
|
|
405
|
+
This property is always present if the error has a `response` property. In
|
|
406
|
+
normal use this should always be the case.
|
|
407
|
+
|
|
17
408
|
## [9.2.0] - 2024-11-27
|
|
18
409
|
|
|
19
410
|
### Added
|
|
@@ -66,6 +457,8 @@ This driver uses semantic versioning:
|
|
|
66
457
|
This property is only available when fetching indexes with the `withHidden`
|
|
67
458
|
option set to `true`.
|
|
68
459
|
|
|
460
|
+
### Added
|
|
461
|
+
|
|
69
462
|
- Added `HiddenIndex` type (DE-849)
|
|
70
463
|
|
|
71
464
|
This type is used to represent an index returned by `collection.indexes` when
|
|
@@ -1962,6 +2355,8 @@ For a detailed list of changes between pre-release versions of v7 see the
|
|
|
1962
2355
|
|
|
1963
2356
|
Graph methods now only return the relevant part of the response body.
|
|
1964
2357
|
|
|
2358
|
+
[10.0.0-alpha.1]: https://github.com/arangodb/arangojs/compare/v10.0.0-alpha.0...v10.0.0-alpha.1
|
|
2359
|
+
[10.0.0-alpha.0]: https://github.com/arangodb/arangojs/compare/v9.2.0...v10.0.0-alpha.0
|
|
1965
2360
|
[9.2.0]: https://github.com/arangodb/arangojs/compare/v9.1.0...v9.2.0
|
|
1966
2361
|
[9.1.0]: https://github.com/arangodb/arangojs/compare/v9.0.0...v9.1.0
|
|
1967
2362
|
[9.0.0]: https://github.com/arangodb/arangojs/compare/v8.8.1...v9.0.0
|
package/MIGRATING.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# Migrating
|
|
2
2
|
|
|
3
|
+
## v9 to v10
|
|
4
|
+
|
|
5
|
+
Version 10 changes the error handling to make it easier to diagnose network
|
|
6
|
+
issues and distinguish between different error conditions.
|
|
7
|
+
|
|
8
|
+
If you previously inspected errors other than `ArangoError` and `HttpError`
|
|
9
|
+
directly, you should now expect to see `NetworkError` or a subclass thereof
|
|
10
|
+
instead. The originating error can be found using the `cause` property of the
|
|
11
|
+
`NetworkError` error:
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
try {
|
|
15
|
+
await db.collection("my-collection").get();
|
|
16
|
+
} catch (err) {
|
|
17
|
+
if (err instanceof NetworkError) console.log(err.cause);
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Module name changes
|
|
22
|
+
|
|
23
|
+
Module names referring to resource types such as analyzers, collections,
|
|
24
|
+
databases, or views have been changed to use the plural form:
|
|
25
|
+
|
|
26
|
+
```diff
|
|
27
|
+
-import { Database } from "arangojs/database";
|
|
28
|
+
+import { Database } from "arangojs/databases";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Note that the `aql` module and `foxx-manifest` modules have not been renamed
|
|
32
|
+
as these are utility modules.
|
|
33
|
+
|
|
34
|
+
### Type imports
|
|
35
|
+
|
|
36
|
+
Types that were previously exported by the `database` module but are not
|
|
37
|
+
related to managing databases have been moved to separate modules:
|
|
38
|
+
|
|
39
|
+
```diff
|
|
40
|
+
-import type {
|
|
41
|
+
- ParseResult,
|
|
42
|
+
- TransactionOptions,
|
|
43
|
+
- VersionInfo
|
|
44
|
+
-} from "arangojs/database";
|
|
45
|
+
+import type { VersionInfo } from "arangojs/administration";
|
|
46
|
+
+import type { TransactionOptions } from "arangojs/transactions";
|
|
47
|
+
+import type { ParseResult } from "arangojs/queries";
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Additionally, some types were renamed. For a full list of changes, see the
|
|
51
|
+
[changelog](./CHANGELOG.md).
|
|
52
|
+
|
|
3
53
|
## v8 to v9
|
|
4
54
|
|
|
5
55
|
Version 9 reverts the automatic NFC normalization introduced in v7.7.0. This
|
package/README.md
CHANGED
|
@@ -139,21 +139,42 @@ and [the `db` object](https://www.arangodb.com/docs/stable/appendix-references-d
|
|
|
139
139
|
|
|
140
140
|
## Error responses
|
|
141
141
|
|
|
142
|
-
If
|
|
143
|
-
an `errorNum` property indicating the ArangoDB error code
|
|
144
|
-
|
|
142
|
+
If the server returns an ArangoDB error response, arangojs will throw an
|
|
143
|
+
`ArangoError` with an `errorNum` property indicating the ArangoDB error code
|
|
144
|
+
and expose the response body as the `response` property of the error object.
|
|
145
145
|
|
|
146
|
-
For
|
|
147
|
-
|
|
146
|
+
For all other errors during the request/response cycle, arangojs will throw a
|
|
147
|
+
`NetworkError` or a more specific subclass thereof and expose the originating
|
|
148
|
+
request object as the `request` property of the error object.
|
|
148
149
|
|
|
149
|
-
If the server
|
|
150
|
-
|
|
150
|
+
If the server responded with a non-2xx status code, this `NetworkError` will
|
|
151
|
+
be an `HttpError` with a `code` property indicating the HTTP status code of the
|
|
152
|
+
response and a `response` property containing the response object itself.
|
|
151
153
|
|
|
152
|
-
|
|
153
|
-
`
|
|
154
|
+
If the error is caused by an exception, the originating exception will be
|
|
155
|
+
available as the `cause` property of the error object thrown by arangojs. For
|
|
156
|
+
network errors, this will often be a `TypeError`.
|
|
154
157
|
|
|
155
|
-
|
|
156
|
-
|
|
158
|
+
### Node.js network errors
|
|
159
|
+
|
|
160
|
+
In Node.js, network errors caused by a `TypeError` will often have a `cause`
|
|
161
|
+
property containing a more detailed exception.
|
|
162
|
+
|
|
163
|
+
Specifically, these are often either system errors (represented by regular
|
|
164
|
+
`Error` objects with additional properties) or errors from the `undici` module
|
|
165
|
+
Node.js uses internally for its native `fetch` implementation.
|
|
166
|
+
|
|
167
|
+
Node.js system error objects provide a `code` property containing the specific
|
|
168
|
+
string error code, a `syscall` property identifying the underlying system call
|
|
169
|
+
that triggered the error (e.g. `connect`), as well as other helpful properties.
|
|
170
|
+
|
|
171
|
+
For more details on Node.js system errors, see the Node.js documentation of the
|
|
172
|
+
[`SystemError` interface](https://nodejs.org/api/errors.html#class-systemerror)
|
|
173
|
+
as well as the section on
|
|
174
|
+
[Node.js error codes](https://nodejs.org/api/errors.html#nodejs-error-codes).
|
|
175
|
+
|
|
176
|
+
For more details on the errors thrown by `undici`, see the
|
|
177
|
+
[undici errors documentation](https://undici.nodejs.org/#/docs/api/Errors.md).
|
|
157
178
|
|
|
158
179
|
## Common issues
|
|
159
180
|
|
|
@@ -170,6 +191,15 @@ Additionally please ensure that your version of Node.js (or browser) and
|
|
|
170
191
|
ArangoDB are supported by the version of arangojs you are trying to use. See
|
|
171
192
|
the [compatibility section](#compatibility) for additional information.
|
|
172
193
|
|
|
194
|
+
You can install an older version of arangojs using `npm` or `yarn`:
|
|
195
|
+
|
|
196
|
+
```sh
|
|
197
|
+
# for version 8.x.x
|
|
198
|
+
yarn add arangojs@8
|
|
199
|
+
# - or -
|
|
200
|
+
npm install --save arangojs@8
|
|
201
|
+
```
|
|
202
|
+
|
|
173
203
|
### No code intelligence when using require instead of import
|
|
174
204
|
|
|
175
205
|
If you are using `require` to import the `arangojs` module in JavaScript, the
|
|
@@ -225,7 +255,7 @@ allowing arangojs to provide more meaningful stack traces at the cost of an
|
|
|
225
255
|
impact to performance even when no error occurs.
|
|
226
256
|
|
|
227
257
|
```diff
|
|
228
|
-
|
|
258
|
+
import { Database } from "arangojs";
|
|
229
259
|
|
|
230
260
|
const db = new Database({
|
|
231
261
|
url: ARANGODB_SERVER,
|
|
@@ -239,15 +269,47 @@ that do not support the `stack` property on error objects, this option will
|
|
|
239
269
|
still impact performance but not result in any additional information becoming
|
|
240
270
|
available.
|
|
241
271
|
|
|
272
|
+
### Unix domain sockets
|
|
273
|
+
|
|
274
|
+
If you want to use Unix domain sockets, you need to install the `undici` module,
|
|
275
|
+
which is an optional dependency of arangojs.
|
|
276
|
+
|
|
277
|
+
```sh
|
|
278
|
+
npm install --save undici
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
If the `undici` module is not installed and arangojs attempts to make a request
|
|
282
|
+
over a Unix domain socket, the request will fail with a plain `Error` with a
|
|
283
|
+
message indicating that the `undici` module is unavailable.
|
|
284
|
+
|
|
242
285
|
### Node.js with self-signed HTTPS certificates
|
|
243
286
|
|
|
244
|
-
If you need to support self-signed HTTPS certificates in Node.js, you
|
|
245
|
-
to
|
|
246
|
-
official way to do this for the native `fetch` implementation in Node.js.
|
|
287
|
+
If you need to support self-signed HTTPS certificates in Node.js, you will need
|
|
288
|
+
to install the `undici` module, which is an optional dependency of arangojs.
|
|
247
289
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
290
|
+
```sh
|
|
291
|
+
npm install --save undici
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
You can instruct arangojs to use the `undici` module by setting the
|
|
295
|
+
`config.agentOptions` option:
|
|
296
|
+
|
|
297
|
+
```diff
|
|
298
|
+
import { Database } from "arangojs";
|
|
299
|
+
|
|
300
|
+
const db = new Database({
|
|
301
|
+
url: ARANGODB_SERVER,
|
|
302
|
+
+ agentOptions: {
|
|
303
|
+
+ ca: [
|
|
304
|
+
+ fs.readFileSync(".ssl/sub.class1.server.ca.pem"),
|
|
305
|
+
+ fs.readFileSync(".ssl/ca.pem"),
|
|
306
|
+
+ ],
|
|
307
|
+
+ },
|
|
308
|
+
});
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
To override the global fetch agent instead, you can use the `undici` module's
|
|
312
|
+
`setGlobalDispatcher` method as follows:
|
|
251
313
|
|
|
252
314
|
```js
|
|
253
315
|
import { Agent, setGlobalDispatcher } from "undici";
|
|
@@ -263,20 +325,22 @@ setGlobalDispatcher(
|
|
|
263
325
|
```
|
|
264
326
|
|
|
265
327
|
Although this is **strongly discouraged**, it's also possible to disable
|
|
266
|
-
HTTPS certificate validation entirely, but note this has
|
|
328
|
+
HTTPS certificate validation entirely this way, but note this has
|
|
267
329
|
**extremely dangerous** security implications:
|
|
268
330
|
|
|
269
|
-
```
|
|
270
|
-
import {
|
|
331
|
+
```diff
|
|
332
|
+
import { Database } from "arangojs";
|
|
271
333
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
334
|
+
const db = new Database({
|
|
335
|
+
url: ARANGODB_SERVER,
|
|
336
|
+
+ agentOptions: {
|
|
337
|
+
+ rejectUnauthorized: false,
|
|
338
|
+
+ },
|
|
339
|
+
});
|
|
277
340
|
```
|
|
278
341
|
|
|
279
|
-
|
|
342
|
+
The requirement to use the `undici` module to override these settings is a
|
|
343
|
+
[known limitation](https://github.com/orgs/nodejs/discussions/44038#discussioncomment-5701073)
|
|
280
344
|
of Node.js at the time of this writing.
|
|
281
345
|
|
|
282
346
|
When using arangojs in the browser, self-signed HTTPS certificates need to
|