soda-nodejs 0.6.6 → 0.7.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 (74) hide show
  1. package/dist/index.cjs +123 -0
  2. package/dist/index.js +8 -0
  3. package/dist/utils/compress.cjs +54 -0
  4. package/dist/utils/compress.js +20 -0
  5. package/dist/utils/copy.cjs +70 -0
  6. package/dist/utils/copy.js +36 -0
  7. package/dist/utils/execAsync.cjs +61 -0
  8. package/dist/{esm/utils → utils}/execAsync.d.ts +0 -4
  9. package/dist/utils/execAsync.js +17 -0
  10. package/dist/utils/saveFile.cjs +43 -0
  11. package/dist/utils/saveFile.js +9 -0
  12. package/dist/utils/saveResponse.cjs +41 -0
  13. package/dist/utils/saveResponse.js +7 -0
  14. package/dist/utils/spawnAsync.cjs +78 -0
  15. package/dist/{cjs/utils → utils}/spawnAsync.d.ts +0 -2
  16. package/dist/utils/spawnAsync.js +38 -0
  17. package/dist/utils/unzip.cjs +53 -0
  18. package/dist/utils/unzip.js +9 -0
  19. package/dist/utils/zip.cjs +56 -0
  20. package/dist/utils/zip.js +12 -0
  21. package/package.json +27 -15
  22. package/tsconfig.json +15 -0
  23. package/dist/cjs/index.js +0 -38
  24. package/dist/cjs/index.js.map +0 -7
  25. package/dist/cjs/utils/compress.js +0 -53
  26. package/dist/cjs/utils/compress.js.map +0 -7
  27. package/dist/cjs/utils/copy.js +0 -58
  28. package/dist/cjs/utils/copy.js.map +0 -7
  29. package/dist/cjs/utils/execAsync.d.ts +0 -36
  30. package/dist/cjs/utils/execAsync.js +0 -57
  31. package/dist/cjs/utils/execAsync.js.map +0 -7
  32. package/dist/cjs/utils/saveFile.js +0 -37
  33. package/dist/cjs/utils/saveFile.js.map +0 -7
  34. package/dist/cjs/utils/saveResponse.js +0 -37
  35. package/dist/cjs/utils/saveResponse.js.map +0 -7
  36. package/dist/cjs/utils/spawnAsync.js +0 -69
  37. package/dist/cjs/utils/spawnAsync.js.map +0 -7
  38. package/dist/cjs/utils/unzip.js +0 -45
  39. package/dist/cjs/utils/unzip.js.map +0 -7
  40. package/dist/cjs/utils/zip.js +0 -52
  41. package/dist/cjs/utils/zip.js.map +0 -7
  42. package/dist/esm/index.d.ts +0 -8
  43. package/dist/esm/index.js +0 -9
  44. package/dist/esm/index.js.map +0 -1
  45. package/dist/esm/utils/compress.d.ts +0 -11
  46. package/dist/esm/utils/compress.js +0 -30
  47. package/dist/esm/utils/compress.js.map +0 -1
  48. package/dist/esm/utils/copy.d.ts +0 -9
  49. package/dist/esm/utils/copy.js +0 -44
  50. package/dist/esm/utils/copy.js.map +0 -1
  51. package/dist/esm/utils/execAsync.js +0 -21
  52. package/dist/esm/utils/execAsync.js.map +0 -1
  53. package/dist/esm/utils/saveFile.d.ts +0 -10
  54. package/dist/esm/utils/saveFile.js +0 -15
  55. package/dist/esm/utils/saveFile.js.map +0 -1
  56. package/dist/esm/utils/saveResponse.d.ts +0 -6
  57. package/dist/esm/utils/saveResponse.js +0 -13
  58. package/dist/esm/utils/saveResponse.js.map +0 -1
  59. package/dist/esm/utils/spawnAsync.d.ts +0 -38
  60. package/dist/esm/utils/spawnAsync.js +0 -52
  61. package/dist/esm/utils/spawnAsync.js.map +0 -1
  62. package/dist/esm/utils/unzip.d.ts +0 -26
  63. package/dist/esm/utils/unzip.js +0 -24
  64. package/dist/esm/utils/unzip.js.map +0 -1
  65. package/dist/esm/utils/zip.d.ts +0 -38
  66. package/dist/esm/utils/zip.js +0 -30
  67. package/dist/esm/utils/zip.js.map +0 -1
  68. /package/dist/{cjs/index.d.ts → index.d.ts} +0 -0
  69. /package/dist/{cjs/utils → utils}/compress.d.ts +0 -0
  70. /package/dist/{cjs/utils → utils}/copy.d.ts +0 -0
  71. /package/dist/{cjs/utils → utils}/saveFile.d.ts +0 -0
  72. /package/dist/{cjs/utils → utils}/saveResponse.d.ts +0 -0
  73. /package/dist/{cjs/utils → utils}/unzip.d.ts +0 -0
  74. /package/dist/{cjs/utils → utils}/zip.d.ts +0 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ var __webpack_modules__ = {
3
+ "@/utils/compress": function(module) {
4
+ module.exports = require("./utils/compress.cjs");
5
+ },
6
+ "@/utils/copy": function(module) {
7
+ module.exports = require("./utils/copy.cjs");
8
+ },
9
+ "@/utils/execAsync": function(module) {
10
+ module.exports = require("./utils/execAsync.cjs");
11
+ },
12
+ "@/utils/saveFile": function(module) {
13
+ module.exports = require("./utils/saveFile.cjs");
14
+ },
15
+ "@/utils/saveResponse": function(module) {
16
+ module.exports = require("./utils/saveResponse.cjs");
17
+ },
18
+ "@/utils/spawnAsync": function(module) {
19
+ module.exports = require("./utils/spawnAsync.cjs");
20
+ },
21
+ "@/utils/unzip": function(module) {
22
+ module.exports = require("./utils/unzip.cjs");
23
+ },
24
+ "@/utils/zip": function(module) {
25
+ module.exports = require("./utils/zip.cjs");
26
+ }
27
+ };
28
+ var __webpack_module_cache__ = {};
29
+ function __webpack_require__(moduleId) {
30
+ var cachedModule = __webpack_module_cache__[moduleId];
31
+ if (void 0 !== cachedModule) return cachedModule.exports;
32
+ var module = __webpack_module_cache__[moduleId] = {
33
+ exports: {}
34
+ };
35
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
36
+ return module.exports;
37
+ }
38
+ (()=>{
39
+ __webpack_require__.n = (module)=>{
40
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
41
+ __webpack_require__.d(getter, {
42
+ a: getter
43
+ });
44
+ return getter;
45
+ };
46
+ })();
47
+ (()=>{
48
+ __webpack_require__.d = (exports1, definition)=>{
49
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
50
+ enumerable: true,
51
+ get: definition[key]
52
+ });
53
+ };
54
+ })();
55
+ (()=>{
56
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
57
+ })();
58
+ (()=>{
59
+ __webpack_require__.r = (exports1)=>{
60
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
61
+ value: 'Module'
62
+ });
63
+ Object.defineProperty(exports1, '__esModule', {
64
+ value: true
65
+ });
66
+ };
67
+ })();
68
+ var __webpack_exports__ = {};
69
+ (()=>{
70
+ __webpack_require__.r(__webpack_exports__);
71
+ var _utils_compress__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("@/utils/compress");
72
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
73
+ for(var __WEBPACK_IMPORT_KEY__ in _utils_compress__WEBPACK_IMPORTED_MODULE_0__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
74
+ return _utils_compress__WEBPACK_IMPORTED_MODULE_0__[key];
75
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
76
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
77
+ var _utils_copy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("@/utils/copy");
78
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
79
+ for(var __WEBPACK_IMPORT_KEY__ in _utils_copy__WEBPACK_IMPORTED_MODULE_1__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
80
+ return _utils_copy__WEBPACK_IMPORTED_MODULE_1__[key];
81
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
82
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
83
+ var _utils_execAsync__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("@/utils/execAsync");
84
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
85
+ for(var __WEBPACK_IMPORT_KEY__ in _utils_execAsync__WEBPACK_IMPORTED_MODULE_2__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
86
+ return _utils_execAsync__WEBPACK_IMPORTED_MODULE_2__[key];
87
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
88
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
89
+ var _utils_saveFile__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("@/utils/saveFile");
90
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
91
+ for(var __WEBPACK_IMPORT_KEY__ in _utils_saveFile__WEBPACK_IMPORTED_MODULE_3__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
92
+ return _utils_saveFile__WEBPACK_IMPORTED_MODULE_3__[key];
93
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
94
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
95
+ var _utils_saveResponse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("@/utils/saveResponse");
96
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
97
+ for(var __WEBPACK_IMPORT_KEY__ in _utils_saveResponse__WEBPACK_IMPORTED_MODULE_4__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
98
+ return _utils_saveResponse__WEBPACK_IMPORTED_MODULE_4__[key];
99
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
100
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
101
+ var _utils_spawnAsync__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("@/utils/spawnAsync");
102
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
103
+ for(var __WEBPACK_IMPORT_KEY__ in _utils_spawnAsync__WEBPACK_IMPORTED_MODULE_5__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
104
+ return _utils_spawnAsync__WEBPACK_IMPORTED_MODULE_5__[key];
105
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
106
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
107
+ var _utils_unzip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("@/utils/unzip");
108
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
109
+ for(var __WEBPACK_IMPORT_KEY__ in _utils_unzip__WEBPACK_IMPORTED_MODULE_6__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
110
+ return _utils_unzip__WEBPACK_IMPORTED_MODULE_6__[key];
111
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
112
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
113
+ var _utils_zip__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("@/utils/zip");
114
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
115
+ for(var __WEBPACK_IMPORT_KEY__ in _utils_zip__WEBPACK_IMPORTED_MODULE_7__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
116
+ return _utils_zip__WEBPACK_IMPORTED_MODULE_7__[key];
117
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
118
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
119
+ })();
120
+ for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
121
+ Object.defineProperty(exports, '__esModule', {
122
+ value: true
123
+ });
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ export * from "./utils/compress.js";
2
+ export * from "./utils/copy.js";
3
+ export * from "./utils/execAsync.js";
4
+ export * from "./utils/saveFile.js";
5
+ export * from "./utils/saveResponse.js";
6
+ export * from "./utils/spawnAsync.js";
7
+ export * from "./utils/unzip.js";
8
+ export * from "./utils/zip.js";
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ compress: ()=>compress
28
+ });
29
+ const external_fs_namespaceObject = require("fs");
30
+ const external_path_namespaceObject = require("path");
31
+ const external_tar_namespaceObject = require("tar");
32
+ async function compress({ input, output }) {
33
+ input = (0, external_path_namespaceObject.resolve)(input);
34
+ if (!(0, external_fs_namespaceObject.existsSync)(input)) throw new Error("Source folder does not exist");
35
+ const outputDir = (0, external_path_namespaceObject.dirname)(output);
36
+ if (!(0, external_fs_namespaceObject.existsSync)(outputDir)) (0, external_fs_namespaceObject.mkdirSync)(outputDir, {
37
+ recursive: true
38
+ });
39
+ await (0, external_tar_namespaceObject.create)({
40
+ gzip: true,
41
+ file: output,
42
+ cwd: (0, external_path_namespaceObject.dirname)(input)
43
+ }, [
44
+ (0, external_path_namespaceObject.basename)(input)
45
+ ]);
46
+ return (0, external_path_namespaceObject.resolve)(output);
47
+ }
48
+ exports.compress = __webpack_exports__.compress;
49
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
50
+ "compress"
51
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
52
+ Object.defineProperty(exports, '__esModule', {
53
+ value: true
54
+ });
@@ -0,0 +1,20 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_path__ from "path";
3
+ import * as __WEBPACK_EXTERNAL_MODULE_tar__ from "tar";
4
+ async function compress({ input, output }) {
5
+ input = (0, __WEBPACK_EXTERNAL_MODULE_path__.resolve)(input);
6
+ if (!(0, __WEBPACK_EXTERNAL_MODULE_fs__.existsSync)(input)) throw new Error("Source folder does not exist");
7
+ const outputDir = (0, __WEBPACK_EXTERNAL_MODULE_path__.dirname)(output);
8
+ if (!(0, __WEBPACK_EXTERNAL_MODULE_fs__.existsSync)(outputDir)) (0, __WEBPACK_EXTERNAL_MODULE_fs__.mkdirSync)(outputDir, {
9
+ recursive: true
10
+ });
11
+ await (0, __WEBPACK_EXTERNAL_MODULE_tar__.create)({
12
+ gzip: true,
13
+ file: output,
14
+ cwd: (0, __WEBPACK_EXTERNAL_MODULE_path__.dirname)(input)
15
+ }, [
16
+ (0, __WEBPACK_EXTERNAL_MODULE_path__.basename)(input)
17
+ ]);
18
+ return (0, __WEBPACK_EXTERNAL_MODULE_path__.resolve)(output);
19
+ }
20
+ export { compress };
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ copy: ()=>copy
28
+ });
29
+ const external_fs_namespaceObject = require("fs");
30
+ const promises_namespaceObject = require("fs/promises");
31
+ const external_path_namespaceObject = require("path");
32
+ async function copy({ input, output, mode }) {
33
+ if (Array.isArray(input)) {
34
+ for (const item of input)await copy({
35
+ input: item,
36
+ output,
37
+ mode
38
+ });
39
+ return;
40
+ }
41
+ if (!(0, external_fs_namespaceObject.existsSync)(output)) await (0, promises_namespaceObject.mkdir)(output, {
42
+ recursive: true
43
+ });
44
+ const status = await (0, promises_namespaceObject.stat)(input);
45
+ const { base } = (0, external_path_namespaceObject.parse)(input);
46
+ if (status.isFile()) {
47
+ await (0, promises_namespaceObject.copyFile)(input, (0, external_path_namespaceObject.join)(output, base), mode);
48
+ return;
49
+ }
50
+ if (status.isDirectory()) {
51
+ await (0, promises_namespaceObject.mkdir)((0, external_path_namespaceObject.join)(output, base), {
52
+ recursive: true
53
+ });
54
+ const entries = await (0, promises_namespaceObject.readdir)(input, {
55
+ withFileTypes: true
56
+ });
57
+ for (const entry of entries)await copy({
58
+ input: (0, external_path_namespaceObject.join)(input, entry.name),
59
+ output: (0, external_path_namespaceObject.join)(output, base),
60
+ mode
61
+ });
62
+ }
63
+ }
64
+ exports.copy = __webpack_exports__.copy;
65
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
66
+ "copy"
67
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
68
+ Object.defineProperty(exports, '__esModule', {
69
+ value: true
70
+ });
@@ -0,0 +1,36 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__ from "fs/promises";
3
+ import * as __WEBPACK_EXTERNAL_MODULE_path__ from "path";
4
+ async function copy({ input, output, mode }) {
5
+ if (Array.isArray(input)) {
6
+ for (const item of input)await copy({
7
+ input: item,
8
+ output,
9
+ mode
10
+ });
11
+ return;
12
+ }
13
+ if (!(0, __WEBPACK_EXTERNAL_MODULE_fs__.existsSync)(output)) await (0, __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__.mkdir)(output, {
14
+ recursive: true
15
+ });
16
+ const status = await (0, __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__.stat)(input);
17
+ const { base } = (0, __WEBPACK_EXTERNAL_MODULE_path__.parse)(input);
18
+ if (status.isFile()) {
19
+ await (0, __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__.copyFile)(input, (0, __WEBPACK_EXTERNAL_MODULE_path__.join)(output, base), mode);
20
+ return;
21
+ }
22
+ if (status.isDirectory()) {
23
+ await (0, __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__.mkdir)((0, __WEBPACK_EXTERNAL_MODULE_path__.join)(output, base), {
24
+ recursive: true
25
+ });
26
+ const entries = await (0, __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__.readdir)(input, {
27
+ withFileTypes: true
28
+ });
29
+ for (const entry of entries)await copy({
30
+ input: (0, __WEBPACK_EXTERNAL_MODULE_path__.join)(input, entry.name),
31
+ output: (0, __WEBPACK_EXTERNAL_MODULE_path__.join)(output, base),
32
+ mode
33
+ });
34
+ }
35
+ }
36
+ export { copy };
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, definition)=>{
14
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ };
19
+ })();
20
+ (()=>{
21
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
+ })();
23
+ (()=>{
24
+ __webpack_require__.r = (exports1)=>{
25
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
+ value: 'Module'
27
+ });
28
+ Object.defineProperty(exports1, '__esModule', {
29
+ value: true
30
+ });
31
+ };
32
+ })();
33
+ var __webpack_exports__ = {};
34
+ __webpack_require__.r(__webpack_exports__);
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ execAsync: ()=>execAsync
37
+ });
38
+ const external_child_process_namespaceObject = require("child_process");
39
+ const external_iconv_lite_namespaceObject = require("iconv-lite");
40
+ var external_iconv_lite_default = /*#__PURE__*/ __webpack_require__.n(external_iconv_lite_namespaceObject);
41
+ async function execAsync(command, options) {
42
+ const decode = options?.decode;
43
+ if ("object" == typeof options && null !== options && options.decode) {
44
+ const { decode, ...rest } = options;
45
+ options = rest;
46
+ }
47
+ return await new Promise((resolve, reject)=>{
48
+ (0, external_child_process_namespaceObject.exec)(command, options, (error, stdout, stderr)=>{
49
+ if (error) return reject(error);
50
+ if (decode && stdout instanceof Buffer) return resolve(external_iconv_lite_default().decode(stdout, decode.encoding, decode.options));
51
+ resolve(stdout);
52
+ });
53
+ });
54
+ }
55
+ exports.execAsync = __webpack_exports__.execAsync;
56
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
57
+ "execAsync"
58
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
59
+ Object.defineProperty(exports, '__esModule', {
60
+ value: true
61
+ });
@@ -1,7 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- /// <reference types="node" />
4
- /// <reference types="node" />
5
1
  import { ExecOptions } from "child_process";
6
2
  import { ObjectEncodingOptions } from "fs";
7
3
  import { Options } from "iconv-lite";
@@ -0,0 +1,17 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_child_process__ from "child_process";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_iconv_lite_e3756a92__ from "iconv-lite";
3
+ async function execAsync(command, options) {
4
+ const decode = options?.decode;
5
+ if ("object" == typeof options && null !== options && options.decode) {
6
+ const { decode, ...rest } = options;
7
+ options = rest;
8
+ }
9
+ return await new Promise((resolve, reject)=>{
10
+ (0, __WEBPACK_EXTERNAL_MODULE_child_process__.exec)(command, options, (error, stdout, stderr)=>{
11
+ if (error) return reject(error);
12
+ if (decode && stdout instanceof Buffer) return resolve(__WEBPACK_EXTERNAL_MODULE_iconv_lite_e3756a92__["default"].decode(stdout, decode.encoding, decode.options));
13
+ resolve(stdout);
14
+ });
15
+ });
16
+ }
17
+ export { execAsync };
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ saveFile: ()=>saveFile
28
+ });
29
+ const external_fs_namespaceObject = require("fs");
30
+ const external_stream_namespaceObject = require("stream");
31
+ async function saveFile({ input, output }) {
32
+ await new Promise((resolve, reject)=>{
33
+ const writeAble = (0, external_fs_namespaceObject.createWriteStream)(output);
34
+ external_stream_namespaceObject.Readable.fromWeb(input.stream()).pipe(writeAble).on("finish", resolve).on("error", reject);
35
+ });
36
+ }
37
+ exports.saveFile = __webpack_exports__.saveFile;
38
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
39
+ "saveFile"
40
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
41
+ Object.defineProperty(exports, '__esModule', {
42
+ value: true
43
+ });
@@ -0,0 +1,9 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_stream__ from "stream";
3
+ async function saveFile({ input, output }) {
4
+ await new Promise((resolve, reject)=>{
5
+ const writeAble = (0, __WEBPACK_EXTERNAL_MODULE_fs__.createWriteStream)(output);
6
+ __WEBPACK_EXTERNAL_MODULE_stream__.Readable.fromWeb(input.stream()).pipe(writeAble).on("finish", resolve).on("error", reject);
7
+ });
8
+ }
9
+ export { saveFile };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ saveResponse: ()=>saveResponse
28
+ });
29
+ const external_fs_namespaceObject = require("fs");
30
+ const external_stream_namespaceObject = require("stream");
31
+ async function saveResponse(response, file) {
32
+ const writeable = (0, external_fs_namespaceObject.createWriteStream)(file);
33
+ await new Promise((resolve, reject)=>external_stream_namespaceObject.Readable.fromWeb(response.body).pipe(writeable).on("close", resolve).on("error", reject));
34
+ }
35
+ exports.saveResponse = __webpack_exports__.saveResponse;
36
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
37
+ "saveResponse"
38
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
39
+ Object.defineProperty(exports, '__esModule', {
40
+ value: true
41
+ });
@@ -0,0 +1,7 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_stream__ from "stream";
3
+ async function saveResponse(response, file) {
4
+ const writeable = (0, __WEBPACK_EXTERNAL_MODULE_fs__.createWriteStream)(file);
5
+ await new Promise((resolve, reject)=>__WEBPACK_EXTERNAL_MODULE_stream__.Readable.fromWeb(response.body).pipe(writeable).on("close", resolve).on("error", reject));
6
+ }
7
+ export { saveResponse };
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ getDefaultOptions: ()=>getDefaultOptions,
28
+ spawnAsync: ()=>spawnAsync,
29
+ setDefaultOptions: ()=>setDefaultOptions
30
+ });
31
+ const external_child_process_namespaceObject = require("child_process");
32
+ let defaultOptions = {};
33
+ function getDefaultOptions() {
34
+ return defaultOptions;
35
+ }
36
+ function setDefaultOptions(options) {
37
+ if ("function" == typeof options) {
38
+ defaultOptions = options(defaultOptions);
39
+ return;
40
+ }
41
+ defaultOptions = options;
42
+ return defaultOptions;
43
+ }
44
+ function spawnAsync(command, args, options) {
45
+ let child;
46
+ const promise = new Promise((resolve, reject)=>{
47
+ if (Array.isArray(args)) options = {
48
+ ...defaultOptions,
49
+ ...options
50
+ };
51
+ else args = {
52
+ ...defaultOptions,
53
+ ...args
54
+ };
55
+ child = (0, external_child_process_namespaceObject.spawn)(command, args, options);
56
+ child.on("exit", (code)=>{
57
+ if (0 === code) return resolve(child);
58
+ if (Array.isArray(args)) {
59
+ const args2 = args.map((item)=>item.trim()).filter(Boolean);
60
+ if (args2.length > 0) command = `${command} ${args2.join(" ")}`;
61
+ }
62
+ reject(new Error(`spawn "${command}" failed with code ${code}`));
63
+ });
64
+ });
65
+ promise.child = child;
66
+ return promise;
67
+ }
68
+ exports.getDefaultOptions = __webpack_exports__.getDefaultOptions;
69
+ exports.setDefaultOptions = __webpack_exports__.setDefaultOptions;
70
+ exports.spawnAsync = __webpack_exports__.spawnAsync;
71
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
72
+ "getDefaultOptions",
73
+ "setDefaultOptions",
74
+ "spawnAsync"
75
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
76
+ Object.defineProperty(exports, '__esModule', {
77
+ value: true
78
+ });
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { ChildProcess, ChildProcessByStdio, ChildProcessWithoutNullStreams, SpawnOptions, SpawnOptionsWithStdioTuple, SpawnOptionsWithoutStdio, StdioNull, StdioPipe } from "child_process";
4
2
  import { Readable, Writable } from "stream";
5
3
  export interface PromiseWithChildProcess<T> extends Promise<T> {
@@ -0,0 +1,38 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_child_process__ from "child_process";
2
+ let defaultOptions = {};
3
+ function getDefaultOptions() {
4
+ return defaultOptions;
5
+ }
6
+ function setDefaultOptions(options) {
7
+ if ("function" == typeof options) {
8
+ defaultOptions = options(defaultOptions);
9
+ return;
10
+ }
11
+ defaultOptions = options;
12
+ return defaultOptions;
13
+ }
14
+ function spawnAsync(command, args, options) {
15
+ let child;
16
+ const promise = new Promise((resolve, reject)=>{
17
+ if (Array.isArray(args)) options = {
18
+ ...defaultOptions,
19
+ ...options
20
+ };
21
+ else args = {
22
+ ...defaultOptions,
23
+ ...args
24
+ };
25
+ child = (0, __WEBPACK_EXTERNAL_MODULE_child_process__.spawn)(command, args, options);
26
+ child.on("exit", (code)=>{
27
+ if (0 === code) return resolve(child);
28
+ if (Array.isArray(args)) {
29
+ const args2 = args.map((item)=>item.trim()).filter(Boolean);
30
+ if (args2.length > 0) command = `${command} ${args2.join(" ")}`;
31
+ }
32
+ reject(new Error(`spawn "${command}" failed with code ${code}`));
33
+ });
34
+ });
35
+ promise.child = child;
36
+ return promise;
37
+ }
38
+ export { getDefaultOptions, setDefaultOptions, spawnAsync };