@duplojs/server 0.0.0-stage → 0.1.0-beta.10

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 (280) hide show
  1. package/README.md +8 -2
  2. package/dist/_virtual/_rolldown/runtime.cjs +33 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +17 -0
  4. package/dist/command/argument.cjs +27 -0
  5. package/dist/command/argument.d.ts +18 -0
  6. package/dist/command/argument.mjs +24 -0
  7. package/dist/command/create.cjs +102 -0
  8. package/dist/command/create.d.ts +47 -0
  9. package/dist/command/create.mjs +96 -0
  10. package/dist/command/error.cjs +206 -0
  11. package/dist/command/error.d.ts +61 -0
  12. package/dist/command/error.mjs +193 -0
  13. package/dist/command/exec.cjs +19 -0
  14. package/dist/command/exec.d.ts +14 -0
  15. package/dist/command/exec.mjs +17 -0
  16. package/dist/command/execOptions.cjs +41 -0
  17. package/dist/command/execOptions.d.ts +14 -0
  18. package/dist/command/execOptions.mjs +37 -0
  19. package/dist/command/help.cjs +250 -0
  20. package/dist/command/help.d.ts +10 -0
  21. package/dist/command/help.mjs +237 -0
  22. package/dist/command/index.cjs +82 -0
  23. package/dist/command/index.d.ts +8 -0
  24. package/dist/command/index.mjs +47 -0
  25. package/dist/command/kind.cjs +7 -0
  26. package/dist/command/kind.d.ts +2 -0
  27. package/dist/command/kind.mjs +5 -0
  28. package/dist/command/options/base.cjs +76 -0
  29. package/dist/command/options/base.d.ts +30 -0
  30. package/dist/command/options/base.mjs +69 -0
  31. package/dist/command/options/defaults/array.cjs +35 -0
  32. package/dist/command/options/defaults/array.d.ts +26 -0
  33. package/dist/command/options/defaults/array.mjs +29 -0
  34. package/dist/command/options/defaults/boolean.cjs +28 -0
  35. package/dist/command/options/defaults/boolean.d.ts +14 -0
  36. package/dist/command/options/defaults/boolean.mjs +25 -0
  37. package/dist/command/options/defaults/index.d.ts +3 -0
  38. package/dist/command/options/defaults/simple.cjs +25 -0
  39. package/dist/command/options/defaults/simple.d.ts +18 -0
  40. package/dist/command/options/defaults/simple.mjs +22 -0
  41. package/dist/command/options/identifier.cjs +7 -0
  42. package/dist/command/options/identifier.d.ts +4 -0
  43. package/dist/command/options/identifier.mjs +5 -0
  44. package/dist/command/options/index.d.ts +4 -0
  45. package/dist/command/options/types/index.d.ts +1 -0
  46. package/dist/command/options/types/options.d.ts +9 -0
  47. package/dist/command/types/eligibleType.d.ts +4 -0
  48. package/dist/command/types/forbiddenDuplicateName.d.ts +11 -0
  49. package/dist/command/types/forbiddenInvalidIdentifier.d.ts +6 -0
  50. package/dist/command/types/index.d.ts +3 -0
  51. package/dist/common/environmentVariable/expandEnvironmentVariables.cjs +27 -0
  52. package/dist/common/environmentVariable/expandEnvironmentVariables.d.ts +2 -0
  53. package/dist/common/environmentVariable/expandEnvironmentVariables.mjs +22 -0
  54. package/dist/common/environmentVariable/index.cjs +47 -0
  55. package/dist/common/environmentVariable/index.d.ts +16 -0
  56. package/dist/common/environmentVariable/index.mjs +41 -0
  57. package/dist/common/environmentVariable/overrideEnvironmentVariables.cjs +13 -0
  58. package/dist/common/environmentVariable/overrideEnvironmentVariables.d.ts +3 -0
  59. package/dist/common/environmentVariable/overrideEnvironmentVariables.mjs +9 -0
  60. package/dist/common/environmentVariable/parseEnvironmentFiles.cjs +32 -0
  61. package/dist/common/environmentVariable/parseEnvironmentFiles.d.ts +5 -0
  62. package/dist/common/environmentVariable/parseEnvironmentFiles.mjs +26 -0
  63. package/dist/common/environmentVariableOrThrow.cjs +23 -0
  64. package/dist/common/environmentVariableOrThrow.d.ts +12 -0
  65. package/dist/common/environmentVariableOrThrow.mjs +19 -0
  66. package/dist/common/exitProcess.cjs +7 -0
  67. package/dist/common/exitProcess.d.ts +6 -0
  68. package/dist/common/exitProcess.mjs +8 -0
  69. package/dist/common/getCurrentWorkDirectory.cjs +15 -0
  70. package/dist/common/getCurrentWorkDirectory.d.ts +8 -0
  71. package/dist/common/getCurrentWorkDirectory.mjs +11 -0
  72. package/dist/common/getCurrentWorkDirectoryOrThrow.cjs +25 -0
  73. package/dist/common/getCurrentWorkDirectoryOrThrow.d.ts +8 -0
  74. package/dist/common/getCurrentWorkDirectoryOrThrow.mjs +20 -0
  75. package/dist/common/getProcessArguments.cjs +18 -0
  76. package/dist/common/getProcessArguments.d.ts +6 -0
  77. package/dist/common/getProcessArguments.mjs +18 -0
  78. package/dist/common/index.cjs +44 -0
  79. package/dist/common/index.d.ts +9 -0
  80. package/dist/common/index.mjs +27 -0
  81. package/dist/common/meta/getCurrentDirectoryName.cjs +10 -0
  82. package/dist/common/meta/getCurrentDirectoryName.d.ts +7 -0
  83. package/dist/common/meta/getCurrentDirectoryName.mjs +7 -0
  84. package/dist/common/meta/index.d.ts +7 -0
  85. package/dist/common/setCurrentWorkingDirectory.cjs +11 -0
  86. package/dist/common/setCurrentWorkingDirectory.d.ts +8 -0
  87. package/dist/common/setCurrentWorkingDirectory.mjs +9 -0
  88. package/dist/common/setCurrentWorkingDirectoryOrThrow.cjs +23 -0
  89. package/dist/common/setCurrentWorkingDirectoryOrThrow.d.ts +8 -0
  90. package/dist/common/setCurrentWorkingDirectoryOrThrow.mjs +18 -0
  91. package/dist/dataStructure/common/codec/defaults/index.d.ts +2 -0
  92. package/dist/dataStructure/common/codec/defaults/json.cjs +25 -0
  93. package/dist/dataStructure/common/codec/defaults/json.d.ts +9 -0
  94. package/dist/dataStructure/common/codec/defaults/json.mjs +22 -0
  95. package/dist/dataStructure/common/codec/defaults/string.cjs +25 -0
  96. package/dist/dataStructure/common/codec/defaults/string.d.ts +13 -0
  97. package/dist/dataStructure/common/codec/defaults/string.mjs +22 -0
  98. package/dist/dataStructure/common/codec/index.d.ts +1 -0
  99. package/dist/dataStructure/common/error/defaultInterpreter.cjs +29 -0
  100. package/dist/dataStructure/common/error/defaultInterpreter.d.ts +69 -0
  101. package/dist/dataStructure/common/error/defaultInterpreter.mjs +26 -0
  102. package/dist/dataStructure/common/error/index.d.ts +1 -0
  103. package/dist/dataStructure/common/index.d.ts +2 -0
  104. package/dist/dataStructure/constraint/fileExist.cjs +19 -0
  105. package/dist/dataStructure/constraint/fileExist.d.ts +10 -0
  106. package/dist/dataStructure/constraint/fileExist.mjs +15 -0
  107. package/dist/dataStructure/constraint/folderExist.cjs +19 -0
  108. package/dist/dataStructure/constraint/folderExist.d.ts +10 -0
  109. package/dist/dataStructure/constraint/folderExist.mjs +15 -0
  110. package/dist/dataStructure/constraint/index.d.ts +5 -0
  111. package/dist/dataStructure/constraint/mimeType.cjs +18 -0
  112. package/dist/dataStructure/constraint/mimeType.d.ts +11 -0
  113. package/dist/dataStructure/constraint/mimeType.mjs +14 -0
  114. package/dist/dataStructure/constraint/size.cjs +29 -0
  115. package/dist/dataStructure/constraint/size.d.ts +16 -0
  116. package/dist/dataStructure/constraint/size.mjs +24 -0
  117. package/dist/dataStructure/constraint/types/constraints.d.ts +12 -0
  118. package/dist/dataStructure/constraint/types/index.d.ts +1 -0
  119. package/dist/dataStructure/fundamentalType/file.cjs +11 -0
  120. package/dist/dataStructure/fundamentalType/file.d.ts +8 -0
  121. package/dist/dataStructure/fundamentalType/file.mjs +8 -0
  122. package/dist/dataStructure/fundamentalType/folder.cjs +11 -0
  123. package/dist/dataStructure/fundamentalType/folder.d.ts +8 -0
  124. package/dist/dataStructure/fundamentalType/folder.mjs +8 -0
  125. package/dist/dataStructure/fundamentalType/index.d.ts +3 -0
  126. package/dist/dataStructure/fundamentalType/types/fundamentalTypes.d.ts +8 -0
  127. package/dist/dataStructure/fundamentalType/types/index.d.ts +1 -0
  128. package/dist/dataStructure/helper/file.cjs +10 -0
  129. package/dist/dataStructure/helper/file.d.ts +3 -0
  130. package/dist/dataStructure/helper/file.mjs +8 -0
  131. package/dist/dataStructure/helper/fileExist.cjs +7 -0
  132. package/dist/dataStructure/helper/fileExist.d.ts +2 -0
  133. package/dist/dataStructure/helper/fileExist.mjs +7 -0
  134. package/dist/dataStructure/helper/folder.cjs +10 -0
  135. package/dist/dataStructure/helper/folder.d.ts +3 -0
  136. package/dist/dataStructure/helper/folder.mjs +8 -0
  137. package/dist/dataStructure/helper/folderExist.cjs +7 -0
  138. package/dist/dataStructure/helper/folderExist.d.ts +2 -0
  139. package/dist/dataStructure/helper/folderExist.mjs +7 -0
  140. package/dist/dataStructure/helper/index.d.ts +6 -0
  141. package/dist/dataStructure/helper/mimeType.cjs +7 -0
  142. package/dist/dataStructure/helper/mimeType.d.ts +2 -0
  143. package/dist/dataStructure/helper/mimeType.mjs +7 -0
  144. package/dist/dataStructure/helper/size.cjs +7 -0
  145. package/dist/dataStructure/helper/size.d.ts +2 -0
  146. package/dist/dataStructure/helper/size.mjs +7 -0
  147. package/dist/dataStructure/index.cjs +83 -0
  148. package/dist/dataStructure/index.d.ts +6 -0
  149. package/dist/dataStructure/index.mjs +51 -0
  150. package/dist/dataStructure/kind.cjs +7 -0
  151. package/dist/dataStructure/kind.d.ts +2 -0
  152. package/dist/dataStructure/kind.mjs +5 -0
  153. package/dist/dataStructure/type/file.cjs +14 -0
  154. package/dist/dataStructure/type/file.d.ts +11 -0
  155. package/dist/dataStructure/type/file.mjs +11 -0
  156. package/dist/dataStructure/type/folder.cjs +14 -0
  157. package/dist/dataStructure/type/folder.d.ts +11 -0
  158. package/dist/dataStructure/type/folder.mjs +11 -0
  159. package/dist/dataStructure/type/index.d.ts +3 -0
  160. package/dist/dataStructure/type/types/index.d.ts +1 -0
  161. package/dist/dataStructure/type/types/types.d.ts +8 -0
  162. package/dist/file/appendFile.cjs +67 -0
  163. package/dist/file/appendFile.d.ts +43 -0
  164. package/dist/file/appendFile.mjs +54 -0
  165. package/dist/file/appendTextFile.cjs +67 -0
  166. package/dist/file/appendTextFile.d.ts +43 -0
  167. package/dist/file/appendTextFile.mjs +54 -0
  168. package/dist/file/copy.cjs +53 -0
  169. package/dist/file/copy.d.ts +43 -0
  170. package/dist/file/copy.mjs +40 -0
  171. package/dist/file/createEntryInterface.cjs +19 -0
  172. package/dist/file/createEntryInterface.d.ts +3 -0
  173. package/dist/file/createEntryInterface.mjs +15 -0
  174. package/dist/file/ensureDirectory.cjs +52 -0
  175. package/dist/file/ensureDirectory.d.ts +36 -0
  176. package/dist/file/ensureDirectory.mjs +41 -0
  177. package/dist/file/ensureFile.cjs +60 -0
  178. package/dist/file/ensureFile.d.ts +39 -0
  179. package/dist/file/ensureFile.mjs +48 -0
  180. package/dist/file/exists.cjs +43 -0
  181. package/dist/file/exists.d.ts +27 -0
  182. package/dist/file/exists.mjs +35 -0
  183. package/dist/file/fileInterface.cjs +76 -0
  184. package/dist/file/fileInterface.d.ts +31 -0
  185. package/dist/file/fileInterface.mjs +70 -0
  186. package/dist/file/folderInterface.cjs +76 -0
  187. package/dist/file/folderInterface.d.ts +33 -0
  188. package/dist/file/folderInterface.mjs +70 -0
  189. package/dist/file/index.cjs +634 -0
  190. package/dist/file/index.d.ts +35 -0
  191. package/dist/file/index.mjs +335 -0
  192. package/dist/file/link.cjs +70 -0
  193. package/dist/file/link.d.ts +46 -0
  194. package/dist/file/link.mjs +56 -0
  195. package/dist/file/linkStat.cjs +98 -0
  196. package/dist/file/linkStat.d.ts +31 -0
  197. package/dist/file/linkStat.mjs +88 -0
  198. package/dist/file/makeDirectory.cjs +60 -0
  199. package/dist/file/makeDirectory.d.ts +45 -0
  200. package/dist/file/makeDirectory.mjs +47 -0
  201. package/dist/file/makeTemporaryDirectory.cjs +48 -0
  202. package/dist/file/makeTemporaryDirectory.d.ts +32 -0
  203. package/dist/file/makeTemporaryDirectory.mjs +38 -0
  204. package/dist/file/makeTemporaryFile.cjs +62 -0
  205. package/dist/file/makeTemporaryFile.d.ts +36 -0
  206. package/dist/file/makeTemporaryFile.mjs +50 -0
  207. package/dist/file/move.cjs +71 -0
  208. package/dist/file/move.d.ts +46 -0
  209. package/dist/file/move.mjs +57 -0
  210. package/dist/file/readDirectory.cjs +44 -0
  211. package/dist/file/readDirectory.d.ts +35 -0
  212. package/dist/file/readDirectory.mjs +33 -0
  213. package/dist/file/readFile.cjs +51 -0
  214. package/dist/file/readFile.d.ts +33 -0
  215. package/dist/file/readFile.mjs +41 -0
  216. package/dist/file/readJsonFile.cjs +51 -0
  217. package/dist/file/readJsonFile.d.ts +33 -0
  218. package/dist/file/readJsonFile.mjs +41 -0
  219. package/dist/file/readLink.cjs +46 -0
  220. package/dist/file/readLink.d.ts +30 -0
  221. package/dist/file/readLink.mjs +37 -0
  222. package/dist/file/readTextFile.cjs +51 -0
  223. package/dist/file/readTextFile.d.ts +33 -0
  224. package/dist/file/readTextFile.mjs +41 -0
  225. package/dist/file/realPath.cjs +42 -0
  226. package/dist/file/realPath.d.ts +27 -0
  227. package/dist/file/realPath.mjs +34 -0
  228. package/dist/file/relocate.cjs +83 -0
  229. package/dist/file/relocate.d.ts +46 -0
  230. package/dist/file/relocate.mjs +68 -0
  231. package/dist/file/remove.cjs +60 -0
  232. package/dist/file/remove.d.ts +42 -0
  233. package/dist/file/remove.mjs +48 -0
  234. package/dist/file/rename.cjs +83 -0
  235. package/dist/file/rename.d.ts +46 -0
  236. package/dist/file/rename.mjs +68 -0
  237. package/dist/file/setMode.cjs +65 -0
  238. package/dist/file/setMode.d.ts +45 -0
  239. package/dist/file/setMode.mjs +56 -0
  240. package/dist/file/setOwner.cjs +53 -0
  241. package/dist/file/setOwner.d.ts +35 -0
  242. package/dist/file/setOwner.mjs +44 -0
  243. package/dist/file/setTime.cjs +55 -0
  244. package/dist/file/setTime.d.ts +36 -0
  245. package/dist/file/setTime.mjs +45 -0
  246. package/dist/file/stat.cjs +99 -0
  247. package/dist/file/stat.d.ts +62 -0
  248. package/dist/file/stat.mjs +89 -0
  249. package/dist/file/symlink.cjs +64 -0
  250. package/dist/file/symlink.d.ts +48 -0
  251. package/dist/file/symlink.mjs +52 -0
  252. package/dist/file/truncate.cjs +60 -0
  253. package/dist/file/truncate.d.ts +42 -0
  254. package/dist/file/truncate.mjs +47 -0
  255. package/dist/file/unknownEntryInterface.cjs +40 -0
  256. package/dist/file/unknownEntryInterface.d.ts +17 -0
  257. package/dist/file/unknownEntryInterface.mjs +35 -0
  258. package/dist/file/walkDirectory.cjs +57 -0
  259. package/dist/file/walkDirectory.d.ts +37 -0
  260. package/dist/file/walkDirectory.mjs +45 -0
  261. package/dist/file/writeFile.cjs +68 -0
  262. package/dist/file/writeFile.d.ts +43 -0
  263. package/dist/file/writeFile.mjs +55 -0
  264. package/dist/file/writeJsonFile.cjs +77 -0
  265. package/dist/file/writeJsonFile.d.ts +46 -0
  266. package/dist/file/writeJsonFile.mjs +64 -0
  267. package/dist/file/writeTextFile.cjs +68 -0
  268. package/dist/file/writeTextFile.d.ts +43 -0
  269. package/dist/file/writeTextFile.mjs +55 -0
  270. package/dist/implementor.cjs +67 -0
  271. package/dist/implementor.d.ts +35 -0
  272. package/dist/implementor.mjs +55 -0
  273. package/dist/index.cjs +76 -0
  274. package/dist/index.d.ts +9 -0
  275. package/dist/index.mjs +15 -0
  276. package/dist/kind.cjs +7 -0
  277. package/dist/kind.d.ts +2 -0
  278. package/dist/kind.mjs +5 -0
  279. package/dist/override.d.ts +8 -0
  280. package/package.json +81 -3
@@ -0,0 +1,33 @@
1
+ import * as DCommon from "@duplojs/lang/common";
2
+ import * as DEither from "@duplojs/lang/either";
3
+ import type * as DPath from "@duplojs/lang/path";
4
+ declare const ReadJsonFileErrorNotFound_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-json-file-not-found", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-read-json-file-not-found", unknown>>, unknown>;
5
+ export declare class ReadJsonFileErrorNotFound extends ReadJsonFileErrorNotFound_base {
6
+ }
7
+ declare const ReadJsonFileErrorPermissionDenied_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-json-file-permission-denied", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-read-json-file-permission-denied", unknown>>, unknown>;
8
+ export declare class ReadJsonFileErrorPermissionDenied extends ReadJsonFileErrorPermissionDenied_base {
9
+ }
10
+ declare const ReadJsonFileErrorIsDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-json-file-is-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-read-json-file-is-directory", unknown>>, unknown>;
11
+ export declare class ReadJsonFileErrorIsDirectory extends ReadJsonFileErrorIsDirectory_base {
12
+ }
13
+ declare const ReadJsonFileErrorNotDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-json-file-not-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-read-json-file-not-directory", unknown>>, unknown>;
14
+ export declare class ReadJsonFileErrorNotDirectory extends ReadJsonFileErrorNotDirectory_base {
15
+ }
16
+ declare const ReadJsonFileErrorTooManyOpenFiles_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-json-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-read-json-file-too-many-open-files", unknown>>, unknown>;
17
+ export declare class ReadJsonFileErrorTooManyOpenFiles extends ReadJsonFileErrorTooManyOpenFiles_base {
18
+ }
19
+ declare const ReadJsonFileErrorBusy_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-json-file-busy", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-read-json-file-busy", unknown>>, unknown>;
20
+ export declare class ReadJsonFileErrorBusy extends ReadJsonFileErrorBusy_base {
21
+ }
22
+ declare const ReadJsonFileError_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-json-file-error", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-read-json-file-error", unknown>>, unknown>;
23
+ export declare class ReadJsonFileError extends ReadJsonFileError_base {
24
+ }
25
+ export type ReadJsonFileErrors = (ReadJsonFileErrorNotFound | ReadJsonFileErrorPermissionDenied | ReadJsonFileErrorIsDirectory | ReadJsonFileErrorNotDirectory | ReadJsonFileErrorTooManyOpenFiles | ReadJsonFileErrorBusy | ReadJsonFileError);
26
+ export type ReadJsonFileResult = (DEither.Right<"file-system-read-json-file", DCommon.Json> | DEither.Left<"file-system-read-json-file-error", ReadJsonFileErrors>);
27
+ declare module '../implementor' {
28
+ interface ServerFunction {
29
+ readJsonFile(path: DPath.AnyPath): Promise<ReadJsonFileResult>;
30
+ }
31
+ }
32
+ export declare const readJsonFile: (path: DPath.AnyPath) => Promise<ReadJsonFileResult>;
33
+ export {};
@@ -0,0 +1,41 @@
1
+ import { implementFunction, nodeFileSystem } from "../implementor.mjs";
2
+ import * as DCommon from "@duplojs/lang/common";
3
+ import * as DEither from "@duplojs/lang/either";
4
+ //#region scripts/file/readJsonFile.ts
5
+ var ReadJsonFileErrorNotFound = class extends DCommon.DuploJSError.parentClass("file-system-read-json-file-not-found", Error) {};
6
+ var ReadJsonFileErrorPermissionDenied = class extends DCommon.DuploJSError.parentClass("file-system-read-json-file-permission-denied", Error) {};
7
+ var ReadJsonFileErrorIsDirectory = class extends DCommon.DuploJSError.parentClass("file-system-read-json-file-is-directory", Error) {};
8
+ var ReadJsonFileErrorNotDirectory = class extends DCommon.DuploJSError.parentClass("file-system-read-json-file-not-directory", Error) {};
9
+ var ReadJsonFileErrorTooManyOpenFiles = class extends DCommon.DuploJSError.parentClass("file-system-read-json-file-too-many-open-files", Error) {};
10
+ var ReadJsonFileErrorBusy = class extends DCommon.DuploJSError.parentClass("file-system-read-json-file-busy", Error) {};
11
+ var ReadJsonFileError = class extends DCommon.DuploJSError.parentClass("file-system-read-json-file-error", Error) {};
12
+ function handleNodeReadJsonFileError(error) {
13
+ let readJsonFileError = void 0;
14
+ if ("code" in error) {
15
+ if (error.code === "ENOENT") readJsonFileError = new ReadJsonFileErrorNotFound(error);
16
+ else if (error.code === "EACCES" || error.code === "EPERM") readJsonFileError = new ReadJsonFileErrorPermissionDenied(error);
17
+ else if (error.code === "EISDIR") readJsonFileError = new ReadJsonFileErrorIsDirectory(error);
18
+ else if (error.code === "ENOTDIR") readJsonFileError = new ReadJsonFileErrorNotDirectory(error);
19
+ else if (error.code === "EMFILE" || error.code === "ENFILE") readJsonFileError = new ReadJsonFileErrorTooManyOpenFiles(error);
20
+ else if (error.code === "EBUSY") readJsonFileError = new ReadJsonFileErrorBusy(error);
21
+ }
22
+ if (readJsonFileError === void 0) readJsonFileError = new ReadJsonFileError(error);
23
+ return DEither.left("file-system-read-json-file-error", readJsonFileError);
24
+ }
25
+ function handleDenoReadJsonFileError(error) {
26
+ let readJsonFileError = void 0;
27
+ if (error instanceof Deno.errors.NotFound) readJsonFileError = new ReadJsonFileErrorNotFound(error);
28
+ else if (error instanceof Deno.errors.PermissionDenied || error instanceof Deno.errors.NotCapable) readJsonFileError = new ReadJsonFileErrorPermissionDenied(error);
29
+ else if (error instanceof Deno.errors.IsADirectory) readJsonFileError = new ReadJsonFileErrorIsDirectory(error);
30
+ else if (error instanceof Deno.errors.NotADirectory) readJsonFileError = new ReadJsonFileErrorNotDirectory(error);
31
+ else if (error instanceof Deno.errors.Busy) readJsonFileError = new ReadJsonFileErrorBusy(error);
32
+ if (readJsonFileError === void 0) readJsonFileError = new ReadJsonFileError(error);
33
+ return DEither.left("file-system-read-json-file-error", readJsonFileError);
34
+ }
35
+ const readJsonFile = implementFunction("readJsonFile", {
36
+ NODE: async (path) => nodeFileSystem.value.readFile(path, { encoding: "utf-8" }).then(JSON.parse).then((value) => DEither.right("file-system-read-json-file", value)).catch(handleNodeReadJsonFileError),
37
+ DENO: (path) => Deno.readTextFile(path).then(JSON.parse).then((value) => DEither.right("file-system-read-json-file", value)).catch(handleDenoReadJsonFileError),
38
+ BUN: (path) => Bun.file(path).text().then(JSON.parse).then((value) => DEither.right("file-system-read-json-file", value)).catch(handleNodeReadJsonFileError)
39
+ });
40
+ //#endregion
41
+ export { ReadJsonFileError, ReadJsonFileErrorBusy, ReadJsonFileErrorIsDirectory, ReadJsonFileErrorNotDirectory, ReadJsonFileErrorNotFound, ReadJsonFileErrorPermissionDenied, ReadJsonFileErrorTooManyOpenFiles, readJsonFile };
@@ -0,0 +1,46 @@
1
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
2
+ const require_implementor = require("../implementor.cjs");
3
+ let _duplojs_lang_common = require("@duplojs/lang/common");
4
+ _duplojs_lang_common = require_runtime.__toESM(_duplojs_lang_common, 1);
5
+ let _duplojs_lang_either = require("@duplojs/lang/either");
6
+ _duplojs_lang_either = require_runtime.__toESM(_duplojs_lang_either, 1);
7
+ //#region scripts/file/readLink.ts
8
+ var ReadLinkErrorNotFound = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-read-link-not-found", Error) {};
9
+ var ReadLinkErrorPermissionDenied = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-read-link-permission-denied", Error) {};
10
+ var ReadLinkErrorInvalidArgument = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-read-link-invalid-argument", Error) {};
11
+ var ReadLinkErrorNotDirectory = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-read-link-not-directory", Error) {};
12
+ var ReadLinkErrorTooManyOpenFiles = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-read-link-too-many-open-files", Error) {};
13
+ var ReadLinkError = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-read-link-error", Error) {};
14
+ function handleNodeReadLinkError(error) {
15
+ let readLinkError = void 0;
16
+ if ("code" in error) {
17
+ if (error.code === "ENOENT") readLinkError = new ReadLinkErrorNotFound(error);
18
+ else if (error.code === "EACCES" || error.code === "EPERM") readLinkError = new ReadLinkErrorPermissionDenied(error);
19
+ else if (error.code === "EINVAL") readLinkError = new ReadLinkErrorInvalidArgument(error);
20
+ else if (error.code === "ENOTDIR") readLinkError = new ReadLinkErrorNotDirectory(error);
21
+ else if (error.code === "EMFILE" || error.code === "ENFILE") readLinkError = new ReadLinkErrorTooManyOpenFiles(error);
22
+ }
23
+ if (readLinkError === void 0) readLinkError = new ReadLinkError(error);
24
+ return _duplojs_lang_either.left("file-system-read-link-error", readLinkError);
25
+ }
26
+ function handleDenoReadLinkError(error) {
27
+ let readLinkError = void 0;
28
+ if (error instanceof Deno.errors.NotFound) readLinkError = new ReadLinkErrorNotFound(error);
29
+ else if (error instanceof Deno.errors.PermissionDenied || error instanceof Deno.errors.NotCapable) readLinkError = new ReadLinkErrorPermissionDenied(error);
30
+ else if (error instanceof Deno.errors.InvalidData) readLinkError = new ReadLinkErrorInvalidArgument(error);
31
+ else if (error instanceof Deno.errors.NotADirectory) readLinkError = new ReadLinkErrorNotDirectory(error);
32
+ if (readLinkError === void 0) readLinkError = new ReadLinkError(error);
33
+ return _duplojs_lang_either.left("file-system-read-link-error", readLinkError);
34
+ }
35
+ const readLink = require_implementor.implementFunction("readLink", {
36
+ NODE: async (path) => require_implementor.nodeFileSystem.value.readlink(path, { encoding: "utf-8" }).then((value) => _duplojs_lang_either.right("file-system-read-link", value)).catch(handleNodeReadLinkError),
37
+ DENO: (path) => Deno.readLink(path).then((value) => _duplojs_lang_either.right("file-system-read-link", value)).catch(handleDenoReadLinkError)
38
+ });
39
+ //#endregion
40
+ exports.ReadLinkError = ReadLinkError;
41
+ exports.ReadLinkErrorInvalidArgument = ReadLinkErrorInvalidArgument;
42
+ exports.ReadLinkErrorNotDirectory = ReadLinkErrorNotDirectory;
43
+ exports.ReadLinkErrorNotFound = ReadLinkErrorNotFound;
44
+ exports.ReadLinkErrorPermissionDenied = ReadLinkErrorPermissionDenied;
45
+ exports.ReadLinkErrorTooManyOpenFiles = ReadLinkErrorTooManyOpenFiles;
46
+ exports.readLink = readLink;
@@ -0,0 +1,30 @@
1
+ import * as DEither from "@duplojs/lang/either";
2
+ import type * as DPath from "@duplojs/lang/path";
3
+ import * as DCommon from "@duplojs/lang/common";
4
+ declare const ReadLinkErrorNotFound_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-link-not-found", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-read-link-not-found", unknown>>, unknown>;
5
+ export declare class ReadLinkErrorNotFound extends ReadLinkErrorNotFound_base {
6
+ }
7
+ declare const ReadLinkErrorPermissionDenied_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-link-permission-denied", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-read-link-permission-denied", unknown>>, unknown>;
8
+ export declare class ReadLinkErrorPermissionDenied extends ReadLinkErrorPermissionDenied_base {
9
+ }
10
+ declare const ReadLinkErrorInvalidArgument_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-link-invalid-argument", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-read-link-invalid-argument", unknown>>, unknown>;
11
+ export declare class ReadLinkErrorInvalidArgument extends ReadLinkErrorInvalidArgument_base {
12
+ }
13
+ declare const ReadLinkErrorNotDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-link-not-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-read-link-not-directory", unknown>>, unknown>;
14
+ export declare class ReadLinkErrorNotDirectory extends ReadLinkErrorNotDirectory_base {
15
+ }
16
+ declare const ReadLinkErrorTooManyOpenFiles_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-link-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-read-link-too-many-open-files", unknown>>, unknown>;
17
+ export declare class ReadLinkErrorTooManyOpenFiles extends ReadLinkErrorTooManyOpenFiles_base {
18
+ }
19
+ declare const ReadLinkError_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-link-error", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-read-link-error", unknown>>, unknown>;
20
+ export declare class ReadLinkError extends ReadLinkError_base {
21
+ }
22
+ export type ReadLinkErrors = (ReadLinkErrorNotFound | ReadLinkErrorPermissionDenied | ReadLinkErrorInvalidArgument | ReadLinkErrorNotDirectory | ReadLinkErrorTooManyOpenFiles | ReadLinkError);
23
+ export type ReadLinkResult = (DEither.Right<"file-system-read-link", string> | DEither.Left<"file-system-read-link-error", ReadLinkErrors>);
24
+ declare module '../implementor' {
25
+ interface ServerFunction {
26
+ readLink(path: DPath.AnyPath): Promise<ReadLinkResult>;
27
+ }
28
+ }
29
+ export declare const readLink: (path: DPath.AnyPath) => Promise<ReadLinkResult>;
30
+ export {};
@@ -0,0 +1,37 @@
1
+ import { implementFunction, nodeFileSystem } from "../implementor.mjs";
2
+ import * as DCommon from "@duplojs/lang/common";
3
+ import * as DEither from "@duplojs/lang/either";
4
+ //#region scripts/file/readLink.ts
5
+ var ReadLinkErrorNotFound = class extends DCommon.DuploJSError.parentClass("file-system-read-link-not-found", Error) {};
6
+ var ReadLinkErrorPermissionDenied = class extends DCommon.DuploJSError.parentClass("file-system-read-link-permission-denied", Error) {};
7
+ var ReadLinkErrorInvalidArgument = class extends DCommon.DuploJSError.parentClass("file-system-read-link-invalid-argument", Error) {};
8
+ var ReadLinkErrorNotDirectory = class extends DCommon.DuploJSError.parentClass("file-system-read-link-not-directory", Error) {};
9
+ var ReadLinkErrorTooManyOpenFiles = class extends DCommon.DuploJSError.parentClass("file-system-read-link-too-many-open-files", Error) {};
10
+ var ReadLinkError = class extends DCommon.DuploJSError.parentClass("file-system-read-link-error", Error) {};
11
+ function handleNodeReadLinkError(error) {
12
+ let readLinkError = void 0;
13
+ if ("code" in error) {
14
+ if (error.code === "ENOENT") readLinkError = new ReadLinkErrorNotFound(error);
15
+ else if (error.code === "EACCES" || error.code === "EPERM") readLinkError = new ReadLinkErrorPermissionDenied(error);
16
+ else if (error.code === "EINVAL") readLinkError = new ReadLinkErrorInvalidArgument(error);
17
+ else if (error.code === "ENOTDIR") readLinkError = new ReadLinkErrorNotDirectory(error);
18
+ else if (error.code === "EMFILE" || error.code === "ENFILE") readLinkError = new ReadLinkErrorTooManyOpenFiles(error);
19
+ }
20
+ if (readLinkError === void 0) readLinkError = new ReadLinkError(error);
21
+ return DEither.left("file-system-read-link-error", readLinkError);
22
+ }
23
+ function handleDenoReadLinkError(error) {
24
+ let readLinkError = void 0;
25
+ if (error instanceof Deno.errors.NotFound) readLinkError = new ReadLinkErrorNotFound(error);
26
+ else if (error instanceof Deno.errors.PermissionDenied || error instanceof Deno.errors.NotCapable) readLinkError = new ReadLinkErrorPermissionDenied(error);
27
+ else if (error instanceof Deno.errors.InvalidData) readLinkError = new ReadLinkErrorInvalidArgument(error);
28
+ else if (error instanceof Deno.errors.NotADirectory) readLinkError = new ReadLinkErrorNotDirectory(error);
29
+ if (readLinkError === void 0) readLinkError = new ReadLinkError(error);
30
+ return DEither.left("file-system-read-link-error", readLinkError);
31
+ }
32
+ const readLink = implementFunction("readLink", {
33
+ NODE: async (path) => nodeFileSystem.value.readlink(path, { encoding: "utf-8" }).then((value) => DEither.right("file-system-read-link", value)).catch(handleNodeReadLinkError),
34
+ DENO: (path) => Deno.readLink(path).then((value) => DEither.right("file-system-read-link", value)).catch(handleDenoReadLinkError)
35
+ });
36
+ //#endregion
37
+ export { ReadLinkError, ReadLinkErrorInvalidArgument, ReadLinkErrorNotDirectory, ReadLinkErrorNotFound, ReadLinkErrorPermissionDenied, ReadLinkErrorTooManyOpenFiles, readLink };
@@ -0,0 +1,51 @@
1
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
2
+ const require_implementor = require("../implementor.cjs");
3
+ let _duplojs_lang_common = require("@duplojs/lang/common");
4
+ _duplojs_lang_common = require_runtime.__toESM(_duplojs_lang_common, 1);
5
+ let _duplojs_lang_either = require("@duplojs/lang/either");
6
+ _duplojs_lang_either = require_runtime.__toESM(_duplojs_lang_either, 1);
7
+ //#region scripts/file/readTextFile.ts
8
+ var ReadTextFileErrorNotFound = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-read-text-file-not-found", Error) {};
9
+ var ReadTextFileErrorPermissionDenied = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-read-text-file-permission-denied", Error) {};
10
+ var ReadTextFileErrorIsDirectory = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-read-text-file-is-directory", Error) {};
11
+ var ReadTextFileErrorNotDirectory = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-read-text-file-not-directory", Error) {};
12
+ var ReadTextFileErrorTooManyOpenFiles = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-read-text-file-too-many-open-files", Error) {};
13
+ var ReadTextFileErrorBusy = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-read-text-file-busy", Error) {};
14
+ var ReadTextFileError = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-read-text-file-error", Error) {};
15
+ function handleNodeReadTextFileError(error) {
16
+ let readTextFileError = void 0;
17
+ if ("code" in error) {
18
+ if (error.code === "ENOENT") readTextFileError = new ReadTextFileErrorNotFound(error);
19
+ else if (error.code === "EACCES" || error.code === "EPERM") readTextFileError = new ReadTextFileErrorPermissionDenied(error);
20
+ else if (error.code === "EISDIR") readTextFileError = new ReadTextFileErrorIsDirectory(error);
21
+ else if (error.code === "ENOTDIR") readTextFileError = new ReadTextFileErrorNotDirectory(error);
22
+ else if (error.code === "EMFILE" || error.code === "ENFILE") readTextFileError = new ReadTextFileErrorTooManyOpenFiles(error);
23
+ else if (error.code === "EBUSY") readTextFileError = new ReadTextFileErrorBusy(error);
24
+ }
25
+ if (readTextFileError === void 0) readTextFileError = new ReadTextFileError(error);
26
+ return _duplojs_lang_either.left("file-system-read-text-file-error", readTextFileError);
27
+ }
28
+ function handleDenoReadTextFileError(error) {
29
+ let readTextFileError = void 0;
30
+ if (error instanceof Deno.errors.NotFound) readTextFileError = new ReadTextFileErrorNotFound(error);
31
+ else if (error instanceof Deno.errors.PermissionDenied || error instanceof Deno.errors.NotCapable) readTextFileError = new ReadTextFileErrorPermissionDenied(error);
32
+ else if (error instanceof Deno.errors.IsADirectory) readTextFileError = new ReadTextFileErrorIsDirectory(error);
33
+ else if (error instanceof Deno.errors.NotADirectory) readTextFileError = new ReadTextFileErrorNotDirectory(error);
34
+ else if (error instanceof Deno.errors.Busy) readTextFileError = new ReadTextFileErrorBusy(error);
35
+ if (readTextFileError === void 0) readTextFileError = new ReadTextFileError(error);
36
+ return _duplojs_lang_either.left("file-system-read-text-file-error", readTextFileError);
37
+ }
38
+ const readTextFile = require_implementor.implementFunction("readTextFile", {
39
+ NODE: async (path) => require_implementor.nodeFileSystem.value.readFile(path, { encoding: "utf-8" }).then((value) => _duplojs_lang_either.right("file-system-read-text-file", value)).catch(handleNodeReadTextFileError),
40
+ DENO: (path) => Deno.readTextFile(path).then((value) => _duplojs_lang_either.right("file-system-read-text-file", value)).catch(handleDenoReadTextFileError),
41
+ BUN: (path) => Bun.file(path).text().then((value) => _duplojs_lang_either.right("file-system-read-text-file", value)).catch(handleNodeReadTextFileError)
42
+ });
43
+ //#endregion
44
+ exports.ReadTextFileError = ReadTextFileError;
45
+ exports.ReadTextFileErrorBusy = ReadTextFileErrorBusy;
46
+ exports.ReadTextFileErrorIsDirectory = ReadTextFileErrorIsDirectory;
47
+ exports.ReadTextFileErrorNotDirectory = ReadTextFileErrorNotDirectory;
48
+ exports.ReadTextFileErrorNotFound = ReadTextFileErrorNotFound;
49
+ exports.ReadTextFileErrorPermissionDenied = ReadTextFileErrorPermissionDenied;
50
+ exports.ReadTextFileErrorTooManyOpenFiles = ReadTextFileErrorTooManyOpenFiles;
51
+ exports.readTextFile = readTextFile;
@@ -0,0 +1,33 @@
1
+ import * as DCommon from "@duplojs/lang/common";
2
+ import * as DEither from "@duplojs/lang/either";
3
+ import type * as DPath from "@duplojs/lang/path";
4
+ declare const ReadTextFileErrorNotFound_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-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-read-text-file-not-found", unknown>>, unknown>;
5
+ export declare class ReadTextFileErrorNotFound extends ReadTextFileErrorNotFound_base {
6
+ }
7
+ declare const ReadTextFileErrorPermissionDenied_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-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-read-text-file-permission-denied", unknown>>, unknown>;
8
+ export declare class ReadTextFileErrorPermissionDenied extends ReadTextFileErrorPermissionDenied_base {
9
+ }
10
+ declare const ReadTextFileErrorIsDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-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-read-text-file-is-directory", unknown>>, unknown>;
11
+ export declare class ReadTextFileErrorIsDirectory extends ReadTextFileErrorIsDirectory_base {
12
+ }
13
+ declare const ReadTextFileErrorNotDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-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-read-text-file-not-directory", unknown>>, unknown>;
14
+ export declare class ReadTextFileErrorNotDirectory extends ReadTextFileErrorNotDirectory_base {
15
+ }
16
+ declare const ReadTextFileErrorTooManyOpenFiles_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-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-read-text-file-too-many-open-files", unknown>>, unknown>;
17
+ export declare class ReadTextFileErrorTooManyOpenFiles extends ReadTextFileErrorTooManyOpenFiles_base {
18
+ }
19
+ declare const ReadTextFileErrorBusy_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-text-file-busy", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-read-text-file-busy", unknown>>, unknown>;
20
+ export declare class ReadTextFileErrorBusy extends ReadTextFileErrorBusy_base {
21
+ }
22
+ declare const ReadTextFileError_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-read-text-file-error", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-read-text-file-error", unknown>>, unknown>;
23
+ export declare class ReadTextFileError extends ReadTextFileError_base {
24
+ }
25
+ export type ReadTextFileErrors = (ReadTextFileErrorNotFound | ReadTextFileErrorPermissionDenied | ReadTextFileErrorIsDirectory | ReadTextFileErrorNotDirectory | ReadTextFileErrorTooManyOpenFiles | ReadTextFileErrorBusy | ReadTextFileError);
26
+ export type ReadTextFileResult = (DEither.Right<"file-system-read-text-file", string> | DEither.Left<"file-system-read-text-file-error", ReadTextFileErrors>);
27
+ declare module '../implementor' {
28
+ interface ServerFunction {
29
+ readTextFile(path: DPath.AnyPath): Promise<ReadTextFileResult>;
30
+ }
31
+ }
32
+ export declare const readTextFile: (path: DPath.AnyPath) => Promise<ReadTextFileResult>;
33
+ export {};
@@ -0,0 +1,41 @@
1
+ import { implementFunction, nodeFileSystem } from "../implementor.mjs";
2
+ import * as DCommon from "@duplojs/lang/common";
3
+ import * as DEither from "@duplojs/lang/either";
4
+ //#region scripts/file/readTextFile.ts
5
+ var ReadTextFileErrorNotFound = class extends DCommon.DuploJSError.parentClass("file-system-read-text-file-not-found", Error) {};
6
+ var ReadTextFileErrorPermissionDenied = class extends DCommon.DuploJSError.parentClass("file-system-read-text-file-permission-denied", Error) {};
7
+ var ReadTextFileErrorIsDirectory = class extends DCommon.DuploJSError.parentClass("file-system-read-text-file-is-directory", Error) {};
8
+ var ReadTextFileErrorNotDirectory = class extends DCommon.DuploJSError.parentClass("file-system-read-text-file-not-directory", Error) {};
9
+ var ReadTextFileErrorTooManyOpenFiles = class extends DCommon.DuploJSError.parentClass("file-system-read-text-file-too-many-open-files", Error) {};
10
+ var ReadTextFileErrorBusy = class extends DCommon.DuploJSError.parentClass("file-system-read-text-file-busy", Error) {};
11
+ var ReadTextFileError = class extends DCommon.DuploJSError.parentClass("file-system-read-text-file-error", Error) {};
12
+ function handleNodeReadTextFileError(error) {
13
+ let readTextFileError = void 0;
14
+ if ("code" in error) {
15
+ if (error.code === "ENOENT") readTextFileError = new ReadTextFileErrorNotFound(error);
16
+ else if (error.code === "EACCES" || error.code === "EPERM") readTextFileError = new ReadTextFileErrorPermissionDenied(error);
17
+ else if (error.code === "EISDIR") readTextFileError = new ReadTextFileErrorIsDirectory(error);
18
+ else if (error.code === "ENOTDIR") readTextFileError = new ReadTextFileErrorNotDirectory(error);
19
+ else if (error.code === "EMFILE" || error.code === "ENFILE") readTextFileError = new ReadTextFileErrorTooManyOpenFiles(error);
20
+ else if (error.code === "EBUSY") readTextFileError = new ReadTextFileErrorBusy(error);
21
+ }
22
+ if (readTextFileError === void 0) readTextFileError = new ReadTextFileError(error);
23
+ return DEither.left("file-system-read-text-file-error", readTextFileError);
24
+ }
25
+ function handleDenoReadTextFileError(error) {
26
+ let readTextFileError = void 0;
27
+ if (error instanceof Deno.errors.NotFound) readTextFileError = new ReadTextFileErrorNotFound(error);
28
+ else if (error instanceof Deno.errors.PermissionDenied || error instanceof Deno.errors.NotCapable) readTextFileError = new ReadTextFileErrorPermissionDenied(error);
29
+ else if (error instanceof Deno.errors.IsADirectory) readTextFileError = new ReadTextFileErrorIsDirectory(error);
30
+ else if (error instanceof Deno.errors.NotADirectory) readTextFileError = new ReadTextFileErrorNotDirectory(error);
31
+ else if (error instanceof Deno.errors.Busy) readTextFileError = new ReadTextFileErrorBusy(error);
32
+ if (readTextFileError === void 0) readTextFileError = new ReadTextFileError(error);
33
+ return DEither.left("file-system-read-text-file-error", readTextFileError);
34
+ }
35
+ const readTextFile = implementFunction("readTextFile", {
36
+ NODE: async (path) => nodeFileSystem.value.readFile(path, { encoding: "utf-8" }).then((value) => DEither.right("file-system-read-text-file", value)).catch(handleNodeReadTextFileError),
37
+ DENO: (path) => Deno.readTextFile(path).then((value) => DEither.right("file-system-read-text-file", value)).catch(handleDenoReadTextFileError),
38
+ BUN: (path) => Bun.file(path).text().then((value) => DEither.right("file-system-read-text-file", value)).catch(handleNodeReadTextFileError)
39
+ });
40
+ //#endregion
41
+ export { ReadTextFileError, ReadTextFileErrorBusy, ReadTextFileErrorIsDirectory, ReadTextFileErrorNotDirectory, ReadTextFileErrorNotFound, ReadTextFileErrorPermissionDenied, ReadTextFileErrorTooManyOpenFiles, readTextFile };
@@ -0,0 +1,42 @@
1
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
2
+ const require_implementor = require("../implementor.cjs");
3
+ let _duplojs_lang_common = require("@duplojs/lang/common");
4
+ _duplojs_lang_common = require_runtime.__toESM(_duplojs_lang_common, 1);
5
+ let _duplojs_lang_either = require("@duplojs/lang/either");
6
+ _duplojs_lang_either = require_runtime.__toESM(_duplojs_lang_either, 1);
7
+ //#region scripts/file/realPath.ts
8
+ var RealPathErrorNotFound = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-real-path-not-found", Error) {};
9
+ var RealPathErrorPermissionDenied = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-real-path-permission-denied", Error) {};
10
+ var RealPathErrorNotDirectory = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-real-path-not-directory", Error) {};
11
+ var RealPathErrorTooManyOpenFiles = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-real-path-too-many-open-files", Error) {};
12
+ var RealPathError = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-real-path-error", Error) {};
13
+ function handleNodeRealPathError(error) {
14
+ let realPathError = void 0;
15
+ if ("code" in error) {
16
+ if (error.code === "ENOENT") realPathError = new RealPathErrorNotFound(error);
17
+ else if (error.code === "EACCES" || error.code === "EPERM") realPathError = new RealPathErrorPermissionDenied(error);
18
+ else if (error.code === "ENOTDIR") realPathError = new RealPathErrorNotDirectory(error);
19
+ else if (error.code === "EMFILE" || error.code === "ENFILE") realPathError = new RealPathErrorTooManyOpenFiles(error);
20
+ }
21
+ if (realPathError === void 0) realPathError = new RealPathError(error);
22
+ return _duplojs_lang_either.left("file-system-real-path-error", realPathError);
23
+ }
24
+ function handleDenoRealPathError(error) {
25
+ let realPathError = void 0;
26
+ if (error instanceof Deno.errors.NotFound) realPathError = new RealPathErrorNotFound(error);
27
+ else if (error instanceof Deno.errors.PermissionDenied || error instanceof Deno.errors.NotCapable) realPathError = new RealPathErrorPermissionDenied(error);
28
+ else if (error instanceof Deno.errors.NotADirectory) realPathError = new RealPathErrorNotDirectory(error);
29
+ if (realPathError === void 0) realPathError = new RealPathError(error);
30
+ return _duplojs_lang_either.left("file-system-real-path-error", realPathError);
31
+ }
32
+ const realPath = require_implementor.implementFunction("realPath", {
33
+ NODE: async (path) => require_implementor.nodeFileSystem.value.realpath(path).then((value) => _duplojs_lang_either.right("file-system-real-path", value)).catch(handleNodeRealPathError),
34
+ DENO: (path) => Deno.realPath(path).then((value) => _duplojs_lang_either.right("file-system-real-path", value)).catch(handleDenoRealPathError)
35
+ });
36
+ //#endregion
37
+ exports.RealPathError = RealPathError;
38
+ exports.RealPathErrorNotDirectory = RealPathErrorNotDirectory;
39
+ exports.RealPathErrorNotFound = RealPathErrorNotFound;
40
+ exports.RealPathErrorPermissionDenied = RealPathErrorPermissionDenied;
41
+ exports.RealPathErrorTooManyOpenFiles = RealPathErrorTooManyOpenFiles;
42
+ exports.realPath = realPath;
@@ -0,0 +1,27 @@
1
+ import * as DCommon from "@duplojs/lang/common";
2
+ import * as DEither from "@duplojs/lang/either";
3
+ import type * as DPath from "@duplojs/lang/path";
4
+ declare const RealPathErrorNotFound_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-real-path-not-found", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-real-path-not-found", unknown>>, unknown>;
5
+ export declare class RealPathErrorNotFound extends RealPathErrorNotFound_base {
6
+ }
7
+ declare const RealPathErrorPermissionDenied_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-real-path-permission-denied", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-real-path-permission-denied", unknown>>, unknown>;
8
+ export declare class RealPathErrorPermissionDenied extends RealPathErrorPermissionDenied_base {
9
+ }
10
+ declare const RealPathErrorNotDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-real-path-not-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-real-path-not-directory", unknown>>, unknown>;
11
+ export declare class RealPathErrorNotDirectory extends RealPathErrorNotDirectory_base {
12
+ }
13
+ declare const RealPathErrorTooManyOpenFiles_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-real-path-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-real-path-too-many-open-files", unknown>>, unknown>;
14
+ export declare class RealPathErrorTooManyOpenFiles extends RealPathErrorTooManyOpenFiles_base {
15
+ }
16
+ declare const RealPathError_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-real-path-error", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-real-path-error", unknown>>, unknown>;
17
+ export declare class RealPathError extends RealPathError_base {
18
+ }
19
+ export type RealPathErrors = (RealPathErrorNotFound | RealPathErrorPermissionDenied | RealPathErrorNotDirectory | RealPathErrorTooManyOpenFiles | RealPathError);
20
+ export type RealPathResult = (DEither.Right<"file-system-real-path", string> | DEither.Left<"file-system-real-path-error", RealPathErrors>);
21
+ declare module '../implementor' {
22
+ interface ServerFunction {
23
+ realPath(path: DPath.AnyPath): Promise<RealPathResult>;
24
+ }
25
+ }
26
+ export declare const realPath: (path: DPath.AnyPath) => Promise<RealPathResult>;
27
+ export {};
@@ -0,0 +1,34 @@
1
+ import { implementFunction, nodeFileSystem } from "../implementor.mjs";
2
+ import * as DCommon from "@duplojs/lang/common";
3
+ import * as DEither from "@duplojs/lang/either";
4
+ //#region scripts/file/realPath.ts
5
+ var RealPathErrorNotFound = class extends DCommon.DuploJSError.parentClass("file-system-real-path-not-found", Error) {};
6
+ var RealPathErrorPermissionDenied = class extends DCommon.DuploJSError.parentClass("file-system-real-path-permission-denied", Error) {};
7
+ var RealPathErrorNotDirectory = class extends DCommon.DuploJSError.parentClass("file-system-real-path-not-directory", Error) {};
8
+ var RealPathErrorTooManyOpenFiles = class extends DCommon.DuploJSError.parentClass("file-system-real-path-too-many-open-files", Error) {};
9
+ var RealPathError = class extends DCommon.DuploJSError.parentClass("file-system-real-path-error", Error) {};
10
+ function handleNodeRealPathError(error) {
11
+ let realPathError = void 0;
12
+ if ("code" in error) {
13
+ if (error.code === "ENOENT") realPathError = new RealPathErrorNotFound(error);
14
+ else if (error.code === "EACCES" || error.code === "EPERM") realPathError = new RealPathErrorPermissionDenied(error);
15
+ else if (error.code === "ENOTDIR") realPathError = new RealPathErrorNotDirectory(error);
16
+ else if (error.code === "EMFILE" || error.code === "ENFILE") realPathError = new RealPathErrorTooManyOpenFiles(error);
17
+ }
18
+ if (realPathError === void 0) realPathError = new RealPathError(error);
19
+ return DEither.left("file-system-real-path-error", realPathError);
20
+ }
21
+ function handleDenoRealPathError(error) {
22
+ let realPathError = void 0;
23
+ if (error instanceof Deno.errors.NotFound) realPathError = new RealPathErrorNotFound(error);
24
+ else if (error instanceof Deno.errors.PermissionDenied || error instanceof Deno.errors.NotCapable) realPathError = new RealPathErrorPermissionDenied(error);
25
+ else if (error instanceof Deno.errors.NotADirectory) realPathError = new RealPathErrorNotDirectory(error);
26
+ if (realPathError === void 0) realPathError = new RealPathError(error);
27
+ return DEither.left("file-system-real-path-error", realPathError);
28
+ }
29
+ const realPath = implementFunction("realPath", {
30
+ NODE: async (path) => nodeFileSystem.value.realpath(path).then((value) => DEither.right("file-system-real-path", value)).catch(handleNodeRealPathError),
31
+ DENO: (path) => Deno.realPath(path).then((value) => DEither.right("file-system-real-path", value)).catch(handleDenoRealPathError)
32
+ });
33
+ //#endregion
34
+ export { RealPathError, RealPathErrorNotDirectory, RealPathErrorNotFound, RealPathErrorPermissionDenied, RealPathErrorTooManyOpenFiles, realPath };
@@ -0,0 +1,83 @@
1
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
2
+ const require_implementor = require("../implementor.cjs");
3
+ let _duplojs_lang_common = require("@duplojs/lang/common");
4
+ _duplojs_lang_common = require_runtime.__toESM(_duplojs_lang_common, 1);
5
+ let _duplojs_lang_either = require("@duplojs/lang/either");
6
+ _duplojs_lang_either = require_runtime.__toESM(_duplojs_lang_either, 1);
7
+ let _duplojs_lang_path = require("@duplojs/lang/path");
8
+ _duplojs_lang_path = require_runtime.__toESM(_duplojs_lang_path, 1);
9
+ //#region scripts/file/relocate.ts
10
+ var RelocateErrorNotFound = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-relocate-not-found", Error) {};
11
+ var RelocateErrorPermissionDenied = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-relocate-permission-denied", Error) {};
12
+ var RelocateErrorAlreadyExists = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-relocate-already-exists", Error) {};
13
+ var RelocateErrorIsDirectory = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-relocate-is-directory", Error) {};
14
+ var RelocateErrorNotDirectory = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-relocate-not-directory", Error) {};
15
+ var RelocateErrorDirectoryNotEmpty = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-relocate-directory-not-empty", Error) {};
16
+ var RelocateErrorReadOnly = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-relocate-read-only", Error) {};
17
+ var RelocateErrorInvalidArgument = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-relocate-invalid-argument", Error) {};
18
+ var RelocateErrorBusy = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-relocate-busy", Error) {};
19
+ var RelocateErrorCrossDevice = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-relocate-cross-device", Error) {};
20
+ var RelocateError = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-relocate-error", Error) {};
21
+ function handleNodeRelocateError(error) {
22
+ let relocateError = void 0;
23
+ if ("code" in error) {
24
+ if (error.code === "ENOENT") relocateError = new RelocateErrorNotFound(error);
25
+ else if (error.code === "EACCES" || error.code === "EPERM") relocateError = new RelocateErrorPermissionDenied(error);
26
+ else if (error.code === "EEXIST") relocateError = new RelocateErrorAlreadyExists(error);
27
+ else if (error.code === "EISDIR") relocateError = new RelocateErrorIsDirectory(error);
28
+ else if (error.code === "ENOTDIR") relocateError = new RelocateErrorNotDirectory(error);
29
+ else if (error.code === "ENOTEMPTY") relocateError = new RelocateErrorDirectoryNotEmpty(error);
30
+ else if (error.code === "EROFS") relocateError = new RelocateErrorReadOnly(error);
31
+ else if (error.code === "EINVAL") relocateError = new RelocateErrorInvalidArgument(error);
32
+ else if (error.code === "EBUSY") relocateError = new RelocateErrorBusy(error);
33
+ else if (error.code === "EXDEV") relocateError = new RelocateErrorCrossDevice(error);
34
+ }
35
+ if (relocateError === void 0) relocateError = new RelocateError(error);
36
+ return _duplojs_lang_either.left("file-system-relocate-error", relocateError);
37
+ }
38
+ function handleDenoRelocateError(error) {
39
+ let relocateError = void 0;
40
+ if (error instanceof Deno.errors.NotFound) relocateError = new RelocateErrorNotFound(error);
41
+ else if (error instanceof Deno.errors.PermissionDenied || error instanceof Deno.errors.NotCapable) relocateError = new RelocateErrorPermissionDenied(error);
42
+ else if (error instanceof Deno.errors.AlreadyExists) relocateError = new RelocateErrorAlreadyExists(error);
43
+ else if (error instanceof Deno.errors.IsADirectory) relocateError = new RelocateErrorIsDirectory(error);
44
+ else if (error instanceof Deno.errors.NotADirectory) relocateError = new RelocateErrorNotDirectory(error);
45
+ else if (error instanceof Deno.errors.InvalidData) relocateError = new RelocateErrorInvalidArgument(error);
46
+ else if (error instanceof Deno.errors.Busy) relocateError = new RelocateErrorBusy(error);
47
+ if (relocateError === void 0) relocateError = new RelocateError(error);
48
+ return _duplojs_lang_either.left("file-system-relocate-error", relocateError);
49
+ }
50
+ const relocateImplementation = require_implementor.implementFunction("relocate", {
51
+ NODE: async (fromPath, newParentPath) => {
52
+ const baseName = _duplojs_lang_path.getBaseName(fromPath);
53
+ if (!baseName) return _duplojs_lang_either.left("file-system-relocate-error", new RelocateErrorInvalidArgument(/* @__PURE__ */ new Error(`Invalid base name ${fromPath}`)));
54
+ const newPath = _duplojs_lang_path.resolveRelative([newParentPath, baseName]);
55
+ return require_implementor.nodeFileSystem.value.rename(fromPath, newPath).then(() => _duplojs_lang_either.right("file-system-relocate", newPath)).catch(handleNodeRelocateError);
56
+ },
57
+ DENO: async (fromPath, newParentPath) => {
58
+ const baseName = _duplojs_lang_path.getBaseName(fromPath);
59
+ if (!baseName) return Promise.resolve(_duplojs_lang_either.left("file-system-relocate-error", new RelocateErrorInvalidArgument(/* @__PURE__ */ new Error(`Invalid base name ${fromPath}`))));
60
+ const newPath = _duplojs_lang_path.resolveRelative([newParentPath, baseName]);
61
+ return Deno.rename(fromPath, newPath).then(() => _duplojs_lang_either.right("file-system-relocate", newPath)).catch(handleDenoRelocateError);
62
+ }
63
+ });
64
+ function relocate(...args) {
65
+ if (args.length === 1) {
66
+ const [toPath] = args;
67
+ return (fromPath) => relocateImplementation(fromPath, toPath);
68
+ }
69
+ return relocateImplementation(...args);
70
+ }
71
+ //#endregion
72
+ exports.RelocateError = RelocateError;
73
+ exports.RelocateErrorAlreadyExists = RelocateErrorAlreadyExists;
74
+ exports.RelocateErrorBusy = RelocateErrorBusy;
75
+ exports.RelocateErrorCrossDevice = RelocateErrorCrossDevice;
76
+ exports.RelocateErrorDirectoryNotEmpty = RelocateErrorDirectoryNotEmpty;
77
+ exports.RelocateErrorInvalidArgument = RelocateErrorInvalidArgument;
78
+ exports.RelocateErrorIsDirectory = RelocateErrorIsDirectory;
79
+ exports.RelocateErrorNotDirectory = RelocateErrorNotDirectory;
80
+ exports.RelocateErrorNotFound = RelocateErrorNotFound;
81
+ exports.RelocateErrorPermissionDenied = RelocateErrorPermissionDenied;
82
+ exports.RelocateErrorReadOnly = RelocateErrorReadOnly;
83
+ exports.relocate = relocate;
@@ -0,0 +1,46 @@
1
+ import * as DPath from "@duplojs/lang/path";
2
+ import * as DEither from "@duplojs/lang/either";
3
+ import * as DCommon from "@duplojs/lang/common";
4
+ declare const RelocateErrorNotFound_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-relocate-not-found", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-relocate-not-found", unknown>>, unknown>;
5
+ export declare class RelocateErrorNotFound extends RelocateErrorNotFound_base {
6
+ }
7
+ declare const RelocateErrorPermissionDenied_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-relocate-permission-denied", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-relocate-permission-denied", unknown>>, unknown>;
8
+ export declare class RelocateErrorPermissionDenied extends RelocateErrorPermissionDenied_base {
9
+ }
10
+ declare const RelocateErrorAlreadyExists_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-relocate-already-exists", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-relocate-already-exists", unknown>>, unknown>;
11
+ export declare class RelocateErrorAlreadyExists extends RelocateErrorAlreadyExists_base {
12
+ }
13
+ declare const RelocateErrorIsDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-relocate-is-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-relocate-is-directory", unknown>>, unknown>;
14
+ export declare class RelocateErrorIsDirectory extends RelocateErrorIsDirectory_base {
15
+ }
16
+ declare const RelocateErrorNotDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-relocate-not-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-relocate-not-directory", unknown>>, unknown>;
17
+ export declare class RelocateErrorNotDirectory extends RelocateErrorNotDirectory_base {
18
+ }
19
+ declare const RelocateErrorDirectoryNotEmpty_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-relocate-directory-not-empty", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-relocate-directory-not-empty", unknown>>, unknown>;
20
+ export declare class RelocateErrorDirectoryNotEmpty extends RelocateErrorDirectoryNotEmpty_base {
21
+ }
22
+ declare const RelocateErrorReadOnly_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-relocate-read-only", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-relocate-read-only", unknown>>, unknown>;
23
+ export declare class RelocateErrorReadOnly extends RelocateErrorReadOnly_base {
24
+ }
25
+ declare const RelocateErrorInvalidArgument_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-relocate-invalid-argument", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-relocate-invalid-argument", unknown>>, unknown>;
26
+ export declare class RelocateErrorInvalidArgument extends RelocateErrorInvalidArgument_base {
27
+ }
28
+ declare const RelocateErrorBusy_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-relocate-busy", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-relocate-busy", unknown>>, unknown>;
29
+ export declare class RelocateErrorBusy extends RelocateErrorBusy_base {
30
+ }
31
+ declare const RelocateErrorCrossDevice_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-relocate-cross-device", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-relocate-cross-device", unknown>>, unknown>;
32
+ export declare class RelocateErrorCrossDevice extends RelocateErrorCrossDevice_base {
33
+ }
34
+ declare const RelocateError_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-relocate-error", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-relocate-error", unknown>>, unknown>;
35
+ export declare class RelocateError extends RelocateError_base {
36
+ }
37
+ export type RelocateErrors = (RelocateErrorNotFound | RelocateErrorPermissionDenied | RelocateErrorAlreadyExists | RelocateErrorIsDirectory | RelocateErrorNotDirectory | RelocateErrorDirectoryNotEmpty | RelocateErrorReadOnly | RelocateErrorInvalidArgument | RelocateErrorBusy | RelocateErrorCrossDevice | RelocateError);
38
+ export type RelocateResult = (DEither.Right<"file-system-relocate", string & DPath.Path> | DEither.Left<"file-system-relocate-error", RelocateErrors>);
39
+ declare module '../implementor' {
40
+ interface ServerFunction {
41
+ relocate(fromPath: DPath.AnyPath, toPath: DPath.AnyPath): Promise<RelocateResult>;
42
+ }
43
+ }
44
+ export declare function relocate(toPath: DPath.AnyPath): (fromPath: DPath.AnyPath) => Promise<RelocateResult>;
45
+ export declare function relocate(fromPath: DPath.AnyPath, toPath: DPath.AnyPath): Promise<RelocateResult>;
46
+ export {};