@breautek/storm 4.1.0 → 4.3.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 +14 -1
- package/docs/README.md +6 -4
- package/docs/classes/Application.md +26 -26
- package/docs/classes/BackendAuthenticationMiddleware.md +2 -2
- package/docs/classes/CORSMiddleware.md +6 -6
- package/docs/classes/ConfigLoader.md +1 -1
- package/docs/classes/Database.md +12 -12
- package/docs/classes/DatabaseConnection.md +19 -19
- package/docs/classes/DatabaseQueryError.md +46 -8
- package/docs/classes/DiskSpaceError.md +46 -8
- package/docs/classes/DropTemporaryTableQuery.md +14 -8
- package/docs/classes/DumpStream.md +1 -1
- package/docs/classes/DuplicateEntryError.md +46 -8
- package/docs/classes/EntityNotFoundError.md +46 -8
- package/docs/classes/ExpiredTokenError.md +46 -8
- package/docs/classes/Handler.md +22 -22
- package/docs/classes/InternalError.md +46 -8
- package/docs/classes/InvalidCredentialsError.md +46 -8
- package/docs/classes/InvalidValueError.md +46 -8
- package/docs/classes/ManagedDatabaseConnection.md +19 -19
- package/docs/classes/Middleware.md +3 -3
- package/docs/classes/MissingConfigError.md +46 -8
- package/docs/classes/MissingParameterError.md +46 -8
- package/docs/classes/MySQLConnection.md +20 -20
- package/docs/classes/MySQLDatabase.md +13 -13
- package/docs/classes/NotImplementedError.md +339 -0
- package/docs/classes/Query.md +14 -8
- package/docs/classes/RawError.md +351 -0
- package/docs/classes/RawQuery.md +14 -8
- package/docs/classes/Request.md +18 -18
- package/docs/classes/Response.md +11 -11
- package/docs/classes/ResponseData.md +7 -7
- package/docs/classes/ServiceProvider.md +15 -15
- package/docs/classes/ServiceResponse.md +4 -4
- package/docs/classes/SetSessionVariableQuery.md +14 -8
- package/docs/classes/StormError.md +42 -8
- package/docs/classes/TemporaryTableQuery.md +14 -8
- package/docs/classes/Token.md +2 -2
- package/docs/classes/TokenManager.md +4 -4
- package/docs/classes/UnauthorizedAccessError.md +46 -8
- package/docs/enums/ErrorCode.md +9 -9
- package/docs/enums/ExitCode.md +2 -2
- package/docs/enums/HTTPMethod.md +4 -4
- package/docs/enums/JWTError.md +2 -2
- package/docs/enums/StatusCode.md +48 -48
- package/docs/interfaces/IConfig.md +8 -8
- package/docs/interfaces/IDatabaseConfig.md +6 -6
- package/docs/interfaces/IDatabaseConnection.md +14 -14
- package/docs/interfaces/IErrorResponse.md +15 -4
- package/docs/interfaces/IFormData.md +2 -2
- package/docs/interfaces/IHandler.md +1 -1
- package/docs/interfaces/IInsertQueryResult.md +3 -3
- package/docs/interfaces/IJWTVerifyOptions.md +1 -1
- package/docs/interfaces/IRequestResponse.md +2 -2
- package/docs/interfaces/ISetSessionVariableQueryInput.md +2 -2
- package/docs/interfaces/ITemporaryTableQueryInput.md +2 -2
- package/docs/interfaces/IUpdateQueryResult.md +2 -2
- package/lib/Application.d.ts +58 -0
- package/lib/Application.js +73 -0
- package/lib/Application.js.map +1 -1
- package/lib/ApplicationEvent.js +15 -0
- package/lib/ApplicationEvent.js.map +1 -1
- package/lib/BackendAuthenticationMiddleware.d.ts +12 -0
- package/lib/BackendAuthenticationMiddleware.js +28 -0
- package/lib/BackendAuthenticationMiddleware.js.map +1 -1
- package/lib/CORSMiddleware.d.ts +14 -0
- package/lib/CORSMiddleware.js +29 -0
- package/lib/CORSMiddleware.js.map +1 -1
- package/lib/ConfigLoader.js +16 -0
- package/lib/ConfigLoader.js.map +1 -1
- package/lib/Database.js +15 -0
- package/lib/Database.js.map +1 -1
- package/lib/DatabaseConnection.d.ts +115 -0
- package/lib/DatabaseConnection.js +71 -0
- package/lib/DatabaseConnection.js.map +1 -1
- package/lib/DatabaseQueryError.d.ts +1 -0
- package/lib/DatabaseQueryError.js +19 -0
- package/lib/DatabaseQueryError.js.map +1 -1
- package/lib/DiskSpaceError.d.ts +1 -0
- package/lib/DiskSpaceError.js +18 -0
- package/lib/DiskSpaceError.js.map +1 -1
- package/lib/DropTemporaryTableQuery.js +15 -0
- package/lib/DropTemporaryTableQuery.js.map +1 -1
- package/lib/DumpStream.js +16 -0
- package/lib/DumpStream.js.map +1 -1
- package/lib/DuplicateEntryError.d.ts +2 -0
- package/lib/DuplicateEntryError.js +26 -0
- package/lib/DuplicateEntryError.js.map +1 -1
- package/lib/EntityNotFoundError.d.ts +2 -0
- package/lib/EntityNotFoundError.js +23 -0
- package/lib/EntityNotFoundError.js.map +1 -1
- package/lib/ErrorCode.js +15 -0
- package/lib/ErrorCode.js.map +1 -1
- package/lib/ExitCode.js +15 -0
- package/lib/ExitCode.js.map +1 -1
- package/lib/ExpiredTokenError.d.ts +1 -0
- package/lib/ExpiredTokenError.js +19 -0
- package/lib/ExpiredTokenError.js.map +1 -1
- package/lib/HTTPMethod.js +15 -0
- package/lib/HTTPMethod.js.map +1 -1
- package/lib/Handler.d.ts +22 -4
- package/lib/Handler.js +22 -6
- package/lib/Handler.js.map +1 -1
- package/lib/IAuthTokenData.js +15 -0
- package/lib/IAuthTokenData.js.map +1 -1
- package/lib/IConfig.js +15 -0
- package/lib/IConfig.js.map +1 -1
- package/lib/IDatabaseConfig.js +15 -0
- package/lib/IDatabaseConfig.js.map +1 -1
- package/lib/IDatabaseConnection.js +15 -0
- package/lib/IDatabaseConnection.js.map +1 -1
- package/lib/IDeleteQueryResult.js +15 -0
- package/lib/IDeleteQueryResult.js.map +1 -1
- package/lib/IFormData.js +15 -0
- package/lib/IFormData.js.map +1 -1
- package/lib/IHandler.js +15 -0
- package/lib/IHandler.js.map +1 -1
- package/lib/IInsertQueryResult.js +15 -0
- package/lib/IInsertQueryResult.js.map +1 -1
- package/lib/IJWTVerifyOptions.js +15 -0
- package/lib/IJWTVerifyOptions.js.map +1 -1
- package/lib/IRequestResponse.js +15 -0
- package/lib/IRequestResponse.js.map +1 -1
- package/lib/IServiceHeaders.js +15 -0
- package/lib/IServiceHeaders.js.map +1 -1
- package/lib/IUpdateQueryResult.js +15 -0
- package/lib/IUpdateQueryResult.js.map +1 -1
- package/lib/InternalError.d.ts +1 -0
- package/lib/InternalError.js +19 -0
- package/lib/InternalError.js.map +1 -1
- package/lib/InvalidConfigError.js +15 -0
- package/lib/InvalidConfigError.js.map +1 -1
- package/lib/InvalidCredentialsError.d.ts +1 -0
- package/lib/InvalidCredentialsError.js +19 -0
- package/lib/InvalidCredentialsError.js.map +1 -1
- package/lib/InvalidValueError.d.ts +2 -0
- package/lib/InvalidValueError.js +27 -0
- package/lib/InvalidValueError.js.map +1 -1
- package/lib/JWTError.js +15 -0
- package/lib/JWTError.js.map +1 -1
- package/lib/JWTVerifyOptionsParser.js +16 -0
- package/lib/JWTVerifyOptionsParser.js.map +1 -1
- package/lib/ManagedDatabaseConnection.d.ts +5 -0
- package/lib/ManagedDatabaseConnection.js +26 -0
- package/lib/ManagedDatabaseConnection.js.map +1 -1
- package/lib/Middleware.js +16 -0
- package/lib/Middleware.js.map +1 -1
- package/lib/MissingConfigError.d.ts +2 -0
- package/lib/MissingConfigError.js +23 -0
- package/lib/MissingConfigError.js.map +1 -1
- package/lib/MissingParameterError.d.ts +2 -0
- package/lib/MissingParameterError.js +23 -0
- package/lib/MissingParameterError.js.map +1 -1
- package/lib/MySQLConnection.js +24 -1
- package/lib/MySQLConnection.js.map +1 -1
- package/lib/MySQLDatabase.js +18 -0
- package/lib/MySQLDatabase.js.map +1 -1
- package/lib/NotImplementedError.d.ts +16 -0
- package/lib/NotImplementedError.js +48 -0
- package/lib/NotImplementedError.js.map +1 -0
- package/lib/Query.d.ts +21 -0
- package/lib/Query.js +37 -0
- package/lib/Query.js.map +1 -1
- package/lib/RawError.d.ts +14 -0
- package/lib/RawError.js +40 -0
- package/lib/RawError.js.map +1 -0
- package/lib/RawQuery.js +15 -0
- package/lib/RawQuery.js.map +1 -1
- package/lib/Request.js +15 -0
- package/lib/Request.js.map +1 -1
- package/lib/Response.js +17 -0
- package/lib/Response.js.map +1 -1
- package/lib/ResponseData.js +15 -0
- package/lib/ResponseData.js.map +1 -1
- package/lib/ServiceProvider.js +20 -0
- package/lib/ServiceProvider.js.map +1 -1
- package/lib/ServiceResponse.js +15 -0
- package/lib/ServiceResponse.js.map +1 -1
- package/lib/SetSessionVariableQuery.js +1 -0
- package/lib/SetSessionVariableQuery.js.map +1 -1
- package/lib/StatusCode.js +15 -0
- package/lib/StatusCode.js.map +1 -1
- package/lib/StormError.d.ts +14 -0
- package/lib/StormError.js +32 -0
- package/lib/StormError.js.map +1 -1
- package/lib/TemporaryTableQuery.js +15 -0
- package/lib/TemporaryTableQuery.js.map +1 -1
- package/lib/Token.js +15 -0
- package/lib/Token.js.map +1 -1
- package/lib/TokenManager.js +17 -0
- package/lib/TokenManager.js.map +1 -1
- package/lib/UnauthorizedAccessError.d.ts +1 -0
- package/lib/UnauthorizedAccessError.js +18 -0
- package/lib/UnauthorizedAccessError.js.map +1 -1
- package/lib/api.d.ts +2 -0
- package/lib/api.js +28 -1
- package/lib/api.js.map +1 -1
- package/lib/instance.js +15 -0
- package/lib/instance.js.map +1 -1
- package/lib/private/CommitQuery.js +15 -0
- package/lib/private/CommitQuery.js.map +1 -1
- package/lib/private/RollbackQuery.js +15 -0
- package/lib/private/RollbackQuery.js.map +1 -1
- package/lib/private/StartTransactionQuery.js +15 -0
- package/lib/private/StartTransactionQuery.js.map +1 -1
- package/package.json +1 -1
- package/src/DatabaseQueryError.ts +4 -0
- package/src/DiskSpaceError.ts +4 -0
- package/src/DuplicateEntryError.ts +13 -0
- package/src/EntityNotFoundError.ts +10 -0
- package/src/ExpiredTokenError.ts +4 -0
- package/src/Handler.ts +10 -9
- package/src/InternalError.ts +4 -0
- package/src/InvalidCredentialsError.ts +4 -0
- package/src/InvalidValueError.ts +13 -0
- package/src/MissingConfigError.ts +10 -0
- package/src/MissingParameterError.ts +10 -0
- package/src/NotImplementedError.ts +55 -0
- package/src/Query.ts +8 -0
- package/src/RawError.ts +39 -0
- package/src/StormError.ts +18 -0
- package/src/UnauthorizedAccessError.ts +4 -0
- package/src/api.ts +2 -0
- package/tsconfig.json +0 -1
package/lib/InternalError.js
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2017-2021 Norman Breau
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*/
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.InternalError = void 0;
|
|
4
19
|
const StormError_1 = require("./StormError");
|
|
5
20
|
const ErrorCode_1 = require("./ErrorCode");
|
|
6
21
|
const StatusCode_1 = require("./StatusCode");
|
|
7
22
|
class InternalError extends StormError_1.StormError {
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
8
24
|
constructor(details) {
|
|
9
25
|
super(details);
|
|
10
26
|
}
|
|
@@ -17,6 +33,9 @@ class InternalError extends StormError_1.StormError {
|
|
|
17
33
|
getHTTPCode() {
|
|
18
34
|
return StatusCode_1.StatusCode.INTERNAL_ERROR;
|
|
19
35
|
}
|
|
36
|
+
getLocaleCode() {
|
|
37
|
+
return '@breautek/storm/InternalError/message';
|
|
38
|
+
}
|
|
20
39
|
}
|
|
21
40
|
exports.InternalError = InternalError;
|
|
22
41
|
//# sourceMappingURL=InternalError.js.map
|
package/lib/InternalError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalError.js","sourceRoot":"","sources":["../src/InternalError.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"InternalError.js","sourceRoot":"","sources":["../src/InternalError.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,6CAAwC;AACxC,2CAAsC;AACtC,6CAAwC;AAExC,MAAa,aAAc,SAAQ,uBAAe;IAC9C,6EAA6E;IAC7E,YAAmB,OAAa;QAC5B,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;IAEM,UAAU;QACb,OAAO,yDAAyD,CAAC;IACrE,CAAC;IAEM,OAAO;QACV,OAAO,qBAAS,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAEM,WAAW;QACd,OAAO,uBAAU,CAAC,cAAc,CAAC;IACrC,CAAC;IAEe,aAAa;QACzB,OAAO,uCAAuC,CAAC;IACnD,CAAC;CACJ;AArBD,sCAqBC"}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2017-2021 Norman Breau
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*/
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.InvalidConfigError = void 0;
|
|
4
19
|
const StormError_1 = require("./StormError");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvalidConfigError.js","sourceRoot":"","sources":["../src/InvalidConfigError.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"InvalidConfigError.js","sourceRoot":"","sources":["../src/InvalidConfigError.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,6CAAwC;AAExC,6CAAwC;AAGxC,yCAAsC;AAOtC,MAAa,kBAA4C,SAAQ,uBAA+C;IAC5G,YAAmB,MAAe,EAAE,MAA0B;QAC1D,KAAK,CAAC;YACF,MAAM;YACN,MAAM;SACT,CAAC,CAAC;IACP,CAAC;IAEM,UAAU;QACb,OAAO,4BAA4B;YAC3B,IAAI,CAAC,iBAAiB,EAAE,CAAC,MAAM,CAAC;IAC5C,CAAC;IAEM,OAAO;QACV,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,WAAW;QACd,OAAO,uBAAU,CAAC,cAAc,CAAC;IACrC,CAAC;IAEM,WAAW;QACd,OAAO,mBAAQ,CAAC,cAAc,CAAC;IACnC,CAAC;CACJ;AAxBD,gDAwBC"}
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2017-2021 Norman Breau
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*/
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.InvalidCredentialsError = void 0;
|
|
4
19
|
const StormError_1 = require("./StormError");
|
|
5
20
|
const ErrorCode_1 = require("./ErrorCode");
|
|
6
21
|
const StatusCode_1 = require("./StatusCode");
|
|
7
22
|
class InvalidCredentialsError extends StormError_1.StormError {
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
8
24
|
constructor(details) {
|
|
9
25
|
super(details);
|
|
10
26
|
}
|
|
@@ -17,6 +33,9 @@ class InvalidCredentialsError extends StormError_1.StormError {
|
|
|
17
33
|
getHTTPCode() {
|
|
18
34
|
return StatusCode_1.StatusCode.ERR_UNAUTHORIZED;
|
|
19
35
|
}
|
|
36
|
+
getLocaleCode() {
|
|
37
|
+
return '@breautek/storm/InvalidCredentialsError/message';
|
|
38
|
+
}
|
|
20
39
|
}
|
|
21
40
|
exports.InvalidCredentialsError = InvalidCredentialsError;
|
|
22
41
|
//# sourceMappingURL=InvalidCredentialsError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvalidCredentialsError.js","sourceRoot":"","sources":["../src/InvalidCredentialsError.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"InvalidCredentialsError.js","sourceRoot":"","sources":["../src/InvalidCredentialsError.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,6CAAwC;AACxC,2CAAsC;AACtC,6CAAwC;AAExC,MAAa,uBAAwB,SAAQ,uBAAe;IACxD,6EAA6E;IAC7E,YAAmB,OAAa;QAC5B,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;IAEM,UAAU;QACb,OAAO,6EAA6E,CAAC;IACzF,CAAC;IAEM,OAAO;QACV,OAAO,qBAAS,CAAC,mBAAmB,CAAC;IACzC,CAAC;IAEM,WAAW;QACd,OAAO,uBAAU,CAAC,gBAAgB,CAAC;IACvC,CAAC;IAEe,aAAa;QACzB,OAAO,iDAAiD,CAAC;IAC7D,CAAC;CACJ;AArBD,0DAqBC"}
|
package/lib/InvalidValueError.js
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2017-2021 Norman Breau
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*/
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.InvalidValueError = void 0;
|
|
4
19
|
const StormError_1 = require("./StormError");
|
|
5
20
|
const ErrorCode_1 = require("./ErrorCode");
|
|
6
21
|
const StatusCode_1 = require("./StatusCode");
|
|
7
22
|
class InvalidValueError extends StormError_1.StormError {
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
8
24
|
constructor(variable, expected, got) {
|
|
9
25
|
super({
|
|
10
26
|
variable: variable,
|
|
@@ -22,6 +38,17 @@ class InvalidValueError extends StormError_1.StormError {
|
|
|
22
38
|
getHTTPCode() {
|
|
23
39
|
return StatusCode_1.StatusCode.ERR_BAD_REQUEST;
|
|
24
40
|
}
|
|
41
|
+
getLocaleCode() {
|
|
42
|
+
return '@breautek/storm/InvalidValueError/message';
|
|
43
|
+
}
|
|
44
|
+
getLocaleParameters() {
|
|
45
|
+
let details = this.getPrivateDetails();
|
|
46
|
+
return {
|
|
47
|
+
variable: details.variable,
|
|
48
|
+
expected: details.expected,
|
|
49
|
+
got: details.got
|
|
50
|
+
};
|
|
51
|
+
}
|
|
25
52
|
}
|
|
26
53
|
exports.InvalidValueError = InvalidValueError;
|
|
27
54
|
//# sourceMappingURL=InvalidValueError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvalidValueError.js","sourceRoot":"","sources":["../src/InvalidValueError.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"InvalidValueError.js","sourceRoot":"","sources":["../src/InvalidValueError.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,6CAAwC;AACxC,2CAAsC;AACtC,6CAAwC;AAExC,MAAa,iBAAkB,SAAQ,uBAIrC;IACE,6EAA6E;IAC7E,YAAmB,QAAgB,EAAE,QAAa,EAAE,GAAQ;QACxD,KAAK,CAAC;YACF,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,QAAQ;YAClB,GAAG,EAAE,GAAG;SACX,CAAC,CAAC;IACP,CAAC;IAEM,UAAU;QACb,IAAI,OAAO,GAAQ,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC5C,OAAO,yBAAyB,OAAO,CAAC,QAAQ,eAAe,OAAO,CAAC,QAAQ,aAAa,OAAO,CAAC,GAAG,IAAI,CAAC;IAChH,CAAC;IAEM,OAAO;QACV,OAAO,qBAAS,CAAC,aAAa,CAAC;IACnC,CAAC;IAEM,WAAW;QACd,OAAO,uBAAU,CAAC,eAAe,CAAC;IACtC,CAAC;IAEe,aAAa;QACzB,OAAO,2CAA2C,CAAC;IACvD,CAAC;IAEe,mBAAmB;QAC/B,IAAI,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvC,OAAO;YACH,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,GAAG,EAAE,OAAO,CAAC,GAAG;SACnB,CAAC;IACN,CAAC;CACJ;AAvCD,8CAuCC"}
|
package/lib/JWTError.js
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2017-2021 Norman Breau
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*/
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.JWTError = void 0;
|
|
4
19
|
var JWTError;
|
package/lib/JWTError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JWTError.js","sourceRoot":"","sources":["../src/JWTError.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"JWTError.js","sourceRoot":"","sources":["../src/JWTError.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,IAAY,QAGX;AAHD,WAAY,QAAQ;IAChB,6CAAiC,CAAA;IACjC,6CAAiC,CAAA;AACrC,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB"}
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2017-2021 Norman Breau
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*/
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.JWTVerifyOptionsParser = void 0;
|
|
4
19
|
class JWTVerifyOptionsParser {
|
|
5
20
|
constructor() {
|
|
6
21
|
throw new Error('JWTVerifyOptionsParser is an static class.');
|
|
7
22
|
}
|
|
23
|
+
// Parses IJWTVerifyOptions to jwt options
|
|
8
24
|
static parse(options) {
|
|
9
25
|
let opts = {};
|
|
10
26
|
if (options.enableExpiration !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JWTVerifyOptionsParser.js","sourceRoot":"","sources":["../src/JWTVerifyOptionsParser.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"JWTVerifyOptionsParser.js","sourceRoot":"","sources":["../src/JWTVerifyOptionsParser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAIF,MAAa,sBAAsB;IAC/B;QACI,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAClE,CAAC;IAED,0CAA0C;IACnC,MAAM,CAAC,KAAK,CAAC,OAA0B;QAC1C,IAAI,IAAI,GAAQ,EAAE,CAAC;QAEnB,IAAI,OAAO,CAAC,gBAAgB,KAAK,SAAS,EAAE;YACxC,IAAI,CAAC,gBAAgB,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC;SACrD;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAfD,wDAeC"}
|
|
@@ -4,6 +4,11 @@ import { Readable } from 'stream';
|
|
|
4
4
|
import { Query } from './Query';
|
|
5
5
|
export declare class ManagedDatabaseConnection implements IDatabaseConnection {
|
|
6
6
|
private $connection;
|
|
7
|
+
/**
|
|
8
|
+
* When true, this class will not close the connection or
|
|
9
|
+
* allow transaction starts or ends. Methods for these actions
|
|
10
|
+
* will be a no-op.
|
|
11
|
+
*/
|
|
7
12
|
private $managed;
|
|
8
13
|
private $requiresWrite;
|
|
9
14
|
private $instantionStack;
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2017-2021 Norman Breau
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*/
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.ManagedDatabaseConnection = void 0;
|
|
4
19
|
const instance_1 = require("./instance");
|
|
@@ -9,9 +24,17 @@ class ManagedDatabaseConnection {
|
|
|
9
24
|
this.$requiresWrite = requiresWrite;
|
|
10
25
|
this.$instantionStack = new Error().stack;
|
|
11
26
|
}
|
|
27
|
+
// TODO(Breaking): Turn this API into async
|
|
12
28
|
setConnection(connection) {
|
|
13
29
|
if (this.$connection) {
|
|
30
|
+
// Store original connection because of async,
|
|
31
|
+
// but we don't really need to wait for the async operations
|
|
32
|
+
// to complete to set the new connection object.
|
|
14
33
|
let oldConnection = this.$connection;
|
|
34
|
+
/**
|
|
35
|
+
* If the old connection has a transaction, only care about it
|
|
36
|
+
* if this particular instance of managed connections has write access.
|
|
37
|
+
*/
|
|
15
38
|
if (this.$requiresWrite && oldConnection.isTransaction()) {
|
|
16
39
|
(0, instance_1.getInstance)().getLogger().warn(TAG, 'Rolling back a transaction because setConnection was called on a ManagedDatabaseConnection in a transaction in progress.');
|
|
17
40
|
(0, instance_1.getInstance)().getLogger().trace(TAG, new Error('Stacktrace'));
|
|
@@ -70,6 +93,7 @@ class ManagedDatabaseConnection {
|
|
|
70
93
|
return true;
|
|
71
94
|
}
|
|
72
95
|
}
|
|
96
|
+
// TODO: Turn this into a promise -- but the public interface also needs to change
|
|
73
97
|
setTimeout(timeout) {
|
|
74
98
|
this.$getConnection().then((connection) => {
|
|
75
99
|
connection.setTimeout(timeout);
|
|
@@ -83,6 +107,7 @@ class ManagedDatabaseConnection {
|
|
|
83
107
|
return null;
|
|
84
108
|
}
|
|
85
109
|
}
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
86
111
|
query(query, params) {
|
|
87
112
|
return new Promise((resolve, reject) => {
|
|
88
113
|
this.$getConnection().then((connection) => {
|
|
@@ -90,6 +115,7 @@ class ManagedDatabaseConnection {
|
|
|
90
115
|
}).catch(reject);
|
|
91
116
|
});
|
|
92
117
|
}
|
|
118
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
93
119
|
stream(query, params, streamOptions) {
|
|
94
120
|
throw new Error('stream is not supported on Managed Connections');
|
|
95
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedDatabaseConnection.js","sourceRoot":"","sources":["../src/ManagedDatabaseConnection.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ManagedDatabaseConnection.js","sourceRoot":"","sources":["../src/ManagedDatabaseConnection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAGF,yCAAuC;AAIvC,MAAM,GAAG,GAAW,2BAA2B,CAAC;AAEhD,MAAa,yBAAyB;IAalC,YAAmB,gBAAyB,KAAK;QAC7C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,gBAAgB,GAAG,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC;IAC9C,CAAC;IAED,2CAA2C;IACpC,aAAa,CAAC,UAA+B;QAChD,IAAI,IAAI,CAAC,WAAW,EAAE;YAClB,8CAA8C;YAC9C,4DAA4D;YAC5D,gDAAgD;Y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AC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;aAC/C;YAED,OAAO,CAAC,IAAI,CAAC,CAAC,UAA+B,EAAE,EAAE;gBAC7C,IAAI,0BAA0B,EAAE;oBAC5B,UAAU,CAAC,qBAAqB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;iBAC3D;gBACD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;gBAC9B,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC9B,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,MAAM;QACT,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;YACtB,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;SACpC;aACI;YACD,OAAO,IAAI,CAAC;SACf;IACL,CAAC;CACJ;AA7ND,8DA6NC"}
|
package/lib/Middleware.js
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2017-2021 Norman Breau
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*/
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.Middleware = void 0;
|
|
4
19
|
class Middleware {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
5
21
|
constructor() { }
|
|
6
22
|
execute(request, response) {
|
|
7
23
|
return this._execute(request, response);
|
package/lib/Middleware.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Middleware.js","sourceRoot":"","sources":["../src/Middleware.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Middleware.js","sourceRoot":"","sources":["../src/Middleware.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAMF,MAAsB,UAAU;IAC5B,gEAAgE;IAChE,gBAAsB,CAAC;IAIhB,OAAO,CAAC,OAAgB,EAAE,QAAkB;QAC/C,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC5C,CAAC;CACJ;AATD,gCASC"}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2017-2021 Norman Breau
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*/
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.MissingConfigError = void 0;
|
|
4
19
|
const StormError_1 = require("./StormError");
|
|
@@ -22,6 +37,14 @@ class MissingConfigError extends StormError_1.StormError {
|
|
|
22
37
|
getExitCode() {
|
|
23
38
|
return ExitCode_1.ExitCode.MISSING_CONFIG;
|
|
24
39
|
}
|
|
40
|
+
getLocaleCode() {
|
|
41
|
+
return '@breautek/storm/MissingConfigError/message';
|
|
42
|
+
}
|
|
43
|
+
getLocaleParameters() {
|
|
44
|
+
return {
|
|
45
|
+
path: this.getPrivateDetails().path
|
|
46
|
+
};
|
|
47
|
+
}
|
|
25
48
|
}
|
|
26
49
|
exports.MissingConfigError = MissingConfigError;
|
|
27
50
|
//# sourceMappingURL=MissingConfigError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MissingConfigError.js","sourceRoot":"","sources":["../src/MissingConfigError.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"MissingConfigError.js","sourceRoot":"","sources":["../src/MissingConfigError.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,6CAAwC;AAExC,6CAAwC;AACxC,yCAAsC;AAMtC,MAAa,kBAAmB,SAAQ,uBAAsC;IAC1E,YAAmB,IAAY;QAC3B,KAAK,CAAC;YACF,IAAI;SACP,CAAC,CAAC;IACP,CAAC;IAEM,UAAU;QACb,OAAO,+BAA+B,IAAI,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,CAAC;IAC1E,CAAC;IAEM,OAAO;QACV,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,WAAW;QACd,OAAO,uBAAU,CAAC,cAAc,CAAC;IACrC,CAAC;IAEM,WAAW;QACd,OAAO,mBAAQ,CAAC,cAAc,CAAC;IACnC,CAAC;IAEe,aAAa;QACzB,OAAO,4CAA4C,CAAC;IACxD,CAAC;IAEe,mBAAmB;QAC/B,OAAO;YACH,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,IAAI;SACtC,CAAC;IACN,CAAC;CACJ;AAhCD,gDAgCC"}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2017-2021 Norman Breau
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*/
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.MissingParameterError = void 0;
|
|
4
19
|
const StormError_1 = require("./StormError");
|
|
@@ -17,6 +32,14 @@ class MissingParameterError extends StormError_1.StormError {
|
|
|
17
32
|
getHTTPCode() {
|
|
18
33
|
return StatusCode_1.StatusCode.ERR_BAD_REQUEST;
|
|
19
34
|
}
|
|
35
|
+
getLocaleCode() {
|
|
36
|
+
return '@breautek/storm/MissingParameterError/message';
|
|
37
|
+
}
|
|
38
|
+
getLocaleParameters() {
|
|
39
|
+
return {
|
|
40
|
+
parameter: this.getPrivateDetails().parameter
|
|
41
|
+
};
|
|
42
|
+
}
|
|
20
43
|
}
|
|
21
44
|
exports.MissingParameterError = MissingParameterError;
|
|
22
45
|
//# sourceMappingURL=MissingParameterError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MissingParameterError.js","sourceRoot":"","sources":["../src/MissingParameterError.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"MissingParameterError.js","sourceRoot":"","sources":["../src/MissingParameterError.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,6CAAwC;AACxC,2CAAsC;AACtC,6CAAwC;AAExC,MAAa,qBAAsB,SAAQ,uBAAU;IACjD,YAAmB,SAAiB;QAChC,KAAK,CAAC,EAAC,SAAS,EAAE,SAAS,EAAC,CAAC,CAAC;IAClC,CAAC;IAEM,UAAU;QACb,OAAO,sBAAsB,IAAI,CAAC,iBAAiB,EAAE,CAAC,SAAS,IAAI,CAAC;IACxE,CAAC;IAEM,OAAO;QACV,OAAO,qBAAS,CAAC,iBAAiB,CAAC;IACvC,CAAC;IAEM,WAAW;QACd,OAAO,uBAAU,CAAC,eAAe,CAAC;IACtC,CAAC;IAEe,aAAa;QACzB,OAAO,+CAA+C,CAAC;IAC3D,CAAC;IAEe,mBAAmB;QAC/B,OAAO;YACH,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,SAAS;SAChD,CAAC;IACN,CAAC;CACJ;AA1BD,sDA0BC"}
|
package/lib/MySQLConnection.js
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2017-2021 Norman Breau
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*/
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.MySQLConnection = void 0;
|
|
4
19
|
const DatabaseConnection_1 = require("./DatabaseConnection");
|
|
@@ -9,7 +24,7 @@ const CommitQuery_1 = require("./private/CommitQuery");
|
|
|
9
24
|
const RollbackQuery_1 = require("./private/RollbackQuery");
|
|
10
25
|
const SQLFormatter = require("sql-formatter");
|
|
11
26
|
const logger_1 = require("@arashi/logger");
|
|
12
|
-
const DEFAULT_HIGH_WATERMARK = 512;
|
|
27
|
+
const DEFAULT_HIGH_WATERMARK = 512; // in number of result objects
|
|
13
28
|
const TAG = 'MySQLConnection';
|
|
14
29
|
const SQL_FORMATTING_OPTIONS = {
|
|
15
30
|
language: 'mysql',
|
|
@@ -28,6 +43,7 @@ class MySQLConnection extends DatabaseConnection_1.DatabaseConnection {
|
|
|
28
43
|
if (!values)
|
|
29
44
|
return query;
|
|
30
45
|
return query.replace(/:(\w+)/g, function (txt, key) {
|
|
46
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
31
47
|
if (values.hasOwnProperty(key)) {
|
|
32
48
|
return this.escape(values[key]);
|
|
33
49
|
}
|
|
@@ -41,6 +57,7 @@ class MySQLConnection extends DatabaseConnection_1.DatabaseConnection {
|
|
|
41
57
|
isOpen() {
|
|
42
58
|
return this.$opened;
|
|
43
59
|
}
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
44
61
|
_query(query, params) {
|
|
45
62
|
let logger = (0, instance_1.getInstance)().getLogger();
|
|
46
63
|
return new Promise((resolve, reject) => {
|
|
@@ -50,8 +67,12 @@ class MySQLConnection extends DatabaseConnection_1.DatabaseConnection {
|
|
|
50
67
|
}, params, (error, results) => {
|
|
51
68
|
if (error) {
|
|
52
69
|
let sql = queryObject.sql;
|
|
70
|
+
// Formatting queries can be an expensive task, so only do it if the log level is actually silly.
|
|
53
71
|
if (logger.getLogLevel() === logger_1.LogLevel.SILLY) {
|
|
54
72
|
try {
|
|
73
|
+
// SQLFormatter doesn't understand all MySQL syntaxes, so this is to prevent
|
|
74
|
+
// potentially valid queries from becoming errors simply because we couldn't
|
|
75
|
+
// log them.
|
|
55
76
|
sql = SQLFormatter.format(queryObject.sql, SQL_FORMATTING_OPTIONS);
|
|
56
77
|
}
|
|
57
78
|
catch (ex) {
|
|
@@ -63,6 +84,7 @@ class MySQLConnection extends DatabaseConnection_1.DatabaseConnection {
|
|
|
63
84
|
}
|
|
64
85
|
return resolve(results);
|
|
65
86
|
});
|
|
87
|
+
// Formatting queries can be an expensive task, so only do it if the log level is actually silly.
|
|
66
88
|
let sql = queryObject.sql;
|
|
67
89
|
if (logger.getLogLevel() === logger_1.LogLevel.SILLY) {
|
|
68
90
|
sql = SQLFormatter.format(queryObject.sql, SQL_FORMATTING_OPTIONS);
|
|
@@ -70,6 +92,7 @@ class MySQLConnection extends DatabaseConnection_1.DatabaseConnection {
|
|
|
70
92
|
(0, instance_1.getInstance)().getLogger().trace(TAG, sql);
|
|
71
93
|
});
|
|
72
94
|
}
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
73
96
|
_stream(query, params, streamOptions) {
|
|
74
97
|
if (!streamOptions) {
|
|
75
98
|
streamOptions = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MySQLConnection.js","sourceRoot":"","sources":["../src/MySQLConnection.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"MySQLConnection.js","sourceRoot":"","sources":["../src/MySQLConnection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,6DAAwD;AACxD,6DAAwD;AACxD,yCAAuC;AAIvC,2EAAwE;AACxE,uDAAoD;AACpD,2DAAwD;AACxD,8CAA8C;AAC9C,2CAAkD;AAElD,MAAM,sBAAsB,GAAW,GAAG,CAAC,CAAC,8BAA8B;AAC1E,MAAM,GAAG,GAAW,iBAAiB,CAAC;AAEtC,MAAM,sBAAsB,GAA+B;IACvD,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,IAAI;CAClB,CAAC;AAEF,IAAI,qBAAqB,GAAU,IAAI,6CAAqB,EAAE,CAAC;AAC/D,IAAI,WAAW,GAAU,IAAI,yBAAW,EAAE,CAAC;AAC3C,IAAI,aAAa,GAAU,IAAI,6BAAa,EAAE,CAAC;AAE/C,MAAa,eAAgB,SAAQ,uCAAwC;IAIzE,YAAmB,UAAgC,EAAE,kBAA0B,EAAE,aAAsB,IAAI;QACvG,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,kBAAkB,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AAC,CAAC;SACrI;QAED,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QAErB,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACzC,IAAI,eAAe,GAAkB,IAAI,CAAC;YAC1C,IAAI,UAAU,EAAE;gBACZ,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;oBACtB,eAAe,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;iBACrC;qBACI;oBACD,eAAe,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;iBACvC;aACJ;iBACI;gBACD,eAAe,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;aACvC;YAED,eAAe,CAAC,IAAI,CAAC,GAAG,EAAE;gBACtB,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC;gBACxB,OAAO,EAAE,CAAC;YACd,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAU,EAAE,EAAE;gBACpB,IAAA,sBAAW,GAAE,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;gBAC5C,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC;gBACxB,OAAO,EAAE,CAAC;YACd,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAnLD,0CAmLC"}
|
package/lib/MySQLDatabase.js
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2017-2021 Norman Breau
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*/
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.MySQLDatabase = void 0;
|
|
4
19
|
const Database_1 = require("./Database");
|
|
@@ -9,6 +24,7 @@ const TAG = 'MySQLDatabase';
|
|
|
9
24
|
class MySQLDatabase extends Database_1.Database {
|
|
10
25
|
constructor() {
|
|
11
26
|
super();
|
|
27
|
+
// TODO: Maybe one day this may be exposed via a bt config setting.
|
|
12
28
|
this.$cluster = MySQL.createPoolCluster({
|
|
13
29
|
removeNodeErrorCount: Infinity,
|
|
14
30
|
restoreNodeTimeout: 1000
|
|
@@ -17,9 +33,11 @@ class MySQLDatabase extends Database_1.Database {
|
|
|
17
33
|
(0, instance_1.getInstance)().getLogger().warn(TAG, 'Waiting for available connection...');
|
|
18
34
|
});
|
|
19
35
|
}
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
20
37
|
escape(value) {
|
|
21
38
|
return MySQLDatabase.escape(value);
|
|
22
39
|
}
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
23
41
|
static escape(value) {
|
|
24
42
|
return MySQL.escape(value);
|
|
25
43
|
}
|
package/lib/MySQLDatabase.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MySQLDatabase.js","sourceRoot":"","sources":["../src/MySQLDatabase.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"MySQLDatabase.js","sourceRoot":"","sources":["../src/MySQLDatabase.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,yCAAoC;AACpC,uDAAkD;AAClD,+BAA+B;AAC/B,yCAAuC;AAEvC,MAAM,GAAG,GAAW,eAAe,CAAC;AAEpC,MAAa,aAAc,SAAQ,mBAA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