@duplojs/server 0.1.0-beta.3 → 0.1.0-beta.4
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/command/argument.d.ts +2 -2
- package/dist/command/create.cjs +7 -1
- package/dist/command/create.d.ts +3 -3
- package/dist/command/create.mjs +7 -1
- package/dist/command/error.cjs +24 -0
- package/dist/command/error.d.ts +9 -1
- package/dist/command/error.mjs +24 -0
- package/dist/command/exec.d.ts +4 -3
- package/dist/command/help.d.ts +1 -1
- package/dist/command/index.cjs +4 -0
- package/dist/command/index.mjs +4 -2
- package/dist/command/options/base.cjs +21 -13
- package/dist/command/options/base.d.ts +6 -0
- package/dist/command/options/base.mjs +20 -14
- package/dist/command/options/defaults/array.d.ts +6 -4
- package/dist/command/options/defaults/boolean.cjs +21 -7
- package/dist/command/options/defaults/boolean.d.ts +6 -3
- package/dist/command/options/defaults/boolean.mjs +20 -8
- package/dist/command/options/defaults/simple.d.ts +6 -4
- package/dist/command/types/forbiddenInvalidIdentifier.d.ts +6 -0
- package/dist/command/types/index.d.ts +1 -0
- package/dist/common/environmentVariable/index.d.ts +1 -1
- package/dist/common/environmentVariable/overrideEnvironmentVariables.d.ts +1 -1
- package/dist/common/environmentVariable/parseEnvironmentFiles.d.ts +1 -1
- package/dist/dataStructure/helper/file.d.ts +1 -1
- package/dist/dataStructure/helper/folder.d.ts +1 -1
- package/dist/file/appendFile.cjs +10 -0
- package/dist/file/appendFile.d.ts +13 -13
- package/dist/file/appendFile.mjs +1 -1
- package/dist/file/appendTextFile.cjs +10 -0
- package/dist/file/appendTextFile.d.ts +13 -13
- package/dist/file/appendTextFile.mjs +1 -1
- package/dist/file/copy.cjs +10 -0
- package/dist/file/copy.d.ts +13 -13
- package/dist/file/copy.mjs +1 -1
- package/dist/file/createEntryInterface.cjs +4 -1
- package/dist/file/createEntryInterface.d.ts +1 -1
- package/dist/file/createEntryInterface.mjs +3 -1
- package/dist/file/ensureDirectory.cjs +8 -0
- package/dist/file/ensureDirectory.d.ts +10 -10
- package/dist/file/ensureDirectory.mjs +1 -1
- package/dist/file/ensureFile.cjs +9 -0
- package/dist/file/ensureFile.d.ts +11 -11
- package/dist/file/ensureFile.mjs +1 -1
- package/dist/file/exists.cjs +5 -0
- package/dist/file/exists.d.ts +7 -7
- package/dist/file/exists.mjs +1 -1
- package/dist/file/fileInterface.cjs +1 -1
- package/dist/file/fileInterface.d.ts +5 -6
- package/dist/file/fileInterface.mjs +1 -1
- package/dist/file/folderInterface.cjs +1 -1
- package/dist/file/folderInterface.d.ts +5 -6
- package/dist/file/folderInterface.mjs +1 -1
- package/dist/file/index.cjs +506 -0
- package/dist/file/index.mjs +285 -32
- package/dist/file/link.cjs +11 -0
- package/dist/file/link.d.ts +14 -14
- package/dist/file/link.mjs +1 -1
- package/dist/file/linkStat.cjs +6 -0
- package/dist/file/linkStat.d.ts +8 -8
- package/dist/file/linkStat.mjs +1 -1
- package/dist/file/makeDirectory.cjs +10 -0
- package/dist/file/makeDirectory.d.ts +12 -12
- package/dist/file/makeDirectory.mjs +1 -1
- package/dist/file/makeTemporaryDirectory.cjs +7 -0
- package/dist/file/makeTemporaryDirectory.d.ts +7 -7
- package/dist/file/makeTemporaryDirectory.mjs +1 -1
- package/dist/file/makeTemporaryFile.cjs +8 -0
- package/dist/file/makeTemporaryFile.d.ts +8 -8
- package/dist/file/makeTemporaryFile.mjs +1 -1
- package/dist/file/move.cjs +11 -0
- package/dist/file/move.d.ts +14 -14
- package/dist/file/move.mjs +1 -1
- package/dist/file/readDirectory.cjs +6 -0
- package/dist/file/readDirectory.d.ts +8 -8
- package/dist/file/readDirectory.mjs +1 -1
- package/dist/file/readFile.cjs +7 -0
- package/dist/file/readFile.d.ts +9 -9
- package/dist/file/readFile.mjs +1 -1
- package/dist/file/readJsonFile.cjs +7 -0
- package/dist/file/readJsonFile.d.ts +9 -9
- package/dist/file/readJsonFile.mjs +1 -1
- package/dist/file/readLink.cjs +6 -0
- package/dist/file/readLink.d.ts +8 -8
- package/dist/file/readLink.mjs +1 -1
- package/dist/file/readTextFile.cjs +7 -0
- package/dist/file/readTextFile.d.ts +9 -9
- package/dist/file/readTextFile.mjs +1 -1
- package/dist/file/realPath.cjs +5 -0
- package/dist/file/realPath.d.ts +7 -7
- package/dist/file/realPath.mjs +1 -1
- package/dist/file/relocate.cjs +11 -0
- package/dist/file/relocate.d.ts +14 -14
- package/dist/file/relocate.mjs +1 -1
- package/dist/file/remove.cjs +9 -0
- package/dist/file/remove.d.ts +11 -11
- package/dist/file/remove.mjs +1 -1
- package/dist/file/rename.cjs +11 -0
- package/dist/file/rename.d.ts +14 -14
- package/dist/file/rename.mjs +1 -1
- package/dist/file/setMode.cjs +6 -0
- package/dist/file/setMode.d.ts +9 -9
- package/dist/file/setMode.mjs +1 -1
- package/dist/file/setOwner.cjs +6 -0
- package/dist/file/setOwner.d.ts +9 -9
- package/dist/file/setOwner.mjs +1 -1
- package/dist/file/setTime.cjs +6 -0
- package/dist/file/setTime.d.ts +9 -9
- package/dist/file/setTime.mjs +1 -1
- package/dist/file/stat.cjs +6 -0
- package/dist/file/stat.d.ts +8 -8
- package/dist/file/stat.mjs +1 -1
- package/dist/file/symlink.cjs +9 -0
- package/dist/file/symlink.d.ts +12 -12
- package/dist/file/symlink.mjs +1 -1
- package/dist/file/truncate.cjs +10 -0
- package/dist/file/truncate.d.ts +12 -12
- package/dist/file/truncate.mjs +1 -1
- package/dist/file/unknownEntryInterface.cjs +3 -1
- package/dist/file/unknownEntryInterface.d.ts +4 -4
- package/dist/file/unknownEntryInterface.mjs +2 -1
- package/dist/file/walkDirectory.cjs +11 -1
- package/dist/file/walkDirectory.d.ts +9 -9
- package/dist/file/walkDirectory.mjs +6 -2
- package/dist/file/writeFile.cjs +10 -0
- package/dist/file/writeFile.d.ts +13 -13
- package/dist/file/writeFile.mjs +1 -1
- package/dist/file/writeJsonFile.cjs +10 -0
- package/dist/file/writeJsonFile.d.ts +13 -13
- package/dist/file/writeJsonFile.mjs +1 -1
- package/dist/file/writeTextFile.cjs +10 -0
- package/dist/file/writeTextFile.d.ts +13 -13
- package/dist/file/writeTextFile.mjs +1 -1
- package/dist/override.d.ts +8 -0
- package/package.json +3 -3
package/dist/file/appendFile.cjs
CHANGED
|
@@ -54,4 +54,14 @@ function appendFile(...args) {
|
|
|
54
54
|
return appendFileImplementation(...args);
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
|
+
exports.AppendFileError = AppendFileError;
|
|
58
|
+
exports.AppendFileErrorBusy = AppendFileErrorBusy;
|
|
59
|
+
exports.AppendFileErrorInvalidArgument = AppendFileErrorInvalidArgument;
|
|
60
|
+
exports.AppendFileErrorIsDirectory = AppendFileErrorIsDirectory;
|
|
61
|
+
exports.AppendFileErrorNoSpace = AppendFileErrorNoSpace;
|
|
62
|
+
exports.AppendFileErrorNotDirectory = AppendFileErrorNotDirectory;
|
|
63
|
+
exports.AppendFileErrorNotFound = AppendFileErrorNotFound;
|
|
64
|
+
exports.AppendFileErrorPermissionDenied = AppendFileErrorPermissionDenied;
|
|
65
|
+
exports.AppendFileErrorReadOnly = AppendFileErrorReadOnly;
|
|
66
|
+
exports.AppendFileErrorTooManyOpenFiles = AppendFileErrorTooManyOpenFiles;
|
|
57
67
|
exports.appendFile = appendFile;
|
|
@@ -2,42 +2,42 @@ import * as DEither from "@duplojs/lang/either";
|
|
|
2
2
|
import type * as DPath from "@duplojs/lang/path";
|
|
3
3
|
import * as DCommon from "@duplojs/lang/common";
|
|
4
4
|
declare const AppendFileErrorNotFound_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-file-not-found", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-file-not-found", unknown>>, unknown>;
|
|
5
|
-
declare class AppendFileErrorNotFound extends AppendFileErrorNotFound_base {
|
|
5
|
+
export declare class AppendFileErrorNotFound extends AppendFileErrorNotFound_base {
|
|
6
6
|
}
|
|
7
7
|
declare const AppendFileErrorPermissionDenied_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-file-permission-denied", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-file-permission-denied", unknown>>, unknown>;
|
|
8
|
-
declare class AppendFileErrorPermissionDenied extends AppendFileErrorPermissionDenied_base {
|
|
8
|
+
export declare class AppendFileErrorPermissionDenied extends AppendFileErrorPermissionDenied_base {
|
|
9
9
|
}
|
|
10
10
|
declare const AppendFileErrorIsDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-file-is-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-file-is-directory", unknown>>, unknown>;
|
|
11
|
-
declare class AppendFileErrorIsDirectory extends AppendFileErrorIsDirectory_base {
|
|
11
|
+
export declare class AppendFileErrorIsDirectory extends AppendFileErrorIsDirectory_base {
|
|
12
12
|
}
|
|
13
13
|
declare const AppendFileErrorNotDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-file-not-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-file-not-directory", unknown>>, unknown>;
|
|
14
|
-
declare class AppendFileErrorNotDirectory extends AppendFileErrorNotDirectory_base {
|
|
14
|
+
export declare class AppendFileErrorNotDirectory extends AppendFileErrorNotDirectory_base {
|
|
15
15
|
}
|
|
16
16
|
declare const AppendFileErrorNoSpace_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-file-no-space", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-file-no-space", unknown>>, unknown>;
|
|
17
|
-
declare class AppendFileErrorNoSpace extends AppendFileErrorNoSpace_base {
|
|
17
|
+
export declare class AppendFileErrorNoSpace extends AppendFileErrorNoSpace_base {
|
|
18
18
|
}
|
|
19
19
|
declare const AppendFileErrorReadOnly_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-file-read-only", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-file-read-only", unknown>>, unknown>;
|
|
20
|
-
declare class AppendFileErrorReadOnly extends AppendFileErrorReadOnly_base {
|
|
20
|
+
export declare class AppendFileErrorReadOnly extends AppendFileErrorReadOnly_base {
|
|
21
21
|
}
|
|
22
22
|
declare const AppendFileErrorInvalidArgument_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-file-invalid-argument", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-file-invalid-argument", unknown>>, unknown>;
|
|
23
|
-
declare class AppendFileErrorInvalidArgument extends AppendFileErrorInvalidArgument_base {
|
|
23
|
+
export declare class AppendFileErrorInvalidArgument extends AppendFileErrorInvalidArgument_base {
|
|
24
24
|
}
|
|
25
25
|
declare const AppendFileErrorTooManyOpenFiles_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-file-too-many-open-files", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-file-too-many-open-files", unknown>>, unknown>;
|
|
26
|
-
declare class AppendFileErrorTooManyOpenFiles extends AppendFileErrorTooManyOpenFiles_base {
|
|
26
|
+
export declare class AppendFileErrorTooManyOpenFiles extends AppendFileErrorTooManyOpenFiles_base {
|
|
27
27
|
}
|
|
28
28
|
declare const AppendFileErrorBusy_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-file-busy", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-file-busy", unknown>>, unknown>;
|
|
29
|
-
declare class AppendFileErrorBusy extends AppendFileErrorBusy_base {
|
|
29
|
+
export declare class AppendFileErrorBusy extends AppendFileErrorBusy_base {
|
|
30
30
|
}
|
|
31
31
|
declare const AppendFileError_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-file-error", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-file-error", unknown>>, unknown>;
|
|
32
|
-
declare class AppendFileError extends AppendFileError_base {
|
|
32
|
+
export declare class AppendFileError extends AppendFileError_base {
|
|
33
33
|
}
|
|
34
34
|
export type AppendFileErrors = (AppendFileErrorNotFound | AppendFileErrorPermissionDenied | AppendFileErrorIsDirectory | AppendFileErrorNotDirectory | AppendFileErrorNoSpace | AppendFileErrorReadOnly | AppendFileErrorInvalidArgument | AppendFileErrorTooManyOpenFiles | AppendFileErrorBusy | AppendFileError);
|
|
35
35
|
export type AppendFileResult = (DEither.Right<"file-system-append-file", void> | DEither.Left<"file-system-append-file-error", AppendFileErrors>);
|
|
36
36
|
declare module '../implementor' {
|
|
37
37
|
interface ServerFunction {
|
|
38
|
-
appendFile(path:
|
|
38
|
+
appendFile(path: DPath.AnyPath, data: Uint8Array): Promise<AppendFileResult>;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
export declare function appendFile(data: Uint8Array): (path:
|
|
42
|
-
export declare function appendFile(path:
|
|
41
|
+
export declare function appendFile(data: Uint8Array): (path: DPath.AnyPath) => Promise<AppendFileResult>;
|
|
42
|
+
export declare function appendFile(path: DPath.AnyPath, data: Uint8Array): Promise<AppendFileResult>;
|
|
43
43
|
export {};
|
package/dist/file/appendFile.mjs
CHANGED
|
@@ -51,4 +51,4 @@ function appendFile(...args) {
|
|
|
51
51
|
return appendFileImplementation(...args);
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
|
-
export { appendFile };
|
|
54
|
+
export { AppendFileError, AppendFileErrorBusy, AppendFileErrorInvalidArgument, AppendFileErrorIsDirectory, AppendFileErrorNoSpace, AppendFileErrorNotDirectory, AppendFileErrorNotFound, AppendFileErrorPermissionDenied, AppendFileErrorReadOnly, AppendFileErrorTooManyOpenFiles, appendFile };
|
|
@@ -54,4 +54,14 @@ function appendTextFile(...args) {
|
|
|
54
54
|
return appendTextFileImplementation(...args);
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
|
+
exports.AppendTextFileError = AppendTextFileError;
|
|
58
|
+
exports.AppendTextFileErrorBusy = AppendTextFileErrorBusy;
|
|
59
|
+
exports.AppendTextFileErrorInvalidArgument = AppendTextFileErrorInvalidArgument;
|
|
60
|
+
exports.AppendTextFileErrorIsDirectory = AppendTextFileErrorIsDirectory;
|
|
61
|
+
exports.AppendTextFileErrorNoSpace = AppendTextFileErrorNoSpace;
|
|
62
|
+
exports.AppendTextFileErrorNotDirectory = AppendTextFileErrorNotDirectory;
|
|
63
|
+
exports.AppendTextFileErrorNotFound = AppendTextFileErrorNotFound;
|
|
64
|
+
exports.AppendTextFileErrorPermissionDenied = AppendTextFileErrorPermissionDenied;
|
|
65
|
+
exports.AppendTextFileErrorReadOnly = AppendTextFileErrorReadOnly;
|
|
66
|
+
exports.AppendTextFileErrorTooManyOpenFiles = AppendTextFileErrorTooManyOpenFiles;
|
|
57
67
|
exports.appendTextFile = appendTextFile;
|
|
@@ -2,42 +2,42 @@ import * as DEither from "@duplojs/lang/either";
|
|
|
2
2
|
import type * as DPath from "@duplojs/lang/path";
|
|
3
3
|
import * as DCommon from "@duplojs/lang/common";
|
|
4
4
|
declare const AppendTextFileErrorNotFound_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-text-file-not-found", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-text-file-not-found", unknown>>, unknown>;
|
|
5
|
-
declare class AppendTextFileErrorNotFound extends AppendTextFileErrorNotFound_base {
|
|
5
|
+
export declare class AppendTextFileErrorNotFound extends AppendTextFileErrorNotFound_base {
|
|
6
6
|
}
|
|
7
7
|
declare const AppendTextFileErrorPermissionDenied_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-text-file-permission-denied", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-text-file-permission-denied", unknown>>, unknown>;
|
|
8
|
-
declare class AppendTextFileErrorPermissionDenied extends AppendTextFileErrorPermissionDenied_base {
|
|
8
|
+
export declare class AppendTextFileErrorPermissionDenied extends AppendTextFileErrorPermissionDenied_base {
|
|
9
9
|
}
|
|
10
10
|
declare const AppendTextFileErrorIsDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-text-file-is-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-text-file-is-directory", unknown>>, unknown>;
|
|
11
|
-
declare class AppendTextFileErrorIsDirectory extends AppendTextFileErrorIsDirectory_base {
|
|
11
|
+
export declare class AppendTextFileErrorIsDirectory extends AppendTextFileErrorIsDirectory_base {
|
|
12
12
|
}
|
|
13
13
|
declare const AppendTextFileErrorNotDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-text-file-not-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-text-file-not-directory", unknown>>, unknown>;
|
|
14
|
-
declare class AppendTextFileErrorNotDirectory extends AppendTextFileErrorNotDirectory_base {
|
|
14
|
+
export declare class AppendTextFileErrorNotDirectory extends AppendTextFileErrorNotDirectory_base {
|
|
15
15
|
}
|
|
16
16
|
declare const AppendTextFileErrorNoSpace_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-text-file-no-space", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-text-file-no-space", unknown>>, unknown>;
|
|
17
|
-
declare class AppendTextFileErrorNoSpace extends AppendTextFileErrorNoSpace_base {
|
|
17
|
+
export declare class AppendTextFileErrorNoSpace extends AppendTextFileErrorNoSpace_base {
|
|
18
18
|
}
|
|
19
19
|
declare const AppendTextFileErrorReadOnly_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-text-file-read-only", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-text-file-read-only", unknown>>, unknown>;
|
|
20
|
-
declare class AppendTextFileErrorReadOnly extends AppendTextFileErrorReadOnly_base {
|
|
20
|
+
export declare class AppendTextFileErrorReadOnly extends AppendTextFileErrorReadOnly_base {
|
|
21
21
|
}
|
|
22
22
|
declare const AppendTextFileErrorInvalidArgument_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-text-file-invalid-argument", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-text-file-invalid-argument", unknown>>, unknown>;
|
|
23
|
-
declare class AppendTextFileErrorInvalidArgument extends AppendTextFileErrorInvalidArgument_base {
|
|
23
|
+
export declare class AppendTextFileErrorInvalidArgument extends AppendTextFileErrorInvalidArgument_base {
|
|
24
24
|
}
|
|
25
25
|
declare const AppendTextFileErrorTooManyOpenFiles_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-text-file-too-many-open-files", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-text-file-too-many-open-files", unknown>>, unknown>;
|
|
26
|
-
declare class AppendTextFileErrorTooManyOpenFiles extends AppendTextFileErrorTooManyOpenFiles_base {
|
|
26
|
+
export declare class AppendTextFileErrorTooManyOpenFiles extends AppendTextFileErrorTooManyOpenFiles_base {
|
|
27
27
|
}
|
|
28
28
|
declare const AppendTextFileErrorBusy_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-text-file-busy", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-text-file-busy", unknown>>, unknown>;
|
|
29
|
-
declare class AppendTextFileErrorBusy extends AppendTextFileErrorBusy_base {
|
|
29
|
+
export declare class AppendTextFileErrorBusy extends AppendTextFileErrorBusy_base {
|
|
30
30
|
}
|
|
31
31
|
declare const AppendTextFileError_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-append-text-file-error", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-append-text-file-error", unknown>>, unknown>;
|
|
32
|
-
declare class AppendTextFileError extends AppendTextFileError_base {
|
|
32
|
+
export declare class AppendTextFileError extends AppendTextFileError_base {
|
|
33
33
|
}
|
|
34
34
|
export type AppendTextFileErrors = (AppendTextFileErrorNotFound | AppendTextFileErrorPermissionDenied | AppendTextFileErrorIsDirectory | AppendTextFileErrorNotDirectory | AppendTextFileErrorNoSpace | AppendTextFileErrorReadOnly | AppendTextFileErrorInvalidArgument | AppendTextFileErrorTooManyOpenFiles | AppendTextFileErrorBusy | AppendTextFileError);
|
|
35
35
|
export type AppendTextFileResult = (DEither.Right<"file-system-append-text-file", void> | DEither.Left<"file-system-append-text-file-error", AppendTextFileErrors>);
|
|
36
36
|
declare module '../implementor' {
|
|
37
37
|
interface ServerFunction {
|
|
38
|
-
appendTextFile(path:
|
|
38
|
+
appendTextFile(path: DPath.AnyPath, data: string): Promise<AppendTextFileResult>;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
export declare function appendTextFile(data: string): (path:
|
|
42
|
-
export declare function appendTextFile(path:
|
|
41
|
+
export declare function appendTextFile(data: string): (path: DPath.AnyPath) => Promise<AppendTextFileResult>;
|
|
42
|
+
export declare function appendTextFile(path: DPath.AnyPath, data: string): Promise<AppendTextFileResult>;
|
|
43
43
|
export {};
|
|
@@ -51,4 +51,4 @@ function appendTextFile(...args) {
|
|
|
51
51
|
return appendTextFileImplementation(...args);
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
|
-
export { appendTextFile };
|
|
54
|
+
export { AppendTextFileError, AppendTextFileErrorBusy, AppendTextFileErrorInvalidArgument, AppendTextFileErrorIsDirectory, AppendTextFileErrorNoSpace, AppendTextFileErrorNotDirectory, AppendTextFileErrorNotFound, AppendTextFileErrorPermissionDenied, AppendTextFileErrorReadOnly, AppendTextFileErrorTooManyOpenFiles, appendTextFile };
|
package/dist/file/copy.cjs
CHANGED
|
@@ -40,4 +40,14 @@ function copy(...args) {
|
|
|
40
40
|
return copyImplementation(...args);
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
|
+
exports.CopyError = CopyError;
|
|
44
|
+
exports.CopyErrorAlreadyExists = CopyErrorAlreadyExists;
|
|
45
|
+
exports.CopyErrorBusy = CopyErrorBusy;
|
|
46
|
+
exports.CopyErrorInvalidArgument = CopyErrorInvalidArgument;
|
|
47
|
+
exports.CopyErrorNoSpace = CopyErrorNoSpace;
|
|
48
|
+
exports.CopyErrorNotDirectory = CopyErrorNotDirectory;
|
|
49
|
+
exports.CopyErrorNotFound = CopyErrorNotFound;
|
|
50
|
+
exports.CopyErrorPermissionDenied = CopyErrorPermissionDenied;
|
|
51
|
+
exports.CopyErrorReadOnly = CopyErrorReadOnly;
|
|
52
|
+
exports.CopyErrorTooManyOpenFiles = CopyErrorTooManyOpenFiles;
|
|
43
53
|
exports.copy = copy;
|
package/dist/file/copy.d.ts
CHANGED
|
@@ -2,42 +2,42 @@ import * as DEither from "@duplojs/lang/either";
|
|
|
2
2
|
import type * as DPath from "@duplojs/lang/path";
|
|
3
3
|
import * as DCommon from "@duplojs/lang/common";
|
|
4
4
|
declare const CopyErrorNotFound_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-copy-not-found", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-copy-not-found", unknown>>, unknown>;
|
|
5
|
-
declare class CopyErrorNotFound extends CopyErrorNotFound_base {
|
|
5
|
+
export declare class CopyErrorNotFound extends CopyErrorNotFound_base {
|
|
6
6
|
}
|
|
7
7
|
declare const CopyErrorPermissionDenied_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-copy-permission-denied", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-copy-permission-denied", unknown>>, unknown>;
|
|
8
|
-
declare class CopyErrorPermissionDenied extends CopyErrorPermissionDenied_base {
|
|
8
|
+
export declare class CopyErrorPermissionDenied extends CopyErrorPermissionDenied_base {
|
|
9
9
|
}
|
|
10
10
|
declare const CopyErrorAlreadyExists_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-copy-already-exists", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-copy-already-exists", unknown>>, unknown>;
|
|
11
|
-
declare class CopyErrorAlreadyExists extends CopyErrorAlreadyExists_base {
|
|
11
|
+
export declare class CopyErrorAlreadyExists extends CopyErrorAlreadyExists_base {
|
|
12
12
|
}
|
|
13
13
|
declare const CopyErrorNotDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-copy-not-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-copy-not-directory", unknown>>, unknown>;
|
|
14
|
-
declare class CopyErrorNotDirectory extends CopyErrorNotDirectory_base {
|
|
14
|
+
export declare class CopyErrorNotDirectory extends CopyErrorNotDirectory_base {
|
|
15
15
|
}
|
|
16
16
|
declare const CopyErrorNoSpace_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-copy-no-space", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-copy-no-space", unknown>>, unknown>;
|
|
17
|
-
declare class CopyErrorNoSpace extends CopyErrorNoSpace_base {
|
|
17
|
+
export declare class CopyErrorNoSpace extends CopyErrorNoSpace_base {
|
|
18
18
|
}
|
|
19
19
|
declare const CopyErrorReadOnly_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-copy-read-only", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-copy-read-only", unknown>>, unknown>;
|
|
20
|
-
declare class CopyErrorReadOnly extends CopyErrorReadOnly_base {
|
|
20
|
+
export declare class CopyErrorReadOnly extends CopyErrorReadOnly_base {
|
|
21
21
|
}
|
|
22
22
|
declare const CopyErrorInvalidArgument_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-copy-invalid-argument", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-copy-invalid-argument", unknown>>, unknown>;
|
|
23
|
-
declare class CopyErrorInvalidArgument extends CopyErrorInvalidArgument_base {
|
|
23
|
+
export declare class CopyErrorInvalidArgument extends CopyErrorInvalidArgument_base {
|
|
24
24
|
}
|
|
25
25
|
declare const CopyErrorTooManyOpenFiles_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-copy-too-many-open-files", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-copy-too-many-open-files", unknown>>, unknown>;
|
|
26
|
-
declare class CopyErrorTooManyOpenFiles extends CopyErrorTooManyOpenFiles_base {
|
|
26
|
+
export declare class CopyErrorTooManyOpenFiles extends CopyErrorTooManyOpenFiles_base {
|
|
27
27
|
}
|
|
28
28
|
declare const CopyErrorBusy_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-copy-busy", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-copy-busy", unknown>>, unknown>;
|
|
29
|
-
declare class CopyErrorBusy extends CopyErrorBusy_base {
|
|
29
|
+
export declare class CopyErrorBusy extends CopyErrorBusy_base {
|
|
30
30
|
}
|
|
31
31
|
declare const CopyError_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-copy-error", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-copy-error", unknown>>, unknown>;
|
|
32
|
-
declare class CopyError extends CopyError_base {
|
|
32
|
+
export declare class CopyError extends CopyError_base {
|
|
33
33
|
}
|
|
34
34
|
export type CopyErrors = (CopyErrorNotFound | CopyErrorPermissionDenied | CopyErrorAlreadyExists | CopyErrorNotDirectory | CopyErrorNoSpace | CopyErrorReadOnly | CopyErrorInvalidArgument | CopyErrorTooManyOpenFiles | CopyErrorBusy | CopyError);
|
|
35
35
|
export type CopyResult = (DEither.Right<"file-system-copy", void> | DEither.Left<"file-system-copy-error", CopyErrors>);
|
|
36
36
|
declare module '../implementor' {
|
|
37
37
|
interface ServerFunction {
|
|
38
|
-
copy(fromPath:
|
|
38
|
+
copy(fromPath: DPath.AnyPath, toPath: DPath.AnyPath): Promise<CopyResult>;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
export declare function copy(toPath:
|
|
42
|
-
export declare function copy(fromPath:
|
|
41
|
+
export declare function copy(toPath: DPath.AnyPath): (fromPath: DPath.AnyPath) => Promise<CopyResult>;
|
|
42
|
+
export declare function copy(fromPath: DPath.AnyPath, toPath: DPath.AnyPath): Promise<CopyResult>;
|
|
43
43
|
export {};
|
package/dist/file/copy.mjs
CHANGED
|
@@ -37,4 +37,4 @@ function copy(...args) {
|
|
|
37
37
|
return copyImplementation(...args);
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
|
-
export { copy };
|
|
40
|
+
export { CopyError, CopyErrorAlreadyExists, CopyErrorBusy, CopyErrorInvalidArgument, CopyErrorNoSpace, CopyErrorNotDirectory, CopyErrorNotFound, CopyErrorPermissionDenied, CopyErrorReadOnly, CopyErrorTooManyOpenFiles, copy };
|
|
@@ -3,13 +3,16 @@ const require_stat = require("./stat.cjs");
|
|
|
3
3
|
const require_fileInterface = require("./fileInterface.cjs");
|
|
4
4
|
const require_unknownEntryInterface = require("./unknownEntryInterface.cjs");
|
|
5
5
|
const require_folderInterface = require("./folderInterface.cjs");
|
|
6
|
+
let _duplojs_lang_common = require("@duplojs/lang/common");
|
|
7
|
+
_duplojs_lang_common = require_runtime.__toESM(_duplojs_lang_common, 1);
|
|
6
8
|
let _duplojs_lang_pattern = require("@duplojs/lang/pattern");
|
|
7
9
|
_duplojs_lang_pattern = require_runtime.__toESM(_duplojs_lang_pattern, 1);
|
|
8
10
|
let _duplojs_lang_either = require("@duplojs/lang/either");
|
|
9
11
|
_duplojs_lang_either = require_runtime.__toESM(_duplojs_lang_either, 1);
|
|
10
12
|
//#region scripts/file/createEntryInterface.ts
|
|
11
13
|
async function createEntryInterface(path) {
|
|
12
|
-
const
|
|
14
|
+
const entryPath = _duplojs_lang_common.cast(path);
|
|
15
|
+
const result = await _duplojs_lang_either.rightAsyncPipe(require_stat.stat(path), _duplojs_lang_pattern.when(({ isFile }) => isFile, () => _duplojs_lang_either.right("file-interface", require_fileInterface.createFileInterface(entryPath))), _duplojs_lang_pattern.when(({ isDirectory }) => isDirectory, () => _duplojs_lang_either.right("folder-interface", require_folderInterface.createFolderInterface(entryPath))), _duplojs_lang_pattern.otherwise(() => _duplojs_lang_either.right("unknown-entry-interface", require_unknownEntryInterface.createUnknownEntryInterface(entryPath))));
|
|
13
16
|
return _duplojs_lang_either.whenIsLeft(result, (value) => _duplojs_lang_either.left("create-entry-interface-error", value));
|
|
14
17
|
}
|
|
15
18
|
//#endregion
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type * as DPath from "@duplojs/lang/path";
|
|
2
2
|
import * as DEither from "@duplojs/lang/either";
|
|
3
|
-
export declare function createEntryInterface(path:
|
|
3
|
+
export declare function createEntryInterface(path: DPath.AnyPath): Promise<DEither.Right<"file-interface", import('./fileInterface').FileInterface<string & DPath.Path>> | DEither.Right<"folder-interface", import('./folderInterface').FolderInterface<string & DPath.Path>> | DEither.Right<"unknown-entry-interface", import('./unknownEntryInterface').UnknownEntryInterface<string & DPath.Path>> | DEither.Left<"create-entry-interface-error", import('./stat').StatErrors>>;
|
|
@@ -2,11 +2,13 @@ import { stat } from "./stat.mjs";
|
|
|
2
2
|
import { createFileInterface } from "./fileInterface.mjs";
|
|
3
3
|
import { createUnknownEntryInterface } from "./unknownEntryInterface.mjs";
|
|
4
4
|
import { createFolderInterface } from "./folderInterface.mjs";
|
|
5
|
+
import * as DCommon from "@duplojs/lang/common";
|
|
5
6
|
import * as DPattern from "@duplojs/lang/pattern";
|
|
6
7
|
import * as DEither from "@duplojs/lang/either";
|
|
7
8
|
//#region scripts/file/createEntryInterface.ts
|
|
8
9
|
async function createEntryInterface(path) {
|
|
9
|
-
const
|
|
10
|
+
const entryPath = DCommon.cast(path);
|
|
11
|
+
const result = await DEither.rightAsyncPipe(stat(path), DPattern.when(({ isFile }) => isFile, () => DEither.right("file-interface", createFileInterface(entryPath))), DPattern.when(({ isDirectory }) => isDirectory, () => DEither.right("folder-interface", createFolderInterface(entryPath))), DPattern.otherwise(() => DEither.right("unknown-entry-interface", createUnknownEntryInterface(entryPath))));
|
|
10
12
|
return DEither.whenIsLeft(result, (value) => DEither.left("create-entry-interface-error", value));
|
|
11
13
|
}
|
|
12
14
|
//#endregion
|
|
@@ -41,4 +41,12 @@ const ensureDirectory = require_implementor.implementFunction("ensureDirectory",
|
|
|
41
41
|
DENO: (path) => Deno.mkdir(path, { recursive: true }).then(() => _duplojs_lang_either.right("file-system-ensure-directory")).catch(handleDenoEnsureDirectoryError)
|
|
42
42
|
});
|
|
43
43
|
//#endregion
|
|
44
|
+
exports.EnsureDirectoryError = EnsureDirectoryError;
|
|
45
|
+
exports.EnsureDirectoryErrorBusy = EnsureDirectoryErrorBusy;
|
|
46
|
+
exports.EnsureDirectoryErrorInvalidArgument = EnsureDirectoryErrorInvalidArgument;
|
|
47
|
+
exports.EnsureDirectoryErrorNoSpace = EnsureDirectoryErrorNoSpace;
|
|
48
|
+
exports.EnsureDirectoryErrorNotDirectory = EnsureDirectoryErrorNotDirectory;
|
|
49
|
+
exports.EnsureDirectoryErrorPermissionDenied = EnsureDirectoryErrorPermissionDenied;
|
|
50
|
+
exports.EnsureDirectoryErrorReadOnly = EnsureDirectoryErrorReadOnly;
|
|
51
|
+
exports.EnsureDirectoryErrorTooManyOpenFiles = EnsureDirectoryErrorTooManyOpenFiles;
|
|
44
52
|
exports.ensureDirectory = ensureDirectory;
|
|
@@ -2,35 +2,35 @@ import * as DEither from "@duplojs/lang/either";
|
|
|
2
2
|
import type * as DPath from "@duplojs/lang/path";
|
|
3
3
|
import * as DCommon from "@duplojs/lang/common";
|
|
4
4
|
declare const EnsureDirectoryErrorPermissionDenied_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-directory-permission-denied", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-directory-permission-denied", unknown>>, unknown>;
|
|
5
|
-
declare class EnsureDirectoryErrorPermissionDenied extends EnsureDirectoryErrorPermissionDenied_base {
|
|
5
|
+
export declare class EnsureDirectoryErrorPermissionDenied extends EnsureDirectoryErrorPermissionDenied_base {
|
|
6
6
|
}
|
|
7
7
|
declare const EnsureDirectoryErrorNotDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-directory-not-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-directory-not-directory", unknown>>, unknown>;
|
|
8
|
-
declare class EnsureDirectoryErrorNotDirectory extends EnsureDirectoryErrorNotDirectory_base {
|
|
8
|
+
export declare class EnsureDirectoryErrorNotDirectory extends EnsureDirectoryErrorNotDirectory_base {
|
|
9
9
|
}
|
|
10
10
|
declare const EnsureDirectoryErrorNoSpace_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-directory-no-space", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-directory-no-space", unknown>>, unknown>;
|
|
11
|
-
declare class EnsureDirectoryErrorNoSpace extends EnsureDirectoryErrorNoSpace_base {
|
|
11
|
+
export declare class EnsureDirectoryErrorNoSpace extends EnsureDirectoryErrorNoSpace_base {
|
|
12
12
|
}
|
|
13
13
|
declare const EnsureDirectoryErrorReadOnly_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-directory-read-only", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-directory-read-only", unknown>>, unknown>;
|
|
14
|
-
declare class EnsureDirectoryErrorReadOnly extends EnsureDirectoryErrorReadOnly_base {
|
|
14
|
+
export declare class EnsureDirectoryErrorReadOnly extends EnsureDirectoryErrorReadOnly_base {
|
|
15
15
|
}
|
|
16
16
|
declare const EnsureDirectoryErrorInvalidArgument_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-directory-invalid-argument", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-directory-invalid-argument", unknown>>, unknown>;
|
|
17
|
-
declare class EnsureDirectoryErrorInvalidArgument extends EnsureDirectoryErrorInvalidArgument_base {
|
|
17
|
+
export declare class EnsureDirectoryErrorInvalidArgument extends EnsureDirectoryErrorInvalidArgument_base {
|
|
18
18
|
}
|
|
19
19
|
declare const EnsureDirectoryErrorTooManyOpenFiles_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-directory-too-many-open-files", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-directory-too-many-open-files", unknown>>, unknown>;
|
|
20
|
-
declare class EnsureDirectoryErrorTooManyOpenFiles extends EnsureDirectoryErrorTooManyOpenFiles_base {
|
|
20
|
+
export declare class EnsureDirectoryErrorTooManyOpenFiles extends EnsureDirectoryErrorTooManyOpenFiles_base {
|
|
21
21
|
}
|
|
22
22
|
declare const EnsureDirectoryErrorBusy_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-directory-busy", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-directory-busy", unknown>>, unknown>;
|
|
23
|
-
declare class EnsureDirectoryErrorBusy extends EnsureDirectoryErrorBusy_base {
|
|
23
|
+
export declare class EnsureDirectoryErrorBusy extends EnsureDirectoryErrorBusy_base {
|
|
24
24
|
}
|
|
25
25
|
declare const EnsureDirectoryError_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-directory-error", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-directory-error", unknown>>, unknown>;
|
|
26
|
-
declare class EnsureDirectoryError extends EnsureDirectoryError_base {
|
|
26
|
+
export declare class EnsureDirectoryError extends EnsureDirectoryError_base {
|
|
27
27
|
}
|
|
28
28
|
export type EnsureDirectoryErrors = (EnsureDirectoryErrorPermissionDenied | EnsureDirectoryErrorNotDirectory | EnsureDirectoryErrorNoSpace | EnsureDirectoryErrorReadOnly | EnsureDirectoryErrorInvalidArgument | EnsureDirectoryErrorTooManyOpenFiles | EnsureDirectoryErrorBusy | EnsureDirectoryError);
|
|
29
29
|
export type EnsureDirectoryResult = (DEither.Right<"file-system-ensure-directory", void> | DEither.Left<"file-system-ensure-directory-error", EnsureDirectoryErrors>);
|
|
30
30
|
declare module '../implementor' {
|
|
31
31
|
interface ServerFunction {
|
|
32
|
-
ensureDirectory(path:
|
|
32
|
+
ensureDirectory(path: DPath.AnyPath): Promise<EnsureDirectoryResult>;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
export declare const ensureDirectory: (path:
|
|
35
|
+
export declare const ensureDirectory: (path: DPath.AnyPath) => Promise<EnsureDirectoryResult>;
|
|
36
36
|
export {};
|
|
@@ -38,4 +38,4 @@ const ensureDirectory = implementFunction("ensureDirectory", {
|
|
|
38
38
|
DENO: (path) => Deno.mkdir(path, { recursive: true }).then(() => DEither.right("file-system-ensure-directory")).catch(handleDenoEnsureDirectoryError)
|
|
39
39
|
});
|
|
40
40
|
//#endregion
|
|
41
|
-
export { ensureDirectory };
|
|
41
|
+
export { EnsureDirectoryError, EnsureDirectoryErrorBusy, EnsureDirectoryErrorInvalidArgument, EnsureDirectoryErrorNoSpace, EnsureDirectoryErrorNotDirectory, EnsureDirectoryErrorPermissionDenied, EnsureDirectoryErrorReadOnly, EnsureDirectoryErrorTooManyOpenFiles, ensureDirectory };
|
package/dist/file/ensureFile.cjs
CHANGED
|
@@ -48,4 +48,13 @@ const ensureFile = require_implementor.implementFunction("ensureFile", {
|
|
|
48
48
|
}).then((fh) => void fh.close()).then(() => _duplojs_lang_either.right("file-system-ensure-file")).catch(handleDenoEnsureFileError)
|
|
49
49
|
});
|
|
50
50
|
//#endregion
|
|
51
|
+
exports.EnsureFileError = EnsureFileError;
|
|
52
|
+
exports.EnsureFileErrorBusy = EnsureFileErrorBusy;
|
|
53
|
+
exports.EnsureFileErrorInvalidArgument = EnsureFileErrorInvalidArgument;
|
|
54
|
+
exports.EnsureFileErrorIsDirectory = EnsureFileErrorIsDirectory;
|
|
55
|
+
exports.EnsureFileErrorNoSpace = EnsureFileErrorNoSpace;
|
|
56
|
+
exports.EnsureFileErrorNotDirectory = EnsureFileErrorNotDirectory;
|
|
57
|
+
exports.EnsureFileErrorPermissionDenied = EnsureFileErrorPermissionDenied;
|
|
58
|
+
exports.EnsureFileErrorReadOnly = EnsureFileErrorReadOnly;
|
|
59
|
+
exports.EnsureFileErrorTooManyOpenFiles = EnsureFileErrorTooManyOpenFiles;
|
|
51
60
|
exports.ensureFile = ensureFile;
|
|
@@ -2,38 +2,38 @@ import * as DEither from "@duplojs/lang/either";
|
|
|
2
2
|
import type * as DPath from "@duplojs/lang/path";
|
|
3
3
|
import * as DCommon from "@duplojs/lang/common";
|
|
4
4
|
declare const EnsureFileErrorPermissionDenied_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-file-permission-denied", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-file-permission-denied", unknown>>, unknown>;
|
|
5
|
-
declare class EnsureFileErrorPermissionDenied extends EnsureFileErrorPermissionDenied_base {
|
|
5
|
+
export declare class EnsureFileErrorPermissionDenied extends EnsureFileErrorPermissionDenied_base {
|
|
6
6
|
}
|
|
7
7
|
declare const EnsureFileErrorIsDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-file-is-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-file-is-directory", unknown>>, unknown>;
|
|
8
|
-
declare class EnsureFileErrorIsDirectory extends EnsureFileErrorIsDirectory_base {
|
|
8
|
+
export declare class EnsureFileErrorIsDirectory extends EnsureFileErrorIsDirectory_base {
|
|
9
9
|
}
|
|
10
10
|
declare const EnsureFileErrorNotDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-file-not-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-file-not-directory", unknown>>, unknown>;
|
|
11
|
-
declare class EnsureFileErrorNotDirectory extends EnsureFileErrorNotDirectory_base {
|
|
11
|
+
export declare class EnsureFileErrorNotDirectory extends EnsureFileErrorNotDirectory_base {
|
|
12
12
|
}
|
|
13
13
|
declare const EnsureFileErrorNoSpace_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-file-no-space", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-file-no-space", unknown>>, unknown>;
|
|
14
|
-
declare class EnsureFileErrorNoSpace extends EnsureFileErrorNoSpace_base {
|
|
14
|
+
export declare class EnsureFileErrorNoSpace extends EnsureFileErrorNoSpace_base {
|
|
15
15
|
}
|
|
16
16
|
declare const EnsureFileErrorReadOnly_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-file-read-only", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-file-read-only", unknown>>, unknown>;
|
|
17
|
-
declare class EnsureFileErrorReadOnly extends EnsureFileErrorReadOnly_base {
|
|
17
|
+
export declare class EnsureFileErrorReadOnly extends EnsureFileErrorReadOnly_base {
|
|
18
18
|
}
|
|
19
19
|
declare const EnsureFileErrorInvalidArgument_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-file-invalid-argument", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-file-invalid-argument", unknown>>, unknown>;
|
|
20
|
-
declare class EnsureFileErrorInvalidArgument extends EnsureFileErrorInvalidArgument_base {
|
|
20
|
+
export declare class EnsureFileErrorInvalidArgument extends EnsureFileErrorInvalidArgument_base {
|
|
21
21
|
}
|
|
22
22
|
declare const EnsureFileErrorTooManyOpenFiles_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-file-too-many-open-files", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-file-too-many-open-files", unknown>>, unknown>;
|
|
23
|
-
declare class EnsureFileErrorTooManyOpenFiles extends EnsureFileErrorTooManyOpenFiles_base {
|
|
23
|
+
export declare class EnsureFileErrorTooManyOpenFiles extends EnsureFileErrorTooManyOpenFiles_base {
|
|
24
24
|
}
|
|
25
25
|
declare const EnsureFileErrorBusy_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-file-busy", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-file-busy", unknown>>, unknown>;
|
|
26
|
-
declare class EnsureFileErrorBusy extends EnsureFileErrorBusy_base {
|
|
26
|
+
export declare class EnsureFileErrorBusy extends EnsureFileErrorBusy_base {
|
|
27
27
|
}
|
|
28
28
|
declare const EnsureFileError_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-ensure-file-error", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-ensure-file-error", unknown>>, unknown>;
|
|
29
|
-
declare class EnsureFileError extends EnsureFileError_base {
|
|
29
|
+
export declare class EnsureFileError extends EnsureFileError_base {
|
|
30
30
|
}
|
|
31
31
|
export type EnsureFileErrors = (EnsureFileErrorPermissionDenied | EnsureFileErrorIsDirectory | EnsureFileErrorNotDirectory | EnsureFileErrorNoSpace | EnsureFileErrorReadOnly | EnsureFileErrorInvalidArgument | EnsureFileErrorTooManyOpenFiles | EnsureFileErrorBusy | EnsureFileError);
|
|
32
32
|
export type EnsureFileResult = (DEither.Right<"file-system-ensure-file", void> | DEither.Left<"file-system-ensure-file-error", EnsureFileErrors>);
|
|
33
33
|
declare module '../implementor' {
|
|
34
34
|
interface ServerFunction {
|
|
35
|
-
ensureFile(path:
|
|
35
|
+
ensureFile(path: DPath.AnyPath): Promise<EnsureFileResult>;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
export declare const ensureFile: (path:
|
|
38
|
+
export declare const ensureFile: (path: DPath.AnyPath) => Promise<EnsureFileResult>;
|
|
39
39
|
export {};
|
package/dist/file/ensureFile.mjs
CHANGED
|
@@ -45,4 +45,4 @@ const ensureFile = implementFunction("ensureFile", {
|
|
|
45
45
|
}).then((fh) => void fh.close()).then(() => DEither.right("file-system-ensure-file")).catch(handleDenoEnsureFileError)
|
|
46
46
|
});
|
|
47
47
|
//#endregion
|
|
48
|
-
export { ensureFile };
|
|
48
|
+
export { EnsureFileError, EnsureFileErrorBusy, EnsureFileErrorInvalidArgument, EnsureFileErrorIsDirectory, EnsureFileErrorNoSpace, EnsureFileErrorNotDirectory, EnsureFileErrorPermissionDenied, EnsureFileErrorReadOnly, EnsureFileErrorTooManyOpenFiles, ensureFile };
|
package/dist/file/exists.cjs
CHANGED
|
@@ -35,4 +35,9 @@ const exists = require_implementor.implementFunction("exists", {
|
|
|
35
35
|
BUN: (path) => Bun.file(path).exists().then((value) => value ? _duplojs_lang_either.right("file-system-exists") : _duplojs_lang_either.left("file-system-exists-error", new ExistsErrorNotFound(/* @__PURE__ */ new Error("Path does not exist")))).catch(handleNodeExistsError)
|
|
36
36
|
});
|
|
37
37
|
//#endregion
|
|
38
|
+
exports.ExistsError = ExistsError;
|
|
39
|
+
exports.ExistsErrorNotDirectory = ExistsErrorNotDirectory;
|
|
40
|
+
exports.ExistsErrorNotFound = ExistsErrorNotFound;
|
|
41
|
+
exports.ExistsErrorPermissionDenied = ExistsErrorPermissionDenied;
|
|
42
|
+
exports.ExistsErrorTooManyOpenFiles = ExistsErrorTooManyOpenFiles;
|
|
38
43
|
exports.exists = exists;
|
package/dist/file/exists.d.ts
CHANGED
|
@@ -2,26 +2,26 @@ import * as DEither from "@duplojs/lang/either";
|
|
|
2
2
|
import type * as DPath from "@duplojs/lang/path";
|
|
3
3
|
import * as DCommon from "@duplojs/lang/common";
|
|
4
4
|
declare const ExistsErrorNotFound_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-exists-not-found", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-exists-not-found", unknown>>, unknown>;
|
|
5
|
-
declare class ExistsErrorNotFound extends ExistsErrorNotFound_base {
|
|
5
|
+
export declare class ExistsErrorNotFound extends ExistsErrorNotFound_base {
|
|
6
6
|
}
|
|
7
7
|
declare const ExistsErrorPermissionDenied_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-exists-permission-denied", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-exists-permission-denied", unknown>>, unknown>;
|
|
8
|
-
declare class ExistsErrorPermissionDenied extends ExistsErrorPermissionDenied_base {
|
|
8
|
+
export declare class ExistsErrorPermissionDenied extends ExistsErrorPermissionDenied_base {
|
|
9
9
|
}
|
|
10
10
|
declare const ExistsErrorNotDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-exists-not-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-exists-not-directory", unknown>>, unknown>;
|
|
11
|
-
declare class ExistsErrorNotDirectory extends ExistsErrorNotDirectory_base {
|
|
11
|
+
export declare class ExistsErrorNotDirectory extends ExistsErrorNotDirectory_base {
|
|
12
12
|
}
|
|
13
13
|
declare const ExistsErrorTooManyOpenFiles_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-exists-too-many-open-files", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-exists-too-many-open-files", unknown>>, unknown>;
|
|
14
|
-
declare class ExistsErrorTooManyOpenFiles extends ExistsErrorTooManyOpenFiles_base {
|
|
14
|
+
export declare class ExistsErrorTooManyOpenFiles extends ExistsErrorTooManyOpenFiles_base {
|
|
15
15
|
}
|
|
16
16
|
declare const ExistsError_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-exists-error", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-exists-error", unknown>>, unknown>;
|
|
17
|
-
declare class ExistsError extends ExistsError_base {
|
|
17
|
+
export declare class ExistsError extends ExistsError_base {
|
|
18
18
|
}
|
|
19
19
|
export type ExistsErrors = (ExistsErrorNotFound | ExistsErrorPermissionDenied | ExistsErrorNotDirectory | ExistsErrorTooManyOpenFiles | ExistsError);
|
|
20
20
|
export type ExistsResult = (DEither.Right<"file-system-exists", void> | DEither.Left<"file-system-exists-error", ExistsErrors>);
|
|
21
21
|
declare module '../implementor' {
|
|
22
22
|
interface ServerFunction {
|
|
23
|
-
exists(path:
|
|
23
|
+
exists(path: DPath.AnyPath): Promise<ExistsResult>;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
export declare const exists: (path:
|
|
26
|
+
export declare const exists: (path: DPath.AnyPath) => Promise<ExistsResult>;
|
|
27
27
|
export {};
|
package/dist/file/exists.mjs
CHANGED
|
@@ -32,4 +32,4 @@ const exists = implementFunction("exists", {
|
|
|
32
32
|
BUN: (path) => Bun.file(path).exists().then((value) => value ? DEither.right("file-system-exists") : DEither.left("file-system-exists-error", new ExistsErrorNotFound(/* @__PURE__ */ new Error("Path does not exist")))).catch(handleNodeExistsError)
|
|
33
33
|
});
|
|
34
34
|
//#endregion
|
|
35
|
-
export { exists };
|
|
35
|
+
export { ExistsError, ExistsErrorNotDirectory, ExistsErrorNotFound, ExistsErrorPermissionDenied, ExistsErrorTooManyOpenFiles, exists };
|
|
@@ -51,7 +51,7 @@ function createFileInterface(path) {
|
|
|
51
51
|
return _duplojs_lang_common.asyncPipe(localStat(), _duplojs_lang_either.whenHasInformationOtherwise("file-system-stat", ({ isFile }) => isFile, _duplojs_lang_common.justReturn(false)));
|
|
52
52
|
}
|
|
53
53
|
return {
|
|
54
|
-
path,
|
|
54
|
+
path: _duplojs_lang_common.cast(path),
|
|
55
55
|
getName,
|
|
56
56
|
getExtension,
|
|
57
57
|
getMimeType,
|
|
@@ -4,7 +4,6 @@ import { MoveResult } from './move';
|
|
|
4
4
|
import { RemoveResult } from './remove';
|
|
5
5
|
import { StatResult } from './stat';
|
|
6
6
|
import { RelocateResult } from './relocate';
|
|
7
|
-
import { EntryPath } from './unknownEntryInterface';
|
|
8
7
|
import type * as DKind from "@duplojs/lang/kind";
|
|
9
8
|
import * as DPath from "@duplojs/lang/path";
|
|
10
9
|
import * as DEither from "@duplojs/lang/either";
|
|
@@ -12,21 +11,21 @@ declare const fileInterfaceKind: DKind.Handler<DKind.Definition<"@DuplojsServer/
|
|
|
12
11
|
type FileInterfaceRenameResult = Exclude<RenameResult, DEither.Right> | DEither.Right<"file-system-rename", FileInterface>;
|
|
13
12
|
type FileInterfaceRelocateResult = Exclude<RelocateResult, DEither.Right> | DEither.Right<"file-system-relocate", FileInterface>;
|
|
14
13
|
type FileInterfaceMoveResult = Exclude<MoveResult, DEither.Right> | DEither.Right<"file-system-move", FileInterface>;
|
|
15
|
-
export interface FileInterface<GenericPath extends
|
|
14
|
+
export interface FileInterface<GenericPath extends DPath.AnyPath = DPath.AnyPath> extends DKind.Kind<typeof fileInterfaceKind> {
|
|
16
15
|
path: GenericPath & DPath.Path;
|
|
17
16
|
getName(): (string & DPath.Segment & DPath.Path) | null;
|
|
18
17
|
getMimeType(): string | null;
|
|
19
18
|
getExtension(params?: DPath.GetExtensionNameParams): (string & DPath.Segment & DPath.Path) | null;
|
|
20
|
-
getParentPath():
|
|
19
|
+
getParentPath(): ReturnType<typeof DPath.getParentFolderPath<GenericPath>>;
|
|
21
20
|
rename(newName: string & DPath.Segment): Promise<FileInterfaceRenameResult>;
|
|
22
|
-
relocate(parentPath:
|
|
23
|
-
move(newPath:
|
|
21
|
+
relocate(parentPath: DPath.AnyPath): Promise<FileInterfaceRelocateResult>;
|
|
22
|
+
move(newPath: DPath.AnyPath): Promise<FileInterfaceMoveResult>;
|
|
24
23
|
exists(): Promise<ExistsResult>;
|
|
25
24
|
remove(): Promise<RemoveResult>;
|
|
26
25
|
stat(): Promise<StatResult>;
|
|
27
26
|
isFile(): Promise<boolean>;
|
|
28
27
|
}
|
|
29
|
-
export declare function createFileInterface<GenericPath extends
|
|
28
|
+
export declare function createFileInterface<GenericPath extends DPath.AnyPath = DPath.AnyPath>(path: GenericPath): FileInterface<GenericPath>;
|
|
30
29
|
export declare function isFileInterface<GenericInput extends unknown>(input: GenericInput): input is Extract<GenericInput, FileInterface>;
|
|
31
30
|
export declare const isFileInterfaceFromUnknown: (input: unknown) => input is FileInterface;
|
|
32
31
|
export {};
|
|
@@ -47,7 +47,7 @@ function createFileInterface(path) {
|
|
|
47
47
|
return DCommon.asyncPipe(localStat(), DEither.whenHasInformationOtherwise("file-system-stat", ({ isFile }) => isFile, DCommon.justReturn(false)));
|
|
48
48
|
}
|
|
49
49
|
return {
|
|
50
|
-
path,
|
|
50
|
+
path: DCommon.cast(path),
|
|
51
51
|
getName,
|
|
52
52
|
getExtension,
|
|
53
53
|
getMimeType,
|
|
@@ -51,7 +51,7 @@ function createFolderInterface(path) {
|
|
|
51
51
|
return _duplojs_lang_common.asyncPipe(localStat(), _duplojs_lang_either.whenHasInformationOtherwise("file-system-stat", ({ isDirectory }) => isDirectory, _duplojs_lang_common.justReturn(false)));
|
|
52
52
|
}
|
|
53
53
|
return {
|
|
54
|
-
path,
|
|
54
|
+
path: _duplojs_lang_common.cast(path),
|
|
55
55
|
getName,
|
|
56
56
|
getParentPath,
|
|
57
57
|
move: localMove,
|