Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/move-same-bucket-only.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tigrisdata/storage': patch
Comment thread
designcode marked this conversation as resolved.
---

`move` no longer accepts `srcBucket` / `destBucket` options — cross-bucket moves are not supported by the server. Use `copy` followed by `remove` to move objects between buckets.
16 changes: 12 additions & 4 deletions packages/storage/src/lib/object/move.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import type { TigrisStorageResponse } from '../types';
import { type CopyOptions, type CopyResponse, copyOrMove } from './copy';
import type { TigrisStorageConfig, TigrisStorageResponse } from '../types';
import { type CopyResponse, copyOrMove } from './copy';

export type MoveOptions = {
config?: TigrisStorageConfig;
};

export type MoveOptions = CopyOptions;
export type MoveResponse = CopyResponse;

/**
* Move (rename) an object within a bucket. Cross-bucket moves are not
* supported by the server; use `copy` followed by `remove` if you need
* to move between buckets.
*/
export async function move(
src: string,
dest: string,
options?: MoveOptions
): Promise<TigrisStorageResponse<MoveResponse, Error>> {
return copyOrMove(src, dest, true, options);
return copyOrMove(src, dest, true, { config: options?.config });
}
Loading