New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

arangojs

Package Overview
Dependencies
Maintainers
2
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arangojs - npm Package Versions

23
14

10.1.1

Diff

Changelog

Source

[10.1.1] - 2025-01-13

Changed

  • Removed File from source option types in Foxx CRUD methods (#818)

    The source option type already includes Blob, which File extends.

pluma4345
published 10.1.0 •

Changelog

Source

[10.1.0] - 2025-01-13

Added

  • Added ignoreRevs option to RemoveDocumentOptions type (DE-947)

    This affects the collection.remove and collection.removeAll methods.

pluma4345
published 10.0.0 •

Changelog

Source

[10.0.0] - 2025-01-06

This is a major release and breaks backwards compatibility.

See the migration guide for detailed instructions for upgrading your code to arangojs v10.

Removed

  • Removed unused CreateUserOptions type

    The actual type used by the db.createUser method is still UserOptions.

  • Removed unused IndexDetails type

    This type was intended to be returned by collection.indexes when the withStats option is set to true but the figures property is already included in the current return type.

  • Removed Node.js 18 support

    Node.js 18 will reach its end of life in May 2025, so arangojs will no longer support this version of Node.js going forward.

    For more information, see the Node.js release schedule.

Changed

  • Closing a connection now closes all open requests

    Previously in certain situations only the most recent request would be closed per server. Note that this still merely aborts the requests but does not guarantee the underlying connections are closed as these are handled by Node.js or the browser natively. need to be installed otherwise.

  • Moved fetch-specific config options from into config.fetchOptions

    The following options were moved: credentials, headers and keepalive.

  • db.setUserAccessLevel now takes grant as a separate parameter

    The parameter was previously passed as an additional property in the options parameter.

Error handling
  • Errors encountered before a request completes are now wrapped in a NetworkError or a subclass thereof

    This should help making it easier to diagnose network issues and distinguish the relevant error conditions.

    The originating error can still be accessed using the cause property of the NetworkError error.

  • HttpError now extends the NetworkError class

    This allows treating all non-ArangoError errors as one category of errors, even when there is no server response available.

  • db.waitForPropagation now throws a PropagationTimeoutError error when invoked with a timeout option and the timeout duration is exceeded

    The method would previously throw the most recent error encountered while waiting for replication. The originating error can still be accessed using the cause property of the PropagationTimeoutError error.

  • db.waitForPropagation now respects the timeout option more strictly

    Previously the method would only time out if the timeout duration was exceeded after the most recent request failed. Now the timeout is recalculated and passed on to each request, preventing it from exceeding the specified duration.

    If the propagation timed out due to an underlying request exceeding the timeout duration, the cause property of the PropagationTimeoutError error will be a ResponseTimeoutError error.

  • config.beforeRequest and config.afterResponse callbacks can now return promises

    If the callback returns a promise, it will be awaited before the request and response cycle proceeds. If either callback throws an error or returns a promise that is rejected, that error will be thrown instead.

  • config.afterResponse callback signature changed

    The callback signature previously used the internal ArangojsResponse type. The new signature uses the Response type of the Fetch API with an additional request property to more accurately represent the actual value it receives as the parsedBody property will never be present.

  • response property on ArangoError is now optional

    This property should always be present but this allows using the error in situations where a response might not be available.

General type changes
  • Changed GraphVertexCollection and GraphEdgeCollection generic types to take separate EntryResultType and EntryInputType type parameters

  • Changed db.collection, db.createCollection and db.createEdgeCollection methods to take separate EntryResultType and EntryInputType type parameters

    These type parameters are used to narrow the the returned collection type.

  • Changed db.removeUser method return type to Promise<void>

    The previous return type served no purpose.

  • Changed QueueTimeMetrics type to an interface

  • Changed CursorExtras and CursorStats interfaces to types

Low-level request/route changes
  • Renamed path option to pathname in RequestOptions type

    This affects the db.waitForPropagation and route.request methods.

  • Removed basePath option from RequestOptions type

    This affects the db.waitForPropagation and route.request methods.

  • Renamed route.path property to route.pathname

Renamed methods
  • Renamed various methods for consistency:

    Methods that return an array now follow the listNouns pattern, methods that return a "list of nouns" wrapped in an object have been renamed to follow the getNouns pattern to avoid confusion:

    • db.listServiceScripts -> db.getServiceScripts
    • db.listHotBackups -> db.getHotBackups
    • db.listFunctions -> db.listUserFunctions
    • db.getLogMessages -> db.listLogMessages
  • Renamed AQL user function management methods:

    • db.createFunction -> db.createUserFunction
    • db.dropFunction -> db.dropUserFunction
Module renaming
  • Renamed most modules to plural form for consistency

    The following modules were renamed:

    • arangojs/analyzer -> arangojs/analyzers
    • arangojs/collection -> arangojs/collections
    • arangojs/cursor -> arangojs/cursors
    • arangojs/database -> arangojs/databases
    • arangojs/error -> arangojs/errors
    • arangojs/graph -> arangojs/graphs
    • arangojs/job -> arangojs/jobs
    • arangojs/route -> arangojs/routes
    • arangojs/transaction -> arangojs/transactions
    • arangojs/view -> arangojs/views
  • Moved internal utility functions to new arangojs/lib/util module

    These methods are all still marked as internal and should not be used directly.

Moved types
  • Moved document related types from arangojs/collection module to arangojs/documents module

    The following types were moved: DocumentOperationFailure, DocumentOperationMetadata, DocumentExistsOptions, CollectionReadOptions, CollectionBatchReadOptions, CollectionInsertOptions, CollectionReplaceOptions, CollectionUpdateOptions, CollectionRemoveOptions, CollectionImportOptions, CollectionEdgesOptions, CollectionImportResult and CollectionEdgesResult

  • Moved index related types from arangojs/collection module to arangojs/indexes module

    The following types were moved: IndexListOptions.

  • Moved transaction related types from arangojs/database module to arangojs/transactions module

    The following types were moved: TransactionCollections, TransactionOptions and TransactionDetails.

  • Moved cluster related types from arangojs/database module to new arangojs/clusters module

    The following types were moved: ClusterImbalanceInfo, ClusterRebalanceState, ClusterRebalanceOptions, ClusterRebalanceMove and ClusterRebalanceResult.

  • Moved hot backup related types from arangojs/database module to new arangojs/hot-backups module

    The following types were moved: HotBackupOptions, HotBackupResult and HotBackupList.

  • Moved query related types from arangojs/database module to new arangojs/queries module

    The following types were moved: QueryOptions, ExplainOptions, ExplainPlan, ExplainStats, SingleExplainResult, MultiExplainResult, AstNode, ParseResult, QueryCachePropertiesOptions, QueryCacheEntry, QueryCacheProperties, QueryOptimizerRule, QueryTracking, QueryTrackingOptions, QueryInfo and AqlUserFunction.

  • Moved service related types from arangojs/database module to new arangojs/services module

    The following types were moved: InstallServiceOptions, ReplaceServiceOptions, UpgradeServiceOptions, UninstallServiceOptions, ServiceSummary, ServiceInfo, ServiceConfiguration, SingleServiceDependency, MultiServiceDependency, ServiceTestStats, ServiceTestStreamTest, ServiceTestStreamReport, ServiceTestSuiteTest, ServiceTestSuite, ServiceTestSuiteReport, ServiceTestXunitTest, ServiceTestXunitReport, ServiceTestTapReport, ServiceTestDefaultTest, ServiceTestDefaultReport and SwaggerJson.

  • Moved user related types from arangojs/database module to new arangojs/users module

    The following types were moved: AccessLevel, ArangoUser, UserOptions, UserAccessLevelOptions and CreateDatabaseUser.

  • Moved server administration related types from arangojs/database module to new arangojs/administration module

    The following types were moved: CompactOptions, EngineInfo, EngineStatsInfo, LicenseInfo, QueueTimeMetrics, ServerAvailability, ServerStatusInformation, SingleServerSupportInfo, ClusterSupportInfo and VersionInfo.

  • Moved configuration related types to new arangojs/config module

    The following types were moved: Config, LoadBalancingStrategy, BasicAuthCredentials and BearerAuthCredentials.

  • Moved ArangoErrorResponse type to arangojs/connection module

    The type is now also no longer marked as internal.

  • Moved configuration related types to new arangojs/configuration module

    The following types were moved: ConfigOptions, LoadBalancingStrategy, BasicAuthCredentials and BearerAuthCredentials.

Renamed types
  • Renamed Index types to IndexDescription for consistency

    The specific index types were also renamed accordingly:

    • Index -> IndexDescription
    • GeoIndex -> GeoIndexDescription
    • PersistentIndex -> PersistentIndexDescription
    • PrimaryIndex -> PrimaryIndexDescription
    • EdgeIndex -> EdgeIndexDescription
    • TtlIndex -> TtlIndexDescription
    • FulltextIndex -> FulltextIndexDescription
    • MdiIndex -> MdiIndexDescription
    • MdiPrefixedIndex -> MdiPrefixedIndexDescription
    • InvertedIndex -> InvertedIndexDescription
    • InternalArangosearchIndex -> ArangosearchIndexDescription
    • InternalIndex -> InternalIndexDescription
    • HiddenIndex -> HiddenIndexDescription

    Note that the "Internal" prefix was dropped from ArangosearchIndexDescription to more accurately reflect the index type name. The index type still refers to an internal index, however.

  • Renamed various types for consistency:

    Types representing an instance of a specific entity type in ArangoDB like a collection, graph or query now follow the NounDescription naming pattern:

    • AqlUserFunction -> UserFunctionDescription
    • CollectionMetadata -> CollectionDescription
    • DatabaseInfo -> DatabaseDescription
    • GraphInfo -> GraphDescription
    • ServiceInfo -> ServiceDescription
    • QueryInfo -> QueryDescription
    • TransactionDetails -> TransactionDescription

    Note that the TransactionDescription type used by db.listTransactions is slightly different from the TransactionInfo type used by methods of Transaction objects due to implementation details of ArangoDB.

    Types representing general information rather than an instance of something now generally follow the NounInfo naming pattern, whereas types representing the result of an operation generally follow the NounResult or VerbNounResult naming pattern:

    • QueryTracking -> QueryTrackingInfo
    • ServerStatusInformation -> ServerStatusInfo
    • CollectionImportResult -> ImportDocumentsResult
    • CollectionEdgesResult -> DocumentEdgesResult

    Types for options passed to methods now generally follow the NounOptions, VerbNounOptions or VerbNounAttributeOptions naming patterns:

    • Config -> ConfigOptions

    • TransactionCollections -> TransactionCollectionOptions

    • CreateDatabaseUser -> CreateDatabaseUserOptions

    • CollectionDropOptions -> DropCollectionOptions

    • CollectionTruncateOptions -> TruncateCollectionOptions

    • IndexListOptions -> ListIndexesOptions

    • Collection document operations:

      • DocumentExistsOptions -> DocumentExistsOptions
      • CollectionReadOptions -> ReadDocumentOptions
      • CollectionBatchReadOptions -> BulkReadDocumentsOptions
      • CollectionInsertOptions -> InsertDocumentOptions
      • CollectionReplaceOptions -> ReplaceDocumentOptions
      • CollectionUpdateOptions -> UpdateDocumentOptions
      • CollectionRemoveOptions -> RemoveDocumentOptions
      • CollectionImportOptions -> ImportDocumentsOptions
      • CollectionEdgesOptions -> DocumentEdgesOptions
    • Graph collection document operation:

      • GraphCollectionReadOptions -> ReadGraphDocumentOptions
      • GraphCollectionInsertOptions -> CreateGraphDocumentOptions
      • GraphCollectionReplaceOptions -> ReplaceGraphDocumentOptions
      • GraphCollectionRemoveOptions -> RemoveGraphDocumentOptions
      • ViewPatchPropertiesOptions -> UpdateViewPropertiesOptions
    • View operations:

      • ArangoSearchViewPatchPropertiesOptions -> UpdateArangoSearchViewPropertiesOptions
      • SearchAliasViewPatchPropertiesOptions -> UpdateSearchAliasViewPropertiesOptions
      • SearchAliasViewPatchIndexOptions -> UpdateSearchAliasViewIndexOptions
      • ArangoSearchViewStoredValueOptions -> CreateArangoSearchViewStoredValueOptions
  • Renamed ArrayCursor and BatchedArrayCursor classes to Cursor and BatchCursor respectively

    The previous name was misleading because it conflicted with how the ArangoDB distinguishes between array cursors and streaming cursors in the interactive shell. This distinction does not apply to the driver.

  • Renamed various types to reduce ambiguity:

    • ObjectWithId (in indexes module) -> ObjectWithIndexId
    • ObjectWithId (in documents module) -> ObjectWithDocumentId
    • ObjectWithKey (in documents module) -> ObjectWithDocumentKey

Added

  • Restored support for Unix domain sockets

    Using Unix domain sockets requires the undici library to be installed.

  • Restored support for config.agentOptions

    The config.agentOptions option can now be used to create a custom undici agent if the undici library is installed.

  • Added config.fetchOptions option

    This option can now be used to specify default options for the fetch function used by arangojs like headers, credentials, keepalive and redirect.

  • Added BatchCursor#itemsView property and BatchCursorItemsView interface

    This property provides a low-level interface for consuming the items of the cursor and is used by the regular item-wise Cursor class internally.

  • Added SystemIndexDescription type

    This type represents either of the system index types primary and edge and can be used to cast indexes returned by collection.indexes.

  • Added ProcessedResponse type

    This type replaces the previously internal ArangojsResponse type and extends the native Response type with additional properties.

Error handling
  • Added config.onError option (DE-955)

    This option can be used to specify a callback function that will be invoked whenever a request results in an error. Unlike afterResponse, this callback will be invoked even if the request completed but returned an error status. In this case the error will be the HttpError or ArangoError representing the error response.

    If the onError callback throws an error or returns a promise that is rejected, that error will be thrown instead.

  • Added support for config.fetchOptions.redirect option (#613)

    This option can now be used to specify the redirect mode for requests.

    When set to "manual", arangojs will throw an HttpError wrapping the redirect response instead of automatically following redirects.

    Note that when set to "error", the native fetch API will throw a non-specific error (usually a TypeError) that arangojs will wrap in a FetchFailedError instead.

  • Added optional ArangoError#request property

    This property is always present if the error has a response property. In normal use this should always be the case.

  • Added NetworkError class

    This is the common base class for all errors (including HttpError) that occur while making a request. The originating error can be accessed using the cause property. The request object can be accessed using the request property.

    Note that ArangoError and the new PropagationTimeoutError error type do not extend NetworkError but may wrap an underlying error, which can be accessed using the cause property.

  • Added ResponseTimeoutError class

    This error extends NetworkError and is thrown when a request deliberately times out using the timeout option.

  • Added RequestAbortedError class

    This error extends NetworkError and is thrown when a request is aborted by using the db.close method.

  • Added FetchFailedError class

    This error extends NetworkError and is thrown when a request fails because the underlying fetch call fails (usually with a TypeError).

    In Node.js the root cause of this error (e.g. a network failure) can often be found in the cause property of the originating error, i.e. the cause property of the cause property of this error.

    In browsers the root cause is usually not exposed directly but can often be diagnosed by examining the developer console or network tab.

  • Added PropagationTimeoutError class

    This error does not extend NetworkError but wraps the most recent error encountered while waiting for replication, which can be accessed using the cause property. This error is only thrown when db.waitForPropagation is invoked with a timeout option and the timeout duration is exceeded.

pluma4345
published 9.3.0 •

Changelog

Source

[9.3.0] - 2025-01-06

Added

  • Added db.compact method (DE-906)

  • Added db.engineStats method (DE-932)

  • Added db.getLicense and db.setLicense methods (DE-949)

  • Added db.listQueryCacheEntries method (DE-149)

  • Added db.clearQueryCache method (DE-148)

  • Added db.getQueryCacheProperties method (DE-150)

  • Added db.setQueryCacheProperties method (DE-151)

  • Added collection.shards method (DE-939)

  • Added support for mdi-prefixed indexes (DE-956)

  • Restored fulltext index type support (DE-957)

    The fulltext index type is still no longer supported for creating new indexes but can be used to cast existing indexes from Index.

  • Added support for edge indexes (DE-958)

    The Index type now can also be cast to the EdgeIndex type.

pluma4345
published 10.0.0-rc.0 •

pluma4345
published 10.0.0-alpha.1 •

pluma4345
published 10.0.0-alpha.0 •

pluma4345
published 9.2.0 •

Changelog

Source

[9.2.0] - 2024-11-27

Added

  • Added db.availability method

  • Added db.engine method (DE-931)

  • Added db.status method (#811)

  • Added db.supportInfo method

  • Added keepNull option to CollectionInsertOptions type (DE-946)

    This option was previously missing from the type.

  • Added allowDirtyRead option to DocumentExistsOptions type (DE-945)

    This option was previously missing from the type.

  • Added ignoreRevs option to CollectionBatchReadOptions type (DE-947)

    This option was previously missing from the type.

  • Added options argument to CollectionTruncateOptions type (DE-940)

    There was previously no way to pass options to the truncate method.

  • Added database property to Analyzer, ArrayCursor, BatchedArrayCursor, Collection, Graph, Job, Route, Transaction and View (DE-935)

    This property can be used to access the database instance a given object belongs to.

  • Added Route#headers and Route#path properties

    These properties can be used to access the headers and path used when creating the route.

  • Added ArrayCursor#id and BatchedArrayCursor#id properties (DE-936)

    This property can be used to access the ID of the cursor.

pluma4345
published 9.1.0 •

Changelog

Source

[9.1.0] - 2024-09-25

Changed

  • Removed progress property from Index type

    This property is only available when fetching indexes with the withHidden option set to true.

Added

  • Added HiddenIndex type (DE-849)

    This type is used to represent an index returned by collection.indexes when the withHidden option is set to true and includes the progress property in addition to internal indexes.

pluma4345
published 9.0.0 •

Changelog

Source

[9.0.0] - 2024-07-31

This is a major release and breaks backwards compatibility.

See the migration guide for detailed instructions for upgrading your code to arangojs v9.

Removed

  • Removed Node.js 14 and Node.js 16 support

    With Node.js 14 and 16 having reached their end of life, arangojs will no longer support these versions of Node.js going forward.

    For more information, see the Node.js release schedule.

  • Removed Params and Headers types

    These can mostly be replaced with the native URLSearchParams and Headers types but most public methods still accept the equivalent Record types for convenience.

  • Removed deprecated FulltextIndex and related types

    Fulltext indexes have been deprecated in ArangoDB 3.10 and should be replaced with ArangoSearch.

  • Removed browser build

    The browser build has been removed from the repository and will no longer be published to npm. The npm package can still be used in the browser by using common frontend tooling like webpack or rollup.

  • Removed Collection methods for simple queries: list, all, any, byExample, firstExample, removeByExample, replaceByExample, updateByExample, lookupByKeys, removeByKeys, fulltext

    Simple queries were deprecated in ArangoDB 3.4 and can be replicated with AQL.

Changed

  • Replaced request logic with native fetch API (#788, DE-578, DE-758)

    The node-specific request logic using the http and https modules has been replaced with all-new logic using the web standard fetch API, which should work in Node.js, browsers and other conformant environments.

  • Unicode names are now no longer automatically NFC normalized (DE-65)

    This change affects all database, collection, graph, view and analyzer names using unicode characters. Starting with arangojs v7.7.0 these names were automatically NFC normalized. This behavior has now been reverted to match the behavior of other ArangoDB drivers and help detect normalization issues in user code.

  • Changed return type of aql and the AQL join helper function to AqlQuery

    Previously the internal GeneratedAqlQuery type was exposed as the return type of these functions, leading to complexity when handling generic type arguments.

  • Removed dependency on Node path module or its browserify equivalent

    This change should be backwards-compatible but may produce different results when using non-normalized paths and base-paths in custom routes. This should help support more environments and reduce the size of the browser bundle.

  • Inlined x3-linkedlist dependency

    Inlining this dependency should help make arangojs more portable.

  • Split the Collection type parameter into result and input types (#807)

    It is now possible to specify a separate type for the data passed when creating or modifying documents in addition to the type of the data returned when fetching documents. This allows excluding computed properties from the input type while still including them in the result type.

Added

  • Added ESM support (DE-236)

    The driver now supports being imported as an ES module or CommonJS module and provides exports for both types of environments. This change should be backwards-compatible.

  • Added support for withHidden option in collection.indexes

    This option was introduced in ArangoDB 3.10.13 and 3.11.7 and allows fetching the progress information of indexes that are in the building phase.

  • Added support for withStats option in collection.indexes

    This method now takes an object with withStats and withHidden options instead of a boolean flag.

  • Added readonly Job#id property

    This property was not previously exposed.

  • Added skipFastLockRound option for streaming transactions

    This option was introduced in 3.12.1 and allows skipping the fast lock round.

  • Added non-specific EnsureIndexOptions type and ensureIndex method signature (#778)

    This allows creating indexes without narrowing the index type.

23
14
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc