@capgo/cli 7.84.4 → 7.84.6
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.js +259 -260
- package/dist/package.json +1 -1
- package/dist/src/sdk.js +193 -193
- package/dist/src/utils/safeWrites.d.ts +21 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type WriteOptions = {
|
|
2
|
+
mode?: number;
|
|
3
|
+
encoding?: BufferEncoding;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Create (or reuse) a directory and enforce safe permissions.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ensureSecureDirectory(path: string, mode: number): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Append content to a file without following symbolic links.
|
|
11
|
+
*/
|
|
12
|
+
export declare function appendToSafeFile(filePath: string, content: string, mode?: number): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Write content atomically by writing a temp file and renaming.
|
|
15
|
+
*/
|
|
16
|
+
export declare function writeFileAtomic(filePath: string, content: string, options?: WriteOptions): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Read file content while rejecting symbolic-link targets.
|
|
19
|
+
*/
|
|
20
|
+
export declare function readSafeFile(filePath: string): Promise<string>;
|
|
21
|
+
export {};
|