@breautek/storm 4.0.0 → 4.2.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 +18 -1
- package/bt-config-sample.jsonc +1 -1
- package/docs/README.md +8 -6
- package/docs/classes/Application.md +30 -30
- 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 +11 -11
- package/docs/classes/DiskSpaceError.md +11 -11
- package/docs/classes/DropTemporaryTableQuery.md +16 -10
- package/docs/classes/DumpStream.md +1 -1
- package/docs/classes/DuplicateEntryError.md +11 -11
- package/docs/classes/EntityNotFoundError.md +11 -11
- package/docs/classes/ExpiredTokenError.md +11 -11
- package/docs/classes/Handler.md +22 -22
- package/docs/classes/InternalError.md +11 -11
- package/docs/classes/InvalidCredentialsError.md +11 -11
- package/docs/classes/InvalidValueError.md +11 -11
- package/docs/classes/ManagedDatabaseConnection.md +19 -19
- package/docs/classes/Middleware.md +3 -3
- package/docs/classes/MissingConfigError.md +11 -11
- package/docs/classes/MissingParameterError.md +11 -11
- package/docs/classes/MySQLConnection.md +20 -20
- package/docs/classes/MySQLDatabase.md +14 -14
- package/docs/classes/NotImplementedError.md +301 -0
- package/docs/classes/Query.md +16 -10
- package/docs/classes/RawError.md +313 -0
- package/docs/classes/RawQuery.md +25 -17
- package/docs/classes/Request.md +18 -18
- package/docs/classes/Response.md +12 -12
- package/docs/classes/ResponseData.md +7 -7
- package/docs/classes/ServiceProvider.md +16 -16
- package/docs/classes/ServiceResponse.md +4 -4
- package/docs/classes/SetSessionVariableQuery.md +16 -10
- package/docs/classes/StormError.md +15 -11
- package/docs/classes/TemporaryTableQuery.md +16 -10
- package/docs/classes/Token.md +2 -2
- package/docs/classes/TokenManager.md +4 -4
- package/docs/classes/UnauthorizedAccessError.md +11 -11
- package/docs/enums/ErrorCode.md +20 -20
- package/docs/enums/ExitCode.md +6 -6
- package/docs/enums/HTTPMethod.md +10 -10
- package/docs/enums/JWTError.md +6 -6
- package/docs/enums/StatusCode.md +98 -98
- package/docs/interfaces/IConfig.md +8 -8
- package/docs/interfaces/IDatabaseConfig.md +6 -6
- package/docs/interfaces/IDatabaseConnection.md +15 -15
- package/docs/interfaces/IErrorResponse.md +4 -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/docs/interfaces/formidable.EmitData.md +1 -1
- package/docs/modules/formidable.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.js +16 -0
- package/lib/DatabaseQueryError.js.map +1 -1
- package/lib/DiskSpaceError.js +15 -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.js +15 -0
- package/lib/DuplicateEntryError.js.map +1 -1
- package/lib/EntityNotFoundError.js +15 -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.js +16 -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.js +16 -0
- package/lib/InternalError.js.map +1 -1
- package/lib/InvalidConfigError.js +15 -0
- package/lib/InvalidConfigError.js.map +1 -1
- package/lib/InvalidCredentialsError.js +16 -0
- package/lib/InvalidCredentialsError.js.map +1 -1
- package/lib/InvalidValueError.js +16 -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.js +15 -0
- package/lib/MissingConfigError.js.map +1 -1
- package/lib/MissingParameterError.js +15 -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 +14 -0
- package/lib/NotImplementedError.js +40 -0
- package/lib/NotImplementedError.js.map +1 -0
- package/lib/Query.d.ts +22 -2
- 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.d.ts +1 -1
- package/lib/RawQuery.js +15 -0
- package/lib/RawQuery.js.map +1 -1
- package/lib/Request.d.ts +1 -0
- package/lib/Request.js +15 -0
- package/lib/Request.js.map +1 -1
- package/lib/Response.d.ts +1 -0
- 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.d.ts +1 -2
- package/lib/ServiceProvider.js +20 -0
- package/lib/ServiceProvider.js.map +1 -1
- package/lib/ServiceResponse.d.ts +1 -0
- package/lib/ServiceResponse.js +15 -0
- package/lib/ServiceResponse.js.map +1 -1
- package/lib/SetSessionVariableQuery.d.ts +1 -2
- 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 +7 -0
- package/lib/StormError.js +22 -0
- package/lib/StormError.js.map +1 -1
- package/lib/TemporaryTableQuery.d.ts +1 -2
- 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.js +15 -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 +15 -16
- package/src/Database.ts +1 -2
- package/src/DatabaseConnection.ts +2 -3
- package/src/Handler.ts +10 -9
- package/src/NotImplementedError.ts +45 -0
- package/src/Query.ts +9 -2
- package/src/RawError.ts +39 -0
- package/src/RawQuery.ts +1 -1
- package/src/ServiceProvider.ts +1 -2
- package/src/SetSessionVariableQuery.ts +1 -2
- package/src/TemporaryTableQuery.ts +2 -3
- package/src/api.ts +2 -0
- package/tsconfig.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationEvent.js","sourceRoot":"","sources":["../src/ApplicationEvent.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ApplicationEvent.js","sourceRoot":"","sources":["../src/ApplicationEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IACxB,mDAA+B,CAAA;AACnC,CAAC,EAFW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAE3B"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { Request } from './Request';
|
|
2
|
+
/**
|
|
3
|
+
* A base authentication strategy that handles 90% of the authentication process.
|
|
4
|
+
* This will verify that the token hasn't been manipulated or tainted.
|
|
5
|
+
* The authenticate API must be implemented by subclasses to further validate the token data
|
|
6
|
+
* for their specific use cases.
|
|
7
|
+
*/
|
|
2
8
|
export declare class BackendAuthenticationMiddleware {
|
|
3
9
|
private $logger;
|
|
4
10
|
constructor();
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param request
|
|
14
|
+
* @param response
|
|
15
|
+
* @param options Arbituary object containing any relevant information used for authentication.
|
|
16
|
+
*/
|
|
5
17
|
execute(request: Request, options?: any): Promise<any>;
|
|
6
18
|
}
|
|
@@ -1,14 +1,42 @@
|
|
|
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.BackendAuthenticationMiddleware = void 0;
|
|
4
19
|
const StatusCode_1 = require("./StatusCode");
|
|
5
20
|
const ResponseData_1 = require("./ResponseData");
|
|
6
21
|
const instance_1 = require("./instance");
|
|
7
22
|
const TAG = 'BackendAuthenticationMiddleware';
|
|
23
|
+
/**
|
|
24
|
+
* A base authentication strategy that handles 90% of the authentication process.
|
|
25
|
+
* This will verify that the token hasn't been manipulated or tainted.
|
|
26
|
+
* The authenticate API must be implemented by subclasses to further validate the token data
|
|
27
|
+
* for their specific use cases.
|
|
28
|
+
*/
|
|
8
29
|
class BackendAuthenticationMiddleware {
|
|
9
30
|
constructor() {
|
|
10
31
|
this.$logger = (0, instance_1.getInstance)().getLogger();
|
|
11
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param request
|
|
36
|
+
* @param response
|
|
37
|
+
* @param options Arbituary object containing any relevant information used for authentication.
|
|
38
|
+
*/
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
12
40
|
execute(request, options) {
|
|
13
41
|
let config = (0, instance_1.getInstance)().getConfig();
|
|
14
42
|
let backendAuthHeader = config.backend_authentication_header;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackendAuthenticationMiddleware.js","sourceRoot":"","sources":["../src/BackendAuthenticationMiddleware.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"BackendAuthenticationMiddleware.js","sourceRoot":"","sources":["../src/BackendAuthenticationMiddleware.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,6CAAwC;AAExC,iDAA4C;AAE5C,yCAAuC;AAGvC,MAAM,GAAG,GAAW,iCAAiC,CAAC;AAEtD;;;;;GAKG;AACH,MAAa,+BAA+B;IAGxC;QACI,IAAI,CAAC,OAAO,GAAG,IAAA,sBAAW,GAAE,CAAC,SAAS,EAAE,CAAC;IAC7C,CAAC;IAED;;;;;OAKG;IACH,6EAA6E;IACtE,OAAO,CAAC,OAAgB,EAAE,OAAa;QAC1C,IAAI,MAAM,GAAY,IAAA,sBAAW,GAAE,CAAC,SAAS,EAAE,CAAC;QAEhD,IAAI,iBAAiB,GAAW,MAAM,CAAC,6BAA6B,CAAC;QAErE,IAAI,OAAO,GAAW,OAAO,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;QAE3D,IAAI,OAAO,EAAE;YACT,IAAI,MAAM,CAAC,6BAA6B,KAAK,IAAI,EAAE;gBAC/C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,iCAAiC,CAAC,CAAC;gBAC1D,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,2BAAY,CAAC,uBAAU,CAAC,cAAc,CAAC,CAAC,CAAC;aACtE;YAED,IAAI,OAAO,KAAK,MAAM,CAAC,6BAA6B,EAAE;gBAClD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;aAChC;iBACI;gBACD,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,2BAAY,CAAC,uBAAU,CAAC,gBAAgB,EAAE;oBAChE,IAAI,EAAE,CAAC;oBACP,MAAM,EAAE,gBAAgB;iBAC3B,CAAC,CAAC,CAAC;aACP;SACJ;aACI;YACD,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,2BAAY,CAAC,uBAAU,CAAC,gBAAgB,EAAE;gBAChE,IAAI,EAAE,CAAC;gBACP,MAAM,EAAE,gBAAgB;aAC3B,CAAC,CAAC,CAAC;SACP;IACL,CAAC;CACJ;AA5CD,0EA4CC"}
|
package/lib/CORSMiddleware.d.ts
CHANGED
|
@@ -2,11 +2,25 @@ import { Middleware } from './Middleware';
|
|
|
2
2
|
import { Request } from './Request';
|
|
3
3
|
import { Response } from './Response';
|
|
4
4
|
import { IRequestResponse } from './IRequestResponse';
|
|
5
|
+
/**
|
|
6
|
+
* CORSMiddleware is used to enable CORS on APIs.
|
|
7
|
+
* It will automatically add the necessary headers necessary to
|
|
8
|
+
* communicate with CORS enabled clients.
|
|
9
|
+
*/
|
|
5
10
|
export declare class CORSMiddleware extends Middleware {
|
|
6
11
|
private $allowedOrigin;
|
|
7
12
|
private $allowedHeaders;
|
|
8
13
|
private $allowedMethods;
|
|
14
|
+
/**
|
|
15
|
+
* @constructor
|
|
16
|
+
* @param allowedOrigin The allowed origin. By default it will use the request origin.
|
|
17
|
+
* @param allowedHeaders Array of allowed headers.
|
|
18
|
+
* @param allowedMethods Array of allowed HTTP methods.
|
|
19
|
+
*/
|
|
9
20
|
constructor(allowedOrigin?: string, allowedHeaders?: Array<string>, allowedMethods?: Array<string>);
|
|
21
|
+
/**
|
|
22
|
+
* Sets the allowed origin. By default,
|
|
23
|
+
*/
|
|
10
24
|
getDefaultAllowedOrigin(): string;
|
|
11
25
|
getDefaultAllowedHeaders(): Array<string>;
|
|
12
26
|
getDefaultAllowedMethods(): Array<string>;
|
package/lib/CORSMiddleware.js
CHANGED
|
@@ -1,15 +1,44 @@
|
|
|
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.CORSMiddleware = void 0;
|
|
4
19
|
const Middleware_1 = require("./Middleware");
|
|
5
20
|
const instance_1 = require("./instance");
|
|
21
|
+
/**
|
|
22
|
+
* CORSMiddleware is used to enable CORS on APIs.
|
|
23
|
+
* It will automatically add the necessary headers necessary to
|
|
24
|
+
* communicate with CORS enabled clients.
|
|
25
|
+
*/
|
|
6
26
|
class CORSMiddleware extends Middleware_1.Middleware {
|
|
27
|
+
/**
|
|
28
|
+
* @constructor
|
|
29
|
+
* @param allowedOrigin The allowed origin. By default it will use the request origin.
|
|
30
|
+
* @param allowedHeaders Array of allowed headers.
|
|
31
|
+
* @param allowedMethods Array of allowed HTTP methods.
|
|
32
|
+
*/
|
|
7
33
|
constructor(allowedOrigin, allowedHeaders, allowedMethods) {
|
|
8
34
|
super();
|
|
9
35
|
this.$allowedOrigin = (!allowedOrigin) ? this.getDefaultAllowedOrigin() : allowedOrigin;
|
|
10
36
|
this.$allowedHeaders = (!allowedHeaders) ? this.getDefaultAllowedHeaders() : allowedHeaders;
|
|
11
37
|
this.$allowedMethods = (!allowedMethods) ? this.getDefaultAllowedMethods() : allowedMethods;
|
|
12
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Sets the allowed origin. By default,
|
|
41
|
+
*/
|
|
13
42
|
getDefaultAllowedOrigin() {
|
|
14
43
|
return null;
|
|
15
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CORSMiddleware.js","sourceRoot":"","sources":["../src/CORSMiddleware.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"CORSMiddleware.js","sourceRoot":"","sources":["../src/CORSMiddleware.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,6CAAwC;AAIxC,yCAAuC;AAEvC;;;;GAIG;AACH,MAAa,cAAe,SAAQ,uBAAU;IAK1C;;;;;OAKG;IACH,YAAmB,aAAsB,EAAE,cAA8B,EAAE,cAA8B;QACrG,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;QACxF,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB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+1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/// <reference path="./defs/merge-change.d.ts" />
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.ConfigLoader = void 0;
|
|
5
|
+
/*
|
|
6
|
+
Copyright 2017-2021 Norman Breau
|
|
7
|
+
|
|
8
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
you may not use this file except in compliance with the License.
|
|
10
|
+
You may obtain a copy of the License at
|
|
11
|
+
|
|
12
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
|
|
14
|
+
Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
See the License for the specific language governing permissions and
|
|
18
|
+
limitations under the License.
|
|
19
|
+
*/
|
|
4
20
|
const instance_1 = require("./instance");
|
|
5
21
|
const logger_1 = require("@arashi/logger");
|
|
6
22
|
const Path = require("path");
|
package/lib/ConfigLoader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigLoader.js","sourceRoot":"","sources":["../src/ConfigLoader.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ConfigLoader.js","sourceRoot":"","sources":["../src/ConfigLoader.ts"],"names":[],"mappings":";AAAA,iDAAiD;;;AAEjD;;;;;;;;;;;;;;EAcE;AAEF,yCAAuC;AACvC,2CAAsC;AACtC,6BAA6B;AAG7B,6BAAsB;AACtB,sDAAsD;AACtD,6DAA0D;AAC1D,6DAA0D;AAE1D,MAAM,GAAG,GAAW,cAAc,CAAC;AAEnC,MAAa,YAAY;IACrB,gBAAuB,CAAC;IAEjB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAY;QACjC,IAAI,MAAM,GAAW,YAAY,CAAC,UAAU,EAAE,CAAC;QAE/C,MAAM,CAAC,KAAK,CA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ACJ;iBACJ;gBACD,YAAY,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,oBAAoB,EAAE,IAAI;oBAC1B,UAAU,EAAE,EAAE;iBACjB;aACJ;SACJ,CAAC,CAAC;QAEH,IAAI,OAAO,GAAY,QAAQ,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO,EAAE;YACV,MAAM,IAAI,uCAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;SACzD;IACL,CAAC;IAEO,MAAM,CAAC,eAAe;QAC1B,IAAI,GAAG,GAAgB,IAAA,sBAAW,GAAE,CAAC;QACrC,IAAI,CAAC,GAAG,EAAE;YACN,OAAO,EAAE,CAAC;SACb;QAED,OAAO,GAAG,CAAC,cAAc,EAAE,CAAC;IAChC,CAAC;IAEO,MAAM,CAAC,UAAU;QACrB,IAAI,MAAc,CAAC;QAEnB,IAAI,CAAC,MAAM,EAAE;YACT,MAAM,GAAG,IAAI,eAAM,CAAC,cAAc,CAAC,CAAC;SACvC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAvLD,oCAuLC"}
|
package/lib/Database.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.Database = void 0;
|
|
4
19
|
const UUID = require("uuid");
|
package/lib/Database.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Database.js","sourceRoot":"","sources":["../src/Database.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Database.js","sourceRoot":"","sources":["../src/Database.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,6BAA6B;AAE7B,yCAAyC;AAEzC,MAAM,WAAW,GAAW,QAAQ,CAAC;AACrC,MAAM,GAAG,GAAW,UAAU,CAAC;AAE/B,MAAsB,QAAQ;IAG1B;QACI,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;IAChC,CAAC;IAEM,SAAS,CAAC,MAAuB;QACpC,IAAI,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE;YACrC,MAAM,IAAI,KAAK,CAAC,SAAS,WAAW,mBAAmB,CAAC,CAAC;SAC5D;QAED,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC;QAC7C,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAC3C,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;IAEM,QAAQ,CAAC,OAAe,EAAE,MAAuB;QACpD,IAAI,EAAE,GAAG,SAAS,IAAI,CAAC,EAAE,EAAE,IAAI,OAAO,EAAE,CAAC;QAEzC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;QACpC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAE1B,OAAO,EAAE,CAAC;IACd,CAAC;IAEM,WAAW,CAAC,OAAe;QAC9B,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE;YAClC,IAAA,sBAAW,GAAE,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,OAAO,iCAAiC,CAAC,CAAC;YACtF,OAAO;SACV;QAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAEM,aAAa,CAAC,qBAA8B,KAAK,EAAE,MAAe;QACrE,IAAI,KAAK,GAAW,QAAQ,CAAC;QAE7B,IAAI,MAAM,EAAE;YACR,KAAK,GAAG,MAAM,CAAC;SAClB;aACI,IAAI,kBAAkB,EAAE;YACzB,KAAK,GAAG,QAAQ,CAAC;SACpB;QAED,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;IAC1D,CAAC;IAEM,OAAO;QACV,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;CAOJ;AA9DD,4BA8DC"}
|
|
@@ -4,6 +4,12 @@ import { IDatabaseConnection } from './IDatabaseConnection';
|
|
|
4
4
|
import { Query } from './Query';
|
|
5
5
|
export declare const LINGER_WARNING: number;
|
|
6
6
|
export declare const DEFAULT_QUERY_TIMEOUT: number;
|
|
7
|
+
/**
|
|
8
|
+
* Do not call `new Database` directly. Use `Database.getConnection` to create a `DatabaseConnection` object.
|
|
9
|
+
* @abstract
|
|
10
|
+
* @implements `IDatabaseConnection`
|
|
11
|
+
* @class
|
|
12
|
+
*/
|
|
7
13
|
export declare abstract class DatabaseConnection<TAPI> implements IDatabaseConnection {
|
|
8
14
|
private $api;
|
|
9
15
|
private $readOnly;
|
|
@@ -14,22 +20,131 @@ export declare abstract class DatabaseConnection<TAPI> implements IDatabaseConne
|
|
|
14
20
|
constructor(api: TAPI, isReadOnly: boolean, instantiationStack: string);
|
|
15
21
|
private $triggerLingerWarning;
|
|
16
22
|
setInstantiationStack(stack: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Gets the callback stacktrace to determine what opened
|
|
25
|
+
* this connection. Useful for debugging lingering connections.
|
|
26
|
+
* @returns string - A stacktrace
|
|
27
|
+
*/
|
|
17
28
|
getInstantiationStack(): string;
|
|
18
29
|
private $armLingerWarning;
|
|
30
|
+
/**
|
|
31
|
+
* Gets the underlying Database API
|
|
32
|
+
* @returns any
|
|
33
|
+
*/
|
|
19
34
|
getAPI(): TAPI;
|
|
35
|
+
/**
|
|
36
|
+
* Returns true if connection was created without
|
|
37
|
+
* write access
|
|
38
|
+
* @returns boolean
|
|
39
|
+
*/
|
|
20
40
|
isReadOnly(): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Sets the timeout of this connectino
|
|
43
|
+
*
|
|
44
|
+
* @param timeout in milliseconds
|
|
45
|
+
*/
|
|
21
46
|
setTimeout(timeout: number): void;
|
|
47
|
+
/**
|
|
48
|
+
* Returns the current timeout setting
|
|
49
|
+
* @returns number in milliseconds
|
|
50
|
+
*/
|
|
22
51
|
getTimeout(): number;
|
|
52
|
+
/**
|
|
53
|
+
* Queries the database for a dataset.
|
|
54
|
+
*
|
|
55
|
+
* @param {Query} query The database query
|
|
56
|
+
* @async
|
|
57
|
+
* @returns Promise<TQueryResult>
|
|
58
|
+
*/
|
|
23
59
|
query<TQueryResult = any>(query: Query): Promise<TQueryResult>;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @param query The database query
|
|
63
|
+
* @param params Parameters for the query
|
|
64
|
+
* @param streamOptions Stream options
|
|
65
|
+
* @returns Readable
|
|
66
|
+
*/
|
|
24
67
|
stream(query: Query, streamOptions?: any): Readable;
|
|
68
|
+
/**
|
|
69
|
+
* Closes the connection. May error if connection has an active transaction.
|
|
70
|
+
* if `forceClose` boolean is true, it will force close the connection, regardless
|
|
71
|
+
* of transaction state.
|
|
72
|
+
*
|
|
73
|
+
* @param forceClose optional boolean
|
|
74
|
+
* @async
|
|
75
|
+
* @returns Promise<void>
|
|
76
|
+
*/
|
|
25
77
|
close(forceClose?: boolean): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Returns true if the connection has been closed.
|
|
80
|
+
*/
|
|
26
81
|
isClosed(): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Implementation method to start a transaction.
|
|
84
|
+
*
|
|
85
|
+
* @abstract
|
|
86
|
+
* @async
|
|
87
|
+
* @returns Promise<void>
|
|
88
|
+
*/
|
|
27
89
|
abstract startTransaction(): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Implementation method to determine if the connection is in an active transaction.
|
|
92
|
+
*
|
|
93
|
+
* @abstract
|
|
94
|
+
* @returns boolean
|
|
95
|
+
*/
|
|
28
96
|
abstract isTransaction(): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Ends a transaction. if `requiresRollback` is `true`, then `rollback()` is invoked. Otherwise, `commit()` is invoked.
|
|
99
|
+
*
|
|
100
|
+
* @abstract
|
|
101
|
+
* @async
|
|
102
|
+
* @param requiresRollback optional boolean
|
|
103
|
+
* @returns Promise<void>
|
|
104
|
+
*/
|
|
29
105
|
abstract endTransaction(requiresRollback?: boolean): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Commits a transaction. This will end a transaction.
|
|
108
|
+
*
|
|
109
|
+
* @abstract
|
|
110
|
+
* @async
|
|
111
|
+
* @returns Promise<void>
|
|
112
|
+
*/
|
|
30
113
|
abstract commit(): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Rollsback a transaction. This will end a transaction.
|
|
116
|
+
*
|
|
117
|
+
* @abstract
|
|
118
|
+
* @async
|
|
119
|
+
* @returns Promise<void>
|
|
120
|
+
*/
|
|
31
121
|
abstract rollback(): Promise<void>;
|
|
122
|
+
/**
|
|
123
|
+
* Implementation to close the connection, if `forceClose` is true, close the connection no matter what.
|
|
124
|
+
* Silently error if it means the connection is closed.
|
|
125
|
+
*
|
|
126
|
+
* @param forceClose boolean, if `true`, should close the connection no matter what.
|
|
127
|
+
* @async
|
|
128
|
+
* @returns Promise<void>
|
|
129
|
+
*/
|
|
32
130
|
protected abstract _close(forceClose: boolean): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Implementation method to return a dataset from the database
|
|
133
|
+
*
|
|
134
|
+
* @param query The database query
|
|
135
|
+
* @param params The query parameters
|
|
136
|
+
* @async
|
|
137
|
+
* @returns Promise
|
|
138
|
+
*/
|
|
33
139
|
protected abstract _query<TQueryResult>(query: string, params?: any): Promise<TQueryResult>;
|
|
140
|
+
/**
|
|
141
|
+
* Implementation method to return a dataset from the database like `query()`,
|
|
142
|
+
* but returns a `Readable` stream instead.
|
|
143
|
+
*
|
|
144
|
+
* @param query The database query
|
|
145
|
+
* @param params The query parameters
|
|
146
|
+
* @param streamOptions `Readable` stream options
|
|
147
|
+
* @returns `Readable`
|
|
148
|
+
*/
|
|
34
149
|
protected abstract _stream(query: string, params?: any, streamOptions?: any): Readable;
|
|
35
150
|
}
|
|
@@ -1,10 +1,31 @@
|
|
|
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.DatabaseConnection = exports.DEFAULT_QUERY_TIMEOUT = exports.LINGER_WARNING = void 0;
|
|
4
19
|
const instance_1 = require("./instance");
|
|
5
20
|
exports.LINGER_WARNING = 10000;
|
|
6
21
|
exports.DEFAULT_QUERY_TIMEOUT = 3600000;
|
|
7
22
|
const TAG = 'DatabaseConnection';
|
|
23
|
+
/**
|
|
24
|
+
* Do not call `new Database` directly. Use `Database.getConnection` to create a `DatabaseConnection` object.
|
|
25
|
+
* @abstract
|
|
26
|
+
* @implements `IDatabaseConnection`
|
|
27
|
+
* @class
|
|
28
|
+
*/
|
|
8
29
|
class DatabaseConnection {
|
|
9
30
|
constructor(api, isReadOnly, instantiationStack) {
|
|
10
31
|
this.$api = api;
|
|
@@ -24,6 +45,11 @@ class DatabaseConnection {
|
|
|
24
45
|
setInstantiationStack(stack) {
|
|
25
46
|
this.$instantiationStack = stack;
|
|
26
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Gets the callback stacktrace to determine what opened
|
|
50
|
+
* this connection. Useful for debugging lingering connections.
|
|
51
|
+
* @returns string - A stacktrace
|
|
52
|
+
*/
|
|
27
53
|
getInstantiationStack() {
|
|
28
54
|
return this.$instantiationStack;
|
|
29
55
|
}
|
|
@@ -35,21 +61,46 @@ class DatabaseConnection {
|
|
|
35
61
|
this.$triggerLingerWarning();
|
|
36
62
|
}, exports.LINGER_WARNING);
|
|
37
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Gets the underlying Database API
|
|
66
|
+
* @returns any
|
|
67
|
+
*/
|
|
38
68
|
getAPI() {
|
|
39
69
|
return this.$api;
|
|
40
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Returns true if connection was created without
|
|
73
|
+
* write access
|
|
74
|
+
* @returns boolean
|
|
75
|
+
*/
|
|
41
76
|
isReadOnly() {
|
|
42
77
|
return this.$readOnly;
|
|
43
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Sets the timeout of this connectino
|
|
81
|
+
*
|
|
82
|
+
* @param timeout in milliseconds
|
|
83
|
+
*/
|
|
44
84
|
setTimeout(timeout) {
|
|
45
85
|
if (isNaN(timeout)) {
|
|
46
86
|
throw new TypeError('setTimeout expects a number in parameter 1.');
|
|
47
87
|
}
|
|
48
88
|
this.$timeout = timeout;
|
|
49
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Returns the current timeout setting
|
|
92
|
+
* @returns number in milliseconds
|
|
93
|
+
*/
|
|
50
94
|
getTimeout() {
|
|
51
95
|
return this.$timeout;
|
|
52
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Queries the database for a dataset.
|
|
99
|
+
*
|
|
100
|
+
* @param {Query} query The database query
|
|
101
|
+
* @async
|
|
102
|
+
* @returns Promise<TQueryResult>
|
|
103
|
+
*/
|
|
53
104
|
async query(query) {
|
|
54
105
|
this.$armLingerWarning();
|
|
55
106
|
let queryStr = null;
|
|
@@ -59,6 +110,14 @@ class DatabaseConnection {
|
|
|
59
110
|
let results = await this._query(queryStr, params);
|
|
60
111
|
return await query.onPostProcess(this, results);
|
|
61
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
* @param query The database query
|
|
116
|
+
* @param params Parameters for the query
|
|
117
|
+
* @param streamOptions Stream options
|
|
118
|
+
* @returns Readable
|
|
119
|
+
*/
|
|
120
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
62
121
|
stream(query, streamOptions) {
|
|
63
122
|
this.$armLingerWarning();
|
|
64
123
|
let queryStr = null;
|
|
@@ -66,6 +125,15 @@ class DatabaseConnection {
|
|
|
66
125
|
queryStr = query.getQuery(this);
|
|
67
126
|
return this._stream(queryStr, params, streamOptions);
|
|
68
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Closes the connection. May error if connection has an active transaction.
|
|
130
|
+
* if `forceClose` boolean is true, it will force close the connection, regardless
|
|
131
|
+
* of transaction state.
|
|
132
|
+
*
|
|
133
|
+
* @param forceClose optional boolean
|
|
134
|
+
* @async
|
|
135
|
+
* @returns Promise<void>
|
|
136
|
+
*/
|
|
69
137
|
close(forceClose = false) {
|
|
70
138
|
if (this.isClosed()) {
|
|
71
139
|
return Promise.resolve();
|
|
@@ -74,6 +142,9 @@ class DatabaseConnection {
|
|
|
74
142
|
clearTimeout(this.$lingerTimer);
|
|
75
143
|
return this._close(forceClose);
|
|
76
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Returns true if the connection has been closed.
|
|
147
|
+
*/
|
|
77
148
|
isClosed() {
|
|
78
149
|
return !this.$open;
|
|
79
150
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatabaseConnection.js","sourceRoot":"","sources":["../src/DatabaseConnection.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"DatabaseConnection.js","sourceRoot":"","sources":["../src/DatabaseConnection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,yCAEoB;AAMP,QAAA,cAAc,GAAW,KAAK,CAAC;AAC/B,QAAA,qBAAqB,GAAW,OAAO,CAAC;AACrD,MAAM,GAAG,GAAW,oBAAoB,CAAC;AAEzC;;;;;GAKG;AACH,MAAsB,kBAAkB;IAQpC,YAAmB,GAAS,EAAE,UAAmB,EAAE,kBAA0B;QACzE,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC;QAC5B,IAAI,CAAC,mBAAmB,GAAG,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACpF,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,IAAI,MAAM,GAAY,IAAA,sBAAW,GAAE,CAAC,SAAS,EAAE,CAAC;QAEhD,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;QACvE,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACtB,IAAI,CAAC,QAAQ,GAAG,6BAAqB,CAAC;SACzC;QAED,IAAI,CAAC,iBAAiB,EAAE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qBAAqB,EAAE,CAAC;QAE7D,MAAM,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,OAAO,GAAiB,MAAM,IAAI,CAAC,MAAM,CAAe,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC9E,OAAO,MAAY,KAAK,CAAC,aAAa,CAAC,IAAI,EAAO,OAAO,CAAE,CAAC;IAChE,CAAC;IAED;;;;;;OAMG;IACH,6EAA6E;IACtE,MAAM,CAAC,KAAY,EAAE,aAAmB;QAC3C,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzB,IAAI,QAAQ,GAAW,IAAI,CAAC;QAC5B,IAAI,MAAM,GAAqB,KAAK,CAAC,qBAAqB,EAAE,CAAC;QAC7D,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,aAAsB,KAAK;QACpC,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE;YACjB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;SAC5B;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACI,QAAQ;QACX,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;IACvB,CAAC;CA+EJ;AAnOD,gDAmOC"}
|
|
@@ -1,9 +1,25 @@
|
|
|
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.DatabaseQueryError = void 0;
|
|
4
19
|
const StormError_1 = require("./StormError");
|
|
5
20
|
const StatusCode_1 = require("./StatusCode");
|
|
6
21
|
class DatabaseQueryError extends StormError_1.StormError {
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
7
23
|
constructor(query, error) {
|
|
8
24
|
super({
|
|
9
25
|
query: query,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatabaseQueryError.js","sourceRoot":"","sources":["../src/DatabaseQueryError.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"DatabaseQueryError.js","sourceRoot":"","sources":["../src/DatabaseQueryError.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,6CAAwC;AACxC,6CAAwC;AAExC,MAAa,kBAAmB,SAAQ,uBAGtC;IACE,6EAA6E;IAC7E,YAAmB,KAAa,EAAE,KAAU;QACxC,KAAK,CAAC;YACF,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,KAAK;SACf,CAAC,CAAC;IACP,CAAC;IAEM,UAAU;QACb,OAAO,uBAAuB,CAAC;IACnC,CAAC;IAEM,OAAO;QACV,OAAO,CAAC,CAAC;IACb,CAAC;IAEM,WAAW;QACd,OAAO,uBAAU,CAAC,cAAc,CAAC;IACrC,CAAC;CACJ;AAvBD,gDAuBC"}
|
package/lib/DiskSpaceError.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.DiskSpaceError = void 0;
|
|
4
19
|
const StormError_1 = require("./StormError");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiskSpaceError.js","sourceRoot":"","sources":["../src/DiskSpaceError.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"DiskSpaceError.js","sourceRoot":"","sources":["../src/DiskSpaceError.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,6CAAwC;AACxC,2CAAsC;AACtC,6CAAwC;AAExC,MAAa,cAAe,SAAQ,uBAAU;IAC1C,YAAmB,aAAqB;QACpC,KAAK,CAAC;YACF,KAAK,EAAE,aAAa;SACvB,CAAC,CAAC;IACP,CAAC;IAEM,UAAU;QACb,OAAO,iBAAiB,CAAC;IAC7B,CAAC;IAEM,OAAO;QACV,OAAO,qBAAS,CAAC,uBAAuB,CAAC;IAC7C,CAAC;IAEM,WAAW;QACd,OAAO,uBAAU,CAAC,cAAc,CAAC;IACrC,CAAC;CACJ;AAlBD,wCAkBC"}
|
|
@@ -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.DropTemporaryTableQuery = void 0;
|
|
4
19
|
const Query_1 = require("./Query");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropTemporaryTableQuery.js","sourceRoot":"","sources":["../src/DropTemporaryTableQuery.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"DropTemporaryTableQuery.js","sourceRoot":"","sources":["../src/DropTemporaryTableQuery.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,mCAA8B;AAM9B,MAAa,uBAAwB,SAAQ,aAAoC;IAEtE,aAAa;QAChB,OAAsC,KAAK,CAAC,aAAa,EAAE,CAAC;IAChE,CAAC;IAES,SAAS;QACf,OAAO;qCACsB,IAAI,CAAC,aAAa,EAAE,CAAC,SAAS;SAC1D,CAAC;IACN,CAAC;CACJ;AAXD,0DAWC"}
|
package/lib/DumpStream.js
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
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.DumpStream = void 0;
|
|
4
19
|
const FileSystem = require("fs");
|
|
5
20
|
class DumpStream {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
6
22
|
constructor() { }
|
|
7
23
|
static getWritable() {
|
|
8
24
|
return FileSystem.createWriteStream('/dev/null');
|
package/lib/DumpStream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DumpStream.js","sourceRoot":"","sources":["../src/DumpStream.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"DumpStream.js","sourceRoot":"","sources":["../src/DumpStream.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,iCAAiC;AAGjC,MAAa,UAAU;IAEnB,gEAAgE;IAChE,gBAAuB,CAAC;IAEjB,MAAM,CAAC,WAAW;QACrB,OAAO,UAAU,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC;CACJ;AARD,gCAQC"}
|