@nocobase/plugin-backup-restore 0.19.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +118 -0
  3. package/README.zh-CN.md +118 -0
  4. package/client.d.ts +2 -0
  5. package/client.js +1 -0
  6. package/dist/client/Configuration.d.ts +2 -0
  7. package/dist/client/DuplicatorProvider.d.ts +2 -0
  8. package/dist/client/index.d.ts +5 -0
  9. package/dist/client/index.js +1 -0
  10. package/dist/client/locale/index.d.ts +4 -0
  11. package/dist/externalVersion.js +14 -0
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.js +39 -0
  14. package/dist/locale/en-US.json +44 -0
  15. package/dist/locale/ja-JP.d.ts +25 -0
  16. package/dist/locale/ja-JP.js +46 -0
  17. package/dist/locale/pt-BR.d.ts +26 -0
  18. package/dist/locale/pt-BR.js +48 -0
  19. package/dist/locale/zh-CN.json +50 -0
  20. package/dist/node_modules/@hapi/topo/lib/index.d.ts +60 -0
  21. package/dist/node_modules/@hapi/topo/lib/index.js +1 -0
  22. package/dist/node_modules/@hapi/topo/package.json +1 -0
  23. package/dist/node_modules/archiver/LICENSE +22 -0
  24. package/dist/node_modules/archiver/index.js +68 -0
  25. package/dist/node_modules/archiver/lib/core.js +974 -0
  26. package/dist/node_modules/archiver/lib/error.js +40 -0
  27. package/dist/node_modules/archiver/lib/plugins/json.js +110 -0
  28. package/dist/node_modules/archiver/lib/plugins/tar.js +167 -0
  29. package/dist/node_modules/archiver/lib/plugins/zip.js +120 -0
  30. package/dist/node_modules/archiver/node_modules/readable-stream/errors-browser.js +127 -0
  31. package/dist/node_modules/archiver/node_modules/readable-stream/errors.js +116 -0
  32. package/dist/node_modules/archiver/node_modules/readable-stream/experimentalWarning.js +17 -0
  33. package/dist/node_modules/archiver/node_modules/readable-stream/lib/_stream_duplex.js +126 -0
  34. package/dist/node_modules/archiver/node_modules/readable-stream/lib/_stream_passthrough.js +37 -0
  35. package/dist/node_modules/archiver/node_modules/readable-stream/lib/_stream_readable.js +1027 -0
  36. package/dist/node_modules/archiver/node_modules/readable-stream/lib/_stream_transform.js +190 -0
  37. package/dist/node_modules/archiver/node_modules/readable-stream/lib/_stream_writable.js +641 -0
  38. package/dist/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/async_iterator.js +180 -0
  39. package/dist/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/buffer_list.js +183 -0
  40. package/dist/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/destroy.js +96 -0
  41. package/dist/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +86 -0
  42. package/dist/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
  43. package/dist/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/from.js +52 -0
  44. package/dist/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/pipeline.js +86 -0
  45. package/dist/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/state.js +22 -0
  46. package/dist/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  47. package/dist/node_modules/archiver/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  48. package/dist/node_modules/archiver/node_modules/readable-stream/package.json +68 -0
  49. package/dist/node_modules/archiver/node_modules/readable-stream/readable-browser.js +9 -0
  50. package/dist/node_modules/archiver/node_modules/readable-stream/readable.js +16 -0
  51. package/dist/node_modules/archiver/node_modules/string_decoder/lib/string_decoder.js +296 -0
  52. package/dist/node_modules/archiver/node_modules/string_decoder/package.json +34 -0
  53. package/dist/node_modules/archiver/node_modules/tar-stream/extract.js +257 -0
  54. package/dist/node_modules/archiver/node_modules/tar-stream/headers.js +295 -0
  55. package/dist/node_modules/archiver/node_modules/tar-stream/index.js +2 -0
  56. package/dist/node_modules/archiver/node_modules/tar-stream/pack.js +255 -0
  57. package/dist/node_modules/archiver/node_modules/tar-stream/package.json +58 -0
  58. package/dist/node_modules/archiver/node_modules/tar-stream/sandbox.js +11 -0
  59. package/dist/node_modules/archiver/package.json +1 -0
  60. package/dist/node_modules/decompress/index.js +16 -0
  61. package/dist/node_modules/decompress/license +9 -0
  62. package/dist/node_modules/decompress/node_modules/make-dir/index.js +85 -0
  63. package/dist/node_modules/decompress/node_modules/make-dir/license +9 -0
  64. package/dist/node_modules/decompress/node_modules/make-dir/node_modules/pify/index.js +84 -0
  65. package/dist/node_modules/decompress/node_modules/make-dir/node_modules/pify/license +9 -0
  66. package/dist/node_modules/decompress/node_modules/make-dir/node_modules/pify/package.json +51 -0
  67. package/dist/node_modules/decompress/node_modules/make-dir/package.json +54 -0
  68. package/dist/node_modules/decompress/package.json +1 -0
  69. package/dist/node_modules/mkdirp/LICENSE +21 -0
  70. package/dist/node_modules/mkdirp/bin/cmd.js +68 -0
  71. package/dist/node_modules/mkdirp/index.js +1 -0
  72. package/dist/node_modules/mkdirp/lib/find-made.js +29 -0
  73. package/dist/node_modules/mkdirp/lib/mkdirp-manual.js +64 -0
  74. package/dist/node_modules/mkdirp/lib/mkdirp-native.js +39 -0
  75. package/dist/node_modules/mkdirp/lib/opts-arg.js +23 -0
  76. package/dist/node_modules/mkdirp/lib/path-arg.js +29 -0
  77. package/dist/node_modules/mkdirp/lib/use-native.js +10 -0
  78. package/dist/node_modules/mkdirp/package.json +1 -0
  79. package/dist/node_modules/mkdirp/readme.markdown +266 -0
  80. package/dist/node_modules/semver/LICENSE +15 -0
  81. package/dist/node_modules/semver/bin/semver.js +197 -0
  82. package/dist/node_modules/semver/classes/comparator.js +141 -0
  83. package/dist/node_modules/semver/classes/index.js +5 -0
  84. package/dist/node_modules/semver/classes/range.js +539 -0
  85. package/dist/node_modules/semver/classes/semver.js +302 -0
  86. package/dist/node_modules/semver/functions/clean.js +6 -0
  87. package/dist/node_modules/semver/functions/cmp.js +52 -0
  88. package/dist/node_modules/semver/functions/coerce.js +52 -0
  89. package/dist/node_modules/semver/functions/compare-build.js +7 -0
  90. package/dist/node_modules/semver/functions/compare-loose.js +3 -0
  91. package/dist/node_modules/semver/functions/compare.js +5 -0
  92. package/dist/node_modules/semver/functions/diff.js +65 -0
  93. package/dist/node_modules/semver/functions/eq.js +3 -0
  94. package/dist/node_modules/semver/functions/gt.js +3 -0
  95. package/dist/node_modules/semver/functions/gte.js +3 -0
  96. package/dist/node_modules/semver/functions/inc.js +19 -0
  97. package/dist/node_modules/semver/functions/lt.js +3 -0
  98. package/dist/node_modules/semver/functions/lte.js +3 -0
  99. package/dist/node_modules/semver/functions/major.js +3 -0
  100. package/dist/node_modules/semver/functions/minor.js +3 -0
  101. package/dist/node_modules/semver/functions/neq.js +3 -0
  102. package/dist/node_modules/semver/functions/parse.js +16 -0
  103. package/dist/node_modules/semver/functions/patch.js +3 -0
  104. package/dist/node_modules/semver/functions/prerelease.js +6 -0
  105. package/dist/node_modules/semver/functions/rcompare.js +3 -0
  106. package/dist/node_modules/semver/functions/rsort.js +3 -0
  107. package/dist/node_modules/semver/functions/satisfies.js +10 -0
  108. package/dist/node_modules/semver/functions/sort.js +3 -0
  109. package/dist/node_modules/semver/functions/valid.js +6 -0
  110. package/dist/node_modules/semver/index.js +1 -0
  111. package/dist/node_modules/semver/internal/constants.js +35 -0
  112. package/dist/node_modules/semver/internal/debug.js +9 -0
  113. package/dist/node_modules/semver/internal/identifiers.js +23 -0
  114. package/dist/node_modules/semver/internal/parse-options.js +15 -0
  115. package/dist/node_modules/semver/internal/re.js +212 -0
  116. package/dist/node_modules/semver/package.json +1 -0
  117. package/dist/node_modules/semver/preload.js +2 -0
  118. package/dist/node_modules/semver/range.bnf +16 -0
  119. package/dist/node_modules/semver/ranges/gtr.js +4 -0
  120. package/dist/node_modules/semver/ranges/intersects.js +7 -0
  121. package/dist/node_modules/semver/ranges/ltr.js +4 -0
  122. package/dist/node_modules/semver/ranges/max-satisfying.js +25 -0
  123. package/dist/node_modules/semver/ranges/min-satisfying.js +24 -0
  124. package/dist/node_modules/semver/ranges/min-version.js +61 -0
  125. package/dist/node_modules/semver/ranges/outside.js +80 -0
  126. package/dist/node_modules/semver/ranges/simplify.js +47 -0
  127. package/dist/node_modules/semver/ranges/subset.js +247 -0
  128. package/dist/node_modules/semver/ranges/to-comparators.js +8 -0
  129. package/dist/node_modules/semver/ranges/valid.js +11 -0
  130. package/dist/server/app-migrator.d.ts +17 -0
  131. package/dist/server/app-migrator.js +61 -0
  132. package/dist/server/collection-group-manager.d.ts +4 -0
  133. package/dist/server/collection-group-manager.js +29 -0
  134. package/dist/server/commands/restore-command.d.ts +2 -0
  135. package/dist/server/commands/restore-command.js +67 -0
  136. package/dist/server/dumper.d.ts +71 -0
  137. package/dist/server/dumper.js +406 -0
  138. package/dist/server/errors/restore-check-error.d.ts +3 -0
  139. package/dist/server/errors/restore-check-error.js +32 -0
  140. package/dist/server/field-value-writer.d.ts +9 -0
  141. package/dist/server/field-value-writer.js +101 -0
  142. package/dist/server/index.d.ts +1 -0
  143. package/dist/server/index.js +33 -0
  144. package/dist/server/locale/zh-CN.d.ts +9 -0
  145. package/dist/server/locale/zh-CN.js +30 -0
  146. package/dist/server/resourcers/backup-files.d.ts +25 -0
  147. package/dist/server/resourcers/backup-files.js +193 -0
  148. package/dist/server/restorer.d.ts +36 -0
  149. package/dist/server/restorer.js +326 -0
  150. package/dist/server/server.d.ts +5 -0
  151. package/dist/server/server.js +41 -0
  152. package/dist/server/utils.d.ts +5 -0
  153. package/dist/server/utils.js +78 -0
  154. package/dist/swagger/index.d.ts +392 -0
  155. package/dist/swagger/index.js +447 -0
  156. package/package.json +40 -0
  157. package/server.d.ts +2 -0
  158. package/server.js +1 -0
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "pify",
3
+ "version": "3.0.0",
4
+ "description": "Promisify a callback-style function",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/pify",
7
+ "author": {
8
+ "name": "Sindre Sorhus",
9
+ "email": "sindresorhus@gmail.com",
10
+ "url": "sindresorhus.com"
11
+ },
12
+ "engines": {
13
+ "node": ">=4"
14
+ },
15
+ "scripts": {
16
+ "test": "xo && ava && npm run optimization-test",
17
+ "optimization-test": "node --allow-natives-syntax optimization-test.js"
18
+ },
19
+ "files": [
20
+ "index.js"
21
+ ],
22
+ "keywords": [
23
+ "promise",
24
+ "promises",
25
+ "promisify",
26
+ "all",
27
+ "denodify",
28
+ "denodeify",
29
+ "callback",
30
+ "cb",
31
+ "node",
32
+ "then",
33
+ "thenify",
34
+ "convert",
35
+ "transform",
36
+ "wrap",
37
+ "wrapper",
38
+ "bind",
39
+ "to",
40
+ "async",
41
+ "await",
42
+ "es2015",
43
+ "bluebird"
44
+ ],
45
+ "devDependencies": {
46
+ "ava": "*",
47
+ "pinkie-promise": "^2.0.0",
48
+ "v8-natives": "^1.0.0",
49
+ "xo": "*"
50
+ }
51
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "make-dir",
3
+ "version": "1.3.0",
4
+ "description": "Make a directory and its parents if needed - Think `mkdir -p`",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/make-dir",
7
+ "author": {
8
+ "name": "Sindre Sorhus",
9
+ "email": "sindresorhus@gmail.com",
10
+ "url": "sindresorhus.com"
11
+ },
12
+ "engines": {
13
+ "node": ">=4"
14
+ },
15
+ "scripts": {
16
+ "test": "xo && nyc ava"
17
+ },
18
+ "files": [
19
+ "index.js"
20
+ ],
21
+ "keywords": [
22
+ "mkdir",
23
+ "mkdirp",
24
+ "make",
25
+ "directories",
26
+ "dir",
27
+ "dirs",
28
+ "folders",
29
+ "directory",
30
+ "folder",
31
+ "path",
32
+ "parent",
33
+ "parents",
34
+ "intermediate",
35
+ "recursively",
36
+ "recursive",
37
+ "create",
38
+ "fs",
39
+ "filesystem",
40
+ "file-system"
41
+ ],
42
+ "dependencies": {
43
+ "pify": "^3.0.0"
44
+ },
45
+ "devDependencies": {
46
+ "ava": "*",
47
+ "codecov": "^3.0.0",
48
+ "graceful-fs": "^4.1.11",
49
+ "nyc": "^11.3.0",
50
+ "path-type": "^3.0.0",
51
+ "tempy": "^0.2.1",
52
+ "xo": "^0.20.0"
53
+ }
54
+ }
@@ -0,0 +1 @@
1
+ {"name":"decompress","version":"4.2.1","description":"Extracting archives made easy","license":"MIT","repository":"kevva/decompress","author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["bz2","bzip2","decompress","extract","tar","tar.bz","tar.gz","zip","unzip"],"dependencies":{"decompress-tar":"^4.0.0","decompress-tarbz2":"^4.0.0","decompress-targz":"^4.0.0","decompress-unzip":"^4.0.1","graceful-fs":"^4.1.10","make-dir":"^1.0.0","pify":"^2.3.0","strip-dirs":"^2.0.0"},"devDependencies":{"ava":"*","esm":"^3.2.25","is-jpg":"^1.0.0","path-exists":"^3.0.0","pify":"^2.3.0","rimraf":"^3.0.2","xo":"*"},"ava":{"require":["esm"]},"xo":{"rules":{"promise/prefer-await-to-then":"off"}},"_lastModified":"2024-01-08T11:40:09.424Z"}
@@ -0,0 +1,21 @@
1
+ Copyright James Halliday (mail@substack.net) and Isaac Z. Schlueter (i@izs.me)
2
+
3
+ This project is free software released under the MIT license:
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+
3
+ const usage = () => `
4
+ usage: mkdirp [DIR1,DIR2..] {OPTIONS}
5
+
6
+ Create each supplied directory including any necessary parent directories
7
+ that don't yet exist.
8
+
9
+ If the directory already exists, do nothing.
10
+
11
+ OPTIONS are:
12
+
13
+ -m<mode> If a directory needs to be created, set the mode as an octal
14
+ --mode=<mode> permission string.
15
+
16
+ -v --version Print the mkdirp version number
17
+
18
+ -h --help Print this helpful banner
19
+
20
+ -p --print Print the first directories created for each path provided
21
+
22
+ --manual Use manual implementation, even if native is available
23
+ `
24
+
25
+ const dirs = []
26
+ const opts = {}
27
+ let print = false
28
+ let dashdash = false
29
+ let manual = false
30
+ for (const arg of process.argv.slice(2)) {
31
+ if (dashdash)
32
+ dirs.push(arg)
33
+ else if (arg === '--')
34
+ dashdash = true
35
+ else if (arg === '--manual')
36
+ manual = true
37
+ else if (/^-h/.test(arg) || /^--help/.test(arg)) {
38
+ console.log(usage())
39
+ process.exit(0)
40
+ } else if (arg === '-v' || arg === '--version') {
41
+ console.log(require('../package.json').version)
42
+ process.exit(0)
43
+ } else if (arg === '-p' || arg === '--print') {
44
+ print = true
45
+ } else if (/^-m/.test(arg) || /^--mode=/.test(arg)) {
46
+ const mode = parseInt(arg.replace(/^(-m|--mode=)/, ''), 8)
47
+ if (isNaN(mode)) {
48
+ console.error(`invalid mode argument: ${arg}\nMust be an octal number.`)
49
+ process.exit(1)
50
+ }
51
+ opts.mode = mode
52
+ } else
53
+ dirs.push(arg)
54
+ }
55
+
56
+ const mkdirp = require('../')
57
+ const impl = manual ? mkdirp.manual : mkdirp
58
+ if (dirs.length === 0)
59
+ console.error(usage())
60
+
61
+ Promise.all(dirs.map(dir => impl(dir, opts)))
62
+ .then(made => print ? made.forEach(m => m && console.log(m)) : null)
63
+ .catch(er => {
64
+ console.error(er.message)
65
+ if (er.code)
66
+ console.error(' code: ' + er.code)
67
+ process.exit(1)
68
+ })
@@ -0,0 +1 @@
1
+ (function(){var e={443:function(e,t,r){const n=r(369);const s=r(402);const{mkdirpNative:c,mkdirpNativeSync:i}=r(833);const{mkdirpManual:o,mkdirpManualSync:a}=r(866);const{useNative:u,useNativeSync:d}=r(942);const mkdirp=(e,t)=>{e=s(e);t=n(t);return u(t)?c(e,t):o(e,t)};const mkdirpSync=(e,t)=>{e=s(e);t=n(t);return d(t)?i(e,t):a(e,t)};mkdirp.sync=mkdirpSync;mkdirp.native=(e,t)=>c(s(e),n(t));mkdirp.manual=(e,t)=>o(s(e),n(t));mkdirp.nativeSync=(e,t)=>i(s(e),n(t));mkdirp.manualSync=(e,t)=>a(s(e),n(t));e.exports=mkdirp},411:function(e,t,r){const{dirname:n}=r(17);const findMade=(e,t,r=undefined)=>{if(r===t)return Promise.resolve();return e.statAsync(t).then((e=>e.isDirectory()?r:undefined),(r=>r.code==="ENOENT"?findMade(e,n(t),t):undefined))};const findMadeSync=(e,t,r=undefined)=>{if(r===t)return undefined;try{return e.statSync(t).isDirectory()?r:undefined}catch(r){return r.code==="ENOENT"?findMadeSync(e,n(t),t):undefined}};e.exports={findMade:findMade,findMadeSync:findMadeSync}},866:function(e,t,r){const{dirname:n}=r(17);const mkdirpManual=(e,t,r)=>{t.recursive=false;const s=n(e);if(s===e){return t.mkdirAsync(e,t).catch((e=>{if(e.code!=="EISDIR")throw e}))}return t.mkdirAsync(e,t).then((()=>r||e),(n=>{if(n.code==="ENOENT")return mkdirpManual(s,t).then((r=>mkdirpManual(e,t,r)));if(n.code!=="EEXIST"&&n.code!=="EROFS")throw n;return t.statAsync(e).then((e=>{if(e.isDirectory())return r;else throw n}),(()=>{throw n}))}))};const mkdirpManualSync=(e,t,r)=>{const s=n(e);t.recursive=false;if(s===e){try{return t.mkdirSync(e,t)}catch(e){if(e.code!=="EISDIR")throw e;else return}}try{t.mkdirSync(e,t);return r||e}catch(n){if(n.code==="ENOENT")return mkdirpManualSync(e,t,mkdirpManualSync(s,t,r));if(n.code!=="EEXIST"&&n.code!=="EROFS")throw n;try{if(!t.statSync(e).isDirectory())throw n}catch(e){throw n}}};e.exports={mkdirpManual:mkdirpManual,mkdirpManualSync:mkdirpManualSync}},833:function(e,t,r){const{dirname:n}=r(17);const{findMade:s,findMadeSync:c}=r(411);const{mkdirpManual:i,mkdirpManualSync:o}=r(866);const mkdirpNative=(e,t)=>{t.recursive=true;const r=n(e);if(r===e)return t.mkdirAsync(e,t);return s(t,e).then((r=>t.mkdirAsync(e,t).then((()=>r)).catch((r=>{if(r.code==="ENOENT")return i(e,t);else throw r}))))};const mkdirpNativeSync=(e,t)=>{t.recursive=true;const r=n(e);if(r===e)return t.mkdirSync(e,t);const s=c(t,e);try{t.mkdirSync(e,t);return s}catch(r){if(r.code==="ENOENT")return o(e,t);else throw r}};e.exports={mkdirpNative:mkdirpNative,mkdirpNativeSync:mkdirpNativeSync}},369:function(e,t,r){const{promisify:n}=r(837);const s=r(147);const optsArg=e=>{if(!e)e={mode:511,fs:s};else if(typeof e==="object")e={mode:511,fs:s,...e};else if(typeof e==="number")e={mode:e,fs:s};else if(typeof e==="string")e={mode:parseInt(e,8),fs:s};else throw new TypeError("invalid options argument");e.mkdir=e.mkdir||e.fs.mkdir||s.mkdir;e.mkdirAsync=n(e.mkdir);e.stat=e.stat||e.fs.stat||s.stat;e.statAsync=n(e.stat);e.statSync=e.statSync||e.fs.statSync||s.statSync;e.mkdirSync=e.mkdirSync||e.fs.mkdirSync||s.mkdirSync;return e};e.exports=optsArg},402:function(e,t,r){const n=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform;const{resolve:s,parse:c}=r(17);const pathArg=e=>{if(/\0/.test(e)){throw Object.assign(new TypeError("path must be a string without null bytes"),{path:e,code:"ERR_INVALID_ARG_VALUE"})}e=s(e);if(n==="win32"){const t=/[*|"<>?:]/;const{root:r}=c(e);if(t.test(e.substr(r.length))){throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}}return e};e.exports=pathArg},942:function(e,t,r){const n=r(147);const s=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version;const c=s.replace(/^v/,"").split(".");const i=+c[0]>10||+c[0]===10&&+c[1]>=12;const o=!i?()=>false:e=>e.mkdir===n.mkdir;const a=!i?()=>false:e=>e.mkdirSync===n.mkdirSync;e.exports={useNative:o,useNativeSync:a}},147:function(e){"use strict";e.exports=require("fs")},17:function(e){"use strict";e.exports=require("path")},837:function(e){"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var s=t[r]={exports:{}};var c=true;try{e[r](s,s.exports,__nccwpck_require__);c=false}finally{if(c)delete t[r]}return s.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(443);module.exports=r})();
@@ -0,0 +1,29 @@
1
+ const {dirname} = require('path')
2
+
3
+ const findMade = (opts, parent, path = undefined) => {
4
+ // we never want the 'made' return value to be a root directory
5
+ if (path === parent)
6
+ return Promise.resolve()
7
+
8
+ return opts.statAsync(parent).then(
9
+ st => st.isDirectory() ? path : undefined, // will fail later
10
+ er => er.code === 'ENOENT'
11
+ ? findMade(opts, dirname(parent), parent)
12
+ : undefined
13
+ )
14
+ }
15
+
16
+ const findMadeSync = (opts, parent, path = undefined) => {
17
+ if (path === parent)
18
+ return undefined
19
+
20
+ try {
21
+ return opts.statSync(parent).isDirectory() ? path : undefined
22
+ } catch (er) {
23
+ return er.code === 'ENOENT'
24
+ ? findMadeSync(opts, dirname(parent), parent)
25
+ : undefined
26
+ }
27
+ }
28
+
29
+ module.exports = {findMade, findMadeSync}
@@ -0,0 +1,64 @@
1
+ const {dirname} = require('path')
2
+
3
+ const mkdirpManual = (path, opts, made) => {
4
+ opts.recursive = false
5
+ const parent = dirname(path)
6
+ if (parent === path) {
7
+ return opts.mkdirAsync(path, opts).catch(er => {
8
+ // swallowed by recursive implementation on posix systems
9
+ // any other error is a failure
10
+ if (er.code !== 'EISDIR')
11
+ throw er
12
+ })
13
+ }
14
+
15
+ return opts.mkdirAsync(path, opts).then(() => made || path, er => {
16
+ if (er.code === 'ENOENT')
17
+ return mkdirpManual(parent, opts)
18
+ .then(made => mkdirpManual(path, opts, made))
19
+ if (er.code !== 'EEXIST' && er.code !== 'EROFS')
20
+ throw er
21
+ return opts.statAsync(path).then(st => {
22
+ if (st.isDirectory())
23
+ return made
24
+ else
25
+ throw er
26
+ }, () => { throw er })
27
+ })
28
+ }
29
+
30
+ const mkdirpManualSync = (path, opts, made) => {
31
+ const parent = dirname(path)
32
+ opts.recursive = false
33
+
34
+ if (parent === path) {
35
+ try {
36
+ return opts.mkdirSync(path, opts)
37
+ } catch (er) {
38
+ // swallowed by recursive implementation on posix systems
39
+ // any other error is a failure
40
+ if (er.code !== 'EISDIR')
41
+ throw er
42
+ else
43
+ return
44
+ }
45
+ }
46
+
47
+ try {
48
+ opts.mkdirSync(path, opts)
49
+ return made || path
50
+ } catch (er) {
51
+ if (er.code === 'ENOENT')
52
+ return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made))
53
+ if (er.code !== 'EEXIST' && er.code !== 'EROFS')
54
+ throw er
55
+ try {
56
+ if (!opts.statSync(path).isDirectory())
57
+ throw er
58
+ } catch (_) {
59
+ throw er
60
+ }
61
+ }
62
+ }
63
+
64
+ module.exports = {mkdirpManual, mkdirpManualSync}
@@ -0,0 +1,39 @@
1
+ const {dirname} = require('path')
2
+ const {findMade, findMadeSync} = require('./find-made.js')
3
+ const {mkdirpManual, mkdirpManualSync} = require('./mkdirp-manual.js')
4
+
5
+ const mkdirpNative = (path, opts) => {
6
+ opts.recursive = true
7
+ const parent = dirname(path)
8
+ if (parent === path)
9
+ return opts.mkdirAsync(path, opts)
10
+
11
+ return findMade(opts, path).then(made =>
12
+ opts.mkdirAsync(path, opts).then(() => made)
13
+ .catch(er => {
14
+ if (er.code === 'ENOENT')
15
+ return mkdirpManual(path, opts)
16
+ else
17
+ throw er
18
+ }))
19
+ }
20
+
21
+ const mkdirpNativeSync = (path, opts) => {
22
+ opts.recursive = true
23
+ const parent = dirname(path)
24
+ if (parent === path)
25
+ return opts.mkdirSync(path, opts)
26
+
27
+ const made = findMadeSync(opts, path)
28
+ try {
29
+ opts.mkdirSync(path, opts)
30
+ return made
31
+ } catch (er) {
32
+ if (er.code === 'ENOENT')
33
+ return mkdirpManualSync(path, opts)
34
+ else
35
+ throw er
36
+ }
37
+ }
38
+
39
+ module.exports = {mkdirpNative, mkdirpNativeSync}
@@ -0,0 +1,23 @@
1
+ const { promisify } = require('util')
2
+ const fs = require('fs')
3
+ const optsArg = opts => {
4
+ if (!opts)
5
+ opts = { mode: 0o777, fs }
6
+ else if (typeof opts === 'object')
7
+ opts = { mode: 0o777, fs, ...opts }
8
+ else if (typeof opts === 'number')
9
+ opts = { mode: opts, fs }
10
+ else if (typeof opts === 'string')
11
+ opts = { mode: parseInt(opts, 8), fs }
12
+ else
13
+ throw new TypeError('invalid options argument')
14
+
15
+ opts.mkdir = opts.mkdir || opts.fs.mkdir || fs.mkdir
16
+ opts.mkdirAsync = promisify(opts.mkdir)
17
+ opts.stat = opts.stat || opts.fs.stat || fs.stat
18
+ opts.statAsync = promisify(opts.stat)
19
+ opts.statSync = opts.statSync || opts.fs.statSync || fs.statSync
20
+ opts.mkdirSync = opts.mkdirSync || opts.fs.mkdirSync || fs.mkdirSync
21
+ return opts
22
+ }
23
+ module.exports = optsArg
@@ -0,0 +1,29 @@
1
+ const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform
2
+ const { resolve, parse } = require('path')
3
+ const pathArg = path => {
4
+ if (/\0/.test(path)) {
5
+ // simulate same failure that node raises
6
+ throw Object.assign(
7
+ new TypeError('path must be a string without null bytes'),
8
+ {
9
+ path,
10
+ code: 'ERR_INVALID_ARG_VALUE',
11
+ }
12
+ )
13
+ }
14
+
15
+ path = resolve(path)
16
+ if (platform === 'win32') {
17
+ const badWinChars = /[*|"<>?:]/
18
+ const {root} = parse(path)
19
+ if (badWinChars.test(path.substr(root.length))) {
20
+ throw Object.assign(new Error('Illegal characters in path.'), {
21
+ path,
22
+ code: 'EINVAL',
23
+ })
24
+ }
25
+ }
26
+
27
+ return path
28
+ }
29
+ module.exports = pathArg
@@ -0,0 +1,10 @@
1
+ const fs = require('fs')
2
+
3
+ const version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version
4
+ const versArr = version.replace(/^v/, '').split('.')
5
+ const hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12
6
+
7
+ const useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir
8
+ const useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync
9
+
10
+ module.exports = {useNative, useNativeSync}
@@ -0,0 +1 @@
1
+ {"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"1.0.4","main":"index.js","keywords":["mkdir","directory","make dir","make","dir","recursive","native"],"repository":{"type":"git","url":"https://github.com/isaacs/node-mkdirp.git"},"scripts":{"test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true,"coverage-map":"map.js"},"devDependencies":{"require-inject":"^1.4.4","tap":"^14.10.7"},"bin":"bin/cmd.js","license":"MIT","engines":{"node":">=10"},"files":["bin","lib","index.js"],"_lastModified":"2024-01-08T11:40:08.559Z"}