@bluecopa/core 0.1.97 → 0.1.98

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.
@@ -4,6 +4,12 @@ export interface DropFileToDataboxRequest {
4
4
  file: File;
5
5
  /** CSV delimiter override (CSV files only) */
6
6
  delimiter?: string;
7
+ /**
8
+ * When true, a file with the same name in the folder is replaced in-place
9
+ * (same file id, new content). If no same-name file exists, a new file is
10
+ * created as usual.
11
+ */
12
+ replace?: boolean;
7
13
  }
8
14
  /**
9
15
  * Drops (uploads) a file into a databox folder. The file is uploaded to blob
@@ -16,7 +22,8 @@ export interface DropFileToDataboxRequest {
16
22
  * @param params.folderId - Required: The databox folder ID
17
23
  * @param params.file - Required: The file to upload
18
24
  * @param params.delimiter - Optional: CSV delimiter override
19
- * @returns Promise<DataboxFile> The created databox file (with id and status)
25
+ * @param params.replace - Optional: Replace a same-name file in-place
26
+ * @returns Promise<DataboxFile> The created/updated databox file (with id and status)
20
27
  * @throws Error if the request fails
21
28
  */
22
- export declare function dropFileToDatabox({ folderId, file, delimiter, }: DropFileToDataboxRequest): Promise<DataboxFile>;
29
+ export declare function dropFileToDatabox({ folderId, file, delimiter, replace, }: DropFileToDataboxRequest): Promise<DataboxFile>;
package/dist/index.es.js CHANGED
@@ -12837,7 +12837,8 @@ async function getDataboxFolderDuplicates({
12837
12837
  async function dropFileToDatabox({
12838
12838
  folderId,
12839
12839
  file,
12840
- delimiter
12840
+ delimiter,
12841
+ replace
12841
12842
  }) {
12842
12843
  try {
12843
12844
  const id = folderId?.trim();
@@ -12859,6 +12860,9 @@ async function dropFileToDatabox({
12859
12860
  if (delimiter?.trim()) {
12860
12861
  formData.append("delimiter", delimiter.trim());
12861
12862
  }
12863
+ if (replace) {
12864
+ formData.append("replace", "true");
12865
+ }
12862
12866
  const response = await apiClient.post(
12863
12867
  `/databox/folders/${encodeURIComponent(id)}/files`,
12864
12868
  formData,