cic-kit 0.0.29 → 0.0.30

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.
@@ -32,6 +32,21 @@ export interface FirebaseFileAddOpts {
32
32
  resize?: FirebaseImageResizeOpts;
33
33
  metadata?: UploadMetadata;
34
34
  }
35
+ /**
36
+ * Estrae il path relativo partendo direttamente dal basePath.
37
+ *
38
+ * @param basePath es: "/public/products"
39
+ * @param url URL completa
40
+ * @returns es: "/gbr2D5wAMoUX7ved2lX8/imgs/1771608038366_0_c.png"
41
+ */
42
+ export declare function extractRelativePathFromBase(basePath: string, url: string): string | null;
43
+ /**
44
+ * Estrae solo il nome file da una URL.
45
+ *
46
+ * @param url URL completa
47
+ * @returns es: "1771608038366_0_c.png"
48
+ */
49
+ export declare function extractFilenameFromUrl(url: string): string | null;
35
50
  export declare class FirebaseFolder {
36
51
  /** Istanza di Firebase Storage */
37
52
  private storage;
@@ -45,6 +60,14 @@ export declare class FirebaseFolder {
45
60
  private fileRef;
46
61
  private static normalizePath;
47
62
  private static createAlreadyExistsError;
63
+ /**
64
+ * Estrae il path relativo dalla URL rispetto al basePath della cartella corrente.
65
+ */
66
+ extractRelativePathFromUrl(url: string): string | null;
67
+ /**
68
+ * Estrae solo il nome file partendo da una URL.
69
+ */
70
+ extractFilenameFromUrl(url: string): string | null;
48
71
  private static withContentType;
49
72
  private static resizeImageIfNeeded;
50
73
  private static computeTargetSize;
@@ -68,6 +91,10 @@ export declare class FirebaseFolder {
68
91
  * remove: elimina un file (non fallisce se già assente).
69
92
  */
70
93
  remove(filename: string): Promise<void>;
94
+ /**
95
+ * removeFromUrl: elimina un file partendo direttamente dalla download URL.
96
+ */
97
+ removeFromUrl(url: string): Promise<void>;
71
98
  /**
72
99
  * getAll: lista tutti i file nella cartella (non include sottocartelle ricorsive).
73
100
  * Per ogni file recupera metadati e url.