@visulima/pail 4.0.0-alpha.10 → 4.0.0-alpha.12

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 (106) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/LICENSE.md +143 -931
  3. package/dist/error.d.ts +95 -96
  4. package/dist/index.browser.d.ts +557 -47
  5. package/dist/index.browser.js +2 -2
  6. package/dist/index.server.d.ts +722 -65
  7. package/dist/index.server.js +27 -410
  8. package/dist/middleware/elysia.d.ts +65 -63
  9. package/dist/middleware/elysia.js +2 -2
  10. package/dist/middleware/express.d.ts +73 -71
  11. package/dist/middleware/express.js +1 -1
  12. package/dist/middleware/fastify.d.ts +69 -67
  13. package/dist/middleware/fastify.js +2 -2
  14. package/dist/middleware/hono.d.ts +74 -72
  15. package/dist/middleware/next/handler.d.ts +101 -34
  16. package/dist/middleware/sveltekit.d.ts +100 -98
  17. package/dist/object-tree.d.ts +67 -70
  18. package/dist/packem_shared/{AbstractJsonReporter-DlugSJpY.js → AbstractJsonReporter-BO8Calb4.js} +1 -5
  19. package/dist/packem_shared/{AbstractJsonReporter-CjtVgHbU.js → AbstractJsonReporter-nOj0Ft1F.js} +1 -5
  20. package/dist/packem_shared/{JsonReporter-Dbw82ewj.js → JsonReporter-CCmj7oYL.js} +1 -1
  21. package/dist/packem_shared/{JsonReporter-BgPvIyC2.js → JsonReporter-Ck2PIAEw.js} +2 -2
  22. package/dist/packem_shared/{PrettyReporter-C2dCzIaf.js → PrettyReporter-CIbrmjUV.js} +2 -4
  23. package/dist/packem_shared/{PrettyReporter-gMqa7j_m.js → PrettyReporter-CNJEO9g7.js} +1250 -15
  24. package/dist/packem_shared/abstract-json-reporter.d-BAgznjyU.d.ts +61 -0
  25. package/dist/packem_shared/{abstract-pretty-reporter-szQO-IgK.js → abstract-pretty-reporter-CkqCt5hg.js} +2300 -2298
  26. package/dist/packem_shared/create-middleware-logger.d-DheMh8q4.d.ts +47 -0
  27. package/dist/packem_shared/{index-Bx3-C0j9.js → index-6cG1Kp0t.js} +2 -2
  28. package/dist/packem_shared/types.d-BeLumqgD.d.ts +246 -0
  29. package/dist/packem_shared/types.d-C51XNfQz.d.ts +194 -0
  30. package/dist/packem_shared/types.d-CM5ie2qm.d.ts +236 -0
  31. package/dist/packem_shared/wide-event.d-B-t8ZnhI.d.ts +704 -0
  32. package/dist/packem_shared/{write-stream-BuFtjATz.js → write-stream-MDqyXmc_.js} +1 -1
  33. package/dist/processor/caller/caller-processor.d.ts +49 -47
  34. package/dist/processor/caller/caller-processor.js +1 -1
  35. package/dist/processor/environment-processor.d.ts +113 -113
  36. package/dist/processor/message-formatter-processor.d.ts +51 -49
  37. package/dist/processor/message-formatter-processor.js +2 -2
  38. package/dist/processor/opentelemetry-processor.d.ts +69 -66
  39. package/dist/processor/redact-processor.d.ts +60 -41
  40. package/dist/processor/sampling-processor.d.ts +102 -101
  41. package/dist/reporter/file/json-file-reporter.d.ts +91 -42
  42. package/dist/reporter/file/json-file-reporter.js +1 -1
  43. package/dist/reporter/http/abstract-http-reporter.d.ts +213 -211
  44. package/dist/reporter/http/abstract-http-reporter.js +1 -1
  45. package/dist/reporter/http/http-reporter.d.ts +40 -36
  46. package/dist/reporter/http/http-reporter.edge-light.d.ts +430 -38
  47. package/dist/reporter/http/http-reporter.edge-light.js +1 -5
  48. package/dist/reporter/json/index.browser.d.ts +99 -3
  49. package/dist/reporter/json/index.browser.js +2 -2
  50. package/dist/reporter/json/index.d.ts +51 -3
  51. package/dist/reporter/json/index.js +2 -2
  52. package/dist/reporter/pretty/index.browser.d.ts +106 -2
  53. package/dist/reporter/pretty/index.browser.js +1 -1
  54. package/dist/reporter/pretty/index.d.ts +219 -2
  55. package/dist/reporter/pretty/index.js +1 -1
  56. package/dist/reporter/simple/simple-reporter.server.d.ts +168 -18
  57. package/dist/reporter/simple/simple-reporter.server.js +3 -2
  58. package/dist/wide-event.d.ts +5 -300
  59. package/dist/wide-event.js +3 -2
  60. package/package.json +9 -21
  61. package/dist/constants.d.ts +0 -37
  62. package/dist/interactive/index.d.ts +0 -2
  63. package/dist/interactive/index.js +0 -2
  64. package/dist/interactive/interactive-manager.d.ts +0 -108
  65. package/dist/interactive/interactive-stream-hook.d.ts +0 -68
  66. package/dist/middleware/next/middleware.d.ts +0 -59
  67. package/dist/middleware/next/storage.d.ts +0 -14
  68. package/dist/middleware/shared/create-middleware-logger.d.ts +0 -82
  69. package/dist/middleware/shared/headers.d.ts +0 -14
  70. package/dist/middleware/shared/routes.d.ts +0 -30
  71. package/dist/middleware/shared/storage.d.ts +0 -29
  72. package/dist/packem_shared/InteractiveManager-CowYA3Hx.js +0 -178
  73. package/dist/packem_shared/InteractiveStreamHook-BypRlYTX.js +0 -133
  74. package/dist/packem_shared/Spinner-Cokext9b.js +0 -2183
  75. package/dist/packem_shared/getBarChar-D7JfmdTr.js +0 -459
  76. package/dist/packem_shared/index-BEfVUy9P.js +0 -1256
  77. package/dist/pail.browser.d.ts +0 -412
  78. package/dist/pail.server.d.ts +0 -233
  79. package/dist/processor/caller/get-caller-filename.d.ts +0 -23
  80. package/dist/progress-bar.d.ts +0 -145
  81. package/dist/progress-bar.js +0 -459
  82. package/dist/reporter/file/utils/rotating-file-stream.d.ts +0 -48
  83. package/dist/reporter/http/utils/compression.d.ts +0 -7
  84. package/dist/reporter/http/utils/log-size-error.d.ts +0 -30
  85. package/dist/reporter/http/utils/retry.d.ts +0 -27
  86. package/dist/reporter/json/abstract-json-reporter.d.ts +0 -61
  87. package/dist/reporter/json/json-reporter.browser.d.ts +0 -40
  88. package/dist/reporter/json/json-reporter.server.d.ts +0 -50
  89. package/dist/reporter/pretty/abstract-pretty-reporter.d.ts +0 -83
  90. package/dist/reporter/pretty/pretty-reporter.browser.d.ts +0 -36
  91. package/dist/reporter/pretty/pretty-reporter.server.d.ts +0 -70
  92. package/dist/reporter/raw/raw-reporter.browser.d.ts +0 -5
  93. package/dist/reporter/raw/raw-reporter.server.d.ts +0 -13
  94. package/dist/reporter/utils/default-inspector-config.d.ts +0 -3
  95. package/dist/reporter/utils/format-label.d.ts +0 -3
  96. package/dist/spinner.d.ts +0 -220
  97. package/dist/spinner.js +0 -2183
  98. package/dist/types.d.ts +0 -241
  99. package/dist/utils/ansi-escapes.d.ts +0 -4
  100. package/dist/utils/arrayify.d.ts +0 -2
  101. package/dist/utils/get-longest-badge.d.ts +0 -4
  102. package/dist/utils/get-longest-label.d.ts +0 -4
  103. package/dist/utils/merge-types.d.ts +0 -4
  104. package/dist/utils/stream/safe-stream-handler.d.ts +0 -21
  105. package/dist/utils/write-console-log-based-on-level.d.ts +0 -4
  106. package/dist/utils/write-stream.d.ts +0 -2
@@ -1,215 +1,217 @@
1
- import type { LiteralUnion } from "type-fest";
2
- import type { ExtendedRfc5424LogLevels, StringifyAwareReporter } from "../../types.d.ts";
3
- import type { AbstractJsonReporterOptions } from "../json/abstract-json-reporter.d.ts";
4
- import { AbstractJsonReporter } from "../json/abstract-json-reporter.d.ts";
1
+ import { E as ExtendedRfc5424LogLevels, L as LiteralUnion, S as StringifyAwareReporter } from "../../packem_shared/types.d-BeLumqgD.js";
2
+ import { A as AbstractJsonReporterOptions, a as AbstractJsonReporter } from "../../packem_shared/abstract-json-reporter.d-BAgznjyU.js";
3
+ import '@visulima/colorize';
4
+ import '@visulima/interactive-manager';
5
+ import 'safe-stable-stringify';
5
6
  /**
6
- * Configuration options for the HTTP reporter.
7
- */
8
- export type AbstractHttpReporterOptions = AbstractJsonReporterOptions & {
9
- /**
10
- * Content type for batch log requests. User-specified headers take precedence.
11
- * @default "application/json"
12
- */
13
- batchContentType?: string;
14
- /**
15
- * Field name to wrap batch entries in when batchMode is "field" (e.g., "batch" for Logflare)
16
- * @default undefined
17
- */
18
- batchFieldName?: string;
19
- /**
20
- * Batch mode for sending multiple log entries
21
- * - "delimiter": Join entries with a delimiter (default)
22
- * - "field": Wrap entries in an object with a field name
23
- * - "array": Send entries as a plain JSON array
24
- * @default "delimiter"
25
- */
26
- batchMode?: "delimiter" | "field" | "array";
27
- /**
28
- * Delimiter to use between log entries in batch mode
29
- * @default "\n"
30
- */
31
- batchSendDelimiter?: string;
32
- /**
33
- * Timeout in milliseconds for sending batches regardless of size
34
- * @default 5000
35
- */
36
- batchSendTimeout?: number;
37
- /**
38
- * Number of log entries to batch before sending
39
- * @default 100
40
- */
41
- batchSize?: number;
42
- /**
43
- * Whether to use gzip compression
44
- * @default false
45
- */
46
- compression?: boolean;
47
- /**
48
- * Content type for single log requests. User-specified headers take precedence.
49
- * @default "application/json"
50
- */
51
- contentType?: string;
52
- /**
53
- * Whether to enable Edge Runtime compatibility mode
54
- * When enabled, TextEncoder and compression are disabled
55
- * @default false
56
- */
57
- edgeCompat?: boolean;
58
- /**
59
- * Whether to enable batch sending
60
- * @default true
61
- */
62
- enableBatchSend?: boolean;
63
- /**
64
- * Headers to include in the request. Can be an object or a function that returns headers.
65
- */
66
- headers?: Record<string, string> | (() => Record<string, string>);
67
- /**
68
- * Maximum size of a single log entry in bytes
69
- * @default 1048576 (1MB)
70
- */
71
- maxLogSize?: number;
72
- /**
73
- * Maximum size of the payload (uncompressed) in bytes
74
- * @default 5242880 (5MB)
75
- */
76
- maxPayloadSize?: number;
77
- /**
78
- * Number of retry attempts before giving up
79
- * @default 3
80
- */
81
- maxRetries?: number;
82
- /**
83
- * HTTP method to use for requests
84
- * @default "POST"
85
- */
86
- method?: string;
87
- /**
88
- * Optional callback for debugging log entries before they are sent
89
- */
90
- onDebug?: (entry: Record<string, unknown>) => void;
91
- /**
92
- * Optional callback for debugging HTTP requests and responses
93
- */
94
- onDebugRequestResponse?: (requestResponse: {
95
- req: {
96
- body: string | Uint8Array;
97
- headers: Record<string, string>;
98
- method: string;
99
- url: string;
100
- };
101
- res: {
102
- body: string;
103
- headers: Record<string, string>;
104
- status: number;
105
- statusText: string;
106
- };
107
- }) => void;
108
- /**
109
- * Optional callback for error handling
110
- */
111
- onError?: (error: Error) => void;
112
- /**
113
- * Function to transform log data into the payload format.
114
- * By default, uses the JSON stringified log entry.
115
- */
116
- payloadTemplate?: (data: {
117
- data?: Record<string, unknown>;
118
- logLevel: string;
119
- message: string;
120
- }) => string;
121
- /**
122
- * Whether to respect rate limiting by waiting when a 429 response is received
123
- * @default true
124
- */
125
- respectRateLimit?: boolean;
126
- /**
127
- * Base delay between retries in milliseconds
128
- * @default 1000
129
- */
130
- retryDelay?: number;
131
- /**
132
- * The URL to send logs to
133
- */
134
- url: string;
7
+ * Configuration options for the HTTP reporter.
8
+ */
9
+ type AbstractHttpReporterOptions = AbstractJsonReporterOptions & {
10
+ /**
11
+ * Content type for batch log requests. User-specified headers take precedence.
12
+ * @default "application/json"
13
+ */
14
+ batchContentType?: string;
15
+ /**
16
+ * Field name to wrap batch entries in when batchMode is "field" (e.g., "batch" for Logflare)
17
+ * @default undefined
18
+ */
19
+ batchFieldName?: string;
20
+ /**
21
+ * Batch mode for sending multiple log entries
22
+ * - "delimiter": Join entries with a delimiter (default)
23
+ * - "field": Wrap entries in an object with a field name
24
+ * - "array": Send entries as a plain JSON array
25
+ * @default "delimiter"
26
+ */
27
+ batchMode?: "delimiter" | "field" | "array";
28
+ /**
29
+ * Delimiter to use between log entries in batch mode
30
+ * @default "\n"
31
+ */
32
+ batchSendDelimiter?: string;
33
+ /**
34
+ * Timeout in milliseconds for sending batches regardless of size
35
+ * @default 5000
36
+ */
37
+ batchSendTimeout?: number;
38
+ /**
39
+ * Number of log entries to batch before sending
40
+ * @default 100
41
+ */
42
+ batchSize?: number;
43
+ /**
44
+ * Whether to use gzip compression
45
+ * @default false
46
+ */
47
+ compression?: boolean;
48
+ /**
49
+ * Content type for single log requests. User-specified headers take precedence.
50
+ * @default "application/json"
51
+ */
52
+ contentType?: string;
53
+ /**
54
+ * Whether to enable Edge Runtime compatibility mode
55
+ * When enabled, TextEncoder and compression are disabled
56
+ * @default false
57
+ */
58
+ edgeCompat?: boolean;
59
+ /**
60
+ * Whether to enable batch sending
61
+ * @default true
62
+ */
63
+ enableBatchSend?: boolean;
64
+ /**
65
+ * Headers to include in the request. Can be an object or a function that returns headers.
66
+ */
67
+ headers?: Record<string, string> | (() => Record<string, string>);
68
+ /**
69
+ * Maximum size of a single log entry in bytes
70
+ * @default 1048576 (1MB)
71
+ */
72
+ maxLogSize?: number;
73
+ /**
74
+ * Maximum size of the payload (uncompressed) in bytes
75
+ * @default 5242880 (5MB)
76
+ */
77
+ maxPayloadSize?: number;
78
+ /**
79
+ * Number of retry attempts before giving up
80
+ * @default 3
81
+ */
82
+ maxRetries?: number;
83
+ /**
84
+ * HTTP method to use for requests
85
+ * @default "POST"
86
+ */
87
+ method?: string;
88
+ /**
89
+ * Optional callback for debugging log entries before they are sent
90
+ */
91
+ onDebug?: (entry: Record<string, unknown>) => void;
92
+ /**
93
+ * Optional callback for debugging HTTP requests and responses
94
+ */
95
+ onDebugRequestResponse?: (requestResponse: {
96
+ req: {
97
+ body: string | Uint8Array;
98
+ headers: Record<string, string>;
99
+ method: string;
100
+ url: string;
101
+ };
102
+ res: {
103
+ body: string;
104
+ headers: Record<string, string>;
105
+ status: number;
106
+ statusText: string;
107
+ };
108
+ }) => void;
109
+ /**
110
+ * Optional callback for error handling
111
+ */
112
+ onError?: (error: Error) => void;
113
+ /**
114
+ * Function to transform log data into the payload format.
115
+ * By default, uses the JSON stringified log entry.
116
+ */
117
+ payloadTemplate?: (data: {
118
+ data?: Record<string, unknown>;
119
+ logLevel: string;
120
+ message: string;
121
+ }) => string;
122
+ /**
123
+ * Whether to respect rate limiting by waiting when a 429 response is received
124
+ * @default true
125
+ */
126
+ respectRateLimit?: boolean;
127
+ /**
128
+ * Base delay between retries in milliseconds
129
+ * @default 1000
130
+ */
131
+ retryDelay?: number;
132
+ /**
133
+ * The URL to send logs to
134
+ */
135
+ url: string;
135
136
  };
136
137
  /**
137
- * Abstract HTTP Reporter.
138
- *
139
- * Base class for HTTP-based reporters that sends logs to HTTP endpoints.
140
- * Supports batching, compression, retries, and rate limiting.
141
- * @template L - The log level type
142
- */
143
- export declare abstract class AbstractHttpReporter<L extends string = string> extends AbstractJsonReporter<L> implements StringifyAwareReporter<L> {
144
- protected url: string;
145
- protected method: string;
146
- protected headers: Record<string, string> | (() => Record<string, string>);
147
- protected contentType: string;
148
- protected batchContentType: string;
149
- protected onError?: (error: Error) => void;
150
- protected onDebug?: (entry: Record<string, unknown>) => void;
151
- protected onDebugRequestResponse?: (requestResponse: {
152
- req: {
153
- body: string | Uint8Array;
154
- headers: Record<string, string>;
155
- method: string;
156
- url: string;
157
- };
158
- res: {
159
- body: string;
160
- headers: Record<string, string>;
161
- status: number;
162
- statusText: string;
163
- };
164
- }) => void;
165
- protected payloadTemplate: (data: {
166
- data?: Record<string, unknown>;
167
- logLevel: string;
168
- message: string;
169
- }) => string;
170
- protected compression: boolean;
171
- protected maxRetries: number;
172
- protected retryDelay: number;
173
- protected respectRateLimit: boolean;
174
- protected enableBatchSend: boolean;
175
- protected batchSize: number;
176
- protected batchSendTimeout: number;
177
- protected batchSendDelimiter: string;
178
- protected batchMode: "delimiter" | "field" | "array";
179
- protected batchFieldName?: string;
180
- protected maxLogSize: number;
181
- protected maxPayloadSize: number;
182
- protected edgeCompat: boolean;
183
- protected batchQueue: string[];
184
- protected batchTimeout?: ReturnType<typeof setTimeout>;
185
- protected isProcessingBatch: boolean;
186
- protected currentBatchSize: number;
187
- /**
188
- * Creates a new instance of AbstractHttpReporter.
189
- * @param config Configuration options for the reporter
190
- */
191
- constructor(config: AbstractHttpReporterOptions);
192
- /**
193
- * Processes and ships log entries to the HTTP endpoint.
194
- * @param message The JSON-formatted log message
195
- * @param logLevel The log level of the message
196
- * @protected
197
- */
198
- protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
199
- /**
200
- * Adds a payload to the batch queue and triggers sending if conditions are met.
201
- */
202
- protected addToBatch(payload: string, logEntrySize: number): void;
203
- /**
204
- * Processes the current batch and sends it to the HTTP endpoint.
205
- */
206
- protected processBatch(): Promise<void>;
207
- /**
208
- * Sends a batch of payloads to the HTTP endpoint.
209
- */
210
- protected sendBatch(batch: string[]): Promise<void>;
211
- /**
212
- * Sends a single payload to the HTTP endpoint.
213
- */
214
- protected sendPayload(payload: string, contentType?: string): Promise<void>;
138
+ * Abstract HTTP Reporter.
139
+ *
140
+ * Base class for HTTP-based reporters that sends logs to HTTP endpoints.
141
+ * Supports batching, compression, retries, and rate limiting.
142
+ * @template L - The log level type
143
+ */
144
+ declare abstract class AbstractHttpReporter<L extends string = string> extends AbstractJsonReporter<L> implements StringifyAwareReporter<L> {
145
+ protected url: string;
146
+ protected method: string;
147
+ protected headers: Record<string, string> | (() => Record<string, string>);
148
+ protected contentType: string;
149
+ protected batchContentType: string;
150
+ protected onError?: (error: Error) => void;
151
+ protected onDebug?: (entry: Record<string, unknown>) => void;
152
+ protected onDebugRequestResponse?: (requestResponse: {
153
+ req: {
154
+ body: string | Uint8Array;
155
+ headers: Record<string, string>;
156
+ method: string;
157
+ url: string;
158
+ };
159
+ res: {
160
+ body: string;
161
+ headers: Record<string, string>;
162
+ status: number;
163
+ statusText: string;
164
+ };
165
+ }) => void;
166
+ protected payloadTemplate: (data: {
167
+ data?: Record<string, unknown>;
168
+ logLevel: string;
169
+ message: string;
170
+ }) => string;
171
+ protected compression: boolean;
172
+ protected maxRetries: number;
173
+ protected retryDelay: number;
174
+ protected respectRateLimit: boolean;
175
+ protected enableBatchSend: boolean;
176
+ protected batchSize: number;
177
+ protected batchSendTimeout: number;
178
+ protected batchSendDelimiter: string;
179
+ protected batchMode: "delimiter" | "field" | "array";
180
+ protected batchFieldName?: string;
181
+ protected maxLogSize: number;
182
+ protected maxPayloadSize: number;
183
+ protected edgeCompat: boolean;
184
+ protected batchQueue: string[];
185
+ protected batchTimeout?: ReturnType<typeof setTimeout>;
186
+ protected isProcessingBatch: boolean;
187
+ protected currentBatchSize: number;
188
+ /**
189
+ * Creates a new instance of AbstractHttpReporter.
190
+ * @param config Configuration options for the reporter
191
+ */
192
+ constructor(config: AbstractHttpReporterOptions);
193
+ /**
194
+ * Processes and ships log entries to the HTTP endpoint.
195
+ * @param message The JSON-formatted log message
196
+ * @param logLevel The log level of the message
197
+ * @protected
198
+ */
199
+ protected override _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
200
+ /**
201
+ * Adds a payload to the batch queue and triggers sending if conditions are met.
202
+ */
203
+ protected addToBatch(payload: string, logEntrySize: number): void;
204
+ /**
205
+ * Processes the current batch and sends it to the HTTP endpoint.
206
+ */
207
+ protected processBatch(): Promise<void>;
208
+ /**
209
+ * Sends a batch of payloads to the HTTP endpoint.
210
+ */
211
+ protected sendBatch(batch: string[]): Promise<void>;
212
+ /**
213
+ * Sends a single payload to the HTTP endpoint.
214
+ */
215
+ protected sendPayload(payload: string, contentType?: string): Promise<void>;
215
216
  }
217
+ export { AbstractHttpReporter, AbstractHttpReporterOptions };
@@ -20,7 +20,7 @@ const __cjs_getBuiltinModule = (module) => {
20
20
  const {
21
21
  Buffer
22
22
  } = __cjs_getBuiltinModule("node:buffer");
23
- import { AbstractJsonReporter } from '../../packem_shared/AbstractJsonReporter-CjtVgHbU.js';
23
+ import { AbstractJsonReporter } from '../../packem_shared/AbstractJsonReporter-nOj0Ft1F.js';
24
24
  const {
25
25
  gzipSync
26
26
  } = __cjs_getBuiltinModule("node:zlib");
@@ -1,39 +1,43 @@
1
- import type { AbstractHttpReporterOptions } from "./abstract-http-reporter.d.ts";
2
- import { AbstractHttpReporter } from "./abstract-http-reporter.d.ts";
1
+ import { AbstractHttpReporterOptions, AbstractHttpReporter } from "./abstract-http-reporter.js";
2
+ import "../../packem_shared/types.d-BeLumqgD.js";
3
+ import '@visulima/colorize';
4
+ import '@visulima/interactive-manager';
5
+ import "../../packem_shared/abstract-json-reporter.d-BAgznjyU.js";
6
+ import 'safe-stable-stringify';
3
7
  /**
4
- * HTTP Reporter.
5
- *
6
- * A reporter that sends logs to HTTP endpoints.
7
- * Supports batching, compression, retries, and rate limiting.
8
- * Works in both Node.js server and browser environments.
9
- * @template L - The log level type
10
- * @example
11
- * ```typescript
12
- * import { createPail } from "@visulima/pail";
13
- * import { HttpReporter } from "@visulima/pail/reporter/http";
14
- *
15
- * const logger = createPail({
16
- * reporters: [
17
- * new HttpReporter({
18
- * url: "https://api.example.com/logs",
19
- * method: "POST",
20
- * headers: {
21
- * "Authorization": "Bearer token"
22
- * },
23
- * enableBatchSend: true,
24
- * batchSize: 100
25
- * })
26
- * ]
27
- * });
28
- *
29
- * logger.info("Application started", { version: "1.0.0" });
30
- * ```
31
- */
8
+ * HTTP Reporter.
9
+ *
10
+ * A reporter that sends logs to HTTP endpoints.
11
+ * Supports batching, compression, retries, and rate limiting.
12
+ * Works in both Node.js server and browser environments.
13
+ * @template L - The log level type
14
+ * @example
15
+ * ```typescript
16
+ * import { createPail } from "@visulima/pail";
17
+ * import { HttpReporter } from "@visulima/pail/reporter/http";
18
+ *
19
+ * const logger = createPail({
20
+ * reporters: [
21
+ * new HttpReporter({
22
+ * url: "https://api.example.com/logs",
23
+ * method: "POST",
24
+ * headers: {
25
+ * "Authorization": "Bearer token"
26
+ * },
27
+ * enableBatchSend: true,
28
+ * batchSize: 100
29
+ * })
30
+ * ]
31
+ * });
32
+ *
33
+ * logger.info("Application started", { version: "1.0.0" });
34
+ * ```
35
+ */
32
36
  declare class HttpReporter<L extends string = string> extends AbstractHttpReporter<L> {
33
- /**
34
- * Creates a new HTTP Reporter instance.
35
- * @param options Configuration options for HTTP reporting
36
- */
37
- constructor(options: AbstractHttpReporterOptions);
37
+ /**
38
+ * Creates a new HTTP Reporter instance.
39
+ * @param options Configuration options for HTTP reporting
40
+ */
41
+ constructor(options: AbstractHttpReporterOptions);
38
42
  }
39
- export default HttpReporter;
43
+ export { HttpReporter as default };