Skip to content

Commit a4a336f

Browse files
committed
Big rename/restructure
1 parent 940b896 commit a4a336f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+5283
-5006
lines changed

CHANGELOG.md

Lines changed: 215 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,211 @@ This driver uses semantic versioning:
1414
- A change in the major version (e.g. 1.Y.Z -> 2.0.0) indicates _breaking_
1515
changes that require changes in your code to upgrade.
1616

17-
## [9.2.0] - 2024-11-27
17+
## [Unreleased]
1818

1919
This is a major release and breaks backwards compatibility.
2020

2121
See [the migration guide](./MIGRATING.md#v9-to-v10) for detailed instructions
2222
for upgrading your code to arangojs v10.
2323

24+
### Removed
25+
26+
- Removed unused `CreateUserOptions` type
27+
28+
The actual type used by the `db.createUser` method is still `UserOptions`.
29+
30+
- Removed unused `IndexDetails` type
31+
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.
35+
2436
### Changed
2537

38+
- Changed `QueueTimeMetrics` type to an interface
39+
40+
- Changed `CursorExtras` and `CursorStats` interfaces to types
41+
42+
- Changed `GraphVertexCollection` and `GraphEdgeCollection` generic types to
43+
take separate `EntryResultType` and `EntryInputType` type parameters
44+
45+
- Changed `db.collection`, `db.createCollection` and `db.createEdgeCollection`
46+
methods to take separate `EntryResultType` and `EntryInputType` type
47+
parameters
48+
49+
These type parameters are used to narrow the the returned collection type.
50+
51+
- Renamed `db.listServiceScripts` method to `db.getServiceScripts`
52+
- Renamed `db.listHotBackups` method to `db.getHotBackups`
53+
- Renamed `db.getLogMessages` method to `db.listLogMessages`
54+
- Renamed `db.listFunctions` method to `db.listUserFunctions`
55+
- Renamed `db.createFunction` method to `db.createUserFunction`
56+
- Renamed `db.dropFunction` method to `db.dropUserFunction`
57+
- Changed `db.removeUser` method to return `void`
58+
59+
#### Module renaming
60+
61+
- Renamed most modules to plural form for consistency
62+
63+
The following modules were renamed:
64+
65+
- `arangojs/analyzer` -> `arangojs/analyzers`
66+
- `arangojs/collection` -> `arangojs/collections`
67+
- `arangojs/cursor` -> `arangojs/cursors`
68+
- `arangojs/database` -> `arangojs/databases`
69+
- `arangojs/error` -> `arangojs/errors`
70+
- `arangojs/graph` -> `arangojs/graphs`
71+
- `arangojs/job` -> `arangojs/jobs`
72+
- `arangojs/route` -> `arangojs/routes`
73+
- `arangojs/transaction` -> `arangojs/transactions`
74+
- `arangojs/view` -> `arangojs/views`
75+
76+
#### Moved types
77+
78+
- Moved document related types from `arangojs/collection` module to
79+
`arangojs/documents` module
80+
81+
The following types were moved: `DocumentOperationFailure`,
82+
`DocumentOperationMetadata`, `DocumentExistsOptions`,
83+
`CollectionReadOptions`, `CollectionBatchReadOptions`,
84+
`CollectionInsertOptions`, `CollectionReplaceOptions`,
85+
`CollectionUpdateOptions`, `CollectionRemoveOptions`,
86+
`CollectionImportOptions`, `CollectionEdgesOptions`,
87+
`CollectionImportResult` and `CollectionEdgesResult`
88+
89+
- Moved index related types from `arangojs/collection` module to
90+
`arangojs/indexes` module
91+
92+
The following types were moved: `IndexListOptions`.
93+
94+
- Moved transaction related types from `arangojs/database` module to
95+
`arangojs/transactions` module
96+
97+
The following types were moved: `TransactionCollections`,
98+
`TransactionOptions` and `TransactionDetails`.
99+
100+
- Moved cluster related types from `arangojs/database` module to new
101+
`arangojs/clusters` module
102+
103+
The following types were moved: `ClusterImbalanceInfo`,
104+
`ClusterRebalanceState`, `ClusterRebalanceOptions`, `ClusterRebalanceMove`
105+
and `ClusterRebalanceResult`.
106+
107+
- Moved hot backup related types from `arangojs/database` module to new
108+
`arangojs/hot-backups` module
109+
110+
The following types were moved: `HotBackupOptions`, `HotBackupResult` and
111+
`HotBackupList`.
112+
113+
- Moved query related types from `arangojs/database` module to new
114+
`arangojs/queries` module
115+
116+
The following types were moved: `QueryOptions`, `ExplainOptions`,
117+
`ExplainPlan`, `ExplainStats`, `SingleExplainResult`, `MultiExplainResult`,
118+
`AstNode`, `ParseResult`, `QueryOptimizerRule`, `QueryTracking`,
119+
`QueryTrackingOptions`, `QueryInfo` and `AqlUserFunction`.
120+
121+
- Moved service related types from `arangojs/database` module to new
122+
`arangojs/services` module
123+
124+
The following types were moved: `InstallServiceOptions`,
125+
`ReplaceServiceOptions`, `UpgradeServiceOptions`, `UninstallServiceOptions`,
126+
`ServiceSummary`, `ServiceInfo`, `ServiceConfiguration`,
127+
`SingleServiceDependency`, `MultiServiceDependency`, `ServiceTestStats`,
128+
`ServiceTestStreamTest`, `ServiceTestStreamReport`, `ServiceTestSuiteTest`,
129+
`ServiceTestSuite`, `ServiceTestSuiteReport`, `ServiceTestXunitTest`,
130+
`ServiceTestXunitReport`, `ServiceTestTapReport`, `ServiceTestDefaultTest`,
131+
`ServiceTestDefaultReport` and `SwaggerJson`.
132+
133+
- Moved user related types from `arangojs/database` module to new
134+
`arangojs/users` module
135+
136+
The following types were moved: `AccessLevel`, `ArangoUser`, `UserOptions`,
137+
`UserAccessLevelOptions` and `CreateDatabaseUser`.
138+
139+
- Moved server administration related types from `arangojs/database` module to
140+
new `arangojs/administration` module
141+
142+
The following types were moved: `QueueTimeMetrics` and `VersionInfo`.
143+
144+
#### Renamed types
145+
146+
- Renamed `Index` types to `IndexDescription` for consistency
147+
148+
The specific index types were also renamed accordingly:
149+
150+
- `Index` -> `IndexDescription`
151+
- `GeoIndex` -> `GeoIndexDescription`
152+
- `PersistentIndex` -> `PersistentIndexDescription`
153+
- `PrimaryIndex` -> `PrimaryIndexDescription`
154+
- `TtlIndex` -> `TtlIndexDescription`
155+
- `MdiIndex` -> `MdiIndexDescription`
156+
- `InvertedIndex` -> `InvertedIndexDescription`
157+
- `InternalArangosearchIndex` -> `ArangosearchIndexDescription`
158+
- `InternalIndex` -> `InternalIndexDescription`
159+
- `HiddenIndex` -> `HiddenIndexDescription`
160+
161+
Note that the "Internal" prefix was dropped from `ArangosearchIndexDescription`
162+
to more accurately reflect the index type name. The index type still refers
163+
to an internal index, however.
164+
165+
- Renamed various types for consistency:
166+
167+
- `AqlUserFunction` -> `UserFunctionDescription`
168+
- `CollectionMetadata` -> `CollectionDescription`
169+
- `DatabaseInfo` -> `DatabaseDescription`
170+
- `GraphInfo` -> `GraphDescription`
171+
- `ServiceInfo` -> `ServiceDescription`
172+
- `QueryInfo` -> `QueryDescription`
173+
- `QueryTracking` -> `QueryTrackingInfo`
174+
- `TransactionDetails` -> `TransactionInfo`
175+
- `TransactionCollections` -> `TransactionCollectionOptions`
176+
- `CreateDatabaseUser` -> `CreateDatabaseUserOptions`
177+
178+
- Index operations:
179+
- `IndexListOptions` -> `ListIndexesOptions`
180+
181+
- Collection document operations:
182+
- `DocumentExistsOptions` -> `DocumentExistsOptions`
183+
- `CollectionReadOptions` -> `ReadDocumentOptions`
184+
- `CollectionBatchReadOptions` -> `BulkReadDocumentsOptions`
185+
- `CollectionInsertOptions` -> `InsertDocumentOptions`
186+
- `CollectionReplaceOptions` -> `ReplaceDocumentOptions`
187+
- `CollectionUpdateOptions` -> `UpdateDocumentOptions`
188+
- `CollectionRemoveOptions` -> `RemoveDocumentOptions`
189+
- `CollectionImportOptions` -> `ImportDocumentsOptions`
190+
- `CollectionEdgesOptions` -> `DocumentEdgesOptions`
191+
- `CollectionImportResult` -> `ImportDocumentsResult`
192+
- `CollectionEdgesResult` -> `DocumentEdgesResult`
193+
194+
- Graph collection document operation:
195+
- `GraphCollectionReadOptions` -> `ReadGraphDocumentOptions`
196+
- `GraphCollectionInsertOptions` -> `CreateGraphDocumentOptions`
197+
- `GraphCollectionReplaceOptions` -> `ReplaceGraphDocumentOptions`
198+
- `GraphCollectionRemoveOptions` -> `RemoveGraphDocumentOptions`
199+
- `ViewPatchPropertiesOptions` -> `UpdateViewPropertiesOptions`
200+
201+
- View operations:
202+
- `ArangoSearchViewPatchPropertiesOptions` -> `UpdateArangoSearchViewPropertiesOptions`
203+
- `SearchAliasViewPatchPropertiesOptions` -> `UpdateSearchAliasViewPropertiesOptions`
204+
- `SearchAliasViewPatchIndexOptions` -> `UpdateSearchAliasViewIndexOptions`
205+
- `ArangoSearchViewStoredValueOptions` -> `CreateArangoSearchViewStoredValueOptions`
206+
207+
- Renamed `ArrayCursor` and `BatchedArrayCursor` classes to `Cursor` and
208+
`BatchCursor` respectively
209+
210+
The previous name was misleading because it conflicted with how the ArangoDB
211+
distinguishes between array cursors and streaming cursors in the interactive
212+
shell. This distinction does not apply to the driver.
213+
214+
- Renamed various types to reduce ambiguity:
215+
216+
- `ObjectWithId` (in `indexes` module) -> `ObjectWithIndexId`
217+
- `ObjectWithId` (in `documents` module) -> `ObjectWithDocumentId`
218+
- `ObjectWithKey` (in `documents` module) -> `ObjectWithDocumentKey`
219+
220+
#### Error handling
221+
26222
- Errors encountered before a request completes are now wrapped in a
27223
`NetworkError` or a subclass thereof
28224

@@ -76,13 +272,10 @@ for upgrading your code to arangojs v10.
76272

77273
### Added
78274

79-
- Added `database.availability` method
80-
81-
- Added `database.engine` method (DE-931)
82-
83-
- Added `database.status` method ([#811](https://github.com/arangodb/arangojs/issues/811))
275+
- Added `BatchCursor#itemsView` property and `BatchCursorItemsView` interface
84276

85-
- Added `database.supportInfo` method
277+
This property provides a low-level interface for consuming the items of the
278+
cursor and is used by the regular item-wise `Cursor` class internally.
86279

87280
- Added `onError` option to `Config` (DE-955)
88281

@@ -145,6 +338,18 @@ for upgrading your code to arangojs v10.
145338
This property is always present if the error has a `response` property. In
146339
normal use this should always be the case.
147340

341+
## [9.2.0] - 2024-11-27
342+
343+
### Added
344+
345+
- Added `database.availability` method
346+
347+
- Added `database.engine` method (DE-931)
348+
349+
- Added `database.status` method ([#811](https://github.com/arangodb/arangojs/issues/811))
350+
351+
- Added `database.supportInfo` method
352+
148353
- Added `keepNull` option to `CollectionInsertOptions` type (DE-946)
149354

150355
This option was previously missing from the type.
@@ -185,6 +390,8 @@ for upgrading your code to arangojs v10.
185390
This property is only available when fetching indexes with the `withHidden`
186391
option set to `true`.
187392

393+
### Added
394+
188395
- Added `HiddenIndex` type (DE-849)
189396

190397
This type is used to represent an index returned by `collection.indexes` when
@@ -2081,6 +2288,7 @@ For a detailed list of changes between pre-release versions of v7 see the
20812288

20822289
Graph methods now only return the relevant part of the response body.
20832290

2291+
[unreleased]: https://github.com/arangodb/arangojs/compare/v9.2.0...HEAD
20842292
[9.2.0]: https://github.com/arangodb/arangojs/compare/v9.1.0...v9.2.0
20852293
[9.1.0]: https://github.com/arangodb/arangojs/compare/v9.0.0...v9.1.0
20862294
[9.0.0]: https://github.com/arangodb/arangojs/compare/v8.8.1...v9.0.0

MIGRATING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,38 @@ try {
1818
}
1919
```
2020

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+
2153
## v8 to v9
2254

2355
Version 9 reverts the automatic NFC normalization introduced in v7.7.0. This

0 commit comments

Comments
 (0)