@nsshunt/stsappframework 2.19.209 → 2.19.210
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/package.json +2 -1
- package/dist/tcpclientserver/app.js +0 -15
- package/dist/tcpclientserver/app.js.map +0 -1
- package/dist/tcpclientserver/appConfig.js +0 -61
- package/dist/tcpclientserver/appConfig.js.map +0 -1
- package/run.sh +0 -24
- package/src/tcpclientserver/app.ts +0 -9
- package/src/tcpclientserver/appConfig.ts +0 -66
- package/types/tcpclientserver/app.d.ts +0 -2
- package/types/tcpclientserver/app.d.ts.map +0 -1
- package/types/tcpclientserver/appConfig.d.ts +0 -3
- package/types/tcpclientserver/appConfig.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nsshunt/stsappframework",
|
|
3
|
-
"version": "2.19.
|
|
3
|
+
"version": "2.19.210",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"typescript": "^5.0.4"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
+
"@nsshunt/stsappframework": "^2.19.209",
|
|
45
46
|
"@nsshunt/stsconfig": "^1.25.46",
|
|
46
47
|
"@nsshunt/stsdatamanagement": "^1.17.97",
|
|
47
48
|
"@nsshunt/stsinstrumentation": "^6.11.84",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const appConfig_js_1 = require("./appConfig.js");
|
|
7
|
-
const index_1 = require("./../index");
|
|
8
|
-
const cluster_1 = __importDefault(require("cluster"));
|
|
9
|
-
if (cluster_1.default.isPrimary) {
|
|
10
|
-
new index_1.MasterProcessBase((0, appConfig_js_1.ServiceConfigOptions)(cluster_1.default.isPrimary)).SetupServer();
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
new index_1.WorkerProcessBase((0, appConfig_js_1.ServiceConfigOptions)(cluster_1.default.isPrimary)).SetupServer();
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=app.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/tcpclientserver/app.ts"],"names":[],"mappings":";;;;;AAAA,iDAAqD;AACrD,sCAAiE;AACjE,sDAA8B;AAE9B,IAAI,iBAAO,CAAC,SAAS,EAAE;IACnB,IAAI,yBAAiB,CAAC,IAAA,mCAAoB,EAAC,iBAAO,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;CAChF;KAAM;IACH,IAAI,yBAAiB,CAAC,IAAA,mCAAoB,EAAC,iBAAO,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;CAChF"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ServiceConfigOptions = void 0;
|
|
4
|
-
const uuid_1 = require("uuid");
|
|
5
|
-
const stsconfig_1 = require("@nsshunt/stsconfig");
|
|
6
|
-
const goptions = (0, stsconfig_1.$Options)();
|
|
7
|
-
const index_1 = require("./../index");
|
|
8
|
-
/*
|
|
9
|
-
// nid: `${goptions.rest01servicename} @ ${goptions.rest01serviceversion} | ${this.options.globalServiceData.serviceInstanceId} @ ${os.hostname()} ^ ${process.pid} @ ${(cluster.isMaster ? process.pid : process.ppid)}`,
|
|
10
|
-
// <serviceId> <serviceInstanceId> <serviceInstanceProcessId>
|
|
11
|
-
// <serviceName> <serviceVersion> <sid> <hostName> <pid> <ppid>
|
|
12
|
-
// << ............... Static Nid ............... >> << ............... Dynamic Nid ............... >>
|
|
13
|
-
// Note: The final nid will NOT contain the NID_SEPERATOR character. This will be replaced with the SEPERATOR character.
|
|
14
|
-
const Context = (isMaster, serviceInstanceId) => {
|
|
15
|
-
return {
|
|
16
|
-
nid: `\
|
|
17
|
-
${goptions.rest01servicename}${ModelDelimeter.COMPONENT_SEPERATOR}${goptions.rest01serviceversion}\
|
|
18
|
-
${ModelDelimeter.SEPERATOR}\
|
|
19
|
-
${serviceInstanceId}${ModelDelimeter.COMPONENT_SEPERATOR}${os.hostname()}\
|
|
20
|
-
${ModelDelimeter.NID_SEPERATOR}\
|
|
21
|
-
${process.pid}${ModelDelimeter.COMPONENT_SEPERATOR}${(isMaster ? process.pid : process.ppid)}`
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
*/
|
|
25
|
-
function ServiceConfigOptions(isMaster) {
|
|
26
|
-
if (isMaster === true) {
|
|
27
|
-
const serviceInstanceId = (0, uuid_1.v4)();
|
|
28
|
-
const data = {
|
|
29
|
-
serverType: index_1.STSServerType.TCPRAW_TLS,
|
|
30
|
-
wssServer: false,
|
|
31
|
-
useLatency: false,
|
|
32
|
-
httpsServerKeyPath: goptions.httpsserverkeypath,
|
|
33
|
-
httpsServerCertificatePath: goptions.httpsservercertpath,
|
|
34
|
-
processExitOnTerminate: true,
|
|
35
|
-
serviceInstanceId: serviceInstanceId,
|
|
36
|
-
useDatabase: true,
|
|
37
|
-
useInstrumentationWorkers: true,
|
|
38
|
-
isMaster: isMaster,
|
|
39
|
-
endpoint: goptions.rest01endpoint,
|
|
40
|
-
apiRoot: goptions.rest01apiroot,
|
|
41
|
-
listenPort: goptions.rest01hostport,
|
|
42
|
-
port: goptions.rest01port,
|
|
43
|
-
prometheusSupport: false,
|
|
44
|
-
prometheusClusterPort: goptions.rest01prometheusclusterport,
|
|
45
|
-
serviceName: goptions.rest01servicename,
|
|
46
|
-
serviceVersion: goptions.rest01serviceversion,
|
|
47
|
-
consoleLogging: true,
|
|
48
|
-
instrumentLogging: true,
|
|
49
|
-
instrumentationObservationInterval: goptions.instrumentationObservationInterval,
|
|
50
|
-
instrumentationTimeWindow: goptions.instrumentationTimeWindow,
|
|
51
|
-
useRedisAdaptor: false
|
|
52
|
-
};
|
|
53
|
-
return data;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
const data = JSON.parse(process.env['STS_GSD_SII']);
|
|
57
|
-
return data;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
exports.ServiceConfigOptions = ServiceConfigOptions;
|
|
61
|
-
//# sourceMappingURL=appConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"appConfig.js","sourceRoot":"","sources":["../../src/tcpclientserver/appConfig.ts"],"names":[],"mappings":";;;AAAA,+BAAoC;AAGpC,kDAA6C;AAC7C,MAAM,QAAQ,GAAG,IAAA,oBAAQ,GAAE,CAAA;AAE3B,sCAAwE;AAExE;;;;;;;;;;;;;;;;EAgBE;AAEF,SAAgB,oBAAoB,CAAC,QAAiB;IAClD,IAAI,QAAQ,KAAK,IAAI,EAAE;QACnB,MAAM,iBAAiB,GAAG,IAAA,SAAM,GAAE,CAAC;QACnC,MAAM,IAAI,GAAmB;YACzB,UAAU,EAAE,qBAAa,CAAC,UAAU;YAEpC,SAAS,EAAE,KAAK;YAChB,UAAU,EAAE,KAAK;YACjB,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;YAC/C,0BAA0B,EAAE,QAAQ,CAAC,mBAAmB;YACxD,sBAAsB,EAAE,IAAI;YAC5B,iBAAiB,EAAE,iBAAiB;YACpC,WAAW,EAAE,IAAI;YACjB,yBAAyB,EAAE,IAAI;YAE/B,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,QAAQ,CAAC,cAAc;YACjC,OAAO,EAAE,QAAQ,CAAC,aAAa;YAC/B,UAAU,EAAE,QAAQ,CAAC,cAAc;YACnC,IAAI,EAAE,QAAQ,CAAC,UAAU;YAEzB,iBAAiB,EAAE,KAAK;YACxB,qBAAqB,EAAE,QAAQ,CAAC,2BAA2B;YAE3D,WAAW,EAAE,QAAQ,CAAC,iBAAiB;YACvC,cAAc,EAAE,QAAQ,CAAC,oBAAoB;YAC7C,cAAc,EAAE,IAAI;YACpB,iBAAiB,EAAE,IAAI;YAEvB,kCAAkC,EAAE,QAAQ,CAAC,kCAAkC;YAC/E,yBAAyB,EAAE,QAAQ,CAAC,yBAAyB;YAE7D,eAAe,EAAE,KAAK;SACzB,CAAA;QACD,OAAO,IAAI,CAAC;KACf;SAAM;QACH,MAAM,IAAI,GAAmB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAW,CAAmB,CAAC;QAChG,OAAO,IAAI,CAAC;KACf;AACL,CAAC;AAvCD,oDAuCC"}
|
package/run.sh
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
# openssl req -nodes -new -x509 -keyout server.key -out server.cert
|
|
3
|
-
clear; \
|
|
4
|
-
export STS_PROJ_ROOT=./..; \
|
|
5
|
-
STSENVFILE=$STS_PROJ_ROOT/stsglobalresources/.env \
|
|
6
|
-
DB_SCRIPT_FOLDER=$STS_PROJ_ROOT/stsglobalresources/db-scripts \
|
|
7
|
-
REST01_PORT=3003 \
|
|
8
|
-
REST01_HOST_PORT=3003 \
|
|
9
|
-
REST01_SERVICE_NAME="STSRest01-3003" \
|
|
10
|
-
REST01_API_IDENTIFIER="https://stsmda.com.au/stsrest01api/v1.0/" \
|
|
11
|
-
REST01_ENDPOINT="https://stsrest.stsmda.org" \
|
|
12
|
-
MAX_CPU=4 \
|
|
13
|
-
AS_ENDPOINT=https://stscore.stsmda.org \
|
|
14
|
-
AS_HOST_PORT=3002 \
|
|
15
|
-
AS_PORT=3002 \
|
|
16
|
-
DB_HOST=localhost \
|
|
17
|
-
DB_PORT=5432 \
|
|
18
|
-
DB_PASSWORD=postgres \
|
|
19
|
-
HTTPS_SERVER_KEY_PATH=/etc/letsencrypt/live/stsmda.org/privkey.pem \
|
|
20
|
-
HTTPS_SERVER_CERT_PATH=/etc/letsencrypt/live/stsmda.org/fullchain.pem \
|
|
21
|
-
DEBUG=zzproc* \
|
|
22
|
-
PUBLISH_DEBUG=false \
|
|
23
|
-
UV_THREADPOOL_SIZE=64 \
|
|
24
|
-
node dist/tcpclientserver/app
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ServiceConfigOptions } from './appConfig.js'
|
|
2
|
-
import { MasterProcessBase, WorkerProcessBase } from './../index'
|
|
3
|
-
import cluster from 'cluster';
|
|
4
|
-
|
|
5
|
-
if (cluster.isPrimary) {
|
|
6
|
-
new MasterProcessBase(ServiceConfigOptions(cluster.isPrimary)).SetupServer();
|
|
7
|
-
} else {
|
|
8
|
-
new WorkerProcessBase(ServiceConfigOptions(cluster.isPrimary)).SetupServer();
|
|
9
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import express from 'express';
|
|
3
|
-
|
|
4
|
-
import { $Options } from '@nsshunt/stsconfig'
|
|
5
|
-
const goptions = $Options()
|
|
6
|
-
|
|
7
|
-
import { ProcessOptions, IProcessBase, STSServerType } from './../index'
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
// nid: `${goptions.rest01servicename} @ ${goptions.rest01serviceversion} | ${this.options.globalServiceData.serviceInstanceId} @ ${os.hostname()} ^ ${process.pid} @ ${(cluster.isMaster ? process.pid : process.ppid)}`,
|
|
11
|
-
// <serviceId> <serviceInstanceId> <serviceInstanceProcessId>
|
|
12
|
-
// <serviceName> <serviceVersion> <sid> <hostName> <pid> <ppid>
|
|
13
|
-
// << ............... Static Nid ............... >> << ............... Dynamic Nid ............... >>
|
|
14
|
-
// Note: The final nid will NOT contain the NID_SEPERATOR character. This will be replaced with the SEPERATOR character.
|
|
15
|
-
const Context = (isMaster, serviceInstanceId) => {
|
|
16
|
-
return {
|
|
17
|
-
nid: `\
|
|
18
|
-
${goptions.rest01servicename}${ModelDelimeter.COMPONENT_SEPERATOR}${goptions.rest01serviceversion}\
|
|
19
|
-
${ModelDelimeter.SEPERATOR}\
|
|
20
|
-
${serviceInstanceId}${ModelDelimeter.COMPONENT_SEPERATOR}${os.hostname()}\
|
|
21
|
-
${ModelDelimeter.NID_SEPERATOR}\
|
|
22
|
-
${process.pid}${ModelDelimeter.COMPONENT_SEPERATOR}${(isMaster ? process.pid : process.ppid)}`
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
export function ServiceConfigOptions(isMaster: boolean): ProcessOptions {
|
|
28
|
-
if (isMaster === true) {
|
|
29
|
-
const serviceInstanceId = uuidv4();
|
|
30
|
-
const data: ProcessOptions = {
|
|
31
|
-
serverType: STSServerType.TCPRAW_TLS,
|
|
32
|
-
|
|
33
|
-
wssServer: false,
|
|
34
|
-
useLatency: false,
|
|
35
|
-
httpsServerKeyPath: goptions.httpsserverkeypath,
|
|
36
|
-
httpsServerCertificatePath: goptions.httpsservercertpath,
|
|
37
|
-
processExitOnTerminate: true,
|
|
38
|
-
serviceInstanceId: serviceInstanceId,
|
|
39
|
-
useDatabase: true,
|
|
40
|
-
useInstrumentationWorkers: true,
|
|
41
|
-
|
|
42
|
-
isMaster: isMaster,
|
|
43
|
-
endpoint: goptions.rest01endpoint,
|
|
44
|
-
apiRoot: goptions.rest01apiroot,
|
|
45
|
-
listenPort: goptions.rest01hostport,
|
|
46
|
-
port: goptions.rest01port,
|
|
47
|
-
|
|
48
|
-
prometheusSupport: false,
|
|
49
|
-
prometheusClusterPort: goptions.rest01prometheusclusterport,
|
|
50
|
-
|
|
51
|
-
serviceName: goptions.rest01servicename,
|
|
52
|
-
serviceVersion: goptions.rest01serviceversion,
|
|
53
|
-
consoleLogging: true,
|
|
54
|
-
instrumentLogging: true,
|
|
55
|
-
|
|
56
|
-
instrumentationObservationInterval: goptions.instrumentationObservationInterval,
|
|
57
|
-
instrumentationTimeWindow: goptions.instrumentationTimeWindow,
|
|
58
|
-
|
|
59
|
-
useRedisAdaptor: false
|
|
60
|
-
}
|
|
61
|
-
return data;
|
|
62
|
-
} else {
|
|
63
|
-
const data: ProcessOptions = JSON.parse(process.env['STS_GSD_SII'] as string) as ProcessOptions;
|
|
64
|
-
return data;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/tcpclientserver/app.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"appConfig.d.ts","sourceRoot":"","sources":["../../src/tcpclientserver/appConfig.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAA+B,MAAM,YAAY,CAAA;AAoBxE,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,cAAc,CAuCtE"}
|