hotstaq 0.9.37 → 0.9.39

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 CHANGED
@@ -1,106 +1,106 @@
1
1
  {
2
- "name": "hotstaq",
3
- "version": "0.9.37",
4
- "description": "A friendly web framework that fits nicely into devops and CI/CD pipelines.",
5
- "bin": {
6
- "hotstaq": "./bin/hotstaq"
7
- },
8
- "main": "./build/src/api.js",
9
- "types": "./build/src/api.d.js",
10
- "packageManager": "npm@11.6.2",
11
- "type": "commonjs",
12
- "scripts": {
13
- "dev": "npx tsc --watch",
14
- "dev-web": "npx webpack --mode=development --watch",
15
- "dev-web-tests": "npx webpack --mode=development --config=webpack.config.tests.cjs --watch",
16
- "benchmarks": "node ./build/benchmarks/index.js",
17
- "version-check": "node ./scripts/VersionCheck.mjs",
18
- "test": "npm run build-test-api && export $(cat .env | xargs) && npx mocha --timeout 5000 --colors ./build/tests/**/*.js",
19
- "test-nyc": "npm run build-test-api && nyc mocha --require=dotenv/config --timeout 5000 --colors ./build/tests/**/*.js",
20
- "prepublishOnly": "npm run builddoc && npm run build && npm run buildweb && npm run version-check",
21
- "builddoc": "npx typedoc --theme markdown --tsconfig ./tsconfig.json --entryPoints './src/api.ts' --readme README.md --out ./docs/ ./src",
22
- "build": "npx tsc --build ./tsconfig.json",
23
- "buildweb": "npx webpack --mode=production && npm_config_yes=true npx google-closure-compiler@latest --js=./build-web/HotStaq.js --language_out=ECMASCRIPT_2018 --js_output_file=./build-web/HotStaq.min.js",
24
- "buildwebdebug": "npx webpack --mode=development --stats-modules-space 999 && npx webpack --mode=development --config=webpack.config.tests.cjs",
25
- "build-test-api": "node ./build/src/index.js --hotsite ./tests/hotsite/HotSite.json generate --api",
26
- "prepare": "husky"
27
- },
28
- "bugs": {
29
- "url": "https://github.com/OurFreeLight/HotStaq/issues"
30
- },
31
- "author": "FreeLight, Inc",
32
- "license": "MIT",
33
- "repository": {
34
- "type": "git",
35
- "url": "https://github.com/OurFreeLight/HotStaq.git"
36
- },
37
- "dependencies": {
38
- "@influxdata/influxdb-client": "^1.20.0",
39
- "@microsoft/fetch-event-source": "^2.0.1",
40
- "@modelcontextprotocol/sdk": "^1.27.1",
41
- "@types/swagger-ui-express": "^4.1.7",
42
- "archiver": "^5.3.1",
43
- "chai": "^6.2.2",
44
- "commander": "^6.2.1",
45
- "dompurify": "^3.2.6",
46
- "dotenv": "^16.0.2",
47
- "esbuild": "^0.28.0",
48
- "express": "^4.21.2",
49
- "express-rate-limit": "^7.5.1",
50
- "form-data": "^4.0.4",
51
- "formidable": "^3.5.4",
52
- "fs-extra": "^9.1.0",
53
- "glob": "^11.1.0",
54
- "ioredis": "^5.4.1",
55
- "js-cookie": "^3.0.1",
56
- "jsdom": "^26.1.0",
57
- "mime-types": "^2.1.35",
58
- "mocha": "^11.7.5",
59
- "mysql2": "^3.9.9",
60
- "node-fetch": "^2.6.7",
61
- "pg": "^8.13.1",
62
- "pg-pool": "^3.7.0",
63
- "rate-limit-redis": "^4.2.0",
64
- "selenium-webdriver": "^4.38.0",
65
- "socket.io": "^4.8.1",
66
- "socket.io-client": "^4.8.1",
67
- "swagger-ui-express": "^5.0.1",
68
- "ts-morph": "^25.0.1",
69
- "turbo": "^2.5.4",
70
- "typescript": "^5.8.2",
71
- "uuid": "^8.3.2",
72
- "validate-npm-package-name": "^3.0.0",
73
- "yaml": "^2.7.1"
74
- },
75
- "devDependencies": {
76
- "@types/archiver": "^5.3.2",
77
- "@types/chai": "^5.2.3",
78
- "@types/express": "^4.17.13",
79
- "@types/formidable": "^3.4.5",
80
- "@types/fs-extra": "^9.0.12",
81
- "@types/js-cookie": "^2.2.7",
82
- "@types/mime-types": "^2.1.1",
83
- "@types/mocha": "^10.0.10",
84
- "@types/node": "^22.14.0",
85
- "@types/node-fetch": "^2.6.1",
86
- "@types/pg": "^8.11.10",
87
- "@types/pg-pool": "^2.0.6",
88
- "@types/selenium-webdriver": "^4.35.4",
89
- "@types/uuid": "^8.3.4",
90
- "@types/validate-npm-package-name": "^3.0.3",
91
- "@typescript-eslint/eslint-plugin": "^8.29.0",
92
- "@typescript-eslint/parser": "^8.29.0",
93
- "eslint": "^9.24.0",
94
- "husky": "^9.1.7",
95
- "nyc": "^17.1.0",
96
- "ts-loader": "^9.5.2",
97
- "typedoc": "^0.28.1",
98
- "typedoc-plugin-markdown": "^4.6.1",
99
- "webpack": "^5.98.0",
100
- "webpack-cli": "^6.0.1"
101
- },
102
- "overrides": {
103
- "diff": ">=8.0.3",
104
- "serialize-javascript": ">=7.0.3"
105
- }
2
+ "name": "hotstaq",
3
+ "version": "0.9.39",
4
+ "description": "A friendly web framework that fits nicely into devops and CI/CD pipelines.",
5
+ "bin": {
6
+ "hotstaq": "./bin/hotstaq"
7
+ },
8
+ "main": "./build/src/api.js",
9
+ "types": "./build/src/api.d.js",
10
+ "packageManager": "npm@11.6.2",
11
+ "type": "commonjs",
12
+ "scripts": {
13
+ "dev": "npx tsc --watch",
14
+ "dev-web": "npx webpack --mode=development --watch",
15
+ "dev-web-tests": "npx webpack --mode=development --config=webpack.config.tests.cjs --watch",
16
+ "benchmarks": "node ./build/benchmarks/index.js",
17
+ "version-check": "node ./scripts/VersionCheck.mjs",
18
+ "test": "npm run build-test-api && export $(cat .env | xargs) && npx mocha --timeout 5000 --colors ./build/tests/**/*.js",
19
+ "test-nyc": "npm run build-test-api && nyc mocha --require=dotenv/config --timeout 5000 --colors ./build/tests/**/*.js",
20
+ "prepublishOnly": "npm run builddoc && npm run build && npm run buildweb && npm run version-check",
21
+ "builddoc": "npx typedoc --theme markdown --tsconfig ./tsconfig.json --entryPoints './src/api.ts' --readme README.md --out ./docs/ ./src",
22
+ "build": "npx tsc --build ./tsconfig.json",
23
+ "buildweb": "npx webpack --mode=production && npm_config_yes=true npx google-closure-compiler@latest --js=./build-web/HotStaq.js --language_out=ECMASCRIPT_2018 --js_output_file=./build-web/HotStaq.min.js",
24
+ "buildwebdebug": "npx webpack --mode=development --stats-modules-space 999 && npx webpack --mode=development --config=webpack.config.tests.cjs",
25
+ "build-test-api": "node ./build/src/index.js --hotsite ./tests/hotsite/HotSite.json generate --api",
26
+ "prepare": "husky"
27
+ },
28
+ "bugs": {
29
+ "url": "https://github.com/OurFreeLight/HotStaq/issues"
30
+ },
31
+ "author": "FreeLight, Inc",
32
+ "license": "MIT",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "https://github.com/OurFreeLight/HotStaq.git"
36
+ },
37
+ "dependencies": {
38
+ "@influxdata/influxdb-client": "^1.20.0",
39
+ "@microsoft/fetch-event-source": "^2.0.1",
40
+ "@modelcontextprotocol/sdk": "^1.27.1",
41
+ "@types/swagger-ui-express": "^4.1.7",
42
+ "archiver": "^5.3.1",
43
+ "chai": "^6.2.2",
44
+ "commander": "^6.2.1",
45
+ "dompurify": "^3.2.6",
46
+ "dotenv": "^16.0.2",
47
+ "esbuild": "^0.28.0",
48
+ "express": "^4.21.2",
49
+ "express-rate-limit": "^7.5.1",
50
+ "form-data": "^4.0.4",
51
+ "formidable": "^3.5.4",
52
+ "fs-extra": "^9.1.0",
53
+ "glob": "^11.1.0",
54
+ "ioredis": "^5.4.1",
55
+ "js-cookie": "^3.0.1",
56
+ "jsdom": "^26.1.0",
57
+ "mime-types": "^2.1.35",
58
+ "mocha": "^11.7.5",
59
+ "mysql2": "^3.9.9",
60
+ "node-fetch": "^2.6.7",
61
+ "pg": "^8.13.1",
62
+ "pg-pool": "^3.7.0",
63
+ "rate-limit-redis": "^4.2.0",
64
+ "selenium-webdriver": "^4.38.0",
65
+ "socket.io": "^4.8.1",
66
+ "socket.io-client": "^4.8.1",
67
+ "swagger-ui-express": "^5.0.1",
68
+ "ts-morph": "^25.0.1",
69
+ "turbo": "^2.5.4",
70
+ "typescript": "^5.8.2",
71
+ "uuid": "^11.1.1",
72
+ "validate-npm-package-name": "^3.0.0",
73
+ "yaml": "^2.7.1"
74
+ },
75
+ "devDependencies": {
76
+ "@types/archiver": "^5.3.2",
77
+ "@types/chai": "^5.2.3",
78
+ "@types/express": "^4.17.13",
79
+ "@types/formidable": "^3.4.5",
80
+ "@types/fs-extra": "^9.0.12",
81
+ "@types/js-cookie": "^2.2.7",
82
+ "@types/mime-types": "^2.1.1",
83
+ "@types/mocha": "^10.0.10",
84
+ "@types/node": "^22.14.0",
85
+ "@types/node-fetch": "^2.6.1",
86
+ "@types/pg": "^8.11.10",
87
+ "@types/pg-pool": "^2.0.6",
88
+ "@types/selenium-webdriver": "^4.35.4",
89
+ "@types/uuid": "^8.3.4",
90
+ "@types/validate-npm-package-name": "^3.0.3",
91
+ "@typescript-eslint/eslint-plugin": "^8.29.0",
92
+ "@typescript-eslint/parser": "^8.29.0",
93
+ "eslint": "^9.24.0",
94
+ "husky": "^9.1.7",
95
+ "nyc": "^18.0.0",
96
+ "ts-loader": "^9.5.2",
97
+ "typedoc": "^0.28.1",
98
+ "typedoc-plugin-markdown": "^4.6.1",
99
+ "webpack": "^5.98.0",
100
+ "webpack-cli": "^6.0.1"
101
+ },
102
+ "overrides": {
103
+ "diff": ">=8.0.3",
104
+ "serialize-javascript": ">=7.0.5"
105
+ }
106
106
  }
@@ -589,12 +589,21 @@ export interface IHotRouteMethod
589
589
  onServerAuthorize?: ServerAuthorizationFunction;
590
590
 
591
591
  /**
592
- * Executes when executing a called method from the server side.
593
- * This will stringify any JSON object and send it as a JSON response.
594
- * If undefined is returned no response will be sent to the server.
592
+ * Executes before executing onServerExecute. Anything that returns
593
+ * from this will be passed onto onServerExecute via request.previousJsonObj.
594
+ * Commonly used for authorization guards, so it MUST be carried through
595
+ * HotRouteMethod.create() alongside onServerExecute — omitting it here
596
+ * silently drops any guard supplied via addMethod({ ... }).
597
+ */
598
+ onServerPreExecute?: ServerExecutionFunction;
599
+
600
+ /**
601
+ * Executes when executing a called method from the server side.
602
+ * This will stringify any JSON object and send it as a JSON response.
603
+ * If undefined is returned no response will be sent to the server.
595
604
  * So the developer would have to send a response using "res".
596
- * If any exceptions are thrown from this function, they will be sent
597
- * to the server as an { error: string; } object with the exception
605
+ * If any exceptions are thrown from this function, they will be sent
606
+ * to the server as an { error: string; } object with the exception
598
607
  * message as the error.
599
608
  */
600
609
  onServerExecute?: ServerExecutionFunction;
@@ -766,6 +775,7 @@ export class HotRouteMethod implements IHotRouteMethod
766
775
  this.onPostRegister = null;
767
776
 
768
777
  this.onServerAuthorize = null;
778
+ this.onServerPreExecute = null;
769
779
  this.onServerExecute = null;
770
780
  this.onClientExecute = null;
771
781
  this.onValidateQueryInput = null;
@@ -889,6 +899,9 @@ export class HotRouteMethod implements IHotRouteMethod
889
899
  if (route.onPostRegister != null)
890
900
  newMethod.onPostRegister = route.onPostRegister;
891
901
 
902
+ if (route.onServerPreExecute != null)
903
+ newMethod.onServerPreExecute = route.onServerPreExecute;
904
+
892
905
  if (route.onServerExecute != null)
893
906
  newMethod.onServerExecute = route.onServerExecute;
894
907
 
package/src/HotStaq.ts CHANGED
@@ -238,7 +238,7 @@ export class HotStaq implements IHotStaq
238
238
  /**
239
239
  * The current version of HotStaq.
240
240
  */
241
- static version: string = "0.9.37";
241
+ static version: string = "0.9.39";
242
242
  /**
243
243
  * Indicates if this is a web build.
244
244
  */