arangojs 10.0.0-alpha.1 → 10.0.0

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.
Files changed (169) hide show
  1. package/CHANGELOG.md +232 -135
  2. package/README.md +8 -7
  3. package/administration.d.ts +67 -2
  4. package/administration.d.ts.map +1 -1
  5. package/analyzers.d.ts +6 -4
  6. package/analyzers.d.ts.map +1 -1
  7. package/aql.d.ts +0 -2
  8. package/aql.d.ts.map +1 -1
  9. package/cjs/administration.d.ts +67 -2
  10. package/cjs/administration.d.ts.map +1 -1
  11. package/cjs/administration.js +1 -1
  12. package/cjs/administration.js.map +1 -1
  13. package/cjs/analyzers.d.ts +6 -4
  14. package/cjs/analyzers.d.ts.map +1 -1
  15. package/cjs/analyzers.js.map +1 -1
  16. package/cjs/aql.d.ts +0 -2
  17. package/cjs/aql.d.ts.map +1 -1
  18. package/cjs/aql.js.map +1 -1
  19. package/cjs/collections.d.ts +86 -0
  20. package/cjs/collections.d.ts.map +1 -1
  21. package/cjs/collections.js +6 -0
  22. package/cjs/collections.js.map +1 -1
  23. package/cjs/configuration.d.ts.map +1 -1
  24. package/cjs/configuration.js.map +1 -1
  25. package/cjs/connection.d.ts +5 -9
  26. package/cjs/connection.d.ts.map +1 -1
  27. package/cjs/connection.js +52 -27
  28. package/cjs/connection.js.map +1 -1
  29. package/cjs/cursors.d.ts.map +1 -1
  30. package/cjs/cursors.js.map +1 -1
  31. package/cjs/databases.d.ts +92 -19
  32. package/cjs/databases.d.ts.map +1 -1
  33. package/cjs/databases.js +153 -26
  34. package/cjs/databases.js.map +1 -1
  35. package/cjs/documents.d.ts.map +1 -1
  36. package/cjs/documents.js.map +1 -1
  37. package/cjs/errors.d.ts +2 -2
  38. package/cjs/errors.d.ts.map +1 -1
  39. package/cjs/errors.js +14 -12
  40. package/cjs/errors.js.map +1 -1
  41. package/cjs/foxx-manifest.d.ts.map +1 -1
  42. package/cjs/foxx-manifest.js.map +1 -1
  43. package/cjs/graphs.d.ts +4 -4
  44. package/cjs/graphs.d.ts.map +1 -1
  45. package/cjs/graphs.js +24 -12
  46. package/cjs/graphs.js.map +1 -1
  47. package/cjs/index.d.ts.map +1 -1
  48. package/cjs/index.js.map +1 -1
  49. package/cjs/indexes.d.ts +141 -14
  50. package/cjs/indexes.d.ts.map +1 -1
  51. package/cjs/indexes.js.map +1 -1
  52. package/cjs/jobs.d.ts.map +1 -1
  53. package/cjs/jobs.js.map +1 -1
  54. package/cjs/lib/util.d.ts.map +1 -1
  55. package/cjs/lib/util.js +13 -7
  56. package/cjs/lib/util.js.map +1 -1
  57. package/cjs/lib/x3-linkedlist.js.map +1 -1
  58. package/cjs/logs.js.map +1 -1
  59. package/cjs/queries.d.ts +104 -3
  60. package/cjs/queries.d.ts.map +1 -1
  61. package/cjs/queries.js +1 -0
  62. package/cjs/queries.js.map +1 -1
  63. package/cjs/routes.d.ts.map +1 -1
  64. package/cjs/routes.js.map +1 -1
  65. package/cjs/services.d.ts +14 -13
  66. package/cjs/services.d.ts.map +1 -1
  67. package/cjs/services.js.map +1 -1
  68. package/cjs/transactions.d.ts +3 -3
  69. package/cjs/transactions.d.ts.map +1 -1
  70. package/cjs/transactions.js.map +1 -1
  71. package/cjs/users.js.map +1 -1
  72. package/cjs/views.d.ts +6 -4
  73. package/cjs/views.d.ts.map +1 -1
  74. package/cjs/views.js.map +1 -1
  75. package/collections.d.ts +86 -0
  76. package/collections.d.ts.map +1 -1
  77. package/configuration.d.ts.map +1 -1
  78. package/connection.d.ts +5 -9
  79. package/connection.d.ts.map +1 -1
  80. package/cursors.d.ts.map +1 -1
  81. package/databases.d.ts +92 -19
  82. package/databases.d.ts.map +1 -1
  83. package/documents.d.ts.map +1 -1
  84. package/errors.d.ts +2 -2
  85. package/errors.d.ts.map +1 -1
  86. package/esm/administration.d.ts +67 -2
  87. package/esm/administration.d.ts.map +1 -1
  88. package/esm/administration.js +1 -1
  89. package/esm/administration.js.map +1 -1
  90. package/esm/analyzers.d.ts +6 -4
  91. package/esm/analyzers.d.ts.map +1 -1
  92. package/esm/analyzers.js.map +1 -1
  93. package/esm/aql.d.ts +0 -2
  94. package/esm/aql.d.ts.map +1 -1
  95. package/esm/aql.js.map +1 -1
  96. package/esm/collections.d.ts +86 -0
  97. package/esm/collections.d.ts.map +1 -1
  98. package/esm/collections.js +6 -0
  99. package/esm/collections.js.map +1 -1
  100. package/esm/configuration.d.ts.map +1 -1
  101. package/esm/configuration.js.map +1 -1
  102. package/esm/connection.d.ts +5 -9
  103. package/esm/connection.d.ts.map +1 -1
  104. package/esm/connection.js +52 -26
  105. package/esm/connection.js.map +1 -1
  106. package/esm/cursors.d.ts.map +1 -1
  107. package/esm/cursors.js.map +1 -1
  108. package/esm/databases.d.ts +92 -19
  109. package/esm/databases.d.ts.map +1 -1
  110. package/esm/databases.js +153 -26
  111. package/esm/databases.js.map +1 -1
  112. package/esm/documents.d.ts.map +1 -1
  113. package/esm/documents.js.map +1 -1
  114. package/esm/errors.d.ts +2 -2
  115. package/esm/errors.d.ts.map +1 -1
  116. package/esm/errors.js +14 -12
  117. package/esm/errors.js.map +1 -1
  118. package/esm/foxx-manifest.d.ts.map +1 -1
  119. package/esm/foxx-manifest.js.map +1 -1
  120. package/esm/graphs.d.ts +4 -4
  121. package/esm/graphs.d.ts.map +1 -1
  122. package/esm/graphs.js +24 -12
  123. package/esm/graphs.js.map +1 -1
  124. package/esm/index.d.ts.map +1 -1
  125. package/esm/index.js.map +1 -1
  126. package/esm/indexes.d.ts +141 -14
  127. package/esm/indexes.d.ts.map +1 -1
  128. package/esm/indexes.js.map +1 -1
  129. package/esm/jobs.d.ts.map +1 -1
  130. package/esm/jobs.js.map +1 -1
  131. package/esm/lib/util.d.ts.map +1 -1
  132. package/esm/lib/util.js +13 -7
  133. package/esm/lib/util.js.map +1 -1
  134. package/esm/lib/x3-linkedlist.js.map +1 -1
  135. package/esm/logs.js.map +1 -1
  136. package/esm/queries.d.ts +104 -3
  137. package/esm/queries.d.ts.map +1 -1
  138. package/esm/queries.js +1 -0
  139. package/esm/queries.js.map +1 -1
  140. package/esm/routes.d.ts.map +1 -1
  141. package/esm/routes.js.map +1 -1
  142. package/esm/services.d.ts +14 -13
  143. package/esm/services.d.ts.map +1 -1
  144. package/esm/services.js.map +1 -1
  145. package/esm/transactions.d.ts +3 -3
  146. package/esm/transactions.d.ts.map +1 -1
  147. package/esm/transactions.js.map +1 -1
  148. package/esm/users.js.map +1 -1
  149. package/esm/views.d.ts +6 -4
  150. package/esm/views.d.ts.map +1 -1
  151. package/esm/views.js.map +1 -1
  152. package/foxx-manifest.d.ts.map +1 -1
  153. package/graphs.d.ts +4 -4
  154. package/graphs.d.ts.map +1 -1
  155. package/index.d.ts.map +1 -1
  156. package/indexes.d.ts +141 -14
  157. package/indexes.d.ts.map +1 -1
  158. package/jobs.d.ts.map +1 -1
  159. package/lib/util.d.ts.map +1 -1
  160. package/package.json +9 -4
  161. package/queries.d.ts +104 -3
  162. package/queries.d.ts.map +1 -1
  163. package/routes.d.ts.map +1 -1
  164. package/services.d.ts +14 -13
  165. package/services.d.ts.map +1 -1
  166. package/transactions.d.ts +3 -3
  167. package/transactions.d.ts.map +1 -1
  168. package/views.d.ts +6 -4
  169. package/views.d.ts.map +1 -1
package/CHANGELOG.md CHANGED
@@ -14,97 +14,105 @@ 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
17
+ ## [10.0.0] - 2025-01-06
18
18
 
19
19
  This is a major release and breaks backwards compatibility.
20
20
 
21
21
  See [the migration guide](./MIGRATING.md#v9-to-v10) for detailed instructions
22
22
  for upgrading your code to arangojs v10.
23
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
24
+ ### Removed
33
25
 
34
- This affects the `db.waitForPropagation` and `route.request` methods.
26
+ - Removed unused `CreateUserOptions` type
35
27
 
36
- - Removed `basePath` option from `RequestOptions` type
28
+ The actual type used by the `db.createUser` method is still `UserOptions`.
37
29
 
38
- This affects the `db.waitForPropagation` and `route.request` methods.
30
+ - Removed unused `IndexDetails` type
39
31
 
40
- - Renamed `route.path` property to `route.pathname`
32
+ This type was intended to be returned by `collection.indexes` when the
33
+ `withStats` option is set to `true` but the `figures` property is already
34
+ included in the current return type.
41
35
 
42
- - Changed error type constructor signatures
36
+ - Removed Node.js 18 support
43
37
 
44
- The `request` property is now always positional and the `options` property
45
- is always optional.
38
+ Node.js 18 will reach its end of life in May 2025, so arangojs will no
39
+ longer support this version of Node.js going forward.
46
40
 
47
- - Moved configuration related types to new `config` module
41
+ For more information, see [the Node.js release schedule](https://nodejs.dev/en/about/releases/).
48
42
 
49
- The following types were moved: `Config`, `LoadBalancingStrategy`,
50
- `BasicAuthCredentials` and `BearerAuthCredentials`.
43
+ ### Changed
51
44
 
52
- - Moved `ArangoErrorResponse` type to `connection` module
45
+ - Closing a connection now closes all open requests
53
46
 
54
- The type is now also no longer marked as internal.
47
+ Previously in certain situations only the most recent request would be
48
+ closed per server. Note that this still merely aborts the requests but
49
+ does not guarantee the underlying connections are closed as these are
50
+ handled by Node.js or the browser natively. need to be installed
51
+ otherwise.
55
52
 
56
- - Moved configuration related types to new `configuration` module
53
+ - Moved fetch-specific `config` options from into `config.fetchOptions`
57
54
 
58
- The following types were moved: `ConfigOptions`, `LoadBalancingStrategy`,
59
- `BasicAuthCredentials` and `BearerAuthCredentials`.
55
+ The following options were moved: `credentials`, `headers` and `keepalive`.
60
56
 
61
- - Moved internal utility functions to new `lib/util` module
57
+ - `db.setUserAccessLevel` now takes `grant` as a separate parameter
62
58
 
63
- These methods are all still marked as internal and should not be used
64
- directly.
59
+ The parameter was previously passed as an additional property in the
60
+ `options` parameter.
65
61
 
66
- - Closing a connection now closes all open requests
62
+ #### Error handling
67
63
 
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.
64
+ - Errors encountered before a request completes are now wrapped in a
65
+ `NetworkError` or a subclass thereof
72
66
 
73
- ### Added
67
+ This should help making it easier to diagnose network issues and distinguish
68
+ the relevant error conditions.
74
69
 
75
- - Restored support for Unix domain sockets
70
+ The originating error can still be accessed using the `cause` property of the
71
+ `NetworkError` error.
76
72
 
77
- Using Unix domain sockets requires the `undici` library to be installed.
73
+ - `HttpError` now extends the `NetworkError` class
78
74
 
79
- - Restored support for `config.agentOptions`
75
+ This allows treating all non-`ArangoError` errors as one category of errors,
76
+ even when there is no server response available.
80
77
 
81
- The `config.agentOptions` option can now be used to create a custom `undici`
82
- agent if the `undici` library is installed.
78
+ - `db.waitForPropagation` now throws a `PropagationTimeoutError` error when
79
+ invoked with a `timeout` option and the timeout duration is exceeded
83
80
 
84
- ## [10.0.0-alpha.0] - 2024-11-28
81
+ The method would previously throw the most recent error encountered while
82
+ waiting for replication. The originating error can still be accessed using
83
+ the `cause` property of the `PropagationTimeoutError` error.
85
84
 
86
- This is a major release and breaks backwards compatibility.
85
+ - `db.waitForPropagation` now respects the `timeout` option more strictly
87
86
 
88
- See [the migration guide](./MIGRATING.md#v9-to-v10) for detailed instructions
89
- for upgrading your code to arangojs v10.
87
+ Previously the method would only time out if the timeout duration was
88
+ exceeded after the most recent request failed. Now the timeout is
89
+ recalculated and passed on to each request, preventing it from exceeding
90
+ the specified duration.
90
91
 
91
- ### Removed
92
+ If the propagation timed out due to an underlying request exceeding the
93
+ timeout duration, the `cause` property of the `PropagationTimeoutError`
94
+ error will be a `ResponseTimeoutError` error.
92
95
 
93
- - Removed unused `CreateUserOptions` type
96
+ - `config.beforeRequest` and `config.afterResponse` callbacks can now return
97
+ promises
94
98
 
95
- The actual type used by the `db.createUser` method is still `UserOptions`.
99
+ If the callback returns a promise, it will be awaited before the request
100
+ and response cycle proceeds. If either callback throws an error or returns
101
+ a promise that is rejected, that error will be thrown instead.
96
102
 
97
- - Removed unused `IndexDetails` type
103
+ - `config.afterResponse` callback signature changed
98
104
 
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.
105
+ The callback signature previously used the internal `ArangojsResponse` type.
106
+ The new signature uses the `Response` type of the Fetch API with an
107
+ additional `request` property to more accurately represent the actual value
108
+ it receives as the `parsedBody` property will never be present.
102
109
 
103
- ### Changed
110
+ - `response` property on `ArangoError` is now optional
104
111
 
105
- - Changed `QueueTimeMetrics` type to an interface
112
+ This property should always be present but this allows using the error in
113
+ situations where a response might not be available.
106
114
 
107
- - Changed `CursorExtras` and `CursorStats` interfaces to types
115
+ #### General type changes
108
116
 
109
117
  - Changed `GraphVertexCollection` and `GraphEdgeCollection` generic types to
110
118
  take separate `EntryResultType` and `EntryInputType` type parameters
@@ -115,13 +123,43 @@ for upgrading your code to arangojs v10.
115
123
 
116
124
  These type parameters are used to narrow the the returned collection type.
117
125
 
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`
126
+ - Changed `db.removeUser` method return type to `Promise<void>`
127
+
128
+ The previous return type served no purpose.
129
+
130
+ - Changed `QueueTimeMetrics` type to an interface
131
+
132
+ - Changed `CursorExtras` and `CursorStats` interfaces to types
133
+
134
+ #### Low-level request/route changes
135
+
136
+ - Renamed `path` option to `pathname` in `RequestOptions` type
137
+
138
+ This affects the `db.waitForPropagation` and `route.request` methods.
139
+
140
+ - Removed `basePath` option from `RequestOptions` type
141
+
142
+ This affects the `db.waitForPropagation` and `route.request` methods.
143
+
144
+ - Renamed `route.path` property to `route.pathname`
145
+
146
+ #### Renamed methods
147
+
148
+ - Renamed various methods for consistency:
149
+
150
+ Methods that return an array now follow the `listNouns` pattern, methods that
151
+ return a "list of nouns" wrapped in an object have been renamed to follow the
152
+ `getNouns` pattern to avoid confusion:
153
+
154
+ - `db.listServiceScripts` -> `db.getServiceScripts`
155
+ - `db.listHotBackups` -> `db.getHotBackups`
156
+ - `db.listFunctions` -> `db.listUserFunctions`
157
+ - `db.getLogMessages` -> `db.listLogMessages`
158
+
159
+ - Renamed AQL user function management methods:
160
+
161
+ - `db.createFunction` -> `db.createUserFunction`
162
+ - `db.dropFunction` -> `db.dropUserFunction`
125
163
 
126
164
  #### Module renaming
127
165
 
@@ -140,13 +178,18 @@ for upgrading your code to arangojs v10.
140
178
  - `arangojs/transaction` -> `arangojs/transactions`
141
179
  - `arangojs/view` -> `arangojs/views`
142
180
 
181
+ - Moved internal utility functions to new `arangojs/lib/util` module
182
+
183
+ These methods are all still marked as internal and should not be used
184
+ directly.
185
+
143
186
  #### Moved types
144
187
 
145
188
  - Moved document related types from `arangojs/collection` module to
146
189
  `arangojs/documents` module
147
190
 
148
191
  The following types were moved: `DocumentOperationFailure`,
149
- `DocumentOperationMetadata`, `DocumentExistsOptions`,
192
+ `DocumentOperationMetadata`, `DocumentExistsOptions`,
150
193
  `CollectionReadOptions`, `CollectionBatchReadOptions`,
151
194
  `CollectionInsertOptions`, `CollectionReplaceOptions`,
152
195
  `CollectionUpdateOptions`, `CollectionRemoveOptions`,
@@ -182,7 +225,8 @@ for upgrading your code to arangojs v10.
182
225
 
183
226
  The following types were moved: `QueryOptions`, `ExplainOptions`,
184
227
  `ExplainPlan`, `ExplainStats`, `SingleExplainResult`, `MultiExplainResult`,
185
- `AstNode`, `ParseResult`, `QueryOptimizerRule`, `QueryTracking`,
228
+ `AstNode`, `ParseResult`, `QueryCachePropertiesOptions`, `QueryCacheEntry`,
229
+ `QueryCacheProperties`, `QueryOptimizerRule`, `QueryTracking`,
186
230
  `QueryTrackingOptions`, `QueryInfo` and `AqlUserFunction`.
187
231
 
188
232
  - Moved service related types from `arangojs/database` module to new
@@ -206,7 +250,24 @@ for upgrading your code to arangojs v10.
206
250
  - Moved server administration related types from `arangojs/database` module to
207
251
  new `arangojs/administration` module
208
252
 
209
- The following types were moved: `QueueTimeMetrics` and `VersionInfo`.
253
+ The following types were moved: `CompactOptions`, `EngineInfo`,
254
+ `EngineStatsInfo`, `LicenseInfo`, `QueueTimeMetrics`, `ServerAvailability`,
255
+ `ServerStatusInformation`, `SingleServerSupportInfo`, `ClusterSupportInfo`
256
+ and `VersionInfo`.
257
+
258
+ - Moved configuration related types to new `arangojs/config` module
259
+
260
+ The following types were moved: `Config`, `LoadBalancingStrategy`,
261
+ `BasicAuthCredentials` and `BearerAuthCredentials`.
262
+
263
+ - Moved `ArangoErrorResponse` type to `arangojs/connection` module
264
+
265
+ The type is now also no longer marked as internal.
266
+
267
+ - Moved configuration related types to new `arangojs/configuration` module
268
+
269
+ The following types were moved: `ConfigOptions`, `LoadBalancingStrategy`,
270
+ `BasicAuthCredentials` and `BearerAuthCredentials`.
210
271
 
211
272
  #### Renamed types
212
273
 
@@ -218,8 +279,11 @@ for upgrading your code to arangojs v10.
218
279
  - `GeoIndex` -> `GeoIndexDescription`
219
280
  - `PersistentIndex` -> `PersistentIndexDescription`
220
281
  - `PrimaryIndex` -> `PrimaryIndexDescription`
282
+ - `EdgeIndex` -> `EdgeIndexDescription`
221
283
  - `TtlIndex` -> `TtlIndexDescription`
284
+ - `FulltextIndex` -> `FulltextIndexDescription`
222
285
  - `MdiIndex` -> `MdiIndexDescription`
286
+ - `MdiPrefixedIndex` -> `MdiPrefixedIndexDescription`
223
287
  - `InvertedIndex` -> `InvertedIndexDescription`
224
288
  - `InternalArangosearchIndex` -> `ArangosearchIndexDescription`
225
289
  - `InternalIndex` -> `InternalIndexDescription`
@@ -231,21 +295,43 @@ for upgrading your code to arangojs v10.
231
295
 
232
296
  - Renamed various types for consistency:
233
297
 
298
+ Types representing an instance of a specific entity type in ArangoDB like a
299
+ collection, graph or query now follow the `NounDescription` naming pattern:
300
+
234
301
  - `AqlUserFunction` -> `UserFunctionDescription`
235
302
  - `CollectionMetadata` -> `CollectionDescription`
236
303
  - `DatabaseInfo` -> `DatabaseDescription`
237
304
  - `GraphInfo` -> `GraphDescription`
238
305
  - `ServiceInfo` -> `ServiceDescription`
239
306
  - `QueryInfo` -> `QueryDescription`
307
+ - `TransactionDetails` -> `TransactionDescription`
308
+
309
+ Note that the `TransactionDescription` type used by `db.listTransactions`
310
+ is slightly different from the `TransactionInfo` type used by methods of
311
+ `Transaction` objects due to implementation details of ArangoDB.
312
+
313
+ Types representing general information rather than an instance of something
314
+ now generally follow the `NounInfo` naming pattern, whereas types
315
+ representing the result of an operation generally follow the `NounResult`
316
+ or `VerbNounResult` naming pattern:
317
+
240
318
  - `QueryTracking` -> `QueryTrackingInfo`
241
- - `TransactionDetails` -> `TransactionInfo`
319
+ - `ServerStatusInformation` -> `ServerStatusInfo`
320
+ - `CollectionImportResult` -> `ImportDocumentsResult`
321
+ - `CollectionEdgesResult` -> `DocumentEdgesResult`
322
+
323
+ Types for options passed to methods now generally follow the `NounOptions`,
324
+ `VerbNounOptions` or `VerbNounAttributeOptions` naming patterns:
325
+
326
+ - `Config` -> `ConfigOptions`
242
327
  - `TransactionCollections` -> `TransactionCollectionOptions`
243
328
  - `CreateDatabaseUser` -> `CreateDatabaseUserOptions`
244
-
245
- - Index operations:
246
- - `IndexListOptions` -> `ListIndexesOptions`
329
+ - `CollectionDropOptions` -> `DropCollectionOptions`
330
+ - `CollectionTruncateOptions` -> `TruncateCollectionOptions`
331
+ - `IndexListOptions` -> `ListIndexesOptions`
247
332
 
248
333
  - Collection document operations:
334
+
249
335
  - `DocumentExistsOptions` -> `DocumentExistsOptions`
250
336
  - `CollectionReadOptions` -> `ReadDocumentOptions`
251
337
  - `CollectionBatchReadOptions` -> `BulkReadDocumentsOptions`
@@ -255,10 +341,9 @@ for upgrading your code to arangojs v10.
255
341
  - `CollectionRemoveOptions` -> `RemoveDocumentOptions`
256
342
  - `CollectionImportOptions` -> `ImportDocumentsOptions`
257
343
  - `CollectionEdgesOptions` -> `DocumentEdgesOptions`
258
- - `CollectionImportResult` -> `ImportDocumentsResult`
259
- - `CollectionEdgesResult` -> `DocumentEdgesResult`
260
344
 
261
345
  - Graph collection document operation:
346
+
262
347
  - `GraphCollectionReadOptions` -> `ReadGraphDocumentOptions`
263
348
  - `GraphCollectionInsertOptions` -> `CreateGraphDocumentOptions`
264
349
  - `GraphCollectionReplaceOptions` -> `ReplaceGraphDocumentOptions`
@@ -266,6 +351,7 @@ for upgrading your code to arangojs v10.
266
351
  - `ViewPatchPropertiesOptions` -> `UpdateViewPropertiesOptions`
267
352
 
268
353
  - View operations:
354
+
269
355
  - `ArangoSearchViewPatchPropertiesOptions` -> `UpdateArangoSearchViewPropertiesOptions`
270
356
  - `SearchAliasViewPatchPropertiesOptions` -> `UpdateSearchAliasViewPropertiesOptions`
271
357
  - `SearchAliasViewPatchIndexOptions` -> `UpdateSearchAliasViewIndexOptions`
@@ -284,67 +370,41 @@ for upgrading your code to arangojs v10.
284
370
  - `ObjectWithId` (in `documents` module) -> `ObjectWithDocumentId`
285
371
  - `ObjectWithKey` (in `documents` module) -> `ObjectWithDocumentKey`
286
372
 
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
373
+ ### Added
305
374
 
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.
375
+ - Restored support for Unix domain sockets
309
376
 
310
- - `db.waitForPropagation` now respects the `timeout` option more strictly
377
+ Using Unix domain sockets requires the `undici` library to be installed.
311
378
 
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.
379
+ - Restored support for `config.agentOptions`
316
380
 
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.
381
+ The `config.agentOptions` option can now be used to create a custom `undici`
382
+ agent if the `undici` library is installed.
320
383
 
321
- - `config.beforeRequest` and `config.afterResponse` callbacks can now return
322
- promises
384
+ - Added `config.fetchOptions` option
323
385
 
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.
386
+ This option can now be used to specify default options for the `fetch`
387
+ function used by arangojs like `headers`, `credentials`, `keepalive` and
388
+ `redirect`.
327
389
 
328
- - `config.afterResponse` callback signature changed
390
+ - Added `BatchCursor#itemsView` property and `BatchCursorItemsView` interface
329
391
 
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.
392
+ This property provides a low-level interface for consuming the items of the
393
+ cursor and is used by the regular item-wise `Cursor` class internally.
334
394
 
335
- - `response` property on `ArangoError` is now optional
395
+ - Added `SystemIndexDescription` type
336
396
 
337
- This property should always be present but this allows using the error in
338
- situations where a response might not be available.
397
+ This type represents either of the system index types `primary` and `edge`
398
+ and can be used to cast indexes returned by `collection.indexes`.
339
399
 
340
- ### Added
400
+ - Added `ProcessedResponse` type
341
401
 
342
- - Added `BatchCursor#itemsView` property and `BatchCursorItemsView` interface
402
+ This type replaces the previously internal `ArangojsResponse` type and
403
+ extends the native `Response` type with additional properties.
343
404
 
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.
405
+ #### Error handling
346
406
 
347
- - Added `onError` option to `Config` (DE-955)
407
+ - Added `config.onError` option (DE-955)
348
408
 
349
409
  This option can be used to specify a callback function that will be invoked
350
410
  whenever a request results in an error. Unlike `afterResponse`, this callback
@@ -355,6 +415,22 @@ for upgrading your code to arangojs v10.
355
415
  If the `onError` callback throws an error or returns a promise that is
356
416
  rejected, that error will be thrown instead.
357
417
 
418
+ - Added support for `config.fetchOptions.redirect` option ([#613](https://github.com/arangodb/arangojs/issues/613))
419
+
420
+ This option can now be used to specify the redirect mode for requests.
421
+
422
+ When set to `"manual"`, arangojs will throw an `HttpError` wrapping the
423
+ redirect response instead of automatically following redirects.
424
+
425
+ Note that when set to `"error"`, the native fetch API will throw a
426
+ non-specific error (usually a `TypeError`) that arangojs will wrap in a
427
+ `FetchFailedError` instead.
428
+
429
+ - Added optional `ArangoError#request` property
430
+
431
+ This property is always present if the error has a `response` property. In
432
+ normal use this should always be the case.
433
+
358
434
  - Added `NetworkError` class
359
435
 
360
436
  This is the common base class for all errors (including `HttpError`) that
@@ -395,27 +471,48 @@ for upgrading your code to arangojs v10.
395
471
  `cause` property. This error is only thrown when `db.waitForPropagation`
396
472
  is invoked with a `timeout` option and the timeout duration is exceeded.
397
473
 
398
- - Added `ProcessedResponse` type
474
+ ## [9.3.0] - 2025-01-06
399
475
 
400
- This type replaces the previously internal `ArangojsResponse` type and
401
- extends the native `Response` type with additional properties.
476
+ ### Added
402
477
 
403
- - Added optional `ArangoError#request` property
478
+ - Added `db.compact` method (DE-906)
404
479
 
405
- This property is always present if the error has a `response` property. In
406
- normal use this should always be the case.
480
+ - Added `db.engineStats` method (DE-932)
481
+
482
+ - Added `db.getLicense` and `db.setLicense` methods (DE-949)
483
+
484
+ - Added `db.listQueryCacheEntries` method (DE-149)
485
+
486
+ - Added `db.clearQueryCache` method (DE-148)
487
+
488
+ - Added `db.getQueryCacheProperties` method (DE-150)
489
+
490
+ - Added `db.setQueryCacheProperties` method (DE-151)
491
+
492
+ - Added `collection.shards` method (DE-939)
493
+
494
+ - Added support for `mdi-prefixed` indexes (DE-956)
495
+
496
+ - Restored `fulltext` index type support (DE-957)
497
+
498
+ The `fulltext` index type is still no longer supported for creating new
499
+ indexes but can be used to cast existing indexes from `Index`.
500
+
501
+ - Added support for `edge` indexes (DE-958)
502
+
503
+ The `Index` type now can also be cast to the `EdgeIndex` type.
407
504
 
408
505
  ## [9.2.0] - 2024-11-27
409
506
 
410
507
  ### Added
411
508
 
412
- - Added `database.availability` method
509
+ - Added `db.availability` method
413
510
 
414
- - Added `database.engine` method (DE-931)
511
+ - Added `db.engine` method (DE-931)
415
512
 
416
- - Added `database.status` method ([#811](https://github.com/arangodb/arangojs/issues/811))
513
+ - Added `db.status` method ([#811](https://github.com/arangodb/arangojs/issues/811))
417
514
 
418
- - Added `database.supportInfo` method
515
+ - Added `db.supportInfo` method
419
516
 
420
517
  - Added `keepNull` option to `CollectionInsertOptions` type (DE-946)
421
518
 
@@ -1510,7 +1607,7 @@ For a detailed list of changes between pre-release versions of v7 see the
1510
1607
 
1511
1608
  - Changed `db.createDatabase` return type to `Database`
1512
1609
 
1513
- - Renamed `database.setQueryTracking` to `database.queryTracking`
1610
+ - Renamed `db.setQueryTracking` to `db.queryTracking`
1514
1611
 
1515
1612
  The method will now return the existing query tracking properties or set the
1516
1613
  new query tracking properties depending on whether an argument is provided.
@@ -1906,7 +2003,7 @@ For a detailed list of changes between pre-release versions of v7 see the
1906
2003
 
1907
2004
  - Added support for ArangoDB 3.5 Analyzers API
1908
2005
 
1909
- See the documentation of the `database.analyzer` method and the `Analyzer`
2006
+ See the documentation of the `db.analyzer` method and the `Analyzer`
1910
2007
  instances for information on using this API.
1911
2008
 
1912
2009
  - Added `collection.getResponsibleShard` method
@@ -2080,7 +2177,7 @@ For a detailed list of changes between pre-release versions of v7 see the
2080
2177
 
2081
2178
  - Fixed `edgeCollection.save` not respecting options ([#554](https://github.com/arangodb/arangojs/issues/554))
2082
2179
 
2083
- - Fixed `database.createDatabase` TypeScript signature ([#561](https://github.com/arangodb/arangojs/issues/561))
2180
+ - Fixed `db.createDatabase` TypeScript signature ([#561](https://github.com/arangodb/arangojs/issues/561))
2084
2181
 
2085
2182
  ## [6.5.0] - 2018-08-03
2086
2183
 
@@ -2121,7 +2218,7 @@ For a detailed list of changes between pre-release versions of v7 see the
2121
2218
 
2122
2219
  - Added `ArangoError` and `CollectionType` to public exports
2123
2220
 
2124
- - Added `database.close` method
2221
+ - Added `db.close` method
2125
2222
 
2126
2223
  - Added `opts` parameter to `EdgeCollection#save`
2127
2224
 
@@ -2129,11 +2226,11 @@ For a detailed list of changes between pre-release versions of v7 see the
2129
2226
 
2130
2227
  ### Added
2131
2228
 
2132
- - Added `database.version` method
2229
+ - Added `db.version` method
2133
2230
 
2134
- - Added `database.login` method
2231
+ - Added `db.login` method
2135
2232
 
2136
- - Added `database.exists` method
2233
+ - Added `db.exists` method
2137
2234
 
2138
2235
  - Added `collection.exists` method
2139
2236
 
@@ -2355,8 +2452,8 @@ For a detailed list of changes between pre-release versions of v7 see the
2355
2452
 
2356
2453
  Graph methods now only return the relevant part of the response body.
2357
2454
 
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
2455
+ [10.0.0]: https://github.com/arangodb/arangojs/compare/v9.3.0...v10.0.0
2456
+ [9.3.0]: https://github.com/arangodb/arangojs/compare/v9.2.0...v9.3.0
2360
2457
  [9.2.0]: https://github.com/arangodb/arangojs/compare/v9.1.0...v9.2.0
2361
2458
  [9.1.0]: https://github.com/arangodb/arangojs/compare/v9.0.0...v9.1.0
2362
2459
  [9.0.0]: https://github.com/arangodb/arangojs/compare/v8.8.1...v9.0.0
package/README.md CHANGED
@@ -36,7 +36,7 @@ You can also use [jsDelivr CDN](https://www.jsdelivr.com) during development:
36
36
  <script type="importmap">
37
37
  {
38
38
  "imports": {
39
- "arangojs": "https://cdn.jsdelivr.net/npm/arangojs@9.0.0/esm/index.js?+esm"
39
+ "arangojs": "https://cdn.jsdelivr.net/npm/arangojs@10.0.0/esm/index.js?+esm"
40
40
  }
41
41
  }
42
42
  </script>
@@ -183,7 +183,7 @@ For more details on the errors thrown by `undici`, see the
183
183
  Please make sure you are using the latest version of this driver and that the
184
184
  version of the arangojs documentation you are reading matches that version.
185
185
 
186
- Changes in the major version number of arangojs (e.g. 8.x.y -> 9.0.0) indicate
186
+ Changes in the major version number of arangojs (e.g. 9.x.y -> 10.0.0) indicate
187
187
  backwards-incompatible changes in the arangojs API that may require changes in
188
188
  your code when upgrading your version of arangojs.
189
189
 
@@ -194,10 +194,10 @@ the [compatibility section](#compatibility) for additional information.
194
194
  You can install an older version of arangojs using `npm` or `yarn`:
195
195
 
196
196
  ```sh
197
- # for version 8.x.x
198
- yarn add arangojs@8
197
+ # for version 9.x.x
198
+ yarn add arangojs@9
199
199
  # - or -
200
- npm install --save arangojs@8
200
+ npm install --save arangojs@9
201
201
  ```
202
202
 
203
203
  ### No code intelligence when using require instead of import
@@ -272,7 +272,7 @@ available.
272
272
  ### Unix domain sockets
273
273
 
274
274
  If you want to use Unix domain sockets, you need to install the `undici` module,
275
- which is an optional dependency of arangojs.
275
+ which is an optional peer dependency of arangojs.
276
276
 
277
277
  ```sh
278
278
  npm install --save undici
@@ -285,7 +285,8 @@ message indicating that the `undici` module is unavailable.
285
285
  ### Node.js with self-signed HTTPS certificates
286
286
 
287
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.
288
+ to install the `undici` module, which is an optional peer dependency of
289
+ arangojs.
289
290
 
290
291
  ```sh
291
292
  npm install --save undici