@hastehaul/common 1.0.14 → 1.0.17
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/build/errors/bad-request-error.d.ts +24 -2
- package/build/errors/bad-request-error.js +22 -0
- package/build/errors/custom-error.d.ts +24 -0
- package/build/errors/custom-error.js +11 -0
- package/build/errors/database-error.d.ts +24 -2
- package/build/errors/database-error.js +23 -1
- package/build/errors/index.d.ts +25 -0
- package/build/errors/index.js +26 -0
- package/build/errors/not-found-error.d.ts +24 -2
- package/build/errors/not-found-error.js +22 -0
- package/build/errors/system-error.d.ts +25 -2
- package/build/errors/system-error.js +24 -1
- package/build/events/base/base-consumer.d.ts +3 -1
- package/build/events/base/base-publisher.d.ts +1 -1
- package/build/events/base/base-stream.d.ts +1 -1
- package/build/events/base/index.d.ts +21 -0
- package/build/events/base/index.js +38 -0
- package/build/events/common/index.d.ts +14 -0
- package/build/events/common/index.js +31 -0
- package/build/events/common/interfaces/index.d.ts +13 -0
- package/build/events/common/interfaces/index.js +33 -0
- package/build/events/common/interfaces/order-events-interfaces/index.d.ts +18 -0
- package/build/events/common/interfaces/order-events-interfaces/index.js +35 -0
- package/build/events/common/interfaces/order-events-interfaces/order-cancelled-event.d.ts +36 -0
- package/build/events/common/interfaces/order-events-interfaces/order-completed-event.d.ts +36 -0
- package/build/events/common/interfaces/order-events-interfaces/order-requested-event.d.ts +36 -0
- package/build/events/common/interfaces/payment-event-interfaces/index.d.ts +0 -0
- package/build/events/common/interfaces/payment-event-interfaces/index.js +3 -0
- package/build/events/common/interfaces/stream-interfaces/index.d.ts +1 -0
- package/build/events/common/interfaces/stream-interfaces/index.js +18 -0
- package/build/events/common/interfaces/stream-interfaces/order-stream-interface.d.ts +17 -0
- package/build/events/index.d.ts +14 -0
- package/build/events/index.js +31 -0
- package/build/index.d.ts +166 -4
- package/build/index.js +175 -4
- package/build/utils/base_classes/index.d.ts +18 -0
- package/build/utils/base_classes/index.js +19 -0
- package/build/utils/base_classes/jobs/base-producers.js +2 -2
- package/build/utils/base_classes/jobs/base-worker.js +2 -2
- package/build/utils/base_classes/listeners/base-namespace.d.ts +15 -0
- package/build/utils/base_classes/listeners/base-namespace.js +7 -0
- package/build/utils/enums.d.ts +1 -1
- package/build/utils/enums.js +1 -1
- package/build/utils/index.d.ts +18 -0
- package/build/utils/index.js +19 -0
- package/package.json +1 -1
@@ -1,10 +1,32 @@
|
|
1
1
|
import { StatusCodes } from "../utils/enums";
|
2
2
|
import { CustomError } from "./custom-error";
|
3
|
+
/**
|
4
|
+
* Class representing a "Bad Request" error.
|
5
|
+
*
|
6
|
+
* This error class extends the `CustomError` abstract class and provides specific error details for a "Bad Request" scenario.
|
7
|
+
* Instances of this class are thrown when the client's request is malformed or contains invalid data.
|
8
|
+
*/
|
3
9
|
export declare class BadRequestError extends CustomError {
|
4
10
|
message: string;
|
11
|
+
/**
|
12
|
+
* The HTTP status code associated with the "Bad Request" error (400).
|
13
|
+
*/
|
5
14
|
statusCode: StatusCodes;
|
15
|
+
/**
|
16
|
+
* Constructs a new instance of the "Bad Request" error.
|
17
|
+
*
|
18
|
+
* @param {string} message - The error message providing details about the "Bad Request" error.
|
19
|
+
*/
|
6
20
|
constructor(message: string);
|
7
|
-
|
21
|
+
/**
|
22
|
+
* Method to serialize the "Bad Request" error details into an array of error objects.
|
23
|
+
*
|
24
|
+
* This method returns an array containing a single error object with the error message provided during construction.
|
25
|
+
* The array format is consistent with the `CustomError` class's expectation for error serialization.
|
26
|
+
*
|
27
|
+
* @returns {Array<{ message: string }>} - An array containing a single error object with the error message.
|
28
|
+
*/
|
29
|
+
serializeErrors(): Array<{
|
8
30
|
message: string;
|
9
|
-
}
|
31
|
+
}>;
|
10
32
|
}
|
@@ -3,13 +3,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BadRequestError = void 0;
|
4
4
|
const enums_1 = require("../utils/enums");
|
5
5
|
const custom_error_1 = require("./custom-error");
|
6
|
+
/**
|
7
|
+
* Class representing a "Bad Request" error.
|
8
|
+
*
|
9
|
+
* This error class extends the `CustomError` abstract class and provides specific error details for a "Bad Request" scenario.
|
10
|
+
* Instances of this class are thrown when the client's request is malformed or contains invalid data.
|
11
|
+
*/
|
6
12
|
class BadRequestError extends custom_error_1.CustomError {
|
13
|
+
/**
|
14
|
+
* Constructs a new instance of the "Bad Request" error.
|
15
|
+
*
|
16
|
+
* @param {string} message - The error message providing details about the "Bad Request" error.
|
17
|
+
*/
|
7
18
|
constructor(message) {
|
8
19
|
super(message);
|
9
20
|
this.message = message;
|
21
|
+
/**
|
22
|
+
* The HTTP status code associated with the "Bad Request" error (400).
|
23
|
+
*/
|
10
24
|
this.statusCode = enums_1.StatusCodes.BAD_REQUEST;
|
11
25
|
Object.setPrototypeOf(this, BadRequestError.prototype);
|
12
26
|
}
|
27
|
+
/**
|
28
|
+
* Method to serialize the "Bad Request" error details into an array of error objects.
|
29
|
+
*
|
30
|
+
* This method returns an array containing a single error object with the error message provided during construction.
|
31
|
+
* The array format is consistent with the `CustomError` class's expectation for error serialization.
|
32
|
+
*
|
33
|
+
* @returns {Array<{ message: string }>} - An array containing a single error object with the error message.
|
34
|
+
*/
|
13
35
|
serializeErrors() {
|
14
36
|
return [{ message: this.message }];
|
15
37
|
}
|
@@ -1,6 +1,30 @@
|
|
1
|
+
/**
|
2
|
+
* Abstract class representing a custom error.
|
3
|
+
*
|
4
|
+
* This abstract class extends the base Error class and serves as a foundation for creating specific error classes for different types of errors.
|
5
|
+
* Classes that extend this abstract class must implement the `statusCode` property and the `serializeErrors` method.
|
6
|
+
*/
|
1
7
|
export declare abstract class CustomError extends Error {
|
8
|
+
/**
|
9
|
+
* The HTTP status code associated with the error.
|
10
|
+
*
|
11
|
+
* Classes extending `CustomError` must provide a value for this property.
|
12
|
+
*/
|
2
13
|
abstract statusCode: number;
|
14
|
+
/**
|
15
|
+
* Constructs a new instance of the custom error.
|
16
|
+
*
|
17
|
+
* @param {string} message - The error message.
|
18
|
+
*/
|
3
19
|
constructor(message?: string);
|
20
|
+
/**
|
21
|
+
* Abstract method that must be implemented in classes extending `CustomError`.
|
22
|
+
*
|
23
|
+
* This method returns an array of error objects containing error messages and optional field information.
|
24
|
+
* The specific implementation of this method depends on the type of custom error and how errors are serialized for responses.
|
25
|
+
*
|
26
|
+
* @returns {Array<{ message: string; field?: string }>} - An array of error objects containing error messages and optional field information.
|
27
|
+
*/
|
4
28
|
abstract serializeErrors(): {
|
5
29
|
message: string;
|
6
30
|
field?: string;
|
@@ -1,7 +1,18 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.CustomError = void 0;
|
4
|
+
/**
|
5
|
+
* Abstract class representing a custom error.
|
6
|
+
*
|
7
|
+
* This abstract class extends the base Error class and serves as a foundation for creating specific error classes for different types of errors.
|
8
|
+
* Classes that extend this abstract class must implement the `statusCode` property and the `serializeErrors` method.
|
9
|
+
*/
|
4
10
|
class CustomError extends Error {
|
11
|
+
/**
|
12
|
+
* Constructs a new instance of the custom error.
|
13
|
+
*
|
14
|
+
* @param {string} message - The error message.
|
15
|
+
*/
|
5
16
|
constructor(message) {
|
6
17
|
super(message);
|
7
18
|
Object.setPrototypeOf(this, CustomError.prototype);
|
@@ -1,9 +1,31 @@
|
|
1
1
|
import { StatusCodes } from '../utils/enums';
|
2
2
|
import { CustomError } from './custom-error';
|
3
|
+
/**
|
4
|
+
* Class representing a database-related error.
|
5
|
+
*
|
6
|
+
* This error class extends the `CustomError` abstract class and provides specific error details for database-related errors.
|
7
|
+
* Instances of this class are thrown when there are errors related to connecting to or interacting with the database.
|
8
|
+
*/
|
3
9
|
export declare class DatabaseError extends CustomError {
|
10
|
+
/**
|
11
|
+
* The HTTP status code associated with the database-related error (500 - Internal Server Error).
|
12
|
+
*/
|
4
13
|
statusCode: StatusCodes;
|
14
|
+
/**
|
15
|
+
* Constructs a new instance of the database-related error.
|
16
|
+
*
|
17
|
+
* @param {string} message - The error message providing details about the database-related error.
|
18
|
+
*/
|
5
19
|
constructor(message?: string);
|
6
|
-
|
20
|
+
/**
|
21
|
+
* Method to serialize the database-related error details into an array of error objects.
|
22
|
+
*
|
23
|
+
* This method returns an array containing a single error object with the error message provided during construction.
|
24
|
+
* The array format is consistent with the `CustomError` class's expectation for error serialization.
|
25
|
+
*
|
26
|
+
* @returns {Array<{ message: string }>} - An array containing a single error object with the error message.
|
27
|
+
*/
|
28
|
+
serializeErrors: () => Array<{
|
7
29
|
message: string;
|
8
|
-
}
|
30
|
+
}>;
|
9
31
|
}
|
@@ -3,10 +3,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DatabaseError = void 0;
|
4
4
|
const enums_1 = require("../utils/enums");
|
5
5
|
const custom_error_1 = require("./custom-error");
|
6
|
+
/**
|
7
|
+
* Class representing a database-related error.
|
8
|
+
*
|
9
|
+
* This error class extends the `CustomError` abstract class and provides specific error details for database-related errors.
|
10
|
+
* Instances of this class are thrown when there are errors related to connecting to or interacting with the database.
|
11
|
+
*/
|
6
12
|
class DatabaseError extends custom_error_1.CustomError {
|
13
|
+
/**
|
14
|
+
* Constructs a new instance of the database-related error.
|
15
|
+
*
|
16
|
+
* @param {string} message - The error message providing details about the database-related error.
|
17
|
+
*/
|
7
18
|
constructor(message = "Error connecting to database") {
|
8
19
|
super(message);
|
9
|
-
|
20
|
+
/**
|
21
|
+
* The HTTP status code associated with the database-related error (500 - Internal Server Error).
|
22
|
+
*/
|
23
|
+
this.statusCode = enums_1.StatusCodes.INTERNAL_SERVER_ERROR;
|
24
|
+
/**
|
25
|
+
* Method to serialize the database-related error details into an array of error objects.
|
26
|
+
*
|
27
|
+
* This method returns an array containing a single error object with the error message provided during construction.
|
28
|
+
* The array format is consistent with the `CustomError` class's expectation for error serialization.
|
29
|
+
*
|
30
|
+
* @returns {Array<{ message: string }>} - An array containing a single error object with the error message.
|
31
|
+
*/
|
10
32
|
this.serializeErrors = () => [{ message: this.message }];
|
11
33
|
Object.setPrototypeOf(this, DatabaseError.prototype);
|
12
34
|
}
|
package/build/errors/index.d.ts
CHANGED
@@ -1,5 +1,30 @@
|
|
1
|
+
/**
|
2
|
+
* Re-exports the "BadRequestError" class from the "bad-request-error" file.
|
3
|
+
*
|
4
|
+
* The "BadRequestError" class represents a specific "Bad Request" error and is used to handle client requests with invalid or malformed data.
|
5
|
+
*/
|
1
6
|
export * from "./bad-request-error";
|
7
|
+
/**
|
8
|
+
* Re-exports the "CustomError" abstract class from the "custom-error" file.
|
9
|
+
*
|
10
|
+
* The "CustomError" abstract class serves as the foundation for creating specific error classes for different types of errors.
|
11
|
+
*/
|
2
12
|
export * from "./custom-error";
|
13
|
+
/**
|
14
|
+
* Re-exports the "DatabaseError" class from the "database-error" file.
|
15
|
+
*
|
16
|
+
* The "DatabaseError" class represents a specific error related to database operations or connectivity issues.
|
17
|
+
*/
|
3
18
|
export * from "./database-error";
|
19
|
+
/**
|
20
|
+
* Re-exports the "NotFoundError" class from the "not-found-error" file.
|
21
|
+
*
|
22
|
+
* The "NotFoundError" class represents a specific "Not Found" error and is used when a requested resource is not found.
|
23
|
+
*/
|
4
24
|
export * from "./not-found-error";
|
25
|
+
/**
|
26
|
+
* Re-exports the "SystemError" class from the "system-error" file.
|
27
|
+
*
|
28
|
+
* The "SystemError" class represents a specific "System Error" that can occur due to unexpected issues in the system.
|
29
|
+
*/
|
5
30
|
export * from "./system-error";
|
package/build/errors/index.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
"use strict";
|
2
|
+
// Import and re-export custom error classes for easier access.
|
2
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
4
|
if (k2 === undefined) k2 = k;
|
4
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
@@ -14,8 +15,33 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
15
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
16
|
};
|
16
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
+
/**
|
19
|
+
* Re-exports the "BadRequestError" class from the "bad-request-error" file.
|
20
|
+
*
|
21
|
+
* The "BadRequestError" class represents a specific "Bad Request" error and is used to handle client requests with invalid or malformed data.
|
22
|
+
*/
|
17
23
|
__exportStar(require("./bad-request-error"), exports);
|
24
|
+
/**
|
25
|
+
* Re-exports the "CustomError" abstract class from the "custom-error" file.
|
26
|
+
*
|
27
|
+
* The "CustomError" abstract class serves as the foundation for creating specific error classes for different types of errors.
|
28
|
+
*/
|
18
29
|
__exportStar(require("./custom-error"), exports);
|
30
|
+
/**
|
31
|
+
* Re-exports the "DatabaseError" class from the "database-error" file.
|
32
|
+
*
|
33
|
+
* The "DatabaseError" class represents a specific error related to database operations or connectivity issues.
|
34
|
+
*/
|
19
35
|
__exportStar(require("./database-error"), exports);
|
36
|
+
/**
|
37
|
+
* Re-exports the "NotFoundError" class from the "not-found-error" file.
|
38
|
+
*
|
39
|
+
* The "NotFoundError" class represents a specific "Not Found" error and is used when a requested resource is not found.
|
40
|
+
*/
|
20
41
|
__exportStar(require("./not-found-error"), exports);
|
42
|
+
/**
|
43
|
+
* Re-exports the "SystemError" class from the "system-error" file.
|
44
|
+
*
|
45
|
+
* The "SystemError" class represents a specific "System Error" that can occur due to unexpected issues in the system.
|
46
|
+
*/
|
21
47
|
__exportStar(require("./system-error"), exports);
|
@@ -1,9 +1,31 @@
|
|
1
1
|
import { StatusCodes } from "../utils/enums";
|
2
2
|
import { CustomError } from "./custom-error";
|
3
|
+
/**
|
4
|
+
* Class representing a "Not Found" error.
|
5
|
+
*
|
6
|
+
* This error class extends the `CustomError` abstract class and provides specific error details for a "Not Found" scenario.
|
7
|
+
* Instances of this class are thrown when a requested resource is not found.
|
8
|
+
*/
|
3
9
|
export declare class NotFoundError extends CustomError {
|
10
|
+
/**
|
11
|
+
* The HTTP status code associated with the "Not Found" error (404).
|
12
|
+
*/
|
4
13
|
statusCode: StatusCodes;
|
14
|
+
/**
|
15
|
+
* Constructs a new instance of the "Not Found" error.
|
16
|
+
*
|
17
|
+
* @param {string} message - The error message providing details about the "Not Found" error.
|
18
|
+
*/
|
5
19
|
constructor(message: string);
|
6
|
-
|
20
|
+
/**
|
21
|
+
* Method to serialize the "Not Found" error details into an array of error objects.
|
22
|
+
*
|
23
|
+
* This method returns an array containing a single error object with the error message provided during construction.
|
24
|
+
* The array format is consistent with the `CustomError` class's expectation for error serialization.
|
25
|
+
*
|
26
|
+
* @returns {Array<{ message: string }>} - An array containing a single error object with the error message.
|
27
|
+
*/
|
28
|
+
serializeErrors: () => Array<{
|
7
29
|
message: string;
|
8
|
-
}
|
30
|
+
}>;
|
9
31
|
}
|
@@ -3,10 +3,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NotFoundError = void 0;
|
4
4
|
const enums_1 = require("../utils/enums");
|
5
5
|
const custom_error_1 = require("./custom-error");
|
6
|
+
/**
|
7
|
+
* Class representing a "Not Found" error.
|
8
|
+
*
|
9
|
+
* This error class extends the `CustomError` abstract class and provides specific error details for a "Not Found" scenario.
|
10
|
+
* Instances of this class are thrown when a requested resource is not found.
|
11
|
+
*/
|
6
12
|
class NotFoundError extends custom_error_1.CustomError {
|
13
|
+
/**
|
14
|
+
* Constructs a new instance of the "Not Found" error.
|
15
|
+
*
|
16
|
+
* @param {string} message - The error message providing details about the "Not Found" error.
|
17
|
+
*/
|
7
18
|
constructor(message) {
|
8
19
|
super(message);
|
20
|
+
/**
|
21
|
+
* The HTTP status code associated with the "Not Found" error (404).
|
22
|
+
*/
|
9
23
|
this.statusCode = enums_1.StatusCodes.NOT_FOUND;
|
24
|
+
/**
|
25
|
+
* Method to serialize the "Not Found" error details into an array of error objects.
|
26
|
+
*
|
27
|
+
* This method returns an array containing a single error object with the error message provided during construction.
|
28
|
+
* The array format is consistent with the `CustomError` class's expectation for error serialization.
|
29
|
+
*
|
30
|
+
* @returns {Array<{ message: string }>} - An array containing a single error object with the error message.
|
31
|
+
*/
|
10
32
|
this.serializeErrors = () => [{ message: this.message }];
|
11
33
|
Object.setPrototypeOf(this, NotFoundError.prototype);
|
12
34
|
}
|
@@ -1,9 +1,32 @@
|
|
1
1
|
import { StatusCodes } from "../utils/enums";
|
2
2
|
import { CustomError } from "./custom-error";
|
3
|
+
/**
|
4
|
+
* Class representing a "System Error".
|
5
|
+
*
|
6
|
+
* This error class extends the `CustomError` abstract class and provides specific error details for a "System Error".
|
7
|
+
* Instances of this class are thrown when there are unexpected issues in the system.
|
8
|
+
*/
|
3
9
|
export declare class SystemError extends CustomError {
|
10
|
+
/**
|
11
|
+
* The HTTP status code associated with the "System Error" (500 - Internal Server Error).
|
12
|
+
*/
|
4
13
|
statusCode: StatusCodes;
|
14
|
+
/**
|
15
|
+
* Constructs a new instance of the "System Error".
|
16
|
+
*
|
17
|
+
* @param {string} message - The error message providing details about the "System Error".
|
18
|
+
* If no message is provided, the default message "Something went wrong" is used.
|
19
|
+
*/
|
5
20
|
constructor(message?: string);
|
6
|
-
|
21
|
+
/**
|
22
|
+
* Method to serialize the "System Error" details into an array of error objects.
|
23
|
+
*
|
24
|
+
* This method returns an array containing a single error object with the error message provided during construction.
|
25
|
+
* The array format is consistent with the `CustomError` class's expectation for error serialization.
|
26
|
+
*
|
27
|
+
* @returns {Array<{ message: string }>} - An array containing a single error object with the error message.
|
28
|
+
*/
|
29
|
+
serializeErrors: () => Array<{
|
7
30
|
message: string;
|
8
|
-
}
|
31
|
+
}>;
|
9
32
|
}
|
@@ -3,10 +3,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SystemError = void 0;
|
4
4
|
const enums_1 = require("../utils/enums");
|
5
5
|
const custom_error_1 = require("./custom-error");
|
6
|
+
/**
|
7
|
+
* Class representing a "System Error".
|
8
|
+
*
|
9
|
+
* This error class extends the `CustomError` abstract class and provides specific error details for a "System Error".
|
10
|
+
* Instances of this class are thrown when there are unexpected issues in the system.
|
11
|
+
*/
|
6
12
|
class SystemError extends custom_error_1.CustomError {
|
13
|
+
/**
|
14
|
+
* Constructs a new instance of the "System Error".
|
15
|
+
*
|
16
|
+
* @param {string} message - The error message providing details about the "System Error".
|
17
|
+
* If no message is provided, the default message "Something went wrong" is used.
|
18
|
+
*/
|
7
19
|
constructor(message = "Something went wrong") {
|
8
20
|
super(message);
|
9
|
-
|
21
|
+
/**
|
22
|
+
* The HTTP status code associated with the "System Error" (500 - Internal Server Error).
|
23
|
+
*/
|
24
|
+
this.statusCode = enums_1.StatusCodes.INTERNAL_SERVER_ERROR;
|
25
|
+
/**
|
26
|
+
* Method to serialize the "System Error" details into an array of error objects.
|
27
|
+
*
|
28
|
+
* This method returns an array containing a single error object with the error message provided during construction.
|
29
|
+
* The array format is consistent with the `CustomError` class's expectation for error serialization.
|
30
|
+
*
|
31
|
+
* @returns {Array<{ message: string }>} - An array containing a single error object with the error message.
|
32
|
+
*/
|
10
33
|
this.serializeErrors = () => [{ message: this.message }];
|
11
34
|
Object.setPrototypeOf(this, SystemError.prototype);
|
12
35
|
}
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { NatsConnection, ConsumerConfig, JsMsg } from "nats";
|
2
|
-
import { DurableName, Subjects, Streams } from "../common/enums";
|
3
2
|
import { MainSubjects, ValidateSubjectFormat } from "../common/enums/subjects/main-subjects";
|
3
|
+
import { Subjects } from '../common/enums/subjects';
|
4
|
+
import { DurableName } from '../common/enums/durable-names';
|
5
|
+
import { Streams } from '../common/enums/streams';
|
4
6
|
/**
|
5
7
|
* Interface representing an event published to NATS.
|
6
8
|
*/
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { PubAck, NatsConnection } from "nats";
|
2
|
-
import { Subjects } from "../common/enums";
|
3
2
|
import { MainSubjects, ValidateSubjectFormat } from "../common/enums/subjects/main-subjects";
|
3
|
+
import { Subjects } from '../common/enums/subjects';
|
4
4
|
/**
|
5
5
|
* Interface representing an event to be published to NATS.
|
6
6
|
*/
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { NatsConnection } from "nats";
|
2
|
-
import { Streams } from "../common/enums";
|
3
2
|
import { MainSubjects } from "../common/enums/subjects/main-subjects";
|
3
|
+
import { Streams } from '../common/enums/streams';
|
4
4
|
/**
|
5
5
|
* Interface representing an event to be used with NATS streams.
|
6
6
|
*/
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/**
|
2
|
+
* Re-exports the "BaseConsumer" class from the "base-consumer" file.
|
3
|
+
*
|
4
|
+
* The "BaseConsumer" class serves as a base class for implementing event consumers.
|
5
|
+
* It provides common functionality and methods that can be extended by specific consumer implementations.
|
6
|
+
*/
|
7
|
+
export * from "./base-consumer";
|
8
|
+
/**
|
9
|
+
* Re-exports the "BasePublisher" class from the "base-publisher" file.
|
10
|
+
*
|
11
|
+
* The "BasePublisher" class serves as a base class for implementing event publishers.
|
12
|
+
* It provides common functionality and methods that can be extended by specific publisher implementations.
|
13
|
+
*/
|
14
|
+
export * from "./base-publisher";
|
15
|
+
/**
|
16
|
+
* Re-exports the "BaseStream" class from the "base-stream" file.
|
17
|
+
*
|
18
|
+
* The "BaseStream" class serves as a base class for implementing event streams.
|
19
|
+
* It provides common functionality and methods that can be extended by specific stream implementations.
|
20
|
+
*/
|
21
|
+
export * from "./base-stream";
|
@@ -0,0 +1,38 @@
|
|
1
|
+
"use strict";
|
2
|
+
// Import and re-export base classes for consumers, publishers, and streams.
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
4
|
+
if (k2 === undefined) k2 = k;
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
8
|
+
}
|
9
|
+
Object.defineProperty(o, k2, desc);
|
10
|
+
}) : (function(o, m, k, k2) {
|
11
|
+
if (k2 === undefined) k2 = k;
|
12
|
+
o[k2] = m[k];
|
13
|
+
}));
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
16
|
+
};
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
+
/**
|
19
|
+
* Re-exports the "BaseConsumer" class from the "base-consumer" file.
|
20
|
+
*
|
21
|
+
* The "BaseConsumer" class serves as a base class for implementing event consumers.
|
22
|
+
* It provides common functionality and methods that can be extended by specific consumer implementations.
|
23
|
+
*/
|
24
|
+
__exportStar(require("./base-consumer"), exports);
|
25
|
+
/**
|
26
|
+
* Re-exports the "BasePublisher" class from the "base-publisher" file.
|
27
|
+
*
|
28
|
+
* The "BasePublisher" class serves as a base class for implementing event publishers.
|
29
|
+
* It provides common functionality and methods that can be extended by specific publisher implementations.
|
30
|
+
*/
|
31
|
+
__exportStar(require("./base-publisher"), exports);
|
32
|
+
/**
|
33
|
+
* Re-exports the "BaseStream" class from the "base-stream" file.
|
34
|
+
*
|
35
|
+
* The "BaseStream" class serves as a base class for implementing event streams.
|
36
|
+
* It provides common functionality and methods that can be extended by specific stream implementations.
|
37
|
+
*/
|
38
|
+
__exportStar(require("./base-stream"), exports);
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* Re-exports all the enums from the "enums" module.
|
3
|
+
*
|
4
|
+
* The "enums" module contains various enumerations used in the application.
|
5
|
+
* Enumerations are used to define named constant values, such as status codes, subject names, or stream names.
|
6
|
+
*/
|
7
|
+
export * from "./enums";
|
8
|
+
/**
|
9
|
+
* Re-exports all the interfaces from the "interfaces" module.
|
10
|
+
*
|
11
|
+
* The "interfaces" module contains various interfaces used in the application to define data structures and contracts.
|
12
|
+
* Interfaces are used to describe the shape of objects and provide a common structure for communication between different parts of the application.
|
13
|
+
*/
|
14
|
+
export * from "./interfaces";
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
// Import and re-export multiple modules related to enums and interfaces.
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
4
|
+
if (k2 === undefined) k2 = k;
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
8
|
+
}
|
9
|
+
Object.defineProperty(o, k2, desc);
|
10
|
+
}) : (function(o, m, k, k2) {
|
11
|
+
if (k2 === undefined) k2 = k;
|
12
|
+
o[k2] = m[k];
|
13
|
+
}));
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
16
|
+
};
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
+
/**
|
19
|
+
* Re-exports all the enums from the "enums" module.
|
20
|
+
*
|
21
|
+
* The "enums" module contains various enumerations used in the application.
|
22
|
+
* Enumerations are used to define named constant values, such as status codes, subject names, or stream names.
|
23
|
+
*/
|
24
|
+
__exportStar(require("./enums"), exports);
|
25
|
+
/**
|
26
|
+
* Re-exports all the interfaces from the "interfaces" module.
|
27
|
+
*
|
28
|
+
* The "interfaces" module contains various interfaces used in the application to define data structures and contracts.
|
29
|
+
* Interfaces are used to describe the shape of objects and provide a common structure for communication between different parts of the application.
|
30
|
+
*/
|
31
|
+
__exportStar(require("./interfaces"), exports);
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* Re-exports all the interfaces related to order events from the "order-events-interfaces" file.
|
3
|
+
*
|
4
|
+
* The "order-events-interfaces" file contains interfaces for various order-related events such as order requested, order cancelled, and order completed.
|
5
|
+
*/
|
6
|
+
export * from "./order-events-interfaces";
|
7
|
+
/**
|
8
|
+
* Re-exports all the interfaces related to streams from the "stream-interfaces" file.
|
9
|
+
*
|
10
|
+
* The "stream-interfaces" file contains interfaces for various streams used in the application.
|
11
|
+
* For example, "OrderStreamEvent" represents an event associated with the "Order" stream.
|
12
|
+
*/
|
13
|
+
export * from "./stream-interfaces";
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
// Import and re-export multiple interfaces related to different events and streams.
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
4
|
+
if (k2 === undefined) k2 = k;
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
8
|
+
}
|
9
|
+
Object.defineProperty(o, k2, desc);
|
10
|
+
}) : (function(o, m, k, k2) {
|
11
|
+
if (k2 === undefined) k2 = k;
|
12
|
+
o[k2] = m[k];
|
13
|
+
}));
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
16
|
+
};
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
+
/**
|
19
|
+
* Re-exports all the interfaces related to order events from the "order-events-interfaces" file.
|
20
|
+
*
|
21
|
+
* The "order-events-interfaces" file contains interfaces for various order-related events such as order requested, order cancelled, and order completed.
|
22
|
+
*/
|
23
|
+
__exportStar(require("./order-events-interfaces"), exports);
|
24
|
+
// Interfaces related to payment events are currently commented out using '//'.
|
25
|
+
// If needed, uncomment the following line to re-export the payment event interfaces.
|
26
|
+
// export * from "./payment-event-interfaces";
|
27
|
+
/**
|
28
|
+
* Re-exports all the interfaces related to streams from the "stream-interfaces" file.
|
29
|
+
*
|
30
|
+
* The "stream-interfaces" file contains interfaces for various streams used in the application.
|
31
|
+
* For example, "OrderStreamEvent" represents an event associated with the "Order" stream.
|
32
|
+
*/
|
33
|
+
__exportStar(require("./stream-interfaces"), exports);
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* Re-exports the "OrderCancelledEvent" class from the "order-cancelled-event" file.
|
3
|
+
*
|
4
|
+
* The "OrderCancelledEvent" class represents an event related to the cancellation of an order.
|
5
|
+
*/
|
6
|
+
export * from "./order-cancelled-event";
|
7
|
+
/**
|
8
|
+
* Re-exports the "OrderCompletedEvent" class from the "order-completed-event" file.
|
9
|
+
*
|
10
|
+
* The "OrderCompletedEvent" class represents an event related to the completion of an order.
|
11
|
+
*/
|
12
|
+
export * from "./order-completed-event";
|
13
|
+
/**
|
14
|
+
* Re-exports the "OrderRequestedEvent" class from the "order-requested-event" file.
|
15
|
+
*
|
16
|
+
* The "OrderRequestedEvent" class represents an event related to a request for an order.
|
17
|
+
*/
|
18
|
+
export * from "./order-requested-event";
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
// Import and re-export event classes for easier access.
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
4
|
+
if (k2 === undefined) k2 = k;
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
8
|
+
}
|
9
|
+
Object.defineProperty(o, k2, desc);
|
10
|
+
}) : (function(o, m, k, k2) {
|
11
|
+
if (k2 === undefined) k2 = k;
|
12
|
+
o[k2] = m[k];
|
13
|
+
}));
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
16
|
+
};
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
+
/**
|
19
|
+
* Re-exports the "OrderCancelledEvent" class from the "order-cancelled-event" file.
|
20
|
+
*
|
21
|
+
* The "OrderCancelledEvent" class represents an event related to the cancellation of an order.
|
22
|
+
*/
|
23
|
+
__exportStar(require("./order-cancelled-event"), exports);
|
24
|
+
/**
|
25
|
+
* Re-exports the "OrderCompletedEvent" class from the "order-completed-event" file.
|
26
|
+
*
|
27
|
+
* The "OrderCompletedEvent" class represents an event related to the completion of an order.
|
28
|
+
*/
|
29
|
+
__exportStar(require("./order-completed-event"), exports);
|
30
|
+
/**
|
31
|
+
* Re-exports the "OrderRequestedEvent" class from the "order-requested-event" file.
|
32
|
+
*
|
33
|
+
* The "OrderRequestedEvent" class represents an event related to a request for an order.
|
34
|
+
*/
|
35
|
+
__exportStar(require("./order-requested-event"), exports);
|