@digitraffic/common 2023.9.14-1 → 2023.10.11-1
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/README.md +7 -0
- package/dist/aws/infra/sqs-queue.js +1 -1
- package/dist/aws/runtime/dt-logger-default.d.ts +4 -0
- package/dist/aws/runtime/dt-logger.d.ts +2 -1
- package/dist/utils/retry.js +2 -0
- package/package.json +1 -1
- package/src/aws/infra/sqs-queue.ts +1 -1
- package/src/aws/runtime/dt-logger-default.ts +5 -0
- package/src/aws/runtime/dt-logger.ts +2 -1
- package/src/utils/retry.ts +2 -0
package/README.md
CHANGED
@@ -48,7 +48,7 @@ class DigitrafficDLQueue {
|
|
48
48
|
});
|
49
49
|
const dlqFunctionName = `${dlqName}-Function`;
|
50
50
|
const lambda = monitoredfunction_1.MonitoredFunction.create(stack, dlqFunctionName, {
|
51
|
-
runtime: aws_lambda_1.Runtime.
|
51
|
+
runtime: aws_lambda_1.Runtime.NODEJS_16_X,
|
52
52
|
logRetention: aws_logs_1.RetentionDays.ONE_YEAR,
|
53
53
|
functionName: dlqFunctionName,
|
54
54
|
code: getDlqCode(dlqBucket.bucketName),
|
@@ -1,4 +1,8 @@
|
|
1
1
|
import { DtLogger } from "./dt-logger";
|
2
|
+
/**
|
3
|
+
* You can use this for method name definition to match DtLogger LoggableType.method parameter.
|
4
|
+
*/
|
5
|
+
export type { LoggerMethodType } from "./dt-logger";
|
2
6
|
/**
|
3
7
|
* You can use this for your logging needs or create one locally and configure it as you wish.
|
4
8
|
*/
|
@@ -2,6 +2,7 @@
|
|
2
2
|
import { Writable } from "stream";
|
3
3
|
/** Logging level */
|
4
4
|
export type LOG_LEVEL = "DEBUG" | "INFO" | "WARN" | "ERROR";
|
5
|
+
export type LoggerMethodType = `${string}.${string}`;
|
5
6
|
/**
|
6
7
|
* Configuration object for configuring the Digitraffic logging utility
|
7
8
|
* @see {@link DtLogger}
|
@@ -39,7 +40,7 @@ export interface CustomParams {
|
|
39
40
|
*/
|
40
41
|
export interface LoggableType extends CustomParams {
|
41
42
|
/** Name of the method logging the message */
|
42
|
-
method:
|
43
|
+
method: LoggerMethodType;
|
43
44
|
/** Message to log, optional */
|
44
45
|
message?: string;
|
45
46
|
/** Type of message, optional */
|
package/dist/utils/retry.js
CHANGED
@@ -15,6 +15,7 @@ var RetryLogError;
|
|
15
15
|
*/
|
16
16
|
exports.timeoutFunctions = (function () {
|
17
17
|
return {
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
18
19
|
noTimeout: (retryCount) => {
|
19
20
|
return 0;
|
20
21
|
},
|
@@ -40,6 +41,7 @@ exports.retryPredicates = (function () {
|
|
40
41
|
}
|
41
42
|
return false;
|
42
43
|
},
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
43
45
|
alwaysRetry: (error) => {
|
44
46
|
return true;
|
45
47
|
},
|
package/package.json
CHANGED
@@ -61,7 +61,7 @@ export class DigitrafficDLQueue {
|
|
61
61
|
|
62
62
|
const dlqFunctionName = `${dlqName}-Function`;
|
63
63
|
const lambda = MonitoredFunction.create(stack, dlqFunctionName, {
|
64
|
-
runtime: Runtime.
|
64
|
+
runtime: Runtime.NODEJS_16_X,
|
65
65
|
logRetention: RetentionDays.ONE_YEAR,
|
66
66
|
functionName: dlqFunctionName,
|
67
67
|
code: getDlqCode(dlqBucket.bucketName),
|
@@ -1,5 +1,10 @@
|
|
1
1
|
import { DtLogger } from "./dt-logger";
|
2
2
|
|
3
|
+
/**
|
4
|
+
* You can use this for method name definition to match DtLogger LoggableType.method parameter.
|
5
|
+
*/
|
6
|
+
export type { LoggerMethodType } from "./dt-logger";
|
7
|
+
|
3
8
|
/**
|
4
9
|
* You can use this for your logging needs or create one locally and configure it as you wish.
|
5
10
|
*/
|
@@ -3,6 +3,7 @@ import _ from "lodash";
|
|
3
3
|
|
4
4
|
/** Logging level */
|
5
5
|
export type LOG_LEVEL = "DEBUG" | "INFO" | "WARN" | "ERROR";
|
6
|
+
export type LoggerMethodType = `${string}.${string}`;
|
6
7
|
|
7
8
|
/**
|
8
9
|
* Configuration object for configuring the Digitraffic logging utility
|
@@ -55,7 +56,7 @@ export interface CustomParams {
|
|
55
56
|
*/
|
56
57
|
export interface LoggableType extends CustomParams {
|
57
58
|
/** Name of the method logging the message */
|
58
|
-
method:
|
59
|
+
method: LoggerMethodType;
|
59
60
|
/** Message to log, optional */
|
60
61
|
message?: string;
|
61
62
|
/** Type of message, optional */
|
package/src/utils/retry.ts
CHANGED
@@ -16,6 +16,7 @@ export type RetryPredicate = (error: unknown) => boolean;
|
|
16
16
|
*/
|
17
17
|
export const timeoutFunctions = (function () {
|
18
18
|
return {
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
19
20
|
noTimeout: (retryCount: number): number => {
|
20
21
|
return 0;
|
21
22
|
},
|
@@ -42,6 +43,7 @@ export const retryPredicates = (function () {
|
|
42
43
|
}
|
43
44
|
return false;
|
44
45
|
},
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
45
47
|
alwaysRetry: (error: unknown): boolean => {
|
46
48
|
return true;
|
47
49
|
},
|