@breautek/storm 6.1.0-beta.3 → 6.1.0-beta.5
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/search.js +1 -1
- package/docs/classes/Application.html +19 -17
- package/docs/classes/BackendAuthenticationMiddleware.html +3 -3
- package/docs/classes/CORSMiddleware.html +3 -3
- 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 +19 -19
- package/docs/classes/DatabaseQueryError.html +5 -5
- package/docs/classes/DeadLockError.html +5 -5
- package/docs/classes/DiskSpaceError.html +5 -5
- package/docs/classes/DropTemporaryTableQuery.html +6 -6
- package/docs/classes/DuplicateEntryError.html +5 -5
- package/docs/classes/EntityNotFoundError.html +5 -5
- package/docs/classes/ExpiredTokenError.html +5 -5
- package/docs/classes/Handler.html +2 -2
- package/docs/classes/InternalError.html +5 -5
- package/docs/classes/InvalidCredentialsError.html +5 -5
- package/docs/classes/InvalidValueError.html +5 -5
- package/docs/classes/LineString.html +2 -2
- package/docs/classes/LockWaitTimeoutError.html +5 -5
- package/docs/classes/ManagedDatabaseConnection.html +2 -2
- package/docs/classes/Middleware.html +2 -2
- package/docs/classes/MissingConfigError.html +5 -5
- package/docs/classes/MissingParameterError.html +5 -5
- package/docs/classes/MySQLConnection.html +19 -19
- package/docs/classes/MySQLDatabase.html +2 -2
- package/docs/classes/NotImplementedError.html +5 -5
- package/docs/classes/Point.html +2 -2
- package/docs/classes/Polygon.html +2 -2
- package/docs/classes/Query.html +6 -6
- package/docs/classes/RawError.html +5 -5
- package/docs/classes/RawQuery.html +6 -6
- package/docs/classes/Request.html +2 -2
- package/docs/classes/Response.html +2 -2
- package/docs/classes/ResponseData.html +2 -2
- package/docs/classes/ServiceProvider.html +2 -2
- package/docs/classes/ServiceResponse.html +2 -2
- package/docs/classes/SetSessionVariableQuery.html +6 -6
- package/docs/classes/StormError.html +5 -5
- package/docs/classes/TemporaryTableQuery.html +6 -6
- 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 +5 -5
- 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/functions/getInstance.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 +2 -2
- package/docs/interfaces/IErrorResponse.html +2 -2
- package/docs/interfaces/IFormData.html +2 -2
- package/docs/interfaces/IHandler.html +2 -2
- package/docs/interfaces/IInsertQueryResult.html +2 -2
- package/docs/interfaces/IJWTVerifyOptions.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/IServiceHeaders.html +1 -1
- package/docs/interfaces/ISetSessionVariableQueryInput.html +2 -2
- package/docs/interfaces/ITemporaryTableQueryInput.html +2 -2
- package/docs/interfaces/IUpdateQueryResult.html +2 -2
- package/docs/types/IDeleteQueryResult.html +1 -1
- package/docs/types/IHandlerError.html +1 -1
- package/docs/types/IHandlerResponse.html +1 -1
- package/docs/types/TCoordinate.html +1 -1
- package/lib/Application.d.ts +6 -0
- package/lib/Application.js +11 -1
- package/lib/Application.js.map +1 -1
- package/lib/ConfigLoader.js +1 -1
- package/lib/ConfigLoader.js.map +1 -1
- package/package.json +1 -1
- package/src/Application.ts +13 -1
- package/src/ConfigLoader.ts +1 -1
package/src/Application.ts
CHANGED
|
@@ -44,6 +44,7 @@ export interface IStormCLIArgs {
|
|
|
44
44
|
authentication_header?: string;
|
|
45
45
|
configFile?: string;
|
|
46
46
|
localConfigFile?: string;
|
|
47
|
+
custom: Record<string, any>;
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
const TAG: string = 'Application';
|
|
@@ -317,6 +318,14 @@ export abstract class Application
|
|
|
317
318
|
return this.$program;
|
|
318
319
|
}
|
|
319
320
|
|
|
321
|
+
/**
|
|
322
|
+
* Override this method to map CLI args to customConfig
|
|
323
|
+
* @param args
|
|
324
|
+
*/
|
|
325
|
+
public getConfigFromCLIArgs(args: any): Record<string, any> {
|
|
326
|
+
return {};
|
|
327
|
+
}
|
|
328
|
+
|
|
320
329
|
/**
|
|
321
330
|
* The maximum size limit for incoming requests that this service needs to handle.
|
|
322
331
|
*/
|
|
@@ -499,13 +508,16 @@ export abstract class Application
|
|
|
499
508
|
*/
|
|
500
509
|
public getCmdLineArgs(): IStormCLIArgs {
|
|
501
510
|
let program: Command = this.$program;
|
|
502
|
-
let o: IStormCLIArgs = {
|
|
511
|
+
let o: IStormCLIArgs = {
|
|
512
|
+
custom: null
|
|
513
|
+
};
|
|
503
514
|
|
|
504
515
|
if (!program) {
|
|
505
516
|
return o;
|
|
506
517
|
}
|
|
507
518
|
|
|
508
519
|
let opts: any = program.opts();
|
|
520
|
+
o.custom = opts;
|
|
509
521
|
|
|
510
522
|
if (opts.bind !== undefined) {
|
|
511
523
|
o.bind = opts.bind;
|
package/src/ConfigLoader.ts
CHANGED
|
@@ -74,7 +74,7 @@ export class ConfigLoader<TConfig extends IConfig = IConfig> {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// This will pull all custom configurations into customConfig
|
|
77
|
-
config.customConfig = MergeChange.merge(config.customConfig, this.$app.getCmdLineArgs());
|
|
77
|
+
config.customConfig = MergeChange.merge(config.customConfig, this.$app.getConfigFromCLIArgs(this.$app.getCmdLineArgs()));
|
|
78
78
|
|
|
79
79
|
if (config.log.level === null) {
|
|
80
80
|
config.log.level = defaults.log.level;
|