@loglayer/transport-new-relic 2.1.6 → 2.1.7

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/dist/index.d.cts CHANGED
@@ -1,46 +1,48 @@
1
- import { LoggerlessTransportConfig, LoggerlessTransport, LogLayerTransportParams } from '@loglayer/transport';
1
+ import { LogLayerTransportParams, LoggerlessTransport, LoggerlessTransportConfig } from "@loglayer/transport";
2
+
3
+ //#region src/NewRelicTransport.d.ts
2
4
 
3
5
  /**
4
6
  * Configuration options for the New Relic transport.
5
7
  */
6
8
  interface NewRelicTransportConfig extends LoggerlessTransportConfig {
7
- /**
8
- * The New Relic API key
9
- */
10
- apiKey: string;
11
- /**
12
- * The New Relic Log API endpoint
13
- * @default https://log-api.newrelic.com/log/v1
14
- */
15
- endpoint?: string;
16
- /**
17
- * Optional callback for error handling
18
- */
19
- onError?: (err: Error) => void;
20
- /**
21
- * Optional callback for debugging log entries before they are sent
22
- */
23
- onDebug?: (entry: Record<string, any>) => void;
24
- /**
25
- * Whether to use gzip compression
26
- * @default true
27
- */
28
- useCompression?: boolean;
29
- /**
30
- * Number of retry attempts before giving up
31
- * @default 3
32
- */
33
- maxRetries?: number;
34
- /**
35
- * Base delay between retries in milliseconds
36
- * @default 1000
37
- */
38
- retryDelay?: number;
39
- /**
40
- * Whether to respect rate limiting by waiting when a 429 response is received
41
- * @default true
42
- */
43
- respectRateLimit?: boolean;
9
+ /**
10
+ * The New Relic API key
11
+ */
12
+ apiKey: string;
13
+ /**
14
+ * The New Relic Log API endpoint
15
+ * @default https://log-api.newrelic.com/log/v1
16
+ */
17
+ endpoint?: string;
18
+ /**
19
+ * Optional callback for error handling
20
+ */
21
+ onError?: (err: Error) => void;
22
+ /**
23
+ * Optional callback for debugging log entries before they are sent
24
+ */
25
+ onDebug?: (entry: Record<string, any>) => void;
26
+ /**
27
+ * Whether to use gzip compression
28
+ * @default true
29
+ */
30
+ useCompression?: boolean;
31
+ /**
32
+ * Number of retry attempts before giving up
33
+ * @default 3
34
+ */
35
+ maxRetries?: number;
36
+ /**
37
+ * Base delay between retries in milliseconds
38
+ * @default 1000
39
+ */
40
+ retryDelay?: number;
41
+ /**
42
+ * Whether to respect rate limiting by waiting when a 429 response is received
43
+ * @default true
44
+ */
45
+ respectRateLimit?: boolean;
44
46
  }
45
47
  /**
46
48
  * NewRelicTransport is responsible for sending logs to New Relic's Log API.
@@ -56,49 +58,55 @@ interface NewRelicTransportConfig extends LoggerlessTransportConfig {
56
58
  * - Implements retry logic with exponential backoff
57
59
  */
58
60
  declare class NewRelicTransport extends LoggerlessTransport {
59
- private apiKey;
60
- private endpoint;
61
- private onError?;
62
- private onDebug?;
63
- private useCompression;
64
- private maxRetries;
65
- private retryDelay;
66
- private respectRateLimit;
67
- /**
68
- * Creates a new instance of NewRelicTransport.
69
- *
70
- * @param config - Configuration options for the transport
71
- * @param config.apiKey - New Relic API key for authentication
72
- * @param config.endpoint - Optional custom endpoint URL (defaults to New Relic's Log API endpoint)
73
- * @param config.onError - Optional error callback for handling errors
74
- * @param config.onDebug - Optional callback for debugging log entries before they are sent
75
- * @param config.useCompression - Whether to use gzip compression (defaults to true)
76
- * @param config.maxRetries - Maximum number of retry attempts (defaults to 3)
77
- * @param config.retryDelay - Base delay between retries in milliseconds (defaults to 1000)
78
- * @param config.respectRateLimit - Whether to honor rate limiting headers (defaults to true)
79
- */
80
- constructor(config: NewRelicTransportConfig);
81
- /**
82
- * Processes and ships log entries to New Relic.
83
- *
84
- * This method:
85
- * 1. Validates the message size
86
- * 2. Creates and validates the log entry
87
- * 3. Validates the final payload size
88
- * 4. Asynchronously sends the log entry to New Relic
89
- *
90
- * The actual sending is done asynchronously in a fire-and-forget manner to maintain
91
- * compatibility with the base transport class while still providing retry and error handling.
92
- *
93
- * @param params - Log parameters including level, messages, and metadata
94
- * @param params.logLevel - The severity level of the log
95
- * @param params.messages - Array of message strings to be joined
96
- * @param params.data - Optional metadata to include with the log
97
- * @param params.hasData - Whether metadata is present
98
- * @returns The original messages array
99
- * @throws {ValidationError} If the payload exceeds size limits or validation fails
100
- */
101
- shipToLogger({ logLevel, messages, data, hasData }: LogLayerTransportParams): any[];
61
+ private apiKey;
62
+ private endpoint;
63
+ private onError?;
64
+ private onDebug?;
65
+ private useCompression;
66
+ private maxRetries;
67
+ private retryDelay;
68
+ private respectRateLimit;
69
+ /**
70
+ * Creates a new instance of NewRelicTransport.
71
+ *
72
+ * @param config - Configuration options for the transport
73
+ * @param config.apiKey - New Relic API key for authentication
74
+ * @param config.endpoint - Optional custom endpoint URL (defaults to New Relic's Log API endpoint)
75
+ * @param config.onError - Optional error callback for handling errors
76
+ * @param config.onDebug - Optional callback for debugging log entries before they are sent
77
+ * @param config.useCompression - Whether to use gzip compression (defaults to true)
78
+ * @param config.maxRetries - Maximum number of retry attempts (defaults to 3)
79
+ * @param config.retryDelay - Base delay between retries in milliseconds (defaults to 1000)
80
+ * @param config.respectRateLimit - Whether to honor rate limiting headers (defaults to true)
81
+ */
82
+ constructor(config: NewRelicTransportConfig);
83
+ /**
84
+ * Processes and ships log entries to New Relic.
85
+ *
86
+ * This method:
87
+ * 1. Validates the message size
88
+ * 2. Creates and validates the log entry
89
+ * 3. Validates the final payload size
90
+ * 4. Asynchronously sends the log entry to New Relic
91
+ *
92
+ * The actual sending is done asynchronously in a fire-and-forget manner to maintain
93
+ * compatibility with the base transport class while still providing retry and error handling.
94
+ *
95
+ * @param params - Log parameters including level, messages, and metadata
96
+ * @param params.logLevel - The severity level of the log
97
+ * @param params.messages - Array of message strings to be joined
98
+ * @param params.data - Optional metadata to include with the log
99
+ * @param params.hasData - Whether metadata is present
100
+ * @returns The original messages array
101
+ * @throws {ValidationError} If the payload exceeds size limits or validation fails
102
+ */
103
+ shipToLogger({
104
+ logLevel,
105
+ messages,
106
+ data,
107
+ hasData
108
+ }: LogLayerTransportParams): any[];
102
109
  }
103
-
104
- export { NewRelicTransport, type NewRelicTransportConfig };
110
+ //#endregion
111
+ export { NewRelicTransport, NewRelicTransportConfig };
112
+ //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -1,46 +1,48 @@
1
- import { LoggerlessTransportConfig, LoggerlessTransport, LogLayerTransportParams } from '@loglayer/transport';
1
+ import { LogLayerTransportParams, LoggerlessTransport, LoggerlessTransportConfig } from "@loglayer/transport";
2
+
3
+ //#region src/NewRelicTransport.d.ts
2
4
 
3
5
  /**
4
6
  * Configuration options for the New Relic transport.
5
7
  */
6
8
  interface NewRelicTransportConfig extends LoggerlessTransportConfig {
7
- /**
8
- * The New Relic API key
9
- */
10
- apiKey: string;
11
- /**
12
- * The New Relic Log API endpoint
13
- * @default https://log-api.newrelic.com/log/v1
14
- */
15
- endpoint?: string;
16
- /**
17
- * Optional callback for error handling
18
- */
19
- onError?: (err: Error) => void;
20
- /**
21
- * Optional callback for debugging log entries before they are sent
22
- */
23
- onDebug?: (entry: Record<string, any>) => void;
24
- /**
25
- * Whether to use gzip compression
26
- * @default true
27
- */
28
- useCompression?: boolean;
29
- /**
30
- * Number of retry attempts before giving up
31
- * @default 3
32
- */
33
- maxRetries?: number;
34
- /**
35
- * Base delay between retries in milliseconds
36
- * @default 1000
37
- */
38
- retryDelay?: number;
39
- /**
40
- * Whether to respect rate limiting by waiting when a 429 response is received
41
- * @default true
42
- */
43
- respectRateLimit?: boolean;
9
+ /**
10
+ * The New Relic API key
11
+ */
12
+ apiKey: string;
13
+ /**
14
+ * The New Relic Log API endpoint
15
+ * @default https://log-api.newrelic.com/log/v1
16
+ */
17
+ endpoint?: string;
18
+ /**
19
+ * Optional callback for error handling
20
+ */
21
+ onError?: (err: Error) => void;
22
+ /**
23
+ * Optional callback for debugging log entries before they are sent
24
+ */
25
+ onDebug?: (entry: Record<string, any>) => void;
26
+ /**
27
+ * Whether to use gzip compression
28
+ * @default true
29
+ */
30
+ useCompression?: boolean;
31
+ /**
32
+ * Number of retry attempts before giving up
33
+ * @default 3
34
+ */
35
+ maxRetries?: number;
36
+ /**
37
+ * Base delay between retries in milliseconds
38
+ * @default 1000
39
+ */
40
+ retryDelay?: number;
41
+ /**
42
+ * Whether to respect rate limiting by waiting when a 429 response is received
43
+ * @default true
44
+ */
45
+ respectRateLimit?: boolean;
44
46
  }
45
47
  /**
46
48
  * NewRelicTransport is responsible for sending logs to New Relic's Log API.
@@ -56,49 +58,55 @@ interface NewRelicTransportConfig extends LoggerlessTransportConfig {
56
58
  * - Implements retry logic with exponential backoff
57
59
  */
58
60
  declare class NewRelicTransport extends LoggerlessTransport {
59
- private apiKey;
60
- private endpoint;
61
- private onError?;
62
- private onDebug?;
63
- private useCompression;
64
- private maxRetries;
65
- private retryDelay;
66
- private respectRateLimit;
67
- /**
68
- * Creates a new instance of NewRelicTransport.
69
- *
70
- * @param config - Configuration options for the transport
71
- * @param config.apiKey - New Relic API key for authentication
72
- * @param config.endpoint - Optional custom endpoint URL (defaults to New Relic's Log API endpoint)
73
- * @param config.onError - Optional error callback for handling errors
74
- * @param config.onDebug - Optional callback for debugging log entries before they are sent
75
- * @param config.useCompression - Whether to use gzip compression (defaults to true)
76
- * @param config.maxRetries - Maximum number of retry attempts (defaults to 3)
77
- * @param config.retryDelay - Base delay between retries in milliseconds (defaults to 1000)
78
- * @param config.respectRateLimit - Whether to honor rate limiting headers (defaults to true)
79
- */
80
- constructor(config: NewRelicTransportConfig);
81
- /**
82
- * Processes and ships log entries to New Relic.
83
- *
84
- * This method:
85
- * 1. Validates the message size
86
- * 2. Creates and validates the log entry
87
- * 3. Validates the final payload size
88
- * 4. Asynchronously sends the log entry to New Relic
89
- *
90
- * The actual sending is done asynchronously in a fire-and-forget manner to maintain
91
- * compatibility with the base transport class while still providing retry and error handling.
92
- *
93
- * @param params - Log parameters including level, messages, and metadata
94
- * @param params.logLevel - The severity level of the log
95
- * @param params.messages - Array of message strings to be joined
96
- * @param params.data - Optional metadata to include with the log
97
- * @param params.hasData - Whether metadata is present
98
- * @returns The original messages array
99
- * @throws {ValidationError} If the payload exceeds size limits or validation fails
100
- */
101
- shipToLogger({ logLevel, messages, data, hasData }: LogLayerTransportParams): any[];
61
+ private apiKey;
62
+ private endpoint;
63
+ private onError?;
64
+ private onDebug?;
65
+ private useCompression;
66
+ private maxRetries;
67
+ private retryDelay;
68
+ private respectRateLimit;
69
+ /**
70
+ * Creates a new instance of NewRelicTransport.
71
+ *
72
+ * @param config - Configuration options for the transport
73
+ * @param config.apiKey - New Relic API key for authentication
74
+ * @param config.endpoint - Optional custom endpoint URL (defaults to New Relic's Log API endpoint)
75
+ * @param config.onError - Optional error callback for handling errors
76
+ * @param config.onDebug - Optional callback for debugging log entries before they are sent
77
+ * @param config.useCompression - Whether to use gzip compression (defaults to true)
78
+ * @param config.maxRetries - Maximum number of retry attempts (defaults to 3)
79
+ * @param config.retryDelay - Base delay between retries in milliseconds (defaults to 1000)
80
+ * @param config.respectRateLimit - Whether to honor rate limiting headers (defaults to true)
81
+ */
82
+ constructor(config: NewRelicTransportConfig);
83
+ /**
84
+ * Processes and ships log entries to New Relic.
85
+ *
86
+ * This method:
87
+ * 1. Validates the message size
88
+ * 2. Creates and validates the log entry
89
+ * 3. Validates the final payload size
90
+ * 4. Asynchronously sends the log entry to New Relic
91
+ *
92
+ * The actual sending is done asynchronously in a fire-and-forget manner to maintain
93
+ * compatibility with the base transport class while still providing retry and error handling.
94
+ *
95
+ * @param params - Log parameters including level, messages, and metadata
96
+ * @param params.logLevel - The severity level of the log
97
+ * @param params.messages - Array of message strings to be joined
98
+ * @param params.data - Optional metadata to include with the log
99
+ * @param params.hasData - Whether metadata is present
100
+ * @returns The original messages array
101
+ * @throws {ValidationError} If the payload exceeds size limits or validation fails
102
+ */
103
+ shipToLogger({
104
+ logLevel,
105
+ messages,
106
+ data,
107
+ hasData
108
+ }: LogLayerTransportParams): any[];
102
109
  }
103
-
104
- export { NewRelicTransport, type NewRelicTransportConfig };
110
+ //#endregion
111
+ export { NewRelicTransport, NewRelicTransportConfig };
112
+ //# sourceMappingURL=index.d.ts.map