@breautek/storm 9.0.5 → 9.0.6

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.
Files changed (108) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/docs/classes/Application.html +45 -45
  3. package/docs/classes/ConfigLoader.html +3 -3
  4. package/docs/classes/Database.html +2 -2
  5. package/docs/classes/DatabaseCastObject.html +2 -2
  6. package/docs/classes/DatabaseConnection.html +21 -21
  7. package/docs/classes/DatabaseQueryError.html +8 -8
  8. package/docs/classes/DeadLockError.html +8 -8
  9. package/docs/classes/DiskSpaceError.html +7 -7
  10. package/docs/classes/DropTemporaryTableQuery.html +7 -7
  11. package/docs/classes/DuplicateEntryError.html +7 -7
  12. package/docs/classes/EntityNotFoundError.html +7 -7
  13. package/docs/classes/ExpiredTokenError.html +7 -7
  14. package/docs/classes/Handler.html +2 -2
  15. package/docs/classes/InternalError.html +7 -7
  16. package/docs/classes/InvalidCredentialsError.html +7 -7
  17. package/docs/classes/InvalidValueError.html +7 -7
  18. package/docs/classes/LineString.html +2 -2
  19. package/docs/classes/LockWaitTimeoutError.html +8 -8
  20. package/docs/classes/ManagedDatabaseConnection.html +5 -5
  21. package/docs/classes/Middleware.html +2 -2
  22. package/docs/classes/MissingConfigError.html +7 -7
  23. package/docs/classes/MissingParameterError.html +7 -7
  24. package/docs/classes/MySQLConnection.html +25 -25
  25. package/docs/classes/MySQLDatabase.html +2 -2
  26. package/docs/classes/NotImplementedError.html +7 -7
  27. package/docs/classes/Point.html +2 -2
  28. package/docs/classes/Polygon.html +2 -2
  29. package/docs/classes/Query.html +7 -7
  30. package/docs/classes/RawError.html +7 -7
  31. package/docs/classes/RawQuery.html +7 -7
  32. package/docs/classes/Request.html +3 -3
  33. package/docs/classes/Response.html +2 -2
  34. package/docs/classes/ResponseData.html +3 -3
  35. package/docs/classes/ServiceProvider.html +2 -2
  36. package/docs/classes/ServiceResponse.html +2 -2
  37. package/docs/classes/SetSessionVariableQuery.html +7 -7
  38. package/docs/classes/StormError.html +7 -7
  39. package/docs/classes/TemporaryTableQuery.html +7 -7
  40. package/docs/classes/TimeoutError.html +7 -7
  41. package/docs/classes/Token.html +2 -2
  42. package/docs/classes/TokenManager.html +2 -2
  43. package/docs/classes/Transaction.html +2 -2
  44. package/docs/classes/UnauthorizedAccessError.html +7 -7
  45. package/docs/enums/ErrorCode.html +2 -2
  46. package/docs/enums/ExitCode.html +2 -2
  47. package/docs/enums/HTTPMethod.html +2 -2
  48. package/docs/enums/IsolationLevel.html +2 -2
  49. package/docs/enums/JWTError.html +2 -2
  50. package/docs/enums/StatusCode.html +2 -2
  51. package/docs/enums/TransactionAccessLevel.html +2 -2
  52. package/docs/functions/getInstance.html +1 -1
  53. package/docs/interfaces/IAdditionalErrorDetails.html +1 -1
  54. package/docs/interfaces/IAuthTokenData.html +2 -2
  55. package/docs/interfaces/ICloudwatchConfig.html +2 -2
  56. package/docs/interfaces/ICloudwatchCredentials.html +2 -2
  57. package/docs/interfaces/ICloudwatchStreamConfig.html +2 -2
  58. package/docs/interfaces/IConfig.html +2 -2
  59. package/docs/interfaces/IDatabaseConfig.html +2 -2
  60. package/docs/interfaces/IDatabaseConnection.html +5 -5
  61. package/docs/interfaces/IDatabasePosition.html +2 -2
  62. package/docs/interfaces/IErrorResponse.html +2 -2
  63. package/docs/interfaces/IFormData.html +2 -2
  64. package/docs/interfaces/IInsertQueryResult.html +2 -2
  65. package/docs/interfaces/IJWTVerifyOptions.html +2 -2
  66. package/docs/interfaces/IOKPacket.html +2 -2
  67. package/docs/interfaces/IParameterMap.html +1 -1
  68. package/docs/interfaces/IQueryable.html +2 -2
  69. package/docs/interfaces/IRequestResponse.html +2 -2
  70. package/docs/interfaces/ISetSessionVariableQueryInput.html +2 -2
  71. package/docs/interfaces/IStormCLIArgs.html +2 -2
  72. package/docs/interfaces/ITemporaryTableQueryInput.html +2 -2
  73. package/docs/interfaces/IUpdateQueryResult.html +2 -2
  74. package/docs/interfaces/formidable.EmitData.html +2 -2
  75. package/docs/interfaces/formidable.EventData.html +2 -2
  76. package/docs/interfaces/formidable.File.html +9 -9
  77. package/docs/interfaces/formidable.FileJSON.html +7 -7
  78. package/docs/interfaces/formidable.Options.html +16 -16
  79. package/docs/interfaces/formidable.Part.html +17 -17
  80. package/docs/types/IDeleteQueryResult.html +1 -1
  81. package/docs/types/IStoredProcedureResult.html +1 -1
  82. package/docs/types/TCoordinate.html +1 -1
  83. package/docs/types/TSerializableResponse.html +1 -1
  84. package/docs/types/TSupportedResponsePrimitives.html +1 -1
  85. package/docs/types/TSupportedResponseTypes.html +1 -1
  86. package/docs/types/formidable.BufferEncoding.html +1 -1
  87. package/docs/types/formidable.DefaultOptions.html +1 -1
  88. package/docs/types/formidable.EnabledPlugins.html +1 -1
  89. package/docs/types/formidable.EventNames.html +1 -1
  90. package/docs/types/formidable.Fields.html +1 -1
  91. package/docs/types/formidable.Files.html +1 -1
  92. package/docs/types/formidable.MappedParsers.html +1 -1
  93. package/docs/types/formidable.Plugin.html +1 -1
  94. package/docs/types/formidable.PluginFunction.html +1 -1
  95. package/docs/types/formidable.Plugins.html +1 -1
  96. package/docs/variables/formidable.html +1 -1
  97. package/lib/MySQLDatabase.js +5 -1
  98. package/lib/MySQLDatabase.js.map +1 -1
  99. package/lib/private/ConnectionReplicationWaiter.js +3 -5
  100. package/lib/private/ConnectionReplicationWaiter.js.map +1 -1
  101. package/lib/private/GetSlavePositionQuery.d.ts +2 -2
  102. package/lib/private/GetSlavePositionQuery.js +3 -3
  103. package/lib/private/GetSlavePositionQuery.js.map +1 -1
  104. package/package.json +4 -4
  105. package/pnpm-workspace.yaml +6 -0
  106. package/src/MySQLDatabase.ts +8 -1
  107. package/src/private/ConnectionReplicationWaiter.ts +3 -5
  108. package/src/private/GetSlavePositionQuery.ts +5 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breautek/storm",
3
- "version": "9.0.5",
3
+ "version": "9.0.6",
4
4
  "description": "Object-Oriented REST API framework",
5
5
  "main": "lib/api.js",
6
6
  "types": "lib/api.d.ts",
@@ -51,13 +51,13 @@
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.10",
54
+ "@types/node": "24.0.14",
55
55
  "@types/uuid": "10.0.0",
56
56
  "ajv": "8.17.1",
57
57
  "body-parser": "2.2.0",
58
58
  "commander": "14.0.0",
59
59
  "express": "5.1.0",
60
- "form-data": "4.0.3",
60
+ "form-data": "4.0.4",
61
61
  "formidable": "3.5.4",
62
62
  "jsonwebtoken": "9.0.2",
63
63
  "mysql": "2.18.1",
@@ -72,7 +72,7 @@
72
72
  "devDependencies": {
73
73
  "@arashi/interfaces": "1.2.1",
74
74
  "@arashi/logger": "4.1.3",
75
- "@totalpave/eslint-plugin": "7.0.11",
75
+ "@totalpave/eslint-plugin": "7.0.13",
76
76
  "@types/jest": "30.0.0",
77
77
  "@types/ms": "2.1.0",
78
78
  "auto-changelog": "2.5.0",
@@ -0,0 +1,6 @@
1
+ onlyBuiltDependencies:
2
+ - unrs-resolver
3
+
4
+ publicHoistPattern:
5
+ - eslint
6
+
@@ -20,6 +20,7 @@ import * as MySQL from 'mysql';
20
20
  import {getInstance} from './instance';
21
21
  import { IDatabasePosition } from './IDatabasePosition';
22
22
  import { ConnectionReplicationWaiter } from './private/ConnectionReplicationWaiter';
23
+ import { ILogger } from '@arashi/interfaces';
23
24
 
24
25
  const TAG: string = 'MySQLDatabase';
25
26
 
@@ -83,13 +84,19 @@ export class MySQLDatabase extends Database<MySQL.PoolConfig, MySQL.PoolConnecti
83
84
  }
84
85
 
85
86
  protected override async _getConnection(query: string, requireWriteAccess: boolean, position?: IDatabasePosition): Promise<MySQLConnection> {
86
- getInstance().getLogger().trace(TAG, `Querying connection pool for "${query}".`);
87
+ let logger: ILogger = getInstance().getLogger();
88
+ logger.trace(TAG, `Querying connection pool for "${query}".`);
87
89
  let instantationStack: string = new Error().stack;
88
90
 
89
91
  let conn: MySQLConnection = await this.$getConnectionFromPool(query, requireWriteAccess, instantationStack);
90
92
  await conn.__internal_init();
91
93
 
94
+ logger.trace(TAG, `Replication Enabled: ${conn.hasReplicationEnabled() ? 'true' : 'false'}`);
95
+ logger.trace(TAG, `Connection Replicating: ${conn.isReplication() ? 'true' : 'false'}`);
96
+
97
+
92
98
  if (conn.hasReplicationEnabled() && conn.isReplication() && position && position.page && position.position) {
99
+ logger.trace(TAG, 'Connection is waiting on Replication');
93
100
  // master connections will not wait on database positions
94
101
  // they are guarenteed to be at the tip.
95
102
  // readonly, or otherwise known as replication connections
@@ -17,7 +17,6 @@
17
17
 
18
18
  import { IDatabaseConnection } from '../IDatabaseConnection';
19
19
  import { IDatabasePosition } from '../IDatabasePosition';
20
- import { InternalError } from '../InternalError';
21
20
  import { TimeoutError } from '../TimeoutError';
22
21
 
23
22
  export class ConnectionReplicationWaiter {
@@ -74,10 +73,9 @@ export class ConnectionReplicationWaiter {
74
73
 
75
74
  let currentPos: IDatabasePosition = await this.$conn.getCurrentDatabasePosition();
76
75
 
77
- // TODO: I have no idea what my intent is here, but it's obviously wrong
78
- // eslint-disable-next-line no-constant-binary-expression
79
- if (currentPos === null || (currentPos && !currentPos.page === null) || (currentPos && !currentPos.position === null)) {
80
- throw new InternalError('Database Position not supported');
76
+ if (!currentPos) {
77
+ // Replication not supported... just continue
78
+ break;
81
79
  }
82
80
 
83
81
  // If the current page is greater than the target page,
@@ -17,21 +17,21 @@
17
17
  import { GetBinLogPositionQuery } from './GetBinLogPositionQuery';
18
18
 
19
19
  interface IStatus {
20
- Master_Log_File: string;
21
- Read_Master_Log_Pos: string;
20
+ Relay_Source_Log_File: string;
21
+ Exec_Source_Log_Pos: string;
22
22
  }
23
23
 
24
24
  export class GetSlavePositionQuery extends GetBinLogPositionQuery<IStatus> {
25
25
 
26
26
  protected override _getQuery(): string {
27
- return 'SHOW SLAVE STATUS';
27
+ return 'SHOW REPLICA STATUS';
28
28
  }
29
29
 
30
30
  protected override _getFile(row: IStatus): string {
31
- return row.Master_Log_File;
31
+ return row.Relay_Source_Log_File;
32
32
  }
33
33
 
34
34
  protected override _getPosition(row: IStatus): string {
35
- return row.Read_Master_Log_Pos;
35
+ return row.Exec_Source_Log_Pos;
36
36
  }
37
37
  }