nuxt-upload-kit 0.1.14 → 0.1.15

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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-upload-kit",
3
3
  "configKey": "uploadKit",
4
- "version": "0.1.14",
4
+ "version": "0.1.15",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -189,7 +189,9 @@ export declare const useUploadKit: <TUploadResult = any>(_options?: UploadOption
189
189
  addFile: (file: File) => Promise<UploadFile>;
190
190
  onGetRemoteFile: (fn: GetRemoteFileFn) => void;
191
191
  onUpload: (fn: UploadFn<TUploadResult>) => void;
192
- removeFile: (fileId: string) => Promise<void>;
192
+ removeFile: (fileId: string, removeOptions?: {
193
+ deleteFromStorage?: boolean;
194
+ }) => Promise<void>;
193
195
  removeFiles: (fileIds: string[]) => ({
194
196
  source: "local";
195
197
  data: {
@@ -257,10 +257,11 @@ This is deprecated. Use the 'storage' option instead:
257
257
  const addedFiles = results.filter((r) => r.status === "fulfilled").map((r) => r.value);
258
258
  return addedFiles;
259
259
  };
260
- const removeFile = async (fileId) => {
260
+ const removeFile = async (fileId, removeOptions) => {
261
+ const { deleteFromStorage = true } = removeOptions ?? {};
261
262
  const file = files.value.find((f) => f.id === fileId);
262
263
  if (!file) return;
263
- if (file.remoteUrl) {
264
+ if (deleteFromStorage && file.remoteUrl) {
264
265
  const storagePlugin = getStoragePlugin();
265
266
  if (storagePlugin?.hooks.remove) {
266
267
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-upload-kit",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "A powerful, plugin-based file upload manager for Nuxt applications",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/genu/nuxt-upload-kit.git",