@nsshunt/stsappframework 3.1.241 → 3.2.1
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/.github/dependabot.yml +13 -0
- package/.github/workflows/npm-publish.yml +47 -0
- package/.gitignore copy +108 -0
- package/build.sh +37 -0
- package/dist/index.js +30 -0
- package/esbuild.config.js +81 -0
- package/eslint.config.mjs +55 -0
- package/jest/setEnvVars.js +19 -0
- package/keys/server.cert +21 -0
- package/keys/server.key +28 -0
- package/local-redis-stack.conf +2 -0
- package/package.json +10 -23
- package/run-grpc-client.sh +2 -0
- package/run-grpc-server.sh +2 -0
- package/run1.sh +20 -0
- package/run2.sh +20 -0
- package/run3.sh +20 -0
- package/runc1.sh +19 -0
- package/runc2.sh +19 -0
- package/runkafka.sh +19 -0
- package/runkafkaconsume01.sh +21 -0
- package/runkafkaconsume02.sh +21 -0
- package/runpromise.sh +5 -0
- package/runredis.sh +5 -0
- package/runredis1.sh +4 -0
- package/runredis2.sh +24 -0
- package/runredis3.sh +4 -0
- package/runtest1.sh +19 -0
- package/runtest2.sh +19 -0
- package/runtest_ipc_legacy.sh +19 -0
- package/runtest_ipcex.sh +19 -0
- package/runtest_redis.sh +19 -0
- package/runtest_ww.sh +19 -0
- package/src/commonTypes.ts +374 -0
- package/src/controller/stscontrollerbase.ts +14 -0
- package/src/controller/stslatencycontroller.ts +26 -0
- package/src/index.ts +13 -0
- package/src/logger/stsTransportLoggerWinston.ts +24 -0
- package/src/logger/stsTransportWinston.ts +48 -0
- package/src/middleware/serverNetworkMiddleware.ts +243 -0
- package/src/network.ts +36 -0
- package/src/process/masterprocessbase.ts +674 -0
- package/src/process/processbase.ts +483 -0
- package/src/process/serverprocessbase.ts +455 -0
- package/src/process/singleprocessbase.ts +63 -0
- package/src/process/workerprocessbase.ts +224 -0
- package/src/publishertransports/publishTransportUtils.ts +53 -0
- package/src/route/stslatencyroute.ts +15 -0
- package/src/route/stsrouterbase.ts +21 -0
- package/src/stsexpressserver.ts +137 -0
- package/src/validation/errors.ts +6 -0
- package/src/vitesttesting/appConfig.ts +111 -0
- package/src/vitesttesting/appSingleWSS.ts +142 -0
- package/src/vitesttesting/server.ts +17 -0
- package/src/vitesttesting/singleservertest.test.ts +352 -0
- package/src/vitesttesting/wsevents.ts +44 -0
- package/tsconfig.json +42 -0
- package/types/commonTypes.d.ts +230 -0
- package/types/commonTypes.d.ts.map +1 -0
- package/types/controller/stscontrollerbase.d.ts +7 -0
- package/types/controller/stscontrollerbase.d.ts.map +1 -0
- package/types/controller/stslatencycontroller.d.ts +7 -0
- package/types/controller/stslatencycontroller.d.ts.map +1 -0
- package/types/index.d.ts +14 -0
- package/types/index.d.ts.map +1 -0
- package/types/logger/stsTransportLoggerWinston.d.ts +11 -0
- package/types/logger/stsTransportLoggerWinston.d.ts.map +1 -0
- package/types/logger/stsTransportWinston.d.ts +15 -0
- package/types/logger/stsTransportWinston.d.ts.map +1 -0
- package/types/middleware/serverNetworkMiddleware.d.ts +33 -0
- package/types/middleware/serverNetworkMiddleware.d.ts.map +1 -0
- package/types/network.d.ts +4 -0
- package/types/network.d.ts.map +1 -0
- package/types/process/masterprocessbase.d.ts +27 -0
- package/types/process/masterprocessbase.d.ts.map +1 -0
- package/types/process/processbase.d.ts +44 -0
- package/types/process/processbase.d.ts.map +1 -0
- package/types/process/serverprocessbase.d.ts +26 -0
- package/types/process/serverprocessbase.d.ts.map +1 -0
- package/types/process/singleprocessbase.d.ts +21 -0
- package/types/process/singleprocessbase.d.ts.map +1 -0
- package/types/process/workerprocessbase.d.ts +35 -0
- package/types/process/workerprocessbase.d.ts.map +1 -0
- package/types/publishertransports/publishTransportUtils.d.ts +5 -0
- package/types/publishertransports/publishTransportUtils.d.ts.map +1 -0
- package/types/route/stslatencyroute.d.ts +6 -0
- package/types/route/stslatencyroute.d.ts.map +1 -0
- package/types/route/stsrouterbase.d.ts +9 -0
- package/types/route/stsrouterbase.d.ts.map +1 -0
- package/types/stsexpressserver.d.ts +8 -0
- package/types/stsexpressserver.d.ts.map +1 -0
- package/types/validation/errors.d.ts +7 -0
- package/types/validation/errors.d.ts.map +1 -0
- package/types/vitesttesting/appConfig.d.ts +3 -0
- package/types/vitesttesting/appConfig.d.ts.map +1 -0
- package/types/vitesttesting/appSingleWSS.d.ts +7 -0
- package/types/vitesttesting/appSingleWSS.d.ts.map +1 -0
- package/types/vitesttesting/server.d.ts +6 -0
- package/types/vitesttesting/server.d.ts.map +1 -0
- package/types/vitesttesting/singleservertest.test.d.ts +2 -0
- package/types/vitesttesting/singleservertest.test.d.ts.map +1 -0
- package/types/vitesttesting/wsevents.d.ts +29 -0
- package/types/vitesttesting/wsevents.d.ts.map +1 -0
- package/vite.config.ts +19 -0
- package/dist/stsappframework.mjs +0 -156498
- package/dist/stsappframework.mjs.map +0 -7
- package/dist/stsappframework.umd.js +0 -156516
- package/dist/stsappframework.umd.js.map +0 -7
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
|
3
|
+
# Please see the documentation for all configuration options:
|
|
4
|
+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
5
|
+
#
|
|
6
|
+
# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates
|
|
7
|
+
|
|
8
|
+
version: 2
|
|
9
|
+
updates:
|
|
10
|
+
- package-ecosystem: "npm" # See documentation for possible values
|
|
11
|
+
directory: "/" # Location of package manifests
|
|
12
|
+
schedule:
|
|
13
|
+
interval: "monthly"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
3
|
+
name: Node.js Package
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
release:
|
|
7
|
+
types: [created]
|
|
8
|
+
push:
|
|
9
|
+
branches: [ main ]
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version: 23
|
|
19
|
+
cache: 'yarn'
|
|
20
|
+
#cache: 'npm'
|
|
21
|
+
- run: yarn install --frozen-lockfile
|
|
22
|
+
- run: yarn lint
|
|
23
|
+
- run: yarn test
|
|
24
|
+
#- run: npm ci
|
|
25
|
+
#- run: npm run lint
|
|
26
|
+
#- run: npm test
|
|
27
|
+
|
|
28
|
+
publish-npm:
|
|
29
|
+
needs: build
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/checkout@v4
|
|
33
|
+
- uses: actions/setup-node@v4
|
|
34
|
+
with:
|
|
35
|
+
node-version: 23
|
|
36
|
+
cache: 'yarn'
|
|
37
|
+
#cache: 'npm'
|
|
38
|
+
registry-url: https://registry.npmjs.org/
|
|
39
|
+
- run: yarn install --frozen-lockfile
|
|
40
|
+
- run: yarn build
|
|
41
|
+
#- run: node esbuild.config.js
|
|
42
|
+
- run: yarn publish --access public
|
|
43
|
+
#- run: npm ci
|
|
44
|
+
#- run: npm run build
|
|
45
|
+
#- run: npm publish --access public
|
|
46
|
+
env:
|
|
47
|
+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
package/.gitignore copy
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
lerna-debug.log*
|
|
8
|
+
|
|
9
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
10
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
11
|
+
|
|
12
|
+
# Runtime data
|
|
13
|
+
pids
|
|
14
|
+
*.pid
|
|
15
|
+
*.seed
|
|
16
|
+
*.pid.lock
|
|
17
|
+
|
|
18
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
19
|
+
lib-cov
|
|
20
|
+
|
|
21
|
+
# Coverage directory used by tools like istanbul
|
|
22
|
+
coverage
|
|
23
|
+
*.lcov
|
|
24
|
+
|
|
25
|
+
# nyc test coverage
|
|
26
|
+
.nyc_output
|
|
27
|
+
|
|
28
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
29
|
+
.grunt
|
|
30
|
+
|
|
31
|
+
# Bower dependency directory (https://bower.io/)
|
|
32
|
+
bower_components
|
|
33
|
+
|
|
34
|
+
# node-waf configuration
|
|
35
|
+
.lock-wscript
|
|
36
|
+
|
|
37
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
38
|
+
build/Release
|
|
39
|
+
|
|
40
|
+
# Dependency directories
|
|
41
|
+
node_modules/
|
|
42
|
+
jspm_packages/
|
|
43
|
+
|
|
44
|
+
# TypeScript v1 declaration files
|
|
45
|
+
typings/
|
|
46
|
+
|
|
47
|
+
# TypeScript cache
|
|
48
|
+
*.tsbuildinfo
|
|
49
|
+
|
|
50
|
+
# Optional npm cache directory
|
|
51
|
+
.npm
|
|
52
|
+
|
|
53
|
+
# Optional eslint cache
|
|
54
|
+
.eslintcache
|
|
55
|
+
|
|
56
|
+
# Microbundle cache
|
|
57
|
+
.rpt2_cache/
|
|
58
|
+
.rts2_cache_cjs/
|
|
59
|
+
.rts2_cache_es/
|
|
60
|
+
.rts2_cache_umd/
|
|
61
|
+
|
|
62
|
+
# Optional REPL history
|
|
63
|
+
.node_repl_history
|
|
64
|
+
|
|
65
|
+
# Output of 'npm pack'
|
|
66
|
+
*.tgz
|
|
67
|
+
|
|
68
|
+
# Yarn Integrity file
|
|
69
|
+
.yarn-integrity
|
|
70
|
+
|
|
71
|
+
# dotenv environment variables file
|
|
72
|
+
.env
|
|
73
|
+
.env.test
|
|
74
|
+
|
|
75
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
76
|
+
.cache
|
|
77
|
+
|
|
78
|
+
# Next.js build output
|
|
79
|
+
.next
|
|
80
|
+
|
|
81
|
+
# Nuxt.js build / generate output
|
|
82
|
+
.nuxt
|
|
83
|
+
dist
|
|
84
|
+
|
|
85
|
+
# Gatsby files
|
|
86
|
+
.cache/
|
|
87
|
+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
|
|
88
|
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
89
|
+
# public
|
|
90
|
+
|
|
91
|
+
# vuepress build output
|
|
92
|
+
.vuepress/dist
|
|
93
|
+
|
|
94
|
+
# Serverless directories
|
|
95
|
+
.serverless/
|
|
96
|
+
|
|
97
|
+
# FuseBox cache
|
|
98
|
+
.fusebox/
|
|
99
|
+
|
|
100
|
+
# DynamoDB Local files
|
|
101
|
+
.dynamodb/
|
|
102
|
+
|
|
103
|
+
# TernJS port file
|
|
104
|
+
.tern-port
|
|
105
|
+
|
|
106
|
+
.DS_Store
|
|
107
|
+
|
|
108
|
+
.scannerwork
|
package/build.sh
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
rm -rf dist
|
|
3
|
+
rm -rf types
|
|
4
|
+
#npm i --verbose
|
|
5
|
+
yarn install
|
|
6
|
+
#npm run build
|
|
7
|
+
yarn build
|
|
8
|
+
#node esbuild.config.js
|
|
9
|
+
RESULT=$?
|
|
10
|
+
if [ $RESULT -eq 0 ]; then
|
|
11
|
+
echo success build
|
|
12
|
+
#npm run lint
|
|
13
|
+
yarn lint
|
|
14
|
+
RESULT=$?
|
|
15
|
+
if [ $RESULT -eq 0 ]; then
|
|
16
|
+
echo success lint
|
|
17
|
+
yarn test
|
|
18
|
+
#npm run test
|
|
19
|
+
RESULT=$?
|
|
20
|
+
if [ $RESULT -eq 0 ]; then
|
|
21
|
+
echo success test
|
|
22
|
+
git commit -a -m "changed"
|
|
23
|
+
yarn version --patch
|
|
24
|
+
#npm version patch
|
|
25
|
+
yarn install
|
|
26
|
+
#npm i --verbose
|
|
27
|
+
git commit -a -m "changed"
|
|
28
|
+
git push
|
|
29
|
+
else
|
|
30
|
+
echo failed test
|
|
31
|
+
fi
|
|
32
|
+
else
|
|
33
|
+
echo failed lint
|
|
34
|
+
fi
|
|
35
|
+
else
|
|
36
|
+
echo failed build
|
|
37
|
+
fi
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./commonTypes"), exports);
|
|
18
|
+
__exportStar(require("./process/masterprocessbase"), exports);
|
|
19
|
+
__exportStar(require("./process/processbase"), exports);
|
|
20
|
+
__exportStar(require("./process/serverprocessbase"), exports);
|
|
21
|
+
__exportStar(require("./process/singleprocessbase"), exports);
|
|
22
|
+
__exportStar(require("./process/workerprocessbase"), exports);
|
|
23
|
+
__exportStar(require("./controller/stscontrollerbase"), exports);
|
|
24
|
+
__exportStar(require("./controller/stslatencycontroller"), exports);
|
|
25
|
+
__exportStar(require("./route/stslatencyroute"), exports);
|
|
26
|
+
__exportStar(require("./route/stsrouterbase"), exports);
|
|
27
|
+
__exportStar(require("./publishertransports/publishTransportUtils"), exports);
|
|
28
|
+
__exportStar(require("./logger/stsTransportLoggerWinston"), exports);
|
|
29
|
+
__exportStar(require("./logger/stsTransportWinston"), exports);
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
2
|
+
const esbuild = require('esbuild');
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
// Define the library name and output paths
|
|
7
|
+
const libraryFileName = 'stsappframework';
|
|
8
|
+
const libraryName = 'stsappframework';
|
|
9
|
+
const distPath = './dist';
|
|
10
|
+
|
|
11
|
+
// Shared build options
|
|
12
|
+
const sharedOptions = {
|
|
13
|
+
entryPoints: [path.resolve('./src/index.ts')],
|
|
14
|
+
bundle: true,
|
|
15
|
+
sourcemap: true,
|
|
16
|
+
platform: 'node', // Target Node.js
|
|
17
|
+
target: 'node20', // Node.js version
|
|
18
|
+
external: [
|
|
19
|
+
/*
|
|
20
|
+
'axios',
|
|
21
|
+
'express',
|
|
22
|
+
'@nsshunt/stsutils',
|
|
23
|
+
'@nsshunt/stsauthclient',
|
|
24
|
+
'node:*',
|
|
25
|
+
'fs',
|
|
26
|
+
'path',
|
|
27
|
+
'os',
|
|
28
|
+
'http',
|
|
29
|
+
'https',
|
|
30
|
+
'tls',
|
|
31
|
+
'crypto',
|
|
32
|
+
'util',
|
|
33
|
+
'child_process',
|
|
34
|
+
'cluster',
|
|
35
|
+
*/
|
|
36
|
+
],
|
|
37
|
+
define: {
|
|
38
|
+
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
|
|
39
|
+
},
|
|
40
|
+
outdir: distPath,
|
|
41
|
+
entryNames: libraryFileName, // Ensures output files are named 'stsappframework'
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// Build UMD (Universal Module Definition)
|
|
45
|
+
esbuild.build({
|
|
46
|
+
...sharedOptions,
|
|
47
|
+
format: 'cjs', // UMD format for browser and Node.js
|
|
48
|
+
globalName: libraryName, // Global variable for UMD in browser
|
|
49
|
+
outExtension: { '.js': '.umd.js' },
|
|
50
|
+
}).then(() => {
|
|
51
|
+
console.log(`UMD build complete! Files written to ${distPath}`);
|
|
52
|
+
}).catch((err) => {
|
|
53
|
+
console.error('UMD build failed:', err);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
// Build CommonJS (CJS)
|
|
59
|
+
esbuild.build({
|
|
60
|
+
...sharedOptions,
|
|
61
|
+
format: 'cjs', // CommonJS format for Node.js
|
|
62
|
+
outExtension: { '.js': '.cjs.js' },
|
|
63
|
+
}).then(() => {
|
|
64
|
+
console.log(`CJS build complete! Files written to ${distPath}`);
|
|
65
|
+
}).catch((err) => {
|
|
66
|
+
console.error('CJS build failed:', err);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
});
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
// Build ES Module (ESM)
|
|
72
|
+
esbuild.build({
|
|
73
|
+
...sharedOptions,
|
|
74
|
+
format: 'esm', // ES Module format
|
|
75
|
+
outExtension: { '.js': '.mjs' },
|
|
76
|
+
}).then(() => {
|
|
77
|
+
console.log(`ESM build complete! Files written to ${distPath}`);
|
|
78
|
+
}).catch((err) => {
|
|
79
|
+
console.error('ESM build failed:', err);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
import tsParser from "@typescript-eslint/parser";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import js from "@eslint/js";
|
|
7
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
const compat = new FlatCompat({
|
|
12
|
+
baseDirectory: __dirname,
|
|
13
|
+
recommendedConfig: js.configs.recommended,
|
|
14
|
+
allConfig: js.configs.all
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export default [{
|
|
18
|
+
ignores: [
|
|
19
|
+
"**/temp.js",
|
|
20
|
+
"**/k6scripts/*.js",
|
|
21
|
+
"**/public/*",
|
|
22
|
+
"**/dist/*",
|
|
23
|
+
"**/types/*",
|
|
24
|
+
],
|
|
25
|
+
}, ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"), {
|
|
26
|
+
plugins: {
|
|
27
|
+
"@typescript-eslint": typescriptEslint,
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
languageOptions: {
|
|
31
|
+
globals: {
|
|
32
|
+
...globals.browser,
|
|
33
|
+
...globals.node,
|
|
34
|
+
...globals.jest,
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
parser: tsParser,
|
|
38
|
+
ecmaVersion: "latest",
|
|
39
|
+
sourceType: "module",
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
rules: {
|
|
43
|
+
indent: ["error", 4],
|
|
44
|
+
"no-mixed-spaces-and-tabs": [2],
|
|
45
|
+
"@typescript-eslint/no-var-requires": "warn",
|
|
46
|
+
"@typescript-eslint/no-this-alias": "warn",
|
|
47
|
+
"@typescript-eslint/no-unused-expressions": [
|
|
48
|
+
"error",
|
|
49
|
+
{
|
|
50
|
+
"allowTernary": true,
|
|
51
|
+
"allowTaggedTemplates": true
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
}];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
process.env.DB_HOST='localhost:5432';
|
|
2
|
+
process.env.DB_PASSWORD='postgres';
|
|
3
|
+
process.env.DB_USER='postgres';
|
|
4
|
+
|
|
5
|
+
process.env.DEBUG='proc*';
|
|
6
|
+
process.env.MAX_CPU=2;
|
|
7
|
+
|
|
8
|
+
process.env.CLIENT_ID='v4qBrds3Autl/i86xT+5z0K53kJ/2hHTfxNo0QO/0Jk='; // STSAuthenticateSPA
|
|
9
|
+
process.env.REDIRECT_URI='https://stsmda.com.au/stsauthenticate/admin/';
|
|
10
|
+
process.env.SCOPE='openid offline_access res01.create res01.read res01.update res01.delete';
|
|
11
|
+
//@@ below
|
|
12
|
+
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; // Required for self-signed certs
|
|
13
|
+
//@@ above
|
|
14
|
+
process.env.AS_ENDPOINT='https://localhost'; // Required for the jwks signing keys
|
|
15
|
+
|
|
16
|
+
process.env.HTTPS_SERVER_KEY_PATH='./keys/server.key'; //@@
|
|
17
|
+
process.env.HTTPS_SERVER_CERT_PATH='./keys/server.cert'; //@@
|
|
18
|
+
//process.env.HTTPS_SERVER_KEY_PATH='/etc/letsencrypt/live/stsmda.org/privkey.pem'; //@@
|
|
19
|
+
//process.env.HTTPS_SERVER_CERT_PATH='/etc/letsencrypt/live/stsmda.org/fullchain.pem'; //@@
|
package/keys/server.cert
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
|
2
|
+
MIIDazCCAlOgAwIBAgIUL2Hy5aV6VpHdEL5gRE6Rf1V7Fi0wDQYJKoZIhvcNAQEL
|
|
3
|
+
BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
|
|
4
|
+
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMjA0MjMyMzU3MDJaFw0yMjA1
|
|
5
|
+
MjMyM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|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nsshunt/stsappframework",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "
|
|
6
|
-
"module": "./dist/stsappframework.mjs",
|
|
7
|
-
"type": "commonjs",
|
|
5
|
+
"main": "dist/index.js",
|
|
8
6
|
"types": "./types/index.d.ts",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"require": "./dist/stsappframework.umd.js"
|
|
13
|
-
}
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/nsshunt/stsappframework.git"
|
|
14
10
|
},
|
|
15
|
-
"files": [
|
|
16
|
-
"dist",
|
|
17
|
-
"types",
|
|
18
|
-
"LICENSE",
|
|
19
|
-
"README.md"
|
|
20
|
-
],
|
|
21
11
|
"scripts": {
|
|
22
|
-
"test": "
|
|
12
|
+
"test": "vitest run --reporter verbose --pool forks",
|
|
23
13
|
"test2": "vitest run --reporter verbose --threads false --ui",
|
|
24
14
|
"test3": "jest --detectOpenHandles --no-cache",
|
|
25
15
|
"testwatch": "jest --watchAll --detectOpenHandles --no-cache",
|
|
26
16
|
"nodeapp": "node app.js",
|
|
27
17
|
"lint": "eslint .",
|
|
28
18
|
"lintex": "eslint . --fix",
|
|
29
|
-
"build": "tsc
|
|
30
|
-
"build2": "tsc && vite build"
|
|
31
|
-
},
|
|
32
|
-
"repository": {
|
|
33
|
-
"type": "git",
|
|
34
|
-
"url": "git+https://github.com/nsshunt/stsappframework.git"
|
|
19
|
+
"build": "tsc"
|
|
35
20
|
},
|
|
36
21
|
"author": "Marcus Bettens",
|
|
37
22
|
"license": "MIT",
|
|
@@ -40,6 +25,8 @@
|
|
|
40
25
|
},
|
|
41
26
|
"homepage": "https://github.com/nsshunt/stsappframework#readme",
|
|
42
27
|
"devDependencies": {
|
|
28
|
+
"@babel/preset-env": "^7.26.0",
|
|
29
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
43
30
|
"@eslint/eslintrc": "^3.2.0",
|
|
44
31
|
"@eslint/js": "^9.15.0",
|
|
45
32
|
"@tsconfig/node20": "^20.1.4",
|
|
@@ -49,9 +36,9 @@
|
|
|
49
36
|
"@types/uuid": "^10.0.0",
|
|
50
37
|
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
|
51
38
|
"@typescript-eslint/parser": "^8.15.0",
|
|
52
|
-
"esbuild": "^0.24.0",
|
|
53
39
|
"eslint": "^9.15.0",
|
|
54
40
|
"globals": "^15.12.0",
|
|
41
|
+
"jest": "^29.7.0",
|
|
55
42
|
"testcontainers": "^10.14.0",
|
|
56
43
|
"typescript": "^5.6.3",
|
|
57
44
|
"vite": "^5.4.11",
|
package/run1.sh
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
REST01_PORT=3003 \
|
|
7
|
+
REST01_HOST_PORT=3003 \
|
|
8
|
+
REST01_ENDPOINT="https://stsrest.stsmda.org" \
|
|
9
|
+
MAX_CPU=1 \
|
|
10
|
+
AS_ENDPOINT=https://stscore.stsmda.org \
|
|
11
|
+
AS_HOST_PORT=3002 \
|
|
12
|
+
AS_PORT=3002 \
|
|
13
|
+
DB_HOST=localhost:5432 \
|
|
14
|
+
DB_PASSWORD=postgres \
|
|
15
|
+
HTTPS_SERVER_KEY_PATH=/etc/letsencrypt/live/stsmda.org/privkey.pem \
|
|
16
|
+
HTTPS_SERVER_CERT_PATH=/etc/letsencrypt/live/stsmda.org/fullchain.pem \
|
|
17
|
+
DEBUG=zzproc* \
|
|
18
|
+
UV_THREADPOOL_SIZE=64 \
|
|
19
|
+
SERVICE_INDEX=0 \
|
|
20
|
+
node dist/tcpserver/app;
|
package/run2.sh
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
REST01_PORT=3003 \
|
|
7
|
+
REST01_HOST_PORT=3003 \
|
|
8
|
+
REST01_ENDPOINT="https://stsrest.stsmda.org" \
|
|
9
|
+
MAX_CPU=1 \
|
|
10
|
+
AS_ENDPOINT=https://stscore.stsmda.org \
|
|
11
|
+
AS_HOST_PORT=3002 \
|
|
12
|
+
AS_PORT=3002 \
|
|
13
|
+
DB_HOST=localhost:5432 \
|
|
14
|
+
DB_PASSWORD=postgres \
|
|
15
|
+
HTTPS_SERVER_KEY_PATH=/etc/letsencrypt/live/stsmda.org/privkey.pem \
|
|
16
|
+
HTTPS_SERVER_CERT_PATH=/etc/letsencrypt/live/stsmda.org/fullchain.pem \
|
|
17
|
+
DEBUG=zzproc* \
|
|
18
|
+
UV_THREADPOOL_SIZE=64 \
|
|
19
|
+
SERVICE_INDEX=1 \
|
|
20
|
+
node dist/tcpserver/app;
|
package/run3.sh
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
REST01_PORT=3003 \
|
|
7
|
+
REST01_HOST_PORT=3003 \
|
|
8
|
+
REST01_ENDPOINT="https://stsrest.stsmda.org" \
|
|
9
|
+
MAX_CPU=1 \
|
|
10
|
+
AS_ENDPOINT=https://stscore.stsmda.org \
|
|
11
|
+
AS_HOST_PORT=3002 \
|
|
12
|
+
AS_PORT=3002 \
|
|
13
|
+
DB_HOST=localhost:5432 \
|
|
14
|
+
DB_PASSWORD=postgres \
|
|
15
|
+
HTTPS_SERVER_KEY_PATH=/etc/letsencrypt/live/stsmda.org/privkey.pem \
|
|
16
|
+
HTTPS_SERVER_CERT_PATH=/etc/letsencrypt/live/stsmda.org/fullchain.pem \
|
|
17
|
+
DEBUG=zzproc* \
|
|
18
|
+
UV_THREADPOOL_SIZE=64 \
|
|
19
|
+
SERVICE_INDEX=2 \
|
|
20
|
+
node dist/tcpserver/app;
|
package/runc1.sh
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
REST01_PORT=3003 \
|
|
7
|
+
REST01_HOST_PORT=3003 \
|
|
8
|
+
REST01_ENDPOINT="https://stsrest.stsmda.org" \
|
|
9
|
+
MAX_CPU=1 \
|
|
10
|
+
AS_ENDPOINT=https://stscore.stsmda.org \
|
|
11
|
+
AS_HOST_PORT=3002 \
|
|
12
|
+
AS_PORT=3002 \
|
|
13
|
+
DB_HOST=localhost:5432 \
|
|
14
|
+
DB_PASSWORD=postgres \
|
|
15
|
+
HTTPS_SERVER_KEY_PATH=/etc/letsencrypt/live/stsmda.org/privkey.pem \
|
|
16
|
+
HTTPS_SERVER_CERT_PATH=/etc/letsencrypt/live/stsmda.org/fullchain.pem \
|
|
17
|
+
DEBUG=proc* \
|
|
18
|
+
UV_THREADPOOL_SIZE=64 \
|
|
19
|
+
node dist/tcpclient/app
|
package/runc2.sh
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
REST01_PORT=3003 \
|
|
7
|
+
REST01_HOST_PORT=3003 \
|
|
8
|
+
REST01_ENDPOINT="https://stsrest.stsmda.org" \
|
|
9
|
+
MAX_CPU=1 \
|
|
10
|
+
AS_ENDPOINT=https://stscore.stsmda.org \
|
|
11
|
+
AS_HOST_PORT=3002 \
|
|
12
|
+
AS_PORT=3002 \
|
|
13
|
+
DB_HOST=localhost:5432 \
|
|
14
|
+
DB_PASSWORD=postgres \
|
|
15
|
+
HTTPS_SERVER_KEY_PATH=/etc/letsencrypt/live/stsmda.org/privkey.pem \
|
|
16
|
+
HTTPS_SERVER_CERT_PATH=/etc/letsencrypt/live/stsmda.org/fullchain.pem \
|
|
17
|
+
DEBUG=proc* \
|
|
18
|
+
UV_THREADPOOL_SIZE=64 \
|
|
19
|
+
node dist/tcpclient/app2
|
package/runkafka.sh
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
REST01_PORT=3003 \
|
|
7
|
+
REST01_HOST_PORT=3003 \
|
|
8
|
+
REST01_ENDPOINT="https://stsrest.stsmda.org" \
|
|
9
|
+
MAX_CPU=1 \
|
|
10
|
+
AS_ENDPOINT=https://stscore.stsmda.org \
|
|
11
|
+
AS_HOST_PORT=3002 \
|
|
12
|
+
AS_PORT=3002 \
|
|
13
|
+
DB_HOST=localhost:5432 \
|
|
14
|
+
DB_PASSWORD=postgres \
|
|
15
|
+
HTTPS_SERVER_KEY_PATH=/etc/letsencrypt/live/stsmda.org/privkey.pem \
|
|
16
|
+
HTTPS_SERVER_CERT_PATH=/etc/letsencrypt/live/stsmda.org/fullchain.pem \
|
|
17
|
+
DEBUG=proc* \
|
|
18
|
+
UV_THREADPOOL_SIZE=64 \
|
|
19
|
+
node ./dist/kafkatesting/produce.js
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
REST01_PORT=3003 \
|
|
7
|
+
REST01_HOST_PORT=3003 \
|
|
8
|
+
REST01_ENDPOINT="https://stsrest.stsmda.org" \
|
|
9
|
+
MAX_CPU=1 \
|
|
10
|
+
AS_ENDPOINT=https://stscore.stsmda.org \
|
|
11
|
+
AS_HOST_PORT=3002 \
|
|
12
|
+
AS_PORT=3002 \
|
|
13
|
+
DB_HOST=localhost:5432 \
|
|
14
|
+
DB_PASSWORD=postgres \
|
|
15
|
+
HTTPS_SERVER_KEY_PATH=/etc/letsencrypt/live/stsmda.org/privkey.pem \
|
|
16
|
+
HTTPS_SERVER_CERT_PATH=/etc/letsencrypt/live/stsmda.org/fullchain.pem \
|
|
17
|
+
DEBUG=proc* \
|
|
18
|
+
UV_THREADPOOL_SIZE=64 \
|
|
19
|
+
GROUP_ID=01 \
|
|
20
|
+
CLIENT_ID=01 \
|
|
21
|
+
node ./dist/kafkatesting/consume.js
|