@duplojs/server 0.1.0-beta.2 → 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/_virtual/_rolldown/runtime.mjs +5 -1
- package/dist/command/argument.d.ts +2 -2
- package/dist/command/create.cjs +18 -10
- package/dist/command/create.d.ts +3 -3
- package/dist/command/create.mjs +18 -10
- package/dist/command/error.cjs +26 -2
- package/dist/command/error.d.ts +9 -1
- package/dist/command/error.mjs +25 -1
- package/dist/command/exec.d.ts +4 -3
- package/dist/command/help.cjs +11 -9
- package/dist/command/help.d.ts +1 -1
- package/dist/command/help.mjs +10 -8
- 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 +2 -1
- package/dist/common/index.cjs +3 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.mjs +3 -1
- package/dist/common/meta/getCurrentDirectoryName.cjs +10 -0
- package/dist/common/meta/getCurrentDirectoryName.d.ts +7 -0
- package/dist/common/meta/getCurrentDirectoryName.mjs +7 -0
- package/dist/common/meta/index.d.ts +7 -0
- package/dist/dataStructure/common/codec/defaults/json.cjs +12 -1
- package/dist/dataStructure/common/codec/defaults/json.d.ts +2 -2
- package/dist/dataStructure/common/codec/defaults/json.mjs +12 -1
- package/dist/dataStructure/common/codec/defaults/string.cjs +12 -1
- package/dist/dataStructure/common/codec/defaults/string.d.ts +2 -2
- package/dist/dataStructure/common/codec/defaults/string.mjs +12 -1
- package/dist/dataStructure/common/error/defaultInterpreter.cjs +3 -1
- package/dist/dataStructure/common/error/defaultInterpreter.d.ts +7 -2
- package/dist/dataStructure/common/error/defaultInterpreter.mjs +3 -1
- package/dist/dataStructure/constraint/{exist.cjs → fileExist.cjs} +5 -5
- package/dist/dataStructure/constraint/fileExist.d.ts +10 -0
- package/dist/dataStructure/constraint/{exist.mjs → fileExist.mjs} +4 -4
- package/dist/dataStructure/constraint/folderExist.cjs +19 -0
- package/dist/dataStructure/constraint/folderExist.d.ts +10 -0
- package/dist/dataStructure/constraint/folderExist.mjs +15 -0
- package/dist/dataStructure/constraint/index.d.ts +2 -1
- package/dist/dataStructure/constraint/mimeType.cjs +1 -1
- package/dist/dataStructure/constraint/mimeType.mjs +1 -1
- package/dist/dataStructure/constraint/types/constraints.d.ts +4 -2
- package/dist/dataStructure/fundamentalType/folder.cjs +11 -0
- package/dist/dataStructure/fundamentalType/folder.d.ts +8 -0
- package/dist/dataStructure/fundamentalType/folder.mjs +8 -0
- package/dist/dataStructure/fundamentalType/index.d.ts +1 -0
- package/dist/dataStructure/fundamentalType/types/fundamentalTypes.d.ts +2 -0
- package/dist/dataStructure/helper/file.d.ts +1 -1
- package/dist/dataStructure/helper/fileExist.cjs +7 -0
- package/dist/dataStructure/helper/fileExist.d.ts +2 -0
- package/dist/dataStructure/helper/fileExist.mjs +7 -0
- package/dist/dataStructure/helper/folder.cjs +10 -0
- package/dist/dataStructure/helper/folder.d.ts +3 -0
- package/dist/dataStructure/helper/folder.mjs +8 -0
- package/dist/dataStructure/helper/folderExist.cjs +7 -0
- package/dist/dataStructure/helper/folderExist.d.ts +2 -0
- package/dist/dataStructure/helper/folderExist.mjs +7 -0
- package/dist/dataStructure/helper/index.d.ts +3 -1
- package/dist/dataStructure/index.cjs +29 -8
- package/dist/dataStructure/index.mjs +19 -6
- package/dist/dataStructure/type/folder.cjs +14 -0
- package/dist/dataStructure/type/folder.d.ts +11 -0
- package/dist/dataStructure/type/folder.mjs +11 -0
- package/dist/dataStructure/type/index.d.ts +1 -0
- package/dist/dataStructure/type/types/types.d.ts +2 -0
- package/dist/file/appendFile.cjs +46 -22
- package/dist/file/appendFile.d.ts +37 -5
- package/dist/file/appendFile.mjs +36 -23
- package/dist/file/appendTextFile.cjs +44 -20
- package/dist/file/appendTextFile.d.ts +37 -5
- package/dist/file/appendTextFile.mjs +34 -21
- package/dist/file/copy.cjs +36 -14
- package/dist/file/copy.d.ts +37 -5
- package/dist/file/copy.mjs +26 -15
- package/dist/file/createEntryInterface.cjs +6 -3
- package/dist/file/createEntryInterface.d.ts +1 -1
- package/dist/file/createEntryInterface.mjs +4 -2
- package/dist/file/ensureDirectory.cjs +37 -17
- package/dist/file/ensureDirectory.d.ts +30 -4
- package/dist/file/ensureDirectory.mjs +29 -18
- package/dist/file/ensureFile.cjs +41 -19
- package/dist/file/ensureFile.d.ts +33 -4
- package/dist/file/ensureFile.mjs +32 -20
- package/dist/file/exists.cjs +28 -14
- package/dist/file/exists.d.ts +21 -4
- package/dist/file/exists.mjs +23 -15
- package/dist/file/fileInterface.cjs +3 -1
- package/dist/file/fileInterface.d.ts +10 -9
- package/dist/file/fileInterface.mjs +3 -2
- package/dist/file/folderInterface.cjs +3 -1
- package/dist/file/folderInterface.d.ts +9 -8
- package/dist/file/folderInterface.mjs +3 -2
- package/dist/file/index.cjs +512 -0
- package/dist/file/index.d.ts +0 -1
- package/dist/file/index.mjs +291 -35
- package/dist/file/link.cjs +48 -22
- package/dist/file/link.d.ts +40 -5
- package/dist/file/link.mjs +37 -23
- package/dist/file/linkStat.cjs +29 -15
- package/dist/file/linkStat.d.ts +24 -4
- package/dist/file/linkStat.mjs +24 -16
- package/dist/file/makeDirectory.cjs +45 -21
- package/dist/file/makeDirectory.d.ts +35 -4
- package/dist/file/makeDirectory.mjs +35 -22
- package/dist/file/makeTemporaryDirectory.cjs +33 -15
- package/dist/file/makeTemporaryDirectory.d.ts +25 -2
- package/dist/file/makeTemporaryDirectory.mjs +26 -16
- package/dist/file/makeTemporaryFile.cjs +37 -20
- package/dist/file/makeTemporaryFile.d.ts +28 -2
- package/dist/file/makeTemporaryFile.mjs +30 -21
- package/dist/file/move.cjs +49 -23
- package/dist/file/move.d.ts +40 -5
- package/dist/file/move.mjs +38 -24
- package/dist/file/readDirectory.cjs +33 -9
- package/dist/file/readDirectory.d.ts +26 -5
- package/dist/file/readDirectory.mjs +25 -10
- package/dist/file/readFile.cjs +35 -17
- package/dist/file/readFile.d.ts +27 -4
- package/dist/file/readFile.mjs +28 -18
- package/dist/file/readJsonFile.cjs +35 -17
- package/dist/file/readJsonFile.d.ts +27 -5
- package/dist/file/readJsonFile.mjs +28 -18
- package/dist/file/readLink.cjs +31 -15
- package/dist/file/readLink.d.ts +24 -4
- package/dist/file/readLink.mjs +25 -16
- package/dist/file/readTextFile.cjs +35 -17
- package/dist/file/readTextFile.d.ts +27 -4
- package/dist/file/readTextFile.mjs +28 -18
- package/dist/file/realPath.cjs +27 -13
- package/dist/file/realPath.d.ts +21 -4
- package/dist/file/realPath.mjs +22 -14
- package/dist/file/relocate.cjs +52 -25
- package/dist/file/relocate.d.ts +40 -5
- package/dist/file/relocate.mjs +41 -26
- package/dist/file/remove.cjs +45 -23
- package/dist/file/remove.d.ts +32 -4
- package/dist/file/remove.mjs +36 -24
- package/dist/file/rename.cjs +52 -25
- package/dist/file/rename.d.ts +40 -5
- package/dist/file/rename.mjs +41 -26
- package/dist/file/setMode.cjs +29 -15
- package/dist/file/setMode.d.ts +24 -5
- package/dist/file/setMode.mjs +24 -16
- package/dist/file/setOwner.cjs +31 -15
- package/dist/file/setOwner.d.ts +25 -5
- package/dist/file/setOwner.mjs +25 -16
- package/dist/file/setTime.cjs +31 -15
- package/dist/file/setTime.d.ts +24 -5
- package/dist/file/setTime.mjs +25 -16
- package/dist/file/stat.cjs +29 -15
- package/dist/file/stat.d.ts +24 -4
- package/dist/file/stat.mjs +24 -16
- package/dist/file/symlink.cjs +42 -20
- package/dist/file/symlink.d.ts +34 -5
- package/dist/file/symlink.mjs +33 -21
- package/dist/file/truncate.cjs +43 -21
- package/dist/file/truncate.d.ts +36 -4
- package/dist/file/truncate.mjs +34 -22
- package/dist/file/unknownEntryInterface.cjs +5 -1
- package/dist/file/unknownEntryInterface.d.ts +8 -6
- package/dist/file/unknownEntryInterface.mjs +4 -2
- package/dist/file/walkDirectory.cjs +38 -15
- package/dist/file/walkDirectory.d.ts +25 -4
- package/dist/file/walkDirectory.mjs +32 -15
- package/dist/file/writeFile.cjs +45 -21
- package/dist/file/writeFile.d.ts +37 -5
- package/dist/file/writeFile.mjs +35 -22
- package/dist/file/writeJsonFile.cjs +48 -27
- package/dist/file/writeJsonFile.d.ts +37 -6
- package/dist/file/writeJsonFile.mjs +39 -28
- package/dist/file/writeTextFile.cjs +45 -21
- package/dist/file/writeTextFile.d.ts +37 -5
- package/dist/file/writeTextFile.mjs +35 -22
- package/dist/implementor.cjs +8 -5
- package/dist/implementor.d.ts +4 -4
- package/dist/implementor.mjs +8 -5
- package/dist/index.cjs +2 -0
- package/dist/index.mjs +2 -1
- package/dist/override.d.ts +8 -0
- package/package.json +4 -4
- package/dist/dataStructure/constraint/exist.d.ts +0 -10
- package/dist/dataStructure/helper/exist.cjs +0 -7
- package/dist/dataStructure/helper/exist.d.ts +0 -2
- package/dist/dataStructure/helper/exist.mjs +0 -7
- package/dist/file/types/fileSystemEither.d.ts +0 -2
- package/dist/file/types/index.d.ts +0 -1
- /package/{README → README.md} +0 -0
|
@@ -11,20 +11,21 @@ declare const fileInterfaceKind: DKind.Handler<DKind.Definition<"@DuplojsServer/
|
|
|
11
11
|
type FileInterfaceRenameResult = Exclude<RenameResult, DEither.Right> | DEither.Right<"file-system-rename", FileInterface>;
|
|
12
12
|
type FileInterfaceRelocateResult = Exclude<RelocateResult, DEither.Right> | DEither.Right<"file-system-relocate", FileInterface>;
|
|
13
13
|
type FileInterfaceMoveResult = Exclude<MoveResult, DEither.Right> | DEither.Right<"file-system-move", FileInterface>;
|
|
14
|
-
export interface FileInterface extends DKind.Kind<typeof fileInterfaceKind> {
|
|
15
|
-
path:
|
|
16
|
-
getName(): (string & DPath.Segment) | null;
|
|
14
|
+
export interface FileInterface<GenericPath extends DPath.AnyPath = DPath.AnyPath> extends DKind.Kind<typeof fileInterfaceKind> {
|
|
15
|
+
path: GenericPath & DPath.Path;
|
|
16
|
+
getName(): (string & DPath.Segment & DPath.Path) | null;
|
|
17
17
|
getMimeType(): string | null;
|
|
18
|
-
getExtension(params?: DPath.GetExtensionNameParams): (string & DPath.Segment) | null;
|
|
19
|
-
getParentPath():
|
|
18
|
+
getExtension(params?: DPath.GetExtensionNameParams): (string & DPath.Segment & DPath.Path) | null;
|
|
19
|
+
getParentPath(): ReturnType<typeof DPath.getParentFolderPath<GenericPath>>;
|
|
20
20
|
rename(newName: string & DPath.Segment): Promise<FileInterfaceRenameResult>;
|
|
21
|
-
relocate(parentPath:
|
|
22
|
-
move(newPath:
|
|
21
|
+
relocate(parentPath: DPath.AnyPath): Promise<FileInterfaceRelocateResult>;
|
|
22
|
+
move(newPath: DPath.AnyPath): Promise<FileInterfaceMoveResult>;
|
|
23
23
|
exists(): Promise<ExistsResult>;
|
|
24
24
|
remove(): Promise<RemoveResult>;
|
|
25
25
|
stat(): Promise<StatResult>;
|
|
26
26
|
isFile(): Promise<boolean>;
|
|
27
27
|
}
|
|
28
|
-
export declare function createFileInterface
|
|
29
|
-
export declare function isFileInterface(input:
|
|
28
|
+
export declare function createFileInterface<GenericPath extends DPath.AnyPath = DPath.AnyPath>(path: GenericPath): FileInterface<GenericPath>;
|
|
29
|
+
export declare function isFileInterface<GenericInput extends unknown>(input: GenericInput): input is Extract<GenericInput, FileInterface>;
|
|
30
|
+
export declare const isFileInterfaceFromUnknown: (input: unknown) => input is FileInterface;
|
|
30
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,
|
|
@@ -65,5 +65,6 @@ function createFileInterface(path) {
|
|
|
65
65
|
function isFileInterface(input) {
|
|
66
66
|
return fileInterfaceKind.has(input);
|
|
67
67
|
}
|
|
68
|
+
const isFileInterfaceFromUnknown = isFileInterface;
|
|
68
69
|
//#endregion
|
|
69
|
-
export { createFileInterface, isFileInterface };
|
|
70
|
+
export { createFileInterface, isFileInterface, isFileInterfaceFromUnknown };
|
|
@@ -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,
|
|
@@ -69,6 +69,8 @@ function createFolderInterface(path) {
|
|
|
69
69
|
function isFolderInterface(input) {
|
|
70
70
|
return folderInterfaceKind.has(input);
|
|
71
71
|
}
|
|
72
|
+
const isFolderInterfaceFromUnknown = isFolderInterface;
|
|
72
73
|
//#endregion
|
|
73
74
|
exports.createFolderInterface = createFolderInterface;
|
|
74
75
|
exports.isFolderInterface = isFolderInterface;
|
|
76
|
+
exports.isFolderInterfaceFromUnknown = isFolderInterfaceFromUnknown;
|
|
@@ -13,20 +13,21 @@ declare const folderInterfaceKind: DKind.Handler<DKind.Definition<"@DuplojsServe
|
|
|
13
13
|
type FolderInterfaceRenameResult = Exclude<RenameResult, DEither.Right> | DEither.Right<"file-system-rename", FolderInterface>;
|
|
14
14
|
type FolderInterfaceRelocateResult = Exclude<RelocateResult, DEither.Right> | DEither.Right<"file-system-relocate", FolderInterface>;
|
|
15
15
|
type FolderInterfaceMoveResult = Exclude<MoveResult, DEither.Right> | DEither.Right<"file-system-move", FolderInterface>;
|
|
16
|
-
export interface FolderInterface extends DKind.Kind<typeof folderInterfaceKind> {
|
|
17
|
-
path:
|
|
18
|
-
getName(): (string & DPath.Segment) | null;
|
|
19
|
-
getParentPath():
|
|
16
|
+
export interface FolderInterface<GenericPath extends DPath.AnyPath = DPath.AnyPath> extends DKind.Kind<typeof folderInterfaceKind> {
|
|
17
|
+
path: GenericPath & DPath.Path;
|
|
18
|
+
getName(): (string & DPath.Segment & DPath.Path) | null;
|
|
19
|
+
getParentPath(): ReturnType<typeof DPath.getParentFolderPath<GenericPath>>;
|
|
20
20
|
rename(newName: (string & DPath.Segment)): Promise<FolderInterfaceRenameResult>;
|
|
21
21
|
exists(): Promise<ExistsResult>;
|
|
22
|
-
relocate(parentPath:
|
|
23
|
-
move(newPath:
|
|
22
|
+
relocate(parentPath: DPath.AnyPath): Promise<FolderInterfaceRelocateResult>;
|
|
23
|
+
move(newPath: DPath.AnyPath): Promise<FolderInterfaceMoveResult>;
|
|
24
24
|
remove(): Promise<RemoveResult>;
|
|
25
25
|
getChildren(): Promise<ReadDirectoryResult>;
|
|
26
26
|
stat(): Promise<StatResult>;
|
|
27
27
|
walk(params?: WalkDirectoryParams): Promise<WalkDirectoryResult>;
|
|
28
28
|
isFolder(): Promise<boolean>;
|
|
29
29
|
}
|
|
30
|
-
export declare function createFolderInterface
|
|
31
|
-
export declare function isFolderInterface(input:
|
|
30
|
+
export declare function createFolderInterface<GenericPath extends DPath.AnyPath = DPath.AnyPath>(path: GenericPath): FolderInterface<GenericPath>;
|
|
31
|
+
export declare function isFolderInterface<GenericInput extends unknown>(input: GenericInput): input is Extract<GenericInput, FolderInterface>;
|
|
32
|
+
export declare const isFolderInterfaceFromUnknown: (input: unknown) => input is FolderInterface;
|
|
32
33
|
export {};
|
|
@@ -47,7 +47,7 @@ function createFolderInterface(path) {
|
|
|
47
47
|
return DCommon.asyncPipe(localStat(), DEither.whenHasInformationOtherwise("file-system-stat", ({ isDirectory }) => isDirectory, DCommon.justReturn(false)));
|
|
48
48
|
}
|
|
49
49
|
return {
|
|
50
|
-
path,
|
|
50
|
+
path: DCommon.cast(path),
|
|
51
51
|
getName,
|
|
52
52
|
getParentPath,
|
|
53
53
|
move: localMove,
|
|
@@ -65,5 +65,6 @@ function createFolderInterface(path) {
|
|
|
65
65
|
function isFolderInterface(input) {
|
|
66
66
|
return folderInterfaceKind.has(input);
|
|
67
67
|
}
|
|
68
|
+
const isFolderInterfaceFromUnknown = isFolderInterface;
|
|
68
69
|
//#endregion
|
|
69
|
-
export { createFolderInterface, isFolderInterface };
|
|
70
|
+
export { createFolderInterface, isFolderInterface, isFolderInterfaceFromUnknown };
|