orcaq 1.0.21 → 1.0.26

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 (248) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/AKIL8y6B.js +1 -0
  3. package/.output/public/_nuxt/B5vWsFeq.js +160 -0
  4. package/.output/public/_nuxt/B7OaQ1wH.js +8 -0
  5. package/.output/public/_nuxt/BG-9_o0s.js +3 -0
  6. package/.output/public/_nuxt/BHnp06h8.js +1 -0
  7. package/.output/public/_nuxt/BKxFOGv6.js +1 -0
  8. package/.output/public/_nuxt/{8qASMGdV.js → BNIRlgC1.js} +1 -1
  9. package/.output/public/_nuxt/BNdHe5KI.js +1 -0
  10. package/.output/public/_nuxt/BQANhp-y.js +1 -0
  11. package/.output/public/_nuxt/BUYy1lWT.js +215 -0
  12. package/.output/public/_nuxt/Bdtn2mn5.js +1 -0
  13. package/.output/public/_nuxt/Ber6tLDb.js +1 -0
  14. package/.output/public/_nuxt/BgEovngA.js +1 -0
  15. package/.output/public/_nuxt/BhgYrVrc.js +6 -0
  16. package/.output/public/_nuxt/{CrgoNCm2.js → BmnOz39b.js} +2 -2
  17. package/.output/public/_nuxt/BuKJVBv4.js +1 -0
  18. package/.output/public/_nuxt/BxMjn94S.js +4 -0
  19. package/.output/public/_nuxt/C1dxTB9p.js +39 -0
  20. package/.output/public/_nuxt/C4mc67xO.js +31 -0
  21. package/.output/public/_nuxt/CAOPafml.js +1 -0
  22. package/.output/public/_nuxt/CPxn9ATh.js +1 -0
  23. package/.output/public/_nuxt/CQ_P7x7z.js +3 -0
  24. package/.output/public/_nuxt/CS9PCQVw.js +6 -0
  25. package/.output/public/_nuxt/{CbcyysXi.js → CdEjcJco.js} +1 -1
  26. package/.output/public/_nuxt/CeQk_zaG.js +3867 -0
  27. package/.output/public/_nuxt/CgN2MmkB.js +47 -0
  28. package/.output/public/_nuxt/CijEBUIh.js +9 -0
  29. package/.output/public/_nuxt/Cn-07UHL.js +1 -0
  30. package/.output/public/_nuxt/Co87DPdr.js +18 -0
  31. package/.output/public/_nuxt/D0LmHvgn.js +13 -0
  32. package/.output/public/_nuxt/D4_A4fm4.js +1 -0
  33. package/.output/public/_nuxt/D8pqASdN.js +1 -0
  34. package/.output/public/_nuxt/DAs4584G.js +72 -0
  35. package/.output/public/_nuxt/DBO1CAN4.js +1 -0
  36. package/.output/public/_nuxt/DF7Phtj8.js +39 -0
  37. package/.output/public/_nuxt/DMMO4O3Y.js +1 -0
  38. package/.output/public/_nuxt/DP-hoxaC.js +1 -0
  39. package/.output/public/_nuxt/DREcM-oC.js +20 -0
  40. package/.output/public/_nuxt/DX-rdvVh.js +28 -0
  41. package/.output/public/_nuxt/DXei3mDv.js +1 -0
  42. package/.output/public/_nuxt/DZcRPyDc.js +26 -0
  43. package/.output/public/_nuxt/D_QjJZ_n.js +1 -0
  44. package/.output/public/_nuxt/DhSSuHOz.js +32 -0
  45. package/.output/public/_nuxt/Dj2IVxO7.js +1 -0
  46. package/.output/public/_nuxt/DmMeuvwr.js +1 -0
  47. package/.output/public/_nuxt/DqlhGxxN.js +32 -0
  48. package/.output/public/_nuxt/GmXmO94-.js +1 -0
  49. package/.output/public/_nuxt/HPyUOgdi.js +1 -0
  50. package/.output/public/_nuxt/MdxV8r4v.js +1 -0
  51. package/.output/public/_nuxt/Mp6jDt1I.js +1 -0
  52. package/.output/public/_nuxt/QuickQuery.h4epNPla.css +1 -0
  53. package/.output/public/_nuxt/{CustomEdge.BNBpjEHb.css → WrapperErdDiagram.DeMTjOwN.css} +1 -1
  54. package/.output/public/_nuxt/Zvfofmwe.js +1 -0
  55. package/.output/public/_nuxt/{_fileId_.DmPfwyyD.css → _fileId_.BHiWIaF7.css} +1 -1
  56. package/.output/public/_nuxt/builds/latest.json +1 -1
  57. package/.output/public/_nuxt/builds/meta/db42d692-1628-4dd8-9442-d7621bdd9ac6.json +1 -0
  58. package/.output/public/_nuxt/cQYBDqKG.js +1 -0
  59. package/.output/public/_nuxt/default.BfdyU-m9.css +1 -0
  60. package/.output/public/_nuxt/entry.0UG0MnUy.css +1 -0
  61. package/.output/public/_nuxt/fIC3FurW.js +1 -0
  62. package/.output/public/_nuxt/{index.CrXmf4gr.css → index.BHg08rtV.css} +1 -1
  63. package/.output/public/_nuxt/kehy-5uo.js +1 -0
  64. package/.output/public/_nuxt/n9bD6NrC.js +2 -0
  65. package/.output/public/_nuxt/ykQL1ia3.js +271 -0
  66. package/.output/public/_nuxt/zD3bTrJp.js +1 -0
  67. package/.output/server/chunks/build/client.manifest.mjs +509 -358
  68. package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
  69. package/.output/server/chunks/nitro/nitro.mjs +504 -274
  70. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  71. package/.output/server/chunks/routes/api/database-export/export-database.mjs +139 -0
  72. package/.output/server/chunks/routes/api/database-export/export-database.mjs.map +1 -0
  73. package/.output/server/chunks/routes/api/database-import/import-database.mjs +178 -0
  74. package/.output/server/chunks/routes/api/database-import/import-database.mjs.map +1 -0
  75. package/.output/server/chunks/routes/api/database-roles/adapters/postgres.adapter.mjs +700 -0
  76. package/.output/server/chunks/routes/api/database-roles/adapters/postgres.adapter.mjs.map +1 -0
  77. package/.output/server/chunks/routes/api/database-roles/adapters/types.mjs +2 -0
  78. package/.output/server/chunks/routes/api/database-roles/adapters/types.mjs.map +1 -0
  79. package/.output/server/chunks/routes/api/database-roles/create-role.mjs +46 -0
  80. package/.output/server/chunks/routes/api/database-roles/create-role.mjs.map +1 -0
  81. package/.output/server/chunks/routes/api/database-roles/delete-role.mjs +34 -0
  82. package/.output/server/chunks/routes/api/database-roles/delete-role.mjs.map +1 -0
  83. package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs +34 -0
  84. package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs.map +1 -0
  85. package/.output/server/chunks/routes/api/database-roles/get-databases.mjs +32 -0
  86. package/.output/server/chunks/routes/api/database-roles/get-databases.mjs.map +1 -0
  87. package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs +32 -0
  88. package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs.map +1 -0
  89. package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs +40 -0
  90. package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs.map +1 -0
  91. package/.output/server/chunks/routes/api/database-roles/get-role.mjs +26 -0
  92. package/.output/server/chunks/routes/api/database-roles/get-role.mjs.map +1 -0
  93. package/.output/server/chunks/routes/api/database-roles/get-roles.mjs +26 -0
  94. package/.output/server/chunks/routes/api/database-roles/get-roles.mjs.map +1 -0
  95. package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs +38 -0
  96. package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs.map +1 -0
  97. package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs +32 -0
  98. package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs.map +1 -0
  99. package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs +43 -0
  100. package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs.map +1 -0
  101. package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs +41 -0
  102. package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs.map +1 -0
  103. package/.output/server/chunks/routes/api/database-roles/index.mjs +39 -0
  104. package/.output/server/chunks/routes/api/database-roles/index.mjs.map +1 -0
  105. package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs +41 -0
  106. package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs.map +1 -0
  107. package/.output/server/chunks/routes/api/delete-function.mjs +65 -0
  108. package/.output/server/chunks/routes/api/delete-function.mjs.map +1 -0
  109. package/.output/server/chunks/routes/api/execute-bulk-delete.mjs +1 -1
  110. package/.output/server/chunks/routes/api/execute-bulk-delete.mjs.map +1 -1
  111. package/.output/server/chunks/routes/api/execute-bulk-update.mjs +1 -1
  112. package/.output/server/chunks/routes/api/execute-bulk-update.mjs.map +1 -1
  113. package/.output/server/chunks/routes/api/export-table-data.mjs +229 -0
  114. package/.output/server/chunks/routes/api/export-table-data.mjs.map +1 -0
  115. package/.output/server/chunks/routes/api/get-function-signature.mjs +96 -0
  116. package/.output/server/chunks/routes/api/get-function-signature.mjs.map +1 -0
  117. package/.output/server/chunks/routes/api/get-one-function.mjs +8 -2
  118. package/.output/server/chunks/routes/api/get-one-function.mjs.map +1 -1
  119. package/.output/server/chunks/routes/api/get-over-view-views.mjs +44 -0
  120. package/.output/server/chunks/routes/api/get-over-view-views.mjs.map +1 -0
  121. package/.output/server/chunks/routes/api/get-reverse-table-schemas.mjs +21 -10
  122. package/.output/server/chunks/routes/api/get-reverse-table-schemas.mjs.map +1 -1
  123. package/.output/server/chunks/routes/api/get-schema-meta-data.mjs +73 -5
  124. package/.output/server/chunks/routes/api/get-schema-meta-data.mjs.map +1 -1
  125. package/.output/server/chunks/routes/api/get-table-ddl.mjs +185 -0
  126. package/.output/server/chunks/routes/api/get-table-ddl.mjs.map +1 -0
  127. package/.output/server/chunks/routes/api/get-view-definition.mjs +57 -0
  128. package/.output/server/chunks/routes/api/get-view-definition.mjs.map +1 -0
  129. package/.output/server/chunks/routes/api/getMetricMonitor.mjs.map +1 -1
  130. package/.output/server/chunks/routes/api/raw-execute.mjs +1 -2
  131. package/.output/server/chunks/routes/api/raw-execute.mjs.map +1 -1
  132. package/.output/server/chunks/routes/api/rename-function.mjs +77 -0
  133. package/.output/server/chunks/routes/api/rename-function.mjs.map +1 -0
  134. package/.output/server/chunks/routes/api/update-function.mjs +65 -0
  135. package/.output/server/chunks/routes/api/update-function.mjs.map +1 -0
  136. package/.output/server/chunks/routes/renderer.mjs +1 -1
  137. package/.output/server/index.mjs +1 -1
  138. package/.output/server/node_modules/cross-spawn/index.js +39 -0
  139. package/.output/server/node_modules/cross-spawn/lib/enoent.js +59 -0
  140. package/.output/server/node_modules/cross-spawn/lib/parse.js +91 -0
  141. package/.output/server/node_modules/cross-spawn/lib/util/escape.js +47 -0
  142. package/.output/server/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
  143. package/.output/server/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
  144. package/.output/server/node_modules/cross-spawn/package.json +73 -0
  145. package/.output/server/node_modules/execa/index.js +268 -0
  146. package/.output/server/node_modules/execa/lib/command.js +52 -0
  147. package/.output/server/node_modules/execa/lib/error.js +88 -0
  148. package/.output/server/node_modules/execa/lib/kill.js +115 -0
  149. package/.output/server/node_modules/execa/lib/promise.js +46 -0
  150. package/.output/server/node_modules/execa/lib/stdio.js +52 -0
  151. package/.output/server/node_modules/execa/lib/stream.js +97 -0
  152. package/.output/server/node_modules/execa/package.json +74 -0
  153. package/.output/server/node_modules/get-stream/buffer-stream.js +52 -0
  154. package/.output/server/node_modules/get-stream/index.js +61 -0
  155. package/.output/server/node_modules/get-stream/package.json +47 -0
  156. package/.output/server/node_modules/human-signals/build/src/core.js +273 -0
  157. package/.output/server/node_modules/human-signals/build/src/main.js +71 -0
  158. package/.output/server/node_modules/human-signals/build/src/realtime.js +19 -0
  159. package/.output/server/node_modules/human-signals/build/src/signals.js +35 -0
  160. package/.output/server/node_modules/human-signals/package.json +64 -0
  161. package/.output/server/node_modules/is-stream/index.js +28 -0
  162. package/.output/server/node_modules/is-stream/package.json +42 -0
  163. package/.output/server/node_modules/isexe/index.js +57 -0
  164. package/.output/server/node_modules/isexe/mode.js +41 -0
  165. package/.output/server/node_modules/isexe/package.json +31 -0
  166. package/.output/server/node_modules/isexe/windows.js +42 -0
  167. package/.output/server/node_modules/merge-stream/index.js +41 -0
  168. package/.output/server/node_modules/merge-stream/package.json +19 -0
  169. package/.output/server/node_modules/mimic-fn/index.js +13 -0
  170. package/.output/server/node_modules/mimic-fn/package.json +42 -0
  171. package/.output/server/node_modules/npm-run-path/index.js +47 -0
  172. package/.output/server/node_modules/npm-run-path/package.json +44 -0
  173. package/.output/server/node_modules/onetime/index.js +44 -0
  174. package/.output/server/node_modules/onetime/package.json +43 -0
  175. package/.output/server/node_modules/path-key/index.js +16 -0
  176. package/.output/server/node_modules/path-key/package.json +39 -0
  177. package/.output/server/node_modules/pg-copy-streams/copy-both.js +267 -0
  178. package/.output/server/node_modules/pg-copy-streams/copy-from.js +173 -0
  179. package/.output/server/node_modules/pg-copy-streams/copy-to.js +177 -0
  180. package/.output/server/node_modules/pg-copy-streams/index.js +17 -0
  181. package/.output/server/node_modules/pg-copy-streams/message-formats.js +27 -0
  182. package/.output/server/node_modules/pg-copy-streams/obuf.js +376 -0
  183. package/.output/server/node_modules/pg-copy-streams/package.json +51 -0
  184. package/.output/server/node_modules/pg-dump-restore/lib/common.js +33 -0
  185. package/.output/server/node_modules/pg-dump-restore/lib/index.js +9 -0
  186. package/.output/server/node_modules/pg-dump-restore/lib/pg-dump.js +95 -0
  187. package/.output/server/node_modules/pg-dump-restore/lib/pg-restore.js +87 -0
  188. package/.output/server/node_modules/pg-dump-restore/package.json +66 -0
  189. package/.output/server/node_modules/pg-query-stream/esm/index.mjs +5 -0
  190. package/.output/server/node_modules/shebang-command/index.js +19 -0
  191. package/.output/server/node_modules/shebang-command/package.json +34 -0
  192. package/.output/server/node_modules/shebang-regex/index.js +2 -0
  193. package/.output/server/node_modules/shebang-regex/package.json +35 -0
  194. package/.output/server/node_modules/signal-exit/index.js +202 -0
  195. package/.output/server/node_modules/signal-exit/package.json +38 -0
  196. package/.output/server/node_modules/signal-exit/signals.js +53 -0
  197. package/.output/server/node_modules/strip-final-newline/index.js +16 -0
  198. package/.output/server/node_modules/strip-final-newline/package.json +40 -0
  199. package/.output/server/node_modules/which/package.json +43 -0
  200. package/.output/server/node_modules/which/which.js +125 -0
  201. package/.output/server/package.json +19 -1
  202. package/package.json +1 -1
  203. package/.output/public/_nuxt/9lJACZIQ.js +0 -19
  204. package/.output/public/_nuxt/B2DnNiWd.js +0 -1
  205. package/.output/public/_nuxt/BH83_dXo.js +0 -39
  206. package/.output/public/_nuxt/BIKqrFbQ.js +0 -1
  207. package/.output/public/_nuxt/BNjPC06x.js +0 -1
  208. package/.output/public/_nuxt/BPQ-Pz1w.js +0 -39
  209. package/.output/public/_nuxt/BRpgKkVT.js +0 -51
  210. package/.output/public/_nuxt/BTCLPbPY.js +0 -4
  211. package/.output/public/_nuxt/BUV-RarV.js +0 -1
  212. package/.output/public/_nuxt/Bh6RgYlO.js +0 -1
  213. package/.output/public/_nuxt/Bq3cyzOD.js +0 -1
  214. package/.output/public/_nuxt/Bt9sU68B.js +0 -9
  215. package/.output/public/_nuxt/BwpH2ZxJ.js +0 -1
  216. package/.output/public/_nuxt/C25Tmn1m.js +0 -1
  217. package/.output/public/_nuxt/C2HlI1ss.js +0 -1
  218. package/.output/public/_nuxt/CU3ZV9iV.js +0 -1
  219. package/.output/public/_nuxt/CepyvMhE.js +0 -1
  220. package/.output/public/_nuxt/CuBKbBH_.js +0 -1
  221. package/.output/public/_nuxt/CulD8qYQ.js +0 -193
  222. package/.output/public/_nuxt/CylkLpwm.js +0 -1
  223. package/.output/public/_nuxt/D-bWLYHw.js +0 -1
  224. package/.output/public/_nuxt/D-zecHND.js +0 -1
  225. package/.output/public/_nuxt/D8vj6kFe.js +0 -160
  226. package/.output/public/_nuxt/DIETYtCL.js +0 -1
  227. package/.output/public/_nuxt/DJ4vUzxS.js +0 -1
  228. package/.output/public/_nuxt/DK-itzXx.js +0 -8
  229. package/.output/public/_nuxt/DL3T5jYo.js +0 -3867
  230. package/.output/public/_nuxt/DUsuhY9i.js +0 -1
  231. package/.output/public/_nuxt/DXV2HFBA.js +0 -224
  232. package/.output/public/_nuxt/Dh2zppOR.js +0 -1
  233. package/.output/public/_nuxt/DlAUqK2U.js +0 -1
  234. package/.output/public/_nuxt/DlmSeCnw.js +0 -5
  235. package/.output/public/_nuxt/DswTpYG4.js +0 -1
  236. package/.output/public/_nuxt/G830WtVn.js +0 -1
  237. package/.output/public/_nuxt/ICwM1E4-.js +0 -15
  238. package/.output/public/_nuxt/QZbJy9YW.js +0 -31
  239. package/.output/public/_nuxt/QuickQueryTable.DS_ON57S.css +0 -1
  240. package/.output/public/_nuxt/UXhX8z2W.js +0 -1
  241. package/.output/public/_nuxt/WrapperErdDiagram.DwhUd9Wr.css +0 -1
  242. package/.output/public/_nuxt/_tabViewId_.9Axt3zoi.css +0 -1
  243. package/.output/public/_nuxt/builds/meta/03cede5c-c45c-41b3-ac1a-73756bb8cff0.json +0 -1
  244. package/.output/public/_nuxt/default.DixIpIal.css +0 -1
  245. package/.output/public/_nuxt/entry.GqPNPe1e.css +0 -1
  246. package/.output/public/_nuxt/ivUnXl9B.js +0 -1
  247. package/.output/public/_nuxt/pAheHeBV.js +0 -36
  248. package/.output/public/_nuxt/s5fCn4j5.js +0 -1
@@ -0,0 +1,88 @@
1
+ 'use strict';
2
+ const {signalsByName} = require('human-signals');
3
+
4
+ const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => {
5
+ if (timedOut) {
6
+ return `timed out after ${timeout} milliseconds`;
7
+ }
8
+
9
+ if (isCanceled) {
10
+ return 'was canceled';
11
+ }
12
+
13
+ if (errorCode !== undefined) {
14
+ return `failed with ${errorCode}`;
15
+ }
16
+
17
+ if (signal !== undefined) {
18
+ return `was killed with ${signal} (${signalDescription})`;
19
+ }
20
+
21
+ if (exitCode !== undefined) {
22
+ return `failed with exit code ${exitCode}`;
23
+ }
24
+
25
+ return 'failed';
26
+ };
27
+
28
+ const makeError = ({
29
+ stdout,
30
+ stderr,
31
+ all,
32
+ error,
33
+ signal,
34
+ exitCode,
35
+ command,
36
+ escapedCommand,
37
+ timedOut,
38
+ isCanceled,
39
+ killed,
40
+ parsed: {options: {timeout}}
41
+ }) => {
42
+ // `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`.
43
+ // We normalize them to `undefined`
44
+ exitCode = exitCode === null ? undefined : exitCode;
45
+ signal = signal === null ? undefined : signal;
46
+ const signalDescription = signal === undefined ? undefined : signalsByName[signal].description;
47
+
48
+ const errorCode = error && error.code;
49
+
50
+ const prefix = getErrorPrefix({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled});
51
+ const execaMessage = `Command ${prefix}: ${command}`;
52
+ const isError = Object.prototype.toString.call(error) === '[object Error]';
53
+ const shortMessage = isError ? `${execaMessage}\n${error.message}` : execaMessage;
54
+ const message = [shortMessage, stderr, stdout].filter(Boolean).join('\n');
55
+
56
+ if (isError) {
57
+ error.originalMessage = error.message;
58
+ error.message = message;
59
+ } else {
60
+ error = new Error(message);
61
+ }
62
+
63
+ error.shortMessage = shortMessage;
64
+ error.command = command;
65
+ error.escapedCommand = escapedCommand;
66
+ error.exitCode = exitCode;
67
+ error.signal = signal;
68
+ error.signalDescription = signalDescription;
69
+ error.stdout = stdout;
70
+ error.stderr = stderr;
71
+
72
+ if (all !== undefined) {
73
+ error.all = all;
74
+ }
75
+
76
+ if ('bufferedData' in error) {
77
+ delete error.bufferedData;
78
+ }
79
+
80
+ error.failed = true;
81
+ error.timedOut = Boolean(timedOut);
82
+ error.isCanceled = isCanceled;
83
+ error.killed = killed && !timedOut;
84
+
85
+ return error;
86
+ };
87
+
88
+ module.exports = makeError;
@@ -0,0 +1,115 @@
1
+ 'use strict';
2
+ const os = require('os');
3
+ const onExit = require('signal-exit');
4
+
5
+ const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5;
6
+
7
+ // Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior
8
+ const spawnedKill = (kill, signal = 'SIGTERM', options = {}) => {
9
+ const killResult = kill(signal);
10
+ setKillTimeout(kill, signal, options, killResult);
11
+ return killResult;
12
+ };
13
+
14
+ const setKillTimeout = (kill, signal, options, killResult) => {
15
+ if (!shouldForceKill(signal, options, killResult)) {
16
+ return;
17
+ }
18
+
19
+ const timeout = getForceKillAfterTimeout(options);
20
+ const t = setTimeout(() => {
21
+ kill('SIGKILL');
22
+ }, timeout);
23
+
24
+ // Guarded because there's no `.unref()` when `execa` is used in the renderer
25
+ // process in Electron. This cannot be tested since we don't run tests in
26
+ // Electron.
27
+ // istanbul ignore else
28
+ if (t.unref) {
29
+ t.unref();
30
+ }
31
+ };
32
+
33
+ const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => {
34
+ return isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
35
+ };
36
+
37
+ const isSigterm = signal => {
38
+ return signal === os.constants.signals.SIGTERM ||
39
+ (typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM');
40
+ };
41
+
42
+ const getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => {
43
+ if (forceKillAfterTimeout === true) {
44
+ return DEFAULT_FORCE_KILL_TIMEOUT;
45
+ }
46
+
47
+ if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
48
+ throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
49
+ }
50
+
51
+ return forceKillAfterTimeout;
52
+ };
53
+
54
+ // `childProcess.cancel()`
55
+ const spawnedCancel = (spawned, context) => {
56
+ const killResult = spawned.kill();
57
+
58
+ if (killResult) {
59
+ context.isCanceled = true;
60
+ }
61
+ };
62
+
63
+ const timeoutKill = (spawned, signal, reject) => {
64
+ spawned.kill(signal);
65
+ reject(Object.assign(new Error('Timed out'), {timedOut: true, signal}));
66
+ };
67
+
68
+ // `timeout` option handling
69
+ const setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise) => {
70
+ if (timeout === 0 || timeout === undefined) {
71
+ return spawnedPromise;
72
+ }
73
+
74
+ let timeoutId;
75
+ const timeoutPromise = new Promise((resolve, reject) => {
76
+ timeoutId = setTimeout(() => {
77
+ timeoutKill(spawned, killSignal, reject);
78
+ }, timeout);
79
+ });
80
+
81
+ const safeSpawnedPromise = spawnedPromise.finally(() => {
82
+ clearTimeout(timeoutId);
83
+ });
84
+
85
+ return Promise.race([timeoutPromise, safeSpawnedPromise]);
86
+ };
87
+
88
+ const validateTimeout = ({timeout}) => {
89
+ if (timeout !== undefined && (!Number.isFinite(timeout) || timeout < 0)) {
90
+ throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
91
+ }
92
+ };
93
+
94
+ // `cleanup` option handling
95
+ const setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => {
96
+ if (!cleanup || detached) {
97
+ return timedPromise;
98
+ }
99
+
100
+ const removeExitHandler = onExit(() => {
101
+ spawned.kill();
102
+ });
103
+
104
+ return timedPromise.finally(() => {
105
+ removeExitHandler();
106
+ });
107
+ };
108
+
109
+ module.exports = {
110
+ spawnedKill,
111
+ spawnedCancel,
112
+ setupTimeout,
113
+ validateTimeout,
114
+ setExitHandler
115
+ };
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ const nativePromisePrototype = (async () => {})().constructor.prototype;
4
+ const descriptors = ['then', 'catch', 'finally'].map(property => [
5
+ property,
6
+ Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
7
+ ]);
8
+
9
+ // The return value is a mixin of `childProcess` and `Promise`
10
+ const mergePromise = (spawned, promise) => {
11
+ for (const [property, descriptor] of descriptors) {
12
+ // Starting the main `promise` is deferred to avoid consuming streams
13
+ const value = typeof promise === 'function' ?
14
+ (...args) => Reflect.apply(descriptor.value, promise(), args) :
15
+ descriptor.value.bind(promise);
16
+
17
+ Reflect.defineProperty(spawned, property, {...descriptor, value});
18
+ }
19
+
20
+ return spawned;
21
+ };
22
+
23
+ // Use promises instead of `child_process` events
24
+ const getSpawnedPromise = spawned => {
25
+ return new Promise((resolve, reject) => {
26
+ spawned.on('exit', (exitCode, signal) => {
27
+ resolve({exitCode, signal});
28
+ });
29
+
30
+ spawned.on('error', error => {
31
+ reject(error);
32
+ });
33
+
34
+ if (spawned.stdin) {
35
+ spawned.stdin.on('error', error => {
36
+ reject(error);
37
+ });
38
+ }
39
+ });
40
+ };
41
+
42
+ module.exports = {
43
+ mergePromise,
44
+ getSpawnedPromise
45
+ };
46
+
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+ const aliases = ['stdin', 'stdout', 'stderr'];
3
+
4
+ const hasAlias = options => aliases.some(alias => options[alias] !== undefined);
5
+
6
+ const normalizeStdio = options => {
7
+ if (!options) {
8
+ return;
9
+ }
10
+
11
+ const {stdio} = options;
12
+
13
+ if (stdio === undefined) {
14
+ return aliases.map(alias => options[alias]);
15
+ }
16
+
17
+ if (hasAlias(options)) {
18
+ throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`);
19
+ }
20
+
21
+ if (typeof stdio === 'string') {
22
+ return stdio;
23
+ }
24
+
25
+ if (!Array.isArray(stdio)) {
26
+ throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
27
+ }
28
+
29
+ const length = Math.max(stdio.length, aliases.length);
30
+ return Array.from({length}, (value, index) => stdio[index]);
31
+ };
32
+
33
+ module.exports = normalizeStdio;
34
+
35
+ // `ipc` is pushed unless it is already present
36
+ module.exports.node = options => {
37
+ const stdio = normalizeStdio(options);
38
+
39
+ if (stdio === 'ipc') {
40
+ return 'ipc';
41
+ }
42
+
43
+ if (stdio === undefined || typeof stdio === 'string') {
44
+ return [stdio, stdio, stdio, 'ipc'];
45
+ }
46
+
47
+ if (stdio.includes('ipc')) {
48
+ return stdio;
49
+ }
50
+
51
+ return [...stdio, 'ipc'];
52
+ };
@@ -0,0 +1,97 @@
1
+ 'use strict';
2
+ const isStream = require('is-stream');
3
+ const getStream = require('get-stream');
4
+ const mergeStream = require('merge-stream');
5
+
6
+ // `input` option
7
+ const handleInput = (spawned, input) => {
8
+ // Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852
9
+ // @todo remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0
10
+ if (input === undefined || spawned.stdin === undefined) {
11
+ return;
12
+ }
13
+
14
+ if (isStream(input)) {
15
+ input.pipe(spawned.stdin);
16
+ } else {
17
+ spawned.stdin.end(input);
18
+ }
19
+ };
20
+
21
+ // `all` interleaves `stdout` and `stderr`
22
+ const makeAllStream = (spawned, {all}) => {
23
+ if (!all || (!spawned.stdout && !spawned.stderr)) {
24
+ return;
25
+ }
26
+
27
+ const mixed = mergeStream();
28
+
29
+ if (spawned.stdout) {
30
+ mixed.add(spawned.stdout);
31
+ }
32
+
33
+ if (spawned.stderr) {
34
+ mixed.add(spawned.stderr);
35
+ }
36
+
37
+ return mixed;
38
+ };
39
+
40
+ // On failure, `result.stdout|stderr|all` should contain the currently buffered stream
41
+ const getBufferedData = async (stream, streamPromise) => {
42
+ if (!stream) {
43
+ return;
44
+ }
45
+
46
+ stream.destroy();
47
+
48
+ try {
49
+ return await streamPromise;
50
+ } catch (error) {
51
+ return error.bufferedData;
52
+ }
53
+ };
54
+
55
+ const getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => {
56
+ if (!stream || !buffer) {
57
+ return;
58
+ }
59
+
60
+ if (encoding) {
61
+ return getStream(stream, {encoding, maxBuffer});
62
+ }
63
+
64
+ return getStream.buffer(stream, {maxBuffer});
65
+ };
66
+
67
+ // Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all)
68
+ const getSpawnedResult = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => {
69
+ const stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer});
70
+ const stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer});
71
+ const allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2});
72
+
73
+ try {
74
+ return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
75
+ } catch (error) {
76
+ return Promise.all([
77
+ {error, signal: error.signal, timedOut: error.timedOut},
78
+ getBufferedData(stdout, stdoutPromise),
79
+ getBufferedData(stderr, stderrPromise),
80
+ getBufferedData(all, allPromise)
81
+ ]);
82
+ }
83
+ };
84
+
85
+ const validateInputSync = ({input}) => {
86
+ if (isStream(input)) {
87
+ throw new TypeError('The `input` option cannot be a stream in sync mode');
88
+ }
89
+ };
90
+
91
+ module.exports = {
92
+ handleInput,
93
+ makeAllStream,
94
+ getSpawnedResult,
95
+ validateInputSync
96
+ };
97
+
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "execa",
3
+ "version": "5.1.1",
4
+ "description": "Process execution for humans",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/execa",
7
+ "funding": "https://github.com/sindresorhus/execa?sponsor=1",
8
+ "author": {
9
+ "name": "Sindre Sorhus",
10
+ "email": "sindresorhus@gmail.com",
11
+ "url": "https://sindresorhus.com"
12
+ },
13
+ "engines": {
14
+ "node": ">=10"
15
+ },
16
+ "scripts": {
17
+ "test": "xo && nyc ava && tsd"
18
+ },
19
+ "files": [
20
+ "index.js",
21
+ "index.d.ts",
22
+ "lib"
23
+ ],
24
+ "keywords": [
25
+ "exec",
26
+ "child",
27
+ "process",
28
+ "execute",
29
+ "fork",
30
+ "execfile",
31
+ "spawn",
32
+ "file",
33
+ "shell",
34
+ "bin",
35
+ "binary",
36
+ "binaries",
37
+ "npm",
38
+ "path",
39
+ "local"
40
+ ],
41
+ "dependencies": {
42
+ "cross-spawn": "^7.0.3",
43
+ "get-stream": "^6.0.0",
44
+ "human-signals": "^2.1.0",
45
+ "is-stream": "^2.0.0",
46
+ "merge-stream": "^2.0.0",
47
+ "npm-run-path": "^4.0.1",
48
+ "onetime": "^5.1.2",
49
+ "signal-exit": "^3.0.3",
50
+ "strip-final-newline": "^2.0.0"
51
+ },
52
+ "devDependencies": {
53
+ "@types/node": "^14.14.10",
54
+ "ava": "^2.4.0",
55
+ "get-node": "^11.0.1",
56
+ "is-running": "^2.1.0",
57
+ "nyc": "^15.1.0",
58
+ "p-event": "^4.2.0",
59
+ "tempfile": "^3.0.0",
60
+ "tsd": "^0.13.1",
61
+ "xo": "^0.35.0"
62
+ },
63
+ "nyc": {
64
+ "reporter": [
65
+ "text",
66
+ "lcov"
67
+ ],
68
+ "exclude": [
69
+ "**/fixtures/**",
70
+ "**/test.js",
71
+ "**/test/**"
72
+ ]
73
+ }
74
+ }
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+ const {PassThrough: PassThroughStream} = require('stream');
3
+
4
+ module.exports = options => {
5
+ options = {...options};
6
+
7
+ const {array} = options;
8
+ let {encoding} = options;
9
+ const isBuffer = encoding === 'buffer';
10
+ let objectMode = false;
11
+
12
+ if (array) {
13
+ objectMode = !(encoding || isBuffer);
14
+ } else {
15
+ encoding = encoding || 'utf8';
16
+ }
17
+
18
+ if (isBuffer) {
19
+ encoding = null;
20
+ }
21
+
22
+ const stream = new PassThroughStream({objectMode});
23
+
24
+ if (encoding) {
25
+ stream.setEncoding(encoding);
26
+ }
27
+
28
+ let length = 0;
29
+ const chunks = [];
30
+
31
+ stream.on('data', chunk => {
32
+ chunks.push(chunk);
33
+
34
+ if (objectMode) {
35
+ length = chunks.length;
36
+ } else {
37
+ length += chunk.length;
38
+ }
39
+ });
40
+
41
+ stream.getBufferedValue = () => {
42
+ if (array) {
43
+ return chunks;
44
+ }
45
+
46
+ return isBuffer ? Buffer.concat(chunks, length) : chunks.join('');
47
+ };
48
+
49
+ stream.getBufferedLength = () => length;
50
+
51
+ return stream;
52
+ };
@@ -0,0 +1,61 @@
1
+ 'use strict';
2
+ const {constants: BufferConstants} = require('buffer');
3
+ const stream = require('stream');
4
+ const {promisify} = require('util');
5
+ const bufferStream = require('./buffer-stream');
6
+
7
+ const streamPipelinePromisified = promisify(stream.pipeline);
8
+
9
+ class MaxBufferError extends Error {
10
+ constructor() {
11
+ super('maxBuffer exceeded');
12
+ this.name = 'MaxBufferError';
13
+ }
14
+ }
15
+
16
+ async function getStream(inputStream, options) {
17
+ if (!inputStream) {
18
+ throw new Error('Expected a stream');
19
+ }
20
+
21
+ options = {
22
+ maxBuffer: Infinity,
23
+ ...options
24
+ };
25
+
26
+ const {maxBuffer} = options;
27
+ const stream = bufferStream(options);
28
+
29
+ await new Promise((resolve, reject) => {
30
+ const rejectPromise = error => {
31
+ // Don't retrieve an oversized buffer.
32
+ if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
33
+ error.bufferedData = stream.getBufferedValue();
34
+ }
35
+
36
+ reject(error);
37
+ };
38
+
39
+ (async () => {
40
+ try {
41
+ await streamPipelinePromisified(inputStream, stream);
42
+ resolve();
43
+ } catch (error) {
44
+ rejectPromise(error);
45
+ }
46
+ })();
47
+
48
+ stream.on('data', () => {
49
+ if (stream.getBufferedLength() > maxBuffer) {
50
+ rejectPromise(new MaxBufferError());
51
+ }
52
+ });
53
+ });
54
+
55
+ return stream.getBufferedValue();
56
+ }
57
+
58
+ module.exports = getStream;
59
+ module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'});
60
+ module.exports.array = (stream, options) => getStream(stream, {...options, array: true});
61
+ module.exports.MaxBufferError = MaxBufferError;
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "get-stream",
3
+ "version": "6.0.1",
4
+ "description": "Get a stream as a string, buffer, or array",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/get-stream",
7
+ "funding": "https://github.com/sponsors/sindresorhus",
8
+ "author": {
9
+ "name": "Sindre Sorhus",
10
+ "email": "sindresorhus@gmail.com",
11
+ "url": "https://sindresorhus.com"
12
+ },
13
+ "engines": {
14
+ "node": ">=10"
15
+ },
16
+ "scripts": {
17
+ "test": "xo && ava && tsd"
18
+ },
19
+ "files": [
20
+ "index.js",
21
+ "index.d.ts",
22
+ "buffer-stream.js"
23
+ ],
24
+ "keywords": [
25
+ "get",
26
+ "stream",
27
+ "promise",
28
+ "concat",
29
+ "string",
30
+ "text",
31
+ "buffer",
32
+ "read",
33
+ "data",
34
+ "consume",
35
+ "readable",
36
+ "readablestream",
37
+ "array",
38
+ "object"
39
+ ],
40
+ "devDependencies": {
41
+ "@types/node": "^14.0.27",
42
+ "ava": "^2.4.0",
43
+ "into-stream": "^5.0.0",
44
+ "tsd": "^0.13.1",
45
+ "xo": "^0.24.0"
46
+ }
47
+ }