@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.
Files changed (198) hide show
  1. package/dist/_virtual/_rolldown/runtime.mjs +5 -1
  2. package/dist/command/argument.d.ts +2 -2
  3. package/dist/command/create.cjs +18 -10
  4. package/dist/command/create.d.ts +3 -3
  5. package/dist/command/create.mjs +18 -10
  6. package/dist/command/error.cjs +26 -2
  7. package/dist/command/error.d.ts +9 -1
  8. package/dist/command/error.mjs +25 -1
  9. package/dist/command/exec.d.ts +4 -3
  10. package/dist/command/help.cjs +11 -9
  11. package/dist/command/help.d.ts +1 -1
  12. package/dist/command/help.mjs +10 -8
  13. package/dist/command/index.cjs +4 -0
  14. package/dist/command/index.mjs +4 -2
  15. package/dist/command/options/base.cjs +21 -13
  16. package/dist/command/options/base.d.ts +6 -0
  17. package/dist/command/options/base.mjs +20 -14
  18. package/dist/command/options/defaults/array.d.ts +6 -4
  19. package/dist/command/options/defaults/boolean.cjs +21 -7
  20. package/dist/command/options/defaults/boolean.d.ts +6 -3
  21. package/dist/command/options/defaults/boolean.mjs +20 -8
  22. package/dist/command/options/defaults/simple.d.ts +6 -4
  23. package/dist/command/types/forbiddenInvalidIdentifier.d.ts +6 -0
  24. package/dist/command/types/index.d.ts +1 -0
  25. package/dist/common/environmentVariable/index.d.ts +1 -1
  26. package/dist/common/environmentVariable/overrideEnvironmentVariables.d.ts +1 -1
  27. package/dist/common/environmentVariable/parseEnvironmentFiles.d.ts +2 -1
  28. package/dist/common/index.cjs +3 -0
  29. package/dist/common/index.d.ts +1 -0
  30. package/dist/common/index.mjs +3 -1
  31. package/dist/common/meta/getCurrentDirectoryName.cjs +10 -0
  32. package/dist/common/meta/getCurrentDirectoryName.d.ts +7 -0
  33. package/dist/common/meta/getCurrentDirectoryName.mjs +7 -0
  34. package/dist/common/meta/index.d.ts +7 -0
  35. package/dist/dataStructure/common/codec/defaults/json.cjs +12 -1
  36. package/dist/dataStructure/common/codec/defaults/json.d.ts +2 -2
  37. package/dist/dataStructure/common/codec/defaults/json.mjs +12 -1
  38. package/dist/dataStructure/common/codec/defaults/string.cjs +12 -1
  39. package/dist/dataStructure/common/codec/defaults/string.d.ts +2 -2
  40. package/dist/dataStructure/common/codec/defaults/string.mjs +12 -1
  41. package/dist/dataStructure/common/error/defaultInterpreter.cjs +3 -1
  42. package/dist/dataStructure/common/error/defaultInterpreter.d.ts +7 -2
  43. package/dist/dataStructure/common/error/defaultInterpreter.mjs +3 -1
  44. package/dist/dataStructure/constraint/{exist.cjs → fileExist.cjs} +5 -5
  45. package/dist/dataStructure/constraint/fileExist.d.ts +10 -0
  46. package/dist/dataStructure/constraint/{exist.mjs → fileExist.mjs} +4 -4
  47. package/dist/dataStructure/constraint/folderExist.cjs +19 -0
  48. package/dist/dataStructure/constraint/folderExist.d.ts +10 -0
  49. package/dist/dataStructure/constraint/folderExist.mjs +15 -0
  50. package/dist/dataStructure/constraint/index.d.ts +2 -1
  51. package/dist/dataStructure/constraint/mimeType.cjs +1 -1
  52. package/dist/dataStructure/constraint/mimeType.mjs +1 -1
  53. package/dist/dataStructure/constraint/types/constraints.d.ts +4 -2
  54. package/dist/dataStructure/fundamentalType/folder.cjs +11 -0
  55. package/dist/dataStructure/fundamentalType/folder.d.ts +8 -0
  56. package/dist/dataStructure/fundamentalType/folder.mjs +8 -0
  57. package/dist/dataStructure/fundamentalType/index.d.ts +1 -0
  58. package/dist/dataStructure/fundamentalType/types/fundamentalTypes.d.ts +2 -0
  59. package/dist/dataStructure/helper/file.d.ts +1 -1
  60. package/dist/dataStructure/helper/fileExist.cjs +7 -0
  61. package/dist/dataStructure/helper/fileExist.d.ts +2 -0
  62. package/dist/dataStructure/helper/fileExist.mjs +7 -0
  63. package/dist/dataStructure/helper/folder.cjs +10 -0
  64. package/dist/dataStructure/helper/folder.d.ts +3 -0
  65. package/dist/dataStructure/helper/folder.mjs +8 -0
  66. package/dist/dataStructure/helper/folderExist.cjs +7 -0
  67. package/dist/dataStructure/helper/folderExist.d.ts +2 -0
  68. package/dist/dataStructure/helper/folderExist.mjs +7 -0
  69. package/dist/dataStructure/helper/index.d.ts +3 -1
  70. package/dist/dataStructure/index.cjs +29 -8
  71. package/dist/dataStructure/index.mjs +19 -6
  72. package/dist/dataStructure/type/folder.cjs +14 -0
  73. package/dist/dataStructure/type/folder.d.ts +11 -0
  74. package/dist/dataStructure/type/folder.mjs +11 -0
  75. package/dist/dataStructure/type/index.d.ts +1 -0
  76. package/dist/dataStructure/type/types/types.d.ts +2 -0
  77. package/dist/file/appendFile.cjs +46 -22
  78. package/dist/file/appendFile.d.ts +37 -5
  79. package/dist/file/appendFile.mjs +36 -23
  80. package/dist/file/appendTextFile.cjs +44 -20
  81. package/dist/file/appendTextFile.d.ts +37 -5
  82. package/dist/file/appendTextFile.mjs +34 -21
  83. package/dist/file/copy.cjs +36 -14
  84. package/dist/file/copy.d.ts +37 -5
  85. package/dist/file/copy.mjs +26 -15
  86. package/dist/file/createEntryInterface.cjs +6 -3
  87. package/dist/file/createEntryInterface.d.ts +1 -1
  88. package/dist/file/createEntryInterface.mjs +4 -2
  89. package/dist/file/ensureDirectory.cjs +37 -17
  90. package/dist/file/ensureDirectory.d.ts +30 -4
  91. package/dist/file/ensureDirectory.mjs +29 -18
  92. package/dist/file/ensureFile.cjs +41 -19
  93. package/dist/file/ensureFile.d.ts +33 -4
  94. package/dist/file/ensureFile.mjs +32 -20
  95. package/dist/file/exists.cjs +28 -14
  96. package/dist/file/exists.d.ts +21 -4
  97. package/dist/file/exists.mjs +23 -15
  98. package/dist/file/fileInterface.cjs +3 -1
  99. package/dist/file/fileInterface.d.ts +10 -9
  100. package/dist/file/fileInterface.mjs +3 -2
  101. package/dist/file/folderInterface.cjs +3 -1
  102. package/dist/file/folderInterface.d.ts +9 -8
  103. package/dist/file/folderInterface.mjs +3 -2
  104. package/dist/file/index.cjs +512 -0
  105. package/dist/file/index.d.ts +0 -1
  106. package/dist/file/index.mjs +291 -35
  107. package/dist/file/link.cjs +48 -22
  108. package/dist/file/link.d.ts +40 -5
  109. package/dist/file/link.mjs +37 -23
  110. package/dist/file/linkStat.cjs +29 -15
  111. package/dist/file/linkStat.d.ts +24 -4
  112. package/dist/file/linkStat.mjs +24 -16
  113. package/dist/file/makeDirectory.cjs +45 -21
  114. package/dist/file/makeDirectory.d.ts +35 -4
  115. package/dist/file/makeDirectory.mjs +35 -22
  116. package/dist/file/makeTemporaryDirectory.cjs +33 -15
  117. package/dist/file/makeTemporaryDirectory.d.ts +25 -2
  118. package/dist/file/makeTemporaryDirectory.mjs +26 -16
  119. package/dist/file/makeTemporaryFile.cjs +37 -20
  120. package/dist/file/makeTemporaryFile.d.ts +28 -2
  121. package/dist/file/makeTemporaryFile.mjs +30 -21
  122. package/dist/file/move.cjs +49 -23
  123. package/dist/file/move.d.ts +40 -5
  124. package/dist/file/move.mjs +38 -24
  125. package/dist/file/readDirectory.cjs +33 -9
  126. package/dist/file/readDirectory.d.ts +26 -5
  127. package/dist/file/readDirectory.mjs +25 -10
  128. package/dist/file/readFile.cjs +35 -17
  129. package/dist/file/readFile.d.ts +27 -4
  130. package/dist/file/readFile.mjs +28 -18
  131. package/dist/file/readJsonFile.cjs +35 -17
  132. package/dist/file/readJsonFile.d.ts +27 -5
  133. package/dist/file/readJsonFile.mjs +28 -18
  134. package/dist/file/readLink.cjs +31 -15
  135. package/dist/file/readLink.d.ts +24 -4
  136. package/dist/file/readLink.mjs +25 -16
  137. package/dist/file/readTextFile.cjs +35 -17
  138. package/dist/file/readTextFile.d.ts +27 -4
  139. package/dist/file/readTextFile.mjs +28 -18
  140. package/dist/file/realPath.cjs +27 -13
  141. package/dist/file/realPath.d.ts +21 -4
  142. package/dist/file/realPath.mjs +22 -14
  143. package/dist/file/relocate.cjs +52 -25
  144. package/dist/file/relocate.d.ts +40 -5
  145. package/dist/file/relocate.mjs +41 -26
  146. package/dist/file/remove.cjs +45 -23
  147. package/dist/file/remove.d.ts +32 -4
  148. package/dist/file/remove.mjs +36 -24
  149. package/dist/file/rename.cjs +52 -25
  150. package/dist/file/rename.d.ts +40 -5
  151. package/dist/file/rename.mjs +41 -26
  152. package/dist/file/setMode.cjs +29 -15
  153. package/dist/file/setMode.d.ts +24 -5
  154. package/dist/file/setMode.mjs +24 -16
  155. package/dist/file/setOwner.cjs +31 -15
  156. package/dist/file/setOwner.d.ts +25 -5
  157. package/dist/file/setOwner.mjs +25 -16
  158. package/dist/file/setTime.cjs +31 -15
  159. package/dist/file/setTime.d.ts +24 -5
  160. package/dist/file/setTime.mjs +25 -16
  161. package/dist/file/stat.cjs +29 -15
  162. package/dist/file/stat.d.ts +24 -4
  163. package/dist/file/stat.mjs +24 -16
  164. package/dist/file/symlink.cjs +42 -20
  165. package/dist/file/symlink.d.ts +34 -5
  166. package/dist/file/symlink.mjs +33 -21
  167. package/dist/file/truncate.cjs +43 -21
  168. package/dist/file/truncate.d.ts +36 -4
  169. package/dist/file/truncate.mjs +34 -22
  170. package/dist/file/unknownEntryInterface.cjs +5 -1
  171. package/dist/file/unknownEntryInterface.d.ts +8 -6
  172. package/dist/file/unknownEntryInterface.mjs +4 -2
  173. package/dist/file/walkDirectory.cjs +38 -15
  174. package/dist/file/walkDirectory.d.ts +25 -4
  175. package/dist/file/walkDirectory.mjs +32 -15
  176. package/dist/file/writeFile.cjs +45 -21
  177. package/dist/file/writeFile.d.ts +37 -5
  178. package/dist/file/writeFile.mjs +35 -22
  179. package/dist/file/writeJsonFile.cjs +48 -27
  180. package/dist/file/writeJsonFile.d.ts +37 -6
  181. package/dist/file/writeJsonFile.mjs +39 -28
  182. package/dist/file/writeTextFile.cjs +45 -21
  183. package/dist/file/writeTextFile.d.ts +37 -5
  184. package/dist/file/writeTextFile.mjs +35 -22
  185. package/dist/implementor.cjs +8 -5
  186. package/dist/implementor.d.ts +4 -4
  187. package/dist/implementor.mjs +8 -5
  188. package/dist/index.cjs +2 -0
  189. package/dist/index.mjs +2 -1
  190. package/dist/override.d.ts +8 -0
  191. package/package.json +4 -4
  192. package/dist/dataStructure/constraint/exist.d.ts +0 -10
  193. package/dist/dataStructure/helper/exist.cjs +0 -7
  194. package/dist/dataStructure/helper/exist.d.ts +0 -2
  195. package/dist/dataStructure/helper/exist.mjs +0 -7
  196. package/dist/file/types/fileSystemEither.d.ts +0 -2
  197. package/dist/file/types/index.d.ts +0 -1
  198. /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: string & DPath.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(): (string & DPath.Path) | null;
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: string & DPath.Path): Promise<FileInterfaceRelocateResult>;
22
- move(newPath: string & DPath.Path): Promise<FileInterfaceMoveResult>;
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(path: string & DPath.Path): FileInterface;
29
- export declare function isFileInterface(input: unknown): input is FileInterface;
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: string & DPath.Path;
18
- getName(): (string & DPath.Segment) | null;
19
- getParentPath(): (string & DPath.Path) | null;
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: string & DPath.Path): Promise<FolderInterfaceRelocateResult>;
23
- move(newPath: string & DPath.Path): Promise<FolderInterfaceMoveResult>;
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(path: string & DPath.Path): FolderInterface;
31
- export declare function isFolderInterface(input: unknown): input is FolderInterface;
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 };