@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.
- package/dist/concepts/projection-metadata.d.ts +4 -4
- package/dist/concepts/projection-metadata.js +6 -6
- package/dist/concepts/reducer-metadata.d.ts +5 -0
- package/dist/concepts/reducer-metadata.js +5 -0
- package/dist/concepts/register.js +6 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.js +78 -65
- package/dist/envelope.d.ts +9 -0
- package/dist/errors/command-handler-global-error.js +2 -0
- package/dist/errors/event-global-error.js +1 -0
- package/dist/errors/event-handler-global-error.js +3 -0
- package/dist/errors/global-error-container.js +1 -0
- package/dist/errors/projection-global-error.js +4 -0
- package/dist/errors/query-handler-global-error.js +1 -0
- package/dist/errors/reducer-global-error.js +4 -0
- package/dist/errors/schedule-command-global-error.js +2 -0
- package/dist/errors/snapshot-persist-handler-global-error.js +1 -0
- package/dist/errors.js +6 -3
- package/dist/event-store-adapter.d.ts +71 -16
- package/dist/graphql-websocket-messages.js +11 -7
- package/dist/http-service.js +2 -2
- package/dist/index.d.ts +17 -20
- package/dist/index.js +30 -20
- package/dist/instances.d.ts +20 -0
- package/dist/instances.js +10 -0
- package/dist/logger.js +5 -6
- package/dist/metadata-types.d.ts +20 -0
- package/dist/retrier.js +3 -3
- package/dist/searcher.js +10 -3
- package/dist/timestamp-generator.d.ts +38 -0
- package/dist/timestamp-generator.js +84 -0
- package/package.json +2 -2
- package/dist/field-decorator.d.ts +0 -63
- package/dist/field-decorator.js +0 -122
- package/dist/internal-info.d.ts +0 -2
- package/dist/internal-info.js +0 -6
- package/dist/promises.d.ts +0 -25
- package/dist/promises.js +0 -42
- package/dist/run-command.d.ts +0 -5
- package/dist/run-command.js +0 -48
package/dist/run-command.js
DELETED
|
@@ -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
|
-
}
|