@geniehr/utilities 1.0.6 → 1.0.8

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.
@@ -4,6 +4,7 @@ interface RabbitMQCredentials {
4
4
  port: string | number;
5
5
  user: string;
6
6
  password: string;
7
+ protocol?: 'amqp' | 'amqps';
7
8
  }
8
9
  interface DLQOptions {
9
10
  dlqName: string;
package/dist/mq/client.js CHANGED
@@ -12,9 +12,9 @@ export class MQClient {
12
12
  * @param creds - RabbitMQ connection credentials.
13
13
  */
14
14
  async init(creds) {
15
- const { host, port, user, password } = creds;
15
+ const { host, port, user, password, protocol } = creds;
16
16
  // Construct the connection string for AMQPS (secure AMQP).
17
- const connStr = `amqps://${user}:${password}@${host}:${port}`;
17
+ const connStr = `${protocol || 'amqps'}://${user}:${password}@${host}:${port}`;
18
18
  try {
19
19
  // Connect to RabbitMQ.
20
20
  const rawConn = await amqp.connect(connStr);
@@ -1,13 +1,13 @@
1
1
  export declare class AppException extends Error {
2
2
  errorCode?: string | undefined;
3
- details?: any;
4
- constructor(message: string, errorCode?: string | undefined, details?: any);
3
+ details?: any | undefined;
4
+ constructor(message: string, errorCode?: string | undefined, details?: any | undefined);
5
5
  }
6
6
  export declare class InvalidEnvironmentException extends Error {
7
7
  constructor();
8
8
  }
9
9
  export declare class InvalidRequestException extends Error {
10
10
  errorCode?: string | undefined;
11
- details?: any;
12
- constructor(message: string[] | string, errorCode?: string | undefined, details?: any);
11
+ details?: any | undefined;
12
+ constructor(message: string[] | string, errorCode?: string | undefined, details?: any | undefined);
13
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geniehr/utilities",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/Genie-HR/ghr-utilities#readme",
6
6
  "bugs": {
@@ -24,7 +24,8 @@
24
24
  "scripts": {
25
25
  "build": "tsc",
26
26
  "watch": "tsc -p tsconfig.json --watch",
27
- "prepare": "test $HUSKY_SKIP != 'true' && husky install || echo 'Skipping husky install'"
27
+ "prepare": "test $HUSKY_SKIP != 'true' && husky install || echo 'Skipping husky install'",
28
+ "prepublishOnly": "npm run build"
28
29
  },
29
30
  "dependencies": {
30
31
  "@aws-sdk/client-cognito-identity-provider": "^3.859.0",