exupery-core-bin 0.3.17 → 0.3.18

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 (20) hide show
  1. package/dist/algorithms/procedures/copy.js +2 -2
  2. package/dist/algorithms/procedures/execute_any_procedure_executable.js +3 -3
  3. package/dist/algorithms/procedures/execute_any_smelly_procedure_executable.js +3 -3
  4. package/dist/algorithms/procedures/make_directory.js +2 -2
  5. package/dist/algorithms/procedures/remove.js +2 -2
  6. package/dist/algorithms/procedures/write_file.js +3 -3
  7. package/dist/algorithms/queries/{unguaranteed/execute_any_query_executable.js → execute_any_query_executable.js} +5 -6
  8. package/dist/algorithms/queries/{guaranteed/execute_query_executable_and_catch.js → execute_query_executable_and_catch.js} +2 -3
  9. package/dist/algorithms/queries/{guaranteed/get_instream_data.js → get_instream_data.js} +2 -3
  10. package/dist/algorithms/queries/{unguaranteed/read_directory.js → read_directory.js} +4 -5
  11. package/dist/algorithms/queries/{unguaranteed/read_file.js → read_file.js} +4 -5
  12. package/dist/algorithms/queries/{unguaranteed/stat.js → stat.js} +4 -5
  13. package/dist/index.js +4 -4
  14. package/package.json +2 -2
  15. /package/dist/algorithms/queries/{unguaranteed/execute_any_query_executable.d.ts → execute_any_query_executable.d.ts} +0 -0
  16. /package/dist/algorithms/queries/{guaranteed/execute_query_executable_and_catch.d.ts → execute_query_executable_and_catch.d.ts} +0 -0
  17. /package/dist/algorithms/queries/{guaranteed/get_instream_data.d.ts → get_instream_data.d.ts} +0 -0
  18. /package/dist/algorithms/queries/{unguaranteed/read_directory.d.ts → read_directory.d.ts} +0 -0
  19. /package/dist/algorithms/queries/{unguaranteed/read_file.d.ts → read_file.d.ts} +0 -0
  20. /package/dist/algorithms/queries/{unguaranteed/stat.d.ts → stat.d.ts} +0 -0
@@ -35,14 +35,14 @@ exports.$$ = _easync.__create_procedure_primed_with_resources(($p) => {
35
35
  return path;
36
36
  };
37
37
  return _easync.__create_procedure_promise({
38
- 'execute': (on_success, on_exception) => {
38
+ 'execute': (on_success, on_error) => {
39
39
  const options = {};
40
40
  $p.options.recursive.map(($) => { options.recursive = $; });
41
41
  $p.options.force.map(($) => { options.force = $; });
42
42
  $p.options.errorOnExist.map(($) => { options.errorOnExist = $; });
43
43
  (0, fs_1.cp)(__possibly_escape_filename($p.source.path, $p.source['escape spaces in path']), __possibly_escape_filename($p.target.path, $p.target['escape spaces in path']), options, (err) => {
44
44
  if (err) {
45
- on_exception(_ei.block(() => {
45
+ on_error(_ei.block(() => {
46
46
  if (err.code === 'ENOENT') {
47
47
  return ['source does not exist', null];
48
48
  }
@@ -35,7 +35,7 @@ const node_child_process_1 = require("node:child_process");
35
35
  exports.$$ = _easync.__create_procedure_primed_with_resources(($p) => {
36
36
  const args = $p.args.__get_raw_copy();
37
37
  return _easync.__create_procedure_promise({
38
- 'execute': (on_success, on_exception) => {
38
+ 'execute': (on_success, on_error) => {
39
39
  const child = (0, node_child_process_1.spawn)($p.program, args, {
40
40
  shell: false, // ✅ direct execution, no shell
41
41
  });
@@ -44,7 +44,7 @@ exports.$$ = _easync.__create_procedure_primed_with_resources(($p) => {
44
44
  stderrData += chunk.toString("utf8");
45
45
  });
46
46
  child.on("error", err => {
47
- on_exception(_ei.block(() => {
47
+ on_error(_ei.block(() => {
48
48
  return ['failed to spawn', { message: err instanceof Error ? err.message : `${err}` }];
49
49
  }));
50
50
  });
@@ -53,7 +53,7 @@ exports.$$ = _easync.__create_procedure_primed_with_resources(($p) => {
53
53
  on_success();
54
54
  }
55
55
  else {
56
- on_exception(_ei.block(() => {
56
+ on_error(_ei.block(() => {
57
57
  return ['non zero exit code', {
58
58
  'exit code': exitCode === null ? _ei.not_set() : _ei.set(exitCode),
59
59
  'stderr': stderrData
@@ -36,7 +36,7 @@ const node_child_process_1 = require("node:child_process");
36
36
  exports.$$ = _easync.__create_procedure_primed_with_resources(($p) => {
37
37
  const args = $p.args.__get_raw_copy();
38
38
  return _easync.__create_procedure_promise({
39
- 'execute': (on_success, on_exception) => {
39
+ 'execute': (on_success, on_error) => {
40
40
  const child = (0, node_child_process_1.spawn)($p.program, args, {
41
41
  shell: false, // ✅ direct execution, no shell
42
42
  });
@@ -49,7 +49,7 @@ exports.$$ = _easync.__create_procedure_primed_with_resources(($p) => {
49
49
  stderrData += chunk.toString("utf8");
50
50
  });
51
51
  child.on("error", err => {
52
- on_exception(_ei.block(() => {
52
+ on_error(_ei.block(() => {
53
53
  return ['failed to spawn', { message: err instanceof Error ? err.message : `${err}` }];
54
54
  }));
55
55
  });
@@ -59,7 +59,7 @@ exports.$$ = _easync.__create_procedure_primed_with_resources(($p) => {
59
59
  on_success();
60
60
  }
61
61
  else {
62
- on_exception(_ei.block(() => {
62
+ on_error(_ei.block(() => {
63
63
  return ['non zero exit code', {
64
64
  'exit code': exitCode === null ? _ei.not_set() : _ei.set(exitCode),
65
65
  'stderr': stderrData,
@@ -35,12 +35,12 @@ exports.$$ = _easync.__create_procedure_primed_with_resources(($p) => {
35
35
  return path;
36
36
  };
37
37
  return _easync.__create_procedure_promise({
38
- 'execute': (on_success, on_exception) => {
38
+ 'execute': (on_success, on_error) => {
39
39
  (0, fs_1.mkdir)(__possibly_escape_filename($p.path, $p['escape spaces in path']), {
40
40
  'recursive': true,
41
41
  }, (err, path) => {
42
42
  if (err) {
43
- on_exception(_ei.block(() => {
43
+ on_error(_ei.block(() => {
44
44
  if (err.code === 'EEXIST') {
45
45
  return ['directory already exists', null];
46
46
  }
@@ -35,7 +35,7 @@ exports.$$ = _easync.__create_procedure_primed_with_resources(($p) => {
35
35
  return path;
36
36
  };
37
37
  return _easync.__create_procedure_promise({
38
- 'execute': (on_success, on_exception) => {
38
+ 'execute': (on_success, on_error) => {
39
39
  (0, fs_1.rm)(__possibly_escape_filename($p.path.path, $p.path['escape spaces in path']), {
40
40
  'recursive': true,
41
41
  }, (err) => {
@@ -44,7 +44,7 @@ exports.$$ = _easync.__create_procedure_primed_with_resources(($p) => {
44
44
  on_success();
45
45
  }
46
46
  else {
47
- on_exception(_ei.block(() => {
47
+ on_error(_ei.block(() => {
48
48
  if (err.code === 'ENOENT') {
49
49
  return ['node does not exist', null];
50
50
  }
@@ -30,7 +30,7 @@ const fs_1 = require("fs");
30
30
  const path_1 = require("path");
31
31
  exports.$$ = _easync.__create_procedure_primed_with_resources(($p) => {
32
32
  return _easync.__create_procedure_promise({
33
- 'execute': (on_success, on_exception) => {
33
+ 'execute': (on_success, on_error) => {
34
34
  const __possibly_escape_filename = (path, escape) => {
35
35
  if (escape) {
36
36
  return path.replace(/ /g, '_');
@@ -42,7 +42,7 @@ exports.$$ = _easync.__create_procedure_primed_with_resources(($p) => {
42
42
  'recursive': true
43
43
  }, (err, path) => {
44
44
  if (err) {
45
- on_exception(_ei.block(() => {
45
+ on_error(_ei.block(() => {
46
46
  if (err.code === 'EACCES' || err.code === 'EPERM') {
47
47
  return ['permission denied', null];
48
48
  }
@@ -52,7 +52,7 @@ exports.$$ = _easync.__create_procedure_primed_with_resources(($p) => {
52
52
  }
53
53
  (0, fs_1.writeFile)(fname, $p.data, (err) => {
54
54
  if (err) {
55
- on_exception(_ei.block(() => {
55
+ on_error(_ei.block(() => {
56
56
  if (err.code === 'EACCES' || err.code === 'EPERM') {
57
57
  return ['permission denied', null];
58
58
  }
@@ -32,10 +32,10 @@ const node_child_process_1 = require("node:child_process");
32
32
  * The executable being executed is assumed to be side effect free
33
33
  * There is no way to give guarantees about that though
34
34
  */
35
- const $$ = ($p) => {
35
+ exports.$$ = _easync.__create_query_primed_with_resources(($p) => {
36
36
  const args = $p.args.__get_raw_copy();
37
37
  return _easync.__create_query_promise({
38
- 'execute': (on_value, on_exception) => {
38
+ 'execute': (on_value, on_error) => {
39
39
  const child = (0, node_child_process_1.spawn)($p.program, args, {
40
40
  shell: false, // ✅ no implicit parsing
41
41
  });
@@ -48,7 +48,7 @@ const $$ = ($p) => {
48
48
  stderrData += chunk.toString("utf8");
49
49
  });
50
50
  child.on("error", err => {
51
- on_exception(_ei.block(() => {
51
+ on_error(_ei.block(() => {
52
52
  return ['failed to spawn', {
53
53
  message: err instanceof Error ? err.message : `${err}`
54
54
  }];
@@ -61,7 +61,7 @@ const $$ = ($p) => {
61
61
  });
62
62
  }
63
63
  else {
64
- on_exception(_ei.block(() => {
64
+ on_error(_ei.block(() => {
65
65
  return ['non zero exit code', {
66
66
  'exit code': exitCode === null ? _ei.not_set() : _ei.set(exitCode),
67
67
  'stderr': stderrData,
@@ -71,5 +71,4 @@ const $$ = ($p) => {
71
71
  });
72
72
  }
73
73
  });
74
- };
75
- exports.$$ = $$;
74
+ });
@@ -32,7 +32,7 @@ const node_child_process_1 = require("node:child_process");
32
32
  * The executable being executed is assumed to be side effect free
33
33
  * There is no way to give guarantees about that though
34
34
  */
35
- const $$ = ($p) => {
35
+ exports.$$ = _easync.__create_query_primed_with_resources(($p) => {
36
36
  const args = $p.args.__get_raw_copy();
37
37
  return _easync.__create_query_promise({
38
38
  'execute': (on_result) => {
@@ -67,5 +67,4 @@ const $$ = ($p) => {
67
67
  });
68
68
  }
69
69
  });
70
- };
71
- exports.$$ = $$;
70
+ });
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.$$ = void 0;
27
27
  const _easync = __importStar(require("exupery-core-async"));
28
- const $$ = () => {
28
+ exports.$$ = _easync.__create_query_primed_with_resources(() => {
29
29
  return _easync.__create_query_promise({
30
30
  'execute': (on_value) => {
31
31
  const stdin = process.stdin;
@@ -40,5 +40,4 @@ const $$ = () => {
40
40
  stdin.resume();
41
41
  }
42
42
  });
43
- };
44
- exports.$$ = $$;
43
+ });
@@ -27,7 +27,7 @@ exports.$$ = void 0;
27
27
  const _easync = __importStar(require("exupery-core-async"));
28
28
  const _ei = __importStar(require("exupery-core-internals"));
29
29
  const fs_1 = require("fs");
30
- const $$ = ($p) => {
30
+ exports.$$ = _easync.__create_query_primed_with_resources(($p) => {
31
31
  const __possibly_escape_filename = (path, escape) => {
32
32
  if (escape) {
33
33
  return path.replace(/ /g, '_');
@@ -35,13 +35,13 @@ const $$ = ($p) => {
35
35
  return path;
36
36
  };
37
37
  return _easync.__create_query_promise({
38
- 'execute': (on_value, on_exception) => {
38
+ 'execute': (on_value, on_error) => {
39
39
  (0, fs_1.readdir)(__possibly_escape_filename($p.path.path, $p.path['escape spaces in path']), {
40
40
  'encoding': 'utf-8',
41
41
  'withFileTypes': true,
42
42
  }, (err, files) => {
43
43
  if (err) {
44
- on_exception(_ei.block(() => {
44
+ on_error(_ei.block(() => {
45
45
  if (err.code === 'ENOENT') {
46
46
  return ['directory does not exist', null];
47
47
  }
@@ -61,5 +61,4 @@ const $$ = ($p) => {
61
61
  });
62
62
  }
63
63
  });
64
- };
65
- exports.$$ = $$;
64
+ });
@@ -27,7 +27,7 @@ exports.$$ = void 0;
27
27
  const _easync = __importStar(require("exupery-core-async"));
28
28
  const _ei = __importStar(require("exupery-core-internals"));
29
29
  const fs_1 = require("fs");
30
- const $$ = ($p) => {
30
+ exports.$$ = _easync.__create_query_primed_with_resources(($p) => {
31
31
  const __possibly_escape_filename = (path, escape) => {
32
32
  if (escape) {
33
33
  return path.replace(/ /g, '_');
@@ -35,10 +35,10 @@ const $$ = ($p) => {
35
35
  return path;
36
36
  };
37
37
  return _easync.__create_query_promise({
38
- 'execute': (on_value, on_exception) => {
38
+ 'execute': (on_value, on_error) => {
39
39
  (0, fs_1.readFile)(__possibly_escape_filename($p.path, $p['escape spaces in path']), { 'encoding': 'utf-8' }, (err, data) => {
40
40
  if (err) {
41
- on_exception(_ei.block(() => {
41
+ on_error(_ei.block(() => {
42
42
  if (err.code === 'ENOENT') {
43
43
  return ['file does not exist', null];
44
44
  }
@@ -63,5 +63,4 @@ const $$ = ($p) => {
63
63
  });
64
64
  }
65
65
  });
66
- };
67
- exports.$$ = $$;
66
+ });
@@ -27,7 +27,7 @@ exports.$$ = void 0;
27
27
  const _easync = __importStar(require("exupery-core-async"));
28
28
  const _ei = __importStar(require("exupery-core-internals"));
29
29
  const fs_1 = require("fs");
30
- const $$ = ($p) => {
30
+ exports.$$ = _easync.__create_query_primed_with_resources(($p) => {
31
31
  const __possibly_escape_filename = (path, escape) => {
32
32
  if (escape) {
33
33
  return path.replace(/ /g, '_');
@@ -35,10 +35,10 @@ const $$ = ($p) => {
35
35
  return path;
36
36
  };
37
37
  return _easync.__create_query_promise({
38
- 'execute': (on_value, on_exception) => {
38
+ 'execute': (on_value, on_error) => {
39
39
  (0, fs_1.stat)(__possibly_escape_filename($p.path, $p['escape spaces in path']), (err, stats) => {
40
40
  if (err) {
41
- on_exception(_ei.block(() => {
41
+ on_error(_ei.block(() => {
42
42
  if (err.code === 'ENOENT') {
43
43
  return ['node does not exist', null];
44
44
  }
@@ -51,5 +51,4 @@ const $$ = ($p) => {
51
51
  });
52
52
  }
53
53
  });
54
- };
55
- exports.$$ = $$;
54
+ });
package/dist/index.js CHANGED
@@ -35,10 +35,10 @@ const remove_1 = require("./algorithms/procedures/remove");
35
35
  const write_file_1 = require("./algorithms/procedures/write_file");
36
36
  const write_to_stderr_1 = require("./algorithms/procedures/write_to_stderr");
37
37
  const write_to_stdout_1 = require("./algorithms/procedures/write_to_stdout");
38
- const execute_any_query_executable_1 = require("./algorithms/queries/unguaranteed/execute_any_query_executable");
39
- const get_instream_data_1 = require("./algorithms/queries/guaranteed/get_instream_data");
40
- const read_directory_1 = require("./algorithms/queries/unguaranteed/read_directory");
41
- const read_file_1 = require("./algorithms/queries/unguaranteed/read_file");
38
+ const execute_any_query_executable_1 = require("./algorithms/queries/execute_any_query_executable");
39
+ const get_instream_data_1 = require("./algorithms/queries/get_instream_data");
40
+ const read_directory_1 = require("./algorithms/queries/read_directory");
41
+ const read_file_1 = require("./algorithms/queries/read_file");
42
42
  const create_available_resources = () => {
43
43
  return {
44
44
  'procedures': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exupery-core-bin",
3
- "version": "0.3.17",
3
+ "version": "0.3.18",
4
4
  "license": "ISC",
5
5
  "description": "this is one of the core packages for Exupery. it provides functionality to create executables",
6
6
  "author": "Corno",
@@ -27,7 +27,7 @@
27
27
  "url": "git+https://github.com/corno/exupery-core.git"
28
28
  },
29
29
  "dependencies": {
30
- "exupery-core-async": "^0.3.18",
30
+ "exupery-core-async": "^0.3.22",
31
31
  "exupery-core-internals": "^0.3.1",
32
32
  "exupery-resources": "^0.3.6"
33
33
  }