Skip to content

Commit

Permalink
More renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
pluma4345 committed Nov 28, 2024
1 parent e1cd08f commit 62d17e9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ This driver uses semantic versioning:
- A change in the major version (e.g. 1.Y.Z -> 2.0.0) indicates _breaking_
changes that require changes in your code to upgrade.

## [Unreleased]

### Changed

- Renamed `CollectionDropOptions` type to `DropCollectionOptions`
- Renamed `CollectionTruncateOptions` type to `TruncateCollectionOptions`

## [10.0.0-alpha.0] - 2024-11-28

This is a major release and breaks backwards compatibility.
Expand Down
12 changes: 6 additions & 6 deletions src/collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ export type CollectionChecksumOptions = {
/**
* Options for truncating collections.
*/
export type CollectionTruncateOptions = {
export type TruncateCollectionOptions = {
/**
* Whether the collection should be compacted after truncation.
*/
Expand All @@ -354,7 +354,7 @@ export type CollectionTruncateOptions = {
/**
* Options for dropping collections.
*/
export type CollectionDropOptions = {
export type DropCollectionOptions = {
/**
* Whether the collection is a system collection. If the collection is a
* system collection, this option must be set to `true` or ArangoDB will
Expand Down Expand Up @@ -819,7 +819,7 @@ export interface DocumentCollection<
* // the collection "some-collection" is now empty
* ```
*/
truncate(options?: CollectionTruncateOptions): Promise<connection.ArangoApiResponse<CollectionDescription>>;
truncate(options?: TruncateCollectionOptions): Promise<connection.ArangoApiResponse<CollectionDescription>>;
/**
* Deletes the collection from the database.
*
Expand All @@ -834,7 +834,7 @@ export interface DocumentCollection<
* ```
*/
drop(
options?: CollectionDropOptions
options?: DropCollectionOptions
): Promise<connection.ArangoApiResponse<{ id: string }>>;
/**
* Triggers compaction for a collection.
Expand Down Expand Up @@ -2415,15 +2415,15 @@ export class Collection<
return result;
}

truncate(options?: CollectionTruncateOptions): Promise<connection.ArangoApiResponse<CollectionDescription>> {
truncate(options?: TruncateCollectionOptions): Promise<connection.ArangoApiResponse<CollectionDescription>> {
return this._db.request({
method: "PUT",
path: `/_api/collection/${this._name}/truncate`,
search: options,
});
}

drop(options?: CollectionDropOptions) {
drop(options?: DropCollectionOptions) {
return this._db.request({
method: "DELETE",
path: `/_api/collection/${encodeURIComponent(this._name)}`,
Expand Down

0 comments on commit 62d17e9

Please sign in to comment.