@bitblit/ratchet-epsilon-common 4.0.86-alpha → 4.0.88-alpha
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/cjs/build/ratchet-epsilon-common-info.js +5 -5
- package/dist/cjs/cli-bootstrap/ratchet-cli-handler.js +21 -0
- package/dist/cjs/cli-bootstrap/run-background-process-from-command-line.js +26 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/local-container-server.js +14 -16
- package/dist/cjs/test-error-server.js +6 -8
- package/dist/es/build/ratchet-epsilon-common-info.js +5 -5
- package/dist/es/cli-bootstrap/ratchet-cli-handler.js +17 -0
- package/dist/es/cli-bootstrap/run-background-process-from-command-line.js +22 -0
- package/dist/es/index.js +2 -2
- package/dist/es/local-container-server.js +14 -16
- package/dist/es/test-error-server.js +5 -7
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.es.tsbuildinfo +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/cli-bootstrap/ratchet-cli-handler.d.ts +6 -0
- package/dist/types/{run-background-process-from-command-line.d.ts → cli-bootstrap/run-background-process-from-command-line.d.ts} +1 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/local-container-server.d.ts +1 -0
- package/dist/types/test-error-server.d.ts +1 -0
- package/includes/cli.js +12 -0
- package/package.json +4 -3
- package/dist/cjs/cli-bootstrap/epsilon-run-background-process-from-command-line-dry-run.js +0 -21
- package/dist/cjs/run-background-process-from-command-line.js +0 -37
- package/dist/es/cli-bootstrap/epsilon-run-background-process-from-command-line-dry-run.js +0 -18
- package/dist/es/run-background-process-from-command-line.js +0 -32
- package/dist/types/cli-bootstrap/epsilon-run-background-process-from-command-line-dry-run.d.ts +0 -2
|
@@ -5,11 +5,11 @@ class RatchetEpsilonCommonInfo {
|
|
|
5
5
|
constructor() { }
|
|
6
6
|
static buildInformation() {
|
|
7
7
|
const val = {
|
|
8
|
-
version: '
|
|
9
|
-
hash: '
|
|
10
|
-
branch: 'alpha-2023-03-
|
|
11
|
-
tag: 'alpha-2023-03-
|
|
12
|
-
timeBuiltISO: '2023-03-
|
|
8
|
+
version: '88',
|
|
9
|
+
hash: '418c4bc66dfcf5dde834725e96f814a6782d2ed5',
|
|
10
|
+
branch: 'alpha-2023-03-15-2',
|
|
11
|
+
tag: 'alpha-2023-03-15-2',
|
|
12
|
+
timeBuiltISO: '2023-03-15T01:43:15-0700',
|
|
13
13
|
notes: '',
|
|
14
14
|
};
|
|
15
15
|
return val;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RatchetCliHandler = void 0;
|
|
4
|
+
const ratchet_node_only_1 = require("@bitblit/ratchet-node-only");
|
|
5
|
+
const run_background_process_from_command_line_1 = require("./run-background-process-from-command-line");
|
|
6
|
+
const test_error_server_1 = require("../test-error-server");
|
|
7
|
+
const local_container_server_1 = require("../local-container-server");
|
|
8
|
+
const ratchet_epsilon_common_info_1 = require("../build/ratchet-epsilon-common-info");
|
|
9
|
+
class RatchetCliHandler extends ratchet_node_only_1.AbstractRatchetCliHandler {
|
|
10
|
+
fetchHandlerMap() {
|
|
11
|
+
return {
|
|
12
|
+
'run-background-process': run_background_process_from_command_line_1.RunBackgroundProcessFromCommandLine.runFromCliArgs,
|
|
13
|
+
'run-test-error-server': test_error_server_1.TestErrorServer.runFromCliArgs,
|
|
14
|
+
'run-local-container-server': local_container_server_1.LocalContainerServer.runFromCliArgs,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
fetchVersionInfo() {
|
|
18
|
+
return ratchet_epsilon_common_info_1.RatchetEpsilonCommonInfo.buildInformation();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.RatchetCliHandler = RatchetCliHandler;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RunBackgroundProcessFromCommandLine = void 0;
|
|
4
|
+
const ratchet_common_1 = require("@bitblit/ratchet-common");
|
|
5
|
+
const ratchet_common_2 = require("@bitblit/ratchet-common");
|
|
6
|
+
class RunBackgroundProcessFromCommandLine {
|
|
7
|
+
static async runFromCliArgs(args) {
|
|
8
|
+
if (args.length > 1) {
|
|
9
|
+
const procName = args[0];
|
|
10
|
+
const dryRun = args.length > 1 && ratchet_common_2.BooleanRatchet.parseBool(args[1]);
|
|
11
|
+
const data = args.length > 2 ? JSON.parse(args[2]) : null;
|
|
12
|
+
const meta = args.length > 3 ? JSON.parse(args[3]) : null;
|
|
13
|
+
const epsilon = null;
|
|
14
|
+
if (dryRun) {
|
|
15
|
+
ratchet_common_1.Logger.info('Dry-Run, would have sent : %s %j %j', procName, data, meta);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
await epsilon.processSingleBackgroundByParts(procName, data, meta);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
console.log('Usage : run-background-process {processName} {dryRun true/false} {dataJson} {metaJson}');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.RunBackgroundProcessFromCommandLine = RunBackgroundProcessFromCommandLine;
|
package/dist/cjs/index.js
CHANGED
|
@@ -10,7 +10,6 @@ tslib_1.__exportStar(require("./inter-api-manager"), exports);
|
|
|
10
10
|
tslib_1.__exportStar(require("./local-container-server"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./local-server-cert"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./local-server"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./run-background-process-from-command-line"), exports);
|
|
14
13
|
tslib_1.__exportStar(require("./test-error-server"), exports);
|
|
15
14
|
tslib_1.__exportStar(require("./background/background-dynamo-log-table-handler"), exports);
|
|
16
15
|
tslib_1.__exportStar(require("./background/background-entry"), exports);
|
|
@@ -53,7 +52,8 @@ tslib_1.__exportStar(require("./built-in/http/built-in-filters"), exports);
|
|
|
53
52
|
tslib_1.__exportStar(require("./built-in/http/built-in-handlers"), exports);
|
|
54
53
|
tslib_1.__exportStar(require("./built-in/http/log-level-manipulation-filter"), exports);
|
|
55
54
|
tslib_1.__exportStar(require("./built-in/http/run-handler-as-filter"), exports);
|
|
56
|
-
tslib_1.__exportStar(require("./cli-bootstrap/
|
|
55
|
+
tslib_1.__exportStar(require("./cli-bootstrap/ratchet-cli-handler"), exports);
|
|
56
|
+
tslib_1.__exportStar(require("./cli-bootstrap/run-background-process-from-command-line"), exports);
|
|
57
57
|
tslib_1.__exportStar(require("./config/dynamo-db-config"), exports);
|
|
58
58
|
tslib_1.__exportStar(require("./config/epsilon-config"), exports);
|
|
59
59
|
tslib_1.__exportStar(require("./config/epsilon-lambda-event-handler"), exports);
|
|
@@ -7,7 +7,6 @@ const http_1 = tslib_1.__importDefault(require("http"));
|
|
|
7
7
|
const event_util_1 = require("./http/event-util");
|
|
8
8
|
const cross_fetch_1 = tslib_1.__importDefault(require("cross-fetch"));
|
|
9
9
|
const local_server_1 = require("./local-server");
|
|
10
|
-
const ratchet_node_only_1 = require("@bitblit/ratchet-node-only");
|
|
11
10
|
class LocalContainerServer {
|
|
12
11
|
constructor(port = 8889) {
|
|
13
12
|
this.port = port;
|
|
@@ -60,20 +59,19 @@ class LocalContainerServer {
|
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
}
|
|
62
|
+
static async runFromCliArgs(args) {
|
|
63
|
+
try {
|
|
64
|
+
ratchet_common_1.Logger.setLevel(ratchet_common_1.LoggerLevelName.debug);
|
|
65
|
+
ratchet_common_1.Logger.debug('Running local container server : %j', process === null || process === void 0 ? void 0 : process.argv);
|
|
66
|
+
const testServer = new LocalContainerServer();
|
|
67
|
+
await testServer.runServer();
|
|
68
|
+
ratchet_common_1.Logger.info('Got res server');
|
|
69
|
+
process.exit(0);
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
ratchet_common_1.Logger.error('Error : %s', err);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
63
76
|
}
|
|
64
77
|
exports.LocalContainerServer = LocalContainerServer;
|
|
65
|
-
if (ratchet_node_only_1.CliRatchet.isCalledFromCLISingle('local-container-server')) {
|
|
66
|
-
ratchet_common_1.Logger.setLevel(ratchet_common_1.LoggerLevelName.debug);
|
|
67
|
-
ratchet_common_1.Logger.debug('Running local container server : %j', process === null || process === void 0 ? void 0 : process.argv);
|
|
68
|
-
const testServer = new LocalContainerServer();
|
|
69
|
-
testServer
|
|
70
|
-
.runServer()
|
|
71
|
-
.then((res) => {
|
|
72
|
-
ratchet_common_1.Logger.info('Got res server');
|
|
73
|
-
process.exit(0);
|
|
74
|
-
})
|
|
75
|
-
.catch((err) => {
|
|
76
|
-
ratchet_common_1.Logger.error('Error : %s', err);
|
|
77
|
-
process.exit(1);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TestErrorServer = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ratchet_common_1 = require("@bitblit/ratchet-common");
|
|
6
|
-
const ratchet_node_only_1 = require("@bitblit/ratchet-node-only");
|
|
7
6
|
const net_1 = tslib_1.__importDefault(require("net"));
|
|
8
7
|
class TestErrorServer {
|
|
9
8
|
constructor(port = 9999) {
|
|
@@ -37,13 +36,12 @@ class TestErrorServer {
|
|
|
37
36
|
request.setTimeout(100);
|
|
38
37
|
response.end('x');
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const testServer = new TestErrorServer();
|
|
45
|
-
testServer.runServer().then((res) => {
|
|
39
|
+
static async runFromCliArgs(args) {
|
|
40
|
+
ratchet_common_1.Logger.info('test-error-server requested (cli is %s) - starting', process === null || process === void 0 ? void 0 : process.argv);
|
|
41
|
+
const testServer = new TestErrorServer();
|
|
42
|
+
await testServer.runServer();
|
|
46
43
|
ratchet_common_1.Logger.info('Got res server');
|
|
47
44
|
process.exit(0);
|
|
48
|
-
}
|
|
45
|
+
}
|
|
49
46
|
}
|
|
47
|
+
exports.TestErrorServer = TestErrorServer;
|
|
@@ -2,11 +2,11 @@ export class RatchetEpsilonCommonInfo {
|
|
|
2
2
|
constructor() { }
|
|
3
3
|
static buildInformation() {
|
|
4
4
|
const val = {
|
|
5
|
-
version: '
|
|
6
|
-
hash: '
|
|
7
|
-
branch: 'alpha-2023-03-
|
|
8
|
-
tag: 'alpha-2023-03-
|
|
9
|
-
timeBuiltISO: '2023-03-
|
|
5
|
+
version: '88',
|
|
6
|
+
hash: '418c4bc66dfcf5dde834725e96f814a6782d2ed5',
|
|
7
|
+
branch: 'alpha-2023-03-15-2',
|
|
8
|
+
tag: 'alpha-2023-03-15-2',
|
|
9
|
+
timeBuiltISO: '2023-03-15T01:43:15-0700',
|
|
10
10
|
notes: '',
|
|
11
11
|
};
|
|
12
12
|
return val;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AbstractRatchetCliHandler } from '@bitblit/ratchet-node-only';
|
|
2
|
+
import { RunBackgroundProcessFromCommandLine } from './run-background-process-from-command-line';
|
|
3
|
+
import { TestErrorServer } from '../test-error-server';
|
|
4
|
+
import { LocalContainerServer } from '../local-container-server';
|
|
5
|
+
import { RatchetEpsilonCommonInfo } from '../build/ratchet-epsilon-common-info';
|
|
6
|
+
export class RatchetCliHandler extends AbstractRatchetCliHandler {
|
|
7
|
+
fetchHandlerMap() {
|
|
8
|
+
return {
|
|
9
|
+
'run-background-process': RunBackgroundProcessFromCommandLine.runFromCliArgs,
|
|
10
|
+
'run-test-error-server': TestErrorServer.runFromCliArgs,
|
|
11
|
+
'run-local-container-server': LocalContainerServer.runFromCliArgs,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
fetchVersionInfo() {
|
|
15
|
+
return RatchetEpsilonCommonInfo.buildInformation();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Logger } from '@bitblit/ratchet-common';
|
|
2
|
+
import { BooleanRatchet } from '@bitblit/ratchet-common';
|
|
3
|
+
export class RunBackgroundProcessFromCommandLine {
|
|
4
|
+
static async runFromCliArgs(args) {
|
|
5
|
+
if (args.length > 1) {
|
|
6
|
+
const procName = args[0];
|
|
7
|
+
const dryRun = args.length > 1 && BooleanRatchet.parseBool(args[1]);
|
|
8
|
+
const data = args.length > 2 ? JSON.parse(args[2]) : null;
|
|
9
|
+
const meta = args.length > 3 ? JSON.parse(args[3]) : null;
|
|
10
|
+
const epsilon = null;
|
|
11
|
+
if (dryRun) {
|
|
12
|
+
Logger.info('Dry-Run, would have sent : %s %j %j', procName, data, meta);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
await epsilon.processSingleBackgroundByParts(procName, data, meta);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
console.log('Usage : run-background-process {processName} {dryRun true/false} {dataJson} {metaJson}');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
package/dist/es/index.js
CHANGED
|
@@ -7,7 +7,6 @@ export * from './inter-api-manager';
|
|
|
7
7
|
export * from './local-container-server';
|
|
8
8
|
export * from './local-server-cert';
|
|
9
9
|
export * from './local-server';
|
|
10
|
-
export * from './run-background-process-from-command-line';
|
|
11
10
|
export * from './test-error-server';
|
|
12
11
|
export * from './background/background-dynamo-log-table-handler';
|
|
13
12
|
export * from './background/background-entry';
|
|
@@ -50,7 +49,8 @@ export * from './built-in/http/built-in-filters';
|
|
|
50
49
|
export * from './built-in/http/built-in-handlers';
|
|
51
50
|
export * from './built-in/http/log-level-manipulation-filter';
|
|
52
51
|
export * from './built-in/http/run-handler-as-filter';
|
|
53
|
-
export * from './cli-bootstrap/
|
|
52
|
+
export * from './cli-bootstrap/ratchet-cli-handler';
|
|
53
|
+
export * from './cli-bootstrap/run-background-process-from-command-line';
|
|
54
54
|
export * from './config/dynamo-db-config';
|
|
55
55
|
export * from './config/epsilon-config';
|
|
56
56
|
export * from './config/epsilon-lambda-event-handler';
|
|
@@ -3,7 +3,6 @@ import http from 'http';
|
|
|
3
3
|
import { EventUtil } from './http/event-util';
|
|
4
4
|
import fetch from 'cross-fetch';
|
|
5
5
|
import { LocalServer } from './local-server';
|
|
6
|
-
import { CliRatchet } from '@bitblit/ratchet-node-only';
|
|
7
6
|
export class LocalContainerServer {
|
|
8
7
|
constructor(port = 8889) {
|
|
9
8
|
this.port = port;
|
|
@@ -56,19 +55,18 @@ export class LocalContainerServer {
|
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
});
|
|
58
|
+
static async runFromCliArgs(args) {
|
|
59
|
+
try {
|
|
60
|
+
Logger.setLevel(LoggerLevelName.debug);
|
|
61
|
+
Logger.debug('Running local container server : %j', process?.argv);
|
|
62
|
+
const testServer = new LocalContainerServer();
|
|
63
|
+
await testServer.runServer();
|
|
64
|
+
Logger.info('Got res server');
|
|
65
|
+
process.exit(0);
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
Logger.error('Error : %s', err);
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
74
72
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Logger } from '@bitblit/ratchet-common';
|
|
2
|
-
import { CliRatchet } from '@bitblit/ratchet-node-only';
|
|
3
2
|
import net from 'net';
|
|
4
3
|
export class TestErrorServer {
|
|
5
4
|
constructor(port = 9999) {
|
|
@@ -33,12 +32,11 @@ export class TestErrorServer {
|
|
|
33
32
|
request.setTimeout(100);
|
|
34
33
|
response.end('x');
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
testServer.runServer().then((res) => {
|
|
35
|
+
static async runFromCliArgs(args) {
|
|
36
|
+
Logger.info('test-error-server requested (cli is %s) - starting', process?.argv);
|
|
37
|
+
const testServer = new TestErrorServer();
|
|
38
|
+
await testServer.runServer();
|
|
41
39
|
Logger.info('Got res server');
|
|
42
40
|
process.exit(0);
|
|
43
|
-
}
|
|
41
|
+
}
|
|
44
42
|
}
|