@magek/common 0.0.6 → 0.0.8

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 (40) hide show
  1. package/dist/concepts/projection-metadata.d.ts +4 -4
  2. package/dist/concepts/projection-metadata.js +6 -6
  3. package/dist/concepts/reducer-metadata.d.ts +5 -0
  4. package/dist/concepts/reducer-metadata.js +5 -0
  5. package/dist/concepts/register.js +6 -1
  6. package/dist/config.d.ts +4 -0
  7. package/dist/config.js +78 -65
  8. package/dist/envelope.d.ts +9 -0
  9. package/dist/errors/command-handler-global-error.js +2 -0
  10. package/dist/errors/event-global-error.js +1 -0
  11. package/dist/errors/event-handler-global-error.js +3 -0
  12. package/dist/errors/global-error-container.js +1 -0
  13. package/dist/errors/projection-global-error.js +4 -0
  14. package/dist/errors/query-handler-global-error.js +1 -0
  15. package/dist/errors/reducer-global-error.js +4 -0
  16. package/dist/errors/schedule-command-global-error.js +2 -0
  17. package/dist/errors/snapshot-persist-handler-global-error.js +1 -0
  18. package/dist/errors.js +6 -3
  19. package/dist/event-store-adapter.d.ts +71 -16
  20. package/dist/graphql-websocket-messages.js +11 -7
  21. package/dist/http-service.js +2 -2
  22. package/dist/index.d.ts +17 -20
  23. package/dist/index.js +30 -20
  24. package/dist/instances.d.ts +20 -0
  25. package/dist/instances.js +10 -0
  26. package/dist/logger.js +5 -6
  27. package/dist/metadata-types.d.ts +20 -0
  28. package/dist/retrier.js +3 -3
  29. package/dist/searcher.js +10 -3
  30. package/dist/timestamp-generator.d.ts +38 -0
  31. package/dist/timestamp-generator.js +84 -0
  32. package/package.json +2 -2
  33. package/dist/field-decorator.d.ts +0 -63
  34. package/dist/field-decorator.js +0 -122
  35. package/dist/internal-info.d.ts +0 -2
  36. package/dist/internal-info.js +0 -6
  37. package/dist/promises.d.ts +0 -25
  38. package/dist/promises.js +0 -42
  39. package/dist/run-command.d.ts +0 -5
  40. package/dist/run-command.js +0 -48
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runCommandAsync = runCommandAsync;
4
- exports.runCommand = runCommand;
5
- const child_process_1 = require("child_process");
6
- /** Spawn a CLI command and optionally printing the logs and error messages */
7
- function runCommandAsync(path, command, ignoreLogs = false) {
8
- // Split the command into an array of arguments
9
- const args = command.split(' ');
10
- // Use the first argument as the command name
11
- const subprocess = (0, child_process_1.spawn)(args[0], args.slice(1), {
12
- cwd: path,
13
- stdio: 'pipe',
14
- });
15
- if (!ignoreLogs) {
16
- subprocess.stdout.on('data', (data) => {
17
- console.log(data.toString());
18
- });
19
- subprocess.stderr.on('data', (data) => {
20
- console.error(data.toString());
21
- });
22
- }
23
- return subprocess;
24
- }
25
- /** Synchronously run a CLI command and return the stdout, optionally printing the logs and error messages */
26
- function runCommand(path, command, ignoreLogs = false) {
27
- return new Promise((resolve, reject) => {
28
- const subprocess = runCommandAsync(path, command, ignoreLogs);
29
- let stdout = '';
30
- let stderr = '';
31
- if (subprocess) {
32
- subprocess.stdout.on('data', (data) => {
33
- stdout += data.toString();
34
- });
35
- subprocess.stderr.on('data', (data) => {
36
- stderr += data.toString();
37
- });
38
- subprocess.on('close', (code) => {
39
- if (code === 0) {
40
- resolve(stdout);
41
- }
42
- else {
43
- reject(stderr);
44
- }
45
- });
46
- }
47
- });
48
- }