@breautek/storm 9.0.7 → 9.1.0
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/CHANGELOG.md +13 -0
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Application.html +45 -45
- package/docs/classes/ConfigLoader.html +3 -3
- package/docs/classes/Database.html +2 -2
- package/docs/classes/DatabaseCastObject.html +2 -2
- package/docs/classes/DatabaseConnection.html +21 -21
- package/docs/classes/DatabaseQueryError.html +8 -8
- package/docs/classes/DeadLockError.html +8 -8
- package/docs/classes/DiskSpaceError.html +7 -7
- package/docs/classes/DropTemporaryTableQuery.html +7 -7
- package/docs/classes/DuplicateEntryError.html +7 -7
- package/docs/classes/EntityNotFoundError.html +7 -7
- package/docs/classes/ExpiredTokenError.html +7 -7
- package/docs/classes/Handler.html +2 -2
- package/docs/classes/IllegalStateError.html +46 -0
- package/docs/classes/InternalError.html +7 -7
- package/docs/classes/InvalidCredentialsError.html +7 -7
- package/docs/classes/InvalidValueError.html +7 -7
- package/docs/classes/LineString.html +2 -2
- package/docs/classes/LockWaitTimeoutError.html +8 -8
- package/docs/classes/ManagedDatabaseConnection.html +5 -5
- package/docs/classes/Middleware.html +2 -2
- package/docs/classes/MissingConfigError.html +7 -7
- package/docs/classes/MissingParameterError.html +7 -7
- package/docs/classes/MySQLConnection.html +25 -25
- package/docs/classes/MySQLDatabase.html +2 -2
- package/docs/classes/NotImplementedError.html +7 -7
- package/docs/classes/Point.html +2 -2
- package/docs/classes/Polygon.html +2 -2
- package/docs/classes/Query.html +7 -7
- package/docs/classes/RawError.html +7 -7
- package/docs/classes/RawQuery.html +7 -7
- package/docs/classes/Request.html +3 -3
- package/docs/classes/Response.html +2 -2
- package/docs/classes/ResponseData.html +3 -3
- package/docs/classes/ServiceProvider.html +2 -2
- package/docs/classes/ServiceResponse.html +2 -2
- package/docs/classes/SetSessionVariableQuery.html +7 -7
- package/docs/classes/StormError.html +7 -7
- package/docs/classes/TemporaryTableQuery.html +7 -7
- package/docs/classes/TimeoutError.html +7 -7
- package/docs/classes/Token.html +2 -2
- package/docs/classes/TokenManager.html +2 -2
- package/docs/classes/Transaction.html +2 -2
- package/docs/classes/UnauthorizedAccessError.html +7 -7
- package/docs/enums/ErrorCode.html +2 -2
- package/docs/enums/ExitCode.html +2 -2
- package/docs/enums/HTTPMethod.html +2 -2
- package/docs/enums/IsolationLevel.html +2 -2
- package/docs/enums/JWTError.html +2 -2
- package/docs/enums/StatusCode.html +2 -2
- package/docs/enums/TransactionAccessLevel.html +2 -2
- package/docs/functions/getInstance.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/IAdditionalErrorDetails.html +1 -1
- package/docs/interfaces/ICloudwatchConfig.html +2 -2
- package/docs/interfaces/ICloudwatchCredentials.html +2 -2
- package/docs/interfaces/ICloudwatchStreamConfig.html +2 -2
- package/docs/interfaces/IConfig.html +2 -2
- package/docs/interfaces/IDatabaseConfig.html +2 -2
- package/docs/interfaces/IDatabaseConnection.html +5 -5
- package/docs/interfaces/IDatabasePosition.html +2 -2
- package/docs/interfaces/IErrorResponse.html +2 -2
- package/docs/interfaces/IFormData.html +2 -2
- package/docs/interfaces/IInsertQueryResult.html +2 -2
- package/docs/interfaces/IJWTVerifyOptions.html +2 -2
- package/docs/interfaces/IOKPacket.html +2 -2
- package/docs/interfaces/IParameterMap.html +1 -1
- package/docs/interfaces/IQueryable.html +2 -2
- package/docs/interfaces/IRequestResponse.html +2 -2
- package/docs/interfaces/ISetSessionVariableQueryInput.html +2 -2
- package/docs/interfaces/IStormCLIArgs.html +2 -2
- package/docs/interfaces/ITemporaryTableQueryInput.html +2 -2
- package/docs/interfaces/IUpdateQueryResult.html +2 -2
- package/docs/interfaces/formidable.FileJSON.html +7 -7
- package/docs/interfaces/formidable.Part.html +17 -17
- package/docs/types/IDeleteQueryResult.html +1 -1
- package/docs/types/IStoredProcedureResult.html +1 -1
- package/docs/types/TCoordinate.html +1 -1
- package/docs/types/TExpiresIn.html +1 -1
- package/docs/types/TSerializableResponse.html +1 -1
- package/docs/types/TSupportedResponsePrimitives.html +1 -1
- package/docs/types/TSupportedResponseTypes.html +1 -1
- package/lib/Application.js +4 -4
- package/lib/Application.js.map +1 -1
- package/lib/IllegalStateError.d.ts +15 -0
- package/lib/IllegalStateError.js +34 -0
- package/lib/IllegalStateError.js.map +1 -0
- package/lib/ManagedDatabaseConnection.js +3 -3
- package/lib/ManagedDatabaseConnection.js.map +1 -1
- package/lib/MySQLDatabase.js +1 -1
- package/lib/MySQLDatabase.js.map +1 -1
- package/lib/api.d.ts +1 -0
- package/lib/api.js +4 -2
- package/lib/api.js.map +1 -1
- package/package.json +7 -7
- package/src/Application.ts +4 -4
- package/src/IllegalStateError.ts +36 -0
- package/src/ManagedDatabaseConnection.ts +3 -3
- package/src/MySQLDatabase.ts +1 -1
- package/src/api.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@breautek/storm",
|
|
3
|
-
"version": "9.0
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "Object-Oriented REST API framework",
|
|
5
5
|
"main": "lib/api.js",
|
|
6
6
|
"types": "lib/api.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@types/formidable": "3.4.5",
|
|
52
52
|
"@types/jsonwebtoken": "9.0.10",
|
|
53
53
|
"@types/mysql": "2.15.27",
|
|
54
|
-
"@types/node": "24.0
|
|
54
|
+
"@types/node": "24.1.0",
|
|
55
55
|
"@types/uuid": "10.0.0",
|
|
56
56
|
"ajv": "8.17.1",
|
|
57
57
|
"body-parser": "2.2.0",
|
|
@@ -73,16 +73,16 @@
|
|
|
73
73
|
"@arashi/interfaces": "1.2.1",
|
|
74
74
|
"@arashi/logger": "4.1.3",
|
|
75
75
|
"@jest/types": "30.0.5",
|
|
76
|
-
"@totalpave/eslint-plugin": "7.0.
|
|
76
|
+
"@totalpave/eslint-plugin": "7.0.15",
|
|
77
77
|
"@types/jest": "30.0.0",
|
|
78
78
|
"@types/ms": "2.1.0",
|
|
79
79
|
"auto-changelog": "2.5.0",
|
|
80
|
-
"jest": "30.0.
|
|
81
|
-
"jest-jasmine2": "30.0.
|
|
80
|
+
"jest": "30.0.5",
|
|
81
|
+
"jest-jasmine2": "30.0.5",
|
|
82
82
|
"ts-jest": "29.4.0",
|
|
83
83
|
"ts-node": "10.9.2",
|
|
84
|
-
"typedoc": "0.28.
|
|
85
|
-
"typedoc-plugin-markdown": "4.
|
|
84
|
+
"typedoc": "0.28.8",
|
|
85
|
+
"typedoc-plugin-markdown": "4.8.0",
|
|
86
86
|
"typescript": "5.8.3"
|
|
87
87
|
}
|
|
88
88
|
}
|
package/src/Application.ts
CHANGED
|
@@ -359,19 +359,19 @@ export abstract class Application
|
|
|
359
359
|
public attachHandlerInstance(path: string, handler: Handler): void {
|
|
360
360
|
this.$server.get(path, (request: Express.Request, response: Express.Response) => {
|
|
361
361
|
let r: Request = new Request(request);
|
|
362
|
-
handler.get(r, new Response(this, response, r.getURL()));
|
|
362
|
+
void handler.get(r, new Response(this, response, r.getURL()));
|
|
363
363
|
});
|
|
364
364
|
this.$server.post(path, (request: Express.Request, response: Express.Response) => {
|
|
365
365
|
let r: Request = new Request(request);
|
|
366
|
-
handler.post(r, new Response(this, response, r.getURL()));
|
|
366
|
+
void handler.post(r, new Response(this, response, r.getURL()));
|
|
367
367
|
});
|
|
368
368
|
this.$server.put(path, (request: Express.Request, response: Express.Response) => {
|
|
369
369
|
let r: Request = new Request(request);
|
|
370
|
-
handler.put(r, new Response(this, response, r.getURL()));
|
|
370
|
+
void handler.put(r, new Response(this, response, r.getURL()));
|
|
371
371
|
});
|
|
372
372
|
this.$server.delete(path, (request: Express.Request, response: Express.Response) => {
|
|
373
373
|
let r: Request = new Request(request);
|
|
374
|
-
handler.delete(r, new Response(this, response, r.getURL()));
|
|
374
|
+
void handler.delete(r, new Response(this, response, r.getURL()));
|
|
375
375
|
});
|
|
376
376
|
}
|
|
377
377
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
import { StatusCode } from './StatusCode';
|
|
3
|
+
import { StormError } from './StormError';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @since 9.1.0
|
|
7
|
+
*
|
|
8
|
+
* An error that describes an illegal state
|
|
9
|
+
*/
|
|
10
|
+
export class IllegalStateError extends StormError<string> {
|
|
11
|
+
public constructor(message: string) {
|
|
12
|
+
super(message);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public override getMessage(): string {
|
|
16
|
+
return this.getPrivateDetails();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public override getHTTPCode(): StatusCode {
|
|
20
|
+
return StatusCode.ERR_BAD_REQUEST;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public override getCode(): number {
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public override getLocaleCode(): string {
|
|
28
|
+
return '@breautek/storm/IllegalStateError/message';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public override getLocaleParameters(): Record<string, string> {
|
|
32
|
+
return {
|
|
33
|
+
message: this.getMessage()
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -76,14 +76,14 @@ export class ManagedDatabaseConnection implements IDatabaseConnection {
|
|
|
76
76
|
getInstance().getLogger().warn(TAG, 'Rolling back a transaction because setConnection was called on a ManagedDatabaseConnection in a transaction in progress.');
|
|
77
77
|
getInstance().getLogger().trace(TAG, new Error('Stacktrace'));
|
|
78
78
|
oldConnection.rollback().then(() => {
|
|
79
|
-
oldConnection.close();
|
|
79
|
+
return oldConnection.close();
|
|
80
80
|
}).catch((error: any) => {
|
|
81
81
|
getInstance().getLogger().error(TAG, error);
|
|
82
|
-
oldConnection.close(true);
|
|
82
|
+
void oldConnection.close(true);
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
else {
|
|
86
|
-
oldConnection.close();
|
|
86
|
+
void oldConnection.close();
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
package/src/MySQLDatabase.ts
CHANGED
package/src/api.ts
CHANGED
|
@@ -68,6 +68,7 @@ export {DatabaseQueryError} from './DatabaseQueryError';
|
|
|
68
68
|
export {NotImplementedError} from './NotImplementedError';
|
|
69
69
|
export {DeadLockError} from './DeadLockError';
|
|
70
70
|
export {LockWaitTimeoutError} from './LockWaitTimeoutError';
|
|
71
|
+
export {IllegalStateError} from './IllegalStateError';
|
|
71
72
|
|
|
72
73
|
// HTTP
|
|
73
74
|
export {StatusCode} from './StatusCode';
|