@stacksjs/storage 0.67.0 → 0.68.1
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/aws.d.ts +5 -0
- package/dist/copy.d.ts +2 -2
- package/dist/delete.d.ts +1 -2
- package/dist/files.d.ts +19 -38
- package/dist/flystorage.d.ts +4 -4
- package/dist/folders.d.ts +6 -9
- package/dist/fs.d.ts +4 -4
- package/dist/fsevents-hj42pnne.node +0 -0
- package/dist/glob.d.ts +14 -12
- package/dist/hash.d.ts +3 -2
- package/dist/helpers.d.ts +4 -5
- package/dist/index.d.ts +11 -11
- package/dist/index.js +108922 -108139
- package/dist/local.d.ts +5 -0
- package/dist/memory.d.ts +5 -0
- package/dist/move.d.ts +4 -6
- package/dist/storage.d.ts +9 -9
- package/dist/visibility.d.ts +1 -1
- package/dist/zip.d.ts +7 -8
- package/package.json +11 -13
- package/dist/drivers/aws.d.ts +0 -4
- package/dist/drivers/index.d.ts +0 -3
- package/dist/drivers/local.d.ts +0 -4
- package/dist/drivers/memory.d.ts +0 -4
package/dist/aws.d.ts
ADDED
package/dist/copy.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare function copy(src: string | string[], dest: string, exclude
|
|
1
|
+
export declare function copy(src: string | string[], dest: string, exclude: string[] = []): void;
|
|
2
2
|
export declare function copyFile(src: string, dest: string): void;
|
|
3
|
-
export declare function copyFolder(src: string, dest: string, exclude
|
|
3
|
+
export declare function copyFolder(src: string, dest: string, exclude: string[] = []): void;
|
package/dist/delete.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { Result } from "@stacksjs/error-handling";
|
|
2
1
|
export declare function deleteFolder(path: string): Promise<Result<string, Error>>;
|
|
3
2
|
export declare function isDirectoryEmpty(path: string): Promise<Result<boolean, Error>>;
|
|
4
3
|
export declare function deleteEmptyFolder(path: string): Promise<Result<string, Error>>;
|
|
5
4
|
export declare function deleteEmptyFolders(dir: string): Promise<Result<string, Error>>;
|
|
6
5
|
export declare function deleteFile(path: string): Promise<Result<string, Error>>;
|
|
7
6
|
export declare function deleteGlob(path: string): Promise<Result<string, Error>>;
|
|
8
|
-
export declare function del(path: string): Promise<Result<string, Error>>;
|
|
7
|
+
export declare function del(path: string): Promise<Result<string, Error>>;
|
package/dist/files.d.ts
CHANGED
|
@@ -1,52 +1,33 @@
|
|
|
1
|
-
import type { JsonFile,
|
|
2
|
-
|
|
3
|
-
* Reads a JSON file and returns the parsed data.
|
|
4
|
-
*/
|
|
1
|
+
import type { JsonFile, TextFile } from '@stacksjs/types';
|
|
2
|
+
|
|
5
3
|
export declare function readJsonFile(name: string, cwd?: string): Promise<JsonFile>;
|
|
6
|
-
/**
|
|
7
|
-
* Reads a package.json file and returns the parsed data.
|
|
8
|
-
*/
|
|
9
4
|
export declare function readPackageJson(name: string, cwd?: string): Promise<PackageJson>;
|
|
10
|
-
/**
|
|
11
|
-
* Writes the given text to the specified file.
|
|
12
|
-
*/
|
|
13
5
|
export declare function writeFile(path: string, data: any): Promise<number>;
|
|
14
|
-
/**
|
|
15
|
-
* Writes the given data to the specified JSON file.
|
|
16
|
-
*/
|
|
17
6
|
export declare function writeJsonFile(file: JsonFile): Promise<number>;
|
|
18
|
-
/**
|
|
19
|
-
* Reads a text file and returns its contents.
|
|
20
|
-
*/
|
|
21
7
|
export declare function readTextFile(name: string, cwd?: string): Promise<TextFile>;
|
|
22
|
-
/**
|
|
23
|
-
* Writes the given text to the specified file.
|
|
24
|
-
*/
|
|
25
8
|
export declare function writeTextFile(file: TextFile): Promise<number>;
|
|
9
|
+
declare function isFile(path: string): boolean;
|
|
26
10
|
export declare function doesExist(path: string): boolean;
|
|
27
11
|
export declare function doesNotExist(path: string): boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Determine whether a folder has any files in it.
|
|
30
|
-
*/
|
|
31
12
|
export declare function hasFiles(folder: string): boolean;
|
|
32
13
|
export declare function hasComponents(): boolean;
|
|
33
14
|
export declare function hasFunctions(): boolean;
|
|
34
|
-
export declare function deleteFiles(dir: string, exclude
|
|
35
|
-
export declare function getFiles(dir: string, exclude
|
|
15
|
+
export declare function deleteFiles(dir: string, exclude: string[] = []): void;
|
|
16
|
+
export declare function getFiles(dir: string, exclude: string[] = []): string[];
|
|
36
17
|
export declare function put(path: string, contents: string): void;
|
|
37
18
|
export declare function get(path: string): Promise<string>;
|
|
38
|
-
export interface Files {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
19
|
+
export declare interface Files {
|
|
20
|
+
readJsonFile: typeof readJsonFile
|
|
21
|
+
readPackageJson: typeof readPackageJson
|
|
22
|
+
readTextFile: typeof readTextFile
|
|
23
|
+
writeJsonFile: typeof writeJsonFile
|
|
24
|
+
writeTextFile: typeof writeTextFile
|
|
25
|
+
hasFiles: typeof hasFiles
|
|
26
|
+
hasComponents: typeof hasComponents
|
|
27
|
+
hasFunctions: typeof hasFunctions
|
|
28
|
+
deleteFiles: typeof deleteFiles
|
|
29
|
+
getFiles: typeof getFiles
|
|
30
|
+
put: typeof put
|
|
31
|
+
get: typeof get
|
|
51
32
|
}
|
|
52
|
-
export declare const files: Files;
|
|
33
|
+
export declare const files: Files;
|
package/dist/flystorage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AwsS3StorageAdapter, DefaultAwsPublicUrlGenerator, HostStyleAwsPublicUrlGenerator } from
|
|
2
|
-
export { checksumFromStream, closeReadable, DirectoryListing, FileStorage, isDirectory, isFile, normalizeExpiryToDate, normalizeExpiryToMilliseconds, readableToString, readableToUint8Array, toReadable } from
|
|
3
|
-
export { InMemoryStorageAdapter, resolveMimeType } from
|
|
4
|
-
export { BaseUrlLocalPublicUrlGenerator, FailingLocalTemporaryUrlGenerator, LocalStorageAdapter } from
|
|
1
|
+
export { AwsS3StorageAdapter, DefaultAwsPublicUrlGenerator, HostStyleAwsPublicUrlGenerator } from '@flystorage/aws-s3'
|
|
2
|
+
export { checksumFromStream, closeReadable, DirectoryListing, FileStorage, isDirectory, isFile, normalizeExpiryToDate, normalizeExpiryToMilliseconds, readableToString, readableToUint8Array, toReadable } from '@flystorage/file-storage'
|
|
3
|
+
export { InMemoryStorageAdapter, resolveMimeType } from '@flystorage/in-memory'
|
|
4
|
+
export { BaseUrlLocalPublicUrlGenerator, FailingLocalTemporaryUrlGenerator, LocalStorageAdapter } from '@flystorage/local-fs'
|
package/dist/folders.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determine whether a path is a folder.
|
|
3
|
-
*/
|
|
4
1
|
export declare function isFolder(path: string): boolean;
|
|
5
2
|
export declare function isDir(path: string): boolean;
|
|
6
3
|
export declare function doesFolderExist(path: string): boolean;
|
|
7
4
|
export declare function createFolder(dir: string): Promise<void>;
|
|
8
5
|
export declare function getFolders(dir: string): string[];
|
|
9
|
-
export interface Folders {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
export declare interface Folders {
|
|
7
|
+
isFolder: (path: string) => boolean
|
|
8
|
+
doesFolderExist: (path: string) => boolean
|
|
9
|
+
createFolder: (dir: string) => Promise<void>
|
|
10
|
+
getFolders: (dir: string) => string[]
|
|
14
11
|
}
|
|
15
|
-
export declare const folders: Folders;
|
|
12
|
+
export declare const folders: Folders;
|
package/dist/fs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
import { mkdirSync, pathExists as existsSync, readFileSync, watch as fsWatch, watchFile, writeFileSync } from 'fs-extra';
|
|
2
|
+
|
|
3
|
+
export { existsSync, fs, fsWatch, mkdirSync, readFileSync, watchFile, writeFileSync }
|
|
4
|
+
export declare function exists(path: string): Promise<boolean>;
|
|
Binary file
|
package/dist/glob.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { globSync as gs } from 'tinyglobby';
|
|
2
|
+
|
|
3
|
+
export { glob } from 'tinyglobby'
|
|
4
|
+
export declare interface GlobOptions {
|
|
5
|
+
absolute?: boolean
|
|
6
|
+
cwd?: string
|
|
7
|
+
patterns?: string[]
|
|
8
|
+
ignore?: string[]
|
|
9
|
+
dot?: boolean
|
|
10
|
+
deep?: number
|
|
11
|
+
expandDirectories?: boolean
|
|
12
|
+
onlyDirectories?: boolean
|
|
13
|
+
onlyFiles?: boolean
|
|
12
14
|
}
|
|
13
|
-
export declare function globSync(patterns: string | string[], options?: Omit<GlobOptions,
|
|
15
|
+
export declare function globSync(patterns: string | string[], options?: Omit<GlobOptions, 'patterns'>): string[];
|
package/dist/hash.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Hash } from
|
|
1
|
+
import type { Hash } from 'node:crypto';
|
|
2
|
+
|
|
2
3
|
export declare function hashFileOrDirectory(path: string, hash: Hash): void;
|
|
3
4
|
export declare function hashDirectory(directory: string): string;
|
|
4
5
|
export declare function hashPath(path: string): string;
|
|
5
|
-
export declare function hashPaths(paths: string | string[]): string;
|
|
6
|
+
export declare function hashPaths(paths: string | string[]): string;
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export declare const _dirname: string;
|
|
2
2
|
export declare function updateConfigFile(filePath: string, newConfig: Record<string, unknown>): Promise<void>;
|
|
3
|
-
interface Helpers {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
declare interface Helpers {
|
|
4
|
+
_dirname: string
|
|
5
|
+
updateConfigFile: (filePath: string, newConfig: Record<string, unknown>) => Promise<void>
|
|
6
6
|
}
|
|
7
|
-
export declare const helpers: Helpers;
|
|
8
|
-
export {};
|
|
7
|
+
export declare const helpers: Helpers;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * as storage from
|
|
11
|
-
export * from
|
|
1
|
+
export * from './copy'
|
|
2
|
+
export * from './delete'
|
|
3
|
+
export * from './files'
|
|
4
|
+
export * from './flystorage'
|
|
5
|
+
export * from './folders'
|
|
6
|
+
export * from './fs'
|
|
7
|
+
export * from './glob'
|
|
8
|
+
export * from './hash'
|
|
9
|
+
export * from './helpers'
|
|
10
|
+
export * as storage from './storage'
|
|
11
|
+
export * from './zip'
|