@logscopeai/logscope 0.1.0-beta.3 → 1.0.0
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 +145 -203
- package/dist/client/create-logscope-client.js.map +1 -1
- package/dist/config/config-guards.js +2 -7
- package/dist/config/config-guards.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/logscope.js +1 -19
- package/dist/logscope.js.map +1 -1
- package/dist/types.d.ts +2 -32
- package/dist/winston/transport.js.map +1 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,81 +1,60 @@
|
|
|
1
1
|
# @logscopeai/logscope
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Stable `1.0` Node.js SDK for sending application logs to the Logscope Ingestion API.
|
|
4
4
|
>
|
|
5
|
-
>
|
|
6
|
-
>
|
|
7
|
-
> Breaking changes may occur in any minor or patch release.
|
|
5
|
+
> `@logscopeai/logscope` is the official Node.js SDK for Logscope producers. The documented public
|
|
6
|
+
> contract is now stable `1.0` and is maintained with a conservative, fail-safe posture.
|
|
8
7
|
|
|
9
|
-
`@logscopeai/logscope`
|
|
8
|
+
`@logscopeai/logscope` lets Node.js applications capture logs, normalize them to the ingestion
|
|
9
|
+
schema, apply optional client-side filtering, batch delivery asynchronously, and forward logs to
|
|
10
|
+
Logscope without throwing into user code.
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
## Stable 1.0 Posture
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
- Stable `1.0` means the documented SDK contract is intended for real integrations and deliberate
|
|
15
|
+
long-lived usage.
|
|
16
|
+
- Stable `1.0` does not mean every future feature already exists:
|
|
17
|
+
- no disk persistence or local buffering;
|
|
18
|
+
- no sampling, tracing, or OpenTelemetry surface;
|
|
19
|
+
- no hidden global patching of pino or winston.
|
|
20
|
+
- Documented public behavior remains compatibility-sensitive and requires deliberate review before
|
|
21
|
+
it changes.
|
|
14
22
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## Early Development Mode
|
|
18
|
-
|
|
19
|
-
During early development phases, `@logscopeai/logscope` is expected to be executed locally using:
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
npm link
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
This allows the SDK to be developed and tested inside a consuming service before being published to npm.
|
|
26
|
-
|
|
27
|
-
The intended import pattern is:
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
import { Logscope } from '@logscopeai/logscope';
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Compatibility with `npm link` is a design requirement.
|
|
34
|
-
|
|
35
|
-
---
|
|
23
|
+
See `docs/stable-1.0-policy.md` for the stability and change policy, and
|
|
24
|
+
`docs/compatibility-contract.md` for the stable `1.0` contract baseline.
|
|
36
25
|
|
|
37
26
|
## What This Package Does
|
|
38
27
|
|
|
39
28
|
- Captures logs from:
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
- Never throws into user code
|
|
50
|
-
|
|
51
|
-
---
|
|
29
|
+
- the manual SDK API;
|
|
30
|
+
- optional console capture;
|
|
31
|
+
- pino via `@logscopeai/logscope/pino`;
|
|
32
|
+
- winston via `@logscopeai/logscope/winston`.
|
|
33
|
+
- Normalizes logs to the ingestion schema.
|
|
34
|
+
- Applies optional level-based filtering before batching.
|
|
35
|
+
- Batches logs in memory and sends them asynchronously.
|
|
36
|
+
- Retries retriable delivery failures with backoff.
|
|
37
|
+
- Avoids throwing into user code.
|
|
52
38
|
|
|
53
39
|
## What This Package Does Not Do
|
|
54
40
|
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
- Replace structured logging frameworks
|
|
61
|
-
|
|
62
|
-
---
|
|
41
|
+
- Validate API keys semantically against server-side policy.
|
|
42
|
+
- Persist logs to disk.
|
|
43
|
+
- Provide storage, analytics, dashboarding, or querying.
|
|
44
|
+
- Replace structured logging frameworks.
|
|
45
|
+
- Provide hosted-service SLA guarantees by itself.
|
|
63
46
|
|
|
64
47
|
## Installation
|
|
65
48
|
|
|
66
|
-
```
|
|
49
|
+
```bash
|
|
67
50
|
npm install @logscopeai/logscope
|
|
68
51
|
```
|
|
69
52
|
|
|
70
|
-
|
|
53
|
+
For workspace development and local package iteration, `npm link` remains supported. See
|
|
54
|
+
`docs/local-development.md` for the canonical SDK-side standalone-vs-integrated local-topology
|
|
55
|
+
guidance.
|
|
71
56
|
|
|
72
|
-
|
|
73
|
-
npm link @logscopeai/logscope
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## Basic Usage (Class API)
|
|
57
|
+
## Quick Start (`Logscope`)
|
|
79
58
|
|
|
80
59
|
```ts
|
|
81
60
|
import { Logscope } from '@logscopeai/logscope';
|
|
@@ -88,13 +67,19 @@ logscope.info('Service started');
|
|
|
88
67
|
logscope.error('Payment failed', { orderId: 123 });
|
|
89
68
|
```
|
|
90
69
|
|
|
91
|
-
`new Logscope({ apiKey })` uses
|
|
70
|
+
`new Logscope({ apiKey })` currently uses this default ingestion URL:
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
https://dev.ingestion.logscopeai.com
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The planned production ingestion URL is:
|
|
92
77
|
|
|
93
78
|
```text
|
|
94
79
|
https://ingestion.logscopeai.com
|
|
95
80
|
```
|
|
96
81
|
|
|
97
|
-
For
|
|
82
|
+
For local or test environments, override `ingestionBaseUrl` explicitly:
|
|
98
83
|
|
|
99
84
|
```ts
|
|
100
85
|
const logscope = new Logscope({
|
|
@@ -103,60 +88,68 @@ const logscope = new Logscope({
|
|
|
103
88
|
});
|
|
104
89
|
```
|
|
105
90
|
|
|
106
|
-
|
|
91
|
+
`Logscope` exposes these manual log methods:
|
|
107
92
|
|
|
108
|
-
|
|
109
|
-
|
|
93
|
+
- `trace`
|
|
94
|
+
- `debug`
|
|
95
|
+
- `info`
|
|
96
|
+
- `warn`
|
|
97
|
+
- `error`
|
|
98
|
+
- `fatal`
|
|
110
99
|
|
|
111
|
-
|
|
112
|
-
apiKey: process.env.LOGSCOPE_API_KEY!,
|
|
113
|
-
captureConsole: true,
|
|
114
|
-
context: {
|
|
115
|
-
source: 'billing-api',
|
|
116
|
-
},
|
|
117
|
-
logFilter: {
|
|
118
|
-
levels: ['warn', 'error'],
|
|
119
|
-
},
|
|
120
|
-
runtime: {
|
|
121
|
-
maxBatchSize: 25,
|
|
122
|
-
flushIntervalMs: 1_000,
|
|
123
|
-
maxRetries: 5,
|
|
124
|
-
retryBaseDelayMs: 200,
|
|
125
|
-
retryMaxDelayMs: 4_000,
|
|
126
|
-
},
|
|
127
|
-
});
|
|
128
|
-
```
|
|
100
|
+
## Client Configuration
|
|
129
101
|
|
|
130
|
-
|
|
102
|
+
Client config highlights:
|
|
131
103
|
|
|
132
|
-
|
|
104
|
+
- `apiKey` is required.
|
|
105
|
+
- `ingestionBaseUrl` is the canonical root-client override for local, development, and test
|
|
106
|
+
routing.
|
|
107
|
+
- `captureConsole` is opt-in and disabled by default.
|
|
108
|
+
- Root-client logs always use the deterministic fallback source `unknown`.
|
|
109
|
+
- `runtime` controls batching and retry quantities through validated safe defaults.
|
|
133
110
|
|
|
134
|
-
|
|
111
|
+
Runtime delivery knobs:
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
runtime: {
|
|
115
|
+
maxBatchSize?: number; // default: 50, bounded to ingestion contract max
|
|
116
|
+
flushIntervalMs?: number; // default: 2000
|
|
117
|
+
maxRetries?: number; // default: 3
|
|
118
|
+
retryBaseDelayMs?: number; // default: 250
|
|
119
|
+
retryMaxDelayMs?: number; // default: 2000
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Invalid runtime overrides are ignored safely and fallback to defaults without throwing.
|
|
124
|
+
|
|
125
|
+
## Validation And Safety Guarantees
|
|
135
126
|
|
|
136
127
|
Runtime guards are applied before delivery:
|
|
137
128
|
|
|
138
|
-
- Required config fields are validated
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
- Winston transport: `apiKey`, `endpoint`, `source`
|
|
142
|
-
- Invalid required config triggers a single safe warning and switches to a no-op fallback pipeline.
|
|
129
|
+
- Required config fields are validated before pipeline creation.
|
|
130
|
+
- Invalid required config triggers a safe warning and switches the client or transport into no-op
|
|
131
|
+
fallback behavior.
|
|
143
132
|
- Warning diagnostics never include secret values such as API keys.
|
|
144
|
-
- `ingestionBaseUrl` is optional
|
|
145
|
-
|
|
146
|
-
- The SDK does not expose
|
|
133
|
+
- `ingestionBaseUrl` is optional on the root client and falls back to the current default when
|
|
134
|
+
omitted or invalid.
|
|
135
|
+
- The SDK does not expose a client-owned `environment` routing field.
|
|
147
136
|
|
|
148
137
|
Normalization enforces ingestion constraints:
|
|
149
138
|
|
|
150
139
|
- `message` is deterministically truncated to `<= 2048` characters.
|
|
151
140
|
- `metadata` is normalized to JSON-safe content and dropped if serialized size is `> 2048` bytes.
|
|
152
141
|
|
|
153
|
-
|
|
142
|
+
Fail-safe expectations:
|
|
154
143
|
|
|
155
|
-
|
|
144
|
+
- The SDK must never throw into user code.
|
|
145
|
+
- Filtering happens before batching.
|
|
146
|
+
- `401` results warn once.
|
|
147
|
+
- `429` and `500` results retry with backoff.
|
|
148
|
+
- Batches are dropped after max retries are exhausted.
|
|
156
149
|
|
|
157
|
-
## Public Types
|
|
150
|
+
## Public Types And Utilities
|
|
158
151
|
|
|
159
|
-
The root entrypoint
|
|
152
|
+
The root entrypoint exports the class API, shared types, constants, and normalization utility:
|
|
160
153
|
|
|
161
154
|
```ts
|
|
162
155
|
import { Logscope, normalizeLog } from '@logscopeai/logscope';
|
|
@@ -164,69 +157,52 @@ import type {
|
|
|
164
157
|
IngestionLogEntry,
|
|
165
158
|
LogLevel,
|
|
166
159
|
LogscopeClient,
|
|
167
|
-
LogscopeConfig,
|
|
168
160
|
LogscopeInitConfig,
|
|
169
161
|
} from '@logscopeai/logscope';
|
|
170
162
|
```
|
|
171
163
|
|
|
172
|
-
`normalizeLog` converts SDK log input into ingestion-safe entries using
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## Filtering Logs
|
|
177
|
-
|
|
178
|
-
Users may restrict which logs are sent to Logscope:
|
|
164
|
+
`normalizeLog` converts SDK log input into ingestion-safe entries using:
|
|
179
165
|
|
|
180
166
|
```ts
|
|
181
|
-
|
|
182
|
-
|
|
167
|
+
{
|
|
168
|
+
source,
|
|
169
|
+
level,
|
|
170
|
+
timestamp,
|
|
171
|
+
message,
|
|
172
|
+
metadata?,
|
|
183
173
|
}
|
|
184
174
|
```
|
|
185
175
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
If `logFilter.levels` is configured as an empty array (`[]`), all logs are filtered out.
|
|
189
|
-
|
|
190
|
-
---
|
|
191
|
-
|
|
192
|
-
## Runtime Delivery Configuration
|
|
176
|
+
## Filtering Logs
|
|
193
177
|
|
|
194
|
-
|
|
178
|
+
`logFilter.levels` restricts which levels enter the delivery pipeline:
|
|
195
179
|
|
|
196
180
|
```ts
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
flushIntervalMs?: number; // default: 2000
|
|
200
|
-
maxRetries?: number; // default: 3
|
|
201
|
-
retryBaseDelayMs?: number; // default: 250
|
|
202
|
-
retryMaxDelayMs?: number; // default: 2000
|
|
181
|
+
logFilter: {
|
|
182
|
+
levels: ['warn', 'error'],
|
|
203
183
|
}
|
|
204
184
|
```
|
|
205
185
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
---
|
|
186
|
+
- If no filter is configured, all logs are sent.
|
|
187
|
+
- If `logFilter.levels` is an empty array, all logs are filtered out.
|
|
209
188
|
|
|
210
189
|
## Console Capture
|
|
211
190
|
|
|
212
191
|
`captureConsole` is disabled by default.
|
|
213
192
|
|
|
214
|
-
When
|
|
193
|
+
When enabled, the SDK wraps:
|
|
215
194
|
|
|
216
|
-
- `console.log`
|
|
217
|
-
- `console.info`
|
|
218
|
-
- `console.warn`
|
|
219
|
-
- `console.error`
|
|
195
|
+
- `console.log` -> `info`
|
|
196
|
+
- `console.info` -> `info`
|
|
197
|
+
- `console.warn` -> `warn`
|
|
198
|
+
- `console.error` -> `error`
|
|
220
199
|
|
|
221
|
-
|
|
200
|
+
Original console behavior is preserved, and captured entries flow through the same filtering and
|
|
201
|
+
batching pipeline used by the manual client API.
|
|
222
202
|
|
|
223
|
-
|
|
203
|
+
## Pino Integration
|
|
224
204
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
Logscope does not intercept pino automatically.
|
|
228
|
-
|
|
229
|
-
Instead, it provides an explicit transport:
|
|
205
|
+
Logscope does not intercept pino automatically. Use the explicit transport subpath:
|
|
230
206
|
|
|
231
207
|
```ts
|
|
232
208
|
import pino from 'pino';
|
|
@@ -247,15 +223,17 @@ const logger = pino({
|
|
|
247
223
|
});
|
|
248
224
|
```
|
|
249
225
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
---
|
|
226
|
+
Pino transport notes:
|
|
253
227
|
|
|
254
|
-
|
|
228
|
+
- transport option name remains `endpoint`;
|
|
229
|
+
- `source` is required on the transport surface;
|
|
230
|
+
- pino levels `10/20/30/40/50/60` map to Logscope levels
|
|
231
|
+
`trace/debug/info/warn/error/fatal`;
|
|
232
|
+
- filtering still happens before batching.
|
|
255
233
|
|
|
256
|
-
|
|
234
|
+
## Winston Integration
|
|
257
235
|
|
|
258
|
-
|
|
236
|
+
Logscope does not patch winston globally. Use the explicit transport subpath:
|
|
259
237
|
|
|
260
238
|
```ts
|
|
261
239
|
import { createLogger, format } from 'winston';
|
|
@@ -277,97 +255,61 @@ const logger = createLogger({
|
|
|
277
255
|
});
|
|
278
256
|
```
|
|
279
257
|
|
|
280
|
-
|
|
258
|
+
Winston transport notes:
|
|
281
259
|
|
|
282
|
-
|
|
260
|
+
- transport option name remains `endpoint`;
|
|
261
|
+
- `source` is required on the transport surface;
|
|
262
|
+
- default npm levels map to Logscope levels
|
|
263
|
+
`error/warn/info/info/debug/debug/trace`;
|
|
264
|
+
- filtering still happens before batching.
|
|
283
265
|
|
|
284
|
-
##
|
|
266
|
+
## Ingestion Contract Summary
|
|
285
267
|
|
|
286
|
-
|
|
268
|
+
The SDK sends logs to:
|
|
287
269
|
|
|
288
|
-
```
|
|
270
|
+
```text
|
|
289
271
|
POST /api/logs/ingest
|
|
290
272
|
```
|
|
291
273
|
|
|
292
274
|
Using header:
|
|
293
275
|
|
|
294
|
-
```
|
|
276
|
+
```text
|
|
295
277
|
x-api-key: <LOGSCOPE_API_KEY>
|
|
296
278
|
```
|
|
297
279
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
Transport status handling is classified as:
|
|
280
|
+
Response handling:
|
|
301
281
|
|
|
302
282
|
- `202` -> success
|
|
303
|
-
- `400` / `413` -> drop
|
|
283
|
+
- `400` / `413` -> drop batch
|
|
304
284
|
- `401` -> unauthorized warning path
|
|
305
285
|
- `429` / `500` -> retry with backoff
|
|
306
286
|
- retriable batches are dropped after max retries
|
|
307
287
|
|
|
308
|
-
|
|
288
|
+
## Current Limits And Non-Goals
|
|
309
289
|
|
|
310
|
-
|
|
290
|
+
- Stable `1.0` SDK contract, not a hosted-service SLA promise.
|
|
291
|
+
- No disk persistence or local buffering.
|
|
292
|
+
- No sampling, tracing, or OpenTelemetry surface.
|
|
293
|
+
- No hidden global patching of pino or winston.
|
|
294
|
+
- No synchronous I/O.
|
|
311
295
|
|
|
312
|
-
|
|
296
|
+
## Testing And Build
|
|
313
297
|
|
|
314
|
-
|
|
315
|
-
- Under active development
|
|
316
|
-
- Not production-ready
|
|
317
|
-
- Subject to API changes
|
|
318
|
-
|
|
319
|
-
---
|
|
320
|
-
|
|
321
|
-
## Testing Conventions
|
|
322
|
-
|
|
323
|
-
Unit tests must be co-located with the files they validate.
|
|
324
|
-
|
|
325
|
-
Use either `.test.ts` or `.spec.ts` next to the implementation file, for example:
|
|
326
|
-
|
|
327
|
-
```text
|
|
328
|
-
src/
|
|
329
|
-
dirA/
|
|
330
|
-
file.ts
|
|
331
|
-
file.spec.ts
|
|
332
|
-
dirB/
|
|
333
|
-
otherFile.ts
|
|
334
|
-
otherFile.test.ts
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
Run tests with:
|
|
298
|
+
Run the standard verification flow from a clean checkout:
|
|
338
299
|
|
|
339
300
|
```bash
|
|
301
|
+
npm ci
|
|
340
302
|
npm test
|
|
303
|
+
npm run build
|
|
341
304
|
```
|
|
342
305
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
```bash
|
|
346
|
-
npm run test:coverage
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
---
|
|
306
|
+
Unit tests are co-located with the files they validate and coverage is enforced through Vitest.
|
|
350
307
|
|
|
351
308
|
## Additional Documentation
|
|
352
309
|
|
|
310
|
+
- Stability and change policy: `docs/stable-1.0-policy.md`
|
|
311
|
+
- Stable SDK contract: `docs/compatibility-contract.md`
|
|
312
|
+
- Local development and `npm link` guidance: `docs/local-development.md`
|
|
313
|
+
- Release verification checklist: `docs/release-verification.md`
|
|
353
314
|
- Hardening and coverage matrix: `docs/hardening-and-testing.md`
|
|
354
315
|
- Formatting and lint workflow: `docs/linting.md`
|
|
355
|
-
|
|
356
|
-
## Local usage with `npm link`
|
|
357
|
-
|
|
358
|
-
To run the package locally in other repositories, use `npm link`:
|
|
359
|
-
|
|
360
|
-
Steps:
|
|
361
|
-
|
|
362
|
-
1. In this repository:
|
|
363
|
-
|
|
364
|
-
```
|
|
365
|
-
npm link
|
|
366
|
-
npm run build -- --watch
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
2. In the consuming repository:
|
|
370
|
-
|
|
371
|
-
```
|
|
372
|
-
npm link @logscopeai/logscope
|
|
373
|
-
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-logscope-client.js","sourceRoot":"","sources":["../../src/client/create-logscope-client.ts"],"names":[],"mappings":";;;AAAA,gEAAqF;AAErF,2DAGiC;AACjC,mDAAqF;AACrF,mEAAqE;AACrE,gFAA2E;AAM3E,+CAAiD;AAEjD,MAAM,4BAA4B,GAChC,mFAAmF,CAAC;AACtF,MAAM,+BAA+B,
|
|
1
|
+
{"version":3,"file":"create-logscope-client.js","sourceRoot":"","sources":["../../src/client/create-logscope-client.ts"],"names":[],"mappings":";;;AAAA,gEAAqF;AAErF,2DAGiC;AACjC,mDAAqF;AACrF,mEAAqE;AACrE,gFAA2E;AAM3E,+CAAiD;AAEjD,MAAM,4BAA4B,GAChC,mFAAmF,CAAC;AACtF,MAAM,+BAA+B,GAAG,yDAAyD,CAAC;AAqBlG,MAAM,kBAAkB,GAAG,GAAqB,EAAE;IAChD,OAAO;QACL,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;QACjB,QAAQ,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;QACxB,IAAI,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;KACrB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,GAAqC,EAAE;IACvE,MAAM,SAAS,GAAc,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,6CAAoB,EAAC,KAAK,CAAC,CAAC;IAEpE,OAAO;QACL,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE,CACxB,IAAA,iCAAsB,EAAC;YACrB,QAAQ,EAAE,KAAK,CAAC,gBAAgB;YAChC,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,SAAS;YACT,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,YAAY;YAC9C,eAAe,EAAE,KAAK,CAAC,aAAa,CAAC,eAAe;YACpD,WAAW,EAAE,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AAA,4BAA4B,gCA0EvC;AAEK,MAAM,oBAAoB,GAAG,CAAC,MAAsB,EAAkB,EAAE;IAC7E,OAAO,IAAA,oCAA4B,EAAC,MAAM,EAAE,yBAAyB,EAAE,CAAC,CAAC;AAC3E,CAAC,CAAC;AAFW,QAAA,oBAAoB,wBAE/B"}
|
|
@@ -73,14 +73,9 @@ exports.buildInvalidWinstonOptionsWarning = buildInvalidWinstonOptionsWarning;
|
|
|
73
73
|
const guardLogscopeClientConfig = (config) => {
|
|
74
74
|
const apiKey = safeGetProperty(config, 'apiKey');
|
|
75
75
|
const ingestionBaseUrlCandidate = safeGetProperty(config, 'ingestionBaseUrl');
|
|
76
|
-
const endpoint = safeGetProperty(config, 'endpoint');
|
|
77
76
|
const ingestionBaseUrl = isNonEmptyString(ingestionBaseUrlCandidate)
|
|
78
77
|
? ingestionBaseUrlCandidate
|
|
79
|
-
:
|
|
80
|
-
? endpoint
|
|
81
|
-
: constants_1.DEFAULT_INGESTION_BASE_URL;
|
|
82
|
-
const context = safeGetProperty(config, 'context');
|
|
83
|
-
const source = safeGetProperty(context, 'source');
|
|
78
|
+
: constants_1.DEFAULT_INGESTION_BASE_URL;
|
|
84
79
|
const captureConsole = safeGetProperty(config, 'captureConsole') === true;
|
|
85
80
|
const logFilter = normalizeLogFilter(safeGetProperty(config, 'logFilter'));
|
|
86
81
|
const runtimeConfig = (0, runtime_config_1.resolveRuntimeConfig)(normalizeRuntimeOverrides(safeGetProperty(config, 'runtime')));
|
|
@@ -92,7 +87,7 @@ const guardLogscopeClientConfig = (config) => {
|
|
|
92
87
|
isValid: invalidFields.length === 0,
|
|
93
88
|
apiKey: isNonEmptyString(apiKey) ? apiKey : '',
|
|
94
89
|
ingestionBaseUrl,
|
|
95
|
-
source:
|
|
90
|
+
source: constants_1.SAFE_FALLBACK_SOURCE,
|
|
96
91
|
captureConsole,
|
|
97
92
|
logFilter,
|
|
98
93
|
runtimeConfig,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{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C,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;QACpD,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,gCAAoB;QAChE,eAAe,EAAE,OAAO,oBAAoB,KAAK,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS;QAC5F,WAAW,EAAE,oBAAoB,CAAC,gBAAgB,CAAC;QACnD,SAAS;QACT,aAAa;KACd,CAAC;AACJ,CAAC,CAAC;AAhCW,QAAA,4BAA4B,gCAgCvC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export declare const METADATA_PRIMITIVE_VALUE_KEY = "value";
|
|
|
4
4
|
export declare const MAX_MESSAGE_LENGTH = 2048;
|
|
5
5
|
export declare const MAX_METADATA_BYTES = 2048;
|
|
6
6
|
export declare const SAFE_FALLBACK_SOURCE = "unknown";
|
|
7
|
-
export declare const DEFAULT_INGESTION_BASE_URL = "https://ingestion.logscopeai.com";
|
|
7
|
+
export declare const DEFAULT_INGESTION_BASE_URL = "https://dev.ingestion.logscopeai.com";
|
package/dist/constants.js
CHANGED
|
@@ -13,5 +13,5 @@ exports.METADATA_PRIMITIVE_VALUE_KEY = 'value';
|
|
|
13
13
|
exports.MAX_MESSAGE_LENGTH = 2_048;
|
|
14
14
|
exports.MAX_METADATA_BYTES = 2_048;
|
|
15
15
|
exports.SAFE_FALLBACK_SOURCE = 'unknown';
|
|
16
|
-
exports.DEFAULT_INGESTION_BASE_URL = 'https://ingestion.logscopeai.com';
|
|
16
|
+
exports.DEFAULT_INGESTION_BASE_URL = 'https://dev.ingestion.logscopeai.com';
|
|
17
17
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAA4B;IACjD,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,OAAO;CACR,CAAC;AAEW,QAAA,4BAA4B,GAAG,OAAO,CAAC;AACvC,QAAA,kBAAkB,GAAG,KAAK,CAAC;AAC3B,QAAA,kBAAkB,GAAG,KAAK,CAAC;AAC3B,QAAA,oBAAoB,GAAG,SAAS,CAAC;AACjC,QAAA,0BAA0B,GAAG,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAA4B;IACjD,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,OAAO;CACR,CAAC;AAEW,QAAA,4BAA4B,GAAG,OAAO,CAAC;AACvC,QAAA,kBAAkB,GAAG,KAAK,CAAC;AAC3B,QAAA,kBAAkB,GAAG,KAAK,CAAC;AAC3B,QAAA,oBAAoB,GAAG,SAAS,CAAC;AACjC,QAAA,0BAA0B,GAAG,sCAAsC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './constants';
|
|
2
|
-
export { createLogscopeClient } from './client/create-logscope-client';
|
|
3
2
|
export { Logscope } from './logscope';
|
|
4
3
|
export { normalizeLog, type NormalizeLogInput, type NormalizeLogOptions, } from './normalization/normalize-log';
|
|
5
4
|
export * from './types';
|
package/dist/index.js
CHANGED
|
@@ -14,10 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.normalizeLog = exports.Logscope =
|
|
17
|
+
exports.normalizeLog = exports.Logscope = void 0;
|
|
18
18
|
__exportStar(require("./constants"), exports);
|
|
19
|
-
var create_logscope_client_1 = require("./client/create-logscope-client");
|
|
20
|
-
Object.defineProperty(exports, "createLogscopeClient", { enumerable: true, get: function () { return create_logscope_client_1.createLogscopeClient; } });
|
|
21
19
|
var logscope_1 = require("./logscope");
|
|
22
20
|
Object.defineProperty(exports, "Logscope", { enumerable: true, get: function () { return logscope_1.Logscope; } });
|
|
23
21
|
var normalize_log_1 = require("./normalization/normalize-log");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,+DAIuC;AAHrC,6GAAA,YAAY,OAAA;AAId,0CAAwB"}
|
package/dist/logscope.js
CHANGED
|
@@ -2,26 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Logscope = void 0;
|
|
4
4
|
const create_logscope_client_1 = require("./client/create-logscope-client");
|
|
5
|
-
const constants_1 = require("./constants");
|
|
6
5
|
const resolveApiKey = (config) => {
|
|
7
6
|
return typeof config?.apiKey === 'string' ? config.apiKey : '';
|
|
8
7
|
};
|
|
9
|
-
const toNonEmptyString = (value) => {
|
|
10
|
-
if (typeof value !== 'string') {
|
|
11
|
-
return undefined;
|
|
12
|
-
}
|
|
13
|
-
return value.trim().length > 0 ? value : undefined;
|
|
14
|
-
};
|
|
15
8
|
const resolveIngestionBaseUrl = (config) => {
|
|
16
|
-
|
|
17
|
-
const endpoint = toNonEmptyString(config?.endpoint);
|
|
18
|
-
return ingestionBaseUrl ?? endpoint ?? constants_1.DEFAULT_INGESTION_BASE_URL;
|
|
19
|
-
};
|
|
20
|
-
const resolveSource = (config) => {
|
|
21
|
-
if (typeof config?.context?.source === 'string') {
|
|
22
|
-
return config.context.source;
|
|
23
|
-
}
|
|
24
|
-
return constants_1.SAFE_FALLBACK_SOURCE;
|
|
9
|
+
return typeof config?.ingestionBaseUrl === 'string' ? config.ingestionBaseUrl : undefined;
|
|
25
10
|
};
|
|
26
11
|
class Logscope {
|
|
27
12
|
client;
|
|
@@ -30,9 +15,6 @@ class Logscope {
|
|
|
30
15
|
apiKey: resolveApiKey(config),
|
|
31
16
|
ingestionBaseUrl: resolveIngestionBaseUrl(config),
|
|
32
17
|
captureConsole: config?.captureConsole === true,
|
|
33
|
-
context: {
|
|
34
|
-
source: resolveSource(config),
|
|
35
|
-
},
|
|
36
18
|
logFilter: config?.logFilter,
|
|
37
19
|
runtime: config?.runtime,
|
|
38
20
|
};
|
package/dist/logscope.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logscope.js","sourceRoot":"","sources":["../src/logscope.ts"],"names":[],"mappings":";;;AAAA,4EAAuE;
|
|
1
|
+
{"version":3,"file":"logscope.js","sourceRoot":"","sources":["../src/logscope.ts"],"names":[],"mappings":";;;AAAA,4EAAuE;AAGvE,MAAM,aAAa,GAAG,CAAC,MAA0B,EAAU,EAAE;IAC3D,OAAO,OAAO,MAAM,EAAE,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AACjE,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,CAAC,MAA0B,EAAsB,EAAE;IACjF,OAAO,OAAO,MAAM,EAAE,gBAAgB,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5F,CAAC,CAAC;AAEF,MAAa,QAAQ;IACF,MAAM,CAAiB;IAExC,YAAY,MAA0B;QACpC,MAAM,cAAc,GAAmB;YACrC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC;YAC7B,gBAAgB,EAAE,uBAAuB,CAAC,MAAM,CAAC;YACjD,cAAc,EAAE,MAAM,EAAE,cAAc,KAAK,IAAI;YAC/C,SAAS,EAAE,MAAM,EAAE,SAAS;YAC5B,OAAO,EAAE,MAAM,EAAE,OAAO;SACzB,CAAC;QAEF,IAAI,CAAC,MAAM,GAAG,IAAA,6CAAoB,EAAC,cAAc,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,QAAkB;QACvC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,QAAkB;QACvC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,QAAkB;QACtC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,QAAkB;QACtC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,QAAkB;QACvC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,QAAkB;QACvC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;CACF;AAtCD,4BAsCC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -9,43 +9,14 @@ export interface LogscopeRuntimeConfig {
|
|
|
9
9
|
retryBaseDelayMs?: number;
|
|
10
10
|
retryMaxDelayMs?: number;
|
|
11
11
|
}
|
|
12
|
-
interface
|
|
13
|
-
apiKey: string;
|
|
14
|
-
captureConsole?: boolean;
|
|
15
|
-
context?: {
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated Source input is optional and falls back safely when omitted.
|
|
18
|
-
*/
|
|
19
|
-
source?: string;
|
|
20
|
-
};
|
|
21
|
-
logFilter?: LogFilterConfig;
|
|
22
|
-
runtime?: LogscopeRuntimeConfig;
|
|
23
|
-
}
|
|
24
|
-
export interface LogscopeInitConfig {
|
|
12
|
+
export interface LogscopeConfig {
|
|
25
13
|
apiKey: string;
|
|
26
14
|
ingestionBaseUrl?: string;
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated Use ingestionBaseUrl instead.
|
|
29
|
-
*/
|
|
30
|
-
endpoint?: string;
|
|
31
15
|
captureConsole?: boolean;
|
|
32
|
-
context?: {
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated Source input is optional and falls back safely when omitted.
|
|
35
|
-
*/
|
|
36
|
-
source?: string;
|
|
37
|
-
};
|
|
38
16
|
logFilter?: LogFilterConfig;
|
|
39
17
|
runtime?: LogscopeRuntimeConfig;
|
|
40
18
|
}
|
|
41
|
-
|
|
42
|
-
ingestionBaseUrl?: string;
|
|
43
|
-
/**
|
|
44
|
-
* @deprecated Use ingestionBaseUrl instead.
|
|
45
|
-
*/
|
|
46
|
-
endpoint?: string;
|
|
47
|
-
}
|
|
48
|
-
export type LogscopeConfig = LogscopeConfigBase & LogscopeIngestionTarget;
|
|
19
|
+
export type LogscopeInitConfig = LogscopeConfig;
|
|
49
20
|
export interface LogscopeClient {
|
|
50
21
|
trace(message: string, metadata?: unknown): void;
|
|
51
22
|
debug(message: string, metadata?: unknown): void;
|
|
@@ -66,4 +37,3 @@ export interface IngestionLogEntry {
|
|
|
66
37
|
message: string;
|
|
67
38
|
metadata?: Record<string, unknown>;
|
|
68
39
|
}
|
|
69
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/winston/transport.ts"],"names":[],"mappings":";;;;;;AAAA,0EAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","s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AAE,CAAC;IAC3B,CAAC;IAEQ,MAAM,CAAC,QAAwC;QACtD,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;YACpC,QAAQ,EAAE,CAAC;QACb,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,YAAY;QAClB,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC,WAAW,CAAC;QAC1B,CAAC;QAED,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACxC,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF;AAEM,MAAM,8BAA8B,GAAG,CAC5C,OAAwC,EACxC,YAA0C,EACzB,EAAE;IACnB,OAAO,IAAI,8BAA8B,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACnE,CAAC,CAAC;AALW,QAAA,8BAA8B,kCAKzC;AAEK,MAAM,sBAAsB,GAAG,CACpC,OAAwC,EACvB,EAAE;IACnB,OAAO,IAAA,sCAA8B,EAAC,OAAO,EAAE,yBAAyB,EAAE,CAAC,CAAC;AAC9E,CAAC,CAAC;AAJW,QAAA,sBAAsB,0BAIjC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logscopeai/logscope",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Stable 1.0 Node.js SDK for sending application logs to the Logscope ingestion API.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"test": "vitest run --coverage",
|
|
31
31
|
"test:coverage": "vitest run --coverage",
|
|
32
32
|
"test:watch": "vitest",
|
|
33
|
+
"prepare": "husky install",
|
|
33
34
|
"format": "prettier --config .prettierrc --write .",
|
|
34
35
|
"format:check": "prettier --config .prettierrc --check ."
|
|
35
36
|
},
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@types/node": "^22.10.2",
|
|
57
58
|
"@vitest/coverage-v8": "^2.1.8",
|
|
59
|
+
"husky": "^9.1.7",
|
|
58
60
|
"lint-staged": "^15.4.3",
|
|
59
61
|
"prettier": "^3.4.2",
|
|
60
62
|
"typescript": "^5.7.2",
|
|
@@ -62,7 +64,9 @@
|
|
|
62
64
|
"winston": "^3.19.0"
|
|
63
65
|
},
|
|
64
66
|
"lint-staged": {
|
|
65
|
-
"*.{ts,js,tsx,jsx,html,css,scss,json,md}":
|
|
67
|
+
"*.{ts,js,tsx,jsx,html,css,scss,json,md}": [
|
|
68
|
+
"npx prettier --config .prettierrc --write"
|
|
69
|
+
]
|
|
66
70
|
},
|
|
67
71
|
"engines": {
|
|
68
72
|
"node": ">=20"
|