@caido-utils/backend 1.0.0 → 1.1.0

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/index.d.ts CHANGED
@@ -4,4 +4,4 @@ export type { PoolCallbacks, PoolConfig } from "./pool";
4
4
  export { spawnCommand } from "./process";
5
5
  export { getProjectId } from "./project";
6
6
  export { Fetch, queryRequests, type FetchOptions, type QueryRequestsOptions, } from "./requests";
7
- export { fileExists, readFile, storeFile } from "./storage";
7
+ export { deleteFile, fileExists, readFile, storeFile } from "./storage";
package/dist/index.js CHANGED
@@ -6,4 +6,4 @@ export {
6
6
  Fetch,
7
7
  queryRequests
8
8
  } from "./requests/index.js";
9
- export { fileExists, readFile, storeFile } from "./storage/index.js";
9
+ export { deleteFile, fileExists, readFile, storeFile } from "./storage/index.js";
@@ -5,5 +5,6 @@ type StoreFileOptions = {
5
5
  };
6
6
  export declare function storeFile(sdk: SDK, options: StoreFileOptions): Promise<string>;
7
7
  export declare function readFile(fsPath: string): Promise<string>;
8
+ export declare function deleteFile(fsPath: string): Promise<void>;
8
9
  export declare function fileExists(fsPath: string): Promise<boolean>;
9
10
  export {};
@@ -35,6 +35,9 @@ export async function readFile(fsPath) {
35
35
  const content = await fs.readFile(fsPath);
36
36
  return content.toString();
37
37
  }
38
+ export async function deleteFile(fsPath) {
39
+ await fs.rm(fsPath);
40
+ }
38
41
  export async function fileExists(fsPath) {
39
42
  try {
40
43
  await fs.access(fsPath);
@@ -1 +1 @@
1
- export { fileExists, readFile, storeFile } from "./files";
1
+ export { deleteFile, fileExists, readFile, storeFile } from "./files";
@@ -1 +1 @@
1
- export { fileExists, readFile, storeFile } from "./files.js";
1
+ export { deleteFile, fileExists, readFile, storeFile } from "./files.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caido-utils/backend",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"