@reproapp/node-sdk 0.0.46 → 0.0.48
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.ts +16 -3
- package/dist/index.js +327 -159
- package/dist/ingest/client.js +11 -0
- package/dist/privacy.d.ts +1 -0
- package/dist/privacy.js +306 -7
- package/dist/semantic-serialization.d.ts +9 -0
- package/dist/semantic-serialization.js +171 -0
- package/package.json +3 -3
- package/src/index.ts +513 -144
- package/src/ingest/client.ts +13 -0
- package/src/privacy.ts +409 -7
- package/src/semantic-serialization.ts +182 -0
- package/test/content-addressed-mongodb.testcontainers.test.js +348 -0
- package/test/content-addressed-trace-values.test.js +264 -0
- package/test/fixtures/semantic-serialization-trace-controller.js +85 -0
- package/test/fixtures/semantic-serialization-trace-server.js +19 -0
- package/test/ingest-high-priority-fairness.test.js +76 -0
- package/test/policy-capture-attestation.test.js +234 -0
- package/test/policy-session-completion.testcontainers.test.js +271 -0
- package/test/privacy-policy-index.test.js +194 -0
- package/test/sdk-background-timeout-isolation.test.js +39 -0
- package/test/semantic-serialization-trace.test.js +152 -0
- package/test/semantic-serialization.test.js +229 -0
- package/test/session-storage-budget.test.js +298 -0
- package/test/trace-batch-size.test.js +37 -0
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ import type { Request, Response, NextFunction } from 'express';
|
|
|
27
27
|
import type { Schema } from 'mongoose';
|
|
28
28
|
import { type IngestClientConfig } from './ingest/client';
|
|
29
29
|
import { type NormalizedRuntimePrivacyPolicy, type RuntimePrivacyConfig, type RuntimePrivacyDbContext, type RuntimePrivacySurface } from './privacy';
|
|
30
|
+
import { projectSemanticInfrastructureValue } from './semantic-serialization';
|
|
30
31
|
type SpanContext = {
|
|
31
32
|
traceId: string | null;
|
|
32
33
|
spanId: string | number | null;
|
|
@@ -87,7 +88,7 @@ type PendingTraceEventRecord = TraceEventRecord & {
|
|
|
87
88
|
__reproTraceValueEntries?: TraceValueBatchEntry[];
|
|
88
89
|
};
|
|
89
90
|
type TraceValueCaptureRef = {
|
|
90
|
-
status: 'stored' | 'truncated-for-storage' | 'skipped-non-meaningful';
|
|
91
|
+
status: 'stored' | 'truncated-for-storage' | 'skipped-non-meaningful' | 'failed-policy';
|
|
91
92
|
valueId?: string;
|
|
92
93
|
projectedKind?: string;
|
|
93
94
|
};
|
|
@@ -106,6 +107,7 @@ type TraceValueBatchEntry = {
|
|
|
106
107
|
eventIndex?: number;
|
|
107
108
|
};
|
|
108
109
|
type TraceMaterializationConfig = {
|
|
110
|
+
tenantId: string;
|
|
109
111
|
appId: string;
|
|
110
112
|
appSecret?: string;
|
|
111
113
|
appName?: string;
|
|
@@ -118,6 +120,7 @@ type TraceMaterializationWorkerPayload = {
|
|
|
118
120
|
masking: NormalizedMaskingConfig | null;
|
|
119
121
|
privacy: NormalizedRuntimePrivacyPolicy | null;
|
|
120
122
|
fullValueCaptureEnabled: boolean;
|
|
123
|
+
valueNamespace?: string;
|
|
121
124
|
};
|
|
122
125
|
export type HeaderRule = string | RegExp;
|
|
123
126
|
export type HeaderCaptureOptions = {
|
|
@@ -287,6 +290,15 @@ type RequestCaptureScopeState = {
|
|
|
287
290
|
traceBatchCount: number;
|
|
288
291
|
dbChangeCount: number;
|
|
289
292
|
emailEventCount: number;
|
|
293
|
+
captureFailures: Array<{
|
|
294
|
+
stage: string;
|
|
295
|
+
target: string;
|
|
296
|
+
reason: string;
|
|
297
|
+
}>;
|
|
298
|
+
privacyMode: 'policy' | 'fallback' | 'raw';
|
|
299
|
+
privacyPolicyFingerprint?: string;
|
|
300
|
+
privacyStatementCount: number;
|
|
301
|
+
emittedValueDefinitionIds: Set<string>;
|
|
290
302
|
};
|
|
291
303
|
type BackendLiveTimingConfig = {
|
|
292
304
|
sessionMaxDurationMs: number;
|
|
@@ -324,9 +336,9 @@ type InlinePrivacyMaterializationResult = {
|
|
|
324
336
|
limit?: number;
|
|
325
337
|
};
|
|
326
338
|
};
|
|
327
|
-
declare function materializeInlinePrivacyValueAsync(target: RuntimePrivacySurface, value: any, cfg: ReproMiddlewareConfig, req: MaskRequestContext, trace: TraceEventForFilter | null, masking: NormalizedMaskingConfig | null, privacy: NormalizedRuntimePrivacyPolicy | null, db?: RuntimePrivacyDbContext | null): Promise<InlinePrivacyMaterializationResult>;
|
|
339
|
+
declare function materializeInlinePrivacyValueAsync(target: RuntimePrivacySurface, value: any, cfg: ReproMiddlewareConfig, req: MaskRequestContext, trace: TraceEventForFilter | null, masking: NormalizedMaskingConfig | null, privacy: NormalizedRuntimePrivacyPolicy | null, db?: RuntimePrivacyDbContext | null, captureScope?: RequestCaptureScopeState | null): Promise<InlinePrivacyMaterializationResult>;
|
|
328
340
|
declare function getEventTraceValueEntries(event: TraceEventRecord | PendingTraceEventRecord): TraceValueBatchEntry[] | undefined;
|
|
329
|
-
declare function estimateTraceBatchSerializedBytes(batch: TraceEventRecord[], requestRid: string, actionId: string | null | undefined, batchIndex: number): number;
|
|
341
|
+
declare function estimateTraceBatchSerializedBytes(batch: TraceEventRecord[], requestRid: string, actionId: string | null | undefined, batchIndex: number, previouslyEmittedValueIds?: ReadonlySet<string>): number;
|
|
330
342
|
declare function chunkTraceEventsForTransport(events: TraceEventRecord[], requestRid: string, actionId: string | null | undefined): TraceEventRecord[][];
|
|
331
343
|
export type ReproMiddlewareConfig = IngestClientConfig & {
|
|
332
344
|
/** API base used for backend-owned live session documents. Defaults to REPRO_API_BASE_URL/REPRO_API_BASE/privacy.apiBase. */
|
|
@@ -483,6 +495,7 @@ export declare const __reproTestHooks: {
|
|
|
483
495
|
estimateTraceBatchSerializedBytesForTest: typeof estimateTraceBatchSerializedBytes;
|
|
484
496
|
sanitizeTraceValueForPrivacyForTest: typeof sanitizeTraceValueForPrivacy;
|
|
485
497
|
sanitizeMaterializedTraceValueForTest: typeof sanitizeMaterializedTraceValue;
|
|
498
|
+
projectSemanticInfrastructureValueForTest: typeof projectSemanticInfrastructureValue;
|
|
486
499
|
getEventTraceValueEntriesForTest: typeof getEventTraceValueEntries;
|
|
487
500
|
};
|
|
488
501
|
export {};
|